You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/10/21 01:48:04 UTC

DO NOT REPLY [Bug 50129] New: ContextConfig - unnecessary null checks

https://issues.apache.org/bugzilla/show_bug.cgi?id=50129

           Summary: ContextConfig - unnecessary null checks
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sebb@apache.org


Created an attachment (id=26192)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26192)
Patch to remove null checks

Sample code:

urlPatterns = processAnnotationsStringArray(evp.getValue());
urlPatternsSet = urlPatterns != null && urlPatterns.length > 0;
for (String urlPattern : urlPatterns) {

The check "urlPatterns != null" is unnecessary as the method call never returns
null.

If it could return null, then the for loop would cause an NPE.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 50129] ContextConfig - unnecessary null checks

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50129

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> 2010-10-24 10:31:34 EDT ---
ContextConfig has been refactored to remove all the IDE generated null
warnings, including the two that this 'bug' refers to. There was no functional
change. The refactored code will be used in 7.0.5 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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