commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r754678 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java
Date Sun, 15 Mar 2009 15:27:50 GMT
Author: sebb
Date: Sun Mar 15 15:27:48 2009
New Revision: 754678

URL: http://svn.apache.org/viewvc?rev=754678&view=rev
Log:
Genericize; add final qualifier to private var

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java?rev=754678&r1=754677&r2=754678&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java Sun Mar 15 15:27:48
2009
@@ -79,7 +79,7 @@
      * Subclasses can add more common patterns if desired.
      * @since 2.0
      */
-    protected static final Map COMMON = new HashMap();
+    protected static final Map<String, CharSet> COMMON = new HashMap<String, CharSet>();
     
     static {
         COMMON.put(null, EMPTY);
@@ -92,7 +92,7 @@
     }
 
     /** The set of CharRange objects. */
-    private Set set = new HashSet();
+    private final Set<CharRange> set = new HashSet<CharRange>();
 
     //-----------------------------------------------------------------------
     /**
@@ -231,7 +231,7 @@
      * @since 2.0
      */
     public CharRange[] getCharRanges() {
-        return (CharRange[]) set.toArray(new CharRange[set.size()]);
+        return set.toArray(new CharRange[set.size()]);
     }
 
     //-----------------------------------------------------------------------
@@ -243,8 +243,8 @@
      * @return <code>true</code> if the set contains the characters
      */
     public boolean contains(char ch) {
-        for (Iterator it = set.iterator(); it.hasNext();) {
-            CharRange range = (CharRange) it.next();
+        for (Iterator<CharRange> it = set.iterator(); it.hasNext();) {
+            CharRange range = it.next();
             if (range.contains(ch)) {
                 return true;
             }



Mime
View raw message