Community
Participate
Working Groups
Eclipse compiler reports error "The constructor [...] is undefined", where there is the constructor's name in the place of [...]. Program compiles perfectly with Sun's JDK 1.5. What is more, the error is not reported after cleaning and building whole project. Program also starts after clean & build. The constructors TypedInput<T>( Class<T>) and TypedOutput<T>( Class<T>) are defined in internal class as shown below. Eclipse's internal compiler reports 2 errors in the method void test() complaing that constructor is undefined. public class Processor { public static class Contract extends InputClass { int getInputIndex() { return 0; } boolean isRequired() { return true; } public int getNumber() { return getInt( 0); } public Date getDate() { return getDate( 1); } public double getValue() { return getDouble( 2); } } public static class State extends OutputClass { int getOutputIndex() { return 0; } public void setNumber( int nr) { setInt( 0, nr);} public void setDate( Date data) { setDate( 1, data);} public void setValue( double stan) { setDouble( 2, stan);} public void setDelay( int opoznienie) { setInt( 3, opoznienie);} } public class TypedInput< T extends InputClass> { T templateObject; T currentObject; boolean endOfData = false; TypedInput( Class<T> templateClass) throws InstantiationException, IllegalAccessException, InterruptedException, CloneNotSupportedException { this.templateObject = templateClass.newInstance(); } void advance() { //doing something } boolean isEndOfData() { return this.endOfData; } T getCurrent() { return this.currentObject; } } class TypedOutput< T extends OutputClass> { private T templateObject; public TypedOutput( Class<T> templateClass) throws InstantiationException, IllegalAccessException { templateObject = templateClass.newInstance(); } void write( T outputObject) throws InterruptedException { } } public void test() { TypedInput<Contract> dateInput = new TypedInput<Contract>( Contract.class); TypedOutput<State> stateOutout = new TypedOutput<State>( State.class); } }
Can you please provide us with the complete testcase so we don't have to guess at what the missing types look like.
Created attachment 17625 [details] complete test case
If I change the declaration of the method Processor.test() to: public void test() throws IllegalAccessException, InstantiationException { ... } I get no errors at all. Which build are you running?
Created attachment 17644 [details] extended test case
thanks for the testcase. Added GenericType test493
(In reply to comment #5) > thanks for the testcase. > > Added GenericType test493 Excellent! I'm looking forward to the next milestone.
Verified in I20050215-2300