-
Notifications
You must be signed in to change notification settings - Fork 326
DevGuide_RefactorXtend2Java
Karsten Thoms edited this page Nov 22, 2019
·
2 revisions
Some steps to consider when refactoring compiled Xtend code to Java again (see #1569):
- Disable Automatic Build
- Move Java sources from
xtend-gentosrc - Auto-Format the source code
- Perform Source / Clean Up action. See here for the cleanup actions settings to apply.
- Remove
@SuppressWarnings("all") - Start manual source cleanup
- Move constructor to appropriate place. Often they are much too late in the code
- Remove
super()calls in constructors - Look for unnecessary
finalmodifiers, esp. in parameters - Remove references to active annotations. The resulting code should not import anything unnecessary from
org.eclipse.xtext.xbase.lib. - Replace Guava
Objects#equal()by JavaObjects#equals() - Look out for double parantheses
((. Sometimes expressions are unnnecessarily enclosed by parentheses. - Remove unnecessary
this.qualifiers - Update copyright header upper year
- Remove unused imports
- Use method references where appropriate
- When nested classes are used, access to them e.g. in casts are unnecessarily qualified by the enclosing type name.
- Resolve usage of
Exceptions#sneakyThrow() - Check that no inline comment gets lost