Community
Participate
Working Groups
I am using the JavaCodeFormatter in an ANT task. It works fine, as long as there are no annotations in the JAVA code. Adding a simple annotation like "@Deprecated" results with the following message: "The Eclipse formatter failed to format ...\src\bugsample\JavaCodeFormatterAnnotationBug.java. Skip the file." I attached the ANT and JAVA snippets below. I can't find any results for this problem with google. Is it a bug? Are the any config details i should consider? >>>ANT>>> <java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true" maxmemory="256m" > <jvmarg value="-Xms128m"/> <arg value="-clean"/> <arg value="-noupdate"/> <arg value="-data"/> <arg value="${eclipse.workspace}"/> <arg value="-application"/> <arg value="org.eclipse.jdt.core.JavaCodeFormatter"/> <arg value="-verbose"/> <arg value="-config"/> <arg value="${eclipse.formatter}"/> <arg value="${src.formatted}"/> <classpath> <pathelement location="${eclipse.startup.jar}"/> </classpath> </java> <<<ANT<<< >>>JAVA>>> package bugsample; public class JavaCodeFormatterAnnotationBug { @Deprecated public void annotationsJavaCodeFormatterBug() { } } <<<JAVA<<<
Could you please provide your config file? Thanks.
Created attachment 52743 [details] JavaCodeFormatter Annotation Bug Here is the config file.
Add: org.eclipse.jdt.core.compiler.compliance=1.5 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 org.eclipse.jdt.core.compiler.source=1.5 in your config file and let me know if this works.
I checked and it works with those three lines. I'll update the help to specify that these options also need to be set.
Doc task-232.htm updated. Closing as FIXED. To verify, please check the documentation.
It also works in my environment (thanks). It may also be helpfull to document how to create a minimal headless eclipse environment for this feature. I have created one that needs 10.174.729 Bytes for eclipse 3.2.1 to run the JavaDocFormatter by removing all unnecessary plungins with the trail & error strategy :-( I use this jars: startup.jar plugins com.ibm.icu_3.4.5.jar org.eclipse.core.commands_3.2.0.I20060605-1400.jar org.eclipse.core.contenttype_3.2.0.v20060603.jar org.eclipse.core.expressions_3.2.1.r321_v20060721.jar org.eclipse.core.filesystem_1.0.0.v20060603.jar org.eclipse.core.jobs_3.2.0.v20060603.jar org.eclipse.core.resources_3.2.1.R32x_v20060914.jar org.eclipse.core.runtime.compatibility_3.1.100.v20060603.jar org.eclipse.core.runtime_3.2.0.v20060603.jar org.eclipse.equinox.common_3.2.0.v20060603.jar org.eclipse.equinox.preferences_3.2.1.R32x_v20060717.jar org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar org.eclipse.jdt.core_3.2.1.v_677_R32x.jar org.eclipse.osgi_3.2.1.R32x_v20060919.jar org.eclipse.text_3.2.0.v20060605-1400.jar org.eclipse.update.configurator_3.2.1.v20092006.jar Are there any links for this issue? Thanks.
You should open a bug report against JDT/Doc to request this addition in the documentation. The documentation to fix this bug has been released yesterday.
Released for 3.3 M3.
Verified for 3.3 M3 using build I20061030-0010