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
Contribute to JDT cleanup actions #386
Comments
Btw. I'm starting to use your tool now to improve the Eclipse code. :-) |
@vogella sounds interesting. Btw, thank you for your site and tutorials, they were very useful for me. |
It's the best future we hope for this plugin! We don't know if we will be here in a decade. This sounds like immortality :) The current development version has transformed the plugin as a CleanUp Extension. It should ease the migration. There is still one limitation: in this mode, AutoRefactor only does 1 pass. I think I know how to fix it but it's not already done. |
Awesome. One of our employees recently added a cleanup action to JDT so we
should be able to help here. :-)
Maybe let's start with "Combine try catch blocks"?
Fabrice TIERCELIN <notifications@github.com> schrieb am Fr., 14. Juni 2019,
20:13:
… It's the best future we hope for this plugin! We don't know if we will be
here in a decade. This sounds like immortality :)
The current development version has transformed the plugin as a CleanUp
Extension. It should ease the migration. There is still one limitation: in
this mode, AutoRefactor only does 1 pass. I think I know how to fix it but
it's not already done.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBTOZPU6V37U54XX2TTP2PNS3A5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXXSERI#issuecomment-502211141>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCFBS2ASGU36IICJHO4JTP2PNS3ANCNFSM4HYFPIDQ>
.
|
Do you mean I think we should check the policy:
|
Remove useless blocks would also be a very nice addition, opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=548324 for that. |
Testing now Push negation down. |
By the way, should we start direct communication? If you agree, please drop me an email at Lars.Vogel@vogella.com |
"Push negation down" does not have one hit in the eclipse.platform code base so I think this is not the most valuable clean for Eclipse users. I had lots of: 1.) contains vrs. indexOf cases Do you have a convert to method reference refactoring? That would also be beneficial. |
|
What is the next step? Would you like start contributing cleanup actions / quickfixes to JDT? For this we use Gerrit, if you have issues with this process, I can help with that. JDT is not very active in terms of reviewing community contributions but I could ask the Redhat team to review. If you start this, I think it would be great if you would gain JDT committership at some point in time to improve these cleanups directly. |
You said "One of our employees recently added a cleanup action to JDT". Can I see the diff? Another question: is cleanup action multi-pass? I mean: Givenboolean reducedValue = !!!!true; WhenCleanup is applied Then
boolean reducedValue = !!!false;
boolean reducedValue = true; A multi-pass process can reevaluate an already changed part of code. It's coded in AutoRefactor. If it is not the case in cleanup, I think it would be a good idea to implement it. |
Hi Fabrice, I have recently been made a JDT committer. I can help if you have code to be reviewed or have questions though I am relatively new and am still learning myself. |
Jeff, can you give the link to your ; cleanup Gerrit?
jjohnstn <notifications@github.com> schrieb am Di., 25. Juni 2019, 18:37:
… Hi Fabrice, I have recently been made a JDT committer. I can help if you
have code to be reviewed or have questions though I am relatively new and
am still learning myself.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBR4DWNZ63UFFHSIYS3P4JCURA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQ27LY#issuecomment-505524143>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCFBQH6OQYSRPJMAPCQSTP4JCURANCNFSM4HYFPIDQ>
.
|
With regards to single-pass vs multi-pass, the cleanups are not recursively checked, however, cleanups should be smart (e.g. I wrote a redundant semi-colon cleanup that will remove multiple extraneous trailing semi-colons at once and not just one at a time). Your example above could be calculated to a single change. An example where this doesn't work is removing unused private members/fields where a private field is being used by an unused private method. First cleanup removes the unused method, second cleanup will remove the unused field. My gerrit change for redundant semi-colons can be found at: |
@vogella, here we are, I have made a first contribution. I searched the simplest useful rule. I have complete the cleanup that removes the unnecessary modifiers. Now it will also remove the abstract modifier on interface : Now, I don't know how I'm supposed to contribute. Can I create an entry in Eclipse bugzilla or you create it? |
I have been able to test the feature on Eclipse but I haven't been able to run the unitary tests. Maybe you can do it. |
@Fabrice-TIERCELIN awesome. I'm already in summer vacation, so it would be great if you can open a bug directly. Please use "UI" and the following link: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT This requires a bugzilla user. We use Gerrit for code contributions, as for the setup, please see https://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#exericse-eclipse-user-creation-and-gerrit-server-configuration The setup usually only takes 10 minutes in our hackerthons, we do from time to time in Hamburg. For the Gerrit, please add Jeff (Jeff Johnston from Redhat) as reviewer. Review times in JDT can be very long, adding Jeff (or Roland Grunberg if Jeff is not available) as reviewer should result in faster review. I'm happy to help with any Gerrit questions, important rule is to use the same Change-Id if you want to update the review. Eclipse Staging View has nice Gerrit support and the ammend option can be used to update Gerrits. |
Gerrit will run the test automatically, no need for you to do it
Fabrice TIERCELIN <notifications@github.com> schrieb am Mo., 8. Juli 2019,
08:19:
… I have been able to test the feature on Eclipse but I haven't been able to
run the unitary tests. Maybe you can do it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBWOO2Q367HO2RD7QYLP6LL7RA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZMCR5I#issuecomment-509094133>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCFBUHIXUECVUENXVWO4LP6LL7RANCNFSM4HYFPIDQ>
.
|
Awesome @Fabrice-TIERCELIN, thanks for https://bugs.eclipse.org/bugs/show_bug.cgi?id=549242. Any plans to contribute more cleanups? |
I'm preparing the migration of Autoboxing and Unboxing. |
@Fabrice-TIERCELIN thanks for doing it - would you please watch https://twitter.com/ZhekaKozlov/status/1135506701438857217 . I'm interested whether there are other of your cleanup actions that can help us achieve parity (boxing/unboxing should be one of them). |
@akurtakov What is this tool? What is the list of the features? |
Awesome work, looking forward to seeing more features getting migrated! 👍 |
Hi @vogella, do you know how your Jenkins is configured to feature the build SUCCESS as green? On my Jenkins, it appears in blue... Or do you know who knows? |
You'll have to install the Green Balls plugin. 😉 |
OK, thanks @PyvesB. |
@PyvesB, @akurtakov and @vogella, don't support the coder, support the reviewer. The migration time is estimated to 6 years and it's mostly review time. Or be a merger 😺 |
Eclipse ist currently in release freeze but we should open master soon
again. And I assume this means reviews will continue.
Fabrice TIERCELIN <notifications@github.com> schrieb am Sa., 7. Sep. 2019,
15:58:
… Awesome work, looking forward to seeing more features getting migrated! 👍
@PyvesB <https://github.com/PyvesB>, @akurtakov
<https://github.com/akurtakov> and @vogella <https://github.com/vogella>,
don't support the coder, support the reviewer. The migration time is
estimated to 6 years and it's mostly review time
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=550394>.
Or be a merger 😺
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBRGIATQE6OJW3IZKVDQIOXSDA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EZNFI#issuecomment-529110677>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABCFBUZPIUW2IEDF5LKNR3QIOXSDANCNFSM4HYFPIDQ>
.
|
Do you want to remove also the |
+1
Fabrice TIERCELIN <notifications@github.com> schrieb am Mi., 23. Okt. 2019,
07:27:
… Do you want to remove also the final modifier on method parameters?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBVGPJMU5OTYJNOIKHTQP7OCLA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECADIJQ#issuecomment-545272870>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBS76JTOEE3E6HW2JJ3QP7OCLANCNFSM4HYFPIDQ>
.
|
How can I ask commit rights? |
Hi Fabrice, it is not just a simple case of asking for commit rights. What is required is a nomination to the JDT group. Before that, a body of work consisting of bug fixes / features needs to be established that prove you require minimal oversight. At this point, you are definitely on the right track to becoming nominated but there aren't enough merged bug fix changes yet (excludes code cleanups) and you also need to get a chance to demonstrate administrative aspects for bugs (milestones, status). I am confident you will get there in a shorter time than it took me. |
I asked you a while ago if you could try your cleanups on Platform code and provide patches for them. But I also asked you already here and you also did not react so I assume this is your way of saying no. |
I admit I'm not very OK to refactor a huge code I don't know... You also asked me to create a rule to remove the final keyword. As there are lots of activities around AutoRefactor, I prefer making rules for anyone than this rule... I think you're right and that's probably the reason I haven't answered :) Anyway, which is the ticket for cleaning the Platform code? |
|
Yet another cleanup: Use var keyword It's the first cleanup I have coded that does not come from AutoRefactor. Meanwhile, here is my cleanups that can already been reviewed: And also: |
I've picked up the number suffix patch, hopefully that will help a bit. Though as I'm not a committer either, there's only so far we'll be able to go. Reviewing and merging patches does seems to be a big problem with the JDT project at the moment. I also submitted one back in July, it's looking increasingly likely that it won't get shipped until at least March next year. 😕 |
We are doing our best to improve the situation with reviews. I have to admit it's still not in acceptable state but at least compared to a year ago the improvements in review time are huge. I know these are empty words if your patch hasn't been looked at. Please add me on CC to the gerrit so I can push JDT committers to do a revew (I'm not JDT committer myself so can't do it myself). |
I don't think you can if you're not the one who created the bug/not part of the project. I generally simply put a comment saying I'm working on something.
Next Wednesday apparently. See here. |
Pierre-Yves and Fabrice,
I will ask webmaster to give you bug triage rights so that you can assign
bugs and set milestones.
JDT is in the same state as platform was 3-5 years ago. With your help I
hope that he can soon improve the situation.
Pierre-Yves B. <notifications@github.com> schrieb am Do., 21. Nov. 2019,
20:15:
… How to self assigning a bug?
I don't think you can if you're not the one who created the bug/not part
of the project. I generally simply put a comment saying I'm working on
something.
And when will be the frozen zone? Where to know it?
Next Wednesday apparently. See here
<https://www.eclipse.org/eclipse/development/plans/freeze_plan_4_14.php>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBQTJXB5JGZFIOHLA3DQU3M6BA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE3K2GQ#issuecomment-557231386>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBSMQ3DPZ3OF2QRQ2KDQU3M6BANCNFSM4HYFPIDQ>
.
|
Hopefully bug management will become much smoother when Buzilla is replaced. There are discussions about this on Bug 537913. Gerrit is somewhat a pain-point as well IMO, the old 2017 version the Foundation is running doesn't compete with what GitHub or Gitlab provide nowadays (upgrading is tracked by Bug 541221). But we're getting slightly off-topic here! |
Please comment in the Bug 541221 to remind the foundation that users care.
…On Fri, Nov 22, 2019 at 9:10 AM Pierre-Yves B. ***@***.***> wrote:
Hopefully bug management will become much smoother when Buzilla is
replaced. There are discussions about this on Bug 537913
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=537913>.
Gerrit is somewhat a pain-point as well IMO, the old 2017 version the
Foundation is running doesn't compete with what GitHub or Gitlab provide
nowadays (upgrading is tracked by Bug 541221
<https://bugs.eclipse.org/bugs/show_bug.cgi?id=541221>).
But we're getting slightly off-topic here!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBX6VYG245C4XPDQXJ3QU6HYRA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE44KZI#issuecomment-557434213>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBWZAJI6CYZEE2WHDJTQU6HYRANCNFSM4HYFPIDQ>
.
--
Eclipse Platform project co-lead
CEO vogella GmbH
Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@vogella.com, Web:
http://www.vogella.com
|
Done. Random thought: wouldn't it be great to have the Source -> Clean Up... command directly accessible through EGit in the Git Staging view? Like that you could only cleanup the files you have modified since since last commit and also have a reminder to do so. |
Clean-up of changed files can be done via save actions.
The clean up menu is currently missing for project explorer, would be nice
to have it here too in addition to the menu in the package explorer
Pierre-Yves B. <notifications@github.com> schrieb am Fr., 22. Nov. 2019,
22:47:
… Please comment in the Bug 541221 to remind the foundation that users care.
Done.
Random thought: wouldn't it be great to have the *Source -> Clean Up...*
command directly accessible through EGit in the Git Staging view? Like that
you could only cleanup the files you have modified since since last commit
and also have a reminder to do so.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBRFVJ3VTQRT3EQPIPLQVBHN7A5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE6624Q#issuecomment-557706610>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBUTLXTLRF4HNZGW2GDQVBHN7ANCNFSM4HYFPIDQ>
.
|
To do this:
It's not obvious so I don't know if it is worth to add a shortcut. It is asked but not highly voted. I think that this way lot's of shortcuts should be added... |
@vogella, if you want to cleanup a huge part of the Eclipse code base, I advise you the following cleanups. They all improve performance and I filtered the ones I consider as dangerous. Improving the performance would be a benefit for the contributors and the users:
|
Thanks Fabrice, will have a look. 4.14 is already in release mode but I
will try them for 4.15.
Some stuff we already did in platform code, e.g. StringBuffer replacement.
Only JDT has not been improved as they as not very welcoming yet with
regards to cleanup patches.
Fabrice TIERCELIN <notifications@github.com> schrieb am So., 24. Nov. 2019,
16:57:
… @vogella <https://github.com/vogella>, if you want to cleanup a huge part
of the Eclipse code base, I advise you the following cleanups. They all
improve performance and I filtered the ones I consider as dangerous.
Improving the performance would be a benefit for the contributors and the
users:
- Int primitive rather than wrapper
- Short primitive rather than wrapper
- Long primitive rather than wrapper
- Double primitive rather than wrapper
- Float primitive rather than wrapper
- Char primitive rather than wrapper
- Byte primitive rather than wrapper
- Primitive wrapper creation
- Boolean primitive rather than wrapper
- Lazy logical rather than eager
- Boolean constant rather than value of
- String rather than new string
- String
- String value of rather than concat
- Opposite comparison rather than negative expression
- Remove empty if
- No loop iteration rather than empty check
- Do while rather than while
- Break rather than passive iterations
- String builder
- String builder rather than string buffer
- Hash map rather than hashtable
- Array list rather than vector
- Array deque rather than stack
- Array list rather than linked list
- Set rather than list
- Hash map rather than tree map
- Hash set rather than tree set
- Static constant rather than instance constant
- Remove overridden assignment
- Log parameters rather than log message
- Remove unnecessary local before return
- Remove unnecessary cast
- Local variable rather than field
- Simplify expression
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBUFJZQNKOP46GB7MADQVKQABA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFAOPPI#issuecomment-557901757>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBWZU6BND33BKHW7L7TQVKQABANCNFSM4HYFPIDQ>
.
|
I tried staring running the suggested improved refactoring but face the issues described in #427
|
cc @ruspl-afed |
WOW, looks like a secret treasury! |
If you're interested, here is an AutoRefactor mod that lombokifies a Java project: If I remember well, it lacks a feature (static field handling or boolean getter, I don't remember). Give me feedback and I can improve it. Beware! Don't execute other rules on lombok code! It would destroy it. |
Hi @vogella, Here is your feature that removes all the optional final modifiers To use it:
I still think it's foolish to do so... It even changes constants into variables. Do as you want. |
Thanks, but please do not invest time in things you find foolish. IMHO open
source developer should work on things they find important. Sorry for
asking for this feature.
Fabrice TIERCELIN <notifications@github.com> schrieb am Mi., 26. Feb. 2020,
19:55:
… Hi @vogella <https://github.com/vogella>,
Here is your feature that *removes all the optional final modifiers*
- org.autorefactor.plugin.ui-1.3.0-SNAPSHOT.jar.txt
<https://github.com/JnRouvignac/AutoRefactor/files/4257591/org.autorefactor.plugin.ui-1.3.0-SNAPSHOT.jar.txt>
- org.autorefactor.plugin-1.3.0-SNAPSHOT.jar.txt
<https://github.com/JnRouvignac/AutoRefactor/files/4257592/org.autorefactor.plugin-1.3.0-SNAPSHOT.jar.txt>
To use it:
1. Remove the .txt extension
2. Put the files in your eclipse/dropins folder
3. Launch Eclipse
4. Click on project -> Source (AutoRefactor) -> Choose... -> *Remove
optional final*
I still think it's foolish to do so... It even changes constants into
variables. Do as you want.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBSQO3BFRXV22TUCPPLRE23JJA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENBN47I#issuecomment-591584893>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBQJQ2TCLD2WGZCQR7TRE23JJANCNFSM4HYFPIDQ>
.
|
I have also used it to clean up AutoRefactor, modifying the rules. |
Great to hear, I was a bit concerned that you spend time on something on my
request which you think is not worth it.
…On Thu, Feb 27, 2020 at 6:18 AM Fabrice TIERCELIN ***@***.***> wrote:
I have also used it to clean up AutoRefactor, modifying the rules.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#386?email_source=notifications&email_token=AABCFBX5NEDUDDU66IFF6H3RE5EJJA5CNFSM4HYFPID2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENC7ERQ#issuecomment-591786566>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCFBVTTXWDGMCI4W46S6LRE5EJJANCNFSM4HYFPIDQ>
.
--
Eclipse Platform project co-lead
CEO vogella GmbH
Haindaalwisch 17a, 22395 Hamburg
Amtsgericht Hamburg: HRB 127058
Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel
USt-IdNr.: DE284122352
Fax (040) 5247 6322, Email: lars.vogel@vogella.com, Web:
http://www.vogella.com
|
Hello, I just found your plug-in and I'm already in love with it. Thanks for this awesome work.
Would you be interested in moving parts of your plug-in to JDT cleanup actions? I think this would be highly beneficial for all Eclipse users.
P.S. I'm one of the Eclipse developers and project leads. See https://projects.eclipse.org/projects/eclipse.platform/who
The text was updated successfully, but these errors were encountered: