In class tartan.smarthome.TartanHomeConfiguration
In method
tartan.smarthome.TartanHomeConfiguration.getDataSourceFactory()
Field tartan.smarthome.TartanHomeConfiguration.database
At TartanHomeConfiguration.java:[line 48]
tartan.smarthome.TartanHomeConfiguration.getDataSourceFactory() may
expose internal representation by returning
TartanHomeConfiguration.database
In class tartan.smarthome.TartanHomeConfiguration
In method tartan.smarthome.TartanHomeConfiguration.getHouses()
Field tartan.smarthome.TartanHomeConfiguration.houses
At TartanHomeConfiguration.java:[line 38]
tartan.smarthome.TartanHomeConfiguration.getHouses() may expose
internal representation by returning TartanHomeConfiguration.houses
In class tartan.smarthome.TartanHomeConfiguration
In method
tartan.smarthome.TartanHomeConfiguration.setDataSourceFactory(DataSourceFactory)
Field tartan.smarthome.TartanHomeConfiguration.database
Local variable named dataSourceFactory
At TartanHomeConfiguration.java:[line 53]
tartan.smarthome.TartanHomeConfiguration.setDataSourceFactory(DataSourceFactory)
may expose internal representation by storing an externally mutable
object into TartanHomeConfiguration.database
In class tartan.smarthome.TartanHomeConfiguration
In method tartan.smarthome.TartanHomeConfiguration.setHouses(List)
Field tartan.smarthome.TartanHomeConfiguration.houses
Local variable named houses
At TartanHomeConfiguration.java:[line 43]
tartan.smarthome.TartanHomeConfiguration.setHouses(List) may expose
internal representation by storing an externally mutable object into
TartanHomeConfiguration.houses
In class tartan.smarthome.core.TartanHome
In method tartan.smarthome.core.TartanHome.getEventLog()
Field tartan.smarthome.core.TartanHome.eventLog
At TartanHome.java:[line 390]
tartan.smarthome.core.TartanHome.getEventLog() may expose internal
representation by returning TartanHome.eventLog
In class tartan.smarthome.core.TartanHome
In method tartan.smarthome.core.TartanHome.setEventLog(List)
Field tartan.smarthome.core.TartanHome.eventLog
Local variable named eventLog
At TartanHome.java:[line 399]
tartan.smarthome.core.TartanHome.setEventLog(List) may expose internal
representation by storing an externally mutable object into
TartanHome.eventLog
In class tartan.smarthome.core.TartanHome
In method tartan.smarthome.core.TartanHome.equals(Object)
At TartanHome.java:[lines 650-657]
tartan.smarthome.core.TartanHome defines equals and uses
Object.hashCode()
In class tartan.smarthome.core.TartanHomeData
In method tartan.smarthome.core.TartanHomeData.getCreateTimeStamp()
Field tartan.smarthome.core.TartanHomeData.createTimeStamp
At TartanHomeData.java:[line 444]
tartan.smarthome.core.TartanHomeData.getCreateTimeStamp() may expose
internal representation by returning TartanHomeData.createTimeStamp
In class tartan.smarthome.core.TartanHomeData
In method
tartan.smarthome.core.TartanHomeData.setCreateTimeStamp(Date)
Field tartan.smarthome.core.TartanHomeData.createTimeStamp
Local variable named createTimeStamp
At TartanHomeData.java:[line 453]
tartan.smarthome.core.TartanHomeData.setCreateTimeStamp(Date) may
expose internal representation by storing an externally mutable object
into TartanHomeData.createTimeStamp
In class tartan.smarthome.reporting.ReportScheduler
In method new tartan.smarthome.reporting.ReportScheduler(HomeDAO,
List)
Field tartan.smarthome.reporting.ReportScheduler.homeServices
Local variable named homeServices
At ReportScheduler.java:[line 44]
new tartan.smarthome.reporting.ReportScheduler(HomeDAO, List) may
expose internal representation by storing an externally mutable object
into ReportScheduler.homeServices
In class tartan.smarthome.reporting.ReportScheduler
In method
tartan.smarthome.reporting.ReportScheduler.storeUserReport(String,
ReportType, String, String)
Value userReport
Type tartan.smarthome.reporting.models.UserReport
At ReportScheduler.java:[line 144]
Useless object stored in variable userReport of method
tartan.smarthome.reporting.ReportScheduler.storeUserReport(String,
ReportType, String, String)
In class tartan.smarthome.reporting.TestReportGenerator
In method
tartan.smarthome.reporting.TestReportGenerator.generateReport(Date,
Date)
At TestReportGenerator.java:[line 61]
Another occurrence at TestReportGenerator.java:[line 77]
Another occurrence at TestReportGenerator.java:[line 105]
tartan.smarthome.reporting.TestReportGenerator.generateReport(Date,
Date) makes inefficient use of keySet iterator instead of entrySet
iterator
In class tartan.smarthome.reporting.UserReportGenerator
In method
tartan.smarthome.reporting.UserReportGenerator.generateCostFocusedReport(TartanHome)
Called method java.text.SimpleDateFormat.format(Date)
Field tartan.smarthome.reporting.UserReportGenerator.DATE_FORMAT
At UserReportGenerator.java:[line 58]
Call to method of static java.text.DateFormat in
tartan.smarthome.reporting.UserReportGenerator.generateCostFocusedReport(TartanHome)
In class tartan.smarthome.reporting.UserReportGenerator
In method
tartan.smarthome.reporting.UserReportGenerator.generateEcoFocusedReport(TartanHome)
Called method java.text.SimpleDateFormat.format(Date)
Field tartan.smarthome.reporting.UserReportGenerator.DATE_FORMAT
At UserReportGenerator.java:[line 110]
Call to method of static java.text.DateFormat in
tartan.smarthome.reporting.UserReportGenerator.generateEcoFocusedReport(TartanHome)
In class tartan.smarthome.reporting.models.TestReport
In method tartan.smarthome.reporting.models.TestReport.getEndDate()
Field tartan.smarthome.reporting.models.TestReport.endDate
At TestReport.java:[line 26]
tartan.smarthome.reporting.models.TestReport.getEndDate() may expose
internal representation by returning TestReport.endDate
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.getGeneratedDate()
Field tartan.smarthome.reporting.models.TestReport.generatedDate
At TestReport.java:[line 34]
tartan.smarthome.reporting.models.TestReport.getGeneratedDate() may
expose internal representation by returning TestReport.generatedDate
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.getGroupMetrics()
Field tartan.smarthome.reporting.models.TestReport.groupMetrics
At TestReport.java:[line 58]
tartan.smarthome.reporting.models.TestReport.getGroupMetrics() may
expose internal representation by returning TestReport.groupMetrics
In class tartan.smarthome.reporting.models.TestReport
In method tartan.smarthome.reporting.models.TestReport.getStartDate()
Field tartan.smarthome.reporting.models.TestReport.startDate
At TestReport.java:[line 18]
tartan.smarthome.reporting.models.TestReport.getStartDate() may expose
internal representation by returning TestReport.startDate
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.setEndDate(Date)
Field tartan.smarthome.reporting.models.TestReport.endDate
Local variable named endDate
At TestReport.java:[line 30]
tartan.smarthome.reporting.models.TestReport.setEndDate(Date) may
expose internal representation by storing an externally mutable object
into TestReport.endDate
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.setGeneratedDate(Date)
Field tartan.smarthome.reporting.models.TestReport.generatedDate
Local variable named generatedDate
At TestReport.java:[line 38]
tartan.smarthome.reporting.models.TestReport.setGeneratedDate(Date)
may expose internal representation by storing an externally mutable
object into TestReport.generatedDate
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.setGroupMetrics(Map)
Field tartan.smarthome.reporting.models.TestReport.groupMetrics
Local variable named groupMetrics
At TestReport.java:[line 62]
tartan.smarthome.reporting.models.TestReport.setGroupMetrics(Map) may
expose internal representation by storing an externally mutable object
into TestReport.groupMetrics
In class tartan.smarthome.reporting.models.TestReport
In method
tartan.smarthome.reporting.models.TestReport.setStartDate(Date)
Field tartan.smarthome.reporting.models.TestReport.startDate
Local variable named startDate
At TestReport.java:[line 22]
tartan.smarthome.reporting.models.TestReport.setStartDate(Date) may
expose internal representation by storing an externally mutable object
into TestReport.startDate
In class tartan.smarthome.reporting.models.UserReport
In method
tartan.smarthome.reporting.models.UserReport.getGeneratedDate()
Field tartan.smarthome.reporting.models.UserReport.generatedDate
At UserReport.java:[line 90]
tartan.smarthome.reporting.models.UserReport.getGeneratedDate() may
expose internal representation by returning UserReport.generatedDate
In class tartan.smarthome.reporting.models.UserReport
In method
tartan.smarthome.reporting.models.UserReport.setGeneratedDate(Date)
Field tartan.smarthome.reporting.models.UserReport.generatedDate
Local variable named generatedDate
At UserReport.java:[line 94]
tartan.smarthome.reporting.models.UserReport.setGeneratedDate(Date)
may expose internal representation by storing an externally mutable
object into UserReport.generatedDate
In class tartan.smarthome.resources.StaticTartanStateEvaluator
In method
tartan.smarthome.resources.StaticTartanStateEvaluator.evaluateState(Map,
StringBuffer)
At StaticTartanStateEvaluator.java:[lines 92-118]
Switch statement found in
tartan.smarthome.resources.StaticTartanStateEvaluator.evaluateState(Map,
StringBuffer) where default case is missing
In class tartan.smarthome.resources.StaticTartanStateEvaluator
In method
tartan.smarthome.resources.StaticTartanStateEvaluator.evaluateState(Map,
StringBuffer)
At StaticTartanStateEvaluator.java:[line 93]
tartan.smarthome.resources.StaticTartanStateEvaluator.evaluateState(Map,
StringBuffer) makes inefficient use of keySet iterator instead of
entrySet iterator
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.handleHvacState(TartanHome,
Map)
Field tartan.smarthome.resources.TartanHomeService.hvacOnDuration
At TartanHomeService.java:[line 450]
Another occurrence at TartanHomeService.java:[line 458]
Operation on the "hvacOnDuration" shared variable in
"TartanHomeService" class is not atomic
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.authenticate(String,
String)
Field tartan.smarthome.resources.TartanHomeService.authenticated
At TartanHomeService.java:[line 171]
Shared primitive variable "authenticated" in one thread may not yield
the value of the most recent write from another thread
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.initializeSettings(TartanHomeSettings,
Integer)
Field tartan.smarthome.resources.TartanHomeService.authenticated
At TartanHomeService.java:[line 80]
Shared primitive variable "authenticated" in one thread may not yield
the value of the most recent write from another thread
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.lambda$processStateValues$1(TartanHome,
Map, String, Object)
At TartanHomeService.java:[lines 351-371]
Switch statement found in
tartan.smarthome.resources.TartanHomeService.lambda$processStateValues$1(TartanHome,
Map, String, Object) where default case is missing
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.setBooleanValue(TartanHome,
String, Boolean)
At TartanHomeService.java:[lines 396-425]
Switch statement found in
tartan.smarthome.resources.TartanHomeService.setBooleanValue(TartanHome,
String, Boolean) where default case is missing
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.setNumericValue(TartanHome,
String, Object)
At TartanHomeService.java:[lines 379-390]
Switch statement found in
tartan.smarthome.resources.TartanHomeService.setNumericValue(TartanHome,
String, Object) where default case is missing
In class tartan.smarthome.resources.TartanHomeService
In method
tartan.smarthome.resources.TartanHomeService.initializeSettings(TartanHomeSettings,
Integer)
Value temp
Type tartan.smarthome.core.TartanHome
At TartanHomeService.java:[line 104]
Useless object stored in variable temp of method
tartan.smarthome.resources.TartanHomeService.initializeSettings(TartanHomeSettings,
Integer)
In class tartan.smarthome.resources.TartanHomeService$1
In method new
tartan.smarthome.resources.TartanHomeService$1(TartanHomeService,
TartanHome)
At TartanHomeService.java:[line 509]
At TartanHomeService.java:[line 509]
Exception thrown in class
tartan.smarthome.resources.TartanHomeService$1 at new
tartan.smarthome.resources.TartanHomeService$1(TartanHomeService,
TartanHome) will leave the constructor. The object under construction
remains partially initialized and may be vulnerable to Finalizer
attacks.
In class tartan.smarthome.resources.TartanResource
In method tartan.smarthome.resources.TartanResource.getHomeServices()
Field tartan.smarthome.resources.TartanResource.services
At TartanResource.java:[line 101]
tartan.smarthome.resources.TartanResource.getHomeServices() may expose
internal representation by returning TartanResource.services
In class tartan.smarthome.resources.UserReportResource
In method
tartan.smarthome.resources.UserReportResource.getUserReport(String,
TartanUser)
Value loaded from homeState
Return value of
tartan.smarthome.resources.TartanHomeService.getState() of type
tartan.smarthome.core.TartanHome
Redundant null check at UserReportResource.java:[line 59]
Redundant nullcheck of homeState, which is known to be non-null in
tartan.smarthome.resources.UserReportResource.getUserReport(String,
TartanUser)
In class tartan.smarthome.resources.iotcontroller.IoTConnectManager
In method
tartan.smarthome.resources.iotcontroller.IoTConnectManager.handleStateUpdate(String)
Value loaded from body
Redundant null check at IoTConnectManager.java:[line 234]
Redundant nullcheck of body, which is known to be non-null in
tartan.smarthome.resources.iotcontroller.IoTConnectManager.handleStateUpdate(String)
In class tartan.smarthome.resources.iotcontroller.IoTConnectManager
In method
tartan.smarthome.resources.iotcontroller.IoTConnectManager.setState(Map)
At IoTConnectManager.java:[line 64]
tartan.smarthome.resources.iotcontroller.IoTConnectManager.setState(Map)
makes inefficient use of keySet iterator instead of entrySet iterator
In class tartan.smarthome.resources.iotcontroller.IoTConnection
In method
tartan.smarthome.resources.iotcontroller.IoTConnection.connect()
Called method new java.io.InputStreamReader(InputStream)
At IoTConnection.java:[line 118]
Found reliance on default encoding in
tartan.smarthome.resources.iotcontroller.IoTConnection.connect(): new
java.io.InputStreamReader(InputStream)
In class tartan.smarthome.resources.iotcontroller.IoTConnection
In method
tartan.smarthome.resources.iotcontroller.IoTConnection.connect()
Called method new java.io.OutputStreamWriter(OutputStream)
At IoTConnection.java:[line 117]
Found reliance on default encoding in
tartan.smarthome.resources.iotcontroller.IoTConnection.connect(): new
java.io.OutputStreamWriter(OutputStream)
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadUsers()
Called method new java.io.FileReader(String)
At IoTControlManager.java:[line 83]
Found reliance on default encoding in
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadUsers():
new java.io.FileReader(String)
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.getLogMessages()
Field
tartan.smarthome.resources.iotcontroller.IoTControlManager.logMessages
At IoTControlManager.java:[line 314]
tartan.smarthome.resources.iotcontroller.IoTControlManager.getLogMessages()
may expose internal representation by returning
IoTControlManager.logMessages
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.getUpdateThread()
Field
tartan.smarthome.resources.iotcontroller.IoTControlManager.updateThread
At IoTControlManager.java:[line 157]
tartan.smarthome.resources.iotcontroller.IoTControlManager.getUpdateThread()
may expose internal representation by returning
IoTControlManager.updateThread
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.getUserSettings()
Field
tartan.smarthome.resources.iotcontroller.IoTControlManager.userSettings
At IoTControlManager.java:[line 153]
tartan.smarthome.resources.iotcontroller.IoTControlManager.getUserSettings()
may expose internal representation by returning
IoTControlManager.userSettings
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadSettings()
Reference type java.io.InputStream
1 instances of obligation remaining
Obligation to clean up resource created at
IoTControlManager.java:[line 106] is not discharged
Path continues at IoTControlManager.java:[line 107]
Path continues at IoTControlManager.java:[line 110]
Path continues at IoTControlManager.java:[line 112]
Path continues at IoTControlManager.java:[line 113]
Path continues at IoTControlManager.java:[line 114]
Path continues at IoTControlManager.java:[line 115]
Path continues at IoTControlManager.java:[line 116]
Path continues at IoTControlManager.java:[line 117]
Path continues at IoTControlManager.java:[line 118]
Path continues at IoTControlManager.java:[line 120]
Path continues at IoTControlManager.java:[line 121]
Path continues at IoTControlManager.java:[line 122]
Path continues at IoTControlManager.java:[line 123]
Path continues at IoTControlManager.java:[line 124]
Path continues at IoTControlManager.java:[line 125]
Path continues at IoTControlManager.java:[line 126]
Path continues at IoTControlManager.java:[line 127]
Path continues at IoTControlManager.java:[line 130]
Path continues at IoTControlManager.java:[line 133]
Path continues at IoTControlManager.java:[line 134]
Remaining obligations: {InputStream x 1}
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadSettings()
may fail to clean up java.io.InputStream
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
In method
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadSettings()
Need to close java.io.InputStream
At IoTControlManager.java:[line 106]
tartan.smarthome.resources.iotcontroller.IoTControlManager.loadSettings()
may fail to close stream
In class tartan.smarthome.resources.iotcontroller.IoTControlManager
Field
tartan.smarthome.resources.iotcontroller.IoTControlManager.settingsPath
At IoTControlManager.java:[line 62]
Field only ever set to null:
tartan.smarthome.resources.iotcontroller.IoTControlManager.settingsPath
In class tartan.smarthome.resources.iotcontroller.LoginHandler
In method new
tartan.smarthome.resources.iotcontroller.LoginHandler(Vector)
Field tartan.smarthome.resources.iotcontroller.LoginHandler.validUsers
Local variable named vu
At LoginHandler.java:[line 28]
new tartan.smarthome.resources.iotcontroller.LoginHandler(Vector) may
expose internal representation by storing an externally mutable object
into LoginHandler.validUsers
In class tartan.smarthome.views.ReportView
In method tartan.smarthome.views.ReportView.getReport()
Field tartan.smarthome.views.ReportView.report
At ReportView.java:[line 17]
tartan.smarthome.views.ReportView.getReport() may expose internal
representation by returning ReportView.report
In class tartan.smarthome.views.ReportView
In method new tartan.smarthome.views.ReportView(TestReport, String)
Field tartan.smarthome.views.ReportView.report
Local variable named report
At ReportView.java:[line 12]
new tartan.smarthome.views.ReportView(TestReport, String) may expose
internal representation by storing an externally mutable object into
ReportView.report
In class tartan.smarthome.views.SmartHomeView
In method tartan.smarthome.views.SmartHomeView.getTartanHome()
Field tartan.smarthome.views.SmartHomeView.tartanHome
At SmartHomeView.java:[line 32]
tartan.smarthome.views.SmartHomeView.getTartanHome() may expose
internal representation by returning SmartHomeView.tartanHome
In class tartan.smarthome.views.SmartHomeView
In method new tartan.smarthome.views.SmartHomeView(TartanHome)
Field tartan.smarthome.views.SmartHomeView.tartanHome
Local variable named tartanHome
At SmartHomeView.java:[line 23]
new tartan.smarthome.views.SmartHomeView(TartanHome) may expose
internal representation by storing an externally mutable object into
SmartHomeView.tartanHome
This write of a variable shared between functions depends on the
current value of the variable (either because it's a compound
operation - e.g. +=, ++ - or it simply depends on the current value),
as such it consists of more than one discrete operation. These
operations are not atomic in themselves and need further
synchronization. See
SEI CERT rule VNA02-J. Simply declaring a variable volatile fails to guarantee the
atomicity of compound operations on the variable, but synchronizing
the writes on top of declaring the variable volatile for read
operations is sufficient.
To solve this issue, synchronize compound operations and other write
operations depending on the previous value, use read-write locks, or
declare the shared variable with an atomic type.
SEI CERT rule VNA00-J
describes that reading a shared primitive variable in one thread may
not yield the value of the most recent write to the variable from
another thread. Consequently, the thread may observe a stale value of
the shared variable.
To fix it, declare the variable volatile, change the type of the field
to the corresponding atomic type from
java.lang.concurrent.atomic or correctly synchronize the
code. Declaring the variable volatile may not be enough in some cases:
e.g. when the variable is assigned a value which depends on the
current value or on the result of nonatomic compound operations. This
guarantees that 64-bit primitive long and double variables are
accessed atomically.
Classes that throw exceptions in their constructors are vulnerable to
Finalizer attacks
A finalizer attack can be prevented, by declaring the class final,
using an empty finalizer declared as final, or by a clever use of a
private constructor.
See
SEI CERT Rule OBJ-11
for more information.
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 behavior to vary
between platforms. Use an alternative API and specify a charset name
or Charset object explicitly.
Returning a reference to a mutable object value stored in one of the
object's fields exposes the internal representation of the
object. If instances are accessed by untrusted code, and
unchecked changes to the mutable object would compromise security or
other important properties, you will need to do something different.
Returning a new copy of the object is better approach in many
situations.
This code stores a reference to an externally mutable object into the
internal representation of the object. If instances are accessed
by untrusted code, and unchecked changes to the mutable object would
compromise security or other important properties, you will need to do
something different. Storing a copy of the object is better approach
in many situations.
This class overrides equals(Object), but does not
override hashCode(), and inherits the implementation of
hashCode() from java.lang.Object (which
returns the identity hash code, an arbitrary value assigned to the
object by the VM). Therefore, the class is very likely to
violate the invariant that equal objects must have equal hashcodes.
If you don't think instances of this class will ever be inserted into
a HashMap/HashTable, the recommended
hashCode implementation to use is:
public int hashCode() {
assert false : "hashCode not designed";
return 42; // any arbitrary constant will do
}
This method may fail to clean up (close, dispose of) a stream,
database object, or other resource requiring an explicit cleanup
operation.
In general, if a method opens a stream or other resource, the method
should use a try/finally block to ensure that the stream or resource
is cleaned up before the method returns.
This bug pattern is essentially the same as the OS_OPEN_STREAM and
ODR_OPEN_DATABASE_RESOURCE bug patterns, but is based on a different
(and hopefully better) static analysis technique. We are interested is
getting feedback about the usefulness of this bug pattern. For sending
feedback, check:
In particular, the false-positive suppression heuristics for this bug
pattern have not been extensively tuned, so reports about false
positives are helpful to us.
See Weimer and Necula,
Finding and Preventing Run-Time Error Handling Mistakes (PDF), for a description of the analysis technique.
The method creates an IO stream object, does not assign it to any
fields, pass it to other methods that might close it, or return it,
and does not appear to close the stream on all paths out of the
method. This may result in a file descriptor leak. It is
generally a good idea to use a finally block to ensure
that streams are closed.
This method contains a redundant check of a known non-null value
against the constant null.
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 the switch statement doesn't contain break
statements for other cases.
Our analysis shows that this object is useless. It's created and
modified, but its value never go outside of the method or produce any
side-effect. Either there is a mistake and object was intended to be
used or it can be removed.
This analysis rarely produces false-positives. Common false-positive
cases include:
- This object used to implicitly throw some obscure exception.
- This object used as a stub to generalize the code.
- This object used to hold strong references to weak/soft-referenced
objects.
All writes to this field are of the constant value null, and thus all
reads of the field will return null. Check for errors, or remove it if
it is useless.
This method accesses the value of a Map entry, using a key that was
retrieved from a keySet iterator. It is more efficient to use an
iterator on the entrySet of the map, to avoid the Map.get(key) lookup.