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

Bug 144493

Summary: [Change Method Signature] does not add imports for default expression
Product: [Eclipse Project] JDT Reporter: Zorzella Mising name <zorzella>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: deepakazad
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Zorzella Mising name CLA 2006-05-30 13:10:41 EDT
If a have a method

public void A () {...}

and I refactor it, adding a parameter that defaults to an enum (say "RoundingMode.HALF_UP"), the refactoring will not automatically add an import to the enum ("RoundingMode" in this case) to the files affected by the refactoring.

Z
Comment 1 Olivier Thomann CLA 2006-05-30 14:17:04 EDT
Moving to JDT/UI
Comment 2 Markus Keller CLA 2006-06-01 08:58:08 EDT
Imports are currently not added for the default expression - the expression is just inserted as-is.
Comment 3 Eclipse Genie CLA 2018-12-15 19:50:58 EST
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 4 Zorzella Mising name CLA 2018-12-17 19:20:57 EST
I just tested this (on 4.7), and the problem remains. You need two classes to see it. Here's a way to repro:

****************

public class Bug144493 {
  
  // Add RoundingMode as a parameter, default to RoundingMode.HALF_UP
  void A() {}
  
}


*****************

public class Bug144493B {
  void B() {
    new Bug144493().A();
  }
}