简体   繁体   中英

guava source code in IDEA has errors ,what 's happen

I want to study guava .so i want to build from source code
1:git clone https://code.google.com/p/guava-libraries/
2:import to IDEA
3:then Absent class has error
the error is Class Absent must either be declared abstract or implements abstract method transform(Function) in Optional
the more info ,see attach file
how to solve it ?
在此处输入图片说明

在此处输入图片说明

在此处输入图片说明

The abstract class Optional has the following function:

public abstract <V> Optional<V> transform(Function<? super T, V> function);

The class Absent implements it like this:

@Override public <V> Optional<V> transform(Function<Object, V> function) {

This is correct Java. I think Idea has a bug here, when it does not recognize this overriding correctly. However you should be able to compile this code, because for compiling Idea uses the javac compiler.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM