Community
Participate
Working Groups
User-Agent: Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.2.15 Version/10.00 Build Identifier: M20090911-1628 when I run ecj-3.5.1RC4.jar from ant it shows several warnings: [unchecked] unchecked cast that are not highlited by compler when I work in IDE Reproducible: Always Steps to Reproduce: I have this code. In IDE - no warnings. private JComponent addListActiveProperty(DomainProperty property, String layout) { IListView<?> listView = lvFactory.create(property.dataType()); if (listView != null) { listView.setName(property.name()); listView.setTitle(property.displayName()); JComponent result = (JComponent) listView; this.add(result, StringUtils.coalesce(layout, "span, push, grow")); return (result); } return (null); } When run ecj-3.5.1RC4.jar from ant (run ant script inside IDE, but with Separate JRE option) I have following warnings: [javac] Note: C:\Temp\deploy\src\ka\presentation\builder\impl\DomainPanelBuilder.java uses unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. and after adding -Xlint:unchecked to javac comand I have this: [javac] C:\Temp\deploy\src\ka\presentation\builder\impl\DomainPanelBuilder.java:222: warning: [unchecked] unchecked cast [javac] found : ka.ui.intf.IListView<capture#914 of ?> [javac] required: javax.swing.JComponent [javac] JComponent result = (JComponent) listView; [javac] ^ [javac] C:\Temp\deploy\src\ka\presentation\builder\impl\DomainPanelBuilder.java:348: warning: [unchecked] unchecked cast [javac] found : ka.ui.intf.IListView<capture#375 of ?> [javac] required: javax.swing.JComponent [javac] this.add((JComponent)listView, StringUtils.coalesce(layout, "span, push, grow")); [javac] ^ [javac] C:\Temp\deploy\src\ka\presentation\builder\impl\DomainPanelBuilder.java:349: warning: [unchecked] unchecked cast [javac] found : ka.ui.intf.IListView<capture#824 of ?> [javac] required: javax.swing.JComponent [javac] return ((JComponent)listView); [javac] ^ [javac] 3 warnings Why it happens? As I understand in both cases used internal eclipse compiler.
You are not running our compiler inside your ant script. Do you have this line in your ant script ? <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" /> The ouput that you give looks like javac warning output, not the Eclipse compiler output.
Closing as INVALID. Reopen if you still have a problem once the Eclipse compiler is used inside the ant javac task.
Very strange... When I remove [compiler="modern"] from <javac> command all works fine. It seems that some how ant compile my classes by JDK6 compiler. But I don't configure JAVA_HOME to JDK6. It seems that because of I configure tools.jar in Ant-runtime-global entries to D:\JDK\j2sdk1.6_16\lib\tools.jar, ant is able to find JDK javac compiler and use it not regarding of <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" /> I also configure Ant-runtime-global entries: add exteranl jar: ecj-3.5.1RC4.jar now all works fine, but Is such behavior expected (compiler="modern")?
compiler=modern, this is javac, not the Eclipse compiler. You should report this against Ant and not JDT. Closing as INVALID.
Verified for 3.6 M3