Frage

I have check out spring framework code from

https://github.com/spring-projects/spring-framework.git

In order to import the code in Eclipse / STS, I followed the instructions mentioned in

import-into-eclipse.bat

but I am getting following error in STS/ Eclipse

Duplicate methods named computeIfPresent with the parameters (K, BiFunction) and (K, BiFunction) are inherited from the types ConcurrentMap and Map

I get similar error for multiple methods in ConcurrentReferenceHashMap.java

  • Duplicate methods named computeIfPresent with the parameters (K, BiFunction) and (K, BiFunction) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named merge with the parameters (K, V, BiFunction) and (K, V, BiFunction) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named getOrDefault with the parameters (Object, V) and (Object, V) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named forEach with the parameters (BiConsumer) and (BiConsumer) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named replaceAll with the parameters (BiFunction) and (BiFunction) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named computeIfAbsent with the parameters (K, Function) and (K, Function) are inherited from the types ConcurrentMap and Map
    • Duplicate methods named compute with the parameters (K, BiFunction) and (K, BiFunction) are inherited from the types ConcurrentMap and Map

I am using java 8, some classes use java.lang.reflect.Parameter class which does not exist in java 7. I have tried multiple versions of Eclipse / STS without any success.

Also, if i do gradle build from command line, I get no errors (tests skipped)

Please suggest what could be the problem.

War es hilfreich?

Lösung

IntelliJ IDEA comes to rescue. IntelliJ reports no errors.

After some search i noticed that Eclipse has history of this problem, though it was reported for JDK 5 and 6. I am not sure why this happening for JDk 8 as well. Also, as per eclipse bugzilla this bug has already been fixed for eclipse 3.8 but some thing in JDK 8 seems to break their fix or fix is not portable to different version of JDK.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top