/hg/release/icedtea7-forest-2.1/jdk: 12 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Tue Jun 12 15:49:21 PDT 2012


changeset 98a24555076b in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=98a24555076b
author: sherman
date: Tue Feb 28 15:44:47 2012 -0800

	7143606: File.createTempFile should be improved for temporary files created by the platform.
	Summary: To use java.nio.file.Files.createTempFile()
	Reviewed-by: alanb, ksrini, prr


changeset 67f46062f113 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=67f46062f113
author: rupashka
date: Mon Feb 27 20:18:28 2012 +0200

	7143614: SynthLookAndFeel stability improvement
	Reviewed-by: malenkov


changeset 70dad7ce76b2 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=70dad7ce76b2
author: bae
date: Wed Feb 15 10:59:12 2012 +0400

	7143617: Improve fontmanager layout lookup operations
	Reviewed-by: prr


changeset c40e3e14e7c8 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=c40e3e14e7c8
author: coffeys
date: Wed Feb 29 16:48:03 2012 +0000

	7143851: Improve IIOP stub and tie generation in RMIC
	7149048: Changes to corba rmic stubGenerator class are not used during jdk build process
	Reviewed-by: mschoene, dholmes


changeset ca9c7add5936 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=ca9c7add5936
author: weijun
date: Wed Feb 29 14:06:00 2012 +0800

	7143872: Improve certificate extension processing
	Reviewed-by: mullan


changeset b64fac383773 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=b64fac383773
author: mullan
date: Wed Jun 06 15:19:16 2012 +0100

	7145239: Finetune package definition restriction
	Reviewed-by: hawtin


changeset d2e50959da60 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=d2e50959da60
author: jrose
date: Mon May 07 01:22:07 2012 -0700

	7165628: Issues with java.lang.invoke.MethodHandles.Lookup
	Summary: Base SecurityManager checks on either of Lookup.lookupClass or caller class; also clarify Lookup access checks.
	Reviewed-by: twisti


changeset 9eab524b30c7 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=9eab524b30c7
author: andrew
date: Wed Jun 06 16:20:12 2012 +0100

	Merge


changeset 203e7363c99a in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=203e7363c99a
author: andrew
date: Thu Jun 07 15:22:11 2012 +0100

	Added tag icedtea-2.1.1 for changeset 9eab524b30c7


changeset 508776c334c9 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=508776c334c9
author: andrew
date: Fri Jun 08 14:12:16 2012 +0100

	Remove stray file.


changeset d5ddeffc4651 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=d5ddeffc4651
author: andrew
date: Fri Jun 08 14:12:38 2012 +0100

	Removed tag icedtea-2.1.1


changeset 75095d04f040 in /hg/release/icedtea7-forest-2.1/jdk
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/jdk?cmd=changeset;node=75095d04f040
author: andrew
date: Fri Jun 08 14:27:37 2012 +0100

	Added tag icedtea-2.1.1 for changeset d5ddeffc4651


diffstat:

 .hgtags                                                                |   5 +
 jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java         |  97 ----------
 make/com/sun/jmx/Makefile                                              |  19 +-
 make/common/shared/Compiler-gcc.gmk                                    |   2 +-
 src/share/classes/com/sun/java/util/jar/pack/Driver.java               |   5 +-
 src/share/classes/java/awt/Font.java                                   |   5 +-
 src/share/classes/java/lang/invoke/MethodHandles.java                  |  33 ++-
 src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java  |   8 +-
 src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java |   8 +-
 src/share/classes/javax/management/loading/MLet.java                   |   6 +-
 src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java            |   4 +-
 src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java             |   4 +-
 src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java         |  57 +++--
 src/share/classes/sun/invoke/util/VerifyAccess.java                    |  43 +++-
 src/share/classes/sun/print/PSPrinterJob.java                          |   3 +-
 src/share/classes/sun/rmi/server/Activation.java                       |   3 +-
 src/share/classes/sun/security/x509/CRLExtensions.java                 |   9 +-
 src/share/classes/sun/security/x509/CertificateExtensions.java         |  13 +-
 src/share/classes/sun/security/x509/X509CRLEntryImpl.java              |  52 ++++-
 src/share/classes/sun/security/x509/X509CRLImpl.java                   |  56 +++--
 src/share/classes/sun/security/x509/X509CertImpl.java                  |  22 +-
 src/share/classes/sun/tools/jar/Main.java                              |   2 +-
 src/share/classes/sun/tools/native2ascii/Main.java                     |   9 +-
 src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt            |   2 +-
 src/share/demo/jvmti/gctest/sample.makefile.txt                        |   2 +-
 src/share/demo/jvmti/heapTracker/sample.makefile.txt                   |   2 +-
 src/share/demo/jvmti/heapViewer/sample.makefile.txt                    |   2 +-
 src/share/demo/jvmti/hprof/sample.makefile.txt                         |   2 +-
 src/share/demo/jvmti/index.html                                        |   6 +-
 src/share/demo/jvmti/java_crw_demo/sample.makefile.txt                 |   2 +-
 src/share/demo/jvmti/minst/sample.makefile.txt                         |   2 +-
 src/share/demo/jvmti/mtrace/sample.makefile.txt                        |   2 +-
 src/share/demo/jvmti/versionCheck/sample.makefile.txt                  |   2 +-
 src/share/lib/security/java.security                                   |   8 +-
 src/share/lib/security/java.security-solaris                           |   8 +-
 src/share/lib/security/java.security-windows                           |   8 +-
 src/share/native/sun/font/layout/LookupProcessor.cpp                   |  15 +-
 src/share/native/sun/font/layout/LookupProcessor.h                     |   1 +
 src/solaris/classes/sun/font/FcFontConfiguration.java                  |   3 +-
 src/solaris/classes/sun/print/UnixPrintJob.java                        |   3 +-
 src/solaris/classes/sun/print/UnixPrintServiceLookup.java              |   3 +-
 41 files changed, 290 insertions(+), 248 deletions(-)

diffs (truncated from 1475 to 500 lines):

diff -r 2d8ad70a2243 -r 75095d04f040 .hgtags
--- a/.hgtags	Fri Mar 02 10:18:25 2012 -0500
+++ b/.hgtags	Fri Jun 08 14:27:37 2012 +0100
@@ -147,3 +147,8 @@
 24e42f1f9029f9f5a9b1481d523facaf09452e5b jdk7u2-b21
 a75913596199fbb8583f9d74021f54dc76f87b14 icedtea-2.1-branchpoint
 2bc1f3f7576e789eaf7e6f5b82976455fe202158 icedtea-2.1
+9eab524b30c7e20b98c63cf5e2e7f7ccd2cf9fd6 icedtea-2.1.1
+9eab524b30c7e20b98c63cf5e2e7f7ccd2cf9fd6 icedtea-2.1.1
+0000000000000000000000000000000000000000 icedtea-2.1.1
+0000000000000000000000000000000000000000 icedtea-2.1.1
+d5ddeffc46517a17e3236f1a2c2446d432370f5e icedtea-2.1.1
diff -r 2d8ad70a2243 -r 75095d04f040 jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalOnlyTest.java	Fri Mar 02 10:18:25 2012 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * @test
- * @bug 6685178
- * @summary Sanity check for local only option. In order to fully test this
- *          new local only option two different machines would be required.
- * @author Luis-Miguel Alventosa
- * @run main/othervm LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=true LocalOnlyTest
- * @run main/othervm -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false LocalOnlyTest
- */
-
-import java.io.*;
-import java.lang.management.*;
-import java.util.*;
-import javax.management.*;
-import javax.management.remote.*;
-import com.sun.tools.attach.*;
-
-public class LocalOnlyTest {
-
-    public static void main(String args[]) throws Exception {
-        RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
-        String name = rt.getName();
-        System.out.println("name = " + name);
-        String vmid = name.substring(0, name.indexOf("@"));
-        System.out.println("vmid = " + vmid);
-        VirtualMachine vm = VirtualMachine.attach(vmid);
-        String addr = vm.getAgentProperties().getProperty(
-                "com.sun.management.jmxremote.localConnectorAddress");
-        System.out.println("connectorAddress = " + addr);
-        if (addr == null) {
-            // Normally in ${java.home}/jre/lib/management-agent.jar
-            // but might be in ${java.home}/lib in build environments.
-            String javaHome = System.getProperty("java.home");
-            String agent = javaHome + File.separator + "jre" + File.separator +
-                    "lib" + File.separator + "management-agent.jar";
-            File f = new File(agent);
-            if (!f.exists()) {
-                agent = javaHome + File.separator + "lib" + File.separator +
-                        "management-agent.jar";
-                f = new File(agent);
-                if (!f.exists()) {
-                    throw new IOException("Management agent not found");
-                }
-            }
-            agent = f.getCanonicalPath();
-            try {
-                vm.loadAgent(agent, "com.sun.management.jmxremote");
-            } catch (AgentLoadException x) {
-                IOException ioe = new IOException(x.getMessage());
-                ioe.initCause(x);
-                throw ioe;
-            } catch (AgentInitializationException x) {
-                IOException ioe = new IOException(x.getMessage());
-                ioe.initCause(x);
-                throw ioe;
-            }
-            addr = vm.getAgentProperties().getProperty(
-                    "com.sun.management.jmxremote.localConnectorAddress");
-            System.out.println("connectorAddress (after loading agent) = " + addr);
-        }
-        vm.detach();
-        JMXServiceURL url = new JMXServiceURL(addr);
-        JMXConnector c = JMXConnectorFactory.connect(url);
-        System.out.println("connectionId  = " + c.getConnectionId());
-        System.out.println("Bye! Bye!");
-    }
-}
diff -r 2d8ad70a2243 -r 75095d04f040 make/com/sun/jmx/Makefile
--- a/make/com/sun/jmx/Makefile	Fri Mar 02 10:18:25 2012 -0500
+++ b/make/com/sun/jmx/Makefile	Fri Jun 08 14:27:37 2012 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -100,6 +100,23 @@
 # so that *_tie classes are generated in package without the prefix
 # org.omg.stub (6375696)
 # 
