--- old/src/solaris/native/java/lang/java_props_macosx.c Mon Dec 17 18:00:23 2012 +++ new/src/solaris/native/java/lang/java_props_macosx.c Mon Dec 17 18:00:23 2012 @@ -115,10 +115,6 @@ return true; } -static bool isXDisplayDefined() { - return getenv("DISPLAY") != NULL; -} - PreferredToolkit getPreferredToolkit() { static PreferredToolkit pref = unset; if (pref != unset) return pref; @@ -127,7 +123,6 @@ if (prefFromEnv != unset) return pref = prefFromEnv; if (isInAquaSession()) return pref = CToolkit; - if (isXDisplayDefined()) return pref = XToolkit; return pref = HToolkit; } --- old/test/ProblemList.txt Mon Dec 17 18:00:26 2012 +++ new/test/ProblemList.txt Mon Dec 17 18:00:26 2012 @@ -238,27 +238,6 @@ # 7056489 com/sun/jndi/ldap/ReadTimeoutTest.java generic-all -# 7162111 -demo/jvmti/mtrace/TraceJFrame.java macosx-all -javax/script/CauseExceptionTest.java macosx-all -javax/script/GetInterfaceTest.java macosx-all -javax/script/JavaScriptScopeTest.java macosx-all -javax/script/NullUndefinedVarTest.java macosx-all -javax/script/PluggableContextTest.java macosx-all -javax/script/ProviderTest.sh macosx-all -javax/script/RhinoExceptionTest.java macosx-all -javax/script/StringWriterPrintTest.java macosx-all -javax/script/Test1.java macosx-all -javax/script/Test2.java macosx-all -javax/script/Test3.java macosx-all -javax/script/Test4.java macosx-all -javax/script/Test5.java macosx-all -javax/script/Test6.java macosx-all -javax/script/Test7.java macosx-all -javax/script/Test8.java macosx-all -javax/script/UnescapedBracketRegExTest.java macosx-all -javax/script/VersionTest.java macosx-all - ############################################################################ # jdk_net @@ -301,11 +280,6 @@ # 6962637 java/io/File/MaxPathLength.java windows-all -# 7162111 - these tests need to be updated to run headless -java/io/Serializable/resolveClass/deserializeButton/run.sh macosx-all -java/io/Serializable/serialver/classpath/run.sh macosx-all -java/io/Serializable/serialver/nested/run.sh macosx-all - ############################################################################ # jdk_nio @@ -479,14 +453,6 @@ # 7132203 sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all -# 7162111 -sun/tools/jrunscript/jrunscript-DTest.sh macosx-all -sun/tools/jrunscript/jrunscript-argsTest.sh macosx-all -sun/tools/jrunscript/jrunscript-cpTest.sh macosx-all -sun/tools/jrunscript/jrunscript-eTest.sh macosx-all -sun/tools/jrunscript/jrunscript-fTest.sh macosx-all -sun/tools/jrunscript/jrunscriptTest.sh macosx-all - # 8001118 sun/tools/jcmd/jcmd-f.sh generic-all sun/tools/jcmd/jcmd-help-help.sh generic-all @@ -535,10 +501,6 @@ # Problems on windows, jmap.exe hangs? (these run jmap), fails on Solaris 10 x86 java/util/concurrent/locks/Lock/TimedAcquireLeak.java generic-all -# 7162111 -java/util/ResourceBundle/Control/Bug6530694.java macosx-all -java/util/logging/LoggingDeadlock4.java macosx-all - # 7041639, Solaris DSA keypair generation bug java/util/TimeZone/TimeZoneDatePermissionCheck.sh solaris-all --- old/test/demo/jvmti/mtrace/TraceJFrame.java Mon Dec 17 18:00:29 2012 +++ new/test/demo/jvmti/mtrace/TraceJFrame.java Mon Dec 17 18:00:29 2012 @@ -32,21 +32,26 @@ * @run main TraceJFrame JFrameCreateTime */ -public class TraceJFrame { +import java.awt.GraphicsEnvironment; +public class TraceJFrame { public static void main(String args[]) throws Exception { - DemoRun demo; + if (GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) { + System.out.println("JFrame test was skipped due to headless mode"); + } else { + DemoRun demo; - /* Run demo that uses JVMTI mtrace agent (no options) */ - demo = new DemoRun("mtrace", "" /* options to mtrace */ ); - demo.runit(args[0]); + /* Run demo that uses JVMTI mtrace agent (no options) */ + demo = new DemoRun("mtrace", "" /* options to mtrace */ ); + demo.runit(args[0]); - /* Make sure patterns in output look ok */ - if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in output"); - } + /* Make sure patterns in output look ok */ + if (demo.output_contains("ERROR")) { + throw new RuntimeException("Test failed - ERROR seen in output"); + } - /* Must be a pass. */ - System.out.println("Test passed - cleanly terminated"); + /* Must be a pass. */ + System.out.println("Test passed - cleanly terminated"); + } } } --- old/test/java/io/Serializable/resolveClass/deserializeButton/Foo.java Mon Dec 17 18:00:32 2012 +++ new/test/java/io/Serializable/resolveClass/deserializeButton/Foo.java Mon Dec 17 18:00:32 2012 @@ -26,27 +26,26 @@ * @summary Verify that class loaded outside of application class loader is * correctly resolved during deserialization when read in by custom * readObject() method of a bootstrap class (in this case, - * java.awt.Button). + * java.util.Vector). */ -import java.awt.Button; -import java.awt.event.MouseAdapter; import java.io.*; +import java.util.Vector; public class Foo implements Runnable { - static class Adapter extends MouseAdapter implements Serializable {} + static class TestElement extends Object implements Serializable {} public void run() { try { - Button button = new Button(); - button.addMouseListener(new Adapter()); + Vector container = new Vector(); + container.add(new TestElement()); // iterate to trigger java.lang.reflect code generation for (int i = 0; i < 100; i++) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); - oout.writeObject(button); + oout.writeObject(container); oout.close(); ObjectInputStream oin = new ObjectInputStream( new ByteArrayInputStream(bout.toByteArray())); @@ -54,7 +53,7 @@ } } catch (Exception ex) { throw new Error( - "Error occured while (de)serializing Button: " + ex); + "Error occured while (de)serializing container: ", ex); } } } --- old/test/java/io/Serializable/resolveClass/deserializeButton/Test.java Mon Dec 17 18:00:35 2012 +++ new/test/java/io/Serializable/resolveClass/deserializeButton/Test.java Mon Dec 17 18:00:35 2012 @@ -26,7 +26,7 @@ * @summary Verify that class loaded outside of application class loader is * correctly resolved during deserialization when read in by custom * readObject() method of a bootstrap class (in this case, - * java.awt.Button). + * java.util.Vector). */ import java.io.*; --- old/test/java/io/Serializable/resolveClass/deserializeButton/run.sh Mon Dec 17 18:00:38 2012 +++ new/test/java/io/Serializable/resolveClass/deserializeButton/run.sh Mon Dec 17 18:00:38 2012 @@ -26,7 +26,7 @@ # @summary Verify that class loaded outside of application class loader is # correctly resolved during deserialization when read in by custom # readObject() method of a bootstrap class (in this case, -# java.awt.Button). +# java.util.Vector). if [ "${TESTJAVA}" = "" ] then --- old/test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java Mon Dec 17 18:00:41 2012 +++ new/test/java/io/Serializable/resolveProxyClass/NonPublicInterface.java Mon Dec 17 18:00:41 2012 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4413817 + * @bug 4413817 8004928 * @summary Verify that ObjectInputStream.resolveProxyClass can properly * resolve a dynamic proxy class which implements a non-public * interface not defined in the latest user defined class loader. @@ -29,7 +29,10 @@ */ import java.io.*; -import java.lang.reflect.*; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Proxy; public class NonPublicInterface { @@ -39,35 +42,19 @@ } } + public static final String nonPublicIntrfaceName = "java.util.zip.ZipConstants"; + public static void main(String[] args) throws Exception { - Class nonPublic = null; - String[] nonPublicInterfaces = new String[] { - "java.awt.Conditional", - "java.util.zip.ZipConstants", - "javax.swing.GraphicsWrapper", - "javax.swing.JPopupMenu$Popup", - "javax.swing.JTable$Resizable2", - "javax.swing.JTable$Resizable3", - "javax.swing.ToolTipManager$Popup", - "sun.audio.Format", - "sun.audio.HaePlayable", - "sun.tools.agent.StepConstants", - }; - for (int i = 0; i < nonPublicInterfaces.length; i++) { - try { - nonPublic = Class.forName(nonPublicInterfaces[i]); - break; - } catch (ClassNotFoundException ex) { - } + Class nonPublic = Class.forName(nonPublicIntrfaceName); + if (Modifier.isPublic(nonPublic.getModifiers())) { + throw new Error("Interface " + nonPublicIntrfaceName + + " is public and need to be changed!"); } - if (nonPublic == null) { - throw new Error("couldn't find system non-public interface"); - } ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); oout.writeObject(Proxy.newProxyInstance(nonPublic.getClassLoader(), - new Class[]{ nonPublic }, new Handler())); + new Class[]{ nonPublic }, new Handler())); oout.close(); ObjectInputStream oin = new ObjectInputStream( new ByteArrayInputStream(bout.toByteArray())); --- old/test/java/lang/Throwable/LegacyChainedExceptionSerialization.java Mon Dec 17 18:00:45 2012 +++ new/test/java/lang/Throwable/LegacyChainedExceptionSerialization.java Mon Dec 17 18:00:44 2012 @@ -25,7 +25,7 @@ /** * @test - * @bug 4385429 + * @bug 4385429 8004928 * @summary Certain legacy chained exceptions throw IllegalArgumentException * upon deserialization if "causative exception" is null. * @author Josh Bloch @@ -36,8 +36,7 @@ new ExceptionInInitializerError(), new java.lang.reflect.UndeclaredThrowableException(null), new java.lang.reflect.InvocationTargetException(null), - new java.security.PrivilegedActionException(null), - new java.awt.print.PrinterIOException(null) + new java.security.PrivilegedActionException(null) }; public static void main(String[] args) throws Exception { --- old/test/java/lang/management/CompilationMXBean/Basic.java Mon Dec 17 18:00:48 2012 +++ new/test/java/lang/management/CompilationMXBean/Basic.java Mon Dec 17 18:00:47 2012 @@ -23,10 +23,10 @@ /* * @test - * @bug 5011189 + * @bug 5011189 8004928 * @summary Unit test for java.lang.management.CompilationMXBean * - * @run main/othervm -Xcomp -Xbatch -Djava.awt.headless=true Basic + * @run main/othervm -Xcomp -Xbatch Basic */ import java.lang.management.*; @@ -65,8 +65,6 @@ java.util.Locale.getAvailableLocales(); java.security.Security.getProviders(); - java.awt.Toolkit.getDefaultToolkit(); - javax.swing.UIManager.getInstalledLookAndFeels(); java.nio.channels.spi.SelectorProvider.provider(); time = mb.getTotalCompilationTime(); --- old/test/java/lang/reflect/Generics/Probe.java Mon Dec 17 18:00:51 2012 +++ new/test/java/lang/reflect/Generics/Probe.java Mon Dec 17 18:00:50 2012 @@ -23,7 +23,7 @@ /* * @test - * @bug 5003916 6704655 6873951 6476261 + * @bug 5003916 6704655 6873951 6476261 8004928 * @summary Testing parsing of signatures attributes of nested classes * @author Joseph D. Darcy */ @@ -52,8 +52,7 @@ "java.util.HashMap$ValueIterator", "java.util.LinkedHashMap$EntryIterator", "java.util.LinkedHashMap$KeyIterator", - "java.util.LinkedHashMap$ValueIterator", - "javax.swing.JComboBox$AccessibleJComboBox"}) + "java.util.LinkedHashMap$ValueIterator"}) public class Probe { public static void main (String... args) throws Throwable { Classes classesAnnotation = (Probe.class).getAnnotation(Classes.class); --- old/test/java/lang/reflect/Proxy/ClassRestrictions.java Mon Dec 17 18:00:54 2012 +++ new/test/java/lang/reflect/Proxy/ClassRestrictions.java Mon Dec 17 18:00:53 2012 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4227192 + * @bug 4227192 8004928 * @summary This is a test of the restrictions on the parameters that may * be passed to the Proxy.getProxyClass method. * @author Peter Jones @@ -31,6 +31,7 @@ * @run main ClassRestrictions */ +import java.lang.reflect.Modifier; import java.lang.reflect.Proxy; import java.net.URLClassLoader; @@ -48,6 +49,8 @@ void foo(); } + public static final String nonPublicIntrfaceName = "java.util.zip.ZipConstants"; + public static void main(String[] args) { System.err.println( @@ -65,7 +68,7 @@ try { interfaces = new Class[] { Object.class }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with java.lang.Object as interface"); } catch (IllegalArgumentException e) { e.printStackTrace(); @@ -75,7 +78,7 @@ try { interfaces = new Class[] { Integer.TYPE }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with int.class as interface"); } catch (IllegalArgumentException e) { e.printStackTrace(); @@ -90,7 +93,7 @@ try { interfaces = new Class[] { Bar.class, Bar.class }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with repeated interfaces"); } catch (IllegalArgumentException e) { e.printStackTrace(); @@ -109,7 +112,7 @@ try { interfaces = new Class[] { altBarClass }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with interface " + "not visible to class loader"); } catch (IllegalArgumentException e) { @@ -122,34 +125,16 @@ * All non-public interfaces must be in the same package. */ Class nonPublic1 = Bashful.class; - Class nonPublic2 = null; - String[] nonPublicInterfaces = new String[] { - "java.awt.Conditional", - "java.util.zip.ZipConstants", - "javax.swing.GraphicsWrapper", - "javax.swing.JPopupMenu$Popup", - "javax.swing.JTable$Resizable2", - "javax.swing.JTable$Resizable3", - "javax.swing.ToolTipManager$Popup", - "sun.audio.Format", - "sun.audio.HaePlayable", - "sun.tools.agent.StepConstants", - }; - for (int i = 0; i < nonPublicInterfaces.length; i++) { - try { - nonPublic2 = Class.forName(nonPublicInterfaces[i]); - break; - } catch (ClassNotFoundException e) { - } + Class nonPublic2 = Class.forName(nonPublicIntrfaceName); + if (Modifier.isPublic(nonPublic2.getModifiers())) { + throw new Error( + "Interface " + nonPublicIntrfaceName + + " is public and need to be changed!"); } - if (nonPublic2 == null) { - throw new RuntimeException( - "no second non-public interface found for test"); - } try { interfaces = new Class[] { nonPublic1, nonPublic2 }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with two non-public interfaces " + "in different packages"); } catch (IllegalArgumentException e) { @@ -165,7 +150,7 @@ try { interfaces = new Class[] { Bar.class, Baz.class }; proxyClass = Proxy.getProxyClass(loader, interfaces); - throw new RuntimeException( + throw new Error( "proxy class created with conflicting methods"); } catch (IllegalArgumentException e) { e.printStackTrace(); @@ -178,10 +163,10 @@ */ System.err.println("\nTEST PASSED"); - } catch (Exception e) { + } catch (Throwable e) { System.err.println("\nTEST FAILED:"); e.printStackTrace(); - throw new RuntimeException("TEST FAILED: " + e.toString()); + throw new Error("TEST FAILED: ", e); } } } --- old/test/java/util/Collections/EmptyIterator.java Mon Dec 17 18:00:57 2012 +++ new/test/java/util/Collections/EmptyIterator.java Mon Dec 17 18:00:56 2012 @@ -23,12 +23,12 @@ /* * @test - * @bug 5017904 6356890 + * @bug 5017904 6356890 8004928 * @summary Test empty iterators, enumerations, and collections */ -import java.util.*; import static java.util.Collections.*; +import java.util.*; public class EmptyIterator { @@ -47,11 +47,14 @@ testEmptyIterator(emptyTable.values().iterator()); testEmptyIterator(emptyTable.entrySet().iterator()); - testEmptyEnumeration(javax.swing.tree.DefaultMutableTreeNode - .EMPTY_ENUMERATION); - testEmptyEnumeration(javax.swing.text.SimpleAttributeSet - .EMPTY.getAttributeNames()); + final Enumeration finalEmptyTyped = + Collections.emptyEnumeration(); + testEmptyEnumeration(finalEmptyTyped); + final Enumeration finalEmptyAbstract = + Collections.emptyEnumeration(); + testEmptyEnumeration(finalEmptyAbstract); + @SuppressWarnings("unchecked") Iterator x = new sun.tools.java.MethodSet() .lookupName(sun.tools.java.Identifier.lookup("")); --- old/test/java/util/logging/LoggingDeadlock4.java Mon Dec 17 18:01:00 2012 +++ new/test/java/util/logging/LoggingDeadlock4.java Mon Dec 17 18:00:59 2012 @@ -23,11 +23,11 @@ /* * @test - * @bug 6977677 + * @bug 6977677 8004928 * @summary Deadlock between LogManager. and Logger.getLogger() * @author Daniel D. Daugherty - * @build LoggingDeadlock4 - * @run main/timeout=15 LoggingDeadlock4 + * @compile -XDignore.symbol.file LoggingDeadlock4.java + * @run main/othervm/timeout=15 LoggingDeadlock4 */ import java.awt.Container; @@ -40,21 +40,16 @@ private static CountDownLatch lmIsRunning = new CountDownLatch(1); private static CountDownLatch logIsRunning = new CountDownLatch(1); + // Create a sun.util.logging.PlatformLogger$JavaLogger object + // that has to be redirected when the LogManager class + // is initialized. This can cause a deadlock between + // LogManager. and Logger.getLogger(). + private static final sun.util.logging.PlatformLogger log = + sun.util.logging.PlatformLogger.getLogger("java.util.logging"); + public static void main(String[] args) { System.out.println("main: LoggingDeadlock4 is starting."); - // Loading the java.awt.Container class will create a - // sun.util.logging.PlatformLogger$JavaLogger object - // that has to be redirected when the LogManager class - // is initialized. This can cause a deadlock between - // LogManager. and Logger.getLogger(). - try { - Class.forName("java.awt.Container"); - } catch (ClassNotFoundException cnfe) { - throw new RuntimeException("Test failed: could not load" - + " java.awt.Container." + cnfe); - } - Thread lmThread = new Thread("LogManagerThread") { public void run() { // let main know LogManagerThread is running