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

Result of Source->Find broken externalized Strings is broken project #555

Closed
jjohnstn opened this issue Apr 28, 2023 · 3 comments · Fixed by #600
Closed

Result of Source->Find broken externalized Strings is broken project #555

jjohnstn opened this issue Apr 28, 2023 · 3 comments · Fixed by #600
Assignees
Labels
bug Something isn't working

Comments

@jjohnstn
Copy link
Contributor

@jjohnstn jjohnstn added the bug Something isn't working label Apr 28, 2023
@jjohnstn jjohnstn self-assigned this Apr 28, 2023
jjohnstn added a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue May 4, 2023
- add enhancement to be able to specify XXXX.usedproperties file which
  contains property keys known to be used (e.g. a key that gets
  dynamically created where it is used such as in ResourceAction
- modify NLSSearchResultRequestor to read .usedproperties files if
  they exist and keep a set of used properties
- modify NLSSearchQuery to check if an unused key has actually
  been specified as used via the .usedproperties file
- add new test to NLSSearchTest
- for eclipse-jdt#555
@jjohnstn
Copy link
Contributor Author

jjohnstn commented May 4, 2023

@carstenartur FYI, as the reporter of the original bug, I have posted a new enhancement PR to be able to specify messages that are known to be used so they won't show up when you do a Find broken externalized Strings. I do this by adding a .usedproperties file to protect various messages in the .properties file (as opposed to just adding comments). I intend to add these files for JDT UI for 4.28 M3 and do the final removal for 4.29 M1 to give external projects ample time to discover any internal message being used that isn't marked as used (there are already a few of these). One of the offenders was FoldingMessages.java which was an old style messages file and message keys were built dynamically so it fooled the find action.

@carstenartur
Copy link
Contributor

It's too long ago. I don't remember the details and I'm not sure that I have understood the reason for the malfunction already at the time I investigated.
Will orphaned strings like the ones from
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296836
be found now? And will they be removed? Or are they kept purly for backwards compatibility with your new approach? From my point of view another option removing nls keys could be to change the bundle version range on dependent bundles which allows a real cleanup (deletion) in the bundle. And for the "keep backward compatibility case" in an ideal world everything that has to be kept because of backwards compatibility should be marked somehow lightweight as deprecated near the orphaned entry itself. But maybe I should rather try your approach first. Thanks for putting effort on the bug report!

@jjohnstn
Copy link
Contributor Author

jjohnstn commented May 5, 2023

Orphaned messages with DO NOT REMOVE have been placed into the .usedproperties files I will commit soon so they will protected at least for the time-being.

jjohnstn added a commit that referenced this issue May 5, 2023
…em (#562)

* Add ability to specify used properties to avoid NLS search marking them

- add enhancement to be able to specify XXXX.usedproperties file which
  contains property keys known to be used (e.g. a key that gets
  dynamically created where it is used such as in ResourceAction
- modify NLSSearchResultRequestor to read .usedproperties files if
  they exist and keep a set of used properties
- modify NLSSearchQuery to check if an unused key has actually
  been specified as used via the .usedproperties file
- add new test to NLSSearchTest
- for #555
jjohnstn added a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue May 5, 2023
github-actions bot pushed a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue May 8, 2023
jjohnstn added a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue May 26, 2023
github-actions bot pushed a commit to jjohnstn/eclipse.jdt.ui-1 that referenced this issue Jun 8, 2023
jjohnstn added a commit that referenced this issue Jun 9, 2023
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants