Skip to content

line comment gets removed and causes indentation errors during AST rewrite operations #1962

Closed

Description

@martinlippert

It looks like line comments are confusing the AST rewrite logic:

	/**
	 * method comment
	*/
	// some doc
	<*>@Async
	@Transactional
	@TransactionalEventListener
	public void handleOrderPaidEvent(OrderPaid event) {

when replacing the three annotations with @ApplicationModuleListener, it removes the line comment above:

	/**
	 * method comment
	*/
	@ApplicationModuleListener
	public void handleOrderPaidEvent(OrderPaid event) {

When the line comment has no proper line indentation, it causes the new annotation to have no proper line indentation:

	/**
	 * method comment
	*/
// some doc
	<*>@Async
	@Transactional
	@TransactionalEventListener
	public void handleOrderPaidEvent(OrderPaid event) {

turns into:

	/**
	 * method comment
	*/
@ApplicationModuleListener
	public void handleOrderPaidEvent(OrderPaid event) {

Note: if there is no method comment, the line comment is not touched and everything works fine.

Activity

  1. added this to the 5.4.0.RELEASE milestone on Aug 12, 2026
  2. added a commit that references this issue on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions