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

review fix: Object[]::new references resolution #1945

Merged
merged 9 commits into from
Jun 15, 2018

Conversation

surli
Copy link
Collaborator

@surli surli commented Apr 3, 2018

fix #1883

@surli surli changed the title WIP Fix: Object[]::new references resolution review fix: Object[]::new references resolution Jun 12, 2018
@surli
Copy link
Collaborator Author

surli commented Jun 12, 2018

The proposed solution is far from being perfect but it's a first step. I propose that before improving it further we define first a better test contract.


@Test
public void testPbWithStream() {
// contract: array constructor references are well represented
Copy link
Collaborator

@monperrus monperrus Jun 13, 2018

Choose a reason for hiding this comment

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

add assert on type of element (instanceof InvisibleArrayConstructorImpl)?
add assert on toString of element?

* String[]::new
* </pre>
*/
public class InvisibleArrayConstructor<T> extends CtConstructorImpl<T> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

By convention, should end by Impl: InvisibleArrayConstructorImpl, and should be in spoon.support.reflect.declaration (all implementation classes are in spoon.support)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is in spoon.support. I will rename it.

@monperrus
Copy link
Collaborator

Thanks @surli.

LGTM, see comments.

@spoon-bot
Copy link
Collaborator

API changes: 1 (Detected by Revapi)

Old API: fr.inria.gforge.spoon:spoon-core:jar:6.3.0-20180613.225605-139 / New API: fr.inria.gforge.spoon:spoon-core:jar:6.3.0-SNAPSHOT

Method was added to an interface.
Old none
New method CoreFactory#createInvisibleArrayConstructor()
Breaking binary: non_breaking

@surli
Copy link
Collaborator Author

surli commented Jun 14, 2018

For me it's ready again.

@monperrus monperrus merged commit a701539 into INRIA:master Jun 15, 2018
@monperrus
Copy link
Collaborator

Thanks Simon!

@surli surli deleted the fix-new-reference branch June 15, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Java8 "Foo[]::new" cannot be resolved
3 participants