Browse Source

[java] fixed accidental filtering of non-static java-lib variables

Caue Waneck 12 years ago
parent
commit
be2efa8271
2 changed files with 2 additions and 6 deletions
  1. 2 1
      genjava.ml
  2. 0 5
      tests/unit/native_java/src/haxe/test/MyClass.java

+ 2 - 1
genjava.ml

@@ -2463,6 +2463,7 @@ let convert_java_class ctx p jc =
     ) jc.cinterfaces;
     ) jc.cinterfaces;
 
 
     let fields = ref [] in
     let fields = ref [] in
+    print_endline ("======== class " ^ path_s jc.cpath);
 
 
     if jc.cpath <> (["java";"lang"], "CharSequence") then
     if jc.cpath <> (["java";"lang"], "CharSequence") then
       List.iter (fun f ->
       List.iter (fun f ->
@@ -2592,7 +2593,7 @@ let normalize_jclass com cls =
     if List.mem JStatic f.jf_flags then
     if List.mem JStatic f.jf_flags then
       not (List.exists (filter_field f) cmethods)
       not (List.exists (filter_field f) cmethods)
     else
     else
-      not (List.exists (filter_field f) !nonstatics) && not (List.exists (fun f2 -> f.jf_name = f2.jf_name && not (List.mem JStatic f2.jf_flags)) !all_fields) ) cfields
+      not (List.exists (filter_field f) !nonstatics) && not (List.exists (fun f2 -> f != f2 && f.jf_name = f2.jf_name && not (List.mem JStatic f2.jf_flags)) !all_fields) ) cfields
   in
   in
   (* removing duplicate fields. They are there because of return type covariance in Java *)
   (* removing duplicate fields. They are there because of return type covariance in Java *)
   let rec loop acc = function
   let rec loop acc = function

+ 0 - 5
tests/unit/native_java/src/haxe/test/MyClass.java

@@ -12,11 +12,6 @@ public class MyClass
 
 
 	}
 	}
 
 
-	public void normalOverload(Integer a)
-	{
-
-	}
-
 	public void normalOverload(boolean a)
 	public void normalOverload(boolean a)
 	{
 	{