Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.5
-
None
Description
Single and double quotes when mixed in Groovy strings within annotations are not translated correctly into Java strings in generated stubs. Internal quotes are not escaped.
This issue is related to GROOVY-4470. I used the same source code to demonstrate it.
StringAnno.groovy
@interface StringAnno { String val() }
StringAnnoUser.groovy
@StringAnno(val = 'single quote string with "double quote string"') class StringAnnoUser {}
StringAnnoUser.java (generated stub)
import java.lang.*; import java.io.*; import java.net.*; import java.util.*; import groovy.lang.*; import groovy.util.*; @StringAnno(val="single quote string with "double quote string"") public class StringAnnoUser extends java.lang.Object implements groovy.lang.GroovyObject { public StringAnnoUser () {} public groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;} public void setMetaClass(groovy.lang.MetaClass mc) { } public java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;} public java.lang.Object getProperty(java.lang.String property) { return null;} public void setProperty(java.lang.String property, java.lang.Object value) { } }
Attachments
Issue Links
- depends upon
-
GROOVY-4604 Stub generator doesn't escape double quotes in String annotation values
- Closed
- is depended upon by
-
GROOVY-4470 Stub generator cannot handle multi-line strings as annotation values
- Closed