Error Reporter created CAMEL-16599:
--------------------------------------

             Summary: Potential NPE in org.apache.camel.util
                 Key: CAMEL-16599
                 URL: https://issues.apache.org/jira/browse/CAMEL-16599
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Error Reporter


Our code analyses found the following potential NPE:
{code:java}
    public String extractPathWithinPattern(String pattern, String path) {
        String[] patternParts = tokenizeToStringArray(pattern, 
this.pathSeparator);
        String[] pathParts = tokenizeToStringArray(path, this.pathSeparator); 
<- null may be returned
{code}
 

Full Trace:

1. Return null to caller
https://github.com/apache/camel/blob/0dbf915c5a3dc773952436dd360931b2f55da4d9/core/camel-util/src/main/java/org/apache/camel/util/AntPathMatcher.java#L449

2. Function tokenizeToStringArray executes and returns
https://github.com/apache/camel/blob/0dbf915c5a3dc773952436dd360931b2f55da4d9/core/camel-util/src/main/java/org/apache/camel/util/AntPathMatcher.java#L405

3. Load value from tokenizeToStringArray(<param2>,this.pathSeparator).length
https://github.com/apache/camel/blob/0dbf915c5a3dc773952436dd360931b2f55da4d9/core/camel-util/src/main/java/org/apache/camel/util/AntPathMatcher.java#L413

Commit: 0dbf915c5a3dc773952436dd360931b2f55da4d9



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to