java-gobject-introspection r37 - trunk/src/org/gnome/gir/gobject



Author: walters
Date: Sat Sep  6 15:44:57 2008
New Revision: 37
URL: http://svn.gnome.org/viewvc/java-gobject-introspection?rev=37&view=rev

Log:
Nuke useless String TypeConverter; we don't use annotations


Modified:
   trunk/src/org/gnome/gir/gobject/GTypeMapper.java

Modified: trunk/src/org/gnome/gir/gobject/GTypeMapper.java
==============================================================================
--- trunk/src/org/gnome/gir/gobject/GTypeMapper.java	(original)
+++ trunk/src/org/gnome/gir/gobject/GTypeMapper.java	Sat Sep  6 15:44:57 2008
@@ -178,36 +178,6 @@
         }
     };
 
-    private TypeConverter stringConverter = new TypeConverter() {
-
-        public Object fromNative(Object result, FromNativeContext context) {
-            if (result == null) {
-                return null;
-            }
-            if (context instanceof MethodResultContext) {
-                MethodResultContext functionContext = (MethodResultContext) context;
-                Method method = functionContext.getMethod();
-                Pointer ptr = (Pointer) result;
-                String s = ptr.getString(0);
-                if (method.isAnnotationPresent(Return.class)) {
-                    GlibAPI.glib.g_free(ptr);
-                }
-                return s;
-            } else {
-                return ((Pointer) result).getString(0);
-            }           
-        }
-
-        public Class<?> nativeType() {
-            return Pointer.class;
-        }
-
-        public Object toNative(Object arg, ToNativeContext context) {
-            // Let the default String -> native conversion handle it
-            return arg;            
-        }
-    };
-
     private TypeConverter booleanConverter = new TypeConverter() {
         public Object toNative(Object arg, ToNativeContext context) {
             return Integer.valueOf(Boolean.TRUE.equals(arg) ? 1 : 0);
@@ -281,8 +251,6 @@
             return nativeObjectConverter;
         } else if (Boolean.class == type || boolean.class == type) {
             return booleanConverter;
-        } else if (String.class == type) {
-            return stringConverter;
         } else if (IntPtr.class == type) {
             return intptrConverter;
         } else if (GQuark.class == type) {
@@ -302,9 +270,7 @@
         } else if (Enum.class.isAssignableFrom(type)) {
             return enumConverter;
         } else if (Boolean.class == type || boolean.class == type) {
-            return booleanConverter;
-        } else if (String.class == type) {
-            return stringConverter;        
+            return booleanConverter;   
         } else if (IntPtr.class == type) {
             return intptrConverter;
         } else if (GQuark.class == type) {



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