tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r1170400 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java
Date Wed, 14 Sep 2011 00:24:02 GMT
Author: hlship
Date: Wed Sep 14 00:24:02 2011
New Revision: 1170400

URL: http://svn.apache.org/viewvc?rev=1170400&view=rev
Log:
TAP5-1649: Allow mapping of classpath asset aliases to a package name of even just a single
term

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java?rev=1170400&r1=1170399&r2=1170400&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentClassResolverImpl.java
Wed Sep 14 00:24:02 2011
@@ -568,7 +568,7 @@ public class ComponentClassResolverImpl 
         if (packageName == null)
             throw new RuntimeException(
                     String.format(
-                            "Package names for library folder '%s' (%s) can not be reduced
to a common base package (of at least two terms).",
+                            "Package names for library folder '%s' (%s) can not be reduced
to a common base package (of at least one term).",
                             folder, InternalUtils.joinSorted(packageNames)));
         return packageName;
     }
@@ -614,7 +614,7 @@ public class ComponentClassResolverImpl 
             }
         }
 
-        if (commonTerms < 2)
+        if (commonTerms <= 1)
             return null;
 
         return commonPackageName.substring(0, commonLength);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java?rev=1170400&r1=1170399&r2=1170400&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ComponentClassResolverImplTest.java
Wed Sep 14 00:24:02 2011
@@ -781,7 +781,7 @@ public class ComponentClassResolverImplT
     @Test
     public void expect_failure_when_no_common_package()
     {
-        List<String> packageNames = CollectionFactory.newList("org.example.app.main",
"org.demo.app.sub");
+        List<String> packageNames = CollectionFactory.newList("org.example.app.main",
"demo.app.sub");
 
         // "org" isn't good enough, we expect at least two terms.
 
@@ -795,7 +795,7 @@ public class ComponentClassResolverImplT
         {
             assertEquals(
                     ex.getMessage(),
-                    "Package names for library folder 'fred' (org.demo.app.sub, org.example.app.main)
can not be reduced to a common base package (of at least two terms).");
+                    "Package names for library folder 'fred' (demo.app.sub, org.example.app.main)
can not be reduced to a common base package (of at least one term).");
         }
 
     }



Mime
View raw message