Bug 535536 - Overlapping text edits during Java code Clean Up
Summary: Overlapping text edits during Java code Clean Up
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2018-06-05 04:02 EDT by Trevor Dearham CLA
Modified: 2022-08-16 05:08 EDT (History)
1 user (show)

See Also:


Attachments
Eclipse Clean Up Profile (4.04 KB, text/xml)
2018-06-05 05:15 EDT, Trevor Dearham CLA
no flags Details
project (1.34 MB, application/x-zip-compressed)
2018-06-06 04:09 EDT, Trevor Dearham CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Dearham CLA 2018-06-05 04:02:10 EDT
When applying a Clean Up to the following Java code which is using Project Lombok (https://projectlombok.org/), I get the "Overlapping text edits" error.

package cleanUpError;

import lombok.Data;

public class CleanUpError
{
  @Data
  private static class Inner
  {
    private String hello;
    private String world;
  }

  private Inner inner = new Inner();

  public String getHello( String test )
  {
    return this.inner.getHello() + this.inner.getWorld();
  }
}
Comment 1 Noopur Gupta CLA 2018-06-05 04:38:08 EDT
Can you try with the latest Photon (4.8) build?

Please mention the clean up settings that are active while you are applying it. Also, attach a standalone example with no errors that can reproduce this issue.
Comment 2 Trevor Dearham CLA 2018-06-05 05:13:13 EDT
Thank you for the quick response.

I've managed to make the example that errors smaller:

package cleanUpError;

import lombok.Data;

public class CleanUpError
{
  @Data
  private static class Inner
  {
    private String hello;
    private String world;
  }

}

Clean Up works if @Data is removed or either property is removed. I'll attach my Clean Up profile. I've verified that it still fails on Eclipse Photon RC2.
Comment 3 Trevor Dearham CLA 2018-06-05 05:15:02 EDT
Created attachment 274328 [details]
Eclipse Clean Up Profile
Comment 4 Noopur Gupta CLA 2018-06-05 08:07:02 EDT
I tried with build I20180530-2000 using your example and clean up profile but still could not reproduce it. Please mention the build you are using. Can you try with the latest Photon (4.8) build taken from  http://download.eclipse.org/eclipse/downloads/drops4/S-4.8RC3-201805310700/?

You can also attach a sample project if that helps in reproducing the issue in the above build.
Comment 5 Trevor Dearham CLA 2018-06-06 04:08:58 EDT
Thank you for trying to verify the issue. Sorry I forgot to mention that Project Lombok needs to be installed into Eclipse (https://projectlombok.org/setup/eclipse), as well as included as a dependency. Clean Up works without Project Lombok being installed, but once it is then Clean Up fails.

Using the build you of Eclipse referenced the Clean Up fails with my Clean Up Profile, but works with the default.

I'll attach a copy of my project.
Comment 6 Trevor Dearham CLA 2018-06-06 04:09:53 EDT
Created attachment 274342 [details]
project
Comment 7 Eclipse Genie CLA 2020-07-03 00:23:10 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 8 Eclipse Genie CLA 2022-07-29 14:59:10 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 Trevor Dearham CLA 2022-08-16 05:08:27 EDT
I moved to vscode years ago so I'm no longer concerned by this issue. I've detailed the steps to reproduce this should anyone wish to check if it still exists and fix it.