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

Tuple: Rename Tuples.of(Object...) to Tuples.ofArray(Object...) #520

Closed
Pyknic opened this issue Sep 29, 2017 · 3 comments
Closed

Tuple: Rename Tuples.of(Object...) to Tuples.ofArray(Object...) #520

Pyknic opened this issue Sep 29, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@Pyknic
Copy link
Contributor

Pyknic commented Sep 29, 2017

Since Object[] inherits Object, it means that Tuples.of(Object) has the same signature as Tuples.of(Object[]). This causes problems since a method that returns a single Object can't be used with Tuple.of() without it wrapping the result in an array of dimension 1.

Example:

Object foo() {
    return ...;
}

...

Tuple t = Tuples.of(foo()); // This will resolve to Tuples.of(Object[]), not Tuples.of(Object).
@Pyknic Pyknic added the bug label Sep 29, 2017
@Pyknic Pyknic modified the milestones: 3.0.16 Forest, 3.0.15 Forest Sep 29, 2017
@minborg
Copy link
Contributor

minborg commented Sep 29, 2017

I suggest to rename the static constructor method to Tuples.ofArray(). This issue also affects TupleOfNullable.of()

@minborg minborg modified the milestones: 3.0.15 Forest, 3.0.16 Forest Oct 11, 2017
@minborg minborg modified the milestones: 3.0.16 Forest, 3.0.17 Forest Oct 19, 2017
@minborg
Copy link
Contributor

minborg commented Oct 26, 2017

We could check List.of() functions and see how that is handled in Java 9.

@minborg minborg modified the milestones: 3.0.17 Forest, 3.0.18 Forest Nov 8, 2017
@minborg minborg modified the milestones: 3.0.18 Forest, 3.0.19 Forest Nov 16, 2017
@minborg minborg self-assigned this Nov 16, 2017
minborg added a commit that referenced this issue Nov 17, 2017
@minborg
Copy link
Contributor

minborg commented Nov 17, 2017

This will affect the API

@minborg minborg closed this as completed Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants