You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/05/21 20:59:47 UTC

svn commit: r540238 - /incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java

Author: schor
Date: Mon May 21 11:59:46 2007
New Revision: 540238

URL: http://svn.apache.org/viewvc?view=rev&rev=540238
Log:
[UIMA-409] Findbugs: move namespace separator as String into private final static field

Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java?view=diff&rev=540238&r1=540237&r2=540238
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemUtils.java Mon May 21 11:59:46 2007
@@ -268,6 +268,8 @@
     return (Character.isLetter(c) || Character.isDigit(c) || (c == '_'));
   }
 
+  static private final String NAMESPACE_SEPARATOR_AS_STRING = "" + TypeSystem.NAMESPACE_SEPARATOR;
+
   /**
    * Check if <code>name</code> is a possible type name. Does not check if this type actually
    * exists!
@@ -281,8 +283,7 @@
     // space
     // boundaries. We need to see the delimiters to make sure there are no
     // gratuitous delimiters at the beginning or the end.
-    String separatorString = "" + TypeSystem.NAMESPACE_SEPARATOR;
-    StringTokenizer tok = new StringTokenizer(name, separatorString, true);
+    StringTokenizer tok = new StringTokenizer(name, NAMESPACE_SEPARATOR_AS_STRING, true);
     // Loop over the tokens and check that every item is an identifier.
     while (tok.hasMoreTokens()) {
       // Any subsequence must start with an identifier.
@@ -291,7 +292,7 @@
       }
       // If there is a next token, it must be a separator.
       if (tok.hasMoreTokens()) {
-        if (!tok.nextToken().equals(separatorString)) {
+        if (!tok.nextToken().equals(NAMESPACE_SEPARATOR_AS_STRING)) {
           return false;
         }
         // A sequence can not end in a separator.