Java

Java

By DeepSource

Storing an externally mutable value into a private static field may expose internal state JAVA-S0134
Security

This code stores a reference to an externally mutable object into a static field. If unchecked changes to the mutable object would compromise security or other important properties, you will need to do something different. It may be possible for external code to inspect or change the value of the static field by holding a reference to it after passing it to this class.

JUnit test class overrides setUp but does not invoke super.setUp() JAVA-S0337
Bug risk

This class inherits from JUnit's TestCase class and implements the setUp() method. The setUp method should call super.setUp(), but doesn't.

Public static method returns freely modifiable array that may expose internal state JAVA-S0131
Security

A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify the underlying array. This is dangerous because it could allow external code to modify the behavior of the class by changing data asssumed to be invariant.

Object appears to have been created for no reason JAVA-S0235
Anti-pattern

Our analysis shows that this object is useless. It's created and modified, but its value never goes outside the method or produces any side effect. Either there is a mistake and the object was intended to be used or it can be removed.

Empty catch clauses may hide exceptions JAVA-E0052
Anti-pattern

When a catch clause is empty, it essentially ignores any occurrences of the particular exception it handles. This could allow critical bugs to go undiagnosed because any relevant exceptions indicative of a bug would be discarded within this catch block.