changeset 5347:7c4eed4b6c19

7124400: [macosx] CGraphicsDevice.getConfigurations() returns reference to member (does not copy configs) Reviewed-by: anthony, kizune
author bae
date Mon, 21 May 2012 14:04:46 +0400
parents b5726775b0d8
children 416b3a498e71
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	Thu May 10 10:25:14 2012 -0700
+++ b/src/macosx/classes/sun/awt/CGraphicsDevice.java	Mon May 21 14:04:46 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	Thu May 10 10:25:14 2012 -0700
+++ b/test/java/awt/GraphicsDevice/CloneConfigsTest.java	Mon May 21 14:04:46 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