commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r826518 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java
Date Sun, 18 Oct 2009 20:32:40 GMT
Author: bayard
Date: Sun Oct 18 20:32:40 2009
New Revision: 826518

URL: http://svn.apache.org/viewvc?rev=826518&view=rev
Log:
Changing Param to Option. A Parameter is a user supplied value; an Option is a user supplied
choice. LANG-507 related. 

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java?rev=826518&r1=826517&r2=826518&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
Sun Oct 18 20:32:40 2009
@@ -29,18 +29,18 @@
  */
 public class UnicodeUnescaper extends CharSequenceTranslator {
 
-    public static enum PARAM { escapePlus };
+    public static enum OPTION { escapePlus };
 
-    private EnumSet<PARAM> params;
+    private EnumSet<OPTION> options;
 
-    public UnicodeUnescaper(PARAM... params) {
-        if(params.length > 0) {
-            this.params = EnumSet.copyOf(Arrays.asList(params));
+    public UnicodeUnescaper(OPTION... options) {
+        if(options.length > 0) {
+            this.options = EnumSet.copyOf(Arrays.asList(options));
         }
     }
 
-    public boolean isSet(PARAM p) { 
-        return (params == null) ? false : params.contains(p);
+    public boolean isSet(OPTION opt) { 
+        return (options == null) ? false : options.contains(opt);
     }
 
     /**
@@ -58,7 +58,7 @@
                 }
 
                 // consume + symbol in \\u+0045
-                if(isSet(PARAM.escapePlus)) {
+                if(isSet(OPTION.escapePlus)) {
                     if( (index + i < input.length()) && (input.charAt(index +
i) == '+') ) {
                         i++;
                     }

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java?rev=826518&r1=826517&r2=826518&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java
(original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/translate/UnicodeUnescaperTest.java
Sun Oct 18 20:32:40 2009
@@ -36,7 +36,7 @@
             // expected
         }
 
-        uu = new UnicodeUnescaper(UnicodeUnescaper.PARAM.escapePlus);
+        uu = new UnicodeUnescaper(UnicodeUnescaper.OPTION.escapePlus);
         assertEquals("Failed to unescape unicode characters with 'u+' notation", "G", uu.translate(input));
     }
 



Mime
View raw message