Skip to content

Commit

Permalink
[java] Unit tests-related fixes
Browse files Browse the repository at this point in the history
git-svn-id: http://haxe.googlecode.com/svn/trunk@6149 f16182fa-f095-11de-8f43-4547254af6c6
  • Loading branch information
waneck@gmail.com committed Feb 8, 2013
1 parent 1f43b15 commit 3d88f3b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion genjava.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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) ^ " ]"

Expand Down
6 changes: 3 additions & 3 deletions std/haxe/io/Bytes.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion std/haxe/io/BytesInput.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions std/haxe/io/Output.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Output {
#elseif cpp
writeByte(untyped b[pos]);
#else
writeByte(b[pos]);
writeByte(untyped b[pos]);
#end
pos++;
k--;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
11 changes: 6 additions & 5 deletions std/java/Boot.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,9 +39,9 @@ import java.lang.Throwable;
import java.internal.StringExt;
import java.internal.FieldLookup;

extern class Boot
extern class Boot
{

}


}
4 changes: 2 additions & 2 deletions std/java/_std/Type.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -371,7 +371,7 @@
')
public static function enumEq<T>( a : T, b : T ) : Bool untyped
{
return a.equals(b);
return a == b;
}

@:functionCode('
Expand Down
4 changes: 2 additions & 2 deletions std/java/_std/haxe/ds/StringMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -485,4 +485,4 @@ import java.NativeArray;
}
}

private typedef HashType = Int;
private typedef HashType = Int;
2 changes: 1 addition & 1 deletion std/java/internal/HxObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ private class Enum
}
return true;
}
}
}

0 comments on commit 3d88f3b

Please sign in to comment.