changeset 5035:7f0e6be7f7ea

7124400: [macosx] CGraphicsDevice.getConfigurations() returns reference to member (does not copy configs) Reviewed-by: art, anthony
author bae
date Mon, 28 May 2012 13:29:48 +0400
parents e9014eaf0e03
children 9fa6e878fcdb
files src/macosx/classes/sun/awt/CGraphicsDevice.java test/java/awt/GraphicsDevice/CloneConfigsTest.java
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/sun/awt/CGraphicsDevice.java	Mon May 28 13:19:27 2012 +0400
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Mon May 28 13:29:48 2012 +0400
@@ -40,7 +40,7 @@
     private final int displayID;
 
     // Array of all GraphicsConfig instances for this device
-    private final CGraphicsConfig[] configs;
+    private final GraphicsConfiguration[] configs;
 
     // Default config (temporarily hard coded)
     private final int DEFAULT_CONFIG = 0;
@@ -49,7 +49,7 @@
 
     public CGraphicsDevice(int displayID) {
         this.displayID = displayID;
-        configs = new CGraphicsConfig[] {
+        configs = new GraphicsConfiguration[] {
             CGLGraphicsConfig.getConfig(this, 0)
         };
     }
@@ -66,7 +66,7 @@
      */
     @Override
     public GraphicsConfiguration[] getConfigurations() {
-        return configs;
+        return configs.clone();
     }
 
     /**
--- a/test/java/awt/GraphicsDevice/CloneConfigsTest.java	Mon May 28 13:19:27 2012 +0400
+++ b/test/java/awt/GraphicsDevice/CloneConfigsTest.java	Mon May 28 13:29:48 2012 +0400
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     6822057
+ * @bug     6822057 7124400
  *
  * @summary Test verifies that list of supported graphics configurations
  *          can not be changed via modification of elements of an array