+# To ensure the latest stub generator files are picked up from corba repo
+# when available, we need to run with latest rmic version available. rmic 
+# launch tool not built at this stage but we can invoke via rmi class.
+
+RMIC_JAVA = $(OUTPUTDIR)/bin/java
+# need to treat 64bit solaris differently
+ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
+RMIC_JAVA = $(OUTPUTDIR)/bin/amd64/java
+endif
+ifeq ($(PLATFORM)-$(LIBARCH), solaris-sparcv9)
+RMIC_JAVA = $(OUTPUTDIR)/bin/sparcv9/java
+endif
+
+ifeq ($(CROSS_COMPILE_ARCH),)
+RMIC = $(RMIC_JAVA) $(JAVA_TOOLS_FLAGS) -cp $(OUTPUTDIR)/classes sun.rmi.rmic.Main
+endif  
+
 $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class
 	$(prep-target)
 	$(RMIC) -classpath "$(CLASSDESTDIR)"    \
diff -r 2d8ad70a2243 -r 75095d04f040 make/common/shared/Compiler-gcc.gmk
--- a/make/common/shared/Compiler-gcc.gmk	Fri Mar 02 10:18:25 2012 -0500
+++ b/make/common/shared/Compiler-gcc.gmk	Fri Jun 08 14:27:37 2012 +0100
@@ -133,7 +133,7 @@
     REQUIRED_GCC_VER = 4.0.*
   endif
   # Option used to create a shared library
-  SHARED_LIBRARY_FLAG = -shared -mimpure-text
+  SHARED_LIBRARY_FLAG = -shared
   SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
 
 endif
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/com/sun/java/util/jar/pack/Driver.java
--- a/src/share/classes/com/sun/java/util/jar/pack/Driver.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/com/sun/java/util/jar/pack/Driver.java	Fri Jun 08 14:27:37 2012 +0100
@@ -35,6 +35,7 @@
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.text.MessageFormat;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -385,9 +386,7 @@
         if ( base.getParentFile() == null && suffix.equals(".bak"))
             where = new File(".").getAbsoluteFile();
 
-
-        File f = File.createTempFile(prefix, suffix, where);
-        return f;
+        return Files.createTempFile(where.toPath(), prefix, suffix).toFile();
     }
 
     static private
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/java/awt/Font.java
--- a/src/share/classes/java/awt/Font.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/java/awt/Font.java	Fri Jun 08 14:27:37 2012 +0100
@@ -36,6 +36,7 @@
 import java.awt.peer.FontPeer;
 import java.io.*;
 import java.lang.ref.SoftReference;
+import java.nio.file.Files;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.text.AttributedCharacterIterator.Attribute;
@@ -830,7 +831,7 @@
         File f = null;
         boolean hasPerm = false;
         try {
-            f = File.createTempFile("+~JT", ".tmp", null);
+            f = Files.createTempFile("+~JT", ".tmp").toFile();
             f.delete();
             f = null;
             hasPerm = true;
@@ -880,7 +881,7 @@
             final File tFile = AccessController.doPrivileged(
                 new PrivilegedExceptionAction<File>() {
                     public File run() throws IOException {
-                        return File.createTempFile("+~JF", ".tmp", null);
+                        return Files.createTempFile("+~JF", ".tmp").toFile();
                     }
                 }
             );
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/java/lang/invoke/MethodHandles.java
--- a/src/share/classes/java/lang/invoke/MethodHandles.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/java/lang/invoke/MethodHandles.java	Fri Jun 08 14:27:37 2012 +0100
@@ -407,7 +407,7 @@
          * an access$N method.
          */
         Lookup() {
-            this(getCallerClassAtEntryPoint(), ALL_MODES);
+            this(getCallerClassAtEntryPoint(false), ALL_MODES);
             // make sure we haven't accidentally picked up a privileged class:
             checkUnprivilegedlookupClass(lookupClass);
         }
@@ -461,8 +461,8 @@
                 && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) {
                 newModes &= ~PRIVATE;
             }
-            if (newModes == PUBLIC
-                && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass)) {
+            if ((newModes & PUBLIC) != 0
+                && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass, allowedModes)) {
                 // The requested class it not accessible from the lookup class.
                 // No permissions.
                 newModes = 0;
@@ -540,13 +540,17 @@
             }
         }
 
-        // call this from an entry point method in Lookup with extraFrames=0.
-        private static Class<?> getCallerClassAtEntryPoint() {
+        /* Obtain the external caller class, when called from Lookup.<init> or a first-level subroutine. */
+        private static Class<?> getCallerClassAtEntryPoint(boolean inSubroutine) {
             final int CALLER_DEPTH = 4;
+            //  Stack for the constructor entry point (inSubroutine=false):
             // 0: Reflection.getCC, 1: getCallerClassAtEntryPoint,
             // 2: Lookup.<init>, 3: MethodHandles.*, 4: caller
+            //  The stack is slightly different for a subroutine of a Lookup.find* method:
+            // 2: Lookup.*, 3: Lookup.find*.*, 4: caller
             // Note:  This should be the only use of getCallerClass in this file.
-            assert(Reflection.getCallerClass(CALLER_DEPTH-1) == MethodHandles.class);
+            assert(Reflection.getCallerClass(CALLER_DEPTH-2) == Lookup.class);
+            assert(Reflection.getCallerClass(CALLER_DEPTH-1) == (inSubroutine ? Lookup.class : MethodHandles.class));
             return Reflection.getCallerClass(CALLER_DEPTH);
         }
 
@@ -1080,7 +1084,7 @@
 
         void checkSymbolicClass(Class<?> refc) throws IllegalAccessException {
             Class<?> caller = lookupClassOrNull();
-            if (caller != null && !VerifyAccess.isClassAccessible(refc, caller))
+            if (caller != null && !VerifyAccess.isClassAccessible(refc, caller, allowedModes))
                 throw new MemberName(refc).makeAccessException("symbolic reference class is not public", this);
         }
 
@@ -1095,7 +1099,13 @@
             // Step 1:
             smgr.checkMemberAccess(refc, Member.PUBLIC);
             // Step 2:
-            if (!VerifyAccess.classLoaderIsAncestor(lookupClass, refc))
+            Class<?> callerClass = ((allowedModes & PRIVATE) != 0
+                                    ? lookupClass  // for strong access modes, no extra check
+                                    // next line does stack walk magic; do not refactor:
+                                    : getCallerClassAtEntryPoint(true));
+            if (!VerifyAccess.classLoaderIsAncestor(lookupClass, refc) ||
+                (callerClass != lookupClass &&
+                 !VerifyAccess.classLoaderIsAncestor(callerClass, refc)))
                 smgr.checkPackageAccess(VerifyAccess.getPackageName(refc));
             // Step 3:
             if (m.isPublic()) return;
@@ -1146,9 +1156,10 @@
             int requestedModes = fixmods(mods);  // adjust 0 => PACKAGE
             if ((requestedModes & allowedModes) != 0
                 && VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
-                                                   mods, lookupClass()))
+                                                   mods, lookupClass(), allowedModes))
                 return;
             if (((requestedModes & ~allowedModes) & PROTECTED) != 0
+                && (allowedModes & PACKAGE) != 0
                 && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
                 // Protected members can also be checked as if they were package-private.
                 return;
@@ -1163,9 +1174,9 @@
                                (defc == refc ||
                                 Modifier.isPublic(refc.getModifiers())));
             if (!classOK && (allowedModes & PACKAGE) != 0) {
-                classOK = (VerifyAccess.isClassAccessible(defc, lookupClass()) &&
+                classOK = (VerifyAccess.isClassAccessible(defc, lookupClass(), ALL_MODES) &&
                            (defc == refc ||
-                            VerifyAccess.isClassAccessible(refc, lookupClass())));
+                            VerifyAccess.isClassAccessible(refc, lookupClass(), ALL_MODES)));
             }
             if (!classOK)
                 return "class is not public";
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java
--- a/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/imageio/stream/FileCacheImageInputStream.java	Fri Jun 08 14:27:37 2012 +0100
@@ -29,6 +29,7 @@
 import java.io.InputStream;
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.nio.file.Files;
 import com.sun.imageio.stream.StreamCloser;
 import com.sun.imageio.stream.StreamFinalizer;
 import sun.java2d.Disposer;
