On Jul 29, 2013, at 2:40 PM, Mark Thomas wrote:

> On 29/07/2013 21:04, Nick Williams wrote:
>> On Jul 29, 2013, at 2:02 PM, Jeremy Boynes wrote:
>> 
>>> This flags as a warning for me in IDEA without the suppression. Isn't this
>>> an unchecked cast (Object to List<String>)?
> 
> It is an unchecked cast but there is no way to avoid the cast so there
> is no point the IDE flagging it as there is nothing the developer can do
> to fix it. Eclipse added an option (Ignore unavoidable generic type
> problems) not to flag issues such as this as of a recent(ish) version.
> 
>> Yes, that's an unchecked cast. The @SuppressWarnings was not unnecessary.
> 
> Yes, it is unchecked cast. However, the warning is pointless and
> shouldn't have been generated in the first place.
> 
> The Tomcat 8 code base should not exhibit any warnings with the defined
> Eclipse settings [1]. Ditto for FindBugs and Checkstyle with the
> provided configurations.

Shouldn't it also not exhibit any warnings when compiled by the JDK? "Some 
classes use unchecked or unsafe operations" is not something I want to see when 
compiling code. Remember Eclipse is just what some developers use. Other 
developers use other IDEs, and all IDEs have settings that can be argued 
for/against. The JDK, however, is what everyone uses to compile production 
code, ultimately, and it says that line is unchecked. 
@SuppressWarnings("unchecked") means, to me, "Someone has taken the time to 
look closely at this line and confirm that, indeed, it isn't problematic." Now 
I see that line of code after my compiler warns me and I say, "Oops, might this 
be a problem?"

N

> 
> The intention is to add additional checks over time although we haven't
> added any for a while.
> 
> Mark
> 
> http://svn.apache.org/viewvc/tomcat/trunk/res/ide-support/eclipse/java-compiler-errors-warnings.txt?view=annotate
> 
> 
>> 
>> N
>> 
>>> 
>>> 
>>> On Mon, Jul 29, 2013 at 11:38 AM, <ma...@apache.org> wrote:
>>> 
>>>> Author: markt
>>>> Date: Mon Jul 29 18:38:08 2013
>>>> New Revision: 1508171
>>>> 
>>>> URL: http://svn.apache.org/r1508171
>>>> Log:
>>>> Remove unnecessary @SuppressWarnings
>>>> 
>>>> Modified:
>>>>   tomcat/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java
>>>> 
>>>> Modified:
>>>> tomcat/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java
>>>> URL:
>>>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java?rev=1508171&r1=1508170&r2=1508171&view=diff
>>>> 
>>>> ==============================================================================
>>>> --- tomcat/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java
>>>> (original)
>>>> +++ tomcat/trunk/java/org/apache/catalina/startup/WebappServiceLoader.java
>>>> Mon Jul 29 18:38:08 2013
>>>> @@ -82,7 +82,6 @@ public class WebappServiceLoader<T> {
>>>> 
>>>>        // if the ServletContext has ORDERED_LIBS, then use that to
>>>> specify the
>>>>        // set of JARs from WEB-INF/lib that should be used for loading
>>>> services
>>>> -        @SuppressWarnings("unchecked")
>>>>        List<String> orderedLibs = (List<String>)
>>>> context.getAttribute(ServletContext.ORDERED_LIBS);
>>>>        if (orderedLibs != null) {
>>>>            // handle ordered libs directly, ...
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>>>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


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

Reply via email to