diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-02 06:47:40 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-07-02 06:47:40 +0000 |
commit | 8d7cb21ef3c6cf4a39ee77e3358d2eeb129864fe (patch) | |
tree | 6bb016d2eaa7d5254232ffcb735872e94ab8c14c /java/sca/tools/java2wsdl/src | |
parent | 02f18503f2e2707b6ed535929bcd412877512419 (diff) |
Fix for TUSCANY-2444
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/tools/java2wsdl/src')
-rw-r--r-- | java/sca/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/sca/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java b/java/sca/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java index 218d72c62d..897700ffd9 100644 --- a/java/sca/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java +++ b/java/sca/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java @@ -554,14 +554,19 @@ public class SchemaBuilder implements TuscanyJava2WSDLConstants { this.elementFormDefault = elementFormDefault; } - + private static String getPackageName(Class<?> cls) { + String name = cls.getName(); + int index = name.lastIndexOf('.'); + return index == -1 ? "" : name.substring(0, index); + } + /** * Recognize the pattern of generated SDO type names vs. SDO factory names. * E.g. SDO class: test.sca.w2j.gen.Company will be associated with * SDO factory: test.sca.w2j.gen.GenFactory */ private void detectAndRegisterFactory(Class sdoClass) { - String pkgName = sdoClass.getPackage().getName(); + String pkgName = getPackageName(sdoClass); // Find last segment, e.g. from 'test.sca.w2j.gen' produce 'gen'. int lastDot = pkgName.lastIndexOf('.'); |