[armedbear-cvs] r12111 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Aug 23 09:26:15 UTC 2009


Author: ehuelsmann
Date: Sun Aug 23 05:26:13 2009
New Revision: 12111

Log:
Eliminate all unchecked warnings,
while also removing generic "SuppressWarnings" annotations.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Java.java
   trunk/abcl/src/org/armedbear/lisp/JavaClassLoader.java
   trunk/abcl/src/org/armedbear/lisp/Lisp.java
   trunk/abcl/src/org/armedbear/lisp/LispObject.java

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Sun Aug 23 05:26:13 2009
@@ -254,12 +254,12 @@
             if (args.length < 1)
                 error(new WrongNumberOfArgumentsException(this));
             try {
-                final Class c = javaClass(args[0]);
+                final Class<?> c = javaClass(args[0]);
                 int argCount = 0;
                 if (args.length == 2 && args[1] instanceof Fixnum) {
                     argCount = Fixnum.getValue(args[1]);
                 } else {
-                    Class[] parameterTypes = new Class[args.length-1];
+                    Class<?>[] parameterTypes = new Class[args.length-1];
                     for (int i = 1; i < args.length; i++) {
                         parameterTypes[i-1] = javaClass(args[i]);
                     }
@@ -298,14 +298,14 @@
         {
             if (args.length < 2)
                 error(new WrongNumberOfArgumentsException(this));
-            final Class c = javaClass(args[0]);
+            final Class<?> c = javaClass(args[0]);
             String methodName = args[1].getStringValue();
             try {
                 int argCount = 0;
                 if (args.length == 3 && args[2] instanceof Fixnum) {
                     argCount = ((Fixnum)args[2]).value;
                 } else {
-                    Class[] parameterTypes = new Class[args.length-2];
+                    Class<?>[] parameterTypes = new Class[args.length-2];
                     for (int i = 2; i < args.length; i++)
                         parameterTypes[i-2] = javaClass(args[i]);
                     return JavaObject.getInstance(c.getMethod(methodName,
@@ -636,7 +636,7 @@
                 method = findMethod(c, methodName, args.length - 2);
             } else
                 method = (Method) JavaObject.getObject(methodArg);
-            Class[] argTypes = method.getParameterTypes();
+            Class<?>[] argTypes = (Class<?>[])method.getParameterTypes();
             Object[] methodArgs = new Object[args.length - 2];
             for (int i = 2; i < args.length; i++) {
                 LispObject arg = args[i];
@@ -645,7 +645,8 @@
                 else
                     methodArgs[i-2] = arg.javaInstance(argTypes[i-2]);
             }
-            return JavaObject.getInstance(method.invoke(instance, methodArgs), translate);
+            return JavaObject.getInstance(method.invoke(instance, methodArgs),
+                                          translate);
         }
         catch (ConditionThrowable t) {
             throw t;

Modified: trunk/abcl/src/org/armedbear/lisp/JavaClassLoader.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaClassLoader.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/JavaClassLoader.java	Sun Aug 23 05:26:13 2009
@@ -79,12 +79,14 @@
         }
     }
 
-    public Class loadClassFromByteArray(String className, byte[] classbytes)
+    public Class<?> loadClassFromByteArray(String className,
+                                                byte[] classbytes)
     {
         try {
             long length = classbytes.length;
             if (length < Integer.MAX_VALUE) {
-                Class c = defineClass(className, classbytes, 0, (int) length);
+                Class<?> c =
+                    defineClass(className, classbytes, 0, (int) length);
                 if (c != null) {
                     resolveClass(c);
                     return c;
@@ -100,11 +102,11 @@
         return null;
     }
 
-    public Class loadClassFromByteArray(String className, byte[] bytes,
-                                        int offset, int length)
+    public Class<?> loadClassFromByteArray(String className, byte[] bytes,
+                                                int offset, int length)
     {
         try {
-            Class c = defineClass(className, bytes, offset, length);
+            Class<?> c = defineClass(className, bytes, offset, length);
             if (c != null) {
                 resolveClass(c);
                 return c;

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Sun Aug 23 05:26:13 2009
@@ -1220,7 +1220,7 @@
   }
 
     public static final LispObject loadCompiledFunction(byte[] bytes) throws Throwable {
-        Class<Object> c = (new JavaClassLoader())
+        Class<?> c = (new JavaClassLoader())
             .loadClassFromByteArray(null, bytes, 0, bytes.length);
         if (c != null) {
             Constructor constructor = c.getConstructor((Class[])null);

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Sun Aug 23 05:26:13 2009
@@ -104,7 +104,7 @@
         return this;
   }
 
-  public Object javaInstance(Class<Object> c) throws ConditionThrowable
+  public Object javaInstance(Class<?> c) throws ConditionThrowable
   {
       if (c.isAssignableFrom(getClass()))
 	  return this;




More information about the armedbear-cvs mailing list