add bare-bones set of Java classes for testing

This commit is contained in:
Joel Dice 2007-06-20 19:37:43 -06:00
parent 91b9dc7382
commit ccd71b0d99
6 changed files with 96 additions and 0 deletions

7
input/Test.java Normal file
View File

@ -0,0 +1,7 @@
public class Test {
public static void main(String[] args) {
int a = 2 + 2;
}
}

View File

@ -0,0 +1,7 @@
package java.lang;
public final class Class <T> {
private Object body;
private Class() { }
}

View File

@ -0,0 +1,47 @@
package java.lang;
import vm.VM;
public class Object {
protected Object clone() {
return VM.clone(this);
}
public boolean equals(Object o) {
return this == o;
}
protected void finalize() { }
public final Class<? extends Object> getClass() {
return VM.getClass(this);
}
public int hashCode() {
return VM.hashCode(this);
}
public final void notify() {
VM.notify(this);
}
public final void notifyAll() {
VM.notifyAll(this);
}
public String toString() {
return VM.toString(this);
}
public final void wait() {
VM.wait(this);
}
public final void wait(long timeout) {
VM.wait(this, timeout);
}
public final void wait(long timeout, int nanos) {
VM.wait(this, timeout, nanos);
}
}

View File

@ -0,0 +1,8 @@
package java.lang;
public final class String {
private byte[] bytes;
private int offset;
private int length;
private int hash;
}

View File

@ -0,0 +1,6 @@
package java.lang;
public class Throwable {
private String message;
private Object trace;
}

21
input/vm/VM.java Normal file
View File

@ -0,0 +1,21 @@
package vm;
public class VM {
public static native Object clone(Object o);
public static native Class<? extends Object> getClass(Object o);
public static native int hashCode(Object o);
public static native void notify(Object o);
public static native void notifyAll(Object o);
public static native String toString(Object o);
public static native void wait(Object o);
public static native void wait(Object o, long timeout);
public static native void wait(Object o, long timeout, int nanos);
}