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

Concurrency utilities #815

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

pizzi80
Copy link
Contributor

@pizzi80 pizzi80 commented May 6, 2024

No description provided.

Signed-off-by: pizzi80 <paolo@given2.com>
@BalusC
Copy link
Member

BalusC commented May 10, 2024

Please check javadoc of Utils class:

* This class is indeed intended for internal usage only. We won't add methods here on user request. We only add methods

@pizzi80
Copy link
Contributor Author

pizzi80 commented May 10, 2024

Yes but it's needed for future PR(s) of things that I would like to backport from my forked version

You asked for smaller PR(s), so I've splitted things, but It's time consuming and this was the easiest to backport ...

@BalusC
Copy link
Member

BalusC commented May 10, 2024

The idea is if you need to reuse exactly the same private static method from a different class, then it's OK to move it into Utils class. Right now it's used in only one class, the very one where it's being declared.

@BalusC
Copy link
Member

BalusC commented May 10, 2024

By the way, take a look at https://github.com/omnifaces/omniutils

A long time ago I've played with the idea to simply split/refactor all of OmniFaces "internal" util classes over there and adjust the OmniFaces build to shadow specific OmniUtils classes so we still end up with a single final JAR, but I couldn't get the build right. Perhaps it's time to take a second look.

cc: @arjantijms

@pizzi80
Copy link
Contributor Author

pizzi80 commented May 10, 2024

This is also a very big problem in Jakarta EE "modules"

looking at the code of some modules I saw a lot of copy pasted methods
and Utils class ....

OmniUtils could teorically be a Jakarta Utils standard module

@pizzi80
Copy link
Contributor Author

pizzi80 commented May 14, 2024

The idea is if you need to reuse exactly the same private static method from a different class, then it's OK to move it into Utils class. Right now it's used in only one class, the very one where it's being declared.

After some months or years, or if another commiter will need those method,
no one will remember that inside a class there is exaclty that utility method

Also no one will take care to make a proper refactor because:

  1. it will increase the number of classes modified with a single PR
  2. fear of bugs
  3. fear of git conflict with other PRs

my 2 cents ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants