cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1490346 - in /cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util: PackageUtils.java URIParserUtil.java
Date Thu, 06 Jun 2013 16:32:39 GMT
Author: dkulp
Date: Thu Jun  6 16:32:38 2013
New Revision: 1490346

URL: http://svn.apache.org/r1490346
Log:
Use a common list of keywords

Modified:
    cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/PackageUtils.java
    cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/URIParserUtil.java

Modified: cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/PackageUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/PackageUtils.java?rev=1490346&r1=1490345&r2=1490346&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/PackageUtils.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/PackageUtils.java
Thu Jun  6 16:32:38 2013
@@ -20,25 +20,14 @@
 package org.apache.cxf.common.util;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import java.util.StringTokenizer;
 
+import org.apache.cxf.helpers.JavaUtils;
 
-public final class PackageUtils {
-    
-    private static final Set<String> KEYWORDS = new HashSet<String>(Arrays
-        .asList(new String[] {"abstract", "boolean", "break", "byte", "case", "catch", "char",
"class",
-                              "const", "continue", "default", "do", "double", "else", "extends",
"final",
-                              "finally", "float", "for", "goto", "if", "implements", "import",
"instanceof",
-                              "int", "interface", "long", "native", "new", "package", "private",
"protected",
-                              "public", "return", "short", "static", "strictfp", "super",
"switch",
-                              "synchronized", "this", "throw", "throws", "transient", "try",
"void",
-                              "volatile", "while", "true", "false", "null", "assert", "enum"}));
 
-    
+public final class PackageUtils {
+      
     private PackageUtils() {
         
     }
@@ -178,7 +167,7 @@ public final class PackageUtils {
     }
 
     private static boolean containsReservedKeywords(String token) {
-        return KEYWORDS.contains(token);
+        return JavaUtils.isJavaKeyword(token);
     }
 
     public static String getNamespace(String packageName) {

Modified: cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/URIParserUtil.java?rev=1490346&r1=1490345&r2=1490346&view=diff
==============================================================================
--- cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
(original)
+++ cxf/branches/dkulp-nowsdl4j/api/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
Thu Jun  6 16:32:38 2013
@@ -26,23 +26,13 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 import java.util.StringTokenizer;
 
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.helpers.JavaUtils;
 
 public final class URIParserUtil {
-    private static final Set<String> KEYWORDS = new HashSet<String>(Arrays
-        .asList(new String[] {"abstract", "boolean", "break", "byte", "case", "catch", "char",
"class",
-                              "const", "continue", "default", "do", "double", "else", "extends",
"final",
-                              "finally", "float", "for", "goto", "if", "implements", "import",
"instanceof",
-                              "int", "interface", "long", "native", "new", "package", "private",
"protected",
-                              "public", "return", "short", "static", "strictfp", "super",
"switch",
-                              "synchronized", "this", "throw", "throws", "transient", "try",
"void",
-                              "volatile", "while", "true", "false", "null", "assert", "enum"}));
     private static final String EXCLUDED_CHARS = "<>\"{}|\\^`";
     private static final String HEX_DIGITS = "0123456789abcdef";
 
@@ -223,7 +213,7 @@ public final class URIParserUtil {
     }
 
     public static boolean containsReservedKeywords(String token) {
-        return KEYWORDS.contains(token);
+        return JavaUtils.isJavaKeyword(token);
     }
 
     public static String escapeChars(String s) {



Mime
View raw message