Bug 527462 - UnresolvedReferenceBindings surfacing through DOM AST caused by array annotation value
Summary: UnresolvedReferenceBindings surfacing through DOM AST caused by array annotat...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.8   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 4.8 M4   Edit
Assignee: Till Brychcy CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 155115
Blocks:
  Show dependency tree
 
Reported: 2017-11-19 18:01 EST by Till Brychcy CLA
Modified: 2017-12-07 21:59 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Till Brychcy CLA 2017-11-19 18:01:31 EST
While examining a compilation problem with dagger 2 ( see https://github.com/google/dagger/issues/912 ), I noted that the fix for bug 155115 is note complete: I doesn't handle the case that the annotation value is an array.

(To reproduce, you can try the repository at https://github.com/AndreasMager/eclipse-dagger-test. Note: The example still doesn't compile with this fix, but another error appears, that may be either caused by a bug in dagger 2 or eclipse.)

I've created a junit test based on the regression test for bug 155115.

binaries.jar contains now sources corresponding to:
---anno/Anno.java
package anno;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
public @interface Anno {
	Class<?> clz();
}
---anno2/Anno2.java
package anno2;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
public @interface Anno2 {
	Class<?>[] clz2();
}
---binary/A.java
package binary;

import anno.Anno;
import intf.IFoo.IBar;

public class A {
	@Anno(clz = IBar.class)
	public void f() {
	}
}
---binary/B.java
package binary;

import anno.Anno;
import intf.IFoo.IBar;

public class B extends A {
	@Anno(clz = IBar.class)
	public void f() {
	}
}
---binary2/A2.java
package binary2;

import anno2.Anno2;
import intf.IFoo.IBar;

public class A2 {
	@Anno2(clz2 = IBar.class)
	public void f() {
	}
}
---binary2/B2.java
package binary2;

import anno2.Anno2;
import intf.IFoo.IBar;

public class B2 extends A2 {
	@Anno2(clz2 = IBar.class)
	public void f() {
	}
}
---intf/IFoo.java
package intf;

public interface IFoo {
	public interface IBar {
	}
}
Comment 1 Eclipse Genie CLA 2017-11-19 18:03:52 EST
New Gerrit change created: https://git.eclipse.org/r/111870
Comment 3 Till Brychcy CLA 2017-11-20 01:08:09 EST
(In reply to Eclipse Genie from comment #2)
> Gerrit change https://git.eclipse.org/r/111870 was merged to [master].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/
> ?id=5e9dc14ad257d6505dfe342d7a494a066df77c89

Released for 4.8M4
Comment 4 Till Brychcy CLA 2017-12-07 05:15:21 EST
(In reply to Till Brychcy from comment #0)
> (To reproduce, you can try the repository at
> https://github.com/AndreasMager/eclipse-dagger-test. Note: The example still
> doesn't compile with this fix, but another error appears, that may be either
> caused by a bug in dagger 2 or eclipse.)

BTW: The this other problem is handled in bug 527530
Comment 5 Manoj N Palat CLA 2017-12-07 21:59:16 EST
Verified for Eclipse Photon 4.8 M4 with Build id: I20171206-2000