Boxing is the process of putting a primitive value into an analogous object, such as creating an ``++Integer++`` to hold an ``++int++`` value. Unboxing is the process of retrieving the primitive value from such an object.
Since the original value is unchanged during boxing and unboxing, there's no point in doing either when not needed. This also applies to autoboxing and auto-unboxing (when Java implicitly handles the primitive/object transition for you).
== Noncompliant Code Example
----
public void examineInt(int a) {
//...
}
public void examineInteger(Integer a) {
// ...
}
public void func() {
int i = 0;
Integer iger1 = Integer.valueOf(0);
double d = 1.0;
int dIntValue = new Double(d).intValue(); // Noncompliant