Home » Modeling » TMF (Xtext) » avoid @SuppressWarnings("all") in Xtend batch compiler
| |
Re: avoid @SuppressWarnings("all") in Xtend batch compiler [message #1433949 is a reply to message #1433874] |
Mon, 29 September 2014 12:58   |
Eclipse User |
|
|
|
On 29/09/2014 12:58, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> there is currently no generic way to disable that for Xtend. You can use
> another GeneratorConfig for your own languages but Xtend will generate
> @SuppressWarnings if no user-defined @SuppressWarnings is present.
>
> Best,
> Sebastian
Hi Sebastian
I tried to write this Xtend class
@SuppressWarnings("serial")
class XtendGreeting {
def greeting() {
"Hello, world."
}
def useEquals() {
// 2 findbugs issues:
// findbugs:DM_NUMBER_CTOR
// findbugs:EC_UNRELATED_TYPES
new Integer(0).equals("foo");
}
}
but the generated Java class still shows as follows:
@SuppressWarnings("all")
public class XtendGreeting {
public String greeting() {
return "Hello, world.";
}
public boolean useEquals() {
Integer _integer = new Integer(0);
return _integer.equals("foo");
}
}
am I missing something?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
|
|
|
Re: avoid @SuppressWarnings("all") in Xtend batch compiler [message #1433959 is a reply to message #1433949] |
Mon, 29 September 2014 13:18   |
Eclipse User |
|
|
|
Hmm obviously I'm the one who missed something. I expected it to use
your explicitly suppressed warnings, but apparently it doesn't work.
Could you please file a ticket and describe why you want to suppress the
suppress warnings annotation?
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 29.09.14 14:58, schrieb Lorenzo Bettini:
> On 29/09/2014 12:58, Sebastian Zarnekow wrote:
>> Hi Lorenzo,
>>
>> there is currently no generic way to disable that for Xtend. You can use
>> another GeneratorConfig for your own languages but Xtend will generate
>> @SuppressWarnings if no user-defined @SuppressWarnings is present.
>>
>> Best,
>> Sebastian
>
> Hi Sebastian
>
> I tried to write this Xtend class
>
> @SuppressWarnings("serial")
> class XtendGreeting {
>
> def greeting() {
> "Hello, world."
> }
>
> def useEquals() {
> // 2 findbugs issues:
> // findbugs:DM_NUMBER_CTOR
> // findbugs:EC_UNRELATED_TYPES
> new Integer(0).equals("foo");
> }
> }
>
> but the generated Java class still shows as follows:
>
> @SuppressWarnings("all")
> public class XtendGreeting {
> public String greeting() {
> return "Hello, world.";
> }
>
> public boolean useEquals() {
> Integer _integer = new Integer(0);
> return _integer.equals("foo");
> }
> }
>
> am I missing something?
>
> cheers
> Lorenzo
>
|
|
| | | | |
Goto Forum:
Current Time: Sat Feb 15 01:32:13 GMT 2025
Powered by FUDForum. Page generated in 0.06611 seconds
|