Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

[eclipse/xtext#1569] Refactor Xtend to Java #1268

Merged
merged 1 commit into from
Nov 4, 2019
Merged

Conversation

kthoms
Copy link

@kthoms kthoms commented Oct 29, 2019

The usage of Xtend in the Xtext code base should be reduced where the
usage of Xtend is not super beneficial. Replaced Xtend classes by the
compiled code and refactored the code to more readable Java.

Signed-off-by: Karsten Thoms karsten.thoms@itemis.de

@kthoms kthoms added this to the Release_2.20 milestone Oct 29, 2019
Copy link
Contributor

@szarnekow szarnekow left a comment

Choose a reason for hiding this comment

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

Please apply some cleanup actions

@szarnekow
Copy link
Contributor

There should be a cleanup action that allows to remove redundant parentheses and redundant modifiers.

@szarnekow
Copy link
Contributor

Screenshot 2019-10-30 at 16 45 43

Screenshot 2019-10-30 at 16 45 53

Screenshot 2019-10-30 at 16 45 21

Screenshot 2019-10-30 at 16 45 31

@kthoms
Copy link
Author

kthoms commented Oct 31, 2019

The "remove redundant modifiers" action does not remove final modifiers from parameters. How could this be decided that it might not be wanted? It removes e.g. 'public' on interface fields/methods. BTW: I have implemented this cleanup action :)
But I did not use the "Use parentheses in expressions / Only if necessary" yet.

I think we should configure those common cleanup actions on the projects with separate issue.

@szarnekow
Copy link
Contributor

I think we should configure those common cleanup actions on the projects with separate issue.

No I don't think so. When we migrate the stuff to Java, the result should look nice and not like a second class citizen.

@kthoms
Copy link
Author

kthoms commented Oct 31, 2019

Right. What I meant is: When we already agreed which cleanup actions make sense in general, then we could store these settings in the projects. For the migration it is clear that the resulting Java code should look nice as hand crafted, and applying the cleanup actions is just task to achieve this.

@kthoms kthoms requested a review from tivervac November 1, 2019 04:23
Copy link
Contributor

@tivervac tivervac left a comment

Choose a reason for hiding this comment

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

Noticed a new xtend quirk. We always cast the variable when we did an instanceof check even though that might not be needed

The usage of Xtend in the Xtext code base should be reduced where the
usage of Xtend is not super beneficial. Replaced Xtend classes by the
compiled code and refactored the code to more readable Java. Performed
source cleanup action.

Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
@kthoms
Copy link
Author

kthoms commented Nov 4, 2019

@szarnekow I think all issues should be adressed now. Could you have a look again, please?

Copy link
Contributor

@szarnekow szarnekow left a comment

Choose a reason for hiding this comment

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

LGTM

@kthoms kthoms merged commit 3a4ec33 into master Nov 4, 2019
@kthoms kthoms deleted the kt_issue1569_1 branch November 4, 2019 13:32
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants