summaryrefslogtreecommitdiff
path: root/java/openjdk6/files/icedtea/security/20130201/7186952.patch
diff options
context:
space:
mode:
Diffstat (limited to 'java/openjdk6/files/icedtea/security/20130201/7186952.patch')
-rw-r--r--java/openjdk6/files/icedtea/security/20130201/7186952.patch127
1 files changed, 0 insertions, 127 deletions
diff --git a/java/openjdk6/files/icedtea/security/20130201/7186952.patch b/java/openjdk6/files/icedtea/security/20130201/7186952.patch
deleted file mode 100644
index 0c6c8ee2e67e..000000000000
--- a/java/openjdk6/files/icedtea/security/20130201/7186952.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-# HG changeset patch
-# User denis
-# Date 1353947054 -14400
-# Node ID 9bbc6817b00c3e9d4eba05d53a8a20b45947ea03
-# Parent c684d497e159d3eebded29e997d953019305ec45
-7186952: Improve clipboard access
-Reviewed-by: serb, ahgross
-
-diff --git a/src/share/classes/java/awt/TextComponent.java b/src/share/classes/java/awt/TextComponent.java
---- jdk/src/share/classes/java/awt/TextComponent.java
-+++ jdk/src/share/classes/java/awt/TextComponent.java
-@@ -107,12 +107,6 @@ public class TextComponent extends Compo
- // 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;
-
- /*
-@@ -137,7 +131,6 @@ public class TextComponent extends Compo
- GraphicsEnvironment.checkHeadless();
- this.text = (text != null) ? text : "";
- setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
-- checkSystemClipboardAccess();
- }
-
- private void enableInputMethodsIfNecessary() {
-@@ -727,17 +720,14 @@ public class TextComponent extends Compo
- /**
- * 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;
- }
-
- /*
-@@ -820,7 +810,6 @@ public class TextComponent extends Compo
- }
- }
- enableInputMethodsIfNecessary();
-- checkSystemClipboardAccess();
- }
-
-
-diff --git a/src/windows/native/sun/windows/awt_TextComponent.cpp b/src/windows/native/sun/windows/awt_TextComponent.cpp
---- jdk/src/windows/native/sun/windows/awt_TextComponent.cpp
-+++ jdk/src/windows/native/sun/windows/awt_TextComponent.cpp
-@@ -52,13 +52,11 @@ struct EnableEditingStruct {
- * AwtTextComponent fields
- */
-
--/* java.awt.TextComponent fields */
--jfieldID AwtTextComponent::canAccessClipboardID;
--
--
- /************************************************************************
- * AwtTextComponent methods
- */
-+
-+jmethodID AwtTextComponent::canAccessClipboardMID;
-
- AwtTextComponent::AwtTextComponent() {
- m_synthetic = FALSE;
-@@ -188,8 +186,7 @@ AwtTextComponent::WmPaste()
- }
- jobject target = GetTarget(env);
- jboolean canAccessClipboard =
-- env->GetBooleanField(target,
-- AwtTextComponent::canAccessClipboardID);
-+ env->CallBooleanMethod (target, AwtTextComponent::canAccessClipboardMID);
- env->DeleteLocalRef(target);
- return (canAccessClipboard) ? mrDoDefault : mrConsume;
- }
-@@ -622,12 +619,13 @@ Java_sun_awt_windows_WTextComponentPeer_
- {
- TRY;
-
-- cls = env->FindClass("java/awt/TextComponent");
-- if (cls != NULL) {
-- AwtTextComponent::canAccessClipboardID =
-- env->GetFieldID(cls, "canAccessClipboard", "Z");
-- DASSERT(AwtTextComponent::canAccessClipboardID != NULL);
-- }
-+ jclass textComponentClassID = env->FindClass("java/awt/TextComponent");
-+ AwtTextComponent::canAccessClipboardMID =
-+ env->GetMethodID(textComponentClassID,
-+ "canAccessClipboard", "()Z");
-+ env->DeleteLocalRef(textComponentClassID);
-+
-+ DASSERT(AwtTextComponent::canAccessClipboardMID != NULL)
-
- CATCH_BAD_ALLOC;
- }
-diff --git a/src/windows/native/sun/windows/awt_TextComponent.h b/src/windows/native/sun/windows/awt_TextComponent.h
---- jdk/src/windows/native/sun/windows/awt_TextComponent.h
-+++ jdk/src/windows/native/sun/windows/awt_TextComponent.h
-@@ -42,8 +42,7 @@
-
- class AwtTextComponent : public AwtComponent {
- public:
-- /* java.awt.TextComponent canAccessClipboard field ID */
-- static jfieldID canAccessClipboardID;
-+ static jmethodID canAccessClipboardMID;
-
- AwtTextComponent();
-