clean up bootstrap type generation to eliminate redundancy (broken)

This commit is contained in:
Joel Dice
2007-11-04 14:15:28 -07:00
parent bea4a73f54
commit 94e9bd0fd2
20 changed files with 755 additions and 571 deletions

View File

@ -0,0 +1,11 @@
package java.lang;
public class ArrayStoreException extends RuntimeException {
public ArrayStoreException(String message) {
super(message, null);
}
public ArrayStoreException() {
this(null);
}
}

View File

@ -21,6 +21,7 @@ public final class Boolean implements Comparable<Boolean> {
}
public static Boolean valueOf(String s) {
Boolean.TRUE.booleanValue();
return ("true".equals(s) ? Boolean.TRUE : Boolean.FALSE);
}

View File

@ -0,0 +1,11 @@
package java.lang;
public class ExceptionInInitializerError extends Error {
public ExceptionInInitializerError(String message) {
super(message);
}
public ExceptionInInitializerError() {
super();
}
}

View File

@ -0,0 +1,11 @@
package java.lang;
public class IllegalMonitorStateException extends RuntimeException {
public IllegalMonitorStateException(String message) {
super(message, null);
}
public IllegalMonitorStateException() {
this(null);
}
}

View File

@ -0,0 +1,11 @@
package java.lang;
public class NoSuchMethodError extends IncompatibleClassChangeError {
public NoSuchMethodError(String message) {
super(message);
}
public NoSuchMethodError() {
super();
}
}

View File

@ -0,0 +1,11 @@
package java.lang;
public class StackOverflowError extends Error {
public StackOverflowError(String message) {
super(message, null);
}
public StackOverflowError() {
this(null);
}
}

View File

@ -4,7 +4,7 @@ public final class String implements Comparable<String> {
private Object data;
private int offset;
private int length;
private int hash;
private int hashCode;
public String(char[] data, int offset, int length, boolean copy) {
this((Object) data, offset, length, copy);
@ -70,12 +70,12 @@ public final class String implements Comparable<String> {
}
public int hashCode() {
if (hash == 0) {
if (hashCode == 0) {
int h = 0;
for (int i = 0; i < length; ++i) h = (h * 31) + charAt(i);
hash = h;
hashCode = h;
}
return hash;
return hashCode;
}
public boolean equals(Object o) {

View File

@ -4,7 +4,8 @@ public abstract class Reference<T> {
private Object vmNext;
private T target;
private ReferenceQueue<? super T> queue;
Reference next;
Reference jNext;
protected Reference(T target, ReferenceQueue<? super T> queue) {
this.target = target;
@ -20,7 +21,7 @@ public abstract class Reference<T> {
}
public boolean isEnqueued() {
return next != null;
return jNext != null;
}
public boolean enqueue() {

View File

@ -7,21 +7,21 @@ public class ReferenceQueue<T> {
public Reference<? extends T> poll() {
Reference<? extends T> r = front;
if (front != null) {
if (front == front.next) {
if (front == front.jNext) {
front = rear = null;
} else {
front = front.next;
front = front.jNext;
}
}
return r;
}
void add(Reference<? extends T> r) {
r.next = r;
r.jNext = r;
if (front == null) {
front = r;
} else {
rear.next = r;
rear.jNext = r;
}
rear = r;
}