| javac compiles, eclipse doesn't [message #258404] | 
Mon, 02 February 2009 08:09   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: arend.reinersdorff.de 
 
Hi, 
 
I stumbled upon a piece of code that compiles with Sun's javac, but not  
with the Eclipse Batch Compiler: 
 
import java.lang.reflect.Constructor; 
import java.beans.ConstructorProperties; 
 
public class Test{ 
    void test() { 
        //remove comments around <?> 
        //and this compiles fine with the eclipse batch compiler 
        for (Constructor/*<?>*/ constr : Object.class.getConstructors()) { 
            constr.getAnnotation(ConstructorProperties.class).value(); 
        } 
    } 
} 
 
- Is it intended that the two compilers have different behavior in some  
cases? 
- If it's not intended, which compiler is right? Should this code compile  
or not? 
 
Thanks.
 |  
 |  
  | 
 | 
 | 
 | 
 | 
 | 
 | 
 | 
Powered by 
FUDForum. Page generated in 0.06576 seconds