Java generics code compiles with javac, fails with Eclipse Helios

后端 未结 8 1656
挽巷
挽巷 2020-12-16 02:53

I have the following test class that uses generics to overload a method. It works when compiled with javac and fails to compile in Eclipse Helios. My java version is 1.6.0_2

8条回答
  •  没有蜡笔的小新
    2020-12-16 03:29

    It would be possible if javac had a bug in it. Javac is just software and is as liable to bugs as any other piece of software.

    Plus, the Java Language Spec is very complex and a little bit vague in places so it could also be down to a difference in interpretation between the Eclipse guys and the javac guys.

    I would start by asking this on the Eclipse support channels. They're normally very good at picking up these things and explaining why they think they're right or else admitting that they're wrong.

    For the record, I think Eclipse is right here, too.

提交回复
热议问题