Skip to main content

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

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





Back to the top