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

Error when try to import rule set #24

Open
netoec84 opened this issue May 30, 2017 · 2 comments
Open

Error when try to import rule set #24

netoec84 opened this issue May 30, 2017 · 2 comments
Labels

Comments

@netoec84
Copy link

Steps:

  1. Windows -> Preferences -> PMD -> Rule Configuration
  2. Check "Use global rule management"
  3. Delete all rules
  4. Click "Import rule set" button
  5. Browse and select file. (ERROR)

Log:

eclipse.buildId=4.6.3.M20170301-0400
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=es_EC
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -data file:/E:/jose/workspace_neon/ -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.ui
Error
Tue May 30 16:34:03 COT 2017
Unhandled event loop exception

java.lang.IllegalArgumentException: Unable to exclude rules [EmptyCatchBlock]; perhaps the rule name is mispelled?
at net.sourceforge.pmd.RuleSetFactory.parseRuleSetReferenceNode(RuleSetFactory.java:465)
at net.sourceforge.pmd.RuleSetFactory.parseRuleNode(RuleSetFactory.java:405)
at net.sourceforge.pmd.RuleSetFactory.parseRuleSetNode(RuleSetFactory.java:357)
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:212)
at net.sourceforge.pmd.RuleSetFactory.createRuleSet(RuleSetFactory.java:207)
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java:168)
at net.sourceforge.pmd.RuleSetFactory.createRuleSets(RuleSetFactory.java:152)
at net.sourceforge.pmd.eclipse.ui.preferences.RuleSetSelectionDialog.selectedRuleset(RuleSetSelectionDialog.java:430)
at net.sourceforge.pmd.eclipse.ui.preferences.RuleSetSelectionDialog.updateRuleTable(RuleSetSelectionDialog.java:388)
at net.sourceforge.pmd.eclipse.ui.preferences.RuleSetSelectionDialog.ruleSetChanged(RuleSetSelectionDialog.java:325)
at net.sourceforge.pmd.eclipse.ui.preferences.RuleSetSelectionDialog.access$3(RuleSetSelectionDialog.java:324)
at net.sourceforge.pmd.eclipse.ui.preferences.RuleSetSelectionDialog$5.widgetSelected(RuleSetSelectionDialog.java:284)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at net.sourceforge.pmd.eclipse.ui.preferences.br.RuleTableManager$7.widgetSelected(RuleTableManager.java:428)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
at org.eclipse.jface.window.Window.open(Window.java:794)
at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:211)
at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:63)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

@adangel adangel added the bug label Jun 5, 2017
@adangel
Copy link
Member

adangel commented Jun 5, 2017

@netoec84 Thanks for reporting this bug.
Could you please add the ruleset.xml here, that you tried to import? It seems, it uses "<exclude>EmptyCatchBlock</exclude>" somewhere which causes a problem. This rule is not anymore in the java-basic ruleset and should be excluded from java-empty ruleset.

@netoec84
Copy link
Author

netoec84 commented Jun 5, 2017

@adangel Thank you for reply.

Yes, exclude is include in xml file.

No work

<rule ref="rulesets/java/basic.xml">
<exclude name="EmptyCatchBlock"/>
</rule>

Work

<rule ref="rulesets/java/basic.xml">
</rule>

Maybe, you can add a control to catch the Exception.

Thank you.

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