
findbugs - issue #8
[Eclipse plugin] Exceptions and missing line info for inner member classes and for fields
This is a cumulative patch/bug report for 3 issues.
1) AS IS: Bugs which are in inner member classes (named classes which are declared inside of method body of another class) leads to NumberFormatExceptions in FindBugs plugins, so that they are not reported and not visible in Eclipse at all.
Exemple from Eclipse log:
java.lang.NumberFormatException: For input string: "1MyRunnable" at java.lang.NumberFormatException.forInputString(NumberFormatException.jav a:48) at java.lang.Integer.parseInt(Integer.java:456) at java.lang.Integer.parseInt(Integer.java:497) at de.tobject.findbugs.reporter.MarkerUtil.findChildSourceLine(MarkerUtil.j ava:249) at de.tobject.findbugs.reporter.MarkerUtil.completeInnerClassInfo(MarkerUti l.java:195) at de.tobject.findbugs.reporter.MarkerUtil.getUnderlyingResource(MarkerUtil .java:176) at de.tobject.findbugs.reporter.MarkerUtil.createMarker(MarkerUtil.java:93) at de.tobject.findbugs.reporter.Reporter.doReportBug(Reporter.java:111)
TO BE: no exception, bug is propely reported
2) AS IS: Bug markers which are in inner classes are not always shown in editor, because FindBugs plugin may use -1 as a source location (if the line was not reported in the bug), so that Eclipse shows the bug in the Problems view but not in the editor (editor lines starts with 1).
TO BE: bug is propely reported in editor too
3) AS IS: Bug markers for fields which shown in the Problems view are never at the right location in the editor, because this info is not available in the bug instance.
TO BE: bug is propely reported in editor too
Seen with the latest FindBugs from SVN with Eclipse 3.2.2 and JDK 1.5
Please use the patch attached below to fix all three problems.
- MarkerUtil.java.patch 8.19KB
Comment #1
Posted on Nov 17, 2006 by Helpful Wombatcommitted your patch to SVN, with one change to avoid a NullPointerException
Status: Fixed
Labels:
Type-Defect
Priority-Medium