diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java b/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java index 67304d103f..ada9081668 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/OsgiRegistry.java @@ -307,7 +307,7 @@ public static String bundleEntryPathToClassName(String packagePath, String bundl : packagePath + bundleEntryPath.substring(bundleEntryPath.lastIndexOf('/') + 1); return (normalizedClassNamePath.startsWith("/") ? normalizedClassNamePath.substring(1) : normalizedClassNamePath) - .replace('/', '.').replace(".class", ""); + .replace(".class", "").replace('/', '.'); } /** diff --git a/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java b/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java index f6adc20c80..fe3de0c1b9 100644 --- a/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java +++ b/core-common/src/test/java/org/glassfish/jersey/internal/util/OsgiRegistryTest.java @@ -112,6 +112,12 @@ public void testRootWebInfClassesBundleEntryPathTranslationNoLeadingSlash() { Assert.assertEquals("org.glassfish.jersey.Test", className); } + @Test + public void testDotClassInPackageName() { + String className = OsgiRegistry.bundleEntryPathToClassName("/", "com/classification/Test"); + Assert.assertEquals("com.classification.Test", className); + } + @Test public void testRootWebInfClassesBundleEntryPathEsTranslation() { String className = OsgiRegistry.bundleEntryPathToClassName("es", "/WEB-INF/classes/es/a/Test.class");