Project: clover
Issue CLOV-1131: Unicode CR/LF characters in javadoc causes Eclipse/IntelliJ editors get out of sync
Try the following example: {code:java} class Unicode { void foo() {	System.out.println("1");	/** {@code \u000a} LF */ } void goo() {	System.out.println("2");	/** {@code \u000d} CR */ } void hoo() {	System.out.println("3"); } } // end {code} In Eclipse editor, every CR/LF written in unicode causes that it interprets it as newline character. As a result left ruler "sees" more lines and all subsequent coverage blocks are shifted down. In IntelliJ it's even worse, as we get exception. Stack trace: {noformat} Error during dispatching of java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=com.cenqua.clover.idea.content.ContentPlugin$1@789e7511,notifier=null,catchExceptions=false,when=1343648365649] on sun.awt.windows.WToolkit@2018aa27: Wrong end: 270; document length=249; start=246 java.lang.IllegalArgumentException: Wrong end: 270; document length=249; start=246 com.intellij.openapi.editor.impl.RangeMarkerImpl.(RangeMarkerImpl.java:47) com.intellij.openapi.editor.impl.DocumentImpl.createRangeMarker(DocumentImpl.java:303) com.intellij.openapi.editor.impl.RangeHighlighterImpl.(RangeHighlighterImpl.java:58) com.intellij.openapi.editor.impl.MarkupModelImpl.a(MarkupModelImpl.java:119) com.intellij.openapi.editor.impl.MarkupModelImpl.addRangeHighlighter(MarkupModelImpl.java:135) com.cenqua.clover.idea.content.DocMarkupPlugin$HighlightMarkupBuilder.highlightStatement(DocMarkupPlugin.java:286) com.cenqua.clover.idea.content.DocMarkupPlugin$HighlightMarkupBuilder.process(DocMarkupPlugin.java:220) com.cenqua.clover.idea.content.DocMarkupPlugin.updateMarkups(DocMarkupPlugin.java:136) com.cenqua.clover.idea.content.DocMarkupPlugin.refresh(DocMarkupPlugin.java:424) com.cenqua.clover.idea.content.ContentPlugin$1.run(ContentPlugin.java:96) java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646) java.awt.EventQueue.access$000(EventQueue.java:84) java.awt.EventQueue$1.run(EventQueue.java:607) java.awt.EventQueue$1.run(EventQueue.java:605) java.security.AccessController.doPrivileged(Native Method) java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) java.awt.EventQueue.dispatchEvent(EventQueue.java:616) com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:627) com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:508) com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405) com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369) java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) java.awt.EventDispatchThread.run(EventDispatchThread.java:122) {noformat}
Story points: 2