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

The currently displayed page contains invalid values dialog #467

Closed
rnveach opened this issue Feb 3, 2023 · 4 comments
Closed

The currently displayed page contains invalid values dialog #467

rnveach opened this issue Feb 3, 2023 · 4 comments
Labels

Comments

@rnveach
Copy link
Member

rnveach commented Feb 3, 2023

While working on #454 ,

I guess I created an invalid configuration file. I got the following in the Problem View,

Description Resource Path Location Type
Checkstyle execution failed due to an internal error. Please check the error log for details... net.sf.eclipsecs.checkstyle Unknown Checkstyle Problem

When I right clicked on the problem and did properties I got this error dialog which made no sense:

Could Not Accept Changes

The currently displayed page contains invalid values.

The currently displayed page contains invalid values

I assume that dialog should not appear, and even still, I think there should be some way to communicate the error that Checkstyle provides without going to the Error view. I see the Error view as more a last resort when everything else has failed and it is some exception with the plugin.

The error I was getting turned out to be: Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property ${checkstyle.regexp.old.header.file} has not been set

While this is an error in Checkstyle, it should be more of an expected exception from the plugin that should be handled gracefully somehow.

@Bananeweizen
Copy link
Collaborator

Please post everything from the stacktrace of the error in the error log. That error is not really relevant, but rather where it occurred in the plugin code.

@rnveach
Copy link
Member Author

rnveach commented Feb 4, 2023

The following is when right clicking Checkstyle execution failed due to an internal error. and going to the properties dialog which is what this issue is about.

Error log:

Plugin: org.eclipse.jface

Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".

Exception Stack Trace:

java.lang.NullPointerException: Cannot invoke "net.sf.eclipsecs.core.config.meta.RuleMetadata.getGroup()" because "metaData" is null
	at net.sf.eclipsecs.ui.properties.marker.MarkerPropertyPage.createContents(MarkerPropertyPage.java:62)
	at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:244)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1433)
	at org.eclipse.jface.preference.PreferenceDialog$8.run(PreferenceDialog.java:1196)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1188)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:630)
	at org.eclipse.jface.preference.PreferenceDialog$5.lambda$0(PreferenceDialog.java:660)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
	at org.eclipse.jface.preference.PreferenceDialog$5.selectionChanged(PreferenceDialog.java:657)
	at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:821)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:818)
	at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1661)
	at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1090)
	at org.eclipse.jface.preference.PreferenceDialog.selectSavedItem(PreferenceDialog.java:990)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.selectSavedItem(FilteredPreferenceDialog.java:680)
	at org.eclipse.jface.preference.PreferenceDialog.lambda$0(PreferenceDialog.java:348)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
	at org.eclipse.jface.preference.PreferenceDialog.createContents(PreferenceDialog.java:345)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
	at org.eclipse.ui.internal.dialogs.PropertyDialog.createDialogOn(PropertyDialog.java:84)
	at org.eclipse.ui.internal.handlers.PropertyDialogHandler.execute(PropertyDialogHandler.java:47)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	at jdk.internal.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	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)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

@rnveach
Copy link
Member Author

rnveach commented Feb 4, 2023

new Label(composite, SWT.NONE).setText(metaData.getGroup().getGroupName());

It looks like the issue with the exception is we are trying to display the properties of Checkstyle execution failed due to an internal error. as a Checkstyle violation when it is actually more akin to a configuration error.

We should be displaying this in its own custom dialog, or disable violation related fields (Group, module, etc..) on the current dialog, as it most likely won't have that kind of information.

@Bananeweizen
Copy link
Collaborator

fixed with #679.

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

No branches or pull requests

2 participants