[ https://issues.apache.org/jira/browse/OOZIE-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16049061#comment-16049061 ]
Peter Cseh commented on OOZIE-2943: ----------------------------------- I think this change will change the generated JSONs: {noformat} - for (String cName : map.keySet()) { - group.put(cName, map.get(cName)); + for (Map.Entry cName : map.entrySet()) { + group.put(cName, cName.getValue()); {noformat} shouldn't it be {{ group.put(cName.getKey(), cName.getValue());}} ? > Fix Findbugs warnings in oozie-sharelib-pig > ------------------------------------------- > > Key: OOZIE-2943 > URL: https://issues.apache.org/jira/browse/OOZIE-2943 > Project: Oozie > Issue Type: Sub-task > Components: build > Reporter: Jan Hentschel > Assignee: Jan Hentschel > Attachments: OOZIE-2943-1.patch > > > Currently Findbugs complains about the following warnings in the > *oozie-sharelib-pig* module: > {code} > [INFO] > org.apache.oozie.action.hadoop.OoziePigStats.toJSONFromMultiStoreCounters(Map) > makes inefficient use of keySet iterator instead of entrySet iterator > [org.apache.oozie.action.hadoop.OoziePigStats] At OoziePigStats.java:[line > 130] > [INFO] Dead store to klass in > org.apache.oozie.action.hadoop.PigMain.runPigJob(String[], String, boolean, > boolean) [org.apache.oozie.action.hadoop.PigMain] At PigMain.java:[line 335] > [INFO] Found reliance on default encoding in > org.apache.oozie.action.hadoop.PigMain.handleError(String): new > java.io.FileReader(String) [org.apache.oozie.action.hadoop.PigMain] At > PigMain.java:[line 307] > [INFO] Found reliance on default encoding in > org.apache.oozie.action.hadoop.PigMain.writeExternalData(String, File): new > java.io.FileWriter(File) [org.apache.oozie.action.hadoop.PigMain] At > PigMain.java:[line 408] > [INFO] org.apache.oozie.action.hadoop.PigMain.run(String[]) may fail to clean > up java.io.OutputStream on checked exception > [org.apache.oozie.action.hadoop.PigMain, > org.apache.oozie.action.hadoop.PigMain] Obligation to clean up resource > created at PigMain.java:[line 130] is not dischargedPath continues at > PigMain.java:[line 131] > [INFO] org.apache.oozie.action.hadoop.PigMain.handleError(String) may fail to > close stream on exception [org.apache.oozie.action.hadoop.PigMain] At > PigMain.java:[line 307] > [INFO] org.apache.oozie.action.hadoop.PigMain.run(String[]) may fail to close > stream on exception [org.apache.oozie.action.hadoop.PigMain] At > PigMain.java:[line 130] > [INFO] Found reliance on default encoding in > org.apache.oozie.action.hadoop.PigMainWithOldAPI.getHadoopJobIds(String): new > java.io.FileReader(String) [org.apache.oozie.action.hadoop.PigMainWithOldAPI] > At PigMainWithOldAPI.java:[line 265] > [INFO] Found reliance on default encoding in > org.apache.oozie.action.hadoop.PigMainWithOldAPI.run(String[]): new > java.io.FileReader(String) [org.apache.oozie.action.hadoop.PigMainWithOldAPI, > org.apache.oozie.action.hadoop.PigMainWithOldAPI] At > PigMainWithOldAPI.java:[line 126]Another occurrence at > PigMainWithOldAPI.java:[line 219] > [INFO] org.apache.oozie.action.hadoop.PigMainWithOldAPI.run(String[]) may > fail to clean up java.io.OutputStream on checked exception > [org.apache.oozie.action.hadoop.PigMainWithOldAPI, > org.apache.oozie.action.hadoop.PigMainWithOldAPI] Obligation to clean up > resource created at PigMainWithOldAPI.java:[line 101] is not dischargedPath > continues at PigMainWithOldAPI.java:[line 102] > [INFO] > org.apache.oozie.action.hadoop.PigMainWithOldAPI.getHadoopJobIds(String) may > fail to close stream on exception > [org.apache.oozie.action.hadoop.PigMainWithOldAPI] At > PigMainWithOldAPI.java:[line 265] > [INFO] org.apache.oozie.action.hadoop.PigMainWithOldAPI.run(String[]) may > fail to close stream on exception > [org.apache.oozie.action.hadoop.PigMainWithOldAPI, > org.apache.oozie.action.hadoop.PigMainWithOldAPI] At > PigMainWithOldAPI.java:[line 101]Another occurrence at > PigMainWithOldAPI.java:[line 242] > [INFO] org.apache.oozie.action.hadoop.PigMainWithOldAPI.run(String[]) may > fail to close stream on exception > [org.apache.oozie.action.hadoop.PigMainWithOldAPI, > org.apache.oozie.action.hadoop.PigMainWithOldAPI] At > PigMainWithOldAPI.java:[line 126]Another occurrence at > PigMainWithOldAPI.java:[line 219] > {code} > They should be fixed to get the code more reliable. -- This message was sent by Atlassian JIRA (v6.4.14#64029)