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

add support for Java 15 #3605

Closed
monperrus opened this issue Sep 16, 2020 · 10 comments · Fixed by #3664
Closed

add support for Java 15 #3605

monperrus opened this issue Sep 16, 2020 · 10 comments · Fixed by #3664
Labels

Comments

@monperrus
Copy link
Collaborator

See feature list at https://openjdk.java.net/projects/jdk/15/

@MartinWitt
Copy link
Collaborator

@LakshyAAAgrawal
Copy link
Contributor

LakshyAAAgrawal commented Oct 2, 2020

Going through the above release notes, I could identify the following changes that will need to be incorporated into Spoon:

Preview features:

I think that preview and second preview will not need to be incorporated. Is that right?

@monperrus
Copy link
Collaborator Author

I think that preview and second preview will not need to be incorporated. Is that right?

I would say yes, it's not needed for now.

@MartinWitt
Copy link
Collaborator

MartinWitt commented Oct 2, 2020

Looking at the current jdt version 3.23 we cant implement any feature expect java 14 record preview. Is there a way to use a nighty/weekly version of jdt? Otherwise we would need to wait for the next release. And we really should add some test cases for textblocks. After a first look they are working, but maybe some tests wouldn't harm.
Implementing a preview version could speed up development for features, when they leave preview.
Edit: I believe we should look at https://openjdk.java.net/jeps/371. I'm unsure if we need to handle this and/or could deliver an API/Refactoring supporting this.

@LakshyAAAgrawal
Copy link
Contributor

As mentioned in #3627 (comment), need to work on a way to preserve the origin of a string as either a textblock or a single qoute string in Java.

@monperrus
Copy link
Collaborator Author

FTR #3627 is one important step for this issue.

What remains to be done is pretty-printing of text blocks.

@MartinWitt
Copy link
Collaborator

MartinWitt commented Oct 22, 2020

Looking at the printing problem, i see 2 potential solutions. Either create a flag in Literal isTextblock or create a class TextblockLiteral extends Literal. Wdyt about the solutions?

@LakshyAAAgrawal
Copy link
Contributor

Hey, I have been taking a look at this. Was going through the relevant source code. I think creating a class extending Literal would be more general? But that would break the existing pattern followed by Literal. My thought was to go ahead with extending the class and likewise in the future creating other classes for various types of literals like numeric and singly qouted strings.

@monperrus
Copy link
Collaborator Author

monperrus commented Oct 23, 2020 via email

@MartinWitt
Copy link
Collaborator

My thought was to go ahead with extending the class and likewise in the future creating other classes for various types of literals like numeric

I would prefer the KISS solution and create only TextblockLiteral class.
A potential feature for a refactoring could be the conversion from textblock to string and string to textblock. But for now 1 new class does it and spoon supports java 15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants