Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Compiler warnings & "unnecessary suppress warnings"
Compiler warnings & "unnecessary suppress warnings" [message #258562] Tue, 10 February 2009 05:01 Go to next message
Eclipse UserFriend
Hi!

I have two installations of 3.4.1 (at work and at home) and they have the
same settings for the compiler warnings/errors.

The problem is that in one place I get the warnings ("restricted access"
and "possible null pointer", both on proper grounds), but in the other I
get "unnecessary suppressWarnings" for them (in the places where I added
those to get rid of the other warnings).

I can't find any difference between the two installations, have been
retrying with fresh ones and fresh workspaces and don't understand what is
different.

I hope this is the right place to ask and if not, please point me right.

best regards,
Vlad
Re: Compiler warnings & "unnecessary suppress warnings" [message #258587 is a reply to message #258562] Tue, 10 February 2009 11:21 Go to previous messageGo to next message
Eclipse UserFriend
"Vlad Dumitrescu" <vladdu55@gmail.com> wrote in message
news:ed11620f6de9cb91ac46e6e3d9fe2d3b$1@www.eclipse.org...
> Hi!
>
> I have two installations of 3.4.1 (at work and at home) and they have the
> same settings for the compiler warnings/errors.
>
> The problem is that in one place I get the warnings ("restricted access"
> and "possible null pointer", both on proper grounds), but in the other I
> get "unnecessary suppressWarnings" for them (in the places where I added
> those to get rid of the other warnings).
>
> I can't find any difference between the two installations, have been
> retrying with fresh ones and fresh workspaces and don't understand what is
> different.


The properties may be set at the workspace level or at the project level, so
make sure to check both.

It's possible that if you are running Eclipse on a different JRE some
functionality may be disabled on one platform and enabled on another, so
make sure (by checking Help -> About -> Software Configuration) that you're
using the same JRE.

You should also verify that the versions of the org.eclipse.jdt.* plug-ins
on both machines are exactly the same.

Can you post a specific code sample that gives a different warning?
Re: Compiler warnings & "unnecessary suppress warnings" [message #258595 is a reply to message #258587] Tue, 10 February 2009 13:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/10/2009 11:21 AM, Walter Harley wrote:
> "Vlad Dumitrescu"<vladdu55@gmail.com> wrote in message
> news:ed11620f6de9cb91ac46e6e3d9fe2d3b$1@www.eclipse.org...
>> Hi!
>>
>> I have two installations of 3.4.1 (at work and at home) and they have the
>> same settings for the compiler warnings/errors.
>>
>> The problem is that in one place I get the warnings ("restricted access"
>> and "possible null pointer", both on proper grounds), but in the other I
>> get "unnecessary suppressWarnings" for them (in the places where I added
>> those to get rid of the other warnings).
>>
>> I can't find any difference between the two installations, have been
>> retrying with fresh ones and fresh workspaces and don't understand what is
>> different.
>
>
> The properties may be set at the workspace level or at the project level, so
> make sure to check both.

I always set project-specific settings for projects that will be shared
(ie, checked in to CVS) because that is the only way to enforce the
rules. Otherwise you are at the mercy of the individual developers who
set their workspace settings to whatever.

Eric
Re: Compiler warnings & "unnecessary suppress warnings" [message #258601 is a reply to message #258587] Tue, 10 February 2009 15:43 Go to previous message
Eclipse UserFriend
Walter Harley wrote:

> "Vlad Dumitrescu" <vladdu55@gmail.com> wrote in message
>> I have two installations of 3.4.1 (at work and at home) and they have the
>> same settings for the compiler warnings/errors.
>>
>> The problem is that in one place I get the warnings ("restricted access"
>> and "possible null pointer", both on proper grounds), but in the other I
>> get "unnecessary suppressWarnings" for them (in the places where I added
>> those to get rid of the other warnings).

> The properties may be set at the workspace level or at the project level, so
> make sure to check both.

> It's possible that if you are running Eclipse on a different JRE some
> functionality may be disabled on one platform and enabled on another, so
> make sure (by checking Help -> About -> Software Configuration) that you're
> using the same JRE.

> You should also verify that the versions of the org.eclipse.jdt.* plug-ins
> on both machines are exactly the same.

Thank you for the suggestions!

I had checked those, and didn't see any difference.

I think I found the weirdness regarding the "discouraged access" warnings:
accessing a discouraged class gives a warning in that method and adding a
@SuppressWarnings removes it. But there is a warning for the import of
that class too and it only dissapears if a @SuppressWarnings is added to
the class -- but this makes the annotation on the method unnecessary, so
therefrom the other warning. Probably a "quick fix" added the class
annotation without me noticing.

I still have to investigate the warnings about the possible null pointer
access and its unnecessary annotation. Hopefully it's also me who messed
it up :-/

Thanks again!
best regards,
Vlad
Previous Topic:Problem with IJavaSearchScope
Next Topic:How to implement a feature of the content assistant of the java editor
Goto Forum:
  


Current Time: Thu Aug 21 06:13:45 EDT 2025

Powered by FUDForum. Page generated in 0.04443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top