Skip to content

javax.annotation.processing is migrated to non-existent jakarta.annotation.Processing #731

@dnl50

Description

@dnl50

What version of OpenRewrite are you using?

I am using

  • Gradle Plugin 7.6.1
  • rewrite-migrate-java:3.9.0

How are you running OpenRewrite?

Using the Gradle Plugin applied in the root Project of a multi-project build with the org.openrewrite.java.migrate.jakarta.JakartaEE10 recipe activated.

What is the smallest, simplest way to reproduce the problem?

Applying the org.openrewrite.java.migrate.jakarta.JavaxAnnotationMigrationToJakartaAnnotation recipe to the following class replaces the javax.annotation.processing package with the non-existent jakarta.annotation.processing package.

package org.example;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;

@SupportedAnnotationTypes("org.example.MyAnnotation")
public class MyAnnotationProcessor extends AbstractProcessor {

    @Override
    public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
        return false;
    }

}

What did you expect to see?

The class should not have been changed, because the javax.annotation.processing package is part of the Pluggable Annotation Processing API which is part of the JDK.

Are you interested in contributing a fix to OpenRewrite?

Yes, should be an easy fix

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions