changeset 3947:e3c14b1c846b

7030062: duplicate free Reviewed-by: dcherepanov
author denis
date Tue, 12 Apr 2011 19:06:57 +0400
parents b58d1c9fa886
children e00be783309b
files make/sun/jpeg/Makefile src/share/classes/java/awt/Toolkit.java src/solaris/native/sun/awt/awt_mgrsel.c
diffstat 3 files changed, 35 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/make/sun/jpeg/Makefile	Fri Apr 08 17:04:35 2011 +0400
+++ b/make/sun/jpeg/Makefile	Tue Apr 12 19:06:57 2011 +0400
@@ -74,7 +74,7 @@
   # volatile to prevent the optimization. However, this approach does not
   # work because we have to declare all variables as volatile in result.
 
-  OTHER_CFLAGS += -Wno-clobbered
+#  OTHER_CFLAGS += -Wno-clobbered
 endif
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
--- a/src/share/classes/java/awt/Toolkit.java	Fri Apr 08 17:04:35 2011 +0400
+++ b/src/share/classes/java/awt/Toolkit.java	Tue Apr 12 19:06:57 2011 +0400
@@ -466,6 +466,10 @@
      */
     protected void loadSystemColors(int[] systemColors)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
     }
 
 /**
@@ -500,6 +504,10 @@
      */
     public void setDynamicLayout(boolean dynamic)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
     }
 
     /**
@@ -523,6 +531,9 @@
      */
     protected boolean isDynamicLayoutSet()
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().isDynamicLayoutSet();
         } else {
@@ -558,6 +569,9 @@
      */
     public boolean isDynamicLayoutActive()
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().isDynamicLayoutActive();
         } else {
@@ -601,6 +615,9 @@
      */
     public Insets getScreenInsets(GraphicsConfiguration gc)
         throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getScreenInsets(gc);
         } else {
@@ -1342,6 +1359,9 @@
      * @since 1.4
      */
     public Clipboard getSystemSelection() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getSystemSelection();
         } else {
@@ -1371,6 +1391,10 @@
      * @since     JDK1.1
      */
     public int getMenuShortcutKeyMask() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
+
         return Event.CTRL_MASK;
     }
 
@@ -1499,6 +1523,9 @@
      */
     public Dimension getBestCursorSize(int preferredWidth,
         int preferredHeight) throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         // Override to implement custom cursor support.
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().
@@ -1526,6 +1553,9 @@
      * @since     1.2
      */
     public int getMaximumCursorColors() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         // Override to implement custom cursor support.
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getMaximumCursorColors();
@@ -2572,6 +2602,9 @@
     * @since 1.7
      */
     public boolean areExtraMouseButtonsEnabled() throws HeadlessException {
+        if (GraphicsEnvironment.isHeadless()){
+            throw new HeadlessException();
+        }
         return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();
     }
 }
--- a/src/solaris/native/sun/awt/awt_mgrsel.c	Fri Apr 08 17:04:35 2011 +0400
+++ b/src/solaris/native/sun/awt/awt_mgrsel.c	Tue Apr 12 19:06:57 2011 +0400
@@ -136,7 +136,7 @@
         || per_scr_owners == NULL || mgrsel == NULL)
     {
         DTRACE_PRINTLN("MG: select: unable to allocate memory");
-        if (namesbuf != NULL) free(per_scr_atoms);
+        if (namesbuf != NULL) free(namesbuf);
         if (names != NULL) free(names);
         if (per_scr_atoms != NULL) free(per_scr_atoms);
         if (per_scr_owners != NULL) free(per_scr_owners);