#1475 [java] MethodReturnsInternalArray: False positive

PMD-5.3.7
closed
java (55)
PMD
3-Major
Bug
5.4.1
MethodReturnsInternalArray
2016-06-25
2016-04-28
No

I have a class with the following field:

private static final byte[] DATA = {};

I directly return it from a method:

protected final byte[] getData()
{
    return DATA;
}

And it is marked as a violation of MethodReturnsInternalArray despite the fact this array is not modifiable.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2016-04-30
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: PMD-5.4.1 --> PMD-5.3.7
     
  • Andreas Dangel

    Andreas Dangel - 2016-06-25
    • labels: --> java
    • summary: False positive of MethodReturnsInternalArray --> [java] MethodReturnsInternalArray: False positive
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks