Menu

#609 Missed EI_EXPOSE_REP2

closed-rejected
5
2017-10-22
2008-06-13
Tim Keith
No

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.

Discussion

  • Mark Daly

    Mark Daly - 2008-11-24

    Repro/test case committed, reassigning for further investigation.

     
  • Mark Daly

    Mark Daly - 2008-11-24
    • assigned_to: nobody --> wpugh
     
  • Andrey Loskutov

    Andrey Loskutov - 2017-10-22
    • Status: open --> closed-rejected
     

Log in to post a comment.