[kaffe] CVS kaffe (robilad): Fixed ecj warnings in tests

Kaffe CVS cvs-commits at kaffe.org
Sun Nov 11 07:48:18 PST 2007


PatchSet 7601 
Date: 2007/11/11 15:46:57
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixed ecj warnings in tests

Members: 
	ChangeLog:1.5098->1.5099 
	test/regression/Bean.java:1.6->1.7 
	test/regression/BeanBug.java:INITIAL->1.6 
	test/regression/ClassGC.java:1.8->1.9 
	test/regression/ClassGCTest.java:1.4->1.5 
	test/regression/ClassGCTestLater.java:1.3->1.4 
	test/regression/ConstructorTest.java:1.3->1.4 
	test/regression/DoubleBug.java:1.3->1.4 
	test/regression/DoubleIEEE.java:1.1->1.2 
	test/regression/ExceptionTestClassLoader.java:1.4->1.5 
	test/regression/ExceptionTestClassLoader2.java:1.5->1.6 
	test/regression/FPUStack.java:1.2->1.3 
	test/regression/FileChecks.java:1.2->1.3 
	test/regression/GetField.java:1.3->1.4 
	test/regression/InitTest.java:1.2->1.3 
	test/regression/InputStreamTest.java:1.2->1.3 
	test/regression/LineNumberReaderTest.java:1.4->1.5 
	test/regression/LostTrampolineFrame.java:1.2->1.3 
	test/regression/MapTest.java:1.3->1.4 
	test/regression/MarkResetTest.java:1.7->1.8 
	test/regression/MethodBug.java:1.3->1.4 
	test/regression/MethodErrors.java:1.1->1.2 
	test/regression/NetworkInterfaceTest.java:1.2->1.3 
	test/regression/NullPointerTest.java:1.4->1.5 
	test/regression/PrimordialLoaderTest.java:1.1->1.2 
	test/regression/ProcessClassInst.java:1.19->1.20 
	test/regression/ReaderReadVoidTest.java:1.1->1.2 
	test/regression/Reflect.java:1.17->1.18 
	test/regression/ReflectInvoke.java:1.3->1.4 
	test/regression/ReflectMultiArray.java:1.2->1.3 
	test/regression/SecurityMan2.java:1.1->1.2 
	test/regression/SoTimeout.java:INITIAL->1.9 
	test/regression/TestFloatDouble.java:1.2->1.3 
	test/regression/TestGnuCrypto.java:1.2->1.3 
	test/regression/TestIntLong.java:1.2->1.3 
	test/regression/TestSerializable.java:1.4->1.5 
	test/regression/TestSerializable2.java:INITIAL->1.5 
	test/regression/ThreadInterrupt.java:INITIAL->1.7 
	test/regression/ThreadState.java:1.7->1.8 
	test/regression/TruncatedClass.java:1.2->1.3 
	test/regression/UDPTest.java:1.3->1.4 
	test/regression/URLTest.java:1.6->1.7 
	test/regression/ZipVerify.java:1.2->1.5 
	test/regression/ZipVerifyUtils.java:1.1->1.2 
	test/regression/ttest.java:1.3->1.4 
	test/regression/tthrd1.java:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5098 kaffe/ChangeLog:1.5099
--- kaffe/ChangeLog:1.5098	Sun Nov 11 15:33:38 2007
+++ kaffe/ChangeLog	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,53 @@
 2007-11-11  Dalibor Topic  <robilad at kaffe.org>
 
+	* test/regression/Bean.java,
+	test/regression/BeanBug.java,
+	test/regression/ClassGC.java,
+	test/regression/ClassGCTest.java,
+	test/regression/ClassGCTestLater.java,
+	test/regression/ConstructorTest.java,
+	test/regression/DoubleBug.java,
+	test/regression/DoubleIEEE.java,
+	test/regression/ExceptionTestClassLoader.java,
+	test/regression/ExceptionTestClassLoader2.java,
+	test/regression/FPUStack.java,
+	test/regression/FileChecks.java,
+	test/regression/GetField.java,
+	test/regression/InitTest.java,
+	test/regression/InputStreamTest.java,
+	test/regression/LineNumberReaderTest.java,
+	test/regression/LostTrampolineFrame.java,
+	test/regression/MapTest.java,
+	test/regression/MarkResetTest.java,
+	test/regression/MethodBug.java,
+	test/regression/MethodErrors.java,
+	test/regression/NetworkInterfaceTest.java,
+	test/regression/NullPointerTest.java,
+	test/regression/PrimordialLoaderTest.java,
+	test/regression/ProcessClassInst.java,
+	test/regression/ReaderReadVoidTest.java,
+	test/regression/Reflect.java,
+	test/regression/ReflectInvoke.java,
+	test/regression/ReflectMultiArray.java,
+	test/regression/SecurityMan2.java,
+	test/regression/SoTimeout.java,
+	test/regression/TestFloatDouble.java,
+	test/regression/TestGnuCrypto.java,
+	test/regression/TestIntLong.java,
+	test/regression/TestSerializable.java,
+	test/regression/TestSerializable2.java,
+	test/regression/ThreadInterrupt.java,
+	test/regression/ThreadState.java,
+	test/regression/TruncatedClass.java,
+	test/regression/UDPTest.java,
+	test/regression/URLTest.java,
+	test/regression/ZipVerify.java,
+	test/regression/ZipVerifyUtils.java,
+	test/regression/ttest.java,
+	test/regression/tthrd1.java: Fixed ecj warnings.
+
+2007-11-11  Dalibor Topic  <robilad at kaffe.org>
+
 	* test/regression/Makefile.am (XFAIL_TESTS): Added DateFormatTest.java.
 
 2007-10-24  Dalibor Topic  <robilad at kaffe.org>
Index: kaffe/test/regression/Bean.java
diff -u kaffe/test/regression/Bean.java:1.6 kaffe/test/regression/Bean.java:1.7
--- kaffe/test/regression/Bean.java:1.6	Wed Apr 20 20:42:47 2005
+++ kaffe/test/regression/Bean.java	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,4 @@
 import java.beans.*;
-import java.lang.*;
 import java.lang.reflect.*;
 
 public class Bean {
===================================================================
Checking out kaffe/test/regression/BeanBug.java
RCS:  /home/cvs/kaffe/kaffe/test/regression/BeanBug.java,v
VERS: 1.6
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/test/regression/BeanBug.java	Sun Nov 11 15:48:17 2007
@@ -0,0 +1,66 @@
+/*
+ * tests that listener types are properly set and printed.
+ * Submitted by Moses DeJong <dejong at cs.umn.edu>
+ */
+import java.beans.*;
+ 
+public class BeanBug {
+    public static void main(String[] argv) throws Exception {
+ 
+        Class cls = java.awt.Button.class;
+ 
+        BeanInfo beanInfo = Introspector.getBeanInfo(cls);
+ 
+        EventSetDescriptor[] events = beanInfo.getEventSetDescriptors();
+ 
+        for (int i=0; i < events.length ; i++) {
+ 
+            Class lsnType = events[i].getListenerType();
+ 
+            if (lsnType == null) {
+                throw new NullPointerException("index " + i);
+            }
+	    System.out.println(events[i].getAddListenerMethod());
+	    System.out.println(events[i].getRemoveListenerMethod());
+	    System.out.println(lsnType);
+        }
+	System.out.flush();
+    }
+}
+
+// Sort output
+/* Expected Output:
+interface java.awt.event.ActionListener
+interface java.awt.event.ComponentListener
+interface java.awt.event.FocusListener
+interface java.awt.event.HierarchyBoundsListener
+interface java.awt.event.HierarchyListener
+interface java.awt.event.InputMethodListener
+interface java.awt.event.KeyListener
+interface java.awt.event.MouseListener
+interface java.awt.event.MouseMotionListener
+interface java.awt.event.MouseWheelListener
+interface java.beans.PropertyChangeListener
+public synchronized void java.awt.Button.addActionListener(java.awt.event.ActionListener)
+public synchronized void java.awt.Button.removeActionListener(java.awt.event.ActionListener)
+public synchronized void java.awt.Component.addComponentListener(java.awt.event.ComponentListener)
+public synchronized void java.awt.Component.addFocusListener(java.awt.event.FocusListener)
+public synchronized void java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener)
+public synchronized void java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener)
+public synchronized void java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener)
+public synchronized void java.awt.Component.addKeyListener(java.awt.event.KeyListener)
+public synchronized void java.awt.Component.addMouseListener(java.awt.event.MouseListener)
+public synchronized void java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener)
+public synchronized void java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener)
+public synchronized void java.awt.Component.removeComponentListener(java.awt.event.ComponentListener)
+public synchronized void java.awt.Component.removeFocusListener(java.awt.event.FocusListener)
+public synchronized void java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener)
+public synchronized void java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener)
+public synchronized void java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener)
+public synchronized void java.awt.Component.removeKeyListener(java.awt.event.KeyListener)
+public synchronized void java.awt.Component.removeMouseListener(java.awt.event.MouseListener)
+public synchronized void java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener)
+public synchronized void java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener)
+public void java.awt.Component.addPropertyChangeListener(java.beans.PropertyChangeListener)
+public void java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener)
+*/
Index: kaffe/test/regression/ClassGC.java
diff -u kaffe/test/regression/ClassGC.java:1.8 kaffe/test/regression/ClassGC.java:1.9
--- kaffe/test/regression/ClassGC.java:1.8	Thu Dec  8 21:29:27 2005
+++ kaffe/test/regression/ClassGC.java	Sun Nov 11 15:46:57 2007
@@ -4,7 +4,6 @@
  * @author Godmar Back <gback at cs.utah.edu>
  */
 import java.io.*;
-import java.lang.reflect.*;
 
 public class ClassGC extends ClassLoader {
     // Make sure our helper classers are compiled from the test script
Index: kaffe/test/regression/ClassGCTest.java
diff -u kaffe/test/regression/ClassGCTest.java:1.4 kaffe/test/regression/ClassGCTest.java:1.5
--- kaffe/test/regression/ClassGCTest.java:1.4	Fri Feb 21 09:51:11 2003
+++ kaffe/test/regression/ClassGCTest.java	Sun Nov 11 15:46:57 2007
@@ -3,8 +3,6 @@
  *
  * @author Godmar Back <gback at cs.utah.edu>
  */
-import java.io.*;
-import java.lang.reflect.*;
 
 public class ClassGCTest
 {
Index: kaffe/test/regression/ClassGCTestLater.java
diff -u kaffe/test/regression/ClassGCTestLater.java:1.3 kaffe/test/regression/ClassGCTestLater.java:1.4
--- kaffe/test/regression/ClassGCTestLater.java:1.3	Fri Jun  1 19:25:20 2001
+++ kaffe/test/regression/ClassGCTestLater.java	Sun Nov 11 15:46:57 2007
@@ -3,8 +3,7 @@
  *
  * @author Godmar Back <gback at cs.utah.edu>
  */
-import java.io.*;
-import java.lang.reflect.*;
+import java.lang.reflect.Constructor;
 
 public class ClassGCTestLater
 {
Index: kaffe/test/regression/ConstructorTest.java
diff -u kaffe/test/regression/ConstructorTest.java:1.3 kaffe/test/regression/ConstructorTest.java:1.4
--- kaffe/test/regression/ConstructorTest.java:1.3	Sat Mar 16 18:37:00 2002
+++ kaffe/test/regression/ConstructorTest.java	Sun Nov 11 15:46:57 2007
@@ -9,7 +9,7 @@
   throws IllegalAccessException, InstantiationException
   {
     try {
-	Object o = ConstructorTest.class.newInstance();
+	ConstructorTest.class.newInstance();
     } catch (InstantiationException e) {
 	System.out.println("Success.");
 	return;
Index: kaffe/test/regression/DoubleBug.java
diff -u kaffe/test/regression/DoubleBug.java:1.3 kaffe/test/regression/DoubleBug.java:1.4
--- kaffe/test/regression/DoubleBug.java:1.3	Fri Feb 12 13:51:08 1999
+++ kaffe/test/regression/DoubleBug.java	Sun Nov 11 15:46:57 2007
@@ -5,7 +5,7 @@
 
     static boolean checkValid(String num) {
 	try {
-	    double d = Double.valueOf(num).doubleValue();
+	    Double.valueOf(num).doubleValue();
 	    return true;
 	}
 	catch (NumberFormatException e) {
Index: kaffe/test/regression/DoubleIEEE.java
diff -u kaffe/test/regression/DoubleIEEE.java:1.1 kaffe/test/regression/DoubleIEEE.java:1.2
--- kaffe/test/regression/DoubleIEEE.java:1.1	Wed Jun 15 12:39:56 2005
+++ kaffe/test/regression/DoubleIEEE.java	Sun Nov 11 15:46:57 2007
@@ -1,7 +1,6 @@
 /* This testcase is taken from
  * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=255502
  */
-import java.lang.*;
 
 public class DoubleIEEE {
     volatile double x, y, z;
Index: kaffe/test/regression/ExceptionTestClassLoader.java
diff -u kaffe/test/regression/ExceptionTestClassLoader.java:1.4 kaffe/test/regression/ExceptionTestClassLoader.java:1.5
--- kaffe/test/regression/ExceptionTestClassLoader.java:1.4	Fri Feb 21 09:51:11 2003
+++ kaffe/test/regression/ExceptionTestClassLoader.java	Sun Nov 11 15:46:57 2007
@@ -6,7 +6,6 @@
  * @author Benjamin Reed <breed at almaden.ibm.com>
  */
 import java.io.*;
-import java.util.*;
 import java.lang.reflect.*;
 
 public class ExceptionTestClassLoader extends ClassLoader {
@@ -50,7 +49,6 @@
   }
 
   public static void main( String args[] ) {
-    Vector v = new Vector();
     ClassLoader cl = new ExceptionTestClassLoader();
     try {
       Class classArgs[] = new Class[1];
Index: kaffe/test/regression/ExceptionTestClassLoader2.java
diff -u kaffe/test/regression/ExceptionTestClassLoader2.java:1.5 kaffe/test/regression/ExceptionTestClassLoader2.java:1.6
--- kaffe/test/regression/ExceptionTestClassLoader2.java:1.5	Fri Feb 21 09:51:11 2003
+++ kaffe/test/regression/ExceptionTestClassLoader2.java	Sun Nov 11 15:46:57 2007
@@ -12,7 +12,6 @@
  * @author Benjamin Reed <breed at almaden.ibm.com>
  */
 import java.io.*;
-import java.util.*;
 import java.lang.reflect.*;
 
 public class ExceptionTestClassLoader2 extends ClassLoader {
@@ -58,7 +57,6 @@
   }
 
   public static void main( String args[] ) {
-    Vector v = new Vector();
     ClassLoader cl = new ExceptionTestClassLoader2();
 
     try {
Index: kaffe/test/regression/FPUStack.java
diff -u kaffe/test/regression/FPUStack.java:1.2 kaffe/test/regression/FPUStack.java:1.3
--- kaffe/test/regression/FPUStack.java:1.2	Wed Dec 27 06:20:30 2000
+++ kaffe/test/regression/FPUStack.java	Sun Nov 11 15:46:57 2007
@@ -76,8 +76,8 @@
 	System.out.println("test_good()");
 	while (true) {
 	    // FPU return values are store and store call is not elimitated
-	    double integrate = Q.integrate(1);
-	    double stop = Q.stop();
+	    Q.integrate(1);
+	    Q.stop();
 	    System.out.println ("[1] Q.read() " + Q.read());
 	    System.out.println ("[2] Q.read() " + Q.read());
 	    if (Q.can_stop()) break;
@@ -90,8 +90,8 @@
 	System.out.println("ftest_good()");
 	while (true) {
 	    // FPU return values are store and store call is not elimitated
-	    float fintegrate = Q.fintegrate(1);
-	    float fstop = Q.fstop();
+	    Q.fintegrate(1);
+	    Q.fstop();
 	    System.out.println ("[1] Q.fread() " + Q.fread());
 	    System.out.println ("[2] Q.fread() " + Q.fread());
 	    if (Q.can_stop()) break;
@@ -126,8 +126,8 @@
 	System.out.println("test_good_inline()");
 	// FPU return values are store but store call is elimitated,
 	// JIT _must_ remove the result from the FPU Stack.
-	double integrate = Q.integrate(1);
-	double stop = Q.stop();
+	Q.integrate(1);
+	Q.stop();
 	System.out.println ("[1] Q.read() " + Q.read());
 	System.out.println ("[2] Q.read() " + Q.read());
     }
@@ -138,8 +138,8 @@
 	System.out.println("ftest_good_inline()");
 	// FPU return values are store but store call is elimitated,
 	// JIT _must_ remove the result from the FPU Stack.
-	float fintegrate = Q.fintegrate(1);
-	float fstop = Q.fstop();
+	Q.fintegrate(1);
+	Q.fstop();
 	System.out.println ("[1] Q.fread() " + Q.fread());
 	System.out.println ("[2] Q.fread() " + Q.fread());
     }
@@ -148,12 +148,9 @@
     public static double dstore(double a) {
 	// Test case for PR#737
 	// Author: Stas Sergeev <stas.orel at mailcity.com>
-	double x0;
 	double deltaX = 1.0;
-	double deltaY = 1.0;
 	double eps = 0.01;
 
-        x0 = a - eps;
         deltaX = 2 * eps;
         return deltaX;
     }
@@ -169,12 +166,9 @@
     public static float fstore(float a) {
 	// Test case for PR#737
 	// Author: Stas Sergeev <stas.orel at mailcity.com>
-	float x0;
 	float deltaX = 1.0f;
-	float deltaY = 1.0f;
 	float eps = 0.01f;
 
-        x0 = a - eps;
         deltaX = 2 * eps;
         return deltaX;
     }
Index: kaffe/test/regression/FileChecks.java
diff -u kaffe/test/regression/FileChecks.java:1.2 kaffe/test/regression/FileChecks.java:1.3
--- kaffe/test/regression/FileChecks.java:1.2	Wed Jul  3 21:02:21 2002
+++ kaffe/test/regression/FileChecks.java	Sun Nov 11 15:46:57 2007
@@ -9,7 +9,7 @@
 	{
 		try
 		{
-			FileInputStream     fis  = new FileInputStream(".");
+			new FileInputStream(".");
 			System.out.println("1 FAIL! Should throw java.io.FileNotFoundException!");
 			System.exit(1);
 		}
@@ -21,7 +21,7 @@
 		try
 		{
 			File                file = new File(".");
-			FileInputStream     fis  = new FileInputStream(file);
+			new FileInputStream(file);
 			System.out.println("2 FAIL! Should throw java.io.FileNotFoundException!");
 			System.exit(1);
 		}
@@ -32,7 +32,7 @@
 
 		try
 		{
-			FileOutputStream     fis  = new FileOutputStream(".");
+			new FileOutputStream(".");
 			System.out.println("3 FAIL! Should throw java.io.FileNotFoundException!");
 			System.exit(1);
 		}
@@ -44,7 +44,7 @@
 		try
 		{
 			File                file = new File(".");
-			FileOutputStream     fis  = new FileOutputStream(file);
+			new FileOutputStream(file);
 			System.out.println("4 FAIL! Should throw java.io.FileNotFoundException!");
 			System.exit(1);
 		}
@@ -56,7 +56,7 @@
 		try
 		{
 			File                file = new File("FileChecks.class"); // should exist
-			FileInputStream     fis  = new FileInputStream(file);
+			new FileInputStream(file);
 			System.out.println("5 Success.");
 		}
 		catch (FileNotFoundException e)
Index: kaffe/test/regression/GetField.java
diff -u kaffe/test/regression/GetField.java:1.3 kaffe/test/regression/GetField.java:1.4
--- kaffe/test/regression/GetField.java:1.3	Mon May 30 21:16:11 2005
+++ kaffe/test/regression/GetField.java	Sun Nov 11 15:46:57 2007
@@ -9,7 +9,6 @@
 class GetField {
 	public int TEST = 10;
 	public static int STEST = 20;
-	private static int PSTEST = 30;
 	public static void main(String args[]) {
 		Field fld;
 		Class cls = GetField.class;
Index: kaffe/test/regression/InitTest.java
diff -u kaffe/test/regression/InitTest.java:1.2 kaffe/test/regression/InitTest.java:1.3
--- kaffe/test/regression/InitTest.java:1.2	Fri Feb 12 13:51:09 1999
+++ kaffe/test/regression/InitTest.java	Sun Nov 11 15:46:57 2007
@@ -9,10 +9,8 @@
 
 	public static void main(String argv[] )
 	{
-		int x;
 		if ( argv.length > 10 )
 		{
-			x = Class1.field;
 			Class1.field = 5;
 			Class3.runMe();
 		}
@@ -21,8 +19,6 @@
 			Class2.field = 5;
 			Class2.runMe();
 		}
-
-		x = Class4.finalfield;
 
 		if ( passed )
 			System.out.println("Success 2.");
Index: kaffe/test/regression/InputStreamTest.java
diff -u kaffe/test/regression/InputStreamTest.java:1.2 kaffe/test/regression/InputStreamTest.java:1.3
--- kaffe/test/regression/InputStreamTest.java:1.2	Sun Nov  2 13:29:38 2003
+++ kaffe/test/regression/InputStreamTest.java	Sun Nov 11 15:46:57 2007
@@ -3,15 +3,15 @@
 public class InputStreamTest {
         static public void main (String args[]) {
                 try {
-                        StringBufferInputStream sbis =
-                                new
-StringBufferInputStream("foobar\r\nxbarfoo\rx");
+			byte [] chars = "foobar\r\nxbarfoo\rx".getBytes("US-ASCII");
+                        ByteArrayInputStream bais =
+                                new ByteArrayInputStream(chars);
                         DataInputStream dis = new DataInputStream(sbis);
 
                         System.out.println(dis.readLine());
-                        System.out.println(sbis.read());
+                        System.out.println(bais.read());
                         System.out.println(dis.readLine());
-                        System.out.println(sbis.read());
+                        System.out.println(bais.read());
 			System.out.println(dis.read());
 
                 } catch (IOException ioe) {
Index: kaffe/test/regression/LineNumberReaderTest.java
diff -u kaffe/test/regression/LineNumberReaderTest.java:1.4 kaffe/test/regression/LineNumberReaderTest.java:1.5
--- kaffe/test/regression/LineNumberReaderTest.java:1.4	Mon Dec 29 17:29:31 2003
+++ kaffe/test/regression/LineNumberReaderTest.java	Sun Nov 11 15:46:57 2007
@@ -29,7 +29,7 @@
     super();
 
     try {
-      LineNumberReader lnr = new LineNumberReader(null);
+      new LineNumberReader(null);
       success(this.getClass());
     }
     catch (Exception e) {
@@ -46,7 +46,7 @@
 
     try {
       StringReader sr = new StringReader(" ");
-      LineNumberReader lnr = new LineNumberReader(sr, 0);
+      new LineNumberReader(sr, 0);
       success(this.getClass());
     }
     catch (Exception e) {
@@ -63,7 +63,7 @@
 
     try {
       StringReader sr = new StringReader("X");
-      LineNumberReader lnr = new LineNumberReader(sr, -5);
+      new LineNumberReader(sr, -5);
       success(this.getClass());
     }
     catch (Exception e) {
Index: kaffe/test/regression/LostTrampolineFrame.java
diff -u kaffe/test/regression/LostTrampolineFrame.java:1.2 kaffe/test/regression/LostTrampolineFrame.java:1.3
--- kaffe/test/regression/LostTrampolineFrame.java:1.2	Sun Aug 31 22:09:26 2003
+++ kaffe/test/regression/LostTrampolineFrame.java	Sun Nov 11 15:46:57 2007
@@ -1,6 +1,4 @@
 
-import java.util.Vector;
-
 import java.io.File;
 import java.io.FileInputStream;
 
Index: kaffe/test/regression/MapTest.java
diff -u kaffe/test/regression/MapTest.java:1.3 kaffe/test/regression/MapTest.java:1.4
--- kaffe/test/regression/MapTest.java:1.3	Mon Jun 30 15:46:50 2003
+++ kaffe/test/regression/MapTest.java	Sun Nov 11 15:46:57 2007
@@ -178,7 +178,7 @@
     checkSorted(map);
 
     // Check values() method
-    Collection vals = map.values();
+    map.values();
     Arrays.fill(ary2, -1);
     for (Iterator i = es.iterator(); i.hasNext(); ) {
       Map.Entry e = (Map.Entry)i.next();
Index: kaffe/test/regression/MarkResetTest.java
diff -u kaffe/test/regression/MarkResetTest.java:1.7 kaffe/test/regression/MarkResetTest.java:1.8
--- kaffe/test/regression/MarkResetTest.java:1.7	Mon Apr  2 22:42:55 2001
+++ kaffe/test/regression/MarkResetTest.java	Sun Nov 11 15:46:57 2007
@@ -27,8 +27,10 @@
 	}
 
 	// Test BufferedInputStream
+	byte [] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };
+
         BufferedInputStream b =
-	  new BufferedInputStream(new StringBufferInputStream("ABCDEF"));
+	  new BufferedInputStream(new ByteArrayInputStream(chars));
         b.mark(3);
         b.read();
         b.read();
Index: kaffe/test/regression/MethodBug.java
diff -u kaffe/test/regression/MethodBug.java:1.3 kaffe/test/regression/MethodBug.java:1.4
--- kaffe/test/regression/MethodBug.java:1.3	Thu Feb 24 18:30:31 2000
+++ kaffe/test/regression/MethodBug.java	Sun Nov 11 15:46:57 2007
@@ -3,7 +3,6 @@
  * Submitted by Moses DeJong <dejong at cs.umn.edu>
  */
 import java.lang.reflect.*;
-import java.util.*;
  
  
 public class MethodBug {
Index: kaffe/test/regression/MethodErrors.java
diff -u kaffe/test/regression/MethodErrors.java:1.1 kaffe/test/regression/MethodErrors.java:1.2
--- kaffe/test/regression/MethodErrors.java:1.1	Sun Aug 31 22:09:26 2003
+++ kaffe/test/regression/MethodErrors.java	Sun Nov 11 15:46:57 2007
@@ -111,9 +111,7 @@
 
     public static void test9()
     {
-	ClassToInterface cti;
-
-	cti = new ClassToInterface();
+	new ClassToInterface();
     }
     
     public static void main(String args[])
Index: kaffe/test/regression/NetworkInterfaceTest.java
diff -u kaffe/test/regression/NetworkInterfaceTest.java:1.2 kaffe/test/regression/NetworkInterfaceTest.java:1.3
--- kaffe/test/regression/NetworkInterfaceTest.java:1.2	Wed Oct 19 20:16:40 2005
+++ kaffe/test/regression/NetworkInterfaceTest.java	Sun Nov 11 15:46:57 2007
@@ -2,7 +2,6 @@
 import java.util.Enumeration;
 
 import java.net.InetAddress;
-import java.net.SocketException;
 import java.net.NetworkInterface;
 
 public class NetworkInterfaceTest
@@ -17,16 +16,16 @@
 	}
 	try
 	{
-	    Enumeration enum;
+	    Enumeration enumeration;
 	    int lpc;
 	    
-	    enum = NetworkInterface.getNetworkInterfaces();
-	    for( lpc = 0; enum.hasMoreElements(); lpc++ )
+	    enumeration = NetworkInterface.getNetworkInterfaces();
+	    for( lpc = 0; enumeration.hasMoreElements(); lpc++ )
 	    {
 		NetworkInterface ni, ni2;
 		Enumeration ips;
 		
-		ni = (NetworkInterface)enum.nextElement();
+		ni = (NetworkInterface)enumeration.nextElement();
 		if( verbose )
 		{
 		    System.out.println("Detected interface #" + lpc);
@@ -65,12 +64,7 @@
 	    }
 	    System.out.println("Done");
 	}
-	catch(SocketException e)
-	{
-	    e.printStackTrace();
-	    System.exit(77);
-	}
-	catch(org.kaffe.util.NotImplemented e)
+	catch(Exception e)
 	{
 	    e.printStackTrace();
 	    System.exit(77);
Index: kaffe/test/regression/NullPointerTest.java
diff -u kaffe/test/regression/NullPointerTest.java:1.4 kaffe/test/regression/NullPointerTest.java:1.5
--- kaffe/test/regression/NullPointerTest.java:1.4	Thu Jun 22 21:46:12 2000
+++ kaffe/test/regression/NullPointerTest.java	Sun Nov 11 15:46:57 2007
@@ -2,8 +2,6 @@
  * test that caught null pointers exceptions in finalizers work correctly
  * and that local variables are accessible in null pointer exception handlers.
  */
-import java.io.*;
-
 public class NullPointerTest {
 
     static String s;
@@ -22,7 +20,7 @@
 	    try {
 		local_s = "Perfect";
 		/* trigger null pointer exception */
-		String x = yuck.toLowerCase();
+		yuck.toLowerCase();
 	    } catch (Exception _) {
 		/* 
 		 * when the null pointer exception is caught, we must still
Index: kaffe/test/regression/PrimordialLoaderTest.java
diff -u kaffe/test/regression/PrimordialLoaderTest.java:1.1 kaffe/test/regression/PrimordialLoaderTest.java:1.2
--- kaffe/test/regression/PrimordialLoaderTest.java:1.1	Tue Dec 21 16:51:17 2004
+++ kaffe/test/regression/PrimordialLoaderTest.java	Sun Nov 11 15:46:57 2007
@@ -16,11 +16,11 @@
  
 		System.out.println (url.getProtocol()+" "+((JarURLConnection)url.openConnection()).getEntryName());
 
-		java.util.Enumeration enum = ClassLoader.getSystemResources("java/lang/Object.class");
+		java.util.Enumeration enumeration = ClassLoader.getSystemResources("java/lang/Object.class");
 
-		while (enum.hasMoreElements())
+		while (enumeration.hasMoreElements())
 		{
-			url = (URL)enum.nextElement();
+			url = (URL)enumeration.nextElement();
 
 			System.out.println (url.getProtocol()+" "+((JarURLConnection)url.openConnection()).getEntryName());
 		}
Index: kaffe/test/regression/ProcessClassInst.java
diff -u kaffe/test/regression/ProcessClassInst.java:1.19 kaffe/test/regression/ProcessClassInst.java:1.20
--- kaffe/test/regression/ProcessClassInst.java:1.19	Wed Jun 13 22:19:02 2007
+++ kaffe/test/regression/ProcessClassInst.java	Sun Nov 11 15:46:57 2007
@@ -4,7 +4,6 @@
  * @author Godmar Back <gback at cs.utah.edu>
  */
 import java.util.Vector;
-import java.lang.reflect.*;
 
 class Base {
     static boolean useme;
@@ -70,7 +69,7 @@
 
 	Class cc = v.elementAt(0).getClass();
 	try {
-		final Object ni = cc.newInstance();
+		cc.newInstance();
 	}
 	catch (NoClassDefFoundError e) {
 		System.out.println(e);
Index: kaffe/test/regression/ReaderReadVoidTest.java
diff -u kaffe/test/regression/ReaderReadVoidTest.java:1.1 kaffe/test/regression/ReaderReadVoidTest.java:1.2
--- kaffe/test/regression/ReaderReadVoidTest.java:1.1	Wed Jan 12 20:38:17 2000
+++ kaffe/test/regression/ReaderReadVoidTest.java	Sun Nov 11 15:46:57 2007
@@ -37,8 +37,6 @@
 
 	public static void main(String[] args) {
 		PseudoReader pr = new PseudoReader();
-		int chr1 = 0;
-		int chr2 = 0;
 
 		PseudoThread thread1 = new PseudoThread(pr, "T1");
 		PseudoThread thread2 = new PseudoThread(pr, "T2");
@@ -112,8 +110,7 @@
 					+ "waiting!");
 				*/
 
-				Thread.currentThread().sleep(
-					((PseudoThread)Thread.currentThread()).timer);
+				Thread.sleep(((PseudoThread)Thread.currentThread()).timer);
 				/*
 				System.out.println(Thread.currentThread().toString() 
 					+ "free!");
Index: kaffe/test/regression/Reflect.java
diff -u kaffe/test/regression/Reflect.java:1.17 kaffe/test/regression/Reflect.java:1.18
--- kaffe/test/regression/Reflect.java:1.17	Wed Jun 13 22:40:36 2007
+++ kaffe/test/regression/Reflect.java	Sun Nov 11 15:46:57 2007
@@ -1,4 +1,3 @@
-import java.lang.*;
 import java.lang.reflect.*;
 
 public class Reflect {
Index: kaffe/test/regression/ReflectInvoke.java
diff -u kaffe/test/regression/ReflectInvoke.java:1.3 kaffe/test/regression/ReflectInvoke.java:1.4
--- kaffe/test/regression/ReflectInvoke.java:1.3	Mon Jan  6 17:14:38 2003
+++ kaffe/test/regression/ReflectInvoke.java	Sun Nov 11 15:46:57 2007
@@ -1,4 +1,3 @@
-import java.lang.*;
 import java.lang.reflect.*;
 
 /*
Index: kaffe/test/regression/ReflectMultiArray.java
diff -u kaffe/test/regression/ReflectMultiArray.java:1.2 kaffe/test/regression/ReflectMultiArray.java:1.3
--- kaffe/test/regression/ReflectMultiArray.java:1.2	Fri Feb 12 13:38:45 1999
+++ kaffe/test/regression/ReflectMultiArray.java	Sun Nov 11 15:46:57 2007
@@ -3,6 +3,6 @@
     public static void main(String[] argv) {
 	int[] count= new int[1] ; // 1 seems to be the problem
 	count[0]= 1 ;
-	Object array= Array.newInstance(ReflectMultiArray.class, count) ;
+	Array.newInstance(ReflectMultiArray.class, count) ;
     }
 }
Index: kaffe/test/regression/SecurityMan2.java
diff -u kaffe/test/regression/SecurityMan2.java:1.1 kaffe/test/regression/SecurityMan2.java:1.2
--- kaffe/test/regression/SecurityMan2.java:1.1	Sat Jan 14 09:11:37 2006
+++ kaffe/test/regression/SecurityMan2.java	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,4 @@
 import java.net.*;
-import java.security.*;
 
 public class SecurityMan2 
 {
===================================================================
Checking out kaffe/test/regression/SoTimeout.java
RCS:  /home/cvs/kaffe/kaffe/test/regression/SoTimeout.java,v
VERS: 1.9
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/test/regression/SoTimeout.java	Sun Nov 11 15:48:18 2007
@@ -0,0 +1,81 @@
+/**
+ * Test socket timeouts for accept and read for simple stream sockets 
+ *
+ * @author Godmar Back <gback at cs.utah.edu>
+ */
+import java.net.*;
+import java.io.*;
+
+public class SoTimeout {
+    public static void main(String av[]) throws Exception {
+	int tryport = 45054;
+	ServerSocket server;
+	for(;;++tryport) {
+	    try {
+		server = new ServerSocket(tryport);
+		break;
+	    } catch (IOException _) {}
+	}
+        final int port = tryport;
+
+        Thread watchdog = new Thread() {
+            public void run() {
+                try {
+                    Thread.sleep(10000);
+                } catch (InterruptedException _) { }
+                System.out.println("Failure:   Time out.");
+                System.exit(-1);
+            }
+        };
+        watchdog.start();
+
+        Thread t = new Thread() {
+            public void run() {
+		try {
+		    Socket s = new Socket(InetAddress.getByName(null), port);
+		    try {
+			Thread.sleep(3000);
+		    } catch (InterruptedException e) {
+			System.out.println("Failure " + e);
+		    }
+		    OutputStream o = s.getOutputStream();
+		    o.write('1');
+            o.close();
+		} catch (Exception e) {
+		    System.out.println("Failure " + e);
+		}
+            }
+        };
+        server.setSoTimeout(1000);
+        Socket rsocket = null;
+	try {
+	    rsocket = server.accept(); 
+	} catch (SocketTimeoutException e) {
+	    // System.out.println(e);
+	    System.out.println("Success 1.");
+	}
+        t.start();
+	rsocket = server.accept(); 
+	System.out.println("Success 2.");
+        rsocket.setSoTimeout(2000);	// NB:	2 * 2000 > 3000
+	InputStream is = rsocket.getInputStream();
+        try {
+	    is.read();
+	} catch (InterruptedIOException e) {
+	    // System.out.println(e);
+	    System.out.println("Success 3.");
+	}
+	int b = is.read();
+	if (b == '1') {
+	    System.out.println("Success 4.");
+	}
+	System.exit(0);
+    }
+}
+
+/* Expected Output:
+Success 1.
+Success 2.
+Success 3.
+Success 4.
+*/
Index: kaffe/test/regression/TestFloatDouble.java
diff -u kaffe/test/regression/TestFloatDouble.java:1.2 kaffe/test/regression/TestFloatDouble.java:1.3
--- kaffe/test/regression/TestFloatDouble.java:1.2	Fri Feb 12 13:51:10 1999
+++ kaffe/test/regression/TestFloatDouble.java	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,3 @@
-import java.lang.*;
-
 class TestFloatDouble {
 	static boolean failed = false;
 
Index: kaffe/test/regression/TestGnuCrypto.java
diff -u kaffe/test/regression/TestGnuCrypto.java:1.2 kaffe/test/regression/TestGnuCrypto.java:1.3
--- kaffe/test/regression/TestGnuCrypto.java:1.2	Thu Feb  9 02:24:20 2006
+++ kaffe/test/regression/TestGnuCrypto.java	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,4 @@
 import gnu.javax.crypto.cipher.CipherFactory;
-import gnu.javax.crypto.cipher.IBlockCipher;
 
 import java.util.Iterator;
 
@@ -10,14 +9,12 @@
   public static final void main(String[] args)
   {
     String cipher;
-    IBlockCipher algorithm;
     for (Iterator it = CipherFactory.getNames().iterator(); it.hasNext(); )
       {
         cipher = (String) it.next();
         try
           {
-            algorithm = null;
-            algorithm = CipherFactory.getInstance(cipher);
+            CipherFactory.getInstance(cipher);
           } 
         catch (InternalError x) 
 	  {
Index: kaffe/test/regression/TestIntLong.java
diff -u kaffe/test/regression/TestIntLong.java:1.2 kaffe/test/regression/TestIntLong.java:1.3
--- kaffe/test/regression/TestIntLong.java:1.2	Fri Feb 12 13:51:11 1999
+++ kaffe/test/regression/TestIntLong.java	Sun Nov 11 15:46:57 2007
@@ -1,5 +1,3 @@
-import java.lang.*;
-
 class TestIntLong {
 	static boolean failed = false;
 
Index: kaffe/test/regression/TestSerializable.java
diff -u kaffe/test/regression/TestSerializable.java:1.4 kaffe/test/regression/TestSerializable.java:1.5
--- kaffe/test/regression/TestSerializable.java:1.4	Wed Mar 24 01:17:48 1999
+++ kaffe/test/regression/TestSerializable.java	Sun Nov 11 15:46:57 2007
@@ -8,6 +8,7 @@
 {
     class help implements java.io.Serializable
     {
+	static final long serialVersionUID = -7043095406159607622L;
     }
 
     public static void main(String av[])
===================================================================
Checking out kaffe/test/regression/TestSerializable2.java
RCS:  /home/cvs/kaffe/kaffe/test/regression/TestSerializable2.java,v
VERS: 1.5
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/test/regression/TestSerializable2.java	Sun Nov 11 15:48:18 2007
@@ -0,0 +1,146 @@
+/**
+ * Test Serialization when a super class is not Serializable.
+ *
+ * @author Edouard G. Parmelan <egp at free.fr>
+ */
+import java.io.*;
+
+public class TestSerializable2
+{
+    // this class is serializable as <init>() is not private
+    static class NotSerialized {
+	static int count = 0;
+	public int magic = 123;
+
+	public NotSerialized(int dummy) {
+	    setMagic(321);
+	}
+
+	NotSerialized() {
+	    setMagic(999);
+	}
+
+	private void setMagic(int magic) {
+	    this.magic = magic;
+	}
+    }
+
+    static class Serialized
+	extends NotSerialized
+	implements Serializable
+    {
+	static int count = 0;
+	public int i;
+
+	public Serialized(int i) {
+	    super(i);
+	    this.i = i;
+	}
+
+	public String toString() {
+	    return "Serialized-" + i + " magic " + magic;
+	}
+    }
+
+    // this class is not serializable as it does not have <init>()
+    static class NotSerializable1 {
+	static int count = 0;
+	public int magic = 123;
+
+	public NotSerializable1(int dummy) {
+	    setMagic(321);
+	}
+
+	private void setMagic(int magic) {
+	    this.magic = magic;
+	}
+    }
+
+    static class Serialized1
+	extends NotSerializable1
+	implements Serializable
+    {
+	static int count = 0;
+	public int i;
+
+	public Serialized1(int i) {
+	    super(i);
+	    this.i = i;
+	}
+
+	public String toString() {
+	    return "Serialized1-" + i + " magic " + magic;
+	}
+    }
+
+ 

*** Patch too long, truncated ***




More information about the kaffe mailing list