findbugs: simply cast to int

Primitive value is boxed then unboxed to perform primitive coercion in
org.candlepin.util.X509V3ExtensionUtil.hydrateContentPackage(byte[])

A primitive boxed value constructed and then immediately converted into a
different primitive type (e.g., new Double(d).intValue()). Just perform direct
primitive coercion (e.g., (int) d).
findbugs: chose to use autoboxing instead of valueOf()

Method invokes inefficient Number constructor; use static valueOf instead
(DM_NUMBER_CTOR)

Using new Integer(int) is guaranteed to always result in a new object whereas
Integer.valueOf(int) allows caching of values to be done by the compiler, class
library, or JVM. Using of cached values avoids object allocation and the code
will be faster.

Values between -128 and 127 are guaranteed to have corresponding cached
instances and using valueOf is approximately 3.5 times faster than using
constructor. For values outside the constant range the performance of both
styles is the same.

Unless the class must be compatible with JVMs predating Java 1.5, use either
autoboxing or the valueOf() method when creating instances of Long, Integer,
Short, Character, and Byte.
findbugs: using Boolean.valueOf()

Method invokes inefficient Boolean constructor; use Boolean.valueOf(...) instead
(DM_BOOLEAN_CTOR)

Creating new instances of java.lang.Boolean wastes memory, since Boolean objects
are immutable and there are only two useful values of this type.  Use the
Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects
instead.
checkstyle: space after comman (,)
findbugs: use StringBuffer in a loop

Method concatenates strings using + in a loop (SBSC_USE_STRINGBUFFER_CONCATENATION)

The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. This can lead to a cost quadratic in the number of iterations, as the growing string is recopied in each iteration.

Better performance can be obtained by using a StringBuffer (or StringBuilder in Java 1.5) explicitly.

For example:

  // This is bad
  String s = "";
  for (int i = 0; i < field.length; ++i) {
    s = s + field[i];
  }

  // This is better
  StringBuffer buf = new StringBuffer();
  for (int i = 0; i < field.length; ++i) {
    buf.append(field[i]);
  }
  String s = buf.toString();
findbugs: make inner class static

Should be a static inner class (SIC_INNER_SHOULD_BE_STATIC)

This class is an inner class, but does not use its embedded reference to the
object which created it.  This reference makes the instances of the class
larger, and may keep the reference to the creator object alive longer than
necessary.  If possible, the class should be made static.
Merge pull request #210 from candlepin/zeus/fixfindbugs

Fix various findbugs as reported by jenkins.