From 5469fdc0cd59ff1d76877cf1c159d8f38a6a300a Mon Sep 17 00:00:00 2001 From: Radim Kubacki Date: Tue, 21 Dec 2004 21:40:42 +0000 Subject: [PATCH] output lines are ended with newline in 4.x git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3100 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd-netbeans/src/pmd/PMDOutputListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() );