@@ -97,8 +98,11 @@
             throw new IllegalArgumentException("Not a directory!");
         }
         this.stream = stream;
-        this.cacheFile =
-            File.createTempFile("imageio", ".tmp", cacheDir);
+        if (cacheDir == null)
+            this.cacheFile = Files.createTempFile("imageio", ".tmp").toFile();
+        else
+            this.cacheFile = Files.createTempFile(cacheDir.toPath(), "imageio", ".tmp")
+                                  .toFile();
         this.cache = new RandomAccessFile(cacheFile, "rw");
 
         this.closeAction = StreamCloser.createCloseAction(this);
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java
--- a/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/imageio/stream/FileCacheImageOutputStream.java	Fri Jun 08 14:27:37 2012 +0100
@@ -29,6 +29,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.RandomAccessFile;
+import java.nio.file.Files;
 import com.sun.imageio.stream.StreamCloser;
 
 /**
@@ -83,8 +84,11 @@
             throw new IllegalArgumentException("Not a directory!");
         }
         this.stream = stream;
-        this.cacheFile =
-            File.createTempFile("imageio", ".tmp", cacheDir);
+        if (cacheDir == null)
+            this.cacheFile = Files.createTempFile("imageio", ".tmp").toFile();
+        else
+            this.cacheFile = Files.createTempFile(cacheDir.toPath(), "imageio", ".tmp")
+                                  .toFile();
         this.cache = new RandomAccessFile(cacheFile, "rw");
 
         this.closeAction = StreamCloser.createCloseAction(this);
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/management/loading/MLet.java
--- a/src/share/classes/javax/management/loading/MLet.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/management/loading/MLet.java	Fri Jun 08 14:27:37 2012 +0100
@@ -44,6 +44,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLStreamHandlerFactory;
+import java.nio.file.Files;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
@@ -1160,8 +1161,9 @@
                  try {
                      File directory = new File(libraryDirectory);
                      directory.mkdirs();
-                     File file = File.createTempFile(libname + ".", null,
-                             directory);
+                     File file = Files.createTempFile(directory.toPath(),
+                                                      libname + ".", null)
+                                      .toFile();
                      file.deleteOnExit();
                      FileOutputStream fileOutput = new FileOutputStream(file);
                      try {
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java
--- a/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java	Fri Jun 08 14:27:37 2012 +0100
@@ -152,8 +152,8 @@
         if (!c.isEnabled()) {
             state = DISABLED;
         }
-        if (SynthLookAndFeel.selectedUI == this) {
-            return SynthLookAndFeel.selectedUIState | SynthConstants.ENABLED;
+        if (SynthLookAndFeel.getSelectedUI() == this) {
+            return SynthLookAndFeel.getSelectedUIState() | SynthConstants.ENABLED;
         }
         AbstractButton button = (AbstractButton) c;
         ButtonModel model = button.getModel();
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java
--- a/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java	Fri Jun 08 14:27:37 2012 +0100
@@ -97,9 +97,9 @@
 
     private int getComponentState(JComponent c) {
         int state = SynthLookAndFeel.getComponentState(c);
-        if (SynthLookAndFeel.selectedUI == this &&
+        if (SynthLookAndFeel.getSelectedUI() == this &&
                         state == SynthConstants.ENABLED) {
-            state = SynthLookAndFeel.selectedUIState | SynthConstants.ENABLED;
+            state = SynthLookAndFeel.getSelectedUIState() | SynthConstants.ENABLED;
         }
         return state;
     }
diff -r 2d8ad70a2243 -r 75095d04f040 src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java
--- a/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java	Fri Mar 02 10:18:25 2012 -0500
+++ b/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java	Fri Jun 08 14:27:37 2012 +0100
@@ -76,27 +76,25 @@
     private static final Object STYLE_FACTORY_KEY = new Object(); // com.sun.java.swing.plaf.gtk.StyleCache
 
     /**
+     * AppContext key to get selectedUI.
+     */
+    private static final Object SELECTED_UI_KEY = new StringBuilder("selectedUI");
+
+    /**
+     * AppContext key to get selectedUIState.
+     */
+    private static final Object SELECTED_UI_STATE_KEY = new StringBuilder("selectedUIState");
+
+    /**
      * The last SynthStyleFactory that was asked for from AppContext
      * <code>lastContext</code>.
      */
     private static SynthStyleFactory lastFactory;
     /**
-     * If this is true it indicates there is more than one AppContext active
-     * and that we need to make sure in getStyleCache the requesting
-     * AppContext matches that of <code>lastContext</code> before returning
-     * it.
-     */
-    private static boolean multipleApps;
-    /**
      * AppContext lastLAF came from.
      */
     private static AppContext lastContext;
 
