resources.report.rules.findbugs.DM_STRING_VOID_CTOR.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sanity4j Show documentation
Show all versions of sanity4j Show documentation
Sanity4J was created to simplify running multiple static code
analysis tools on the Java projects. It provides a single entry
point to run all the selected tools and produce a consolidated
report, which presents all findings in an easily accessible
manner.
The newest version!
Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR)
Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR)
Creating a new java.lang.String
object using the
no-argument constructor wastes memory because the object so created will
be functionally indistinguishable from the empty string constant
""
. Java guarantees that identical string constants
will be represented by the same String
object. Therefore,
you should just use the empty string constant directly.