changeset 5886:b6645161a51b

Merge
author ewendeli
date Mon, 11 Feb 2013 21:09:32 +0100
parents 70b0f967c064 343ecd8dee6f
children d00ab6592b1e
files .hgtags
diffstat 24 files changed, 571 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Feb 08 10:46:57 2013 -0800
+++ b/.hgtags	Mon Feb 11 21:09:32 2013 +0100
@@ -236,3 +236,4 @@
 8eb180a284b0911b2645d5cbdff5be499a75d6b2 jdk7u13-b20
 835448d525a10bb826f4f7ebe272fc410bdb0f5d jdk7u15-b01
 0443fe2d8023111b52f4c8db32e038f4a5a9f373 jdk7u15-b02
+8261e56b7f91c7553e8485b206bdc9030a3546e4 jdk7u21-b01
--- a/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -166,7 +166,7 @@
             setTitle(((Dialog) getTarget()).getTitle());
         }
 
-        setAlwaysOnTop(getTarget().isAlwaysOnTop());
+        updateAlwaysOnTopState();
         updateMinimumSize();
 
         final float opacity = getTarget().getOpacity();
@@ -404,8 +404,8 @@
     }
 
     @Override
-    public void setAlwaysOnTop(boolean value) {
-        platformWindow.setAlwaysOnTop(value);
+    public void updateAlwaysOnTopState() {
+        platformWindow.setAlwaysOnTop(getTarget().isAlwaysOnTop());
     }
 
     @Override
--- a/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/macosx/classes/sun/lwawt/macosx/CFileDialog.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -174,7 +174,7 @@
     }
 
     @Override
-    public void setAlwaysOnTop(boolean alwaysOnTop) {
+    public void updateAlwaysOnTopState() {
     }
 
     @Override
--- a/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -87,7 +87,7 @@
     }
 
     // 1.6 peer method
-    public void setAlwaysOnTop(boolean value) {
+    public void updateAlwaysOnTopState() {
         // no-op, since we just show the native print dialog
     }
 
--- a/src/share/classes/java/awt/Window.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/java/awt/Window.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -2234,7 +2234,7 @@
                 WindowPeer peer = (WindowPeer)this.peer;
                 synchronized(getTreeLock()) {
                     if (peer != null) {
-                        peer.setAlwaysOnTop(alwaysOnTop);
+                        peer.updateAlwaysOnTopState();
                     }
                 }
             }
--- a/src/share/classes/java/awt/peer/WindowPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/java/awt/peer/WindowPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -55,15 +55,14 @@
     void toBack();
 
     /**
-     * Sets if the window should always stay on top of all other windows or
-     * not.
+     * Updates the window's always-on-top state.
+     * Sets if the window should always stay
+     * on top of all other windows or not.
      *
-     * @param alwaysOnTop if the window should always stay on top of all other
-     *        windows or not
-     *
+     * @see Window#getAlwaysOnTop()
      * @see Window#setAlwaysOnTop(boolean)
      */
