Skip to main content



      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 12:58 Go to next message
Eclipse UserFriend
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 02:09 Go to previous messageGo to next message
Eclipse UserFriend
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...
Re: Externalize strings error [message #1857913 is a reply to message #1857893] Mon, 06 March 2023 07:57 Go to previous messageGo to next message
Eclipse UserFriend
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 01:44 Go to previous message
Eclipse UserFriend
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
Previous Topic:How to override m2e global settings?
Next Topic:Updating Maven Project never completes - Eclipse is hung
Goto Forum:
  


Current Time: Wed Jul 02 11:34:55 EDT 2025

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

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

Back to the top