Skip to content

Commit 079b080

Browse files
committed
Fix warnings for Java 21
* use Locale.of * surround Executor with try-with-resources
1 parent e8a7cec commit 079b080

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

e4tools/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/common/ComboViewerAutoComplete.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2014, 2017 TwelveTone LLC and others.
2+
* Copyright (c) 2014, 2025 TwelveTone LLC and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -90,12 +90,13 @@ public void focusGained(FocusEvent e) {
9090
// text will be unselected after we set the selection, so we
9191
// need to delay the call
9292
// THIS IS A WORKAROUND
93-
final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1);
94-
executor.schedule(
95-
() -> dropDown.getCombo().getDisplay()
96-
.syncExec(() -> dropDown.getCombo()
97-
.setSelection(new Point(0, dropDown.getCombo().getText().length()))),
98-
200, TimeUnit.MILLISECONDS);
93+
try (ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1)) {
94+
executor.schedule(
95+
() -> dropDown.getCombo().getDisplay()
96+
.syncExec(() -> dropDown.getCombo()
97+
.setSelection(new Point(0, dropDown.getCombo().getText().length()))),
98+
200, TimeUnit.MILLISECONDS);
99+
}
99100
}
100101
});
101102
}

e4tools/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/impl/ResourceBundleHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2012, 2017 Dirk Fauth and others.
2+
* Copyright (c) 2012, 2025 Dirk Fauth and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -347,7 +347,7 @@ else if (localeParts[1].length() == 2) {
347347
variant = localeParts[2];
348348
}
349349

350-
return new Locale(language, country, variant);
350+
return Locale.of(language, country, variant);
351351
}
352352

353353
/**

0 commit comments

Comments
 (0)