Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367224

Summary: Formatter Aligns Equals Sign (=) within Section of Code
Product: [Eclipse Project] JDT Reporter: Nathan Reynolds <numeralnathan>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: VERIFIED DUPLICATE QA Contact: Ayushman Jain <amj87.iitr>
Severity: enhancement    
Priority: P3 CC: amj87.iitr, daniel_megert, deepakazad, manoj.palat, mateusz.matela
Version: 3.8   
Target Milestone: 4.9 RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Reynolds CLA 2011-12-20 12:29:12 EST
Build Identifier: 20110916-0149

Consider the following code snippet.  This code is a bit difficult to read.

lastNearestSeries = nearestSeries;
lastNearestItem = nearestItem;
series = dataset.getSeries(lastNearestSeries);
number = series.getValue(lastNearestItem);
value = value.doubleValue();
period = series.getTimePeriod(lastNearestItem);
time = period.getFirstMillisecond();

Consider this same code reformatted.  This code is much easier to read because all of the equal signs (=) are lined up.

lastNearestSeries = nearestSeries;
lastNearestItem   = nearestItem;
series            = dataset.getSeries(lastNearestSeries);
number            = series.getValue(lastNearestItem);
value             = number.doubleValue();
period            = series.getTimePeriod(lastNearestItem);
time              = period.getFirstMillisecond();

Please improve the code formatter so that it will align (=) within a section
of contiguous lines.  If there is a blank line(s) breaking up two different
sections of code, provide an option to ignore these blank line(s) and
consider the two sections as one.  If there is a non-blank line(s) breaking
up two different sections of code, provide a spinner option to ignore up to N
lines.  Of course, method boundaries break a section regardless of the
previous setting.

Reproducible: Always
Comment 1 Deepak Azad CLA 2011-12-20 14:11:29 EST
Workaround: You can turn the formatter on and off within the Java editor. See the  'Off/On tags' tab in a formatter profile.
Comment 2 Mateusz Matela CLA 2018-02-05 17:01:31 EST

*** This bug has been marked as a duplicate of bug 131292 ***
Comment 3 Manoj N Palat CLA 2018-08-30 10:15:13 EDT
Verified for Eclipse 4.9 RC1 with Build id: I20180829-2000