[ 
https://issues.apache.org/jira/browse/SLIDER-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15378272#comment-15378272
 ] 

Jian He commented on SLIDER-1153:
---------------------------------

Uploaded a patch to fix the ones that are valid. The left ones are either 
invalid or will never occur.
The patch also removed the FsDelegationTokenManager and its test as they are 
not needed as mentioned by Jon

> Code issues - 14 null pointer deferences found
> ----------------------------------------------
>
>                 Key: SLIDER-1153
>                 URL: https://issues.apache.org/jira/browse/SLIDER-1153
>             Project: Slider
>          Issue Type: Bug
>          Components: other
>    Affects Versions: Slider 0.91
>            Reporter: Gour Saha
>             Fix For: Slider 1.0.0
>
>         Attachments: SLIDER-1153.1.patch
>
>
> Following possible null pointer dereferences found in the code needs to be 
> fixed.
> h6. 
> slider-core/src/main/java/org/apache/slider/server/appmaster/state/AppState.java
> {code}
> 819          ProviderRole dynamicRole = createDynamicProviderRole(newName, 
> name, component);
> {code}
> dereference: Dereferencing a pointer that might be null component when 
> calling createDynamicProviderRole
> {code}
>  836        roleHistory.addNewRole(roleStatus);
> {code}
> null_method_call: Calling a method on null object roleHistory
> {code}
> 1290      return roleHistory.requestContainerForRole(role).getIssuedRequest();
> {code}
> null_method_call: Calling a method on null object 
> roleHistory.requestContainerForRole(role)
> h6. slider-core/src/main/java/org/apache/slider/client/SliderClient.java
> {code}
> 960      char[] newPassword2 = br.readLine().toCharArray();
> {code}
> null_method_call: Calling a method on null object br.readLine()
> {code}
> 3679        Path subPath = new Path(path1, 
> appReport.getApplicationId().toString()
> 3680            + "/agent");
> {code}
> null_method_call: Calling a method on null object appReport.
> {code}
> 3795      Path subPath = new Path(path1, 
> appReport.getApplicationId().toString()
> 3796          + "/agent");
> 3797      imagePath = subPath.toString();
> {code}
> null_method_call: Calling a method on null object appReport.
> h6. slider-core/src/main/java/org/apache/slider/common/tools/SliderUtils.java
> {code}
> 1035    return !(address.getHostString().equals("0.0.0.0"));
> {code}
> null_method_call: Calling a method on null object address.getHostString()
> {code}
> 1422    for (String entry : confDirEntries) {
> {code}
> null_array_length: Accessing length of null array confDirEntries
> h6. 
> slider-core/src/main/java/org/apache/slider/common/tools/CoreFileSystem.java
> {code}
> 682      Path[] localFilePaths = new Path[localFiles.length];
> {code}
> null_array_length: Accessing length of null array localFiles
> h6. 
> slider-core/src/main/java/org/apache/slider/server/services/security/FsDelegationTokenManager.java
> {code}
> 159            tokenExpiryTime = CredentialUtils.getTokenExpiryTime(token);
> {code}
> dereference: Dereferencing a pointer that might be null token when calling 
> getTokenExpiryTime
> {code}
> 237        currentUser.addToken(token.getService(), token);
> {code}
> null_method_call: Calling a method on null object token
> h6. 
> slider-core/src/main/java/org/apache/slider/server/appmaster/rpc/SliderIPCService.java
> {code}
> 237    result = cd.toJsonString();
> {code}
> null_method_call: Calling a method on null object cd
> h6. 
> slider-core/src/main/java/org/apache/slider/server/appmaster/actions/RenewingAction.java
> {code}
>  66    Preconditions.checkArgument(action != null, "null actions");
> {code}
> check_after_deref: Null-checking action suggests that it may be null, but it 
> has already been dereferenced on all paths leading to the check.
> h6. 
> slider-core/src/main/java/org/apache/slider/core/launch/SerializedApplicationReport.java
> {code}
> 70    this.applicationAttemptId = 
> report.getCurrentApplicationAttemptId().toString();
> {code}
> null_method_call: Calling a method on null object 
> report.getCurrentApplicationAttemptId()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to