Просмотр исходного кода

[java] Unit tests-related fixes

Caue Waneck 12 лет назад
Родитель
Сommit
2cdb1380cd

+ 1 - 1
genjava.ml

@@ -875,7 +875,7 @@ let configure gen =
         | TDynamic _ ->
             path_s_import pos (["java";"lang"], "Object")
       | TAbstract(a,pl) when a.a_impl <> None ->
-        t_s pos (apply_params a.a_types pl a.a_this)
+        t_s pos (Codegen.get_underlying_type a pl)
       (* No Lazy type nor Function type made. That's because function types will be at this point be converted into other types *)
       | _ -> if !strict_mode then begin trace ("[ !TypeError " ^ (Type.s_type (Type.print_context()) t) ^ " ]"); assert false end else "[ !TypeError " ^ (Type.s_type (Type.print_context()) t) ^ " ]"
 

+ 3 - 3
std/haxe/io/Bytes.hx

@@ -41,7 +41,7 @@ class Bytes {
 		#elseif cpp
 		return untyped b[pos];
 		#elseif java
-		return b[pos] & 0xFF;
+		return untyped b[pos] & 0xFF;
 		#else
 		return b[pos];
 		#end
@@ -156,7 +156,7 @@ class Bytes {
 				#if cpp
 				return untyped b1[i] - untyped b2[i];
 				#else
-				return b1[i] - b2[i];
+				return untyped b1[i] - untyped b2[i];
 				#end
 		return length - other.length;
 		#end
@@ -362,7 +362,7 @@ class Bytes {
 		#elseif cpp
 		return untyped b[pos];
 		#elseif java
-		return b[pos] & 0xFF;
+		return untyped b[pos] & 0xFF;
 		#else
 		return b[pos];
 		#end

+ 1 - 1
std/haxe/io/BytesInput.hx

@@ -63,7 +63,7 @@ class BytesInput extends Input {
 			#elseif cpp
 			return untyped b[pos++];
 			#elseif java
-			return b[pos++] & 0xFF;
+			return untyped b[pos++] & 0xFF;
 			#else
 			return b[pos++];
 			#end

+ 13 - 13
std/haxe/io/Output.hx

@@ -54,7 +54,7 @@ class Output {
 			#elseif cpp
 				writeByte(untyped b[pos]);
 			#else
-				writeByte(b[pos]);
+				writeByte(untyped b[pos]);
 			#end
 			pos++;
 			k--;
@@ -121,10 +121,10 @@ class Output {
 		helper.order(bigEndian ? java.nio.ByteOrder.BIG_ENDIAN : java.nio.ByteOrder.LITTLE_ENDIAN);
 
 		helper.putFloat(0, x);
-		writeByte(helper.get(0));
-		writeByte(helper.get(1));
-		writeByte(helper.get(2));
-		writeByte(helper.get(3));
+		writeByte(untyped helper.get(0));
+		writeByte(untyped helper.get(1));
+		writeByte(untyped helper.get(2));
+		writeByte(untyped helper.get(3));
 		#else
 		if (x == 0.0)
 		{
@@ -184,14 +184,14 @@ class Output {
 
 		helper.putDouble(0, x);
 
-		writeByte(helper.get(0));
-		writeByte(helper.get(1));
-		writeByte(helper.get(2));
-		writeByte(helper.get(3));
-		writeByte(helper.get(4));
-		writeByte(helper.get(5));
-		writeByte(helper.get(6));
-		writeByte(helper.get(7));
+		writeByte(untyped helper.get(0));
+		writeByte(untyped helper.get(1));
+		writeByte(untyped helper.get(2));
+		writeByte(untyped helper.get(3));
+		writeByte(untyped helper.get(4));
+		writeByte(untyped helper.get(5));
+		writeByte(untyped helper.get(6));
+		writeByte(untyped helper.get(7));
 		#else
 		if (x == 0.0)
 		{

+ 6 - 5
std/java/Boot.hx

@@ -28,8 +28,9 @@ import java.internal.Iterator;
 import java.Lib;
 //import java.internal.StringExt;
 import java.StdTypes;
-import Hash;
 import Reflect;
+import Map;
+import haxe.ds.StringMap;
 import java.lang.Boolean;
 import java.lang.Character;
 import java.lang.Class;
@@ -38,9 +39,9 @@ import java.lang.Throwable;
 import java.internal.StringExt;
 import java.internal.FieldLookup;
 
-extern class Boot 
+extern class Boot
 {
 
-	
-	
-}
+
+
+}

+ 2 - 2
std/java/_std/Type.hx

@@ -116,7 +116,7 @@
 
 	public static function resolveEnum( name : String ) : Enum<Dynamic> untyped
 	{
-		if (name.equals("Bool")) return Bool;
+		if (name == "Bool") return Bool;
 		return resolveClass(name);
 	}
 
@@ -371,7 +371,7 @@
 	')
 	public static function enumEq<T>( a : T, b : T ) : Bool untyped
 	{
-		return a.equals(b);
+		return a == b;
 	}
 
 	@:functionCode('

+ 2 - 2
std/java/_std/haxe/ds/StringMap.hx

@@ -335,7 +335,7 @@ import java.NativeArray;
 			if (cachedKey == key)
 				cachedIndex = -1;
 
-			hashes[idx] = FLAG_EMPTY;
+			hashes[idx] = FLAG_DEL;
 			_keys[idx] = null;
 			vals[idx] = null;
 			--size;
@@ -485,4 +485,4 @@ import java.NativeArray;
 	}
 }
 
-private typedef HashType = Int;
+private typedef HashType = Int;

+ 1 - 1
std/java/internal/HxObject.hx

@@ -120,4 +120,4 @@ private class Enum
 		}
 		return true;
 	}
-}
+}