Menu

#1211 PMD is failing with NPE for rule UseIndexOfChar while analyzing Jdk 8 Lambda expression

PMD-5.1.2
closed
None
PMD
3-Major
Bug
5.1.1
2014-08-18
2014-06-18
subhajit
No

PMD analysis is failing with NPE for the rule UseIndexOfChar in version 5.1.1. This is happening while analyzing jdk 1.8 code i.e. when the code has lambda expression.

After through analysis I found that the below snippet of code is causing this NPE exception for this rule

code:
Optional<Service> optionalResult = null;
services.stream()
.filter(s -> s.getLastSeen() > 0)
.findFirst();

Please rectify this rule "UseIndexOfChar" to analyse jdk 8 code.

1 Attachments

Discussion

  • Andreas Dangel

    Andreas Dangel - 2014-07-13
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-Next
     
  • Andreas Dangel

    Andreas Dangel - 2014-07-13

    Will be fixed with the next release.

     

Log in to post a comment.