Bug 572440 - [cleanup] Combine declaration and assignment of local variable during "Remove overridden assignment"
Summary: [cleanup] Combine declaration and assignment of local variable during "Remove...
Status: CLOSED 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: ---   Edit
Assignee: Thomas M??der CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 572159 572441
  Show dependency tree
 
Reported: 2021-03-30 04:23 EDT by Lars Vogel CLA
Modified: 2024-04-22 10:41 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2021-03-30 04:23:45 EDT
Looking at https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/171078 it would be nice to have a clean-up which combines declaration and assignment of a local variable if both happen in two lines:

-----
Before:
BuildCommand result;
result = (BuildCommand) super.clone();
	
After:
BuildCommand result = (BuildCommand) super.clone();
------

IMHO this improves readability.
Comment 1 Lars Vogel CLA 2021-03-30 05:29:36 EDT
Fabrice, sounds like committers think the "Remove overridden assignment" should combine declaration and assignment if possible. Do you agree? In this case, I adjust this bug report.
Comment 2 Fabrice Tiercelin CLA 2021-03-30 05:57:34 EDT
Yes, when possible.
Comment 3 Lars Vogel CLA 2021-04-13 03:00:18 EDT
(In reply to Fabrice Tiercelin from comment #2)
> Yes, when possible.

Could you investiage for M2? This would affect and improve a lot of code in platform and would require again a lot of version number increates if we would have to wait for 4.21.
Comment 4 Lars Vogel CLA 2022-03-22 15:47:57 EDT
Thomas, is that something you could work on? This blocks the application of "Remove overridden assignment" in the Eclipse code base.
Comment 5 Lars Vogel CLA 2022-04-01 04:44:51 EDT
(In reply to Lars Vogel from comment #4)
> Thomas, is that something you could work on? This blocks the application of
> "Remove overridden assignment" in the Eclipse code base.

Jeff, is that something for you? This could clean-up a lot of code in platform once available.
Comment 6 Thomas M??der CLA 2022-04-04 08:23:18 EDT
T.b.h, I don't see that as much of a code smell. Still a useful cleanup, but at the moment, I'd like to focus on getting the number of open changes down before moving to Github.
Comment 7 Lars Vogel CLA 2022-04-05 04:01:32 EDT
(In reply to Thomas  M??der from comment #6)
> T.b.h, I don't see that as much of a code smell. Still a useful cleanup, but
> at the moment, I'd like to focus on getting the number of open changes down
> before moving to Github.

Thanks for the reply. Cleaning up the JDT review queue is a very important task, thanks for doing this.
Comment 8 Eclipse Genie CLA 2024-04-15 16:33:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 9 Jeff Johnston CLA 2024-04-22 10:41:04 EDT
This has been moved to: https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/1330 and fixed for 4.32 M2.