Bug 572340 - New clean ups planned for 4.20
Summary: New clean ups planned for 4.20
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.19   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.20   Edit
Assignee: Fabrice Tiercelin CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2021-03-26 13:16 EDT by Fabrice Tiercelin CLA
Modified: 2021-05-17 08:33 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabrice Tiercelin CLA 2021-03-26 13:16:42 EDT
Here are some planned cleanups:
 - "valueOf() rather than instantiation" (Bug 572234)
 - "Map.entrySet() rather than Map.keySet() and value search"
 - "Int primitive rather than wrapper"
 - "Remove unchecked exceptions from throws clause"
Comment 1 Jeff Johnston CLA 2021-03-26 15:48:13 EDT
Add to that:

Replace system.getProperties() calls with direct Java methods where possible
Comment 2 Jeff Johnston CLA 2021-03-31 14:05:05 EDT
Also:

Replace StringBuffer with StringBuilder for local accesses.
Comment 3 Fabrice Tiercelin CLA 2021-04-09 12:49:23 EDT
I plan another cleanup: Do/while rather than while (Bug 572574)

Given:
        boolean isInitedToTrue= true;
        while (isInitedToTrue) {
            if (i > 100) {
                isInitedToTrue= false;
            }
            i *= 2;
        }

When:
Clean up the code enabling "Do/while rather than while"...

Then:
        boolean isInitedToTrue= true;
        do {
            if (i > 100) {
                isInitedToTrue= false;
            }
            i *= 2;
        } while (isInitedToTrue);
Comment 4 Carsten Hammer CLA 2021-04-09 14:46:48 EDT
I would like to try to implement a helper quickfix to resolve reliance on platform encoding to reuse a single constant for that - in case such a quickfix can be accepted at all.
see Bug 179119
Comment 5 Fabrice Tiercelin CLA 2021-04-11 01:02:35 EDT
"Int primitive rather than wrapper" cleanup is merged. Now I plan to extends this rule to all the primitive types to release a complete feature for Eclipse 2021-06.
Comment 6 Noopur Gupta CLA 2021-05-17 08:33:37 EDT
Closing it for 4.20. Any new clean ups should go in 4.21 now.