IncompatibleClassChangeError example

Peter Levart peter.levart at
Sun Jun 9 08:24:23 PDT 2013


When I compile and run the following program with the latest tip of 
lambda repo:

import java.util.function.Function;
import java.util.function.Supplier;

public class ICCEBug {

     interface Value<T> extends Supplier<T> {
         default <R> Value<R> map(Function<? super T, ? extends R> mapper) {
             return new SuppliedValue<>(() -> mapper.apply(this.get()));

     static class SuppliedValue<T> implements Value<T> {
         private final Supplier<T> supplier;

         SuppliedValue(Supplier<T> supplier) {
             this.supplier = supplier;

         public T get() {
             return supplier.get();

     public static void main(String[] args) {
         Value<String> name = () -> "Peter";
         Value<String> sentence = -> "Hello " + nm + "!");

... I get the following exception:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class 
ICCEBug$$Lambda$2 does not implement the requested interface ICCEBug$Value
     at ICCEBug$Value.lambda$0(
     at ICCEBug$Value$$Lambda$3.get(Unknown Source)
     at ICCEBug$SuppliedValue.get(
     at ICCEBug.main(

It looks like something is not compiled correctly.

Regards, Peter

More information about the lambda-dev mailing list