FindBugs Report

Project Information

Project: hadoop-yarn-server-nodemanager

FindBugs version: 3.0.0

Code analyzed:



Metrics

30312 lines of code analyzed, in 656 classes, in 27 packages.

Metric Total Density*
High Priority Warnings 14 0.46
Medium Priority Warnings 6 0.20
Total Warnings 20 0.66

(* Defects per Thousand lines of non-commenting source statements)



Contents

Summary

Warning Type Number
Bad practice Warnings 3
Correctness Warnings 3
Internationalization Warnings 12
Dodgy code Warnings 2
Total 20

Warnings

Click on a warning row to see full context information.

Bad practice Warnings

Code Warning
FS Format string should use %n rather than \n in org.apache.hadoop.yarn.server.nodemanager.WindowsSecureContainerExecutor.startLocalizer(Path, InetSocketAddress, String, String, String, LocalDirsHandlerService)
RV Exceptional return value of java.util.concurrent.ExecutorService.submit(Callable) ignored in org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainersLauncher.handle(ContainersLauncherEvent)
RV Exceptional return value of java.util.concurrent.ExecutorService.submit(Callable) ignored in org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.sharedcache.SharedCacheUploadService.handle(SharedCacheUploadEvent)

Correctness Warnings

Code Warning
NP Possible null pointer dereference of in in org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler.parseMtab() on exception path
RV Bad attempt to compute absolute value of signed random integer in org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.getWorkingDir(List, String, String)
RV Bad attempt to compute absolute value of signed random integer in org.apache.hadoop.yarn.server.nodemanager.DockerContainerExecutor.getWorkingDir(List, String, String)

Internationalization Warnings

Code Warning
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.writeLaunchEnv(OutputStream, Map, Map, List): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor$LocalWrapperScriptBuilder.writeLocalWrapperScript(Path, Path): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor$UnixLocalWrapperScriptBuilder.writeSessionScript(Path, Path): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DockerContainerExecutor.writeLaunchEnv(OutputStream, Map, Map, List): java.io.ByteArrayOutputStream.toString()
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DockerContainerExecutor.writeLaunchEnv(OutputStream, Map, Map, List): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DockerContainerExecutor$LocalWrapperScriptBuilder.writeLocalWrapperScript(Path, Path): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.DockerContainerExecutor$UnixLocalWrapperScriptBuilder.writeSessionScript(Path, Path): new java.io.PrintStream(OutputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler.parseMtab(): new java.io.FileReader(File)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler.updateCgroup(String, String, String, String): new java.io.FileWriter(String, boolean)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.util.ProcessIdFileReader.getProcessId(Path): new java.io.FileReader(File)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.webapp.ContainerLogsPage$ContainersLogsBlock.printLogFile(HtmlBlock$Block, File): new java.io.InputStreamReader(InputStream)
Dm Found reliance on default encoding in org.apache.hadoop.yarn.server.nodemanager.WindowsSecureContainerExecutor$WintuilsProcessStubExecutor$1.run(): new java.io.InputStreamReader(InputStream)

Dodgy code Warnings

Code Warning
RCN Redundant nullcheck of shExec, which is known to be non-null in org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor.launchContainer(Container, Path, Path, String, String, Path, List, List)
SF Switch statement found in org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl.finished() where default case is missing

Details

DM_DEFAULT_ENCODING: Reliance on default encoding

Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.

VA_FORMAT_STRING_USES_NEWLINE: Format string should use %n rather than \n

This format string include a newline character (\n). In format strings, it is generally preferable better to use %n, which will produce the platform-specific line separator.

NP_NULL_ON_SOME_PATH_EXCEPTION: Possible null pointer dereference in method on exception path

A reference value which is null on some exception control path is dereferenced here.  This may lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, this may be a false warning.

Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE: Redundant nullcheck of value known to be non-null

This method contains a redundant check of a known non-null value against the constant null.

RV_ABSOLUTE_VALUE_OF_RANDOM_INT: Bad attempt to compute absolute value of signed random integer

This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). (Same problem arised for long values as well).

RV_RETURN_VALUE_IGNORED_BAD_PRACTICE: Method ignores exceptional return value

This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false if the file could not be successfully deleted (rather than throwing an Exception). If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.

SF_SWITCH_NO_DEFAULT: Switch statement found where default case is missing

This method contains a switch statement where default case is missing. Usually you need to provide a default case.

Because the analysis only looks at the generated bytecode, this warning can be incorrect triggered if the default case is at the end of the switch statement and doesn't end with a break statement.