-    // Refer to setSelectedUI
-    static ComponentUI selectedUI;
-    // Refer to setSelectedUI
-    static int selectedUIState;
-
     /**
      * SynthStyleFactory for the this SynthLookAndFeel.
      */
@@ -110,6 +108,10 @@
 
     private Handler _handler;
 
+    static ComponentUI getSelectedUI() {
+        return (ComponentUI) AppContext.getAppContext().get(SELECTED_UI_KEY);
+    }
+
     /**
      * Used by the renderers. For the most part the renderers are implemented
      * as Labels, which is problematic in so far as they are never selected.
@@ -121,8 +123,8 @@
     static void setSelectedUI(ComponentUI uix, boolean selected,
                               boolean focused, boolean enabled,
                               boolean rollover) {
-        selectedUI = uix;
-        selectedUIState = 0;
+        int selectedUIState = 0;
+
         if (selected) {
             selectedUIState = SynthConstants.SELECTED;
             if (focused) {
@@ -139,19 +141,32 @@
         else {
             if (enabled) {
                 selectedUIState |= SynthConstants.ENABLED;
-                selectedUIState = SynthConstants.FOCUSED;
+                if (focused) {
+                    selectedUIState |= SynthConstants.FOCUSED;
+                }
             }
             else {
                 selectedUIState |= SynthConstants.DISABLED;
             }
         }
+
+        AppContext context = AppContext.getAppContext();
+
+        context.put(SELECTED_UI_KEY, uix);
+        context.put(SELECTED_UI_STATE_KEY, Integer.valueOf(selectedUIState));
+    }
+
+    static int getSelectedUIState() {
+        Integer result = (Integer) AppContext.getAppContext().get(SELECTED_UI_STATE_KEY);
+
+        return result == null ? 0 : result.intValue();
     }
 
     /**
      * Clears out the selected UI that was last set in setSelectedUI.
      */
     static void resetSelectedUI() {
-        selectedUI = null;
+        AppContext.getAppContext().remove(SELECTED_UI_KEY);
     }



More information about the distro-pkg-dev mailing list