--- old/jdk/src/share/classes/java/awt/TextComponent.java 2013-02-07 17:06:50.000000000 +0100 +++ new/jdk/src/share/classes/java/awt/TextComponent.java 2013-02-07 17:06:50.000000000 +0100 @@ -107,12 +107,6 @@ // the background color of non-editable TextComponents. boolean backgroundSetByClientCode = false; - /** - * True if this TextComponent has access - * to the System clipboard. - */ - transient private boolean canAccessClipboard; - transient protected TextListener textListener; /* @@ -137,7 +131,6 @@ GraphicsEnvironment.checkHeadless(); this.text = (text != null) ? text : ""; setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); - checkSystemClipboardAccess(); } private void enableInputMethodsIfNecessary() { @@ -732,17 +725,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; } /* @@ -825,7 +815,6 @@ } } enableInputMethodsIfNecessary(); - checkSystemClipboardAccess(); }