Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.eclipse.swtchart.extensions bundle activation prints unnecessary exception to syserr #380

Closed
tvlehton opened this issue Jan 29, 2024 · 1 comment · Fixed by #381
Closed

Comments

@tvlehton
Copy link
Contributor

Problem

Every time bundle org.eclipse.swtchart.extensions is activated, it will print out the following exception stack trace for failed loading of .eclipseswtchartsettings from the user's home directory.

java.io.FileNotFoundException: C:\Users\MyUserName\.eclipseswtchartsettings (The system cannot find the file specified)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
	at org.eclipse.jface.preference.PreferenceStore.load(PreferenceStore.java:367)
	at org.eclipse.swtchart.extensions.core.ResourceSupport.getPreferenceStore(ResourceSupport.java:102)
	at org.eclipse.swtchart.extensions.internal.mappings.MappingsIO.restoreSettings(MappingsIO.java:101)
	at org.eclipse.swtchart.extensions.Activator.start(Activator.java:42)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:813)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:805)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:762)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1032)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:371)
	at org.eclipse.osgi.container.Module.doStart(Module.java:605)
	at org.eclipse.osgi.container.Module.start(Module.java:468)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:513)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:397)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:484)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at myproduct.MyEditor(MyEditor.java:line)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:96)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
...

The print comes from https://github.com/eclipse/swtchart/blame/9b90a7cf89cfabb37bb977fe4b24d13f56880d52/org.eclipse.swtchart.extensions/src/org/eclipse/swtchart/extensions/core/ResourceSupport.java#L117 and it was introduced in cce835a of #280.

Expected outcome

I personally feel that it is pointless to print the exception stack trace when the file does not exist, i.e. upon FileNotFoundException, as seen in the stack trace above. Any other IOException is probably worth printing out.

@tvlehton tvlehton changed the title Resource ResourceSupport.getPreferenceStore throws unnecessary exception Jan 29, 2024
@tvlehton tvlehton changed the title ResourceSupport.getPreferenceStore throws unnecessary exception ResourceSupport.getPreferenceStore prints unnecessary exception to syserr Jan 29, 2024
@tvlehton tvlehton changed the title ResourceSupport.getPreferenceStore prints unnecessary exception to syserr org.eclipse.swtchart.extensions bundle activation prints unnecessary exception to syserr Jan 29, 2024
tvlehton added a commit to tvlehton/swtchart that referenced this issue Jan 29, 2024
No exception printing when ~/.eclipseswtchartsettings does not exist.
tvlehton added a commit to tvlehton/swtchart that referenced this issue Jan 29, 2024
No exception printing when ~/.eclipseswtchartsettings does not exist.

Signed-off-by: Tuukka Lehtonen <[email protected]>
@Mailaender
Copy link
Contributor

This is still a problem flathub/com.lablicate.OpenChrom#9. The error message is really spammy. You can't see anything else printed before because it repeats so many times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants