changeset 1050:445d64831b6d

Fix 6652463.
author andrew
date Tue, 14 Apr 2009 16:32:11 +0100
parents 45a2cb0ee7e5
children 11def3259fe2
files src/share/classes/javax/print/attribute/standard/MediaSize.java
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/print/attribute/standard/MediaSize.java	Tue Apr 14 16:25:31 2009 +0100
+++ b/src/share/classes/javax/print/attribute/standard/MediaSize.java	Tue Apr 14 16:32:11 2009 +0100
@@ -123,8 +123,10 @@
         if (x > y) {
             throw new IllegalArgumentException("X dimension > Y dimension");
         }
-        mediaName = media;
-        mediaMap.put(mediaName, this);
+        if (media != null && mediaMap.get(media) == null) {
+            mediaName = media;
+            mediaMap.put(mediaName, this);
+        }
         sizeVector.add(this);
     }
 
@@ -147,8 +149,10 @@
         if (x > y) {
             throw new IllegalArgumentException("X dimension > Y dimension");
         }
-        mediaName = media;
-        mediaMap.put(mediaName, this);
+        if (media != null && mediaMap.get(media) == null) {
+            mediaName = media;
+            mediaMap.put(mediaName, this);
+        }
         sizeVector.add(this);
     }