2

I am using latest IntelliJ Idea ultimate version 2020.1.4 and trying to debug my unit tests. My unit test is run as gradle test. When I evaluate a java method which returns a List , I can see all the values in the list but the moment I try to access the stream() and use filter in the evaluation window I get compilation error.

Just evaluating list.stream() seems to work but adding filter has got some issues. enter image description here

This is when I use .stream() on my list. enter image description here And thats the error I get enter image description here

This used to work in the older version of idea.Any pointers what can be the reason ?

java2017
  • 158
  • 2
  • 12
  • `getListValues()` seems to not be found? And that has nothing to do with streams? – Lino Aug 21 '20 at 07:23
  • That's what I find strange.if I evaluate just list it gives me correct values. But if I evaluate list.stream().filter(somefilter condition using -> operator), I get method not found error. – java2017 Aug 21 '20 at 07:48
  • Can you please provide a [mre], currently as it stands your question is unanswerable, there is *not* enough information, so please [edit] your question with a real example, one which you expect to work, but doesn't – Lino Aug 21 '20 at 07:51
  • @Lino-Votedon'tsayThanks I have edited my post with screen captures from real debug. Hope this explains the problem better. – java2017 Aug 21 '20 at 08:04
  • I assume that the debugger has problems when resolving the inferred types. What you can do is assiting the debugger with "type hints" e.g: `.filter((ValidDocumentTransactionNotification vdtn) -> your_condition)` and also by using a terminating operation. I've experienced similar errors where IntelliJ would mark a complete unaffected piece of code as an error even though the problem was somewhere else – Lino Aug 21 '20 at 08:10
  • 1
    Also if you can't find anymore information I suggest having a look at the [Jetbrains Issue Tracker](https://youtrack.jetbrains.com/) and if you still find nothing there, feel free to open up a Bug – Lino Aug 21 '20 at 08:11
  • Thanks for the suggestion @Linobut unfortunately it didn't work as ValidDocumentTransactionNotification is not a functional interface. My compilation error mentioned this. – java2017 Aug 21 '20 at 08:14

0 Answers0