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

Jan Hentschel commented on OOZIE-2952:
--------------------------------------

[~nobigo] Sure, go ahead.

> Fix Findbugs warnings in oozie-sharelib-oozie
> ---------------------------------------------
>
>                 Key: OOZIE-2952
>                 URL: https://issues.apache.org/jira/browse/OOZIE-2952
>             Project: Oozie
>          Issue Type: Sub-task
>          Components: build
>            Reporter: Jan Hentschel
>            Assignee: Jan Hentschel
>            Priority: Major
>         Attachments: OOZIE-2952-1.patch
>
>
> Currently Findbugs complains about the following warnings in the 
> *oozie-sharelib-oozie* module:
> {code}
> [INFO] The class org.apache.oozie.action.hadoop.HdfsOperations$2 could be 
> refactored into a named _static_ inner class 
> [org.apache.oozie.action.hadoop.HdfsOperations] At HdfsOperations.java:[line 
> 80]
> [INFO] The class org.apache.oozie.action.hadoop.HdfsOperations$3 could be 
> refactored into a named _static_ inner class 
> [org.apache.oozie.action.hadoop.HdfsOperations] At HdfsOperations.java:[line 
> 91]
> [INFO] The class org.apache.oozie.action.hadoop.HdfsOperations$4 could be 
> refactored into a named _static_ inner class 
> [org.apache.oozie.action.hadoop.HdfsOperations] At HdfsOperations.java:[line 
> 105]
> [INFO] Use of non-localized String.toUpperCase() or String.toLowerCase() in 
> org.apache.oozie.action.hadoop.LauncherMain.printArgs(String, String[]) 
> [org.apache.oozie.action.hadoop.LauncherMain] At LauncherMain.java:[line 416]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMain.getHadoopJobIds(String, 
> Pattern[]): new java.io.FileReader(String) 
> [org.apache.oozie.action.hadoop.LauncherMain] At LauncherMain.java:[line 139]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMain.writeExternalChildIDs(String, 
> Pattern[], String): String.getBytes() 
> [org.apache.oozie.action.hadoop.LauncherMain] At LauncherMain.java:[line 175]
> [INFO] org.apache.oozie.action.hadoop.LauncherMain.HADOOP_SITE_FILES should 
> be both final and package protected 
> [org.apache.oozie.action.hadoop.LauncherMain] At LauncherMain.java:[line 76]
> [INFO] Exceptional return value of java.io.File.mkdirs() ignored in 
> org.apache.oozie.action.hadoop.LauncherMain.writeHadoopConfig(String, File) 
> [org.apache.oozie.action.hadoop.LauncherMain] At LauncherMain.java:[line 394]
> [INFO] Use of non-localized String.toUpperCase() or String.toLowerCase() in 
> org.apache.oozie.action.hadoop.LauncherMapper.printArgs(String, String[]) 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 660]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMapper.getLocalFileContentStr(File, 
> String, int): new java.io.FileReader(File) 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 407]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMapper.propagateToHadoopConf(): new 
> java.io.FileWriter(String) [org.apache.oozie.action.hadoop.LauncherMapper] At 
> LauncherMapper.java:[line 355]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMapper.propagateToHadoopConf(): new 
> java.io.OutputStreamWriter(OutputStream) 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 356]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMapper.setRecoveryId(Configuration, 
> Path, String): new java.io.InputStreamReader(InputStream) 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 107]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.LauncherMapper.setRecoveryId(Configuration, 
> Path, String): new java.io.OutputStreamWriter(OutputStream) 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 97]
> [INFO] 
> org.apache.oozie.action.hadoop.LauncherMapper.getLocalFileContentStr(File, 
> String, int) may fail to clean up java.io.Reader on checked exception 
> [org.apache.oozie.action.hadoop.LauncherMapper, 
> org.apache.oozie.action.hadoop.LauncherMapper, 
> org.apache.oozie.action.hadoop.LauncherMapper, 
> org.apache.oozie.action.hadoop.LauncherMapper] Obligation to clean up 
> resource created at LauncherMapper.java:[line 407] is not dischargedPath 
> continues at LauncherMapper.java:[line 408]Path continues at 
> LauncherMapper.java:[line 410]Path continues at LauncherMapper.java:[line 411]
> [INFO] org.apache.oozie.action.hadoop.LauncherMapper.propagateToHadoopConf() 
> may fail to clean up java.io.Writer on checked exception 
> [org.apache.oozie.action.hadoop.LauncherMapper] Obligation to clean up 
> resource created at LauncherMapper.java:[line 355] is not discharged
> [INFO] 
> org.apache.oozie.action.hadoop.LauncherMapper.getLocalFileContentStr(File, 
> String, int) may fail to close stream on exception 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 407]
> [INFO] 
> org.apache.oozie.action.hadoop.LauncherMapper.setRecoveryId(Configuration, 
> Path, String) may fail to close stream on exception 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 107]
> [INFO] 
> org.apache.oozie.action.hadoop.LauncherMapper.setRecoveryId(Configuration, 
> Path, String) may fail to close stream on exception 
> [org.apache.oozie.action.hadoop.LauncherMapper] At LauncherMapper.java:[line 
> 97]
> [INFO] Write to static field 
> org.apache.oozie.action.hadoop.LauncherSecurityManager.exitCode from instance 
> method org.apache.oozie.action.hadoop.LauncherSecurityManager.checkExit(int) 
> [org.apache.oozie.action.hadoop.LauncherSecurityManager] At 
> LauncherMapper.java:[line 698]
> [INFO] Write to static field 
> org.apache.oozie.action.hadoop.LauncherSecurityManager.exitInvoked from 
> instance method 
> org.apache.oozie.action.hadoop.LauncherSecurityManager.checkExit(int) 
> [org.apache.oozie.action.hadoop.LauncherSecurityManager] At 
> LauncherMapper.java:[line 697]
> [INFO] The class org.apache.oozie.action.hadoop.LocalFsOperations$1 could be 
> refactored into a named _static_ inner class 
> [org.apache.oozie.action.hadoop.LocalFsOperations] At 
> LocalFsOperations.java:[line 58]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.MapReduceMain.writeJobIdFile(File, String): 
> String.getBytes() [org.apache.oozie.action.hadoop.MapReduceMain] At 
> MapReduceMain.java:[line 85]
> [INFO] org.apache.oozie.action.hadoop.MapReduceMain.writeJobIdFile(File, 
> String) may fail to clean up java.io.OutputStream on checked exception 
> [org.apache.oozie.action.hadoop.MapReduceMain, 
> org.apache.oozie.action.hadoop.MapReduceMain] Obligation to clean up resource 
> created at MapReduceMain.java:[line 84] is not dischargedPath continues at 
> MapReduceMain.java:[line 85]
> [INFO] org.apache.oozie.action.hadoop.MapReduceMain.writeJobIdFile(File, 
> String) may fail to close stream on exception 
> [org.apache.oozie.action.hadoop.MapReduceMain] At MapReduceMain.java:[line 84]
> [INFO] Exceptional return value of java.io.File.createNewFile() ignored in 
> new org.apache.oozie.action.hadoop.OozieLauncherOutputCommitter() 
> [org.apache.oozie.action.hadoop.OozieLauncherOutputCommitter] At 
> OozieLauncherOutputCommitter.java:[line 35]
> [INFO] The class org.apache.oozie.action.hadoop.OozieLauncherOutputFormat$1 
> could be refactored into a named _static_ inner class 
> [org.apache.oozie.action.hadoop.OozieLauncherOutputFormat] At 
> OozieLauncherOutputFormat.java:[line 35]
> [INFO] Use of non-localized String.toUpperCase() or String.toLowerCase() in 
> org.apache.oozie.action.hadoop.PasswordMasker.isPasswordKey(String) 
> [org.apache.oozie.action.hadoop.PasswordMasker] At PasswordMasker.java:[line 
> 115]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.ShellMain.handleShellOutput(Process, boolean): 
> new java.io.InputStreamReader(InputStream) 
> [org.apache.oozie.action.hadoop.ShellMain, 
> org.apache.oozie.action.hadoop.ShellMain] At ShellMain.java:[line 228]Another 
> occurrence at ShellMain.java:[line 229]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.ShellMain.writeLoggerProperties(Configuration, 
> File): new java.io.PrintWriter(OutputStream) 
> [org.apache.oozie.action.hadoop.ShellMain] At ShellMain.java:[line 172]
> [INFO] 
> org.apache.oozie.action.hadoop.ShellMain.writeLoggerProperties(Configuration, 
> File) may fail to close stream on exception 
> [org.apache.oozie.action.hadoop.ShellMain] At ShellMain.java:[line 172]
> [INFO] Redundant nullcheck of thrArray, which is known to be non-null in 
> org.apache.oozie.action.hadoop.ShellMain.execute(Configuration) 
> [org.apache.oozie.action.hadoop.ShellMain] Redundant null check at 
> ShellMain.java:[line 117]
> [INFO] Found reliance on default encoding in 
> org.apache.oozie.action.hadoop.ShellMain$OutputWriteThread.run(): new 
> java.io.FileWriter(File) 
> [org.apache.oozie.action.hadoop.ShellMain$OutputWriteThread] At 
> ShellMain.java:[line 265]
> [INFO] Should org.apache.oozie.action.hadoop.ShellMain$OutputWriteThread be a 
> _static_ inner class? 
> [org.apache.oozie.action.hadoop.ShellMain$OutputWriteThread] At 
> ShellMain.java:[lines 247-305]
> {code}
> They should be fixed to get the code more reliable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to