Bug 162390 - JavaCodeFormatter Annotation Bug
Summary: JavaCodeFormatter Annotation Bug
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-26 08:24 EDT by Bogdan Gohr CLA
Modified: 2006-10-30 06:38 EST (History)
0 users

See Also:


Attachments
JavaCodeFormatter Annotation Bug (20.35 KB, text/plain)
2006-10-26 08:58 EDT, Bogdan Gohr CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bogdan Gohr CLA 2006-10-26 08:24:38 EDT
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<<<
Comment 1 Olivier Thomann CLA 2006-10-26 08:50:47 EDT
Could you please provide your config file?
Thanks.
Comment 2 Bogdan Gohr CLA 2006-10-26 08:58:14 EDT
Created attachment 52743 [details]
JavaCodeFormatter Annotation Bug

Here is the config file.
Comment 3 Olivier Thomann CLA 2006-10-26 09:04:22 EDT
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.
Comment 4 Olivier Thomann CLA 2006-10-26 18:16:29 EDT
I checked and it works with those three lines.
I'll update the help to specify that these options also need to be set.
Comment 5 Olivier Thomann CLA 2006-10-26 18:25:59 EDT
Doc task-232.htm updated.
Closing as FIXED.
To verify, please check the documentation.
Comment 6 Bogdan Gohr CLA 2006-10-27 01:42:06 EDT
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.
Comment 7 Olivier Thomann CLA 2006-10-27 14:06:04 EDT
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.
Comment 8 Frederic Fusier CLA 2006-10-29 07:55:15 EST
Released for 3.3 M3.
Comment 9 David Audel CLA 2006-10-30 06:38:44 EST
Verified for 3.3 M3 using build I20061030-0010