diff --git a/pmd-netbeans/src/pmd/PMDOutputListener.java b/pmd-netbeans/src/pmd/PMDOutputListener.java index 577f607d04..61c4c73a69 100644 --- a/pmd-netbeans/src/pmd/PMDOutputListener.java +++ b/pmd-netbeans/src/pmd/PMDOutputListener.java @@ -75,7 +75,11 @@ public class PMDOutputListener implements OutputListener { */ public void outputLineAction(OutputEvent outputEvent) { PMDAnnotation.clearAll(); - DataObject object = FaultRegistry.getInstance().getDataObject( outputEvent.getLine() ); + String l = outputEvent.getLine(); + if (l.charAt(l.length()-1) == '\n') { + l = l.substring(0, l.length()-1); + } + DataObject object = FaultRegistry.getInstance().getDataObject( l ); LineCookie cookie = ( LineCookie )object.getCookie( LineCookie.class ); Set lineset = cookie.getLineSet(); int lineNum = Fault.getLineNum( outputEvent.getLine() );