Elis Edlund created ROASTER-99:
----------------------------------
Summary: java comments can not be added with setBody()
Key: ROASTER-99
URL:
https://issues.jboss.org/browse/ROASTER-99
Project: Roaster
Issue Type: Bug
Components: JDT
Affects Versions: 2.18.3.Final
Reporter: Elis Edlund
Priority: Minor
public static void main(String[] args) {
JavaClassSource dst = Roaster.create(JavaClassSource.class);
dst.addMethod().setConstructor(true).setPrivate().setBody("//hidden");
dst.addMethod().setConstructor(true).setPrivate().setBody("super();//hidden");
System.out.println(dst);
//expected "private JavaClass() {\n//hidden\n}" but get "private
JavaClass() {\n}"
//alternative:
dst.addMethod().setConstructor(true).setPrivate().setBody("super();//hidden");
//expected "private JavaClass() {\nsuper();//hidden\n}" but get
"private JavaClass() {\nsuper();\n}"
}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)