java-gobject-introspection r77 - trunk/src/org/gnome/gir/compiler



Author: walters
Date: Thu Oct  9 04:14:02 2008
New Revision: 77
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=77&view=rev

Log:
Fix up get invocation


Modified:
   trunk/src/org/gnome/gir/compiler/CodeFactory.java

Modified: trunk/src/org/gnome/gir/compiler/CodeFactory.java
==============================================================================
--- trunk/src/org/gnome/gir/compiler/CodeFactory.java	(original)
+++ trunk/src/org/gnome/gir/compiler/CodeFactory.java	Thu Oct  9 04:14:02 2008
@@ -111,7 +111,6 @@
 
 import com.sun.jna.Function;
 import com.sun.jna.Pointer;
-import com.sun.jna.PointerType;
 import com.sun.jna.ptr.ByteByReference;
 import com.sun.jna.ptr.DoubleByReference;
 import com.sun.jna.ptr.FloatByReference;
@@ -229,7 +228,7 @@
 		if (arg.getDirection() == Direction.IN) {
 			return toJava(arg.getType());
 		} else {
-			return Type.getType(PointerType.class);
+			return toJavaRef(arg.getType().getTag());
 		}
 	}
 	
@@ -251,9 +250,7 @@
 			return Type.getType(DoubleByReference.class);
 		if (t.equals(Type.getType(String.class)) || t.equals(Type.getType(File.class)))
 			return Type.getType(PointerByReference.class);
-		if (t.equals(Type.VOID_TYPE))
-			return Type.getType(Pointer.class);
-		return t;
+		return Type.getType(Pointer.class);
 	}
 	
 	private static Type toTypeBase(TypeTag tag) {
@@ -972,8 +969,8 @@
 					mv.visitLabel(l0);
 					mv.visitVarInsn(ALOAD, 0);
 					mv.visitLdcInsn(prop.getName());
-					mv.visitMethodInsn(INVOKEVIRTUAL, compilation.internalName, "get", "(Ljava/lang/String;)"
-							+ propTypeBox.getDescriptor());
+					mv.visitMethodInsn(INVOKEVIRTUAL, compilation.internalName, "get", 
+							Type.getMethodDescriptor(getType(Object.class), new Type[] { getType(String.class) }));
 					mv.visitTypeInsn(CHECKCAST, propTypeBox.getInternalName());
 					if (propBox != null)
 						mv.visitMethodInsn(INVOKEVIRTUAL, propTypeBox.getInternalName(), type.getClassName() + "Value",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]