Community
Participate
Working Groups
The Jenkins project contains below code: /** * Stores manually registered Descriptor instances. Keyed by the {@link Describable} type. */ @SuppressWarnings("rawtypes") private static final Map<Class, CopyOnWriteArrayList<ExtensionComponent<Descriptor>>> legacyDescriptors = new ConcurrentHashMap<>(); @SuppressWarnings({"unchecked", "rawtypes"}) private static <T extends Describable<T>> CopyOnWriteArrayList<ExtensionComponent<Descriptor<T>>> getLegacyDescriptors(Class<T> type) { return legacyDescriptors.computeIfAbsent(type, key -> new CopyOnWriteArrayList()); } Above code is parsed by Java 8 / 11 compiler without any problem. But AST parser returns error: Type mismatch: cannot convert from CopyOnWriteArrayList<ExtensionComponent<Descriptor>> to CopyOnWriteArrayList<ExtensionComponent<Descriptor<T>>> How to reproduce: 1. Download source of Jenkins project https://codeload.github.com/jenkinsci/jenkins/zip/master 2. Unpack and import core project into Eclipse 3. Go to jenkins-master\core\src\main\java\hudson\CopyOnWrite.java Error appears on 227 line number.
Seeing that the code extensively uses rawtypes, it has no priority for me personally (other team members may still have other views), because: - rawtypes were invented for the sole purpose for migrating from Java 1.4 to 5. I'm not aware of a valid excuse for writing/maintaining code like "new CopyOnWriteArrayList()" still in 2019. This basically indicates that you are not interested in type safety. If that's the case remove type arguments consistently. Combining the sophisticated type inference of Java 8 with rawtypes is broken by design. - javac is known to have bugs in this area, where it confuses equality and compatibility of type arguments. So even *if* I'd start investigation we wouldn't know if there's a bug in ecj to begin with. sorry
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.