Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateBeanManagerMethods refactors fireEvent(event, qualifier) incorrectly #597

Closed
cortlepp opened this issue Nov 7, 2024 · 1 comment · Fixed by #599
Closed

UpdateBeanManagerMethods refactors fireEvent(event, qualifier) incorrectly #597

cortlepp opened this issue Nov 7, 2024 · 1 comment · Fixed by #599
Assignees
Labels
bug Something isn't working

Comments

@cortlepp
Copy link

cortlepp commented Nov 7, 2024

What version of OpenRewrite are you using?

I am using

  • Maven/Gradle plugin 5.43.4
  • rewrite-migrate-java 2.28.0

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a multi module project, but I ran the recipe for each module individually.

	<plugin>
		<groupId>org.openrewrite.maven</groupId>
		<artifactId>rewrite-maven-plugin</artifactId>
		<version>5.43.4</version>
		<configuration>
			<activeRecipes>
				<recipe>org.openrewrite.java.migrate.jakarta.UpdateBeanManagerMethods</recipe>
			</activeRecipes>
			<skipMavenParsing>true</skipMavenParsing>
		</configuration>
		<dependencies>
			<dependency>
				<groupId>org.openrewrite.recipe</groupId>
				<artifactId>rewrite-migrate-java</artifactId>
				<version>2.28.0</version>
			</dependency>
		</dependencies>
	</plugin>

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

class A {
    void foo(Object event, Annotation qualifier) {
        CDI.current().getBeanManager().fireEvent(object, qualifier);
    }
}

What did you expect to see?

class A {
    void foo(Object event, Annotation qualifier) {
        CDI.current().getBeanManager().select(qualifier).fire(object);
    }
}

What did you see instead?

class A {
    void foo(Object event, Annotation qualifier) {
        CDI.current().getBeanManager().fire(object);
    }
}

What is the full stack trace of any errors you encountered?

There were no errors, it just silently omitted the qualifier.

Are you interested in contributing a fix to OpenRewrite?

Depends on the effort that is required, but generally yes.

@cortlepp cortlepp added the bug Something isn't working label Nov 7, 2024
timtebeek added a commit that referenced this issue Nov 11, 2024
@timtebeek
Copy link
Contributor

Thanks for the report @cortlepp ! Had no idea about those extra parameters. Fixed now in

@timtebeek timtebeek moved this to Ready to Review in OpenRewrite Nov 11, 2024
@timtebeek timtebeek self-assigned this Nov 11, 2024
timtebeek added a commit that referenced this issue Nov 11, 2024
* Retain BeanManager `firstEvent` annotations

Fixes #597

* Reduce warnings
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants