Project: JDT
Bug 24912 inline method - inline method breaks code when inlining into a field initializer [refactoring]
Reported: 2002-10-17 05:58:32 | Status: resolved fixed

I-20021016 linux-gtk: public class Doo { private final static int MAGIC= compute(); private final static int compute() { return 42; } } There are two issues: 1) If select the use of compute() is selected for inlining, then I get a message on the preview page that it's not possible to inline inside a field initializer. This is true in general, but in this particular case, it would be possible. 2) If I select the declaration of the method, I don't get any error on the preview page. When I hit finish(), I will end up with a compile error, since the method is simply removed.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatus.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/base/RefactoringStatusCodes.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineMethodRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/TargetProvider.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TextChangeManager.java org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/code/InlineMethodInputPage.java