You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/11/21 09:42:35 UTC

svn commit: r1204397 - /commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java

Author: simonetripodi
Date: Mon Nov 21 08:42:35 2011
New Revision: 1204397

URL: http://svn.apache.org/viewvc?rev=1204397&view=rev
Log:
code polishing

Modified:
    commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java

Modified: commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java
URL: http://svn.apache.org/viewvc/commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java?rev=1204397&r1=1204396&r2=1204397&view=diff
==============================================================================
--- commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java (original)
+++ commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/filter/ClassNameMatches.java Mon Nov 21 08:42:35 2011
@@ -19,6 +19,9 @@ package org.apache.commons.meiyo.classpa
  * under the License.
  */
 
+import static java.lang.String.format;
+import static java.util.regex.Pattern.compile;
+
 import java.util.regex.Pattern;
 
 /**
@@ -40,7 +43,7 @@ public final class ClassNameMatches
      */
     public ClassNameMatches( String regex )
     {
-        this( Pattern.compile( regex ) );
+        this( compile( regex ) );
     }
 
     /**
@@ -58,7 +61,7 @@ public final class ClassNameMatches
      */
     public boolean matches( Class<?> clazz )
     {
-        return this.pattern.matcher( clazz.getSimpleName() ).matches();
+        return pattern.matcher( clazz.getSimpleName() ).matches();
     }
 
     /**
@@ -67,7 +70,7 @@ public final class ClassNameMatches
     @Override
     public String toString()
     {
-        return String.format( "classNameMatches(%s)", this.pattern.toString() );
+        return format( "classNameMatches(%s)", pattern.toString() );
     }
 
 }