incubator-rat-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r776105 - in /incubator/rat/main/trunk/apache-rat-core/src: main/java/org/apache/rat/document/ test/java/org/apache/rat/document/ test/java/org/apache/rat/test/utils/
Date Mon, 18 May 2009 21:36:54 GMT
Author: rdonkin
Date: Mon May 18 21:36:53 2009
New Revision: 776105

URL: http://svn.apache.org/viewvc?rev=776105&view=rev
Log:
Reduce complexity

Removed:
    incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/DocumentUtils.java
    incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/document/DocumentUtilsTest.java
Modified:
    incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/ToNameTransformer.java
    incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/test/utils/RATCase.java

Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/ToNameTransformer.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/ToNameTransformer.java?rev=776105&r1=776104&r2=776105&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/ToNameTransformer.java
(original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/document/ToNameTransformer.java
Mon May 18 21:36:53 2009
@@ -20,8 +20,14 @@
 
 import org.apache.commons.collections.Transformer;
 
-class ToNameTransformer implements Transformer {
+public class ToNameTransformer implements Transformer {
 
+    private static final Transformer TO_NAME_TRANSFORMER = new ToNameTransformer();
+    
+    public static final Transformer toNameTransformer() {
+        return TO_NAME_TRANSFORMER;
+    }
+    
     public Object transform(Object subject) {
         Object result = null;
         if (subject != null && subject instanceof IResource) {

Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/test/utils/RATCase.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/test/utils/RATCase.java?rev=776105&r1=776104&r2=776105&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/test/utils/RATCase.java
(original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/test/utils/RATCase.java
Mon May 18 21:36:53 2009
@@ -26,16 +26,16 @@
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.IteratorUtils;
 
-import org.apache.rat.document.DocumentUtils;
 import org.apache.rat.document.IDocument;
 import org.apache.rat.document.IDocumentCollection;
+import org.apache.rat.document.ToNameTransformer;
 
 public abstract class RATCase extends TestCase {
 
     protected void checkDummyJar(IDocumentCollection collection) {
         assertNotNull(collection);
         Collection documents = IteratorUtils.toList(collection.documentIterator());
-        CollectionUtils.transform(documents, DocumentUtils.toNameTransformer());
+        CollectionUtils.transform(documents, ToNameTransformer.toNameTransformer());
         assertEquals("Six documents in the jar", 6, documents.size());
         assertTrue("Document names", documents.contains("Image.png"));
         assertTrue("Document names", documents.contains("LICENSE"));



Mime
View raw message