-
Notifications
You must be signed in to change notification settings - Fork 867
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
solves #7044, refactor inner to outer for record #8197
base: master
Are you sure you want to change the base?
Conversation
see issue apache#7044 for exact problem. Start with adding tests. Introduced RECORD and RECORD_COMPONENT case labels in multiple places. Deal with method params for the record header in InnerOuterTransformer. The given way of printing the 'method parameters' for the record header include 'private final', producing illegal java code. The solution found might not be the moset elegant, but since the tree modifications will not persist into any real source code, it is acceptable. The solution strips `private` and `final` from the VARIABLE trees. Delete file threw and unnecessary exception where a simple null test suffices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did a quick pass and enabled some tests, next sync should run them.
...ring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/InnerOuterRecordTest.java
Outdated
Show resolved
Hide resolved
java/java.source.base/src/org/netbeans/modules/java/source/base/SourceLevelUtils.java
Outdated
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Outdated
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Outdated
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Outdated
Show resolved
Hide resolved
...actoring.java/src/org/netbeans/modules/refactoring/java/plugins/InnerToOuterTransformer.java
Outdated
Show resolved
Hide resolved
java/java.source.base/src/org/netbeans/api/java/source/TreePathHandle.java
Show resolved
Hide resolved
java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
Outdated
Show resolved
Hide resolved
java/java.source.base/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
Show resolved
Hide resolved
...va.source.base/test/unit/src/org/netbeans/modules/java/source/save/RecordFormattingTest.java
Outdated
Show resolved
Hide resolved
java/java.source.base/src/org/netbeans/api/java/source/ElementHandle.java
Outdated
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Show resolved
Hide resolved
.../refactoring.java/src/org/netbeans/modules/refactoring/java/api/InnerToOuterRefactoring.java
Outdated
Show resolved
Hide resolved
Dear mbien, thank you for your time. I just pushed to branch issue7044 on my fork. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed to branch issue7044 on my fork.
Is there anything I need to do?
thats all you have to do. Its an iterative process. The very last step before merge would be to squash as final touch - but that is for later.
Tests ran are green too - awesome. Left a few more comments.
java/java.source.base/src/org/netbeans/modules/java/source/base/SourceLevelUtils.java
Outdated
Show resolved
Hide resolved
...ring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/InnerOuterRecordTest.java
Outdated
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Show resolved
Hide resolved
...oring.java/test/unit/src/org/netbeans/modules/refactoring/java/test/RefactoringTestBase.java
Show resolved
Hide resolved
java/refactoring.java/src/org/netbeans/modules/refactoring/java/plugins/DeleteFile.java
Outdated
Show resolved
Hide resolved
...actoring.java/src/org/netbeans/modules/refactoring/java/plugins/InnerToOuterTransformer.java
Outdated
Show resolved
Hide resolved
removed lines as per |
see issue #7044 for exact problem.
Start with adding tests.
Introduced RECORD and RECORD_COMPONENT case labels in multiple places.
Deal with method params for the record header in InnerOuterTransformer. The given way of printing the 'method parameters' for the record header include 'private final', producing illegal java code. The solution found might not be the moset elegant, but since the tree modifications will not persist into any real source code, it is acceptable. The solution strips
private
andfinal
from the VARIABLE trees.Delete file threw and unnecessary exception where a simple null test
suffices.
^Add meaningful description above
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log
) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.