cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [06/30] cxf git commit: CXF-7124 Fix PackageUtils bug
Date Sun, 04 Dec 2016 01:11:48 GMT
CXF-7124 Fix PackageUtils bug


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a43c1eb0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a43c1eb0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a43c1eb0

Branch: refs/heads/CXF-6882.nio
Commit: a43c1eb0034c20399fd6a9371dbe8aa680e2402d
Parents: 970080f
Author: Neal Hu <huxingjiang2649@tops001.com>
Authored: Fri Nov 25 23:59:59 2016 +0800
Committer: Neal Hu <huxingjiang2649@tops001.com>
Committed: Fri Nov 25 23:59:59 2016 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/common/util/PackageUtils.java    | 2 ++
 .../java/org/apache/cxf/common/util/PackageUtilsTest.java     | 7 +++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a43c1eb0/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
index 9ff5510..cd5b306 100644
--- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
@@ -67,6 +67,8 @@ public final class PackageUtils {
             }
             if (j == lParts.size()) {
                 currentParts.add(lParts.get(j - 1).get(i));
+            } else {
+                break;
             }
         }
         StringBuilder sb = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/cxf/blob/a43c1eb0/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
index f4401f6..03ad66d 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
@@ -93,4 +93,11 @@ public class PackageUtilsTest extends Assert {
                     org.apache.cxf.common.jaxb.JAXBContextCache.class));       
         assertEquals("", packageName);
     }
+    @Test
+    public void testSharedPackageNameManyClassesCommonRoot6() {
+        String packageName = PackageUtils.getSharedPackageName(
+            Arrays.asList(org.apache.cxf.bus.spring.BusApplicationContext.class,
+                    org.apache.cxf.configuration.spring.JAXBBeanFactory.class));
+        assertEquals("org.apache.cxf", packageName);
+    }
 }


Mime
View raw message