eclipse.platform.ui icon indicating copy to clipboard operation
eclipse.platform.ui copied to clipboard

Do not show error popup when build fails

Open laeubi opened this issue 3 years ago • 25 comments

Recently I started to get some disturbing error popups because of the Checkstyle not working well with Java 17(?).

Even though the plugin needs to get fixed, the error popup is very disturbing to the user (and actually not helpful at all), I can think of the following, less disturbing actions:

  1. just write the problem to the error log (as it is already done)
  2. add an error marker to the project that for example has a quick-fix to remove the faulty builder from the project.

For reference here is the stack-trace I could extract from the error log, and the popup

grafik

java.lang.reflect.InaccessibleObjectException: Unable to make field private static volatile java.net.Authenticator java.net.Authenticator.theAuthenticator accessible: module java.base does not "opens java.net" to unnamed module @41cbb14f
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at net.sf.eclipsecs.core.config.configtypes.RemoteConfigurationType$RemoteConfigAuthenticator.getDefault(RemoteConfigurationType.java:376)
	at net.sf.eclipsecs.core.config.configtypes.RemoteConfigurationType.getCheckstyleConfiguration(RemoteConfigurationType.java:99)
	at net.sf.eclipsecs.core.config.CheckConfiguration.getCheckstyleConfiguration(CheckConfiguration.java:161)
	at net.sf.eclipsecs.core.builder.CheckerFactory.getCacheKey(CheckerFactory.java:157)
	at net.sf.eclipsecs.core.builder.CheckerFactory.createChecker(CheckerFactory.java:99)
	at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:139)
	at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:307)
	at net.sf.eclipsecs.core.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:173)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

laeubi avatar Jan 05 '23 09:01 laeubi

Let us break each exception into their own issue.

yeekangc avatar May 29 '23 13:05 yeekangc

Thanks for breaking out the issues, @turkeylurkey!

yeekangc avatar May 29 '23 13:05 yeekangc

Need to determine how pervasive this issue is.

yeekangc avatar May 29 '23 13:05 yeekangc

In my testing with VSCode using the latest driver dated May 29th, liberty-dev-vscode-ext-23.0.6-SNAPSHOT.vsix, I was not able to recreate this exception.

rumanaHaque avatar May 31 '23 16:05 rumanaHaque

Simply adding the @Resource annotation to a class consistently recreates this error. I was able to hit this with the 23.0.6 driver on Mac and Linux.

image

dshimo avatar May 31 '23 18:05 dshimo

Is this stop ship?

cherylking avatar May 31 '23 20:05 cherylking

With @dshimo's help, I was also able to reproduce in my env. image

rumanaHaque avatar May 31 '23 20:05 rumanaHaque

Adding @Resource causes a diagnostic which uses ScopeDeclarationQuickFix. This quick fix uses diagnostic.getData() which returns null and causes the NPE. Caused by https://github.com/microsoft/vscode/issues/181166

turkeylurkey avatar Jun 05 '23 16:06 turkeylurkey