| Summary: | [1.8] CCE when trying to parse method reference expression with inappropriate type arguments | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
| Component: | Core | Assignee: | Jay Arthanareeswaran <jarthana> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jarthana, manoj.palat, srikanth_sankaran | ||||
| Version: | 4.3 | Flags: | srikanth_sankaran:
review+
|
||||
| Target Milestone: | BETA J8 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I'll grab this one as it is my code that is faulty. *** Bug 412257 has been marked as a duplicate of this bug. *** Created attachment 233193 [details]
Proposed fix + Test
(In reply to comment #4) > Created attachment 233193 [details] > Proposed fix + Test Patch looks good. Two changes requested: (1) I think we should have a conform test that shows that emitted code is correct and its behavior matches RI. (2) Add a test from the duplicate. (In reply to comment #5) > (In reply to comment #4) > > Created attachment 233193 [details] > > Proposed fix + Test > > Patch looks good. Two changes requested: Corrected and released the fix here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=39cfeabaf2630f8aaf01c3058d94b243711e01e5 |
BETA_JAVA8 CCE when trying to parse method reference expression with inappropriate type arguments: //--------------------- package jsr335; import java.io.Serializable; import java.util.concurrent.Callable; public class MethodReference { class Inner<E> { } void foo() { Callable<Inner<String>> fi = MethodReference.Inner::<Serializable> new; } } //--------------------- Note that the example doesn't make sense, and I didn't try to make it "right". Similar exceptions happen when I remove the <Serializable> or add type arguments after MethodReference.Inner. java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.RawTypeBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.NestedTypeBinding at org.eclipse.jdt.internal.compiler.ast.ReferenceExpression.generateCode(ReferenceExpression.java:119) at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.generateCode(LocalDeclaration.java:143) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:304) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.generateCode(AbstractMethodDeclaration.java:249) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:566) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:635) at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:367) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1213) at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:692) at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1186) at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)