You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/09/06 13:12:17 UTC

svn commit: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Author: markt
Date: Tue Sep  6 11:12:17 2011
New Revision: 1165601

URL: http://svn.apache.org/viewvc?rev=1165601&view=rev
Log:
Add another 3.7+ note

Modified:
    tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Modified: tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1165601&r1=1165600&r2=1165601&view=diff
==============================================================================
--- tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt (original)
+++ tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt Tue Sep  6 11:12:17 2011
@@ -50,6 +50,7 @@ Unnecessary code
    (all additional check boxes)
 Generic types
  - All                                  - W
+   (ignore unavoidable generics warnings)   (Eclipse 3.7+)
 Annotations
  - All                                  - W
    (all additional check boxes)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/16  <ma...@apache.org>:
> markt@apache.org wrote:
>
>>Konstantin Kolinko <kn...@gmail.com> wrote:
>>
>>>2011/9/6  <ma...@apache.org>:
>>>> Author: markt
>>>> Date: Tue Sep  6 11:12:17 2011
>>>> New Revision: 1165601
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1165601&view=rev
>>>> Log:
>>>> Add another 3.7+ note
>>>>
>>>> Modified:
>>>>
>>> tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>>>>
>>>> @@ -50,6 +50,7 @@
>>>>  Generic types
>>>>  - All                                  - W
>>>> +   (ignore unavoidable generics warnings)   (Eclipse 3.7+)
>>>
>>>What value do you mean for that checkbox?
>>> [ ] or [x] Ignore unavoidable generic type problems
>>
>>Checked.
>>
>>>My setting was "[ ]".
>>>
>>>When I changed it to "[x]" I got +11 more warnings than before
>>>(Those are "Unnecessary @SuppressWarnings("unchecked")").
>>
>>Same here.
>>
>>>As far as I do not grasp what those "unavoidable" problems are, I have
>>>slight preference to keep it as "[ ]".
>>
>>My preference was for checked since it would allow me to delete some
>>stuff. I haven't got around to that yet.
>>

Looking at what warnings this flag suppresses, I start to like it.
But, the compiler in Oracle JDK 6 is not so clever.

When building with build.xml as is, it prints a warning that problems are there:
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

If I add  <compilerarg value="-Xlint:unchecked"/>, it lists all those warnings,
and it can be seen that those are the ones that are ignored by Eclipse
if this "Ignore unavoidable generic type problems" flag is enabled.
E.g. in AbstractReplicatedMap class.

I have some hope that if all those places will be marked with
@SuppressWarnings("unchecked") then javac warning will disappear.

The "ignore unavoidable .. problems" flag makes finding and fixing
them a bit harder.
It confirms my preference for having it turned off.


For information, some examples of these are the generic type problems
that are suppressed by this flag:
1) Documentation in Eclipse mentions the following:
[[[
As an example, a type may be forced to use raw types in its method
signatures and return types because the methods it overrides from a
super type are declared to use raw types in the first place.
]]]

Sounds like the code in ExpressionEvaluatorImpl, that extends old
deprecated class from JSP EL API. The API that it implements does not
use generics.

2) Casting from Object to a generic type.
This conversion is itself unchecked by its nature, so it cannot be avoided.
E.g. (in AbstractHttp11Processor):

            @SuppressWarnings("unchecked")
            AbstractInputBuffer<S> internalBuffer = (AbstractInputBuffer<S>)
                request.getInputBuffer();

or (in VariableMapperImpl):

    @SuppressWarnings("unchecked")
    @Override
    public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
        this.vars = (Map<String, ValueExpression>) in.readObject();
    }

3) Implementation details when non-generics class extends generics class:
e.g. AbstractReplicatedMap.
This is not much, because the warnings are already there. If the flag
is unchecked there are just twice more warnings there.
Either annotating the whole class with @SuppressWarnings, or changing
its implementation to use genetics would be a solution here,
regardless of the flag.


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Posted by ma...@apache.org.
markt@apache.org wrote:

>Konstantin Kolinko <kn...@gmail.com> wrote:
>
>>2011/9/6  <ma...@apache.org>:
>>> Author: markt
>>> Date: Tue Sep  6 11:12:17 2011
>>> New Revision: 1165601
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1165601&view=rev
>>> Log:
>>> Add another 3.7+ note
>>>
>>> Modified:
>>>  
>> tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>>>
>>> Modified:
>>tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>>> URL:
>>http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1165601&r1=1165600&r2=1165601&view=diff
>>>
>>
>>> @@ -50,6 +50,7 @@ Unnecessary code
>>>    (all additional check boxes)
>>>  Generic types
>>>  - All                                  - W
>>> +   (ignore unavoidable generics warnings)   (Eclipse 3.7+)
>>
>>What value do you mean for that checkbox?
>> [ ] Ignore unavoidable generic type problems
>>or
>> [x] Ignore unavoidable generic type problems
>
>Checked.
>
>>My setting was "[ ]".
>>
>>When I changed it to "[x]" I got +11 more warnings than before
>>(Those are "Unnecessary @SuppressWarnings("unchecked")").
>
>Same here.
>
>>As far as I do not grasp what those "unavoidable" problems are, I have
>>slight preference to keep it as "[ ]".
>
>My preference was for checked since it would allow me to delete some
>stuff. I haven't got around to that yet.
>
>>BTW, this change has not been applied to 7.0.x copy of
>>java-compiler-errors-warnings.txt yet.
>
>That was deliberate as this was new in 3.7. I wanted to see how things
>Lambert out. Also I didn't want to create warnings in 7.0.x for those
>still using Eclipse 3.7.

"worked out". How the autocorrect and I got that wrong between us I have no idea.

Mark

>
>Mark
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: dev-help@tomcat.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Posted by ma...@apache.org.
Konstantin Kolinko <kn...@gmail.com> wrote:

>2011/9/6  <ma...@apache.org>:
>> Author: markt
>> Date: Tue Sep  6 11:12:17 2011
>> New Revision: 1165601
>>
>> URL: http://svn.apache.org/viewvc?rev=1165601&view=rev
>> Log:
>> Add another 3.7+ note
>>
>> Modified:
>>  
> tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>>
>> Modified:
>tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>> URL:
>http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1165601&r1=1165600&r2=1165601&view=diff
>>
>
>> @@ -50,6 +50,7 @@ Unnecessary code
>>    (all additional check boxes)
>>  Generic types
>>  - All                                  - W
>> +   (ignore unavoidable generics warnings)   (Eclipse 3.7+)
>
>What value do you mean for that checkbox?
> [ ] Ignore unavoidable generic type problems
>or
> [x] Ignore unavoidable generic type problems

Checked.

>My setting was "[ ]".
>
>When I changed it to "[x]" I got +11 more warnings than before
>(Those are "Unnecessary @SuppressWarnings("unchecked")").

Same here.

>As far as I do not grasp what those "unavoidable" problems are, I have
>slight preference to keep it as "[ ]".

My preference was for checked since it would allow me to delete some stuff. I haven't got around to that yet.

>BTW, this change has not been applied to 7.0.x copy of
>java-compiler-errors-warnings.txt yet.

That was deliberate as this was new in 3.7. I wanted to see how things Lambert out. Also I didn't want to create warnings in 7.0.x for those still using Eclipse 3.7.

Mark




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r1165601 - /tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/6  <ma...@apache.org>:
> Author: markt
> Date: Tue Sep  6 11:12:17 2011
> New Revision: 1165601
>
> URL: http://svn.apache.org/viewvc?rev=1165601&view=rev
> Log:
> Add another 3.7+ note
>
> Modified:
>    tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
>
> Modified: tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt
> URL: http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?rev=1165601&r1=1165600&r2=1165601&view=diff
>

> @@ -50,6 +50,7 @@ Unnecessary code
>    (all additional check boxes)
>  Generic types
>  - All                                  - W
> +   (ignore unavoidable generics warnings)   (Eclipse 3.7+)

What value do you mean for that checkbox?
 [ ] Ignore unavoidable generic type problems
or
 [x] Ignore unavoidable generic type problems

My setting was "[ ]".

When I changed it to "[x]" I got +11 more warnings than before
(Those are "Unnecessary @SuppressWarnings("unchecked")").

As far as I do not grasp what those "unavoidable" problems are, I have
slight preference to keep it as "[ ]".

BTW, this change has not been applied to 7.0.x copy of
java-compiler-errors-warnings.txt yet.

>  Annotations
>  - All                                  - W
>    (all additional check boxes)

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org