Cleanup: remove dead code (including a redefinition of 'equals' which is the...

Cleanup: remove dead code (including a redefinition of 'equals' which is the same as its super definition); add @Override annotations.
parent cfb8f4b7
......@@ -136,16 +136,19 @@ public abstract class Function extends Operator
setLambdaList(lambdaList);
}
@Override
public LispObject typeOf()
{
return Symbol.FUNCTION;
}
@Override
public LispObject classOf()
{
return BuiltInClass.FUNCTION;
}
@Override
public LispObject typep(LispObject typeSpecifier) throws ConditionThrowable
{
if (typeSpecifier == Symbol.FUNCTION)
......@@ -157,6 +160,7 @@ public abstract class Function extends Operator
return super.typep(typeSpecifier);
}
@Override
public final LispObject getPropertyList()
{
if (propertyList == null)
......@@ -164,6 +168,7 @@ public abstract class Function extends Operator
return propertyList;
}
@Override
public final void setPropertyList(LispObject obj)
{
if (obj == null)
......@@ -177,22 +182,26 @@ public abstract class Function extends Operator
new JavaObject(bytes));
}
@Override
public LispObject execute() throws ConditionThrowable
{
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second)
throws ConditionThrowable
{
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
throws ConditionThrowable
......@@ -200,6 +209,7 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth)
throws ConditionThrowable
......@@ -207,6 +217,7 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth)
......@@ -215,6 +226,7 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth)
......@@ -223,6 +235,7 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -232,6 +245,7 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -241,11 +255,13 @@ public abstract class Function extends Operator
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public LispObject execute(LispObject[] args) throws ConditionThrowable
{
return error(new WrongNumberOfArgumentsException(this));
}
@Override
public String writeToString() throws ConditionThrowable
{
LispObject name = getLambdaName();
......@@ -290,17 +306,20 @@ public abstract class Function extends Operator
error(new WrongNumberOfArgumentsException(this));
}
@Override
// Profiling.
public final int getCallCount()
{
return callCount;
}
@Override
public void setCallCount(int n)
{
callCount = n;
}
@Override
public final void incrementCallCount()
{
++callCount;
......
......@@ -1933,6 +1933,7 @@ public abstract class Lisp
public static final Primitive REMEMBER =
new Primitive("remember", PACKAGE_SYS, true)
{
@Override
public LispObject execute(LispObject key, LispObject value)
throws ConditionThrowable
{
......@@ -2479,6 +2480,7 @@ public abstract class Lisp
public static final LispObject UNBOUND_VALUE = new LispObject()
{
@Override
public String writeToString()
{
return "#<UNBOUND>";
......@@ -2487,6 +2489,7 @@ public abstract class Lisp
public static final LispObject NULL_VALUE = new LispObject()
{
@Override
public String writeToString()
{
return "null";
......
......@@ -59,6 +59,7 @@ public abstract class Operator extends LispObject
lambdaList = obj;
}
@Override
public LispObject getParts() throws ConditionThrowable
{
LispObject result = NIL;
......
......@@ -45,16 +45,19 @@ public final class SocketStream extends TwoWayStream
this.socket = socket;
}
@Override
public LispObject typeOf()
{
return Symbol.SOCKET_STREAM;
}
@Override
public LispObject classOf()
{
return BuiltInClass.SOCKET_STREAM;
}
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.SOCKET_STREAM)
......@@ -64,6 +67,7 @@ public final class SocketStream extends TwoWayStream
return super.typep(type);
}
@Override
public LispObject close(LispObject abort) throws ConditionThrowable
{
try {
......@@ -75,6 +79,7 @@ public final class SocketStream extends TwoWayStream
}
}
@Override
public String toString()
{
return unreadableString("SOCKET-STREAM");
......
......@@ -95,6 +95,7 @@ public class Symbol extends LispObject
this.pkg = pkg;
}
@Override
public LispObject typeOf()
{
if (pkg == PACKAGE_KEYWORD)
......@@ -104,11 +105,13 @@ public class Symbol extends LispObject
return Symbol.SYMBOL;
}
@Override
public LispObject classOf()
{
return BuiltInClass.SYMBOL;
}
@Override
public LispObject getDescription() throws ConditionThrowable
{
final LispThread thread = LispThread.currentThread();
......@@ -137,6 +140,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject getParts() throws ConditionThrowable
{
LispObject parts = NIL;
......@@ -150,6 +154,7 @@ public class Symbol extends LispObject
return parts.nreverse();
}
@Override
public LispObject typep(LispObject type) throws ConditionThrowable
{
if (type == Symbol.SYMBOL)
......@@ -163,16 +168,19 @@ public class Symbol extends LispObject
return super.typep(type);
}
@Override
public final LispObject SYMBOLP()
{
return T;
}
@Override
public boolean constantp()
{
return (flags & FLAG_CONSTANT) != 0;
}
@Override
public final LispObject STRING()
{
return name;
......@@ -188,11 +196,13 @@ public class Symbol extends LispObject
pkg = obj;
}
@Override
public final boolean isSpecialOperator()
{
return (function instanceof SpecialOperator);
}
@Override
public final boolean isSpecialVariable()
{
return (flags & FLAG_SPECIAL) != 0;
......@@ -274,6 +284,7 @@ public class Symbol extends LispObject
}
// Raw accessor.
@Override
public LispObject getSymbolValue()
{
return value;
......@@ -326,11 +337,13 @@ public class Symbol extends LispObject
return value;
}
@Override
public LispObject getSymbolFunction()
{
return function;
}
@Override
public final LispObject getSymbolFunctionOrDie() throws ConditionThrowable
{
if (function == null)
......@@ -359,6 +372,7 @@ public class Symbol extends LispObject
this.function = obj;
}
@Override
public final LispObject getPropertyList()
{
if (propertyList == null)
......@@ -366,6 +380,7 @@ public class Symbol extends LispObject
return propertyList;
}
@Override
public final void setPropertyList(LispObject obj)
{
if (obj == null)
......@@ -373,6 +388,7 @@ public class Symbol extends LispObject
propertyList = obj;
}
@Override
public String writeToString() throws ConditionThrowable
{
final String n = name.getStringValue();
......@@ -685,6 +701,7 @@ public class Symbol extends LispObject
return sb.toString();
}
@Override
public final int sxhash()
{
int h = hash;
......@@ -696,11 +713,7 @@ public class Symbol extends LispObject
return h;
}
public final boolean equals(Object obj)
{
return this == obj;
}
@Override
public LispObject execute() throws ConditionThrowable
{
try
......@@ -713,6 +726,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject arg) throws ConditionThrowable
{
try
......@@ -725,6 +739,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second)
throws ConditionThrowable
{
......@@ -738,6 +753,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third)
throws ConditionThrowable
......@@ -752,6 +768,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth)
throws ConditionThrowable
......@@ -766,6 +783,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth)
......@@ -781,6 +799,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth)
......@@ -797,6 +816,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -816,6 +836,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject first, LispObject second,
LispObject third, LispObject fourth,
LispObject fifth, LispObject sixth,
......@@ -835,6 +856,7 @@ public class Symbol extends LispObject
}
}
@Override
public LispObject execute(LispObject[] args) throws ConditionThrowable
{
try
......@@ -850,15 +872,6 @@ public class Symbol extends LispObject
}
}
private final LispObject signalNPE(NullPointerException e)
throws ConditionThrowable
{
if (function == null)
return error(new UndefinedFunction(this));
Debug.trace(e);
return error(new LispError("Null pointer exception"));
}
private final LispObject handleNPE(NullPointerException e, LispObject args)
throws ConditionThrowable
{
......@@ -869,6 +882,7 @@ public class Symbol extends LispObject
return error(new LispError("Null pointer exception"));
}
@Override
public void incrementCallCount()
{
if (function != null)
......
......@@ -43,6 +43,7 @@ public final class socket_stream extends Primitive
super("%socket-stream", PACKAGE_SYS, false, "socket element-type external-format");
}
@Override
public LispObject execute(LispObject first, LispObject second, LispObject third)
throws ConditionThrowable
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment