Community
Participate
Working Groups
Statement.get/setLeadingComment does not work properly in 2.0. After consideration, this is not a good approach to dealing with the general issue of comments and significant whitespace. For instance: - can't handle multiple end-of-line comments that precede a statement - doesn't address analogous issue of trailing statement comments It's not clear what the best approach would be, but this ain't it. Consequently, it should be deleted (deprecated). We can add a better solution later. This is a breaking API change. However, AST.parseCompilationUnit never did set the leading comment for any AST nodes it creates, the change is moot for those client. Clients that use these methods to remember a comment with a node they create can achieve the same thing with ASTNode.get/setProperty, so there is no loss of functionality. See bug 28268 for a further discussion of the issue.
Entered bug 29178 for improved mechanism.
Added deprecation notices to Statement.get/setLeadingComment. No changes are required to the implementation.
Both methods are deprecated. Fixed and released in 2.1 stream. Why don't we simply remove them? To prevent compile errors?
Actually removing the methods would break binary compatibility (it would cause linkage errors in existing 2.0 plug-ins that reference these methods).
Verified.
Added API compatibility note to 2.1 release notes.