- Revision
- 739
- Author
- rfscholte
- Date
- 2010-09-06 15:07:18 -0500 (Mon, 06 Sep 2010)
Log Message
Fix for QDOX-218: Handling double escaped String
Modified Paths
Diff
Modified: trunk/qdox/src/grammar/parser.y (738 => 739)
--- trunk/qdox/src/grammar/parser.y 2010-08-02 16:33:28 UTC (rev 738) +++ trunk/qdox/src/grammar/parser.y 2010-09-06 20:07:18 UTC (rev 739) @@ -689,9 +689,6 @@ value = 0; } } - else if(ch == '\\') { - escaped = true; - } else if(escaped) { if(ch == 'u' || ch == 'U') { unicode = 4; @@ -741,6 +738,9 @@ escaped = false; } + else if(ch == '\\') { + escaped = true; + } else { buf.append( ch ); }
Modified: trunk/qdox/src/test/com/thoughtworks/qdox/AnnotationsTest.java (738 => 739)
--- trunk/qdox/src/test/com/thoughtworks/qdox/AnnotationsTest.java 2010-08-02 16:33:28 UTC (rev 738) +++ trunk/qdox/src/test/com/thoughtworks/qdox/AnnotationsTest.java 2010-09-06 20:07:18 UTC (rev 739) @@ -255,4 +255,12 @@ AnnotationFieldRef suppressWarnings = (AnnotationFieldRef) method.getAnnotations()[0].getProperty( "value" ); assertEquals( builder.getClasses()[0].getFields()[0], suppressWarnings.getField()); } + + public void testDoubleEscapedString() throws Exception { + JavaDocBuilder builder = new JavaDocBuilder(); + String source = "public class Foo {\n" + + "@SuppressWarnings({\"abc\\\\d\"})\n" + + "private void bar() { } }"; + builder.addSource( new StringReader(source) ); + } }
To unsubscribe from this list please visit:
