This new thread continues the discussion from 
https://github.com/apache/netbeans/discussions/7051#discussioncomment-12587201
Summary:
* On Windows, Cut and Paste between NetBeans and external applications has been 
unreliable. ( https://github.com/apache/netbeans/issues/3962 )
* With NB25, as a side effect of SecurityManager changes, the problem occurs 
much more frequently, but is also easier to reproduce. (E.g. with the code 
posted by bradvido at 
https://github.com/apache/netbeans/issues/3962#issuecomment-1664507172 , or 
simple manual cut/pasting to/from Notepad.)
* Through heroic investigation efforts, user xxDark has tracked the problem 
down to a JDK bug, and developed a patch. He has submitted an OpenJDK bug and 
opened a PR against OpenJDK ( https://github.com/openjdk/jdk/pull/23736 ). But 
getting this fixed in OpenJDK may take a long time, and meanwhile NetBeans will 
lose Windows users.
* The patch can be applied from NetBeans, however, by supplying a special JAR 
and JVM parameter on startup. There are two ways to do this: Either using the 
"javaagent" developed at https://github.com/xxDark/clipboard-agent , which 
patches bytecode on the fly, or by providing a compiled, patched version of the 
entire sun/awt/windows/WClipboard.java class using the "patch-module" argument 
to the JVM.
* We have tested both the "javaagent" approach and the "patch-module" approach, 
and they both seem to work.
* The downside of the "javaagent" approach is that bytecode patching code is 
cryptic and fragile.
* The downside of the "patch-module" approach is that WClipboard.java is GPL2CP 
and would need external publishing and special clearance from Apache Legal to 
be included in NetBeans (like we did for nb-javac; see 
https://issues.apache.org/jira/browse/LEGAL-563 ).

The main remaining questions seems to be:
1) Do we ship a fix to the bug from officially released NetBeans binaries, i.e. 
the ZIP that is hosted on netbeans.apache.org?
2) If yes, do we take the javaagent or the patch-module approach?

-- Eirik

Reply via email to