[seam-commits] Seam SVN: r12510 - in modules/remoting/trunk: core/src/main/java/org/jboss/seam/remoting/model and 2 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Fri Apr 16 04:38:30 EDT 2010
Author: shane.bryzak at jboss.com
Date: 2010-04-16 04:38:30 -0400 (Fri, 16 Apr 2010)
New Revision: 12510
Added:
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java
Modified:
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java
modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml
Log:
SEAMREMOTING-3
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/Call.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -17,6 +17,7 @@
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.seam.remoting.annotations.WebRemote;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.ConversionException;
import org.jboss.seam.remoting.wrapper.ConversionScore;
import org.jboss.seam.remoting.wrapper.Wrapper;
@@ -58,7 +59,7 @@
{
Class<?> beanType = Class.forName(beanName);
- Annotation[] q = qualifiers != null && !qualifiers.isEmpty() ?
+ Annotation[] q = qualifiers != null && !Strings.isEmpty(qualifiers) ?
new AnnotationsParser(beanType, qualifiers, beanManager).getAnnotations() :
EMPTY_ANNOTATIONS;
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/ExecutionHandler.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -16,6 +16,7 @@
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.Wrapper;
import org.jboss.weld.conversation.ConversationManager;
import org.slf4j.Logger;
@@ -68,7 +69,7 @@
final Element env = doc.getRootElement();
final RequestContext ctx = new RequestContext(env.element("header"));
- if (ctx.getConversationId() != null && !ctx.getConversationId().isEmpty())
+ if (ctx.getConversationId() != null && !Strings.isEmpty(ctx.getConversationId()))
{
// this is non portable ;/
conversationManager.beginOrRestoreConversation(ctx.getConversationId());
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/Model.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -16,6 +16,7 @@
import org.jboss.seam.remoting.AnnotationsParser;
import org.jboss.seam.remoting.Call;
import org.jboss.seam.remoting.CallContext;
+import org.jboss.seam.remoting.util.Strings;
/**
* Manages a model request
@@ -156,7 +157,7 @@
{
Class<?> beanType = Class.forName(beanName);
- Annotation[] q = qualifiers != null && !qualifiers.isEmpty() ?
+ Annotation[] q = qualifiers != null && !Strings.isEmpty(qualifiers) ?
new AnnotationsParser(beanType, qualifiers, beanManager).getAnnotations() :
Call.EMPTY_ANNOTATIONS;
Modified: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/model/ModelHandler.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -24,6 +24,7 @@
import org.jboss.seam.remoting.MarshalUtils;
import org.jboss.seam.remoting.RequestContext;
import org.jboss.seam.remoting.RequestHandler;
+import org.jboss.seam.remoting.util.Strings;
import org.jboss.seam.remoting.wrapper.BagWrapper;
import org.jboss.seam.remoting.wrapper.BeanWrapper;
import org.jboss.seam.remoting.wrapper.MapWrapper;
@@ -81,7 +82,7 @@
// written it, and non-portable code should be abstracted out
conversationContext = Container.instance().services().get(ContextLifecycle.class).getConversationContext();
- if (ctx.getConversationId() != null && !ctx.getConversationId().isEmpty())
+ if (ctx.getConversationId() != null && !Strings.isEmpty(ctx.getConversationId()))
{
conversationContext.setBeanStore(new ConversationBeanStore(
request.getSession(), false, ctx.getConversationId()));
Added: modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java
===================================================================
--- modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java (rev 0)
+++ modules/remoting/trunk/core/src/main/java/org/jboss/seam/remoting/util/Strings.java 2010-04-16 08:38:30 UTC (rev 12510)
@@ -0,0 +1,22 @@
+package org.jboss.seam.remoting.util;
+
+public class Strings
+{
+ public static boolean isEmpty(String string)
+ {
+ int len;
+ if (string == null || (len = string.length()) == 0)
+ {
+ return true;
+ }
+
+ for (int i = 0; i < len; i++)
+ {
+ if ((Character.isWhitespace(string.charAt(i)) == false))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+}
Modified: modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml
===================================================================
--- modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml 2010-04-16 07:15:06 UTC (rev 12509)
+++ modules/remoting/trunk/examples/helloworld/src/main/webapp/helloworld.xhtml 2010-04-16 08:38:30 UTC (rev 12510)
@@ -1,8 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:s="http://jboss.com/products/seam/taglib">
+ xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
More information about the seam-commits
mailing list