--- a/jdk/src/share/classes/java/awt/TextComponent.java Thu Jan 31 17:04:47 2013 -0800
+++ b/jdk/src/share/classes/java/awt/TextComponent.java Sun Feb 03 23:25:38 2013 +0100
@@ -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();
}