Remove 'private' keyword to eliminate the Java requirement

  for the compiler to generate synthetic accessors: functions that
  don't appear in the source but do appear in the class file.

Patch by: Douglas Miles <dmiles _at_ users.sf.net>
parent f03306ba
...@@ -100,7 +100,7 @@ public class ArithmeticError extends LispError ...@@ -100,7 +100,7 @@ public class ArithmeticError extends LispError
return super.typep(type); return super.typep(type);
} }
private final LispObject getOperation() final LispObject getOperation()
{ {
return getInstanceSlotValue(Symbol.OPERATION); return getInstanceSlotValue(Symbol.OPERATION);
} }
...@@ -111,7 +111,7 @@ public class ArithmeticError extends LispError ...@@ -111,7 +111,7 @@ public class ArithmeticError extends LispError
setInstanceSlotValue(Symbol.OPERATION, operation); setInstanceSlotValue(Symbol.OPERATION, operation);
} }
private final LispObject getOperands() final LispObject getOperands()
{ {
return getInstanceSlotValue(Symbol.OPERANDS); return getInstanceSlotValue(Symbol.OPERANDS);
} }
......
...@@ -47,7 +47,7 @@ public final class AutoloadMacro extends Autoload ...@@ -47,7 +47,7 @@ public final class AutoloadMacro extends Autoload
super(symbol, fileName, null); super(symbol, fileName, null);
} }
private static void installAutoloadMacro(Symbol symbol, String fileName) static void installAutoloadMacro(Symbol symbol, String fileName)
{ {
AutoloadMacro am = new AutoloadMacro(symbol, fileName); AutoloadMacro am = new AutoloadMacro(symbol, fileName);
......
...@@ -46,7 +46,7 @@ public class AutoloadedFunctionProxy extends Function { ...@@ -46,7 +46,7 @@ public class AutoloadedFunctionProxy extends Function {
/** List of symbols that need to be saved upon instantiation of a /** List of symbols that need to be saved upon instantiation of a
* proxy and restored while loading the actual function. * proxy and restored while loading the actual function.
*/ */
final static private Symbol[] symsToSave = final static Symbol[] symsToSave =
new Symbol[] new Symbol[]
{ {
AUTOLOADING_CACHE, // allow loading local preloaded functions AUTOLOADING_CACHE, // allow loading local preloaded functions
......
...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*; ...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*;
public final class BroadcastStream extends Stream public final class BroadcastStream extends Stream
{ {
private final Stream[] streams; final Stream[] streams;
private BroadcastStream(Stream[] streams) BroadcastStream(Stream[] streams)
{ {
super(Symbol.BROADCAST_STREAM); super(Symbol.BROADCAST_STREAM);
this.streams = streams; this.streams = streams;
......
...@@ -44,7 +44,7 @@ public final class ByteArrayOutputStream extends Stream ...@@ -44,7 +44,7 @@ public final class ByteArrayOutputStream extends Stream
this(UNSIGNED_BYTE_8); //Declared in Stream.java this(UNSIGNED_BYTE_8); //Declared in Stream.java
} }
private ByteArrayOutputStream(LispObject elementType) ByteArrayOutputStream(LispObject elementType)
{ {
super(Symbol.SYSTEM_STREAM); super(Symbol.SYSTEM_STREAM);
this.elementType = elementType; this.elementType = elementType;
......
...@@ -1026,12 +1026,12 @@ public class Closure extends Function ...@@ -1026,12 +1026,12 @@ public class Closure extends Function
public static class Parameter public static class Parameter
{ {
private final Symbol var; final Symbol var;
private final LispObject initForm; final LispObject initForm;
private final LispObject initVal; final LispObject initVal;
private final LispObject svar; final LispObject svar;
private final int type; private final int type;
private final Symbol keyword; final Symbol keyword;
public Parameter(Symbol var) public Parameter(Symbol var)
{ {
......
...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*; ...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*;
public final class ConcatenatedStream extends Stream public final class ConcatenatedStream extends Stream
{ {
private LispObject streams; LispObject streams;
private ConcatenatedStream(LispObject streams) ConcatenatedStream(LispObject streams)
{ {
super(Symbol.CONCATENATED_STREAM); super(Symbol.CONCATENATED_STREAM);
this.streams = streams; this.streams = streams;
......
...@@ -66,7 +66,7 @@ public final class Do { ...@@ -66,7 +66,7 @@ public final class Do {
} }
}; };
private static final LispObject _do(LispObject args, Environment env, static final LispObject _do(LispObject args, Environment env,
boolean sequential) boolean sequential)
{ {
......
...@@ -37,8 +37,8 @@ import static org.armedbear.lisp.Lisp.*; ...@@ -37,8 +37,8 @@ import static org.armedbear.lisp.Lisp.*;
public final class Environment extends LispObject public final class Environment extends LispObject
{ {
private Binding vars; Binding vars;
private FunctionBinding lastFunctionBinding; FunctionBinding lastFunctionBinding;
private Binding blocks; private Binding blocks;
private Binding tags; private Binding tags;
public boolean inactive; //default value: false == active public boolean inactive; //default value: false == active
......
...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*; ...@@ -37,9 +37,9 @@ import static org.armedbear.lisp.Lisp.*;
public final class FillPointerOutputStream extends Stream public final class FillPointerOutputStream extends Stream
{ {
private ComplexString string; ComplexString string;
private FillPointerOutputStream(ComplexString string) FillPointerOutputStream(ComplexString string)
{ {
super(Symbol.SYSTEM_STREAM); super(Symbol.SYSTEM_STREAM);
elementType = Symbol.CHARACTER; elementType = Symbol.CHARACTER;
...@@ -69,7 +69,7 @@ public final class FillPointerOutputStream extends Stream ...@@ -69,7 +69,7 @@ public final class FillPointerOutputStream extends Stream
} }
}; };
private class Writer extends java.io.Writer class Writer extends java.io.Writer
{ {
@Override @Override
public void write(char cbuf[], int off, int len) public void write(char cbuf[], int off, int len)
......
...@@ -198,8 +198,8 @@ public final class FloatFunctions ...@@ -198,8 +198,8 @@ public final class FloatFunctions
} }
}; };
private static final Fixnum FIXNUM_24 = Fixnum.getInstance(24); static final Fixnum FIXNUM_24 = Fixnum.getInstance(24);
private static final Fixnum FIXNUM_53 = Fixnum.getInstance(53); static final Fixnum FIXNUM_53 = Fixnum.getInstance(53);
// ### float-digits // ### float-digits
// float-digits float => float-digits // float-digits float => float-digits
......
...@@ -37,13 +37,13 @@ import static org.armedbear.lisp.Lisp.*; ...@@ -37,13 +37,13 @@ import static org.armedbear.lisp.Lisp.*;
public final class HashTableFunctions public final class HashTableFunctions
{ {
private static final LispObject FUNCTION_EQ = static final LispObject FUNCTION_EQ =
Symbol.EQ.getSymbolFunction(); Symbol.EQ.getSymbolFunction();
private static final LispObject FUNCTION_EQL = static final LispObject FUNCTION_EQL =
Symbol.EQL.getSymbolFunction(); Symbol.EQL.getSymbolFunction();
private static final LispObject FUNCTION_EQUAL = static final LispObject FUNCTION_EQUAL =
Symbol.EQUAL.getSymbolFunction(); Symbol.EQUAL.getSymbolFunction();
private static final LispObject FUNCTION_EQUALP = static final LispObject FUNCTION_EQUALP =
Symbol.EQUALP.getSymbolFunction(); Symbol.EQUALP.getSymbolFunction();
// ### %make-hash-table // ### %make-hash-table
......
...@@ -41,7 +41,7 @@ import java.util.WeakHashMap; ...@@ -41,7 +41,7 @@ import java.util.WeakHashMap;
public final class JHandler public final class JHandler
{ {
private static final Map<Object,Map<String,Entry>> table = static final Map<Object,Map<String,Entry>> table =
new WeakHashMap<Object,Map<String,Entry>>(); new WeakHashMap<Object,Map<String,Entry>>();
public static void callLisp (String s, Object o) public static void callLisp (String s, Object o)
......
...@@ -44,7 +44,7 @@ import java.util.WeakHashMap; ...@@ -44,7 +44,7 @@ import java.util.WeakHashMap;
public final class JProxy public final class JProxy
{ {
private static final Map<Object,Entry> table = new WeakHashMap<Object,Entry>(); static final Map<Object,Entry> table = new WeakHashMap<Object,Entry>();
// ### %jnew-proxy interface &rest method-names-and-defs // ### %jnew-proxy interface &rest method-names-and-defs
private static final Primitive _JNEW_PROXY = private static final Primitive _JNEW_PROXY =
...@@ -135,7 +135,7 @@ public final class JProxy ...@@ -135,7 +135,7 @@ public final class JProxy
/** /**
* A weak map associating each proxy instance with a "Lisp-this" object. * A weak map associating each proxy instance with a "Lisp-this" object.
*/ */
private static final Map<Object, LispObject> proxyMap = new WeakHashMap<Object, LispObject>(); static final Map<Object, LispObject> proxyMap = new WeakHashMap<Object, LispObject>();
public static class LispInvocationHandler implements InvocationHandler { public static class LispInvocationHandler implements InvocationHandler {
...@@ -238,7 +238,7 @@ public final class JProxy ...@@ -238,7 +238,7 @@ public final class JProxy
} }
}; };
private static LispObject toLispObject(Object obj) { static LispObject toLispObject(Object obj) {
return (obj instanceof LispObject) ? (LispObject) obj : new JavaObject(obj); return (obj instanceof LispObject) ? (LispObject) obj : new JavaObject(obj);
} }
......
...@@ -49,12 +49,12 @@ import java.util.*; ...@@ -49,12 +49,12 @@ import java.util.*;
public final class Java public final class Java
{ {
private static final Map<Class,Symbol> registeredExceptions = static final Map<Class,Symbol> registeredExceptions =
new HashMap<Class,Symbol>(); new HashMap<Class,Symbol>();
private static final LispClass java_exception = LispClass.findClass(Symbol.JAVA_EXCEPTION); private static final LispClass java_exception = LispClass.findClass(Symbol.JAVA_EXCEPTION);
private static boolean isJavaException(LispClass lc) static boolean isJavaException(LispClass lc)
{ {
return lc.subclassp(java_exception); return lc.subclassp(java_exception);
} }
...@@ -93,7 +93,7 @@ public final class Java ...@@ -93,7 +93,7 @@ public final class Java
} }
}; };
private static Symbol getCondition(Class cl) static Symbol getCondition(Class cl)
{ {
Class o = classForName("java.lang.Object"); Class o = classForName("java.lang.Object");
for (Class c = cl ; c != o ; c = c.getSuperclass()) { for (Class c = cl ; c != o ; c = c.getSuperclass()) {
...@@ -146,7 +146,7 @@ public final class Java ...@@ -146,7 +146,7 @@ public final class Java
// derived from the instance. // derived from the instance.
// //
private static final LispObject jfield(Primitive fun, LispObject[] args, boolean translate) static final LispObject jfield(Primitive fun, LispObject[] args, boolean translate)
{ {
if (args.length < 2 || args.length > 4) if (args.length < 2 || args.length > 4)
...@@ -347,7 +347,7 @@ public final class Java ...@@ -347,7 +347,7 @@ public final class Java
} }
}; };
private static final LispObject jstatic(Primitive fun, LispObject[] args, boolean translate) static final LispObject jstatic(Primitive fun, LispObject[] args, boolean translate)
{ {
if (args.length < 2) if (args.length < 2)
...@@ -511,7 +511,7 @@ public final class Java ...@@ -511,7 +511,7 @@ public final class Java
} }
}; };
private static final LispObject jarray_ref(Primitive fun, LispObject[] args, boolean translate) static final LispObject jarray_ref(Primitive fun, LispObject[] args, boolean translate)
{ {
if (args.length < 2) if (args.length < 2)
...@@ -623,7 +623,7 @@ public final class Java ...@@ -623,7 +623,7 @@ public final class Java
} }
}; };
private static LispObject jcall(Primitive fun, LispObject[] args, boolean translate) static LispObject jcall(Primitive fun, LispObject[] args, boolean translate)
{ {
if (args.length < 2) if (args.length < 2)
...@@ -764,7 +764,7 @@ public final class Java ...@@ -764,7 +764,7 @@ public final class Java
return findMethod(methods, methodName, javaArgs); return findMethod(methods, methodName, javaArgs);
} }
private static Constructor findConstructor(Class<?> c, LispObject[] args) throws NoSuchMethodException { static Constructor findConstructor(Class<?> c, LispObject[] args) throws NoSuchMethodException {
int argCount = args.length - 1; int argCount = args.length - 1;
Object[] javaArgs = translateMethodArguments(args, 1); Object[] javaArgs = translateMethodArguments(args, 1);
Constructor[] ctors = c.getConstructors(); Constructor[] ctors = c.getConstructors();
...@@ -1015,7 +1015,7 @@ public final class Java ...@@ -1015,7 +1015,7 @@ public final class Java
} }
}; };
private static PropertyDescriptor getPropertyDescriptor(Object obj, LispObject propertyName) throws IntrospectionException { static PropertyDescriptor getPropertyDescriptor(Object obj, LispObject propertyName) throws IntrospectionException {
String prop = ((AbstractString) propertyName).getStringValue(); String prop = ((AbstractString) propertyName).getStringValue();
BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
for(PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) { for(PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
...@@ -1028,7 +1028,7 @@ public final class Java ...@@ -1028,7 +1028,7 @@ public final class Java
return null; // not reached return null; // not reached
} }
private static Class classForName(String className) static Class classForName(String className)
{ {
try { try {
return Class.forName(className); return Class.forName(className);
...@@ -1046,7 +1046,7 @@ public final class Java ...@@ -1046,7 +1046,7 @@ public final class Java
} }
// Supports Java primitive types too. // Supports Java primitive types too.
private static Class javaClass(LispObject obj) static Class javaClass(LispObject obj)
{ {
if (obj instanceof AbstractString || obj instanceof Symbol) { if (obj instanceof AbstractString || obj instanceof Symbol) {
String s = javaString(obj); String s = javaString(obj);
...@@ -1092,7 +1092,7 @@ public final class Java ...@@ -1092,7 +1092,7 @@ public final class Java
return null; return null;
} }
private static final String getMessage(Throwable t) static final String getMessage(Throwable t)
{ {
String message = t.getMessage(); String message = t.getMessage();
if (message == null || message.length() == 0) if (message == null || message.length() == 0)
......
...@@ -42,7 +42,7 @@ import java.math.BigInteger; ...@@ -42,7 +42,7 @@ import java.math.BigInteger;
import java.util.*; import java.util.*;
public final class JavaObject extends LispObject { public final class JavaObject extends LispObject {
private final Object obj; final Object obj;
private final Class<?> intendedClass; private final Class<?> intendedClass;
public JavaObject(Object obj) { public JavaObject(Object obj) {
......
...@@ -40,8 +40,8 @@ public class Layout extends LispObject ...@@ -40,8 +40,8 @@ public class Layout extends LispObject
private final LispClass lispClass; private final LispClass lispClass;
public final EqHashTable slotTable; public final EqHashTable slotTable;
private final LispObject[] slotNames; final LispObject[] slotNames;
private final LispObject sharedSlots; final LispObject sharedSlots;
private boolean invalid; private boolean invalid;
...@@ -74,7 +74,7 @@ public class Layout extends LispObject ...@@ -74,7 +74,7 @@ public class Layout extends LispObject
} }
// Copy constructor. // Copy constructor.
private Layout(Layout oldLayout) Layout(Layout oldLayout)
{ {
lispClass = oldLayout.getLispClass(); lispClass = oldLayout.getLispClass();
slotNames = oldLayout.slotNames; slotNames = oldLayout.slotNames;
......
...@@ -2028,7 +2028,7 @@ public final class Lisp ...@@ -2028,7 +2028,7 @@ public final class Lisp
} }
// The compiler's object table. // The compiler's object table.
private static final Hashtable<String,LispObject> objectTable = static final Hashtable<String,LispObject> objectTable =
new Hashtable<String,LispObject>(); new Hashtable<String,LispObject>();
public static final LispObject recall(String key) public static final LispObject recall(String key)
...@@ -2620,7 +2620,7 @@ public final class Lisp ...@@ -2620,7 +2620,7 @@ public final class Lisp
exportSpecial("*COMPILE-FILE-ENVIRONMENT*", PACKAGE_SYS, NIL); exportSpecial("*COMPILE-FILE-ENVIRONMENT*", PACKAGE_SYS, NIL);
public static final LispObject UNBOUND_VALUE = new unboundValue(); public static final LispObject UNBOUND_VALUE = new unboundValue();
private static class unboundValue extends LispObject static class unboundValue extends LispObject
{ {
@Override @Override
public String writeToString() public String writeToString()
...@@ -2630,7 +2630,7 @@ public final class Lisp ...@@ -2630,7 +2630,7 @@ public final class Lisp
} }
public static final LispObject NULL_VALUE = new nullValue(); public static final LispObject NULL_VALUE = new nullValue();
private static class nullValue extends LispObject static class nullValue extends LispObject
{ {
@Override @Override
public String writeToString() public String writeToString()
......
...@@ -129,7 +129,7 @@ public final class LispCharacter extends LispObject ...@@ -129,7 +129,7 @@ public final class LispCharacter extends LispObject
return new SimpleString(value); return new SimpleString(value);
} }
private boolean isStandardChar() boolean isStandardChar()
{ {
if (value >= ' ' && value < 127) if (value >= ' ' && value < 127)
return true; return true;
...@@ -682,7 +682,7 @@ public final class LispCharacter extends LispObject ...@@ -682,7 +682,7 @@ public final class LispCharacter extends LispObject
} }
} }
private static final char[] UPPER_CASE_CHARS = new char[128]; static final char[] UPPER_CASE_CHARS = new char[128];
static static
{ {
...@@ -697,7 +697,7 @@ public final class LispCharacter extends LispObject ...@@ -697,7 +697,7 @@ public final class LispCharacter extends LispObject
return Character.toLowerCase(c); return Character.toLowerCase(c);
} }
private static final char[] LOWER_CASE_CHARS = new char[128]; static final char[] LOWER_CASE_CHARS = new char[128];
static static
{ {
......
...@@ -41,11 +41,11 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -41,11 +41,11 @@ import java.util.concurrent.atomic.AtomicInteger;
public final class LispThread extends LispObject public final class LispThread extends LispObject
{ {
private static boolean use_fast_calls = false; static boolean use_fast_calls = false;
// use a concurrent hashmap: we may want to add threads // use a concurrent hashmap: we may want to add threads
// while at the same time iterating the hash // while at the same time iterating the hash
final private static ConcurrentHashMap<Thread,LispThread> map = final static ConcurrentHashMap<Thread,LispThread> map =
new ConcurrentHashMap<Thread,LispThread>(); new ConcurrentHashMap<Thread,LispThread>();
private static ThreadLocal<LispThread> threads = new ThreadLocal<LispThread>(){ private static ThreadLocal<LispThread> threads = new ThreadLocal<LispThread>(){
...@@ -66,20 +66,20 @@ public final class LispThread extends LispObject ...@@ -66,20 +66,20 @@ public final class LispThread extends LispObject
return threads.get(); return threads.get();
} }
private final Thread javaThread; final Thread javaThread;
private boolean destroyed; private boolean destroyed;
private final LispObject name; final LispObject name;
public LispObject[] _values; public LispObject[] _values;
private boolean threadInterrupted; private boolean threadInterrupted;
private LispObject pending = NIL; private LispObject pending = NIL;
private LispThread(Thread javaThread) LispThread(Thread javaThread)
{ {
this.javaThread = javaThread; this.javaThread = javaThread;
name = new SimpleString(javaThread.getName()); name = new SimpleString(javaThread.getName());
} }
private LispThread(final Function fun, LispObject name) LispThread(final Function fun, LispObject name)
{ {
Runnable r = new Runnable() { Runnable r = new Runnable() {
public void run() public void run()
...@@ -141,17 +141,17 @@ public final class LispThread extends LispObject ...@@ -141,17 +141,17 @@ public final class LispThread extends LispObject
return destroyed; return destroyed;
} }
private final synchronized boolean isInterrupted() final synchronized boolean isInterrupted()
{ {
return threadInterrupted; return threadInterrupted;
} }
private final synchronized void setDestroyed(boolean b) final synchronized void setDestroyed(boolean b)
{ {
destroyed = b; destroyed = b;
} }
private final synchronized void interrupt(LispObject function, LispObject args) final synchronized void interrupt(LispObject function, LispObject args)
{ {
pending = new Cons(args, pending); pending = new Cons(args, pending);
pending = new Cons(function, pending); pending = new Cons(function, pending);
...@@ -159,7 +159,7 @@ public final class LispThread extends LispObject ...@@ -159,7 +159,7 @@ public final class LispThread extends LispObject
javaThread.interrupt(); javaThread.interrupt();
} }
private final synchronized void processThreadInterrupts() final synchronized void processThreadInterrupts()
{ {
while (pending != NIL) { while (pending != NIL) {
......
...@@ -324,7 +324,7 @@ public final class Load ...@@ -324,7 +324,7 @@ public final class Load
// ### *fasl-version* // ### *fasl-version*
// internal symbol // internal symbol
private static final Symbol _FASL_VERSION_ = static final Symbol _FASL_VERSION_ =
exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(35)); exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(35));
// ### *fasl-external-format* // ### *fasl-external-format*
...@@ -530,7 +530,7 @@ public final class Load ...@@ -530,7 +530,7 @@ public final class Load
} }
} }
private static final LispObject faslLoadStream(LispThread thread) static final LispObject faslLoadStream(LispThread thread)
{ {
Stream in = (Stream) _LOAD_STREAM_.symbolValue(thread); Stream in = (Stream) _LOAD_STREAM_.symbolValue(thread);
final Environment env = new Environment(); final Environment env = new Environment();
...@@ -589,7 +589,7 @@ public final class Load ...@@ -589,7 +589,7 @@ public final class Load
} }
} }
private static final LispObject load(LispObject filespec, static final LispObject load(LispObject filespec,
LispObject verbose, LispObject verbose,
LispObject print, LispObject print,
LispObject ifDoesNotExist, LispObject ifDoesNotExist,
......
...@@ -47,7 +47,7 @@ public final class MathFunctions ...@@ -47,7 +47,7 @@ public final class MathFunctions
} }
};