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

[util] Add abbreviate method to StringUtils #4164

Merged
merged 1 commit into from Apr 6, 2024

Conversation

lsiepel
Copy link
Contributor

@lsiepel lsiepel commented Apr 1, 2024

While trying to remove the apache libs from the addons i found one more string method that should be moved to this core utility.

It is used in the Max binding, i'll update the related PR accordingly: openhab/openhab-addons#14413

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel requested a review from a team as a code owner April 1, 2024 09:48
Copy link
Contributor

@andrewfg andrewfg left a comment

Choose a reason for hiding this comment

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

LGTM

@J-N-K
Copy link
Member

J-N-K commented Apr 4, 2024

Is there any other use of this method? It seems a very rare case and should probably be added to the binding code if it is not used elsewhere.

@lsiepel
Copy link
Contributor Author

lsiepel commented Apr 4, 2024

Is there any other use of this method? It seems a very rare case and should probably be added to the binding code if it is not used elsewhere.

I cannot oversee all binding code, but i'm not aware at any other usage at this moment in time. As abbreviating strings is a common scenario i would not classify it as very rare. I expect other bindings might benefit in the future too. Besides it is a small method.

@andrewfg
Copy link
Contributor

andrewfg commented Apr 4, 2024

It's surely a chicken and egg situation. If the utility is / would be, present. Then it will / would have been, used.

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Apr 6, 2024
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM

@J-N-K J-N-K added this to the 4.2 milestone Apr 6, 2024
@J-N-K J-N-K merged commit f18c50f into openhab:main Apr 6, 2024
3 checks passed
@J-N-K J-N-K changed the title [util] Add abbreviate method [util] Add abbreviate method to StringUtils Apr 6, 2024
@lsiepel lsiepel deleted the stringutils_abbreviate branch April 7, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants