[
https://issues.apache.org/jira/browse/LIVY-1030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18050928#comment-18050928
]
Edward Capriolo commented on LIVY-1030:
---------------------------------------
https://github.com/apache/incubator-livy/pull/506
> Potential NPE in ContextLauncher and assorted cleanups
> ------------------------------------------------------
>
> Key: LIVY-1030
> URL: https://issues.apache.org/jira/browse/LIVY-1030
> Project: Livy
> Issue Type: Bug
> Reporter: Edward Capriolo
> Assignee: Edward Capriolo
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> There is a subtle NPE and there are various other cleanups that make the code
> match modern style rules
> {code:java}
> List<String> jars = new ArrayList<>();
> for (File dir : allJars) {
> - for (File f : dir.listFiles()) {
> - jars.add(f.getAbsolutePath());
> + File [] list = dir.listFiles();
> + if (list != null) {
> + for (File f : list) {
> + jars.add(f.getAbsolutePath());
> + }
> }
> }
> {code}
> There are also unused variables, redundant or missing modifiers, etc. I
> cleaned as I went.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)