Index: bugs/xml/c1470/test-binding.xml
===================================================================
--- bugs/xml/c1470/test-binding.xml (Revision 0)
+++ bugs/xml/c1470/test-binding.xml (Revision 0)
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
Index: bugs/xml/c1470/TestSourceGenerator.java
===================================================================
--- bugs/xml/c1470/TestSourceGenerator.java (Revision 0)
+++ bugs/xml/c1470/TestSourceGenerator.java (Revision 0)
@@ -0,0 +1,19 @@
+package xml.c1470;
+
+import org.exolab.castor.builder.SourceGenerator;
+import org.xml.sax.InputSource;
+
+import junit.framework.TestCase;
+
+public class TestSourceGenerator extends TestCase
+{
+
+ public void testGeneration() throws Exception {
+ SourceGenerator generator = new SourceGenerator();
+ String xmlSchema = getClass().getResource("test.xsd").toExternalForm();
+ InputSource inputSource = new InputSource(xmlSchema);
+ generator.setBinding(new InputSource(getClass().getResource("test-binding.xml").toExternalForm()));
+ generator.setDestDir("d:/dev/workspace-trunk/steven/src/main/java");
+ generator.generateSource(inputSource, "org.exolab.castor.test");
+ }
+}
Index: bugs/xml/c1470/test.xsd
===================================================================
--- bugs/xml/c1470/test.xsd (Revision 0)
+++ bugs/xml/c1470/test.xsd (Revision 0)
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
Index: bugs/xml/c1470/castorbuilder.properties
===================================================================
--- bugs/xml/c1470/castorbuilder.properties (Revision 0)
+++ bugs/xml/c1470/castorbuilder.properties (Revision 0)
@@ -0,0 +1,12 @@
+#
+# Property file for SourceCodeGenerator
+#
+# $Id: castorbuilder.properties 5951 2006-05-30 22:18:48Z bsnyder $
+
+# Set to true if you want the generated source code to contain
+# Extra methods for the collection fields, such as get/set using
+# the collection type in addition to the type-safe array.
+# Set this to true if you want your code to be more compatible
+# with Castor JDO. This is false by default.
+#
+org.exolab.castor.builder.extraCollectionMethods=true
Index: main/java/org/exolab/javasource/JStructure.java
===================================================================
--- main/java/org/exolab/javasource/JStructure.java (Revision 6030)
+++ main/java/org/exolab/javasource/JStructure.java (Arbeitskopie)
@@ -196,7 +196,14 @@
//-- getPackageName
String pkgName = getPackageFromClassName(className);
-
+ String localClassName = className;
+
+ // DAB -- for Java 5.0, remove any Parameterized types here
+ int paramTypeDeclPos = className.indexOf("<");
+ if ( paramTypeDeclPos != -1 ) {
+ localClassName = className.substring(0, paramTypeDeclPos );
+ }
+
if (pkgName != null) {
if (pkgName.equals(this.packageName)) return;
@@ -546,6 +553,11 @@
if (name == null) return false;
+ int beforeTypeName = name.indexOf("<");
+ if (beforeTypeName > 0) {
+ name = name.substring(0, beforeTypeName);
+ }
+
//-- ignore package information, for now
int period = name.lastIndexOf(".");
if (period>0)
Index: main/java/org/exolab/javasource/JMethodSignature.java
===================================================================
--- main/java/org/exolab/javasource/JMethodSignature.java (Revision 6030)
+++ main/java/org/exolab/javasource/JMethodSignature.java (Arbeitskopie)
@@ -384,6 +384,7 @@
sb.append(returnType);
}
else sb.append("void");
+
sb.append(' ');
sb.append(name);
sb.append('(');
Index: main/java/org/exolab/javasource/JClass.java
===================================================================
--- main/java/org/exolab/javasource/JClass.java (Revision 6030)
+++ main/java/org/exolab/javasource/JClass.java (Arbeitskopie)
@@ -540,6 +540,12 @@
Enumeration enumeration = iClass.getImports();
while (enumeration.hasMoreElements()) {
String classname = (String)enumeration.nextElement();
+
+ // DAB - hack to allow Java 5 parameterized types to pass correctly
+ int paramTypeIndex = classname.indexOf("