Menu

#719 JSR 305 @Nonnegative false positive

closed-rejected
5
2017-10-22
2009-02-18
No

Findbugs 1.3.7 reports

TQ Value that might not carry the @@javax.annotation.Nonnegative annotation reaches a use requiring that annotation

for the test class below (the assignment in the setIntValue() method):

import javax.annotation.CheckForSigned;
import javax.annotation.Nonnegative;

public class TestSigned
{
@Nonnegative
private int fIntValue = 4711;

@Nonnegative
public int getIntValue()
{
return fIntValue;
}

public void setIntValue(@CheckForSigned int pIntValue)
{
if (pIntValue >= 0)
fIntValue = pIntValue;
}
}

Discussion

  • Mark Daly

    Mark Daly - 2009-02-18
    • assigned_to: nobody --> wpugh
     
  • Mark Daly

    Mark Daly - 2009-02-18

    Test case committed, reassigning for further investigation.

     
  • Andrey Loskutov

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

Log in to post a comment.