Trying to detect bugs with structural search, need help

Answered

Hi!

I'm trying to detect instances of calling Flowable.subscribe(...) and ignoring the results (that is because the resulting object should be managed to avoid leaks).

 

To do this I have been using Structural search with this expression:

$exp$.subscribe($args$)

Constraint for $exp$: expression type = Flowable

Constraint for Complete Match = Value is read + Inverted condition

 

Unfortunately this triggers no results.  If I remove the constraint for Complete Match, it does find instances of calling subscribe on instances of type Flowable - so it seems the problem lies with the "value is read" constraint. 

Any idea? 

Thanks!

0
1 comment

Have you considered using Java | Probable bugs | Result of method call ignored inspection for this? You can run it by name via Analyze | Run Inspection by Name... action.

1

Please sign in to leave a comment.