Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] DocumentFormatter problem when pretty printing a class with comment tags

https://dev.eclipse.org/mailman/listinfo/jdt-dev says:
About jdt-dev

This is a mailing list for the discussion of JDT-wide or architectural issues - anything pertaining to the JDT as a whole. Proposals for changes in any of the JDT API should be advertised in this list. While this list is open to the public, it is intended for discussions related to the implementation of the relevant component. General questions about using Eclipse should be directed to the appropriate Eclipse newsgroup

Your issue is probably that you didn't supply the right source level when you called org.eclipse.jdt.core.ToolFactory#createCodeFormatter(Map)

Markus



From:        Julian Thomé <frostisch@xxxxxxxx>
To:        jdt-dev@xxxxxxxxxxx
Date:        2014-06-27 16:48
Subject:        [jdt-dev] DocumentFormatter problem when pretty printing a class        with comment tags
Sent by:        jdt-dev-bounces@xxxxxxxxxxx





Hello list,

I want to process a simple Java class with the DocumentFormatter. Whenever I wanted to format it with

edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, data, 0, data.length(), 0, null);

null was returned. The string variable data represents the class content. I figured that this problem occurs, if java comment tags like “@Override()” are included in the class. If I comment them out, the statement above works. Does anybody knows a proper solution for this issue ? I could preprocess the class file, and remove the comment tags, but what if I want them to be included in the AST ?

Thanks a lot in advance

Best regards,
  Julian



_______________________________________________
jdt-dev mailing list
jdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jdt-dev


Back to the top