Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 531414

Summary: JDT compiler fails to compile legitimate Java code
Product: [Eclipse Project] JDT Reporter: Lyor Goldstein <lgoldstein>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: jarthana, stephan.herrmann
Version: 4.7.2   
Target Milestone: 4.8 M6   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Lyor Goldstein CLA 2018-02-20 10:38:25 EST
I have some CQEngine code that compiles and runs just fine when compiled and generated via Maven and the JDK compiler. However, when compiled by JDT it fails and creates a malformed class which means I cannot debug the code. Furthermore, this same code used to compile and run just fine up until a few days back when some patch/update of the JDT was applied. I can't say which - I just clicked Install when the update dialog was presented - I suspect some interference from the Groovy JDT plugin but cannot confirm. Basically, it claims that the following code invokes a non-existing constructor:

public abstract class NonConcurrentAbstractMapBasedAttributeIndex<A, O, MapType extends Map<A, StoredResultSet<O>>> extends AbstractAttributeIndex<A, O> {

    protected NonConcurrentAbstractMapBasedAttributeIndex(
        Factory<MapType> indexMapFactory,
        Factory<StoredResultSet<O>> valueSetFactory,
        Attribute<O, A> attribute, Set<Class<? extends Query>> supportedQueries) {
    super(attribute, supportedQueries);
}

The error is: 

"The constructor AbstractAttributeIndex<A,O>(Attribute<O,A>, Set<Class<? extends Query>>) is undefined"

But if we look at AbstractAttributeIndex we see this is not the case:

public abstract class AbstractAttributeIndex<A, O> implements AttributeIndex<A, O> {
    protected AbstractAttributeIndex(Attribute<O, A> attribute, Set<Class<? extends Query>> supportedQueries) {
        ...
    }
}

I will try to create an installation without Groovy - just to make sure - and it is the Groovy JDT plugin I will update the issue accordingly.
Comment 1 Lyor Goldstein CLA 2018-02-21 00:32:03 EST
I think I have confirmed this to be a Groovy JDT issue:

1. I re-installed Eclipse Oxygen 2 with (!) Groovy support and JDT "patch" and the problem was re-produced
2. After re-installing Eclipse Oxygen 2, this time without any Groovy support the problem was not re-produced

Luckily I no longer need Groovy support (at least not in the near future), but the issue should be resolved. Can we re-assign this bug to the Greclipse team somehow or do I need to open a new bug (where ?).
Comment 2 Lyor Goldstein CLA 2018-02-21 00:59:20 EST
Some further research might seem to indicate that this happens if one uses the nightly snapshot instead of the release - but it may indicate a bug nevertheless
Comment 3 Jay Arthanareeswaran CLA 2018-02-21 01:06:49 EST
(In reply to Lyor Goldstein from comment #1)
> Luckily I no longer need Groovy support (at least not in the near future),
> but the issue should be resolved. Can we re-assign this bug to the Greclipse
> team somehow or do I need to open a new bug (where ?).

I suppose the link is mentioned here:

http://groovy.apache.org/
Comment 4 Stephan Herrmann CLA 2018-02-21 05:31:31 EST
(In reply to Jay Arthanareeswaran from comment #3)
> (In reply to Lyor Goldstein from comment #1)
> > Luckily I no longer need Groovy support (at least not in the near future),
> > but the issue should be resolved. Can we re-assign this bug to the Greclipse
> > team somehow or do I need to open a new bug (where ?).
> 
> I suppose the link is mentioned here:
> 
> http://groovy.apache.org/

Or more specificially for groovy-eclipse: https://github.com/groovy/groovy-eclipse

(In reply to Lyor Goldstein from comment #2)
> Some further research might seem to indicate that this happens if one uses
> the nightly snapshot instead of the release - but it may indicate a bug
> nevertheless

I'm confused by this statement: is there any version of Eclipse that causes the problem *without* groovy-eclipse installed? If so, which?
Comment 5 Sasikanth Bharadwaj CLA 2018-03-07 01:06:22 EST
Verified for 4.8 M6