Skip to content

Commit cf999b2

Browse files
committed
Make var-args overload of NLS.bind() generic
This avoids a compiler warning if an explicit array of a sub-type of Object[] is passed as last argument: NLS.bind("message: {0} {1}", new String[] { "Hello", "World" }) The byte-code generated for the NLS.bind() method and for all its callers is not changed by this adjustment. It just avoids what looks like a source-compatibility issues with the previous introduction of var-args in NLS.bind(). Although the example above works the same in all three states. Follow-up on: - #936 Also touch calling projects that now get slight different byte-code generated because the var-args array generated by the compiler now can have a more specific type than Object[], common for all passed arguments.
1 parent 71d1fa5 commit cf999b2

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

bundles/org.eclipse.equinox.common/forceQualifierUpdate.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Bug 529356 - Build failure in I20180102-2215
55
Bug 566471 - I20200828-0150 - Comparator Errors Found
66
Bug 527899 [9] Implement JEP 280: Indify String Concatenation #1139
77
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
8-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2044
8+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2044
9+
https://github.com/eclipse-equinox/equinox/pull/939
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# To force a version qualifier update add the bug here
22
Bug 403352 - Update all parent versions to match our build stream
33
Bug 509973 - Comparator errors in I20170105-0320
4-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
4+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
5+
https://github.com/eclipse-equinox/equinox/pull/939

bundles/org.eclipse.equinox.metatype/forceQualifierUpdate.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
Bug 403352 - Update all parent versions to match our build stream
33
Bug 416896 - Some Equinox bundles need to be touched to get API descriptions back
44
Bug 509973 - Comparator errors in I20170105-0320
5-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
5+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
6+
https://github.com/eclipse-equinox/equinox/pull/939

bundles/org.eclipse.equinox.preferences/forceQualifierUpdate.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Bug 403352 - Update all parent versions to match our build stream
33
Bug 509973 - Comparator errors in I20170105-0320
44
Incorrect org.osgi.service.prefs dependency in org.eclipse.equinox.preferences-3.10.0 #54
55
Bug 527899 [9] Implement JEP 280: Indify String Concatenation #1139
6-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1781
6+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1781
7+
https://github.com/eclipse-equinox/equinox/pull/939

bundles/org.eclipse.equinox.registry/forceQualifierUpdate.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Bug 531640 - New certificate conflict
55
Bug 527899 [9] Implement JEP 280: Indify String Concatenation #1139
66
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1659
77
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/1923
8-
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2044
8+
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/issues/2044
9+
https://github.com/eclipse-equinox/equinox/pull/939

bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ public static String bind(String message, Object binding1, Object binding2) {
119119
* @return the manipulated String
120120
* @throws IllegalArgumentException if the text appearing within curly braces in the given message does not map to an integer
121121
*/
122-
public static String bind(String message, Object... bindings) {
122+
@SafeVarargs
123+
public static <T> String bind(String message, T... bindings) {
123124
return internalBind(message, bindings, null, null);
124125
}
125126

0 commit comments

Comments
 (0)