In the code below, findbugs reports "May expose internal representation by incorporating reference to mutable object" on the assignment to this.args2 but not on this.args1. I think that any control flow that allows the argument to be assigned to the field should trigger the bug.
public static class Class1 {
private static final Object[] NO_ARGS = new Object[] {};
private final Object[] args1;
private final Object[] args2;
public Class1(Object[] args1, Object[] args2) {
this.args1 = args1 == null ? NO_ARGS : args1;
this.args2 = args2;
}
}
I'm using version 1.3.4.20080506 of the eclipse plugin.
Repro/test case committed, reassigning for further investigation.