aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-04-19 17:34:04 +0000
committerKenneth Russel <[email protected]>2008-04-19 17:34:04 +0000
commitc047af44ab42520ee1a4d9911d5e3bc72dbf884a (patch)
tree4d51ce92f3a0972b36e1f7af788ee0c30d934ed8 /src
parentcb0b5d8b93e7ca266707f2256ca4d4a555938ecd (diff)
Fixed Issue 6: unqualified class names in generated java code
Applied and expanded patch from user tck to fully qualify all references to New I/O classes in generated code. Tested by removing Import of java.nio.* from JOGL and JOAL; required modification of the custom Java code for those packages, but otherwise working well. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@73 a78bb65f-1512-4460-ba86-f6dc96a7bf27
Diffstat (limited to 'src')
-rw-r--r--src/java/com/sun/gluegen/JavaEmitter.java8
-rw-r--r--src/java/com/sun/gluegen/JavaMethodBindingEmitter.java18
-rwxr-xr-xsrc/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java4
3 files changed, 15 insertions, 15 deletions
diff --git a/src/java/com/sun/gluegen/JavaEmitter.java b/src/java/com/sun/gluegen/JavaEmitter.java
index bcda048..48964b0 100644
--- a/src/java/com/sun/gluegen/JavaEmitter.java
+++ b/src/java/com/sun/gluegen/JavaEmitter.java
@@ -821,7 +821,7 @@ public class JavaEmitter implements GlueEmitter {
writer.println(" return create(BufferFactory.newDirectByteBuffer(size()));");
writer.println(" }");
writer.println();
- writer.println(" public static " + containingTypeName + " create(ByteBuffer buf) {");
+ writer.println(" public static " + containingTypeName + " create(java.nio.ByteBuffer buf) {");
writer.println(" if (CPU.is32Bit()) {");
writer.println(" return new " + containingTypeName + "32(buf);");
writer.println(" } else {");
@@ -829,15 +829,15 @@ public class JavaEmitter implements GlueEmitter {
writer.println(" }");
writer.println(" }");
writer.println();
- writer.println(" " + containingTypeName + "(ByteBuffer buf) {");
+ writer.println(" " + containingTypeName + "(java.nio.ByteBuffer buf) {");
writer.println(" accessor = new StructAccessor(buf);");
writer.println(" }");
writer.println();
- writer.println(" public ByteBuffer getBuffer() {");
+ writer.println(" public java.nio.ByteBuffer getBuffer() {");
writer.println(" return accessor.getBuffer();");
writer.println(" }");
} else {
- writer.println(" " + containingTypeName + suffix + "(ByteBuffer buf) {");
+ writer.println(" " + containingTypeName + suffix + "(java.nio.ByteBuffer buf) {");
writer.println(" super(buf);");
writer.println(" }");
writer.println();
diff --git a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
index 08da5d5..8629371 100644
--- a/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
@@ -464,10 +464,10 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
if (!returnType.isVoid()) {
if (returnType.isCompoundTypeWrapper() ||
returnType.isNIOByteBuffer()) {
- writer.println("ByteBuffer _res;");
+ writer.println("java.nio.ByteBuffer _res;");
needsResultAssignment = true;
} else if (returnType.isArrayOfCompoundTypeWrappers()) {
- writer.println("ByteBuffer[] _res;");
+ writer.println("java.nio.ByteBuffer[] _res;");
needsResultAssignment = true;
} else if ((epilogue != null) && (epilogue.size() > 0)) {
emitReturnType(writer);
@@ -484,9 +484,9 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
}
if (needsResultAssignment) {
- writer.print(" _res = ");
+ writer.print(" _res = ");
} else {
- writer.print(" ");
+ writer.print(" ");
if (!returnType.isVoid()) {
writer.print("return ");
}
@@ -624,9 +624,9 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
String fmt = getReturnedArrayLengthExpression();
writer.println(" if (_res == null) return null;");
if (fmt == null) {
- writer.print(" return " + returnType.getName() + ".create(_res.order(ByteOrder.nativeOrder()))");
+ writer.print(" return " + returnType.getName() + ".create(_res.order(java.nio.ByteOrder.nativeOrder()))");
} else {
- writer.println(" _res.order(ByteOrder.nativeOrder());");
+ writer.println(" _res.order(java.nio.ByteOrder.nativeOrder());");
String expr = new MessageFormat(fmt).format(argumentNameArray());
PointerType cReturnTypePointer = binding.getCReturnType().asPointer();
CompoundType cReturnType = null;
@@ -644,8 +644,8 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
// compound types (rounding up to machine-dependent alignment)
writer.println(" _res.position(_count * " + getReturnTypeString(true) + ".size());");
writer.println(" _res.limit ((1 + _count) * " + getReturnTypeString(true) + ".size());");
- writer.println(" ByteBuffer _tmp = _res.slice();");
- writer.println(" _tmp.order(ByteOrder.nativeOrder());");
+ writer.println(" java.nio.ByteBuffer _tmp = _res.slice();");
+ writer.println(" _tmp.order(java.nio.ByteOrder.nativeOrder());");
writer.println(" _res.position(0);");
writer.println(" _res.limit(_res.capacity());");
writer.println(" _retarray[_count] = " + getReturnTypeString(true) + ".create(_tmp);");
@@ -655,7 +655,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter
writer.println(";");
} else if (returnType.isNIOBuffer()) {
writer.println(" if (_res == null) return null;");
- writer.println(" return _res.order(ByteOrder.nativeOrder());");
+ writer.println(" return _res.order(java.nio.ByteOrder.nativeOrder());");
} else if (returnType.isArrayOfCompoundTypeWrappers()) {
writer.println(" if (_res == null) return null;");
writer.println(" " + getReturnTypeString(false) + " _retarray = new " + getReturnTypeString(true) + "[_res.length];");
diff --git a/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index 71382bf..12a6c0e 100755
--- a/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/java/com/sun/gluegen/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -247,10 +247,10 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
if (!returnType.isVoid()) {
if (returnType.isCompoundTypeWrapper() ||
returnType.isNIOByteBuffer()) {
- writer.println("ByteBuffer _res;");
+ writer.println("java.nio.ByteBuffer _res;");
needsResultAssignment = true;
} else if (returnType.isArrayOfCompoundTypeWrappers()) {
- writer.println("ByteBuffer[] _res;");
+ writer.println("java.nio.ByteBuffer[] _res;");
needsResultAssignment = true;
} else if (returnType.isString() || returnType.isNIOByteBuffer()) {
writer.print(returnType);