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



Author: walters
Date: Wed Sep 17 18:26:36 2008
New Revision: 57
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=57&view=rev

Log:
Blacklist ref/unref methods in subclasses of GObject


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	Wed Sep 17 18:26:36 2008
@@ -118,9 +118,17 @@
 import com.sun.jna.ptr.PointerByReference;
 import com.sun.jna.ptr.ShortByReference;
 
+ SuppressWarnings("serial")
 public class CodeFactory {
 	
 	private static final Logger logger = Logger.getLogger("org.gnome.gir.Compiler");
+	
+	private static final Set<String> GOBJECT_METHOD_BLACKLIST = new HashSet<String>() {
+		{
+			add("ref");
+			add("unref");
+		}
+	};
 
 	public static Type toJava(TypeTag tag) {
 		if (tag == TypeTag.LONG || tag == TypeTag.ULONG ||
@@ -1091,9 +1099,11 @@
 			boolean isConstructor = (fi.getFlags() & FunctionInfoFlags.IS_CONSTRUCTOR) != 0;
 			if (isConstructor)
 				continue;
+			if (GOBJECT_METHOD_BLACKLIST.contains(fi.getName()))
+				continue;
 			CallableCompilationContext ctx = tryCompileCallable(fi, sigs);
 			if (ctx == null)
-				continue;			
+				continue;
 			writeCallable(ACC_PUBLIC, compilation, fi, ctx);
 		}
 		for (InterfaceInfo iface : giInterfaces) {



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