java - Why does Eclipse compile this, but javac doesn't? -


We have some unit tests that run in compilation and precisely Eclipse 3.4, but when we compile them using Java If you try, it fails. I have managed to cut code in some small and self-sufficient, so there is no external dependency in it. The code itself does not understand much because it is out of context, but it does not matter - I need to know this That's why Javak does not like it:

  public class test {public zero test} (matchon (with some michur (.) (Another mile ()); } Zero MatchOn (Submachter Matter) {} Submachore Some Much () {Return New Submeter ()}} Matcher Another Matter () {Return Tap; }} Interface Matcher & lt; U, T & gt; {} Class Besamacher applies to Maitre {Mater & Lt;?,? & Gt; matte} with the public spat (back); }} The square submeter increases the bettemperature {@ with override public submeter (matter mitchure)) this return; }}  

I have tried JDK 1.5.0_10 and 1.6.0_13 , with the same result:

< Pre> test.java:6: Matches in the examination (test. Test can not be tested (test.BaseMatcher) with matchOn (some michaure (.) (Another mile ()); ^ 1 error

I think this is completely valid, the SubMatcher.with () method gives more specific types than BaseMatcher.with (), but the compiler feels that the return type Is basseterter However, it is possible that the eclipse compiler is not allowing it incorrectly.

Any thoughts?

You need to specify the type of parameters in the basmeter:

  {{Code>  

Javac with your method

with public sub-mother (Matcher & lt;?,? & Gt;

To allow matches

There is a bug in the Imho Eclipse compiler


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -