cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nea...@apache.org
Subject cxf git commit: CXF-7124 Fix PackageUtils bug
Date Fri, 25 Nov 2016 16:06:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes c64bf7af4 -> 3c26b6f7d


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/3c26b6f7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3c26b6f7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3c26b6f7

Branch: refs/heads/3.1.x-fixes
Commit: 3c26b6f7da21c619f945d248baf45eed484586dc
Parents: c64bf7a
Author: Neal Hu <huxingjiang2649@tops001.com>
Authored: Fri Nov 25 23:59:59 2016 +0800
Committer: Neal Hu <huxingjiang2649@tops001.com>
Committed: Sat Nov 26 00:05:48 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/3c26b6f7/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/3c26b6f7/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 081df8a..2cbd713 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