[JBoss JIRA] (ROASTER-99) java comments can not be added with setBody()
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-99?page=com.atlassian.jira.plugin... ]
George Gastaldi closed ROASTER-99.
----------------------------------
Fix Version/s: (was: 2.x Future)
Resolution: Duplicate Issue
Duplicate of ROASTER-26
> 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
>
> {code:java}
> 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}"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ROASTER-91) Add JavaInterfaceMethodImpl class
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-91?page=com.atlassian.jira.plugin... ]
George Gastaldi closed ROASTER-91.
----------------------------------
Fix Version/s: 2.18.4.Final
Resolution: Done
Fixed. Thank you!
> Add JavaInterfaceMethodImpl class
> ---------------------------------
>
> Key: ROASTER-91
> URL: https://issues.jboss.org/browse/ROASTER-91
> Project: Roaster
> Issue Type: Bug
> Affects Versions: 2.18.0.Final
> Reporter: Nicolas Challut
> Assignee: Nicolas Challut
> Fix For: 2.18.4.Final
>
>
> method "bar" should be overrided in javaClass but it is empty.
> While searching in the code, I found that :
> {code}
> for (Method method : source.getMethods())
> {
> if (method.isAbstract() && !target.hasMethod(method))
> {
> {code}
> It seems that in JavaInterfaceSource the method aren't abstract by default (in the standars, interface method is abstract, key word is redundant).
> So, I see 2 ways to resolve this :
> # Change JavaInterface implementation to set all method abstract without add the key word
> # Change Methods#implementAbstractMethod() to handle JavaInterfaceSource type (if source instance of JavaInterfaceSource, addAll() )
> What do you guys think about it ?
> UPDATE 21/01 : We could add a new class which extend MethodImpl to handle special behavior of interface.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ROASTER-91) Add JavaInterfaceMethodImpl class
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-91?page=com.atlassian.jira.plugin... ]
George Gastaldi reopened ROASTER-91:
------------------------------------
On a second thought, implements interface won't work as mentioned in the Steps to Reproduce section. Reopening the issue
> Add JavaInterfaceMethodImpl class
> ---------------------------------
>
> Key: ROASTER-91
> URL: https://issues.jboss.org/browse/ROASTER-91
> Project: Roaster
> Issue Type: Bug
> Affects Versions: 2.18.0.Final
> Reporter: Nicolas Challut
> Assignee: Nicolas Challut
>
> method "bar" should be overrided in javaClass but it is empty.
> While searching in the code, I found that :
> {code}
> for (Method method : source.getMethods())
> {
> if (method.isAbstract() && !target.hasMethod(method))
> {
> {code}
> It seems that in JavaInterfaceSource the method aren't abstract by default (in the standars, interface method is abstract, key word is redundant).
> So, I see 2 ways to resolve this :
> # Change JavaInterface implementation to set all method abstract without add the key word
> # Change Methods#implementAbstractMethod() to handle JavaInterfaceSource type (if source instance of JavaInterfaceSource, addAll() )
> What do you guys think about it ?
> UPDATE 21/01 : We could add a new class which extend MethodImpl to handle special behavior of interface.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ROASTER-99) java comments can not be added with setBody()
by George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/ROASTER-99?page=com.atlassian.jira.plugin... ]
George Gastaldi updated ROASTER-99:
-----------------------------------
Fix Version/s: 2.x Future
> 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
> Fix For: 2.x Future
>
>
> {code:java}
> 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}"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ROASTER-99) java comments can not be added with setBody()
by Elis Edlund (JIRA)
[ https://issues.jboss.org/browse/ROASTER-99?page=com.atlassian.jira.plugin... ]
Elis Edlund updated ROASTER-99:
-------------------------------
Description:
{code:java}
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}"
}
{code}
was:
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}"
}
> 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
>
> {code:java}
> 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}"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months
[JBoss JIRA] (ROASTER-99) java comments can not be added with setBody()
by Elis Edlund (JIRA)
[ https://issues.jboss.org/browse/ROASTER-99?page=com.atlassian.jira.plugin... ]
Elis Edlund updated ROASTER-99:
-------------------------------
Description:
{code:java}
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}"
}
{code}
was:
{code:java}
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}"
}
{code}
> 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
>
> {code:java}
> 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}"
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 10 months