-    void setAlwaysOnTop(boolean alwaysOnTop);
+    void updateAlwaysOnTopState();
 
     /**
      * Updates the window's focusable state.
--- a/src/share/classes/java/beans/ThreadGroupContext.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/java/beans/ThreadGroupContext.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2013, 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
@@ -29,7 +29,6 @@
 import com.sun.beans.finder.PropertyEditorFinder;
 
 import java.awt.GraphicsEnvironment;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.WeakHashMap;
 
@@ -42,7 +41,7 @@
  */
 final class ThreadGroupContext {
 
-    private static final Map<ThreadGroup, ThreadGroupContext> contexts = new WeakHashMap<>();
+    private static final WeakIdentityMap<ThreadGroupContext> contexts = new WeakIdentityMap<>();
 
     /**
      * Returns the appropriate {@code AppContext} for the caller,
@@ -69,6 +68,8 @@
     private BeanInfoFinder beanInfoFinder;
     private PropertyEditorFinder propertyEditorFinder;
 
+    private ThreadGroupContext() {
+    }
 
     boolean isDesignTime() {
         return this.isDesignTime;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/beans/WeakIdentityMap.java	Mon Feb 11 21:09:32 2013 +0100
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2013, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.beans;
+
+import java.lang.ref.ReferenceQueue;
+import java.lang.ref.WeakReference;
+
+/**
+ * Hash table based mapping, which uses weak references to store keys
+ * and reference-equality in place of object-equality to compare them.
+ * An entry will automatically be removed when its key is no longer
+ * in ordinary use.  Both null values and the null key are supported.
+ *
+ * @see java.util.IdentityHashMap
+ * @see java.util.WeakHashMap
+ */
+final class WeakIdentityMap<T> {
+
+    private static final int MAXIMUM_CAPACITY = 1 << 30; // it MUST be a power of two
+    private static final Object NULL = new Object(); // special object for null key
+
+    private final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+
+    private Entry<T>[] table = newTable(1<<3); // table's length MUST be a power of two
+    private int threshold = 6; // the next size value at which to resize
+    private int size = 0; // the number of key-value mappings
+
+    public T get(Object key) {
+        removeStaleEntries();
+        if (key == null) {
+            key = NULL;
+        }
+        int hash = key.hashCode();
+        int index = getIndex(this.table, hash);
+        for (Entry<T> entry = this.table[index]; entry != null; entry = entry.next) {
+            if (entry.isMatched(key, hash)) {
+                return entry.value;
+            }
+        }
+        return null;
+    }
+
+    public T put(Object key, T value) {
+        removeStaleEntries();
+        if (key == null) {
+            key = NULL;
+        }
+        int hash = key.hashCode();
+        int index = getIndex(this.table, hash);
+        for (Entry<T> entry = this.table[index]; entry != null; entry = entry.next) {
+            if (entry.isMatched(key, hash)) {
+                T oldValue = entry.value;
+                entry.value = value;
+                return oldValue;
+            }
+        }
+        this.table[index] = new Entry<T>(key, hash, value, this.queue, this.table[index]);
+        if (++this.size >= this.threshold) {
+            if (this.table.length == MAXIMUM_CAPACITY) {
+                this.threshold = Integer.MAX_VALUE;
+            }
+            else {
+                removeStaleEntries();
+                Entry<T>[] table = newTable(this.table.length * 2);
+                transfer(this.table, table);
+
+                // If ignoring null elements and processing ref queue caused massive
+                // shrinkage, then restore old table.  This should be rare, but avoids
+                // unbounded expansion of garbage-filled tables.
+                if (this.size >= this.threshold / 2) {
+                    this.table = table;
+                    this.threshold *= 2;
+                }
+                else {
+                    transfer(table, this.table);
+                }
+            }
+        }
+        return null;
+    }
+
+    private void removeStaleEntries() {
+        for (Object ref = this.queue.poll(); ref != null; ref = this.queue.poll()) {
+            @SuppressWarnings("unchecked")
+            Entry<T> entry = (Entry<T>) ref;
+            int index = getIndex(this.table, entry.hash);
+
+            Entry<T> prev = this.table[index];
+            Entry<T> current = prev;
+            while (current != null) {
+                Entry<T> next = current.next;
+                if (current == entry) {
+                    if (prev == entry) {
+                        this.table[index] = next;
+                    }
+                    else {
+                        prev.next = next;
+                    }
+                    entry.value = null; // Help GC
+                    entry.next = null; // Help GC
+                    this.size--;
+                    break;
+                }
+                prev = current;
+                current = next;
+            }
+        }
+    }
+
+    private void transfer(Entry<T>[] oldTable, Entry<T>[] newTable) {
+        for (int i = 0; i < oldTable.length; i++) {
+            Entry<T> entry = oldTable[i];
+            oldTable[i] = null;
+            while (entry != null) {
+                Entry<T> next = entry.next;
+                Object key = entry.get();
+                if (key == null) {
+                    entry.value = null; // Help GC
+                    entry.next = null; // Help GC
+                    this.size--;
+                }
+                else {
+                    int index = getIndex(newTable, entry.hash);
+                    entry.next = newTable[index];
+                    newTable[index] = entry;
+                }
+                entry = next;
+            }
+        }
+    }
+
+
+    @SuppressWarnings("unchecked")
+    private Entry<T>[] newTable(int length) {
+        return (Entry<T>[]) new Entry<?>[length];
+    }
+
+    private static int getIndex(Entry<?>[] table, int hash) {
+        return hash & (table.length - 1);
+    }
+
+    private static class Entry<T> extends WeakReference<Object> {
+        private final int hash;
+        private T value;
+        private Entry<T> next;
+
+        Entry(Object key, int hash, T value, ReferenceQueue<Object> queue, Entry<T> next) {
+            super(key, queue);
+            this.hash = hash;
+            this.value = value;
+            this.next  = next;
+        }
+
+        boolean isMatched(Object key, int hash) {
+            return (this.hash == hash) && (key == get());
+        }
+    }
+}
--- a/src/share/classes/java/lang/ref/Finalizer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/java/lang/ref/Finalizer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -38,9 +38,9 @@
      */
     static native void invokeFinalizeMethod(Object o) throws Throwable;
 
-    static private ReferenceQueue queue = new ReferenceQueue();
-    static private Finalizer unfinalized = null;
-    static private Object lock = new Object();
+    private static ReferenceQueue queue = new ReferenceQueue();
+    private static Finalizer unfinalized = null;
+    private static final Object lock = new Object();
 
     private Finalizer
         next = null,
@@ -142,7 +142,11 @@
     /* Called by Runtime.runFinalization() */
     static void runFinalization() {
         forkSecondaryFinalizer(new Runnable() {
+            private volatile boolean running;
             public void run() {
+                if (running)
+                    return;
+                running = true;
                 for (;;) {
                     Finalizer f = (Finalizer)queue.poll();
                     if (f == null) break;
@@ -155,7 +159,11 @@
     /* Invoked by java.lang.Shutdown */
     static void runAllFinalizers() {
         forkSecondaryFinalizer(new Runnable() {
+            private volatile boolean running;
             public void run() {
+                if (running)
+                    return;
+                running = true;
                 for (;;) {
                     Finalizer f;
                     synchronized (lock) {
@@ -168,10 +176,14 @@
     }
 
     private static class FinalizerThread extends Thread {
+        private volatile boolean running;
         FinalizerThread(ThreadGroup g) {
             super(g, "Finalizer");
         }
         public void run() {
+            if (running)
+                return;
+            running = true;
             for (;;) {
                 try {
                     Finalizer f = (Finalizer)queue.remove();
--- a/src/share/classes/java/rmi/server/LogStream.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/java/rmi/server/LogStream.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -120,6 +120,13 @@
      */
     @Deprecated
     public static synchronized void setDefaultStream(PrintStream newDefault) {
+        SecurityManager sm = System.getSecurityManager();
+
+        if (sm != null) {
+            sm.checkPermission(
+                new java.util.logging.LoggingPermission("control", null));
+        }
+
         defaultStream = newDefault;
     }
 
--- a/src/share/classes/sun/awt/EmbeddedFrame.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/sun/awt/EmbeddedFrame.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -532,7 +532,7 @@
         public void toBack() {}
         public void updateFocusableWindowState() {}
         public void updateAlwaysOnTop() {}
-        public void setAlwaysOnTop(boolean alwaysOnTop) {}
+        public void updateAlwaysOnTopState() {}
         public Component getGlobalHeavyweightFocusOwner() { return null; }
         public void setBoundsPrivate(int x, int y, int width, int height) {
             setBounds(x, y, width, height, SET_BOUNDS);
--- a/src/share/classes/sun/font/CMap.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/sun/font/CMap.java	Mon Feb 11 21:09:32 2013 +0100
@@ -841,7 +841,6 @@
 
         CMapFormat6(ByteBuffer bbuffer, int offset, char[] xlat) {
 
-             System.err.println("WARNING: CMapFormat8 is untested.");
              bbuffer.position(offset+6);
              CharBuffer buffer = bbuffer.asCharBuffer();
              firstCode = buffer.get();
@@ -884,7 +883,6 @@
 
          CMapFormat8(ByteBuffer bbuffer, int offset, char[] xlat) {
 
-             System.err.println("WARNING: CMapFormat8 is untested.");
              bbuffer.position(12);
              bbuffer.get(is32);
              nGroups = bbuffer.getInt();
@@ -915,7 +913,6 @@
 
          CMapFormat10(ByteBuffer bbuffer, int offset, char[] xlat) {
 
-             System.err.println("WARNING: CMapFormat10 is untested.");
              firstCode = bbuffer.getInt() & INTMASK;
              entryCount = bbuffer.getInt() & INTMASK;
              bbuffer.position(offset+20);
--- a/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLBlitLoops.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -25,6 +25,7 @@
 
 package sun.java2d.opengl;
 
+import java.awt.AlphaComposite;
 import java.awt.Composite;
 import java.awt.Transparency;
 import java.awt.geom.AffineTransform;
@@ -96,6 +97,8 @@
                                CompositeType.AnyAlpha,
                                blitIntArgbPreToSurface),
 
+            new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLSurface),
+
             new OGLSwToSurfaceScale(SurfaceType.IntRgb,
                                     OGLSurfaceData.PF_INT_RGB),
             new OGLSwToSurfaceScale(SurfaceType.IntRgbx,
@@ -172,6 +175,9 @@
             new OGLGeneralBlit(OGLSurfaceData.OpenGLTexture,
                                CompositeType.SrcNoEa,
                                blitIntArgbPreToTexture),
+
+            new OGLAnyCompositeBlit(OGLSurfaceData.OpenGLTexture),
+
         };
         GraphicsPrimitiveMgr.register(primitives);
     }
@@ -760,3 +766,49 @@
         }
     }
 }
+
+class OGLAnyCompositeBlit extends Blit {
+    private WeakReference<SurfaceData> dstTmp;
+
+    public OGLAnyCompositeBlit(SurfaceType dstType) {
+        super(SurfaceType.Any, CompositeType.Any, dstType);
+    }
+    public synchronized void Blit(SurfaceData src, SurfaceData dst,
+                                  Composite comp, Region clip,
+                                  int sx, int sy, int dx, int dy,
+                                  int w, int h)
+    {
+        Blit convertdst = Blit.getFromCache(dst.getSurfaceType(),
+                                            CompositeType.SrcNoEa,
+                                            SurfaceType.IntArgbPre);
+
+        SurfaceData cachedDst = null;
+
+        if (dstTmp != null) {
+            // use cached intermediate surface, if available
+            cachedDst = dstTmp.get();
+        }
+
+        // convert source to IntArgbPre
+        SurfaceData dstBuffer = convertFrom(convertdst, dst, dx, dy, w, h,
+                                            cachedDst, BufferedImage.TYPE_INT_ARGB_PRE);
+
+        Blit performop = Blit.getFromCache(src.getSurfaceType(),
+        CompositeType.Any, dstBuffer.getSurfaceType());
+
+        performop.Blit(src, dstBuffer, comp, clip,
+                       sx, sy, 0, 0, w, h);
+
+        if (dstBuffer != cachedDst) {
+            // cache the intermediate surface
+            dstTmp = new WeakReference(dstBuffer);
+        }
+
+        // now blit the buffer back to the destination
+        convertdst = Blit.getFromCache(dstBuffer.getSurfaceType(),
+                                       CompositeType.SrcNoEa,
+                                       dst.getSurfaceType());
+        convertdst.Blit(dstBuffer, dst, AlphaComposite.Src,
+                        clip, 0, 0, dx, dy, w, h);
+    }
+}
--- a/src/share/classes/sun/java2d/opengl/OGLSurfaceDataProxy.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/classes/sun/java2d/opengl/OGLSurfaceDataProxy.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -76,6 +76,7 @@
                                         CompositeType comp,
                                         Color bgColor)
     {
-        return (bgColor == null || transparency == Transparency.OPAQUE);
+        return comp.isDerivedFrom(CompositeType.AnyAlpha) &&
+               (bgColor == null || transparency == Transparency.OPAQUE);
     }
 }
--- a/src/share/lib/security/java.security	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/lib/security/java.security	Mon Feb 11 21:09:32 2013 +0100
@@ -133,8 +133,7 @@
                com.sun.proxy.,\
                com.sun.org.apache.xerces.internal.utils.,\
                com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.glassfish.external.,\
-               com.sun.org.glassfish.gmbal.
+               com.sun.org.glassfish.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -156,8 +155,7 @@
                    com.sun.proxy.,\
                    com.sun.org.apache.xerces.internal.utils.,\
                    com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.glassfish.external.,\
-                   com.sun.org.glassfish.gmbal.
+                   com.sun.org.glassfish.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/share/lib/security/java.security-macosx	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/lib/security/java.security-macosx	Mon Feb 11 21:09:32 2013 +0100
@@ -134,8 +134,7 @@
                com.sun.proxy.,\
                com.sun.org.apache.xerces.internal.utils.,\
                com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.glassfish.external.,\
-               com.sun.org.glassfish.gmbal.,\
+               com.sun.org.glassfish.,\
                apple.
 
 #
@@ -158,8 +157,7 @@
                    com.sun.proxy.,\
                    com.sun.org.apache.xerces.internal.utils.,\
                    com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.glassfish.external.,\
-                   com.sun.org.glassfish.gmbal.,\
+                   com.sun.org.glassfish.,\
                    apple.
 
 #
--- a/src/share/lib/security/java.security-solaris	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/lib/security/java.security-solaris	Mon Feb 11 21:09:32 2013 +0100
@@ -135,8 +135,7 @@
                com.sun.proxy.,\
                com.sun.org.apache.xerces.internal.utils.,\
                com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.glassfish.external.,\
-               com.sun.org.glassfish.gmbal.
+               com.sun.org.glassfish.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -158,8 +157,7 @@
                    com.sun.proxy.,\
                    com.sun.org.apache.xerces.internal.utils.,\
                    com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.glassfish.external.,\
-                   com.sun.org.glassfish.gmbal.
+                   com.sun.org.glassfish.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/share/lib/security/java.security-windows	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/share/lib/security/java.security-windows	Mon Feb 11 21:09:32 2013 +0100
@@ -134,8 +134,7 @@
                com.sun.proxy.,\
                com.sun.org.apache.xerces.internal.utils.,\
                com.sun.org.apache.xalan.internal.utils.,\
-               com.sun.org.glassfish.external.,\
-               com.sun.org.glassfish.gmbal.
+               com.sun.org.glassfish.
 
 #
 # List of comma-separated packages that start with or equal this string
@@ -157,8 +156,7 @@
                    com.sun.proxy.,\
                    com.sun.org.apache.xerces.internal.utils.,\
                    com.sun.org.apache.xalan.internal.utils.,\
-                   com.sun.org.glassfish.external.,\
-                   com.sun.org.glassfish.gmbal.
+                   com.sun.org.glassfish.
 
 #
 # Determines whether this properties file can be appended to
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, 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
@@ -992,8 +992,8 @@
                              XLayerProtocol.LAYER_NORMAL);
     }
 
-    public void setAlwaysOnTop(boolean alwaysOnTop) {
-        this.alwaysOnTop = alwaysOnTop;
+    public void updateAlwaysOnTopState() {
+        this.alwaysOnTop = ((Window) this.target).isAlwaysOnTop();
         updateAlwaysOnTop();
     }
 
--- a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -237,7 +237,7 @@
 
     // unused methods.  Overridden to disable this functionality as
     // it requires HWND which is not available for FileDialog
-    public void setAlwaysOnTop(boolean value) {}
+    public void updateAlwaysOnTopState() {}
     public void setDirectory(String dir) {}
     public void setFile(String file) {}
     public void setTitle(String title) {}
--- a/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -117,7 +117,7 @@
     // unused methods.  Overridden to disable this functionality as
     // it requires HWND which is not available for FileDialog
     void initialize() {}
-    public void setAlwaysOnTop(boolean b) {}
+    public void updateAlwaysOnTopState() {}
     public void setResizable(boolean resizable) {}
     public void hide() {}
     public void enable() {}
--- a/src/windows/classes/sun/awt/windows/WWindowPeer.java	Fri Feb 08 10:46:57 2013 -0800
+++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java	Mon Feb 11 21:09:32 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2013, 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
@@ -132,6 +132,10 @@
         }
     }
 
+    public void updateAlwaysOnTopState() {
+        setAlwaysOnTop(((Window)target).isAlwaysOnTop());
+    }
+
     public void updateFocusableWindowState() {
         setFocusableWindow(((Window)target).isFocusableWindow());
     }
--- a/test/Makefile	Fri Feb 08 10:46:57 2013 -0800
+++ b/test/Makefile	Mon Feb 11 21:09:32 2013 +0100
@@ -512,7 +512,8 @@
 JDK_ALL_TARGETS += jdk_misc
 jdk_misc: $(call TestDirs, \
           demo/jvmti demo/zipfs javax/naming javax/script \
-          javax/smartcardio javax/xml/soap com/sun/jndi com/sun/xml sun/misc)
+          javax/smartcardio com/sun/jndi com/sun/org/glassfish com/sun/xml \
+          sun/misc)
 	$(call RunAgentvmBatch)
 
 # Stable samevm testruns (minus items from PROBLEM_LIST)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/java2d/OpenGL/CustomCompositeTest.java	Mon Feb 11 21:09:32 2013 +0100
@@ -0,0 +1,266 @@
+/*
+ * Copyright (c) 2013, 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
+ * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7124347
+ * @summary Verifies that rendering with XOR composite, and arbitraty
+ *          custom composite doesn not cause internal errors.
+ *
+ * @run     main/othervm -Dsun.java2d.opengl=True CustomCompositeTest
+ */
+
+import java.awt.AWTException;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.CompositeContext;
+import java.awt.Dimension;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsEnvironment;
+import java.awt.ImageCapabilities;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+import java.awt.image.ColorModel;
+import java.awt.image.DataBufferInt;
+import java.awt.image.Raster;
+import java.awt.image.SinglePixelPackedSampleModel;
+import java.awt.image.VolatileImage;
+import java.awt.image.WritableRaster;
+import java.util.concurrent.CountDownLatch;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+public class CustomCompositeTest {
+
+    private static JFrame frame;
+    private static CountDownLatch paintLatch;
+    private static Throwable paintError;
+
+    public static void main(String[] args) {
+
+        paintLatch = new CountDownLatch(1);
+        paintError = null;
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                initGUI();
+            }
+        });
+
+        try {
+            paintLatch.await();
+        } catch (InterruptedException e) {
+        };
+        System.out.println("Paint is done!");
+        if (paintError != null) {
+            frame.dispose();
+            throw new RuntimeException("Test FAILED.", paintError);
+        }
+
+        System.out.println("Phase 1: PASSED.");
+
+        // now resise the frame in order to cause re-paint with accelerated
+        // source images.
+        paintError = null;
+        paintLatch = new CountDownLatch(1);
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                Dimension size = frame.getSize();
+                size.width += 50;
+                size.height += 50;
+
+                frame.setSize(size);
+            }
+        });
+
+        try {
+            paintLatch.await();
+        } catch (InterruptedException e) {
+        };
+        if (paintError != null) {
+            frame.dispose();
+            throw new RuntimeException("Resize test FAILED.", paintError);
+        }
+        frame.dispose();
+        System.out.println("Phase 2: PASSED.");
+
+        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
+        GraphicsConfiguration cfg = env.getDefaultScreenDevice().getDefaultConfiguration();
+        // test rendering to accelerated volatile image
+        testVolatileImage(cfg, true);
+        System.out.println("Phase 3: PASSED.");
+
+        // test rendering to unaccelerated volatile image
+        testVolatileImage(cfg, false);
+        System.out.println("Phase 4: PASSED.");
+    }
+
+    private static void testVolatileImage(GraphicsConfiguration cfg,
+            boolean accelerated)
+    {
+        VolatileImage dst = null;
+        try {
+            dst = cfg.createCompatibleVolatileImage(640, 480,
+                new ImageCapabilities(accelerated));
+        } catch (AWTException e) {
+            System.out.println("Unable to create volatile image, skip the test.");
+            return;
+        }
+        renderToVolatileImage(dst);
+    }
+
+    private static void renderToVolatileImage(VolatileImage dst) {
+        Graphics2D g = dst.createGraphics();
+        do {
+            System.out.println("Render to volatile image..");
+            try {
+                MyComp.renderTest(g, dst.getHeight(), dst.getHeight());
+            } catch (Throwable e) {
+                throw new RuntimeException("Test FAILED.", e);
+            }
+        } while (dst.contentsLost());
+        System.out.println("Done.");
+    }
+
+    private static void initGUI() {
+        frame = new JFrame("Silly composite");
+        frame.getContentPane().add(new MyComp());
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+    private static class MyComp extends JComponent {
+
+        private static BufferedImage theImage;
+
+        public MyComp() {
+        }
+
+        private static BufferedImage getTestImage() {
+            if (theImage == null) {
+                theImage = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
+                Graphics2D g2d = theImage.createGraphics();
+                g2d.setColor(Color.red);
+                g2d.fillRect(0, 0, 256, 256);
+
+                g2d.setPaint(new GradientPaint(0, 0, Color.red, 256, 256, Color.blue));
+                g2d.fillRect(0, 100, 256, 256);
+                g2d.dispose();
+            }
+            return theImage;
+        }
+
+        public Dimension getPreferredSize() {
+            return new Dimension(640, 375);
+        }
+
+        public void paintComponent(Graphics g) {
+
+
+            Graphics2D g2d = (Graphics2D) g;
+            try {
+                renderTest(g2d, getWidth(), getHeight());
+            } catch (Throwable e) {
+                paintError = e;
+            }
+            if (paintLatch != null) {
+                paintLatch.countDown();
+            }
+        }
+
+        public static void renderTest(Graphics2D g2d, int w, int h) {
+            g2d.setColor(Color.yellow);
+            g2d.fillRect(0, 0, w, h);
+
+            BufferedImage image = getTestImage();
+            // draw original image
+            g2d.drawRenderedImage(image, null);
+
+            // draw image with custom composite
+            g2d.translate(175, 25);
+            Composite currentComposite = g2d.getComposite();
+            g2d.setComposite(new TestComposite());
+            g2d.drawRenderedImage(image, null);
+            g2d.setComposite(currentComposite);
+
+            // draw image with XOR
+            g2d.translate(175, 25);
+            g2d.setXORMode(Color.red);
+            g2d.drawRenderedImage(image, null);
+
+
+            System.out.println("Painting is done...");
+        }
+    }
+
+    // A silly custom Composite to demonstrate the problem - just inverts the RGB
+    private static class TestComposite implements Composite {
+
+        public CompositeContext createContext(ColorModel srcColorModel, ColorModel dstColorModel, RenderingHints hints) {
+            return new TestCompositeContext();
+        }
+    }
+
+    private static class TestCompositeContext implements CompositeContext {
+
+        public void dispose() {
+        }
+
+        public void compose(Raster src, Raster dstIn, WritableRaster dstOut) {
+            int w = src.getWidth();
+            int h = src.getHeight();
+
+            DataBufferInt srcDB = (DataBufferInt) src.getDataBuffer();
+            DataBufferInt dstOutDB = (DataBufferInt) dstOut.getDataBuffer();
+            int srcRGB[] = srcDB.getBankData()[0];
+            int dstOutRGB[] = dstOutDB.getBankData()[0];
+            int srcOffset = srcDB.getOffset();
+            int dstOutOffset = dstOutDB.getOffset();
+            int srcScanStride = ((SinglePixelPackedSampleModel) src.getSampleModel()).getScanlineStride();
+            int dstOutScanStride = ((SinglePixelPackedSampleModel) dstOut.getSampleModel()).getScanlineStride();
+            int srcAdjust = srcScanStride - w;
+            int dstOutAdjust = dstOutScanStride - w;
+
+            int si = srcOffset;
+            int doi = dstOutOffset;
+
+            for (int i = 0; i < h; i++) {
+                for (int j = 0; j < w; j++) {
+                    dstOutRGB[doi] = srcRGB[si] ^ 0x00ffffff;
+                    si++;
+                    doi++;
+                }
+
+                si += srcAdjust;
+                doi += dstOutAdjust;
+            }
+        }
+    }
+}