JaroslavTulach opened a new pull request, #4134:
URL: https://github.com/apache/netbeans/pull/4134
A colleague of mine reported following error when using `Sampler`:
```
Caused by: java.awt.AWTError: Could not create Toolkit: sun.awt.X11.XToolkit
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:607)
at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1494)
at
java.desktop/java.awt.EventQueue.isDispatchThread(EventQueue.java:1086)
at
java.desktop/javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:1493)
at org.netbeans.modules.sampler.Sampler.stopSampling(Sampler.java:232)
at org.netbeans.modules.sampler.Sampler.stopAndWriteTo(Sampler.java:209)
at org.netbeans.modules.sampler.Test.stopSampling(Test.java:58)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
```
We shouldn't be calling into Swing in a library that is supposed to be used
in a headless environment. Removing the (almost useless) check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists