Inspection: doesn't ignore some non-library methods

Answered

I have a Validator class with many static methods that are (implicitly) @pure and return one of their parameters to allow chaining.

Some usages at random are flagged by the "Result of method call ignored" inspection. In the settings of this inspection I haven't added any project classes to the list and I haven't checked the checkbox. According to the description it should flag NO project classes like this, but it does. How can I solve this?

 

 

 

IntelliJ IDEA 2017.3.4 (Community Edition)
Build #IC-173.4548.28, built on January 30, 2018
JRE: 1.8.0_152-release-1024-b11 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-112-generic

 ^ But also on my other PC with W10

0
4 comments

Inspection reports all methods with the 

@Contract(pure = true)

implicitly or explicitly. Is this the case?

0

So,

  • Calls to Methods annotated with org.jetbrains.annotations.Contract(pure=true)

means implicit and explicit?

My code doesn't have explicit annotations so I thought this would not apply. The '@' mark in the side line says 'Inferred annotations available. To me that sounds like the annotation is not 'applied' yet until added to the method.

I don't want to add either @Contract(pure = true) to the method (because that will trip this inspection) nor @Contract(pure = false) because that gives misinformation about the method.

0

Could you please file an issue at https://youtrack.jetbrains.com/issues/IDEA with an example code that is wrongly reported by the inspection?

0

Please sign in to leave a comment.