This method or field is or uses a Map
or Set
of URL
s. Since both the equals
and hashCode
method of URL
perform domain name resolution, this can result in a big performance hit.
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.
The method calls Connection.prepareStatement
inside the loop passing the constant arguments. If the PreparedStatement
should be executed several times there's no reason to recreate it for each loop iteration.
toString
invoked on a string value is useless JAVA-S0064Calling String.toString
is a redundant operation. Just use the string directly.
Boolean
constructor is inefficient, consider using Boolean.valueOf
instead JAVA-S0066Creating new instances of java.lang.Boolean
wastes memory, since Boolean
objects are immutable and there are only two useful values of this type.