tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50129] New: ContextConfig - unnecessary null checks
Date Wed, 20 Oct 2010 23:48:04 GMT
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


Mime
View raw message