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

chore: Never use wildcard imports #45372

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

punkratz312
Copy link

@punkratz312 punkratz312 commented Jan 5, 2025

Convention over configuration -> auto config over manual config:

Next, disable wildcard imports:
navigate to Editor -> Code Style -> Java -> Imports
and set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'.

https://stackoverflow.com/a/67844641/3388213

enforce with plugin: https://github.com/ec4j/editorconfig-maven-plugin

with * import

[ERROR] Failed to execute goal org.ec4j.maven:editorconfig-maven-plugin:0.1.3:check (default-cli) on project quarkus-development-mode-spi: 
[ERROR] 
[ERROR] There are .editorconfig violations. You may want to run
[ERROR] 
[ERROR]     mvn editorconfig:format
[ERROR] 
[ERROR] to fix them automagically.
[ERROR] 
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

without *

[INFO] --- formatter:2.24.1:validate (default-cli) @ quarkus-junit4-mock ---
[INFO] Processed 4 files in 19ms (Formatted: 0, Skipped: 4, Unchanged: 0, Failed: 0, Readonly: 0)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Quarkus - Core 999-SNAPSHOT:
[INFO] 
[INFO] Quarkus - Development mode - SPI ................... SUCCESS [  0.716 s]
[INFO] Quarkus - Core - Class Change Agent ................ SUCCESS [  0.027 s]
[INFO] Quarkus - IDE Launcher ............................. SUCCESS [  0.086 s]
[INFO] Quarkus - Builder .................................. SUCCESS [  0.608 s]
[INFO] Quarkus - Core ..................................... SUCCESS [  0.006 s]
[INFO] Quarkus - Core - Extension Processor ............... SUCCESS [  0.167 s]
[INFO] Quarkus - Core - Runtime ........................... SUCCESS [  0.580 s]
[INFO] Quarkus - Core - Deployment ........................ SUCCESS [  0.830 s]
[INFO] Quarkus - JUnit 4 Mock ............................. SUCCESS [  0.026 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.400 s
[INFO] Finished at: 2025-01-16T15:49:03+01:00
[INFO] ------------------------------------------------------------------------
[INFO] 9 goals, 9 executed

Vincent Potucek added 2 commits January 5, 2025 12:54
Next, disable wildcard imports: navigate to Editor -> Code Style -> Java -> Imports and set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'.
Copy link

quarkus-bot bot commented Jan 5, 2025

Thanks for your pull request!

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

  • description should not be empty, describe your intent or provide links to the issues this PR is fixing (using Fixes #NNNNN) or changelogs

This message is automatically generated by a bot.

@punkratz312 punkratz312 changed the title Add editorconfig Add editorconfig to set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'. Jan 8, 2025
@punkratz312
Copy link
Author

@geoand is this helpful to avoid the manual interaction?

@punkratz312 punkratz312 changed the title Add editorconfig to set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'. cjhore: IntelliJ: Never use wildcard imports Jan 14, 2025
@punkratz312 punkratz312 changed the title cjhore: IntelliJ: Never use wildcard imports cjhore: Never use wildcard imports Jan 14, 2025
@punkratz312 punkratz312 changed the title cjhore: Never use wildcard imports chore: Never use wildcard imports Jan 14, 2025
ozangunalp and others added 20 commits January 15, 2025 09:40
server properties no longer works with auto-config
This is done because I assume that was the original intent,
but also because it avoids the non-zero cost
incurred by Vert.x to look up the various
supported options
They both have the same result starting with 23.1. Runtime
initialization is public API while rerun is not, and will soon be
deprecated and at some point removed in future releases.

See oracle/graal#5013 (comment)
and oracle/graal#8323
This change does not have any impact in Mandrel/GraalVM for JDK 21 and
later versions, but allows Quarkus to build with Mandrel/GraalVM for JDK
17.
Starting with Mandrel/GraalVM for JDK 21
`RuntimeReinitializedClassBuildItem` is functionally the same with
`RuntimeInitializedClassBuildItem`.
In a traditional blocking and synchronous framework the opentelemetry context
is attached to ThreadLocal. In reactive programming, where multiple processings share the same event-loop thread, one has to use Vert.x duplicated contexts instead (see https://quarkus.io/guides/duplicated-context).
wrapWithSpan ensures that the pipeline is executed on a duplicated context (If the current context already is duplicated, it will stay the same. Therefore, nested calls to wrapWithSpan will all run on the same vert.x context).

inspired by Jan Peremsky (https://github.com/jan-peremsky/quarkus-reactive-otel/blob/c74043d388ec4df155f466f1d6938931c3389b70/src/main/java/com/fng/ewallet/pex/Tracer.java)
and edeandrea (https://github.com/quarkusio/quarkus-super-heroes/blob/main/event-statistics/src/main/java/io/quarkus/sample/superheroes/statistics/listener/SuperStats.java)

suggestions from review

I will squash with the previous commit once everything is approved

suggestion from reviewer

todo: squash when everything is done
-> adapt commit message. In this solution span and scope are local variables. no need for a stack.

unnecessary line removed

fix test to run on different contexts again

cleanup
Add helper methods for manual spans in mutiny pipelines
…container

Bump strimzi-test-container version from 0.107.0 to 0.109.1
Use VertxLogDelegateFactory for internal Vert.x logging
…eads

This is going to be useful once
netty/netty#14155 lands in Quarkus.
…-test-reuse-vertx-when-possible

OIDC: reuse shared Vert.x instance in DEV and test mode whenever it is possible
…testclient-with-dev-svc-for-oidc

OIDC: document and use OidcTestClient to get access token from Dev Services for OIDC
…rerun

Switch to runtime initialization instead of rerun
.editorconfig Outdated Show resolved Hide resolved
Vincent Potucek and others added 13 commits January 16, 2025 16:04
Next, disable wildcard imports: navigate to Editor -> Code Style -> Java -> Imports and set Class count to use import with '*' to 999. Do the same with Names count to use static import with '*'.
@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/docstyle issues related for manual docstyle review area/documentation area/kafka-streams area/netty area/oidc labels Jan 16, 2025
Copy link

🎊 PR Preview 0a44026 has been successfully built and deployed to https://quarkus-pr-main-45372-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

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/core area/dependencies Pull requests that update a dependency file area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/docstyle issues related for manual docstyle review area/documentation area/funqy area/gradle Gradle area/graphql area/kafka area/kafka-streams area/kubernetes area/maven area/netty area/oidc area/platform Issues related to definition and interaction with Quarkus Platform area/smallrye area/testing area/tracing area/vertx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants