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

Bug 563382

Summary: [14] Completion inserts an invalid import statement
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 4.14   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Jay Arthanareeswaran CLA 2020-05-20 03:22:38 EDT
This is a modified version from bug 562219. When I try to complete Color at |, X.Y.Z.R.Color is offered as one of the options and when selected, an unresolvable import statement as below is inserted:

import X.Y.Z.R.Color; // This line contains an error

public class X {
  @SuppressWarnings("unused")
    static class Y {
    @SuppressWarnings("preview")
    static class Z {
      public record R(Color c) {
        public enum Color {
          Blue, Red, Green;
        }
      }
      public void foo() {
        R r = new R(Colo|);
      }
    }
  }
}
For now I am raising this in UI and I am not sure if the resolution is at fault here.
Comment 1 Jay Arthanareeswaran CLA 2020-05-26 04:14:19 EDT
Looks like I submitted this report twice.

*** This bug has been marked as a duplicate of bug 563381 ***