Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Externalize strings error(Created Messages class has errors)
Externalize strings error [message #1857889] Fri, 03 March 2023 17:58 Go to next message
jeff prisco is currently offline jeff priscoFriend
Messages: 2
Registered: March 2023
Junior Member
I am running :

Version: 2022-12 (4.26.0)
Build id: 20221201-1913

When I use the "Externalized Strings" function the generate Messages class has the following error for the indicated lne.


private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; //$NON-NLS-1$

the method getPackageName() is undefined for the type Class<Messages>

I'm new to the forum and wondering if this is the right place for the question and if there's some secret sauce needed to make the function work.

Appreciate any help.
Re: Externalize strings error [message #1857893 is a reply to message #1857889] Sat, 04 March 2023 07:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
That Class method is new to Java 9
     * @since 9
     * @jls 6.7 Fully Qualified Names
     */
    public String getPackageName() {
I guess someone change the implementation and didn't consider that this method is not always available. I guess you can change it by hand to hard code the package name...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Externalize strings error [message #1857913 is a reply to message #1857893] Mon, 06 March 2023 12:57 Go to previous messageGo to next message
jeff prisco is currently offline jeff priscoFriend
Messages: 2
Registered: March 2023
Junior Member
Thanks.

Do you think it should be raised as a bug or incompatability?
Re: Externalize strings error [message #1857925 is a reply to message #1857913] Tue, 07 March 2023 06:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
It looks like that was introduced by change associated with this Bugzilla:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=574801

You can report an issue here:

https://github.com/eclipse-jdt/eclipse.jdt.ui/issues


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to override m2e global settings?
Next Topic:Updating Maven Project never completes - Eclipse is hung
Goto Forum:
  


Current Time: Wed Feb 05 17:52:54 GMT 2025

Powered by FUDForum. Page generated in 0.04562 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top