Domanda

I have installed CheckStyle plugin in Eclipse. I am using Eclipse Helios (Version 3.6).

Eclipse and CheckStyle details are as following

Eclipse ::
    Version :  Helios (3.6)

CheckStyle ::
    Version : 5.6.1.201306282206
    ID : net.sf.eclipsecs.feature.group

I am able to configure rules successfully from - Project > Properties > CheckStyle.

But, when I'm trying to configure from - Window > Preferences > CheckStyle, it is firing an error like following:

An error has occurred. See error log for more details.
INSTANCE

However any changes in rule configuration is saved.

Problem is, if I check any box like Include rule names in violation messages or Include module ID, the change is not getting saved.

Is there a way to resolve this issue? If not, can anyone share the link of latest stable version of CheckStyle?

I am putting the stackTrace if this can help anyway

=====StackTrace=====

java.lang.NoSuchFieldError: INSTANCE
    at net.sf.eclipsecs.core.CheckstylePluginPrefs.setBoolean(CheckstylePluginPrefs.java:128)
    at net.sf.eclipsecs.ui.preferences.CheckstylePreferencePage.performOk(CheckstylePreferencePage.java:357)
    at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:964)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:944)
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:447)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.okPressed(WorkbenchPreferenceDialog.java:169)
    at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:233)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
    at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
È stato utile?

Soluzione 2

It looks like it is a checkstyle 5.6.1 bug: http://sourceforge.net/p/eclipse-cs/bugs/357/

When we upgrade to 5.6.1 in Eclipse 3.6.2 we get the following error in the Checkstyle preference page. When we switch to 5.6.0 it works without errors.

java.lang.NoSuchFieldError: org/eclipse/core/runtime/preferences/InstanceScope.INSTANCE
    at net.sf.eclipsecs.core.CheckstylePluginPrefs.setBoolean(CheckstylePluginPrefs.java:128)

Altri suggerimenti

This is a Open Bug of CheckStyle 5.6.1 on Eclipse 3.6.2

Downgrade to CheckStyle 5.6.0 from CheckStyle > Eclipse CheckStyle Plugin > 5.6.0

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top