[20+] fix warning 'The constructor Locale is deprecated since version 20'
Test Results
1 262 files - 631 1 262 suites - 631 57m 10s ⏱️ - 33m 39s 4 381 tests ± 0 4 333 ✅ - 24 48 💤 +24 0 ❌ ±0 8 762 runs - 4 381 8 643 ✅ - 4 333 119 💤 - 48 0 ❌ ±0
Results for commit 61faa7cb. ± Comparison against base commit 4ed09234.
This pull request skips 24 tests.
AutomatedResourceTests AllAliasTests BasicAliasTest ‑ testBug198571
AutomatedResourceTests AllFileSystemTests SymlinkTest ‑ testSymlinkPutHidden
AutomatedResourceTests AllLocalStoreTests MoveTest ‑ testMoveFileAcrossVolumes
AutomatedResourceTests AllLocalStoreTests MoveTest ‑ testMoveFolderAcrossVolumes
AutomatedResourceTests AllRegressionTests Bug_025457 ‑ testFile
AutomatedResourceTests AllRegressionTests Bug_025457 ‑ testFolder
AutomatedResourceTests AllRegressionTests Bug_025457 ‑ testProject
AutomatedResourceTests AllRegressionTests Bug_026294 ‑ testDeleteClosedProjectWindows
AutomatedResourceTests AllRegressionTests Bug_026294 ‑ testDeleteFolderWindows
AutomatedResourceTests AllRegressionTests Bug_026294 ‑ testDeleteOpenProjectWindows
…
:recycle: This comment has been updated with latest results.
i guess this has to wait until BREE>=20
@akurtakov how do we handle PRs where upgrading BREEE shows new warnings? here 30 * "The constructor URL(URL, String) is deprecated since version 20"
As long as the person merging/contributing plans to work on these new failures in the short term it should be fine as having huge PRs is also not nice for review. E.g. I merged https://github.com/eclipse-platform/eclipse.platform/pull/1676 and I'm now cleaning up after myself https://github.com/eclipse-platform/eclipse.platform/pull/1682. I understand there will be cases that would not be fixable in the short term but these should be the exception not the norm.
I had already tried to work on URL(URL, String) but it introduced more regression then doing good. I think its because eclipse typically uses whitespace in URLs instead of %20 (https://github.com/eclipse-platform/eclipse.platform/issues/35).
Getting rid of legacy mistakes is very lengthy process and most of the time it is not straightforward find and replace but requires some rearrangement of the code to make it better. As there is no "silver bullet" - take an instanceof a problem, figure out a proper fix /repeat is what gives better results in so many ways like easier to figure what exactly broke, smaller patch to revert (if/when it comes to that) , easier to get suggestions on PR and learn smth (more people will look at a smaller patch and grasp it and will give up on huge one, @HannesWell gave me a very good suggestion in one such "minor PR" that I just make use of now to fix the ant.tests.ui warnings too) . It's really slow this way and requires extra effort (I know it very well!) but it also generates less mistakes and helps us preserve the stability expected from Eclipse Platform while still advancing the project. P.S. I would never chose this approach for leaf project like https://github.com/eclipse-linuxtools/org.eclipse.linuxtools/ but being in different place in the stack requires (totally) different workflow.
Yes, every time I see people wanting to replace the old URL constructor I need to warn them that it can and generally does cause problems because of URI being fussy about characters like the space and URL not caring at all. In EMF I just gave up on that and introduced this method so that the warning is in one place and if it ever needs to be fixed (they are not marked at to be removed) can be fixed in that one place:
/**
* Creates a URL.
* @param literal the url literal.
* @return the corresponding new URL.
* @throws MalformedURLException
*
* @since 2.40
*/
public static URL newURL(String literal) throws MalformedURLException
{
@SuppressWarnings("deprecation")
URL url = new URL(literal);
return url;
}
introduced this method so that the warning is in one place
seems legit to me
Getting rid of legacy mistakes is very lengthy process and most of the time it is not straightforward find and replace but requires some rearrangement of the code to make it better.
I can only strongly second that. "Upgrading" to java 21 (or any future version) is not replacing one string constant with another it should include:
- Update project setting and JRE / BREE is just the simplest preparation
- Apply new cleanups so we can get rid of old code and really benefit from the upgrade
- Fix new warnings to not leave that daunting task to other for a quick win.
regarding the URL problem, the main issue is that URL is used where URI or even Path has to be used, String concatenation is used instead of proper resolve and escaping. So the best is to take the change to evaluate those places if an URL is really needed and properly used.
Beside that we have several URIUtil / URLUtil already in platform lingering around.
This pull request changes some projects for the first time in this development cycle. Therefore the following files need a version increment:
update/org.eclipse.update.configurator/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 e8c7db66889bf973c1bce715d5e7e71f20db1a14 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Fri, 6 Jun 2025 09:00:58 +0000
Subject: [PATCH] Version bump(s) for 4.37 stream
diff --git a/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF b/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
index d4025ed4a5..f106d88a29 100644
--- a/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
+++ b/update/org.eclipse.update.configurator/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.update.configurator; singleton:=true
-Bundle-Version: 3.5.700.qualifier
+Bundle-Version: 3.5.800.qualifier
Bundle-Activator: org.eclipse.update.internal.configurator.ConfigurationActivator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
--
2.49.0
Further information are available in Common Build Issues - Missing version increments.
This has conflicts with master now. I'm closing it and will prepare a separate PR to fix these.