Skip to content

Remove unused NLS message keys - #2860

Open
vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:remove-unused-nls-messages
Open

Remove unused NLS message keys#2860
vogella wants to merge 2 commits into
eclipse-platform:masterfrom
vogella:remove-unused-nls-messages

Conversation

@vogella

@vogella vogella commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

An NLS class declares public static String fields that NLS.initializeMessages fills reflectively from a .properties file. The compiler cannot flag one that nothing reads, because the field is public and the framework rather than the code writes it, so dead keys accumulate invisibly. This removes 186 of them across 21 message bundles, roughly 370 lines.

Each key goes on both sides, the field and the properties entry, since NLS.initializeMessages logs a warning for an entry without a field and for a field without an entry. I verified that all 21 class/properties pairs remain symmetric afterwards, and all 20 affected bundles compile, which is the real check: a key still being read would no longer resolve.

Keys with a namesake elsewhere were checked individually rather than by name. plugin_instantiateClassError and plugin_loadClassError are referenced downstream, but from Equinox's RegistryMessages, not from the org.eclipse.core.internal.runtime.Messages copies removed here; likewise TestRunSession_unrootedTests and resources_errorVisiting exist as separate copies in jdt.ui and pde.

vogella and others added 2 commits August 10, 2026 08:06
An NLS class declares public static String fields that NLS.initializeMessages
fills reflectively from a .properties file. The compiler cannot flag one that
nothing reads: the field is public and the framework, not the code, writes it.
Over the years 186 such keys across 21 message bundles lost their last caller
and stayed behind.

Each key is removed on both sides, field and properties entry, because
NLS.initializeMessages logs a warning for an entry without a field and for a
field without an entry. All 20 affected bundles compile, which is the actual
check: a key that was still read would no longer resolve.
@eclipse-platform-bot

Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

debug/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
team/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
team/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
team/examples/org.eclipse.compare.examples.xml/pom.xml
ua/org.eclipse.tips.ide/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 428f33c5c1af0d5ffd4408c020c241ff4b212cbf Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Mon, 10 Aug 2026 06:13:13 +0000
Subject: [PATCH] Version bump(s) for 4.41 stream


diff --git a/debug/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF b/debug/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
index af18f6be6c..0fba71420d 100644
--- a/debug/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.ui.externaltools; singleton:=true
-Bundle-Version: 3.7.100.qualifier
+Bundle-Version: 3.7.200.qualifier
 Bundle-Activator: org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin
 Bundle-Vendor: %Plugin.providerName
 Bundle-Localization: plugin
diff --git a/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
index ba2364abd6..908401b602 100644
--- a/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.jsch.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jsch.ui;singleton:=true
-Bundle-Version: 1.6.100.qualifier
+Bundle-Version: 1.6.200.qualifier
 Bundle-Activator: org.eclipse.jsch.internal.ui.JSchUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/team/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF b/team/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
index 91004e108c..bbcc2579ce 100644
--- a/team/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
+++ b/team/bundles/org.eclipse.ui.net/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.ui.net; singleton:=true
-Bundle-Version: 1.6.0.qualifier
+Bundle-Version: 1.6.100.qualifier
 Bundle-Vendor: %PLUGIN_PROVIDER
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.ui;bundle-version="[3.208.0,4.0.0)",
diff --git a/team/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF b/team/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
index a53f8e8663..1796267e4b 100644
--- a/team/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
+++ b/team/examples/org.eclipse.compare.examples.xml/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.compare.examples.xml; singleton:=true
-Bundle-Version: 3.7.100.qualifier
+Bundle-Version: 3.7.200.qualifier
 Bundle-Activator: org.eclipse.compare.examples.xml.XMLPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/team/examples/org.eclipse.compare.examples.xml/pom.xml b/team/examples/org.eclipse.compare.examples.xml/pom.xml
index 3769b3e233..4c4bde80b4 100644
--- a/team/examples/org.eclipse.compare.examples.xml/pom.xml
+++ b/team/examples/org.eclipse.compare.examples.xml/pom.xml
@@ -18,6 +18,6 @@
     <relativePath>../../</relativePath>
   </parent>
   <artifactId>org.eclipse.compare.examples.xml</artifactId>
-  <version>3.7.100-SNAPSHOT</version>
+  <version>3.7.200-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
 </project>
diff --git a/ua/org.eclipse.tips.ide/META-INF/MANIFEST.MF b/ua/org.eclipse.tips.ide/META-INF/MANIFEST.MF
index b3bb4c1476..dc4bb5c1ab 100644
--- a/ua/org.eclipse.tips.ide/META-INF/MANIFEST.MF
+++ b/ua/org.eclipse.tips.ide/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Automatic-Module-Name: org.eclipse.tips.ide
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.tips.ide;singleton:=true
-Bundle-Version: 0.4.100.qualifier
+Bundle-Version: 0.4.200.qualifier
 Bundle-RequiredExecutionEnvironment: JavaSE-21
 Require-Bundle: org.eclipse.ui;bundle-version="3.208.0",
  org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
-- 
2.54.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   58m 17s ⏱️ -37s
 4 707 tests ±0   4 685 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 012 runs  ±0  11 859 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit c662581. ± Comparison against base commit 1cc9ae4.

@vogella
vogella marked this pull request as ready for review August 10, 2026 08:38
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.

2 participants