Vitaliy
Vitaliy

Reputation: 8206

Executing an unused lambda expression in debug session throws ClassNotFoundException

This is a bit nitpicky- I wonder if it's a bug or a feature:

I have this main in Intellij:

 public static void main(String[] args) throws InterruptedException {
    Comparator<String> comp = (s1,s2) ->  1;
    System.out.println("Break here");
 }

When I debug and break at the "System.out.." I see that comp is initialized. However, when I try to execute it from "Expression Evaluation" window I get a ClassNotFoundException!

Of course evaluating the same thing in code works perfectly. Is it somehow related to the way lambdas are implemented under the hood or just a bug in the IDE?

I am using Intellij 13.1.4.

Upvotes: 0

Views: 145

Answers (1)

Vic
Vic

Reputation: 22041

Evaluation of Lambda expressions is supported only starting from version 14.

Taken from What's New in IntelliJ IDEA 14 page:

enter image description here

Upvotes: 3

Related Questions