Skip to content

[S1161] use staticanalysis.MissingOverrideAnnotation to avoid missing @Override on overriding and implementing methods #48344

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

Closed
wants to merge 1 commit into from

Conversation

Pankraz76
Copy link

@Pankraz76 Pankraz76 commented Jun 12, 2025

[S1161] fix build setup to avoid missing @Override on overriding and implementing methods by consolidating rewrite and spotless.

While its not required, it still seems best practice to do so.

take advantage of the compiler check:

refs:

Copy link

quarkus-bot bot commented Jun 12, 2025

/cc @ebullient (metrics), @jmartisk (metrics)

Copy link

quarkus-bot bot commented Jun 12, 2025

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@Pankraz76
Copy link
Author

Pankraz76 commented Jun 12, 2025

is there any chance you can incorporate such low prio but big impact, selfcare topic? @geoand

if you want to gain this increment and solve this flaws there is the need for static analysis.

As you seem to be complain with rewrite this seems the best fit to reduce this kind of avoidable friction.

ether by continue to ignore or to recognize and fix.

@geoand
Copy link
Contributor

geoand commented Jun 12, 2025

I'm traveling, so I haven't been able to look at anything that takes more than a few minutes

@Pankraz76
Copy link
Author

build now fixed flaws just like white spaces:

image

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/dependencies Pull requests that update a dependency file area/platform Issues related to definition and interaction with Quarkus Platform labels Jun 12, 2025
@Pankraz76
Copy link
Author

@gastaldi is this any good?

@Pankraz76
Copy link
Author

Pankraz76 commented Jun 12, 2025

hi @gsmet,

kindly request your call on this.

the parent seems to have all config already like expected. So the 9 times extra seems to be obsolete as all even the independent have luckily SSOT sharing same parent.

if one gets called, all should like sharing same root:

image

@quarkus-bot quarkus-bot bot added the area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure label Jun 12, 2025
@quarkus-bot quarkus-bot bot added area/hibernate-reactive Hibernate Reactive area/panache area/qute The template engine labels Jun 12, 2025
@@ -15,8 +15,29 @@

<packaging>pom</packaging>

<!-- please keep in alphabetical order -->
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only plugin can handle this.

- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
- dependency-name: net.revelc.code:impsort-maven-plugin
- dependency-name: org.openrewrite.maven:rewrite-maven-plugin
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great to only use rewrite and include eclipse format, currently implemented with formatter-maven-plugin/spot, into rewrite by supporting new format.

@timtebeek

@@ -48,12 +48,10 @@ public void collectInput() throws IOException {
return;
}
final TerminalConnection connection = new TerminalConnection();
connection.setSignalHandler(interruptionSignalHandler());
try {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -86,8 +86,8 @@ updates:
- dependency-name: org.apache.maven.plugins:*
- dependency-name: org.codehaus.mojo:*
- dependency-name: io.fabric8:docker-maven-plugin
- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spot is already added only for kotlin but not used.

As spot is covering the impsort-maven-plugin as well, we can have 2 for 1 plugin meaning only spot for having current functionality.

rewrite then goes beyond whitespaces fixing real issues and flaws.

Is this a way to go for the dev team?

This will integrate silent without breaking current workflow, but even fixing any.

@gsmet

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming as already in touch

the leal topic (licence) is not involved, right?
or does the plugin usage interfere anything? @timtebeek

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the leal topic (licence) is not involved, right?
or does the plugin usage interfere anything?

I fail to understand what you mean by this comment; can you provide more context when tagging folks?
It's hard to drop in somewhere and then having to parse a whole lot when you want my input on something.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sorry.

does the licence of rewrite effect on quarkus, when using the plugin?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So up to now, after some friendly coordination late last year, the folks at Quarkus are only using Apache Licensed components of OpenRewrite, such as the rewrite-maven-plugin, rewrite-core/java, rewrite-java-dependencies and of course rewrite-quarkus.

In this PR you look to be adding rewrite-static-analysis in independent-projects/parent/pom.xml as a build plugin. That would still be very much allowed by our licensing terms, but different teams have different tastes for exposure to other-than-traditional OSS licenses, even if it's just a build dependency.

From my earlier chats with the folks at Quarkus/Red Hat I'd say it's likely they'd be appreciative of the code changes made by recipes, but perhaps not willing to make rewrite-static-analysis part of their build pipeline. Any Apache Licensed recipes would not have any such hurdles to clear. I can't speak for them of course; just telling you what I'd expect.

Copy link
Author

@Pankraz76 Pankraz76 Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed exposition.

allowed by our licensing terms

So the licence seems not to be an issue, giving the ability to leverage rewrite-maven-plugin.

Is there an limit to only use rewrite-static-analysis, or could we use all the other goodness, as well?

Like rewrite-testing-frameworks, rewrite-rewrite highlighting bestpractices, as there are several different around.

Treat the plugin as found- and limitation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The licenses for every module are listed here:

The terms for the various licenses are here, with a clear FAQ at the end as well:

In short the folks here (and other end users in general) are welcome to use any of the Apache or MSAL modules for their own code and purposes.

@Pankraz76 Pankraz76 changed the title [S1161] fix build setup to avoid missing @Override on overriding and implementing methods by consolidating rewrite and spotless [S1161] migrating rewrite and spotless to avoid missing @Override on overriding and implementing methods Jun 13, 2025
@Pankraz76 Pankraz76 changed the title [S1161] migrating rewrite and spotless to avoid missing @Override on overriding and implementing methods [S1161] use rewrite to avoid missing @Override on overriding and implementing methods Jun 14, 2025
@Pankraz76 Pankraz76 marked this pull request as draft June 14, 2025 10:53
@Pankraz76 Pankraz76 changed the title [S1161] use rewrite to avoid missing @Override on overriding and implementing methods [S1161] use org.openrewrite.staticanalysis.MissingOverrideAnnotation to avoid missing @Override on overriding and implementing methods Jun 14, 2025
@Pankraz76 Pankraz76 changed the title [S1161] use org.openrewrite.staticanalysis.MissingOverrideAnnotation to avoid missing @Override on overriding and implementing methods [S1161] use staticanalysis.MissingOverrideAnnotation to avoid missing @Override on overriding and implementing methods Jun 14, 2025
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License of the module is not acceptable for the Quarkus build.

@gsmet gsmet closed this Jun 14, 2025
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jun 14, 2025
@Pankraz76
Copy link
Author

Thanks for update.

Then only alternative seems PMD to achieve common baseline:

Autofix is nice so have. Rewrite took too long anyways so it would be very hard to integrate considering the runtime gain of 1h plus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/amazon-lambda area/arc Issue related to ARC (dependency injection) area/config area/context-propagation area/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle area/grpc gRPC area/hibernate-orm Hibernate ORM area/hibernate-reactive Hibernate Reactive area/hibernate-search Hibernate Search area/hibernate-validator Hibernate Validator area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure area/kubernetes area/logging area/mailer area/maven area/metrics area/oidc area/panache area/platform Issues related to definition and interaction with Quarkus Platform area/qute The template engine area/redis area/rest area/rest-client area/resteasy-classic area/scheduler area/smallrye area/testing area/tracing area/vertx area/websockets triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants