Index: modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java =================================================================== --- modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/crypto/src/test/java/javax/crypto/spec/RC2ParameterSpecTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -131,8 +131,8 @@ + "should not cause the change of internal array.", result[0] == ps.getIV()[0]); ps = new RC2ParameterSpec(effectiveKeyBits); - assertTrue("The getIV() method should return null if the parameter " - + "set does not contain iv.", ps.getIV() == null); + assertNull("The getIV() method should return null if the parameter " + + "set does not contain iv.", ps.getIV()); } /** Index: modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java =================================================================== --- modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/crypto/src/test/java/javax/crypto/spec/RC5ParameterSpecTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -192,8 +192,8 @@ + "should not cause the change of internal array.", result[0] == ps.getIV()[0]); ps = new RC5ParameterSpec(version, rounds, wordSize); - assertTrue("The getIV() method should return null if the parameter " - + "set does not contain IV.", ps.getIV() == null); + assertNull("The getIV() method should return null if the parameter " + + "set does not contain IV.", ps.getIV()); } /** Index: modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java =================================================================== --- modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/crypto/src/test/java/javax/crypto/spec/PBEKeySpecTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -253,8 +253,8 @@ + "should not cause the change of internal array.", result[0] == pbeks.getSalt()[0]); pbeks = new PBEKeySpec(password); - assertTrue("The getSalt() method should return null if the salt " - + "is not specified.", pbeks.getSalt() == null); + assertNull("The getSalt() method should return null if the salt " + + "is not specified.", pbeks.getSalt()); } /** Index: modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/zip/ZipEntryTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -81,7 +81,7 @@ public void test_getComment() { // Test for method java.lang.String java.util.zip.ZipEntry.getComment() ZipEntry zipEntry = new ZipEntry("zippy.zip"); - assertTrue("Incorrect Comment Returned.", zipEntry.getComment() == null); + assertNull("Incorrect Comment Returned.", zipEntry.getComment()); zipEntry.setComment("This Is A Comment"); assertTrue("Incorrect Comment Returned.", zipEntry.getComment().equals( "This Is A Comment")); @@ -109,8 +109,8 @@ */ public void test_getExtra() { // Test for method byte [] java.util.zip.ZipEntry.getExtra() - assertTrue("Incorrect extra information returned", - zentry.getExtra() == null); + assertNull("Incorrect extra information returned", + zentry.getExtra()); byte[] ba = { 'T', 'E', 'S', 'T' }; zentry = new ZipEntry("test.tst"); zentry.setExtra(ba); @@ -183,7 +183,7 @@ "Set comment using api")); String n = null; zentry.setComment(n); - assertTrue("Comment not correctly set", zentry.getComment() == null); + assertNull("Comment not correctly set", zentry.getComment()); StringBuffer s = new StringBuffer(); for (int i = 0; i < 0xFFFF; i++) s.append('a'); Index: modules/archive/src/test/java/tests/api/java/util/jar/AttributesTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/AttributesTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/AttributesTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -49,14 +49,14 @@ public void test_clear() { // Test for method void java.util.jar.Attributes.clear() a.clear(); - assertTrue("a) All entries should be null after clear", - a.get("1") == null); - assertTrue("b) All entries should be null after clear", - a.get("2") == null); - assertTrue("c) All entries should be null after clear", - a.get("3") == null); - assertTrue("d) All entries should be null after clear", - a.get("4") == null); + assertNull("a) All entries should be null after clear", + a.get("1")); + assertNull("b) All entries should be null after clear", + a.get("2")); + assertNull("c) All entries should be null after clear", + a.get("3")); + assertNull("d) All entries should be null after clear", + a.get("4")); assertTrue("Should not contain any keys", !a.containsKey("1")); } @@ -125,7 +125,7 @@ // Test for method java.lang.Object // java.util.jar.Attributes.get(java.lang.Object) assertTrue("a) Incorrect value returned", a.getValue("1").equals("one")); - assertTrue("b) Incorrect value returned", a.getValue("0") == null); + assertNull("b) Incorrect value returned", a.getValue("0")); } /** @@ -192,7 +192,7 @@ // java.util.jar.Attributes.remove(java.lang.Object) a.remove(new Attributes.Name("1")); a.remove(new Attributes.Name("3")); - assertTrue("Should have been removed", a.getValue("1") == null); + assertNull("Should have been removed", a.getValue("1")); assertTrue("Should not have been removed", a.getValue("4").equals( "four")); } Index: modules/archive/src/test/java/tests/api/java/util/jar/ManifestTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/ManifestTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/ManifestTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -129,8 +129,8 @@ public void test_getAttributesLjava_lang_String() { // Test for method java.util.jar.Attributes // java.util.jar.Manifest.getAttributes(java.lang.String) - assertTrue("Should not exist", - m2.getAttributes("Doesn't Exist") == null); + assertNull("Should not exist", + m2.getAttributes("Doesn't Exist")); assertTrue("Should exist", m2.getAttributes("HasAttributes.txt").get( new Attributes.Name("MyAttribute")).equals("OK")); } @@ -141,7 +141,7 @@ public void test_getEntries() { // Test for method java.util.Map java.util.jar.Manifest.getEntries() Map myMap = m2.getEntries(); - assertTrue("Shouldn't exist", myMap.get("Doesn't exist") == null); + assertNull("Shouldn't exist", myMap.get("Doesn't exist")); assertTrue("Should exist", ((Attributes) myMap.get("HasAttributes.txt")).get( new Attributes.Name("MyAttribute")).equals("OK")); Index: modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarInputStreamTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -84,8 +84,8 @@ .getInputStream(); JarInputStream jis = new JarInputStream(is); m = jis.getManifest(); - assertTrue("The jar input stream should not have a manifest", - m == null); + assertNull("The jar input stream should not have a manifest", + m); is = new URL(jarName).openConnection().getInputStream(); jis = new JarInputStream(is); Index: modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarFileTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -249,8 +249,8 @@ try { Support_Resources.copyFile(resources, null, jarName2); JarFile jarFile = new JarFile(new File(resources, jarName2)); - assertTrue("Error--should have returned null", jarFile - .getManifest() == null); + assertNull("Error--should have returned null", jarFile + .getManifest()); jarFile.close(); } catch (Exception e) { fail("Exception during 2nd test: " + e.toString()); @@ -334,7 +334,7 @@ try { JarFile jf = new JarFile(localFile); InputStream in = jf.getInputStream(new JarEntry("invalid")); - assertTrue("Got stream for non-existent entry", in == null); + assertNull("Got stream for non-existent entry", in); } catch (Exception e) { fail("Exception during test 2: " + e); } @@ -366,7 +366,7 @@ JarEntry entry = new JarEntry(entryName3); InputStream in = jar.getInputStream(entry); in.read(new byte[1077]); - assertTrue("found certificates", entry.getCertificates() == null); + assertNull("found certificates", entry.getCertificates()); } catch (Exception e) { fail("Exception during test 4: " + e); } Index: modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java =================================================================== --- modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/archive/src/test/java/tests/api/java/util/jar/JarEntryTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -87,8 +87,8 @@ try { jarEntry = attrJar.getJarEntry(attEntryName2); - assertTrue("Shouldn't have any Manifest attributes", jarEntry - .getAttributes() == null); + assertNull("Shouldn't have any Manifest attributes", jarEntry + .getAttributes()); attrJar.close(); } catch (Exception e) { fail("Exception during 1st test: " + e.toString()); @@ -103,8 +103,8 @@ // java.util.jar.JarEntry.getCertificates() zipEntry = jarFile.getEntry(entryName2); jarEntry = new JarEntry(zipEntry); - assertTrue("Shouldn't have any Certificates", jarEntry - .getCertificates() == null); + assertNull("Shouldn't have any Certificates", jarEntry + .getCertificates()); } /** Index: modules/text/src/test/java/tests/api/java/text/FieldPositionTest.java =================================================================== --- modules/text/src/test/java/tests/api/java/text/FieldPositionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/text/src/test/java/tests/api/java/text/FieldPositionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -152,9 +152,9 @@ fpos.getFieldAttribute() == DateFormat.Field.TIME_ZONE); FieldPosition fpos2 = new FieldPosition(DateFormat.TIMEZONE_FIELD); - assertTrue( + assertNull( "FieldPosition(DateFormat.TIMEZONE_FIELD) should have caused getFieldAttribute to return null", - fpos2.getFieldAttribute() == null); + fpos2.getFieldAttribute()); } /** Index: modules/text/src/test/java/tests/api/java/text/DecimalFormatSymbolsTest.java =================================================================== --- modules/text/src/test/java/tests/api/java/text/DecimalFormatSymbolsTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/text/src/test/java/tests/api/java/text/DecimalFormatSymbolsTest.java 2006-04-16 10:59:16.000000000 +0100 @@ -72,34 +72,34 @@ "KR")); assertTrue("Test1: Returned incorrect currency", dfs1.getCurrency() == currK); - assertTrue("Test1: Returned incorrect currencySymbol", dfs1 - .getCurrencySymbol().equals("\uffe6")); - assertTrue("Test1: Returned incorrect intlCurrencySymbol", dfs1 - .getInternationalCurrencySymbol().equals("KRW")); + assertEquals("Test1: Returned incorrect currencySymbol", "\uffe6", dfs1 + .getCurrencySymbol()); + assertEquals("Test1: Returned incorrect intlCurrencySymbol", "KRW", dfs1 + .getInternationalCurrencySymbol()); dfs1 = new DecimalFormatSymbols(new Locale("", "KR")); assertTrue("Test2: Returned incorrect currency", dfs1.getCurrency() == currK); - assertTrue("Test2: Returned incorrect currencySymbol", dfs1 - .getCurrencySymbol().equals("KRW")); - assertTrue("Test2: Returned incorrect intlCurrencySymbol", dfs1 - .getInternationalCurrencySymbol().equals("KRW")); + assertEquals("Test2: Returned incorrect currencySymbol", "KRW", dfs1 + .getCurrencySymbol()); + assertEquals("Test2: Returned incorrect intlCurrencySymbol", "KRW", dfs1 + .getInternationalCurrencySymbol()); dfs1 = new DecimalFormatSymbols(new Locale("ko", "")); assertTrue("Test3: Returned incorrect currency", dfs1.getCurrency() == currX); - assertTrue("Test3: Returned incorrect currencySymbol", dfs1 - .getCurrencySymbol().equals("\u00a4")); - assertTrue("Test3: Returned incorrect intlCurrencySymbol", dfs1 - .getInternationalCurrencySymbol().equals("XXX")); + assertEquals("Test3: Returned incorrect currencySymbol", "\u00a4", dfs1 + .getCurrencySymbol()); + assertEquals("Test3: Returned incorrect intlCurrencySymbol", "XXX", dfs1 + .getInternationalCurrencySymbol()); dfs1 = new DecimalFormatSymbols(new Locale("fr", "FR")); assertTrue("Test4: Returned incorrect currency", dfs1.getCurrency() == currE); - assertTrue("Test4: Returned incorrect currencySymbol", dfs1 - .getCurrencySymbol().equals("\u20ac")); - assertTrue("Test4: Returned incorrect intlCurrencySymbol", dfs1 - .getInternationalCurrencySymbol().equals("EUR")); + assertEquals("Test4: Returned incorrect currencySymbol", "\u20ac", dfs1 + .getCurrencySymbol()); + assertEquals("Test4: Returned incorrect intlCurrencySymbol", "EUR", dfs1 + .getInternationalCurrencySymbol()); // RI fails these tests since it doesn't have the PREEURO variant // dfs1 = new DecimalFormatSymbols(new Locale("fr", "FR","PREEURO")); @@ -115,8 +115,8 @@ * @tests java.text.DecimalFormatSymbols#getCurrencySymbol() */ public void test_getCurrencySymbol() { - assertTrue("Returned incorrect currencySymbol", dfsUS - .getCurrencySymbol().equals("$")); + assertEquals("Returned incorrect currencySymbol", "$", dfsUS + .getCurrencySymbol()); } /** @@ -158,8 +158,8 @@ * @tests java.text.DecimalFormatSymbols#getInternationalCurrencySymbol() */ public void test_getInternationalCurrencySymbol() { - assertTrue("Returned incorrect InternationalCurrencySymbol", dfsUS - .getInternationalCurrencySymbol().equals("USD")); + assertEquals("Returned incorrect InternationalCurrencySymbol", "USD", dfsUS + .getInternationalCurrencySymbol()); } /** @@ -176,8 +176,8 @@ */ public void test_getNaN() { dfs.setNaN("NAN!!"); - assertTrue("Returned incorrect nan symbol", dfs.getNaN() - .equals("NAN!!")); + assertEquals("Returned incorrect nan symbol", "NAN!!", dfs.getNaN() + ); } /** @@ -293,12 +293,12 @@ String symbol = dfs.getCurrencySymbol(); dfs.setInternationalCurrencySymbol("bogus"); - assertTrue("Test2: Returned incorrect currency", - dfs.getCurrency() == null); + assertNull("Test2: Returned incorrect currency", + dfs.getCurrency()); assertTrue("Test2: Returned incorrect currency symbol", dfs .getCurrencySymbol().equals(symbol)); - assertTrue("Test2: Returned incorrect international currency symbol", - dfs.getInternationalCurrencySymbol().equals("bogus")); + assertEquals("Test2: Returned incorrect international currency symbol", + "bogus", dfs.getInternationalCurrencySymbol()); } /** @@ -315,8 +315,8 @@ */ public void test_setNaNLjava_lang_String() { dfs.setNaN("NAN!!"); - assertTrue("Returned incorrect nan symbol", dfs.getNaN() - .equals("NAN!!")); + assertEquals("Returned incorrect nan symbol", "NAN!!", dfs.getNaN() + ); } /** Index: modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java =================================================================== --- modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/text/src/test/java/tests/api/java/text/MessageFormatTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -99,7 +99,7 @@ .getInstance())); assertTrue("Wrong choice format", formats[3].equals(new ChoiceFormat( "0.0#low|1.0#high"))); - assertTrue("Wrong string format", formats[4] == null); + assertNull("Wrong string format", formats[4]); Date date = new Date(); FieldPosition pos = new FieldPosition(-1); @@ -178,7 +178,7 @@ assertTrue("Found formats", format.toPattern().equals("nothing")); format.applyPattern("{0}"); - assertTrue("Wrong format", format.getFormats()[0] == null); + assertNull("Wrong format", format.getFormats()[0]); assertTrue("Wrong pattern", format.toPattern().equals("{0}")); format.applyPattern("{0, \t\u001ftime }"); Index: modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java =================================================================== --- modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/sql/src/test/java/tests/api/java/sql/DriverManagerTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -207,7 +207,7 @@ .getConnection(invalidConnectionURLs[i]); assertFalse(theConnection != null); } catch (SQLException e) { - assertTrue(theConnection == null); + assertNull(theConnection); // System.out.println("testGetConnectionString: exception // message: " + // e.getMessage() ); @@ -389,7 +389,7 @@ } // end method testGetLoginTimeout() public void testGetLogStream() { - assertTrue(DriverManager.getLogStream() == null); + assertNull(DriverManager.getLogStream()); DriverManager.setLogStream(testPrintStream); @@ -399,7 +399,7 @@ } // end method testGetLogStream() public void testGetLogWriter() { - assertTrue(DriverManager.getLogWriter() == null); + assertNull(DriverManager.getLogWriter()); DriverManager.setLogWriter(testPrintWriter); @@ -499,7 +499,7 @@ DriverManager.setLogStream(null); - assertTrue(DriverManager.getLogStream() == null); + assertNull(DriverManager.getLogStream()); // Now let's deal with the case where there is a SecurityManager in // place @@ -549,8 +549,8 @@ DriverManager.setLogWriter(null); - assertTrue("testDriverManager: Log writer not null:", DriverManager - .getLogWriter() == null); + assertNull("testDriverManager: Log writer not null:", DriverManager + .getLogWriter()); // Now let's deal with the case where there is a SecurityManager in // place Index: modules/luni/src/test/java/tests/api/java/lang/NoSuchFieldErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/NoSuchFieldErrorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/NoSuchFieldErrorTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -25,7 +25,7 @@ if (true) throw new NoSuchFieldError(); } catch (NoSuchFieldError e) { - assertTrue("Initializer failed.", e.getMessage() == null); + assertNull("Initializer failed.", e.getMessage()); assertTrue("To string failed.", e.toString().equals( "java.lang.NoSuchFieldError")); } Index: modules/luni/src/test/java/tests/api/java/lang/AssertionErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/AssertionErrorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/AssertionErrorTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -21,7 +21,7 @@ */ public void test_ObjectConstructor() { AssertionError error = new AssertionError(new String("hi")); - assertTrue("non-null cause", error.getCause() == null); + assertNull("non-null cause", error.getCause()); assertTrue(error.getMessage().equals("hi")); Exception exc = new NullPointerException(); error = new AssertionError(exc); Index: modules/luni/src/test/java/tests/api/java/lang/ThreadLocalTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ThreadLocalTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ThreadLocalTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -34,7 +34,7 @@ public void test_get() { // Test for method java.lang.Object java.lang.ThreadLocal.get() ThreadLocal l = new ThreadLocal(); - assertTrue("ThreadLocal's initial value is null", l.get() == null); + assertNull("ThreadLocal's initial value is null", l.get()); // The ThreadLocal has to run once for each thread that touches the // ThreadLocal @@ -112,8 +112,8 @@ // ThreadLocal is not inherited, so the other Thread should see it as // null - assertTrue("ThreadLocal's value in other Thread should be null", - THREADVALUE.result == null); + assertNull("ThreadLocal's value in other Thread should be null", + THREADVALUE.result); } Index: modules/luni/src/test/java/tests/api/java/lang/SystemTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/SystemTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/SystemTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -204,8 +204,8 @@ // Test for method java.lang.String // java.lang.System.setProperty(java.lang.String, java.lang.String) - assertTrue("Failed to return null", System.setProperty("testing", - "value1") == null); + assertNull("Failed to return null", System.setProperty("testing", + "value1")); assertTrue("Failed to return old value", System.setProperty("testing", "value2") == "value1"); assertTrue("Failed to find value", @@ -226,8 +226,8 @@ public void test_getSecurityManager() { // Test for method java.lang.SecurityManager // java.lang.System.getSecurityManager() - assertTrue("Returned incorrect SecurityManager", System - .getSecurityManager() == null); + assertNull("Returned incorrect SecurityManager", System + .getSecurityManager()); } /** Index: modules/luni/src/test/java/tests/api/java/lang/ThreadGroupTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ThreadGroupTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ThreadGroupTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -100,8 +100,8 @@ newGroup = new ThreadGroup(null, null); } catch (NullPointerException e) { } - assertTrue("Can't create a ThreadGroup with a null parent", - newGroup == null); + assertNull("Can't create a ThreadGroup with a null parent", + newGroup); newGroup = new ThreadGroup(getInitialThreadGroup(), null); assertTrue("Has to be possible to create a subgroup of current group", @@ -123,8 +123,8 @@ newGroup = null; } ; - assertTrue("Can't create a subgroup of a destroyed group", - newGroup == null); + assertNull("Can't create a subgroup of a destroyed group", + newGroup); } /** Index: modules/luni/src/test/java/tests/api/java/lang/IntegerTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/IntegerTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/IntegerTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -212,8 +212,8 @@ System.setProperties(tProps); assertTrue("returned incorrect Integer", Integer.getInteger("testInt") .equals(new Integer(99))); - assertTrue("returned incorrect default Integer", Integer - .getInteger("ff") == null); + assertNull("returned incorrect default Integer", Integer + .getInteger("ff")); } /** Index: modules/luni/src/test/java/tests/api/java/lang/ExceptionInInitializerErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ExceptionInInitializerErrorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ExceptionInInitializerErrorTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -27,8 +27,8 @@ } catch (ExceptionInInitializerError e) { assertTrue("Initializer failed." + e.toString(), e.toString() .equals("java.lang.ExceptionInInitializerError")); - assertTrue("Initializer failed.", e.getException() == null); - assertTrue("Initializer failed.", e.getMessage() == null); + assertNull("Initializer failed.", e.getException()); + assertNull("Initializer failed.", e.getMessage()); return; } fail("Constructor failed."); @@ -60,8 +60,8 @@ } fail("Constructor failed."); } catch (ExceptionInInitializerError e) { - assertTrue("Initializer failed." + e.getMessage(), - e.getMessage() == null); + assertNull("Initializer failed." + e.getMessage(), + e.getMessage()); assertTrue("Initializer failed." + e.toString(), e.getException() != null && e.getException().getMessage().equals( Index: modules/luni/src/test/java/tests/api/java/lang/ClassTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ClassTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ClassTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -391,8 +391,8 @@ .getComponentType() == int.class); assertTrue("Object array does not have Object component type", Object[].class.getComponentType() == Object.class); - assertTrue("Object has non-null component type", Object.class - .getComponentType() == null); + assertNull("Object has non-null component type", Object.class + .getComponentType()); } /** @@ -451,8 +451,8 @@ try { java.lang.reflect.Constructor c = TestClass.class .getDeclaredConstructor(new Class[0]); - assertTrue("Incorrect constructor returned", ((TestClass) (c - .newInstance(new Object[0]))).cValue() == null); + assertNull("Incorrect constructor returned", ((TestClass) (c + .newInstance(new Object[0]))).cValue()); c = TestClass.class .getDeclaredConstructor(new Class[] { Object.class }); } catch (NoSuchMethodException e) { @@ -737,7 +737,7 @@ System.setSecurityManager(new SecurityManager()); try { java.net.URL res = Object.class.getResource("Object.class"); - assertTrue("Object.class should not be found", res == null); + assertNull("Object.class should not be found", res); assertTrue("Security: the file " + name + " can not be found in this directory", ClassTest.class @@ -768,7 +768,7 @@ System.setSecurityManager(new SecurityManager()); try { InputStream res = Object.class.getResourceAsStream("Object.class"); - assertTrue("Object.class should not be found", res == null); + assertNull("Object.class should not be found", res); InputStream is = ClassTest.class.getResourceAsStream(name); assertTrue("Security: the file " + name + " can not be found in this directory", is != null); @@ -777,9 +777,9 @@ } name = "hyts_Foo.c"; - assertTrue("the file " + name + assertNull("the file " + name + " should not be found in this directory", clazz - .getResourceAsStream(name) == null); + .getResourceAsStream(name)); assertTrue("the file " + name + " can not be found in the root directory", clazz .getResourceAsStream("/" + name) != null); @@ -822,17 +822,17 @@ public void test_getSuperclass() { // Test for method java.lang.Class java.lang.Class.getSuperclass() - assertTrue("Object has a superclass???", - Object.class.getSuperclass() == null); + assertNull("Object has a superclass???", + Object.class.getSuperclass()); assertTrue( "Normal class has bogus superclass", java.io.FileInputStream.class.getSuperclass() == java.io.InputStream.class); assertTrue("Array class has bogus superclass", java.io.FileInputStream[].class.getSuperclass() == Object.class); - assertTrue("Base class has a superclass", - int.class.getSuperclass() == null); - assertTrue("Interface class has a superclass", Cloneable.class - .getSuperclass() == null); + assertNull("Base class has a superclass", + int.class.getSuperclass()); + assertNull("Interface class has a superclass", Cloneable.class + .getSuperclass()); } /** Index: modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/UnsatisfiedLinkErrorTest.java 2006-04-16 11:01:05.000000000 +0100 @@ -26,7 +26,7 @@ if (true) throw new UnsatisfiedLinkError(); } catch (UnsatisfiedLinkError e) { - assertTrue("Initializer failed.", e.getMessage() == null); + assertNull("Initializer failed.", e.getMessage()); assertTrue("To string failed.", e.toString().equals( "java.lang.UnsatisfiedLinkError")); } Index: modules/luni/src/test/java/tests/api/java/lang/NoSuchMethodErrorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/NoSuchMethodErrorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/NoSuchMethodErrorTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -25,7 +25,7 @@ if (true) throw new NoSuchMethodError(); } catch (NoSuchMethodError e) { - assertTrue("Initializer failed.", e.getMessage() == null); + assertNull("Initializer failed.", e.getMessage()); assertTrue("To string failed.", e.toString().equals( "java.lang.NoSuchMethodError")); } Index: modules/luni/src/test/java/tests/api/java/lang/IllegalArgumentExceptionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/IllegalArgumentExceptionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/IllegalArgumentExceptionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -33,8 +33,8 @@ public void test_Constructor() { // Test for method java.lang.IllegalArgumentException() IllegalArgumentException ill = new IllegalArgumentException(); - assertTrue("failed to create an instance of illegalArgumentException", - ill.getMessage() == null); + assertNull("failed to create an instance of illegalArgumentException", + ill.getMessage()); try { try { new java.io.ByteArrayOutputStream(-12); Index: modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ThreadTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -404,7 +404,7 @@ st.join(); } catch (InterruptedException e) { } - assertTrue("group should be null", st.getThreadGroup() == null); + assertNull("group should be null", st.getThreadGroup()); assertTrue("toString() should not be null", st.toString() != null); tg.destroy(); @@ -427,7 +427,7 @@ while (t.isAlive()) running++; ThreadGroup group = t.getThreadGroup(); - assertTrue("ThreadGroup is not null", group == null); + assertNull("ThreadGroup is not null", group); } /** Index: modules/luni/src/test/java/tests/api/java/lang/IllegalStateExceptionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/IllegalStateExceptionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/IllegalStateExceptionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -23,8 +23,8 @@ public void test_Constructor() { // Test for method java.lang.IllegalStateException() IllegalStateException ill = new IllegalStateException(); - assertTrue("failed to create an instance of illegalStateException", ill - .getMessage() == null); + assertNull("failed to create an instance of illegalStateException", ill + .getMessage()); try { try { java.util.zip.Inflater inflater = new java.util.zip.Inflater(); Index: modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -90,8 +90,8 @@ */ public void test_removeJ() { try { - assertTrue("Queue is empty.", rq.poll() == null); - assertTrue("Queue is empty.", rq.remove((long) 1) == null); + assertNull("Queue is empty.", rq.poll()); + assertNull("Queue is empty.", rq.remove((long) 1)); Thread ct = new Thread(new ChildThread()); ct.start(); Reference ret = rq.remove(0L); Index: modules/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -32,7 +32,7 @@ ReferenceQueue rq = new ReferenceQueue(); bool = new Boolean(false); PhantomReference pr = new PhantomReference(bool, rq); - assertTrue("Same object returned.", pr.get() == null); + assertNull("Same object returned.", pr.get()); } /** Index: modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -114,7 +114,7 @@ ref = rq.remove(); assertTrue("Unexpected ref1", ref == wr); assertTrue("Object not garbage collected1.", ref != null); - assertTrue("Object could not be reclaimed1.", wr.get() == null); + assertNull("Object could not be reclaimed1.", wr.get()); } catch (InterruptedException e) { fail("InterruptedException : " + e.getMessage()); } @@ -128,9 +128,9 @@ ref = rq.poll(); assertTrue("Unexpected ref2", ref == wr); assertTrue("Object not garbage collected.", ref != null); - assertTrue("Object could not be reclaimed.", ref.get() == null); + assertNull("Object could not be reclaimed.", ref.get()); // Reference wr so it does not get collected - assertTrue("Object could not be reclaimed.", wr.get() == null); + assertNull("Object could not be reclaimed.", wr.get()); } catch (Exception e) { fail("Exception : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/lang/LongTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/LongTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/LongTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -215,8 +215,8 @@ System.setProperties(tProps); assertTrue("returned incorrect Long", Long.getLong("testLong").equals( new Long(99))); - assertTrue("returned incorrect default Long", - Long.getLong("ff") == null); + assertNull("returned incorrect default Long", + Long.getLong("ff")); } /** Index: modules/luni/src/test/java/tests/api/java/lang/CompilerTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/lang/CompilerTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/lang/CompilerTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -24,8 +24,8 @@ // Test for method java.lang.Object // java.lang.Compiler.command(java.lang.Object) try { - assertTrue("Incorrect behavior.", - Compiler.command(new Object()) == null); + assertNull("Incorrect behavior.", + Compiler.command(new Object())); } catch (Exception e) { fail("Exception during test : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/net/URITest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URITest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URITest.java 2006-04-16 11:04:42.000000000 +0100 @@ -253,13 +253,13 @@ URI uri; try { uri = new URI("mailto", "mduerst@ifi.unizh.ch", null); - assertTrue("wrong userinfo", uri.getUserInfo() == null); - assertTrue("wrong hostname", uri.getHost() == null); - assertTrue("wrong authority", uri.getAuthority() == null); + assertNull("wrong userinfo", uri.getUserInfo()); + assertNull("wrong hostname", uri.getHost()); + assertNull("wrong authority", uri.getAuthority()); assertTrue("wrong port number", uri.getPort() == -1); - assertTrue("wrong path", uri.getPath() == null); - assertTrue("wrong query", uri.getQuery() == null); - assertTrue("wrong fragment", uri.getFragment() == null); + assertNull("wrong path", uri.getPath()); + assertNull("wrong query", uri.getQuery()); + assertNull("wrong fragment", uri.getFragment()); assertTrue("wrong SchemeSpecificPart", uri.getSchemeSpecificPart() .equals("mduerst@ifi.unizh.ch")); } catch (URISyntaxException e) { @@ -448,9 +448,9 @@ } assertTrue("wrong scheme", uri.getScheme().equals("ht12-3+tp")); - assertTrue("wrong authority", uri.getUserInfo() == null); - assertTrue("wrong userinfo", uri.getUserInfo() == null); - assertTrue("wrong hostname", uri.getHost() == null); + assertNull("wrong authority", uri.getUserInfo()); + assertNull("wrong userinfo", uri.getUserInfo()); + assertNull("wrong hostname", uri.getHost()); assertTrue("wrong port number", uri.getPort() == -1); assertTrue("wrong path", uri.getPath().equals("/p#a%E2%82%ACth")); assertTrue("wrong query", uri.getQuery().equals("q^u%25ery")); Index: modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -599,9 +599,9 @@ // now create a socket that is not bound and validate we get the // right answer theSocket = new ServerSocket(); - assertTrue( + assertNull( "Returned incorrect InetSocketAddress -unbound socket- Expected null", - theSocket.getLocalSocketAddress() == null); + theSocket.getLocalSocketAddress()); // now bind the socket and make sure we get the right answer portNumber = Support_PortManager.getNextPort(); Index: modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/JarURLConnectionTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -61,8 +61,8 @@ u = new URL("jar:" + Support_Resources.getResourceURL("/JUC/lf.jar!/")); juc = (JarURLConnection) u.openConnection(); - assertTrue("Returned incorrect entryName", - juc.getEntryName() == null); + assertNull("Returned incorrect entryName", + juc.getEntryName()); } catch (java.io.IOException e) { fail("IOException during test : " + e.getMessage()); } @@ -81,7 +81,7 @@ u = new URL("jar:" + Support_Resources.getResourceURL("/JUC/lf.jar!/")); juc = (JarURLConnection) u.openConnection(); - assertTrue("Returned incorrect JarEntry", juc.getJarEntry() == null); + assertNull("Returned incorrect JarEntry", juc.getJarEntry()); } catch (java.io.IOException e) { fail("IOException during test : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URLConnectionTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -84,8 +84,8 @@ */ public void test_getContentEncoding() { // should not be known for a file - assertTrue("getContentEncoding failed: " + uc.getContentEncoding(), uc - .getContentEncoding() == null); + assertNull("getContentEncoding failed: " + uc.getContentEncoding(), uc + .getContentEncoding()); } /** @@ -152,19 +152,19 @@ public void test_getDefaultRequestPropertyLjava_lang_String() { try { URLConnection.setDefaultRequestProperty("Shmoo", "Blah"); - assertTrue( + assertNull( "setDefaultRequestProperty should have returned: null, but returned: " + URLConnection.getDefaultRequestProperty("Shmoo"), - URLConnection.getDefaultRequestProperty("Shmoo") == null); + URLConnection.getDefaultRequestProperty("Shmoo")); URLConnection.setDefaultRequestProperty("Shmoo", "Boom"); - assertTrue( + assertNull( "setDefaultRequestProperty should have returned: null, but returned: " + URLConnection.getDefaultRequestProperty("Shmoo"), - URLConnection.getDefaultRequestProperty("Shmoo") == null); - assertTrue( + URLConnection.getDefaultRequestProperty("Shmoo")); + assertNull( "setDefaultRequestProperty should have returned: null, but returned: " + URLConnection.getDefaultRequestProperty("Kapow"), - URLConnection.getDefaultRequestProperty("Kapow") == null); + URLConnection.getDefaultRequestProperty("Kapow")); URLConnection.setDefaultRequestProperty("Shmoo", null); } catch (Exception e) { fail("Exception during test : " + e.getMessage()); @@ -387,9 +387,9 @@ String hf; hf = uc.getHeaderField("Content-Encoding"); if (hf != null) { - assertTrue( + assertNull( "Wrong value returned for header field 'Content-Encoding': " - + hf, hf == null); + + hf, hf); } hf = uc.getHeaderField("Content-Length"); if (hf != null) { @@ -415,9 +415,9 @@ } hf = uc.getHeaderField("Expires"); if (hf != null) { - assertTrue( + assertNull( "Wrong value returned for header field 'Expires': " + hf, - hf == null); + hf); } hf = uc.getHeaderField("SERVER"); if (hf != null) { @@ -441,8 +441,8 @@ } hf = uc.getHeaderField("DoesNotExist"); if (hf != null) { - assertTrue("Wrong value returned for header field 'DoesNotExist': " - + hf, hf == null); + assertNull("Wrong value returned for header field 'DoesNotExist': " + + hf, hf); } } @@ -833,8 +833,8 @@ uc.setRequestProperty("Yo", "yo"); assertTrue("Wrong property returned: " + uc.getRequestProperty("Yo"), uc.getRequestProperty("Yo").equals("yo")); - assertTrue("Wrong property returned: " + uc.getRequestProperty("No"), - uc.getRequestProperty("No") == null); + assertNull("Wrong property returned: " + uc.getRequestProperty("No"), + uc.getRequestProperty("No")); } /** Index: modules/luni/src/test/java/tests/api/java/net/URLTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/URLTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/URLTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -108,7 +108,7 @@ "www.yahoo2.com")); assertTrue("u1 returns a wrong port", u1.getPort() == 9999); assertTrue("u1 returns a wrong file", u1.getFile().equals("")); - assertTrue("u1 returns a wrong anchor", u1.getRef() == null); + assertNull("u1 returns a wrong anchor", u1.getRef()); // test for no port u2 = new URL( @@ -144,7 +144,7 @@ "www.yahoo4.com")); assertTrue("u3 returns a wrong port", u3.getPort() == -1); assertTrue("u3 returns a wrong file", u3.getFile().equals("/")); - assertTrue("u3 returns a wrong anchor", u3.getRef() == null); + assertNull("u3 returns a wrong anchor", u3.getRef()); // test for no file, no port URL u3a = new URL("file://www.yahoo4.com/"); @@ -154,7 +154,7 @@ "www.yahoo4.com")); assertTrue("u3a returns a wrong port", u3a.getPort() == -1); assertTrue("u3a returns a wrong file", u3a.getFile().equals("/")); - assertTrue("u3a returns a wrong anchor", u3a.getRef() == null); + assertNull("u3a returns a wrong anchor", u3a.getRef()); // test for no file, no port URL u3b = new URL("file://www.yahoo4.com"); @@ -164,7 +164,7 @@ "www.yahoo4.com")); assertTrue("u3b returns a wrong port", u3b.getPort() == -1); assertTrue("u3b returns a wrong file", u3b.getFile().equals("")); - assertTrue("u3b returns a wrong anchor", u3b.getRef() == null); + assertNull("u3b returns a wrong anchor", u3b.getRef()); // test for non-port ":" and wierd characters occurrences u4 = new URL( @@ -186,7 +186,7 @@ assertTrue("u5 returns a wrong port", u5.getPort() == -1); assertTrue("u5 returns a wrong file", u5.getFile().equals( "/testing.tst")); - assertTrue("u5 returns a wrong anchor", u5.getRef() == null); + assertNull("u5 returns a wrong anchor", u5.getRef()); URL u5a = new URL("file:testing.tst"); assertTrue("u5a returns a wrong protocol", u5a.getProtocol() @@ -195,7 +195,7 @@ assertTrue("u5a returns a wrong port", u5a.getPort() == -1); assertTrue("u5a returns a wrong file", u5a.getFile().equals( "testing.tst")); - assertTrue("u5a returns a wrong anchor", u5a.getRef() == null); + assertNull("u5a returns a wrong anchor", u5a.getRef()); URL u6 = new URL("http://host:/file"); assertTrue("u6 return a wrong port", u6.getPort() == -1); @@ -213,8 +213,8 @@ u8.getPort() == 35); assertTrue("u8 returns a wrong file " + u8.getFile(), u8.getFile() .equals("/file.txt")); - assertTrue("u8 returns a wrong anchor " + u8.getRef(), - u8.getRef() == null); + assertNull("u8 returns a wrong anchor " + u8.getRef(), + u8.getRef()); URL u9 = new URL( "file://[fec0::1:20d:60ff:fe24:7410]/file.txt#sogood"); @@ -333,7 +333,7 @@ assertTrue("1 returns a wrong port", u1.getPort() == -1); assertTrue("1 returns a wrong file", u1.getFile().equals( "/file.java")); - assertTrue("1 returns a wrong anchor", u1.getRef() == null); + assertNull("1 returns a wrong anchor", u1.getRef()); URL u1f = new URL(uf, "file.java"); assertTrue("1f returns a wrong protocol", u1f.getProtocol().equals( @@ -343,7 +343,7 @@ assertTrue("1f returns a wrong port", u1f.getPort() == -1); assertTrue("1f returns a wrong file", u1f.getFile().equals( "/file.java")); - assertTrue("1f returns a wrong anchor", u1f.getRef() == null); + assertNull("1f returns a wrong anchor", u1f.getRef()); u1 = new URL(u, "dir1/dir2/../file.java"); assertTrue("3 returns a wrong protocol", u1.getProtocol().equals( @@ -353,7 +353,7 @@ assertTrue("3 returns a wrong port", u1.getPort() == -1); assertTrue("3 returns a wrong file", u1.getFile().equals( "/dir1/dir2/../file.java")); - assertTrue("3 returns a wrong anchor", u1.getRef() == null); + assertNull("3 returns a wrong anchor", u1.getRef()); u1 = new URL(u, "http:dir1/dir2/../file.java"); assertTrue("3a returns a wrong protocol", u1.getProtocol().equals( @@ -363,7 +363,7 @@ assertTrue("3a returns a wrong port", u1.getPort() == -1); assertTrue("3a returns a wrong file", u1.getFile().equals( "dir1/dir2/../file.java")); - assertTrue("3a returns a wrong anchor", u1.getRef() == null); + assertNull("3a returns a wrong anchor", u1.getRef()); u = new URL("http://www.apache.org/testing/"); u1 = new URL(u, "file.java"); @@ -374,7 +374,7 @@ assertTrue("4 returns a wrong port", u1.getPort() == -1); assertTrue("4 returns a wrong file", u1.getFile().equals( "/testing/file.java")); - assertTrue("4 returns a wrong anchor", u1.getRef() == null); + assertNull("4 returns a wrong anchor", u1.getRef()); uf = new URL("file://www.apache.org/testing/"); u1f = new URL(uf, "file.java"); @@ -385,7 +385,7 @@ assertTrue("4f returns a wrong port", u1f.getPort() == -1); assertTrue("4f returns a wrong file", u1f.getFile().equals( "/testing/file.java")); - assertTrue("4f returns a wrong anchor", u1f.getRef() == null); + assertNull("4f returns a wrong anchor", u1f.getRef()); uf = new URL("file:/testing/"); u1f = new URL(uf, "file.java"); @@ -395,7 +395,7 @@ assertTrue("4fa returns a wrong port", u1f.getPort() == -1); assertTrue("4fa returns a wrong file", u1f.getFile().equals( "/testing/file.java")); - assertTrue("4fa returns a wrong anchor", u1f.getRef() == null); + assertNull("4fa returns a wrong anchor", u1f.getRef()); uf = new URL("file:testing/"); u1f = new URL(uf, "file.java"); @@ -405,7 +405,7 @@ assertTrue("4fb returns a wrong port", u1f.getPort() == -1); assertTrue("4fb returns a wrong file", u1f.getFile().equals( "testing/file.java")); - assertTrue("4fb returns a wrong anchor", u1f.getRef() == null); + assertNull("4fb returns a wrong anchor", u1f.getRef()); u1f = new URL(uf, "file:file.java"); assertTrue("4fc returns a wrong protocol", u1f.getProtocol() @@ -414,7 +414,7 @@ assertTrue("4fc returns a wrong port", u1f.getPort() == -1); assertTrue("4fc returns a wrong file", u1f.getFile().equals( "file.java")); - assertTrue("4fc returns a wrong anchor", u1f.getRef() == null); + assertNull("4fc returns a wrong anchor", u1f.getRef()); u1f = new URL(uf, "file:"); assertTrue("4fd returns a wrong protocol", u1f.getProtocol() @@ -422,7 +422,7 @@ assertTrue("4fd returns a wrong host", u1f.getHost().equals("")); assertTrue("4fd returns a wrong port", u1f.getPort() == -1); assertTrue("4fd returns a wrong file", u1f.getFile().equals("")); - assertTrue("4fd returns a wrong anchor", u1f.getRef() == null); + assertNull("4fd returns a wrong anchor", u1f.getRef()); u = new URL("http://www.apache.org/testing"); u1 = new URL(u, "file.java"); @@ -433,7 +433,7 @@ assertTrue("5 returns a wrong port", u1.getPort() == -1); assertTrue("5 returns a wrong file", u1.getFile().equals( "/file.java")); - assertTrue("5 returns a wrong anchor", u1.getRef() == null); + assertNull("5 returns a wrong anchor", u1.getRef()); uf = new URL("file://www.apache.org/testing"); u1f = new URL(uf, "file.java"); @@ -444,7 +444,7 @@ assertTrue("5f returns a wrong port", u1f.getPort() == -1); assertTrue("5f returns a wrong file", u1f.getFile().equals( "/file.java")); - assertTrue("5f returns a wrong anchor", u1f.getRef() == null); + assertNull("5f returns a wrong anchor", u1f.getRef()); uf = new URL("file:/testing"); u1f = new URL(uf, "file.java"); @@ -454,7 +454,7 @@ assertTrue("5fa returns a wrong port", u1f.getPort() == -1); assertTrue("5fa returns a wrong file", u1f.getFile().equals( "/file.java")); - assertTrue("5fa returns a wrong anchor", u1f.getRef() == null); + assertNull("5fa returns a wrong anchor", u1f.getRef()); uf = new URL("file:testing"); u1f = new URL(uf, "file.java"); @@ -464,7 +464,7 @@ assertTrue("5fb returns a wrong port", u1f.getPort() == -1); assertTrue("5fb returns a wrong file", u1f.getFile().equals( "file.java")); - assertTrue("5fb returns a wrong anchor", u1f.getRef() == null); + assertNull("5fb returns a wrong anchor", u1f.getRef()); u = new URL("http://www.apache.org/testing/foobaz"); u1 = new URL(u, "/file.java"); @@ -475,7 +475,7 @@ assertTrue("6 returns a wrong port", u1.getPort() == -1); assertTrue("6 returns a wrong file", u1.getFile().equals( "/file.java")); - assertTrue("6 returns a wrong anchor", u1.getRef() == null); + assertNull("6 returns a wrong anchor", u1.getRef()); uf = new URL("file://www.apache.org/testing/foobaz"); u1f = new URL(uf, "/file.java"); @@ -486,7 +486,7 @@ assertTrue("6f returns a wrong port", u1f.getPort() == -1); assertTrue("6f returns a wrong file", u1f.getFile().equals( "/file.java")); - assertTrue("6f returns a wrong anchor", u1f.getRef() == null); + assertNull("6f returns a wrong anchor", u1f.getRef()); u = new URL("http://www.apache.org:8000/testing/foobaz"); u1 = new URL(u, "/file.java"); @@ -497,7 +497,7 @@ assertTrue("7 returns a wrong port", u1.getPort() == 8000); assertTrue("7 returns a wrong file", u1.getFile().equals( "/file.java")); - assertTrue("7 returns a wrong anchor", u1.getRef() == null); + assertNull("7 returns a wrong anchor", u1.getRef()); u = new URL("http://www.apache.org/index.html"); u1 = new URL(u, "#bar"); @@ -521,7 +521,7 @@ "www.apache.org")); assertTrue("10 returns a wrong file", u1.getFile().equals( "/index.html")); - assertTrue("10 returns a wrong anchor", u1.getRef() == null); + assertNull("10 returns a wrong anchor", u1.getRef()); uf = new URL("file://www.apache.org/index.html"); u1f = new URL(uf, ""); @@ -529,14 +529,14 @@ "www.apache.org")); assertTrue("10f returns a wrong file", u1.getFile().equals( "/index.html")); - assertTrue("10f returns a wrong anchor", u1.getRef() == null); + assertNull("10f returns a wrong anchor", u1.getRef()); u = new URL("http://www.apache.org/index.html"); u1 = new URL(u, "http://www.apache.org"); assertTrue("11 returns a wrong host", u1.getHost().equals( "www.apache.org")); assertTrue("11 returns a wrong file", u1.getFile().equals("")); - assertTrue("11 returns a wrong anchor", u1.getRef() == null); + assertNull("11 returns a wrong anchor", u1.getRef()); // test for question mark processing u = new URL("http://www.foo.com/d0/d1/d2/cgi-bin?foo=bar/baz"); @@ -585,7 +585,7 @@ assertTrue("1 returns a wrong port", u1.getPort() == -1); assertTrue("1 returns a wrong file", u1.getFile().equals( "/file.java")); - assertTrue("1 returns a wrong anchor", u1.getRef() == null); + assertNull("1 returns a wrong anchor", u1.getRef()); u1 = new URL(u, "systemresource:/+/FILE0/test.java", new MyHandler()); @@ -595,7 +595,7 @@ assertTrue("2 returns a wrong port", u1.getPort() == -1); assertTrue("2 returns a wrong file", u1.getFile().equals( "/+/FILE0/test.java")); - assertTrue("2 returns a wrong anchor", u1.getRef() == null); + assertNull("2 returns a wrong anchor", u1.getRef()); u1 = new URL(u, "dir1/dir2/../file.java", null); assertTrue("3 returns a wrong protocol", u1.getProtocol().equals( @@ -605,7 +605,7 @@ assertTrue("3 returns a wrong port", u1.getPort() == -1); assertTrue("3 returns a wrong file", u1.getFile().equals( "/dir1/dir2/../file.java")); - assertTrue("3 returns a wrong anchor", u1.getRef() == null); + assertNull("3 returns a wrong anchor", u1.getRef()); // test for question mark processing u = new URL("http://www.foo.com/d0/d1/d2/cgi-bin?foo=bar/baz"); @@ -1010,7 +1010,7 @@ u = new URL( "http://www.yahoo1.com:8080/dir1/dir2/test.cgi?point1.html#anchor1"); assertTrue("returns a wrong anchor1", u.getRef().equals("anchor1")); - assertTrue("returns a wrong anchor2", u1.getRef() == null); + assertNull("returns a wrong anchor2", u1.getRef()); u1 = new URL("http://www.yahoo2.com#ref"); assertTrue("returns a wrong anchor3", u1.getRef().equals("ref")); u1 = new URL("http://www.yahoo2.com/file#ref1#ref2"); @@ -1038,12 +1038,12 @@ url = new URL("http", "home", -1, "/java"); assertTrue("wrong authority2", url.getAuthority().equals("home")); - assertTrue("wrong userInfo2", url.getUserInfo() == null); + assertNull("wrong userInfo2", url.getUserInfo()); assertTrue("wrong host2", url.getHost().equals("home")); assertTrue("wrong file2", url.getFile().equals("/java")); assertTrue("wrong path2", url.getPath().equals("/java")); - assertTrue("wrong query2", url.getQuery() == null); - assertTrue("wrong ref2", url.getRef() == null); + assertNull("wrong query2", url.getQuery()); + assertNull("wrong ref2", url.getRef()); } catch (MalformedURLException e) { fail("Unexpected MalformedURLException : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/net/SocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/SocketTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/SocketTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -906,9 +906,9 @@ // now create a socket that is not bound and validate we get the // right answer Socket theSocket = new Socket(); - assertTrue( + assertNull( "Returned incorrect InetSocketAddress -unbound socket- Expected null", - theSocket.getLocalSocketAddress() == null); + theSocket.getLocalSocketAddress()); // now bind the socket and make sure we get the right answer portNumber = Support_PortManager.getNextPort(); @@ -999,10 +999,10 @@ theSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), portNumber)); - assertTrue( + assertNull( "Returned incorrect InetSocketAddress -unconnected socket:" + "Expected: NULL", theSocket - .getRemoteSocketAddress() == null); + .getRemoteSocketAddress()); // now connect and validate we get the right answer theSocket.connect(new InetSocketAddress(InetAddress.getLocalHost(), Index: modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/net/DatagramSocketTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -557,7 +557,7 @@ int portNumber = Support_PortManager.getNextPort(); ds.connect(inetAddress, portNumber); ds.disconnect(); - assertTrue("Incorrect InetAddress", ds.getInetAddress() == null); + assertNull("Incorrect InetAddress", ds.getInetAddress()); assertTrue("Incorrect Port", ds.getPort() == -1); } catch (Exception e) { fail("Exception during test : " + e.getMessage()); @@ -574,7 +574,7 @@ int portNumber = Support_PortManager.getNextPort(); ds.connect(inetAddress, portNumber); ds.disconnect(); - assertTrue("Incorrect InetAddress", ds.getInetAddress() == null); + assertNull("Incorrect InetAddress", ds.getInetAddress()); assertTrue("Incorrect Port", ds.getPort() == -1); } catch (Exception e) { fail("Exception during test : " + e.getMessage()); @@ -1527,10 +1527,10 @@ portNumber = Support_PortManager.getNextPort(); theSocket.bind(new InetSocketAddress(InetAddress.getLocalHost(), portNumber)); - assertTrue( + assertNull( "Returned incorrect InetSocketAddress -unconnected socket:" + "Expected: NULL", theSocket - .getRemoteSocketAddress() == null); + .getRemoteSocketAddress()); // now connect and validate we get the right answer theSocket.connect(new InetSocketAddress(InetAddress.getLocalHost(), @@ -1572,9 +1572,9 @@ // now create a socket that is not bound and validate we get the // right answer DatagramSocket theSocket = new DatagramSocket(null); - assertTrue( + assertNull( "Returned incorrect InetSocketAddress -unbound socket- Expected null", - theSocket.getLocalSocketAddress() == null); + theSocket.getLocalSocketAddress()); // now bind the socket and make sure we get the right answer portNumber = Support_PortManager.getNextPort(); Index: modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/ObjectOutputStreamTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -630,9 +630,9 @@ sth = (SerializableTestHelper) (ois.readObject()); assertTrue("readFields / writeFields failed--first field not set", sth.getText1().equals("Gabba")); - assertTrue( + assertNull( "readFields / writeFields failed--second field should not have been set", - sth.getText2() == null); + sth.getText2()); } catch (Exception e) { fail("Exception thrown : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/io/ObjectStreamClassTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/ObjectStreamClassTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/ObjectStreamClassTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -54,8 +54,8 @@ ObjectStreamClass osc = ObjectStreamClass.lookup(DummyClass.class); assertTrue("getField did not return correct field", osc.getField("bam") .getTypeCode() == 'J'); - assertTrue("getField did not null for non-existent field", osc - .getField("wham") == null); + assertNull("getField did not null for non-existent field", osc + .getField("wham")); } /** Index: modules/luni/src/test/java/tests/api/java/io/CharConversionExceptionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/CharConversionExceptionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/CharConversionExceptionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -29,9 +29,9 @@ throw new java.io.CharConversionException(); fail("Exception not thrown"); } catch (java.io.CharConversionException e) { - assertTrue( + assertNull( "Exception defined with no message answers non-null to getMessage()", - e.getMessage() == null); + e.getMessage()); } } Index: modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/ObjectInputStreamTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -405,9 +405,9 @@ sth = (SerializableTestHelper) (ois.readObject()); assertTrue("readFields / writeFields failed--first field not set", sth.getText1().equals("Gabba")); - assertTrue( + assertNull( "readFields / writeFields failed--second field should not have been set", - sth.getText2() == null); + sth.getText2()); } catch (Exception e) { fail("Exception serializing data : " + e.getMessage()); } Index: modules/luni/src/test/java/tests/api/java/io/FileTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/FileTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/FileTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -947,7 +947,7 @@ public void test_getParent() { // Test for method java.lang.String java.io.File.getParent() File f = new File("p.tst"); - assertTrue("Incorrect path returned", f.getParent() == null); + assertNull("Incorrect path returned", f.getParent()); f = new File(System.getProperty("user.home"), "p.tst"); assertTrue("Incorrect path returned", f.getParent().equals( System.getProperty("user.home"))); @@ -965,9 +965,9 @@ f1 = new File("directory/file"); assertTrue("Wrong parent test 3", f1.getParent().equals("directory")); f1 = new File("/"); - assertTrue("Wrong parent test 4", f1.getParent() == null); + assertNull("Wrong parent test 4", f1.getParent()); f1 = new File("directory"); - assertTrue("Wrong parent test 5", f1.getParent() == null); + assertNull("Wrong parent test 5", f1.getParent()); if (File.separatorChar == '\\' && new File("d:/").isAbsolute()) { f1 = new File("d:/directory"); @@ -980,7 +980,7 @@ assertTrue("Wrong parent test 3a", f1.getParent().equals( "d:directory")); f1 = new File("d:/"); - assertTrue("Wrong parent test 4a", f1.getParent() == null); + assertNull("Wrong parent test 4a", f1.getParent()); f1 = new File("d:directory"); assertTrue("Wrong parent test 5a", f1.getParent().equals("d:")); } @@ -992,7 +992,7 @@ public void test_getParentFile() { // Test for method java.io.File.getParentFile() File f = new File("tempfile.tst"); - assertTrue("Incorrect path returned", f.getParentFile() == null); + assertNull("Incorrect path returned", f.getParentFile()); f = new File(System.getProperty("user.dir"), "tempfile1.tmp"); File f2 = new File(System.getProperty("user.dir"), "tempfile2.tmp"); File f3 = new File(System.getProperty("user.dir"), "/a/tempfile.tmp"); @@ -1207,7 +1207,7 @@ String[] flist = dir.list(); - assertTrue("Method list() Should Have Returned null.", flist == null); + assertNull("Method list() Should Have Returned null.", flist); assertTrue("Could not create parent directory for list test", dir .mkdir()); @@ -1222,9 +1222,9 @@ try { FileOutputStream fos = new FileOutputStream(file); fos.close(); - assertTrue( + assertNull( "listFiles Should Have Returned Null When Used On A File Instead Of A Directory.", - file.list() == null); + file.list()); } catch (IOException e) { fail("Unexpected IOException during test : " + e.getMessage()); } finally { @@ -1308,7 +1308,7 @@ } } // Test for attempting to cal listFiles on a non-existent directory. - assertTrue("listFiles Should Return Null.", dir.listFiles() == null); + assertNull("listFiles Should Return Null.", dir.listFiles()); assertTrue("Failed To Create Parent Directory.", dir.mkdir()); @@ -1321,9 +1321,9 @@ try { FileOutputStream fos = new FileOutputStream(file); fos.close(); - assertTrue( + assertNull( "listFiles Should Have Returned Null When Used On A File Instead Of A Directory.", - file.listFiles() == null); + file.listFiles()); } catch (IOException e) { fail("Unexpected IOException during test : " + e.getMessage()); } finally { @@ -1445,8 +1445,8 @@ } }; - assertTrue("listFiles Should Return Null.", baseDir - .listFiles(dirFilter) == null); + assertNull("listFiles Should Return Null.", baseDir + .listFiles(dirFilter)); assertTrue("Failed To Create Parent Directory.", baseDir.mkdir()); @@ -1460,9 +1460,9 @@ try { FileOutputStream fos = new FileOutputStream(file); fos.close(); - assertTrue( + assertNull( "listFiles Should Have Returned Null When Used On A File Instead Of A Directory.", - file.listFiles(dirFilter) == null); + file.listFiles(dirFilter)); } catch (IOException e) { fail("Unexpected IOException During Test."); } finally { @@ -1576,8 +1576,8 @@ } }; - assertTrue("listFiles Should Return Null.", - dir.listFiles(tstFilter) == null); + assertNull("listFiles Should Return Null.", + dir.listFiles(tstFilter)); assertTrue("Failed To Create Parent Directory.", dir.mkdir()); @@ -1590,9 +1590,9 @@ try { FileOutputStream fos = new FileOutputStream(file); fos.close(); - assertTrue( + assertNull( "listFiles Should Have Returned Null When Used On A File Instead Of A Directory.", - file.listFiles(tstFilter) == null); + file.listFiles(tstFilter)); } catch (IOException e) { fail("Unexpected IOException during test : " + e.getMessage()); } finally { @@ -1678,8 +1678,8 @@ }; String[] flist = dir.list(filter); - assertTrue("Method list(FilenameFilter) Should Have Returned Null.", - flist == null); + assertNull("Method list(FilenameFilter) Should Have Returned Null.", + flist); assertTrue("Could not create parent directory for test", dir.mkdir()); @@ -1694,9 +1694,9 @@ * File file = new File(dir, "notADir.tst"); try { FileOutputStream * fos = new FileOutputStream(file); fos.close(); } catch * (IOException e) { fail("Unexpected IOException During - * Test."); } flist = dir.list(filter); assertTrue("listFiles + * Test."); } flist = dir.list(filter); assertNull("listFiles * Should Have Returned Null When Used On A File Instead Of A - * Directory.", flist == null); file.delete(); + * Directory.", flist); file.delete(); */ flist = dir.list(filter); Index: modules/luni/src/test/java/tests/api/java/io/SerializationStressTest1.java =================================================================== --- modules/luni/src/test/java/tests/api/java/io/SerializationStressTest1.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/io/SerializationStressTest1.java 2006-04-16 10:54:13.000000000 +0100 @@ -742,8 +742,8 @@ objLoaded = dumpAndReload(objToSave); // non-serializable inst var has to be initialized from top // constructor - assertTrue(MSG_TEST_FAILED + objToSave, - ((SpecTest) objLoaded).instVar == null); + assertNull(MSG_TEST_FAILED + objToSave, + ((SpecTest) objLoaded).instVar); // instVar from non-serialized class, cant be saved/restored // by serialization but serialized ivar has to be restored as it // was in the object when dumped @@ -780,8 +780,8 @@ objLoaded = dumpAndReload(objToSave); // non-serializable inst var cant be saved, and it is not init'ed // from top constructor in this case - assertTrue(MSG_TEST_FAILED + objToSave, - ((SpecTestSubclass) objLoaded).transientInstVar == null); + assertNull(MSG_TEST_FAILED + objToSave, + ((SpecTestSubclass) objLoaded).transientInstVar); // transient slot, cant be saved/restored by serialization } catch (IOException e) { fail("Exception serializing " + objToSave + "\t->" Index: modules/luni/src/test/java/tests/api/java/util/HashSetTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/HashSetTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/HashSetTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -161,7 +161,7 @@ HashSet s = new HashSet(); s.add(null); - assertTrue("Cannot handle null", s.iterator().next() == null); + assertNull("Cannot handle null", s.iterator().next()); } /** Index: modules/luni/src/test/java/tests/api/java/util/ArraysTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/ArraysTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/ArraysTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -576,8 +576,8 @@ Arrays.fill(d, 400, d.length, null); for (int i = 400; i < d.length; i++) - assertTrue("Failed to fill Object array correctly with nulls", - d[i] == null); + assertNull("Failed to fill Object array correctly with nulls", + d[i]); } /** Index: modules/luni/src/test/java/tests/api/java/util/ArrayListTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/ArrayListTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/ArrayListTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -84,7 +84,7 @@ && (alist.get(52) == objArray[51])); Object oldItem = alist.get(25); alist.add(25, null); - assertTrue("Should have returned null", alist.get(25) == null); + assertNull("Should have returned null", alist.get(25)); assertTrue("Should have returned the old item from slot 25", alist .get(26) == oldItem); } @@ -98,7 +98,7 @@ alist.add(o); assertTrue("Failed to add Object", alist.get(alist.size() - 1) == o); alist.add(null); - assertTrue("Failed to add null", alist.get(alist.size() - 1) == null); + assertNull("Failed to add null", alist.get(alist.size() - 1)); } /** @@ -127,13 +127,13 @@ listWithNulls.add(null); alist.addAll(100, listWithNulls); assertTrue("Incorrect size: " + alist.size(), alist.size() == 205); - assertTrue("Item at slot 100 should be null", alist.get(100) == null); - assertTrue("Item at slot 101 should be null", alist.get(101) == null); + assertNull("Item at slot 100 should be null", alist.get(100)); + assertNull("Item at slot 101 should be null", alist.get(101)); assertTrue("Item at slot 102 should be 'yoink'", alist.get(102).equals( "yoink")); assertTrue("Item at slot 103 should be 'kazoo'", alist.get(103).equals( "kazoo")); - assertTrue("Item at slot 104 should be null", alist.get(104) == null); + assertNull("Item at slot 104 should be null", alist.get(104)); alist.addAll(205, listWithNulls); assertTrue("Incorrect size2: " + alist.size(), alist.size() == 210); } @@ -189,8 +189,8 @@ alist.clear(); assertTrue("List with nulls did not clear", alist.size() == 0); /* - * for (int i = 0; i < alist.size(); i++) assertTrue("Failed to clear - * list", alist.get(i) == null); + * for (int i = 0; i < alist.size(); i++) assertNull("Failed to clear + * list", alist.get(i)); */ } @@ -387,7 +387,7 @@ alist.set(65, obj = new Object()); assertTrue("Failed to set object", alist.get(65) == obj); alist.set(50, null); - assertTrue("Setting to null did not work", alist.get(50) == null); + assertNull("Setting to null did not work", alist.get(50)); assertTrue("Setting increased the list's size to: " + alist.size(), alist.size() == 100); } @@ -416,8 +416,8 @@ for (int i = 0; i < obj.length; i++) { if ((i == 25) || (i == 75)) - assertTrue("Should be null at: " + i + " but instead got: " - + obj[i], obj[i] == null); + assertNull("Should be null at: " + i + " but instead got: " + + obj[i], obj[i]); else assertTrue("Returned incorrect array: " + i, obj[i] == objArray[i]); @@ -439,11 +439,11 @@ assertTrue("Returned different array than passed", retArray == argArray); argArray = new Integer[1000]; retArray = alist.toArray(argArray); - assertTrue("Failed to set first extra element to null", argArray[alist - .size()] == null); + assertNull("Failed to set first extra element to null", argArray[alist + .size()]); for (int i = 0; i < 100; i++) { if ((i == 25) || (i == 75)) - assertTrue("Should be null: " + i, retArray[i] == null); + assertNull("Should be null: " + i, retArray[i]); else assertTrue("Returned incorrect array: " + i, retArray[i] == objArray[i]); Index: modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/CollectionsTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -409,7 +409,7 @@ assertTrue("Fill with nulls modified list size", size == ll.size()); i = ll.iterator(); while (i.hasNext()) - assertTrue("Failed to fill with nulls", i.next() == null); + assertNull("Failed to fill with nulls", i.next()); } /** @@ -488,7 +488,7 @@ i = l.iterator(); for (int counter = 0; i.hasNext(); counter++) { assertTrue("List is too large", counter < 20); - assertTrue("Element should be null: " + counter, i.next() == null); + assertNull("Element should be null: " + counter, i.next()); } try { l.add(o); @@ -529,8 +529,8 @@ Collections.reverse(myList); assertTrue("Did not reverse correctly--first element is: " + myList.get(0), myList.get(0).equals(new Integer(20))); - assertTrue("Did not reverse correctly--second element is: " - + myList.get(1), myList.get(1) == null); + assertNull("Did not reverse correctly--second element is: " + + myList.get(1), myList.get(1)); } /** @@ -1338,8 +1338,8 @@ fail(type + " list tests: join() interrupted"); } synchList.set(25, null); - assertTrue(type + " list tests: Trying to use nulls in list failed", - synchList.get(25) == null); + assertNull(type + " list tests: Trying to use nulls in list failed", + synchList.get(25)); } /** @@ -1387,8 +1387,8 @@ // synchronized map does not have to permit null keys or values synchMap.put(new Long(25), null); synchMap.put(null, new Long(30)); - assertTrue("Trying to use a null value in map failed", synchMap - .get(new Long(25)) == null); + assertNull("Trying to use a null value in map failed", synchMap + .get(new Long(25))); assertTrue("Trying to use a null key in map failed", synchMap.get(null) .equals(new Long(30))); @@ -1399,12 +1399,12 @@ synchMap = Collections.synchronizedMap(smallMap); new Support_UnmodifiableMapTest("", synchMap).runTest(); synchMap.keySet().remove(objArray[50].toString()); - assertTrue( + assertNull( "Removing a key from the keySet of the synchronized map did not remove it from the synchronized map: ", - synchMap.get(objArray[50].toString()) == null); - assertTrue( + synchMap.get(objArray[50].toString())); + assertNull( "Removing a key from the keySet of the synchronized map did not remove it from the original map", - smallMap.get(objArray[50].toString()) == null); + smallMap.get(objArray[50].toString())); } /** @@ -1510,12 +1510,12 @@ synchMap = Collections.synchronizedSortedMap(smallMap); new Support_UnmodifiableMapTest("", synchMap).runTest(); synchMap.keySet().remove(objArray[50].toString()); - assertTrue( + assertNull( "Removing a key from the keySet of the synchronized map did not remove it from the synchronized map", - synchMap.get(objArray[50].toString()) == null); - assertTrue( + synchMap.get(objArray[50].toString())); + assertNull( "Removing a key from the keySet of the synchronized map did not remove it from the original map", - smallMap.get(objArray[50].toString()) == null); + smallMap.get(objArray[50].toString())); } /** @@ -1656,7 +1656,7 @@ smallList.add(null); smallList.add("yoink"); c = Collections.unmodifiableList(smallList); - assertTrue("First element should be null", c.get(0) == null); + assertNull("First element should be null", c.get(0)); assertTrue("List should contain null", c.contains(null)); assertTrue( "T1. Returned List should implement Random Access interface", @@ -1751,8 +1751,8 @@ smallMap.put(new Long(25), null); Map unmodMap = Collections.unmodifiableMap(smallMap); - assertTrue("Trying to use a null value in map failed", unmodMap - .get(new Long(25)) == null); + assertNull("Trying to use a null value in map failed", unmodMap + .get(new Long(25))); assertTrue("Trying to use a null key in map failed", unmodMap.get(null) .equals(new Long(30))); Index: modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/AbstractCollectionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -145,7 +145,7 @@ .contains(intArray[i])); duplicates.add(intArray[i]); } - assertTrue("End of list should be null", intArray[100] == null); + assertNull("End of list should be null", intArray[100]); intArray = new Integer[1]; intArray = (Integer[]) org.toArray(intArray); Index: modules/luni/src/test/java/tests/api/java/util/CurrencyTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/CurrencyTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/CurrencyTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -77,9 +77,9 @@ Locale loc = new Locale("", "AQ"); try { Currency curr = Currency.getInstance(loc); - assertTrue( + assertNull( "Currency.getInstance(new Locale(\"\", \"AQ\")) did not return null", - curr == null); + curr); } catch (IllegalArgumentException e) { fail("Unexpected IllegalArgumentException " + e); } Index: modules/luni/src/test/java/tests/api/java/util/HashtableTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/HashtableTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/HashtableTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -69,7 +69,7 @@ assertTrue("Created incorrect hashtable", h.size() == 0); Hashtable empty = new Hashtable(0); - assertTrue("Empty hashtable access", empty.get("nothing") == null); + assertNull("Empty hashtable access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -83,7 +83,7 @@ assertTrue("Created incorrect hashtable", h.size() == 0); Hashtable empty = new Hashtable(0, 0.75f); - assertTrue("Empty hashtable access", empty.get("nothing") == null); + assertNull("Empty hashtable access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -216,10 +216,10 @@ try { // cached "12" Object result = en.nextElement(); - assertTrue("unexpected: " + result, result == null); + assertNull("unexpected: " + result, result); // next is removed "9" result = en.nextElement(); - assertTrue("unexpected: " + result, result == null); + assertNull("unexpected: " + result, result); result = en.nextElement(); assertTrue("unexpected: " + result, "b".equals(result)); } catch (NoSuchElementException e) { Index: modules/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -27,9 +27,9 @@ try { throw new TooManyListenersException(); } catch (TooManyListenersException e) { - assertTrue( + assertNull( "Message thrown with exception constructed with no message", - e.getMessage() == null); + e.getMessage()); } } Index: modules/luni/src/test/java/tests/api/java/util/VectorTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/VectorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/VectorTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -119,7 +119,7 @@ prev = tVector.get(50); tVector.add(50, null); - assertTrue("Failed to add null", tVector.get(50) == null); + assertNull("Failed to add null", tVector.get(50)); assertTrue("Failed to fix-up existing indices after adding null", tVector.get(51) == prev); assertTrue("Wrong size after add", tVector.size() == 102); @@ -136,7 +136,7 @@ assertTrue("Wrong size after add", tVector.size() == 101); tVector.add(null); - assertTrue("Failed to add null", tVector.lastElement() == null); + assertNull("Failed to add null", tVector.lastElement()); assertTrue("Wrong size after add", tVector.size() == 102); } @@ -170,12 +170,12 @@ l.add("gah"); l.add(null); tVector.addAll(50, l); - assertTrue("Wrong element at position 50--wanted null", - tVector.get(50) == null); + assertNull("Wrong element at position 50--wanted null", + tVector.get(50)); assertTrue("Wrong element at position 51--wanted 'gah'", tVector .get(51).equals("gah")); - assertTrue("Wrong element at position 52--wanted null", - tVector.get(52) == null); + assertNull("Wrong element at position 52--wanted null", + tVector.get(52)); } /** @@ -201,12 +201,12 @@ l.add("gah"); l.add(null); tVector.addAll(l); - assertTrue("Wrong element at 3rd last position--wanted null", tVector - .get(vSize) == null); + assertNull("Wrong element at 3rd last position--wanted null", tVector + .get(vSize)); assertTrue("Wrong element at 2nd last position--wanted 'gah'", tVector .get(vSize + 1).equals("gah")); - assertTrue("Wrong element at last position--wanted null", tVector - .get(vSize + 2) == null); + assertNull("Wrong element at last position--wanted null", tVector + .get(vSize + 2)); } /** @@ -221,7 +221,7 @@ .equals("Added Element")); v.addElement(null); assertTrue("Failed to add null", v.contains(null)); - assertTrue("Added null to wrong slot", v.elementAt(101) == null); + assertNull("Added null to wrong slot", v.elementAt(101)); } /** @@ -236,7 +236,7 @@ .equals("Added Element")); v.addElement(null); assertTrue("Failed to add null", v.contains(null)); - assertTrue("Added null to wrong slot", v.elementAt(101) == null); + assertNull("Added null to wrong slot", v.elementAt(101)); } /** @@ -353,8 +353,8 @@ assertTrue("Incorrect element returned", ((String) tVector .elementAt(18)).equals("Test 18")); tVector.setElementAt(null, 20); - assertTrue("Incorrect element returned--wanted null", tVector - .elementAt(20) == null); + assertNull("Incorrect element returned--wanted null", tVector + .elementAt(20)); } @@ -444,8 +444,8 @@ assertTrue("Returned incorrect firstElement", tVector.firstElement() .equals("Test 0")); tVector.insertElementAt(null, 0); - assertTrue("Returned incorrect firstElement--wanted null", tVector - .firstElement() == null); + assertNull("Returned incorrect firstElement--wanted null", tVector + .firstElement()); } /** @@ -456,8 +456,8 @@ assertTrue("Get returned incorrect object", tVector.get(80).equals( "Test 80")); tVector.add(25, null); - assertTrue("Returned incorrect element--wanted null", - tVector.get(25) == null); + assertNull("Returned incorrect element--wanted null", + tVector.get(25)); } /** @@ -521,7 +521,7 @@ assertTrue("Elements shifted incorrectly", ((String) v.elementAt(100)) .equals(prevElement)); v.insertElementAt(null, 20); - assertTrue("null not inserted", v.elementAt(20) == null); + assertNull("null not inserted", v.elementAt(20)); } /** @@ -574,8 +574,8 @@ assertTrue("Incorrect last element returned", tVector.lastElement() .equals("Test 99")); tVector.addElement(null); - assertTrue("Incorrect last element returned--wanted null", tVector - .lastElement() == null); + assertNull("Incorrect last element returned--wanted null", tVector + .lastElement()); } /** @@ -627,7 +627,7 @@ tVector.size() == 99); tVector.add(20, null); tVector.remove(19); - assertTrue("Didn't move null element over", tVector.get(19) == null); + assertNull("Didn't move null element over", tVector.get(19)); tVector.remove(19); assertTrue("Didn't remove null element", tVector.get(19) != null); assertTrue("Failed to decrement size after removing null", tVector @@ -844,7 +844,7 @@ for (int i = 0; i < o.length; i++) o[i] = f; tVector.toArray(o); - assertTrue("Failed to set slot to null", o[100] == null); + assertNull("Failed to set slot to null", o[100]); for (int i = 0; i < tVector.size(); i++) assertTrue("Returned incorrect array", tVector.elementAt(i) == o[i]); } Index: modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/LinkedListTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -70,7 +70,7 @@ assertTrue("Failed to fix up list after insert", ll.get(51) == objArray[50] && (ll.get(52) == objArray[51])); ll.add(50, null); - assertTrue("Did not add null correctly", ll.get(50) == null); + assertNull("Did not add null correctly", ll.get(50)); } /** @@ -82,7 +82,7 @@ ll.add(o = new Object()); assertTrue("Failed to add Object", ll.getLast() == o); ll.add(null); - assertTrue("Did not add null correctly", ll.get(ll.size() - 1) == null); + assertNull("Did not add null correctly", ll.get(ll.size() - 1)); } /** @@ -109,13 +109,13 @@ myList.add("Booga"); myList.add(null); ll.addAll(50, myList); - assertTrue("a) List w/nulls not added correctly", ll.get(50) == null); + assertNull("a) List w/nulls not added correctly", ll.get(50)); assertTrue("b) List w/nulls not added correctly", ll.get(51).equals( "Blah")); - assertTrue("c) List w/nulls not added correctly", ll.get(52) == null); + assertNull("c) List w/nulls not added correctly", ll.get(52)); assertTrue("d) List w/nulls not added correctly", ll.get(53).equals( "Booga")); - assertTrue("e) List w/nulls not added correctly", ll.get(54) == null); + assertNull("e) List w/nulls not added correctly", ll.get(54)); } /** @@ -145,13 +145,13 @@ myList.add("Booga"); myList.add(null); ll.addAll(myList); - assertTrue("a) List w/nulls not added correctly", ll.get(200) == null); + assertNull("a) List w/nulls not added correctly", ll.get(200)); assertTrue("b) List w/nulls not added correctly", ll.get(201).equals( "Blah")); - assertTrue("c) List w/nulls not added correctly", ll.get(202) == null); + assertNull("c) List w/nulls not added correctly", ll.get(202)); assertTrue("d) List w/nulls not added correctly", ll.get(203).equals( "Booga")); - assertTrue("e) List w/nulls not added correctly", ll.get(204) == null); + assertNull("e) List w/nulls not added correctly", ll.get(204)); } /** @@ -163,7 +163,7 @@ ll.addFirst(o = new Object()); assertTrue("Failed to add Object", ll.getFirst() == o); ll.addFirst(null); - assertTrue("Failed to add null", ll.getFirst() == null); + assertNull("Failed to add null", ll.getFirst()); } /** @@ -175,7 +175,7 @@ ll.addLast(o = new Object()); assertTrue("Failed to add Object", ll.getLast() == o); ll.addLast(null); - assertTrue("Failed to add null", ll.getLast() == null); + assertNull("Failed to add null", ll.getLast()); } /** @@ -185,7 +185,7 @@ // Test for method void java.util.LinkedList.clear() ll.clear(); for (int i = 0; i < ll.size(); i++) - assertTrue("Failed to clear list", ll.get(i) == null); + assertNull("Failed to clear list", ll.get(i)); } /** @@ -322,15 +322,15 @@ myList.add(null); ListIterator li = myList.listIterator(); assertTrue("li.hasPrevious() should be false", !li.hasPrevious()); - assertTrue("li.next() should be null", li.next() == null); + assertNull("li.next() should be null", li.next()); assertTrue("li.hasPrevious() should be true", li.hasPrevious()); - assertTrue("li.prev() should be null", li.previous() == null); - assertTrue("li.next() should be null", li.next() == null); + assertNull("li.prev() should be null", li.previous()); + assertNull("li.next() should be null", li.next()); assertTrue("li.next() should be Blah", li.next().equals("Blah")); - assertTrue("li.next() should be null", li.next() == null); + assertNull("li.next() should be null", li.next()); assertTrue("li.next() should be Booga", li.next().equals("Booga")); assertTrue("li.hasNext() should be true", li.hasNext()); - assertTrue("li.next() should be null", li.next() == null); + assertNull("li.next() should be null", li.next()); assertTrue("li.hasNext() should be false", !li.hasNext()); } @@ -418,8 +418,8 @@ for (int i = 0; i < obj.length - 1; i++) assertTrue("Returned incorrect array: " + i, obj[i] == objArray[i]); - assertTrue("Returned incorrect array--end isn't null", - obj[obj.length - 1] == null); + assertNull("Returned incorrect array--end isn't null", + obj[obj.length - 1]); } /** @@ -439,8 +439,8 @@ assertTrue("Lists are not equal", li.next() == ri.next()); argArray = new Integer[1000]; retArray = ll.toArray(argArray); - assertTrue("Failed to set first extra element to null", argArray[ll - .size()] == null); + assertNull("Failed to set first extra element to null", argArray[ll + .size()]); for (int i = 0; i < ll.size(); i++) assertTrue("Returned incorrect array: " + i, retArray[i] == objArray[i]); Index: modules/luni/src/test/java/tests/api/java/util/StackTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/StackTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/StackTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -63,8 +63,8 @@ s.pop(); assertTrue("Peek did not return top item after a pop", s.pop() == item2); s.push(null); - assertTrue("Peek did not return top item (wanted: null)", - s.peek() == null); + assertNull("Peek did not return top item (wanted: null)", + s.peek()); } /** @@ -97,7 +97,7 @@ s.push(null); try { lastPopped = s.pop(); - assertTrue("c) Pop did not return top item", lastPopped == null); + assertNull("c) Pop did not return top item", lastPopped); } catch (EmptyStackException e) { fail( "c) Pop threw EmptyStackException when stack should not have been empty"); Index: modules/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -82,7 +82,7 @@ "Failed to throw IllegalArgumentException for initial capacity < 0"); LinkedHashMap empty = new LinkedHashMap(0); - assertTrue("Empty LinkedHashMap access", empty.get("nothing") == null); + assertNull("Empty LinkedHashMap access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -102,7 +102,7 @@ fail( "Failed to throw IllegalArgumentException for initial load factor <= 0"); LinkedHashMap empty = new LinkedHashMap(0, 0.75f); - assertTrue("Empty hashtable access", empty.get("nothing") == null); + assertNull("Empty hashtable access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -127,8 +127,8 @@ public void test_getLjava_lang_Object() { // Test for method java.lang.Object // java.util.LinkedHashMap.get(java.lang.Object) - assertTrue("Get returned non-null for non existent key", - hm.get("T") == null); + assertNull("Get returned non-null for non existent key", + hm.get("T")); hm.put("T", "HELLO"); assertTrue("Get returned incorecct value for existing key", hm.get("T") .equals("HELLO")); @@ -136,8 +136,8 @@ LinkedHashMap m = new LinkedHashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.get(null).equals("test")); - assertTrue("Failed with missing key matching null hash", m - .get(new Integer(0)) == null); + assertNull("Failed with missing key matching null hash", m + .get(new Integer(0))); } /** @@ -202,7 +202,7 @@ LinkedHashMap m = new LinkedHashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.keySet().contains(null)); - assertTrue("Failed with null key", m.keySet().iterator().next() == null); + assertNull("Failed with null key", m.keySet().iterator().next()); Map map = new LinkedHashMap(101); map.put(new Integer(1), "1"); @@ -277,15 +277,15 @@ Integer y = new Integer(9); Integer x = ((Integer) hm.remove(y.toString())); assertTrue("Remove returned incorrect value", x.equals(new Integer(9))); - assertTrue("Failed to remove given key", hm.get(new Integer(9)) == null); + assertNull("Failed to remove given key", hm.get(new Integer(9))); assertTrue("Failed to decrement size", hm.size() == (size - 1)); - assertTrue("Remove of non-existent key returned non-null", hm - .remove("LCLCLC") == null); + assertNull("Remove of non-existent key returned non-null", hm + .remove("LCLCLC")); LinkedHashMap m = new LinkedHashMap(); m.put(null, "test"); - assertTrue("Failed with same hash as null", - m.remove(new Integer(0)) == null); + assertNull("Failed with same hash as null", + m.remove(new Integer(0))); assertTrue("Failed with null key", m.remove(null).equals("test")); } @@ -297,8 +297,8 @@ hm.clear(); assertTrue("Clear failed to reset size", hm.size() == 0); for (int i = 0; i < hmSize; i++) - assertTrue("Failed to clear all elements", - hm.get(objArray2[i]) == null); + assertNull("Failed to clear all elements", + hm.get(objArray2[i])); } Index: modules/luni/src/test/java/tests/api/java/util/IdentityHashMap2Test.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/IdentityHashMap2Test.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/IdentityHashMap2Test.java 2006-04-16 10:54:13.000000000 +0100 @@ -40,9 +40,9 @@ result = map.put(null, null); assertTrue("testA can not find null key", map.containsKey(null)); assertTrue("testA can not find null value", map.containsValue(null)); - assertTrue("testA can not get null value for null key", - map.get(null) == null); - assertTrue("testA put returned wrong value", result == null); + assertNull("testA can not get null value for null key", + map.get(null)); + assertNull("testA put returned wrong value", result); // null value String value = "a value"; @@ -52,7 +52,7 @@ .containsValue(value)); assertTrue("testB can not get value for null key", map.get(null) == value); - assertTrue("testB put returned wrong value", result == null); + assertNull("testB put returned wrong value", result); // a null key String key = "a key"; @@ -60,8 +60,8 @@ assertTrue("testC can not find a key with null value", map .containsKey(key)); assertTrue("testC can not find null value", map.containsValue(null)); - assertTrue("testC can not get null value for key", map.get(key) == null); - assertTrue("testC put returned wrong value", result == null); + assertNull("testC can not get null value for key", map.get(key)); + assertNull("testC put returned wrong value", result); // another null key String anothervalue = "another value"; @@ -79,8 +79,8 @@ assertTrue("testE should not find null key", !map.containsKey(null)); assertTrue("testE should not find a value with null key", !map .containsValue(anothervalue)); - assertTrue("testE should not get value for null key", - map.get(null) == null); + assertNull("testE should not get value for null key", + map.get(null)); } /** @@ -100,7 +100,7 @@ assertTrue("Modified key2", map.get("key2") != null && map.get("key2") == "value2"); - assertTrue("Modified null entry", map.get(null) == null); + assertNull("Modified null entry", map.get(null)); } /** Index: modules/luni/src/test/java/tests/api/java/util/HashMapTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/HashMapTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/HashMapTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -73,7 +73,7 @@ "Failed to throw IllegalArgumentException for initial capacity < 0"); HashMap empty = new HashMap(0); - assertTrue("Empty hashmap access", empty.get("nothing") == null); + assertNull("Empty hashmap access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -94,7 +94,7 @@ "Failed to throw IllegalArgumentException for initial load factor <= 0"); HashMap empty = new HashMap(0, 0.75f); - assertTrue("Empty hashtable access", empty.get("nothing") == null); + assertNull("Empty hashtable access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -121,8 +121,8 @@ hm.clear(); assertTrue("Clear failed to reset size", hm.size() == 0); for (int i = 0; i < hmSize; i++) - assertTrue("Failed to clear all elements", - hm.get(objArray2[i]) == null); + assertNull("Failed to clear all elements", + hm.get(objArray2[i])); } @@ -212,8 +212,8 @@ public void test_getLjava_lang_Object() { // Test for method java.lang.Object // java.util.HashMap.get(java.lang.Object) - assertTrue("Get returned non-null for non existent key", - hm.get("T") == null); + assertNull("Get returned non-null for non existent key", + hm.get("T")); hm.put("T", "HELLO"); assertTrue("Get returned incorecct value for existing key", hm.get("T") .equals("HELLO")); @@ -221,8 +221,8 @@ HashMap m = new HashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.get(null).equals("test")); - assertTrue("Failed with missing key matching null hash", m - .get(new Integer(0)) == null); + assertNull("Failed with missing key matching null hash", m + .get(new Integer(0))); // Regression for HARMONY-206 ReusableKey k = new ReusableKey(); @@ -260,7 +260,7 @@ HashMap m = new HashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.keySet().contains(null)); - assertTrue("Failed with null key", m.keySet().iterator().next() == null); + assertNull("Failed with null key", m.keySet().iterator().next()); Map map = new HashMap(101); map.put(new Integer(1), "1"); @@ -341,15 +341,15 @@ Integer y = new Integer(9); Integer x = ((Integer) hm.remove(y.toString())); assertTrue("Remove returned incorrect value", x.equals(new Integer(9))); - assertTrue("Failed to remove given key", hm.get(new Integer(9)) == null); + assertNull("Failed to remove given key", hm.get(new Integer(9))); assertTrue("Failed to decrement size", hm.size() == (size - 1)); - assertTrue("Remove of non-existent key returned non-null", hm - .remove("LCLCLC") == null); + assertNull("Remove of non-existent key returned non-null", hm + .remove("LCLCLC")); HashMap m = new HashMap(); m.put(null, "test"); - assertTrue("Failed with same hash as null", - m.remove(new Integer(0)) == null); + assertNull("Failed with same hash as null", + m.remove(new Integer(0))); assertTrue("Failed with null key", m.remove(null).equals("test")); } Index: modules/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -172,7 +172,7 @@ LinkedHashSet s = new LinkedHashSet(); s.add(null); - assertTrue("Cannot handle null", s.iterator().next() == null); + assertNull("Cannot handle null", s.iterator().next()); } /** Index: modules/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -62,7 +62,7 @@ whm.get(keyArray[i]) == valueArray[i]); WeakHashMap empty = new WeakHashMap(0); - assertTrue("Empty weakhashmap access", empty.get("nothing") == null); + assertNull("Empty weakhashmap access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -80,7 +80,7 @@ whm.get(keyArray[i]) == valueArray[i]); WeakHashMap empty = new WeakHashMap(0, 0.75f); - assertTrue("Empty hashtable access", empty.get("nothing") == null); + assertNull("Empty hashtable access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -96,8 +96,8 @@ whm.clear(); assertTrue("Cleared map should be empty", whm.isEmpty()); for (int i = 0; i < 100; i++) - assertTrue("Cleared map should only return null", whm - .get(keyArray[i]) == null); + assertNull("Cleared map should only return null", whm + .get(keyArray[i])); } @@ -218,8 +218,8 @@ assertTrue("Remove returned incorrect value", whm.remove(keyArray[25]) == valueArray[25]); - assertTrue("Remove returned incorrect value", - whm.remove(keyArray[25]) == null); + assertNull("Remove returned incorrect value", + whm.remove(keyArray[25])); assertTrue("Size should be 99 after remove", whm.size() == 99); } Index: modules/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -78,7 +78,7 @@ "Failed to throw IllegalArgumentException for initial capacity < 0"); IdentityHashMap empty = new IdentityHashMap(0); - assertTrue("Empty IdentityHashMap access", empty.get("nothing") == null); + assertNull("Empty IdentityHashMap access", empty.get("nothing")); empty.put("something", "here"); assertTrue("cannot get element", empty.get("something") == "here"); } @@ -105,8 +105,8 @@ hm.clear(); assertTrue("Clear failed to reset size", hm.size() == 0); for (int i = 0; i < hmSize; i++) - assertTrue("Failed to clear all elements", - hm.get(objArray2[i]) == null); + assertNull("Failed to clear all elements", + hm.get(objArray2[i])); } @@ -198,8 +198,8 @@ public void test_getLjava_lang_Object() { // Test for method java.lang.Object // java.util.IdentityHashMap.get(java.lang.Object) - assertTrue("Get returned non-null for non existent key", - hm.get("T") == null); + assertNull("Get returned non-null for non existent key", + hm.get("T")); hm.put("T", "HELLO"); assertTrue("Get returned incorecct value for existing key", hm.get("T") .equals("HELLO")); @@ -207,8 +207,8 @@ IdentityHashMap m = new IdentityHashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.get(null).equals("test")); - assertTrue("Failed with missing key matching null hash", m - .get(new Integer(0)) == null); + assertNull("Failed with missing key matching null hash", m + .get(new Integer(0))); } /** @@ -236,7 +236,7 @@ IdentityHashMap m = new IdentityHashMap(); m.put(null, "test"); assertTrue("Failed with null key", m.keySet().contains(null)); - assertTrue("Failed with null key", m.keySet().iterator().next() == null); + assertNull("Failed with null key", m.keySet().iterator().next()); Map map = new IdentityHashMap(101); map.put(new Integer(1), "1"); @@ -318,15 +318,15 @@ int size = hm.size(); Integer x = ((Integer) hm.remove(objArray2[9])); assertTrue("Remove returned incorrect value", x.equals(new Integer(9))); - assertTrue("Failed to remove given key", hm.get(objArray2[9]) == null); + assertNull("Failed to remove given key", hm.get(objArray2[9])); assertTrue("Failed to decrement size", hm.size() == (size - 1)); - assertTrue("Remove of non-existent key returned non-null", hm - .remove("LCLCLC") == null); + assertNull("Remove of non-existent key returned non-null", hm + .remove("LCLCLC")); IdentityHashMap m = new IdentityHashMap(); m.put(null, "test"); - assertTrue("Failed with same hash as null", - m.remove(objArray[0]) == null); + assertNull("Failed with same hash as null", + m.remove(objArray[0])); assertTrue("Failed with null key", m.remove(null).equals("test")); } Index: modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java =================================================================== --- modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/luni/src/test/java/tests/api/java/util/PropertiesTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -137,8 +137,8 @@ } assertTrue("Failed to load correct properties", prop.getProperty( "test.pkg").equals("harmony.tests")); - assertTrue("Load failed to parse incorrectly", prop - .getProperty("commented.entry") == null); + assertNull("Load failed to parse incorrectly", prop + .getProperty("commented.entry")); prop = new Properties(); try { Index: modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java =================================================================== --- modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/cert/X509CRLSelectorTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -430,8 +430,8 @@ X500Principal iss1 = new X500Principal("O=First Org."); X500Principal iss2 = new X500Principal("O=Second Org."); X500Principal iss3 = new X500Principal("O=Third Org."); - assertTrue("The collection should be null.", - selector.getIssuers() == null); + assertNull("The collection should be null.", + selector.getIssuers()); selector.addIssuer(iss1); selector.addIssuer(iss2); Collection result = selector.getIssuers(); @@ -459,8 +459,8 @@ //manually obtained DER encoding of "O=Second Org." issuer name; {48, 22, 49, 20, 48, 18, 6, 3, 85, 4, 10, 19, 11, 83, 101, 99, 111, 110, 100, 32, 79, 114, 103, 46}; - assertTrue("The collection should be null.", - selector.getIssuerNames() == null); + assertNull("The collection should be null.", + selector.getIssuerNames()); try { selector.addIssuerName(iss1); selector.addIssuerName(iss2); @@ -480,8 +480,8 @@ */ public void testGetMinCRL() { X509CRLSelector selector = new X509CRLSelector(); - assertTrue("Initially the minCRL should be null.", - selector.getMinCRL() == null); + assertNull("Initially the minCRL should be null.", + selector.getMinCRL()); BigInteger minCRL = new BigInteger("10000"); selector.setMinCRLNumber(minCRL); assertTrue("The result should be equal to specified.", @@ -495,8 +495,8 @@ */ public void testGetMaxCRL() { X509CRLSelector selector = new X509CRLSelector(); - assertTrue("Initially the maxCRL should be null.", - selector.getMaxCRL() == null); + assertNull("Initially the maxCRL should be null.", + selector.getMaxCRL()); BigInteger maxCRL = new BigInteger("10000"); selector.setMaxCRLNumber(maxCRL); assertTrue("The result should be equal to specified.", @@ -510,8 +510,8 @@ */ public void testGetDateAndTime() { X509CRLSelector selector = new X509CRLSelector(); - assertTrue("Initially the dateAndTime criteria should be null.", - selector.getDateAndTime() == null); + assertNull("Initially the dateAndTime criteria should be null.", + selector.getDateAndTime()); Date date = new Date(200); selector.setDateAndTime(date); assertTrue("The result should be equal to specified.", Index: modules/security/src/test/java/common/java/security/cert/CRLTest.java =================================================================== --- modules/security/src/test/java/common/java/security/cert/CRLTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/cert/CRLTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -58,7 +58,7 @@ */ public final void testGetType02() { CRL crl = new MyCRL(null); - assertTrue(crl.getType() == null); + assertNull(crl.getType()); } // Index: modules/security/src/test/java/common/java/security/KeyPairTest.java =================================================================== --- modules/security/src/test/java/common/java/security/KeyPairTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/KeyPairTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -96,7 +96,7 @@ */ public final void testGetPrivate01() { KeyPair kp = new KeyPair(null, null); - assertTrue(kp.getPrivate() == null); + assertNull(kp.getPrivate()); } /** @@ -116,7 +116,7 @@ */ public final void testGetPublic01() { KeyPair kp = new KeyPair(null, null); - assertTrue(kp.getPublic() == null); + assertNull(kp.getPublic()); } /** Index: modules/security/src/test/java/common/java/security/spec/ECFieldF2mTest.java =================================================================== --- modules/security/src/test/java/common/java/security/spec/ECFieldF2mTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/spec/ECFieldF2mTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -589,7 +589,7 @@ * Assertion: returns null for normal basis */ public final void testGetMidTermsOfReductionPolynomial02() { - assertTrue(new ECFieldF2m(2000).getMidTermsOfReductionPolynomial() == null); + assertNull(new ECFieldF2m(2000).getMidTermsOfReductionPolynomial()); } /** @@ -620,7 +620,7 @@ * Assertion: returns null for normal basis */ public final void testGetReductionPolynomial02() { - assertTrue(new ECFieldF2m(2000).getReductionPolynomial() == null); + assertNull(new ECFieldF2m(2000).getReductionPolynomial()); } /** Index: modules/security/src/test/java/common/java/security/spec/PSSParameterSpecTest.java =================================================================== --- modules/security/src/test/java/common/java/security/spec/PSSParameterSpecTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/spec/PSSParameterSpecTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -197,7 +197,7 @@ public final void testGetMGFParameters02() { PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1", null, 20, 1); - assertTrue(pssps.getMGFParameters() == null); + assertNull(pssps.getMGFParameters()); } Index: modules/security/src/test/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java =================================================================== --- modules/security/src/test/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/java/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -565,7 +565,7 @@ BigInteger.ONE, BigInteger.ONE, null); - assertTrue(ks.getOtherPrimeInfo() == null); + assertNull(ks.getOtherPrimeInfo()); } // Index: modules/security/src/test/java/common/tests/api/java/security/KeyStoreTest.java =================================================================== --- modules/security/src/test/java/common/tests/api/java/security/KeyStoreTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/tests/api/java/security/KeyStoreTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -297,8 +297,8 @@ && cert[1].getPublicKey() == certRes[1].getPublicKey()); java.security.cert.Certificate[] certResNull = keyTest .getCertificateChain("alias1"); - assertTrue("the certificate chain returned from " - + "getCertificateChain is NOT null", certResNull == null); + assertNull("the certificate chain returned from " + + "getCertificateChain is NOT null", certResNull); } /** Index: modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java =================================================================== --- modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/tests/api/java/security/SecurityTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -507,9 +507,9 @@ assertTrue("Failed to add provider", addResult != -1); Security.removeProvider(test.getName()); - assertTrue( + assertNull( "the provider TestProvider is found after it was removed", - Security.getProvider(test.getName()) == null); + Security.getProvider(test.getName())); // Make sure entrust provider not already loaded. Should do nothing // if not already loaded. Index: modules/security/src/test/java/common/tests/api/java/security/AccessControlExceptionTest.java =================================================================== --- modules/security/src/test/java/common/tests/api/java/security/AccessControlExceptionTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/tests/api/java/security/AccessControlExceptionTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -59,9 +59,9 @@ // Test for method java.security.Permission // java.security.AccessControlException.getPermission() // make sure getPermission returns null when it's not set - assertTrue( + assertNull( "getPermission should have returned null if no permission was set", - acException.getPermission() == null); + acException.getPermission()); assertTrue( "getPermission should have returned the permission we assigned to it", acException1.getPermission() == filePermission); Index: modules/security/src/test/java/common/tests/api/java/security/CodeSourceTest.java =================================================================== --- modules/security/src/test/java/common/tests/api/java/security/CodeSourceTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ modules/security/src/test/java/common/tests/api/java/security/CodeSourceTest.java 2006-04-16 11:04:42.000000000 +0100 @@ -62,8 +62,8 @@ public void test_getCertificates() throws Exception { CodeSource cs = new CodeSource(new java.net.URL("file:///test"), (Certificate[]) null); - assertTrue("Should have gotten null certificate list.", cs - .getCertificates() == null); + assertNull("Should have gotten null certificate list.", cs + .getCertificates()); } /** Index: support/src/test/java/tests/support/Support_UnmodifiableMapTest.java =================================================================== --- support/src/test/java/tests/support/Support_UnmodifiableMapTest.java.orig 2006-04-16 10:54:09.000000000 +0100 +++ support/src/test/java/tests/support/Support_UnmodifiableMapTest.java 2006-04-16 10:54:13.000000000 +0100 @@ -72,8 +72,8 @@ ((Integer) map.get("0")).intValue() == 0); assertTrue("UnmodifiableMapTest - getting \"50\" didn't return 0", ((Integer) map.get("0")).intValue() == 0); - assertTrue("UnmodifiableMapTest - getting \"100\" didn't return null", - map.get("100") == null); + assertNull("UnmodifiableMapTest - getting \"100\" didn't return null", + map.get("100")); // isEmpty assertTrue(