ZoneId.of("Z")should be replaced with
ZoneId.of() to get the UTC timezone offset, and instead use
A boxed primitive is created just to call its
compareTo method. It's more efficient to use the associated static compare method (for double and float since Java 1.4, for other primitive types since Java 7) which works on primitives directly.
Comparing two primitive values with
Objects.equals() can be inefficient, since both primitives will have to be boxed before being compared.
This JavaDoc comment appears to be malformed. Such comments may raise errors or cause crashes when passed to a JavaDoc generation tool.
Rewrite the comment to use correct syntax.
Duration.withNanos()may not produce correct results JAVA-E1087
Duration.withNanos() may produce wrong results, because it will only set the value of the nanoseconds field of
the duration, and will not correctly adjust for any overflow.
This method/constructor has a parameter tag with no description.
Consider adding a description to the tag. If the parameter's name is clear enough, consider removing the parameter tag entirely.
Empty JavaDoc tags are meaningless, and may even cause tools that consume JavaDoc comments to crash.
Always add an explanation when writing JavaDoc tags.
ZoneId.of()should be passed a valid timezone identifier JAVA-E1092
should not be passed invalid time zone identifier strings, as this will cause exceptions to be thrown at runtime.
The Java analyzer has detected a narrowing cast of a subtraction in a comparison method that may flip the sign of the result.
The constructor of an abstract class can never be called directly by the dependency injection framework, meaning any injection annotations applied to it will not be considered. Remove the annotation.
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.
If a method of a superclass has one particular nullability annotation applied to it, avoid marking any overrides in subtypes with a different nullability annotation.
Make sure to use the same annotation present on the super method as much as possible.
setUpbut does not invoke
This class inherits from JUnit's
TestCase class and implements the
setUp() method. The
setUp method should call
super.setUp(), but doesn't.
Futures should not be ignored JAVA-W1087
Always use the value returned by a method with return type
Unused imports should be removed from all source files.
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.
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.
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
This method or field is or uses a
URLs. Since both the
hashCode method of
URL perform domain name resolution, this can result in a big performance hit.
@OverridingMethodsMustInvokeSuperannotation in super method is ignored by overriding method JAVA-S0001
The super method is annotated with
@OverridingMethodsMustInvokeSuper, but the overriding method isn't calling the super method.