Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CompoundQueryable(Collection) constructor public #334

Merged

Conversation

HannesWell
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 25, 2023

Test Results

       9 files  ±0         9 suites  ±0   36m 0s ⏱️ - 1m 3s
2 175 tests ±0  2 171 ✔️ ±0    4 💤 ±0  0 ±0 
6 615 runs  ±0  6 604 ✔️ ±0  11 💤 ±0  0 ±0 

Results for commit 0f83fa7. ± Comparison against base commit 0c02412.

♻️ This comment has been updated with latest results.

// don't suppress the warning as it will cause warnings in the official build
// see bug 423628. Write this without unchecked conversion.
this(queryables.toArray(new IQueryable[queryables.size()]));
this.queryables = (Collection<IQueryable<T>>) queryables;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make the filed of the same type? Also the previous code has made a copy of the collection, so List.copyOf( ... ) would also solve your issue here without a cast.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestions. Applied them both.
A copy is not necessary in all cases, but often a List.of() is passed any way, which is only passed through List.copyOf().

@HannesWell
Copy link
Member Author

I added a second commit to add a similar QueryableArray(Collection) constructor and use it.
Tycho also has a copy of this class named QueryableCollection that is modified only to have such constructor AFAICT.

@HannesWell HannesWell merged commit f40105f into eclipse-equinox:master Sep 29, 2023
6 of 7 checks passed
@HannesWell HannesWell deleted the compoundQueryableConstructor branch September 29, 2023 18:08
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