Skip to content

Conversation

@ptziegler
Copy link
Contributor

This adapts the signature of the following methods to accept a vararg parameter instead of a plain array:

FilteredList:

  • setElements(Object[]) -> setElements(Object...)
  • setSelection(int[]) -> setSelection(int...)
  • setSelection(Object[]) -> setSelection(Object...)

AbstractElementListSelectionDialog:

  • setListElements(Object[]) -> setListElements(Object...)
  • setSelection(Object[]) -> setSelection(Object...)

This stops callers from having to explicitly create an array when e.g. selecting a single element. For example filteredList.setSelection(new int[]{0}) can be simplified to filteredList.setSelection(0).

This adapts the signature of the following methods to accept a vararg
parameter instead of a plain array:

FilteredList:
- setElements(Object[]) -> setElements(Object...)
- setSelection(int[]) -> setSelection(int...)
- setSelection(Object[]) -> setSelection(Object...)

AbstractElementListSelectionDialog:
- setListElements(Object[]) -> setListElements(Object...)
- setSelection(Object[]) -> setSelection(Object...)

This stops callers from having to explicitly create an array when e.g.
selecting a single element. For example `filteredList.setSelection(new
int[]{0})` can be simplified to `filteredList.setSelection(0)`.
@github-actions
Copy link
Contributor

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 14m 51s ⏱️ - 2m 42s
 8 270 tests ±0   8 022 ✅ +1  248 💤 ±0  0 ❌  - 1 
23 634 runs  ±0  22 843 ✅ +1  791 💤 ±0  0 ❌  - 1 

Results for commit 5746835. ± Comparison against base commit 128b1f3.

@akurtakov
Copy link
Member

Thanks, these small and still compatible refinements of Eclipse API are smth I am very happy to see coming.

@akurtakov akurtakov merged commit 647256d into eclipse-platform:master Jan 15, 2026
18 checks passed
iloveeclipse added a commit to iloveeclipse/eclipse.platform that referenced this pull request Jan 18, 2026
Compiler warnings:

1) Varargs methods should only override or be overridden by other
varargs methods unlike
StringVariableSelectionDialog.setListElements(Object[]) and
AbstractElementListSelectionDialog.setListElements(Object...)

2) Type IStringVariable[] of the last argument to method
setListElements(Object...) doesn't exactly match the vararg parameter
type. Cast to Object[] to confirm the non-varargs invocation, or pass
individual arguments of type Object for a varargs invocation.

Side effect of the signature change in
org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.setListElements(Object...)

See eclipse-platform/eclipse.platform.ui@647256d
/ eclipse-platform/eclipse.platform.ui#3675
iloveeclipse added a commit to eclipse-platform/eclipse.platform that referenced this pull request Jan 18, 2026
Compiler warnings:

1) Varargs methods should only override or be overridden by other
varargs methods unlike
StringVariableSelectionDialog.setListElements(Object[]) and
AbstractElementListSelectionDialog.setListElements(Object...)

2) Type IStringVariable[] of the last argument to method
setListElements(Object...) doesn't exactly match the vararg parameter
type. Cast to Object[] to confirm the non-varargs invocation, or pass
individual arguments of type Object for a varargs invocation.

Side effect of the signature change in
org.eclipse.ui.dialogs.AbstractElementListSelectionDialog.setListElements(Object...)

See eclipse-platform/eclipse.platform.ui@647256d
/ eclipse-platform/eclipse.platform.ui#3675
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