jdk/src/share/classes/java/awt/TextComponent.java
changeset 16097 6277cf02aeac
parent 13357 6a75209a8aeb
child 16100 379f48d34516
--- a/jdk/src/share/classes/java/awt/TextComponent.java	Tue Nov 20 11:46:42 2012 +0400
+++ b/jdk/src/share/classes/java/awt/TextComponent.java	Mon Nov 26 20:49:54 2012 +0400
@@ -109,12 +109,6 @@
     // the background color of non-editable TextComponents.
     boolean backgroundSetByClientCode = false;
 
-    /**
-     * True if this <code>TextComponent</code> has access
-     * to the System clipboard.
-     */
-    transient private boolean canAccessClipboard;
-
     transient protected TextListener textListener;
 
     /*
@@ -139,7 +133,6 @@
         GraphicsEnvironment.checkHeadless();
         this.text = (text != null) ? text : "";
         setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
-        checkSystemClipboardAccess();
     }
 
     private void enableInputMethodsIfNecessary() {
@@ -734,17 +727,14 @@
     /**
      * Assigns a valid value to the canAccessClipboard instance variable.
      */
-    private void checkSystemClipboardAccess() {
-        canAccessClipboard = true;
+    private boolean canAccessClipboard() {
         SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            try {
-                sm.checkSystemClipboardAccess();
-            }
-            catch (SecurityException e) {
-                canAccessClipboard = false;
-            }
-        }
+        if (sm == null) return true;
+        try {
+            sm.checkSystemClipboardAccess();
+            return true;
+        } catch (SecurityException e) {}
+        return false;
     }
 
     /*
@@ -827,7 +817,6 @@
             }
         }
         enableInputMethodsIfNecessary();
-        checkSystemClipboardAccess();
     }