This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 247990 - SecurityException: All swing access to clipboard should be redirected to ExClipboard
Summary: SecurityException: All swing access to clipboard should be redirected to ExCl...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 252120 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-16 23:04 UTC by matteodg
Modified: 2016-02-09 02:42 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 202787


Attachments
stacktrace (5.85 KB, text/plain)
2014-10-16 23:04 UTC, matteodg
Details
stacktrace (6.62 KB, text/plain)
2015-05-07 17:43 UTC, Vladimir Kvashin
Details
stacktrace (5.88 KB, text/plain)
2016-02-05 14:13 UTC, Vladimir Voskresensky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matteodg 2014-10-16 23:04:43 UTC
Build: NetBeans IDE 8.0.1 (Build 201408251540)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.65-b04, Java(TM) SE Runtime Environment, 1.7.0_67-b01
OS: Linux

User Comments:
petrk: -

GUEST: rectangular selection and then I wanted delete those rows but maybe I invoked clipboard

matteodg: Doing copy paste on a Java editor

petrk: Deleted rectangular selection

petrk: -

GUEST: i was cut a code...

petrk: Deleted square selection

petrk: deleted rectangular area

petrk: Deleted rectangular selection




Stacktrace: 
java.lang.SecurityException: All swing access to clipboard should be redirected to ExClipboard
   at org.netbeans.TopSecurityManager.checkWhetherAccessedFromSwingTransfer(TopSecurityManager.java:757)
   at org.netbeans.TopSecurityManager.checkPermission(TopSecurityManager.java:501)
   at java.lang.SecurityManager.checkSystemClipboardAccess(SecurityManager.java:1390)
   at sun.awt.X11.XToolkit.getSystemSelection(XToolkit.java:1117)
   at org.netbeans.editor.BaseCaret.getSystemSelection(BaseCaret.java:864)
   at org.netbeans.editor.BaseCaret.updateSystemSelection(BaseCaret.java:855)
Comment 1 matteodg 2014-10-16 23:04:45 UTC
Created attachment 149950 [details]
stacktrace
Comment 2 Exceptions Reporter 2014-11-08 19:03:43 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=202787
Comment 3 Jaroslav Tulach 2014-11-18 12:13:34 UTC
The code in
org.netbeans.editor.BaseCaret.getSystemSelection
should be changed to use ExClipboard. If the direct access to system clipboard is desirable, then the check in TopSecurityManager needs to be updated. For example:

--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -753,6 +753,9 @@
      */
     private void checkWhetherAccessedFromSwingTransfer () throws SecurityException {
         for (Class<?> c : getClassContext()) {
+            if (c.getName().equals("org.netbeans.editor.BaseCaret")) { // NOI18N
+                return;
+            }
             if (c.getName().equals("javax.swing.TransferHandler$TransferAction")) {
                 throw new SecurityException ("All swing access to clipboard should be redirected to ExClipboard"); // NOI18N
             }

passing to editor to decide and integrate.
Comment 4 Vladimir Kvashin 2015-05-07 17:43:12 UTC
Created attachment 153553 [details]
stacktrace

tried to cut a rectangular bloc	k
Comment 5 Ralph Ruijs 2016-01-11 12:52:37 UTC
*** Bug 252120 has been marked as a duplicate of this bug. ***
Comment 6 Vladimir Voskresensky 2016-02-05 14:13:47 UTC
Created attachment 158389 [details]
stacktrace

paste Ctrl+Shift+D text
Comment 7 Miloslav Metelka 2016-02-08 14:17:35 UTC
Fixed as suggested by Yarda since I did not find any better way.
http://hg.netbeans.org/jet-main/rev/50990a2535ba
Comment 8 Quality Engineering 2016-02-09 02:42:46 UTC
Integrated into 'main-silver', will be available in build *201602090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/50990a2535ba
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #Bug 247990 - SecurityException: All swing access to clipboard should be redirected to ExClipboard.