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

Bug 427808

Summary: [1.8] Correct super() invocation is not inferred when argument is a conditional expression
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: manoj.palat, srikanth_sankaran
Version: 4.4   
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 427787    

Description Jay Arthanareeswaran CLA 2014-02-10 10:46:20 EST
This code is rejected by ECJ, but allowed by Javac:

public class X extends Foo {
	public X(I i) {
		super(i != null ?  i.toString() : null);
    }
}

class Foo implements I {
	Foo(I i) {}
	Foo(String string){}
}
interface I {}
Comment 1 Srikanth Sankaran CLA 2014-02-10 11:04:13 EST
Are you sure this is the correct fragment ? Or perhaps your workspace does 
not have all the changes ? I can believe this problem existed last week,
as of now this code compiles fine and the overloaded call is resolved
fine.
Comment 2 Srikanth Sankaran CLA 2014-02-10 11:10:47 EST
Released test (passes) OverloadResolutionTest8.test427808()

Jay, thanks for double checking and closing if an operator error or posting
the right snippet.
Comment 3 Srikanth Sankaran CLA 2014-02-10 22:10:07 EST
Earlier observation based on workspace with HEAD sources.

I also checked it is not reproducible with 

  Eclipse Java Development Tools Patch for Java 8 Support (BETA)	1.0.0.v20140210-0105_BETA_JAVA8	org.eclipse.jdt.java8patch.feature.group	Eclipse.org
Comment 4 Jay Arthanareeswaran CLA 2014-02-10 22:16:33 EST
Sorry, I was using a week old update bits. After updating jdt, I no longer see the error.
Comment 5 Manoj N Palat CLA 2014-02-21 05:51:10 EST
Verified as working for Eclipse + Java 8 RC1 using Kepler SR2(RC4) +   
Eclipse Java Development Tools Patch for Java 8 Support (BETA)   
1.0.0.v20140220-2054