summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3/tools/java2wsdl
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 15:37:05 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-02 15:37:05 +0000
commitc30d85f5d1d1ead6e9ad703f87392992e38150ac (patch)
tree71322bd610db5f5dac2b5399c3ef1325cca5d7f5 /branches/sca-java-1.3/tools/java2wsdl
parent4c7b2e5c0549718ed1814edbb1adb8166efe4fca (diff)
Fix for TUSCANY-2444, merged from trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@673421 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.3/tools/java2wsdl')
-rw-r--r--branches/sca-java-1.3/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/branches/sca-java-1.3/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java b/branches/sca-java-1.3/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java
index 218d72c62d..897700ffd9 100644
--- a/branches/sca-java-1.3/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java
+++ b/branches/sca-java-1.3/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('.');