Bug 353727 - [move member type] Move to new file fails for static inner interface with static inner interface
Summary: [move member type] Move to new file fails for static inner interface with sta...
Status: CLOSED DUPLICATE of bug 310510
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 05:43 EDT by Heiko Böttger CLA
Modified: 2012-04-03 11:46 EDT (History)
5 users (show)

See Also:


Attachments
TestProject (3.79 KB, application/x-zip-compressed)
2011-12-02 03:25 EST, Heiko Böttger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Böttger CLA 2011-08-03 05:43:05 EDT
What steps will reproduce the problem?

Tried to "move to new file" refactoring on IActiveTimeIntervalProvider.

public class SignalDataProvider implements ISignalDataProvider {
  
  public static interface IActiveTimeIntervalProvider {
    
    public static interface ITimeIntervalDataListener {
      
      public void intervalsChanged();
    
    }
    
    public void getValues(ProjectRef projectRef, long startTime, long endTime, IAsyncResultHandler<List<TimeInterval>> resultHandler);
    
    public IListenerHandle addDataListener(ITimeIntervalDataListener listener);
  }
}


-- Error Details --
Date: Wed Aug 03 11:38:13 CEST 2011
Message: Internal Error
Severity: Error
Product: Eclipse SDK 3.7.0.v201106131736 (org.eclipse.sdk.ide)
Plugin: org.eclipse.ltk.ui.refactoring
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_23
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH
Command-line arguments:  -os win32 -ws win32 -arch x86

Exception Stack Trace:
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
	at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2642)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:631)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:470)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.getStartingPage(RefactoringWizard.java:440)
	at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.createContents(RefactoringWizardDialog2.java:613)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:172)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:193)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:116)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:38)
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startMoveInnerRefactoring(RefactoringExecutionStarter.java:378)
	at org.eclipse.jdt.ui.actions.ConvertNestedToTopAction.run(ConvertNestedToTopAction.java:170)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.ASTNodes.getParent(ASTNodes.java:514)
	at org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil.getAbstractTypeDeclarationNode(ASTNodeSearchUtil.java:169)
	at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopRefactoring.addTypeParameters(MoveInnerToTopRefactoring.java:334)
	at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopRefactoring.createChangeManager(MoveInnerToTopRefactoring.java:818)
	at org.eclipse.jdt.internal.corext.refactoring.structure.MoveInnerToTopRefactoring.checkFinalConditions(MoveInnerToTopRefactoring.java:736)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Kentarou Fukuda CLA 2011-09-01 14:09:18 EDT
It seems to be a report for JDT.
Comment 2 Zach Musgrave CLA 2011-11-29 16:38:18 EST
This is probably a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=348024.
Comment 3 Srikanth Sankaran CLA 2011-11-30 02:05:33 EST
Hello, can you test with 3.7.1 or 3.8 M3 to see if the problem is still
there ? Without modifying the test case in comment# 0 in various ways,
we cannot test it from our side and modifying the test may affect the
observations.
Comment 4 Heiko Böttger CLA 2011-11-30 16:15:06 EST
I tried it with 

Version: 3.8.0
Build id: I20110915-1308

and it seems to work.
Comment 5 Srikanth Sankaran CLA 2011-11-30 23:00:57 EST
(In reply to comment #4)
> I tried it with 
> 
> Version: 3.8.0
> Build id: I20110915-1308
> 
> and it seems to work.

Thanks for checking, Any chance we can get a full test case (with stubbed out types should be OK) so we can check against 3.7.1 also ? And add it to regression
test suite as needed ? 

Otherwise we will close this as WORKSFORME/DUPLICATE.
Comment 6 Heiko Böttger CLA 2011-12-01 15:14:16 EST
Okay, I will do this tomorrow at work.
Comment 7 Heiko Böttger CLA 2011-12-02 03:25:55 EST
Created attachment 207825 [details]
TestProject

I could veriy that this is a duplicate of https://bugs.eclipse.org/bugs/show_bug.cgi?id=348024
as reported by Zach Musgrave in https://bugs.eclipse.org/bugs/show_bug.cgi?id=353727#c2.

When removing the package-info.java, there is no error in the old 3.7.0 workspace.
Comment 8 Srikanth Sankaran CLA 2011-12-02 03:47:53 EST
With the test case in comment#7 I don't see the exception anymore.
However, the move to new file refactoring seems to leave things
in a bad state with a couple of files not compiling anymore due to
malformed imports.

Passing to UI team for comment.

(delete the package-info.java file)
Comment 9 Dani Megert CLA 2011-12-05 09:56:02 EST
(In reply to comment #8)
> With the test case in comment#7 I don't see the exception anymore.
> However, the move to new file refactoring seems to leave things
> in a bad state with a couple of files not compiling anymore due to
> malformed imports.

This is with 3.7.1 or 3.8?
Comment 10 Srikanth Sankaran CLA 2011-12-06 01:42:58 EST
(In reply to comment #9)
> (In reply to comment #8)
> > With the test case in comment#7 I don't see the exception anymore.
> > However, the move to new file refactoring seems to leave things
> > in a bad state with a couple of files not compiling anymore due to
> > malformed imports.
> 
> This is with 3.7.1 or 3.8?

With 3.8 M4 candidate build id: I20111202-0800, after the move type to new file
on the project that builds fine prior to the refactoring, I get 

Description	Resource	Path	Location	Type
The import ch.actifsource.bugreport.test.SignalDataProvider.IActiveTimeIntervalProvider cannot be resolved	SignalDataProvider.java	/TestProject/src/ch/actifsource/bugreport/test	line 5	Java Problem
The import ch.actifsource.bugreport.test.SignalDataProvider.IActiveTimeIntervalProvider cannot be resolved	IActiveTimeIntervalProvider.java	/TestProject/src/ch/actifsource/bugreport/test	line 5	Java Problem
Comment 11 Dani Megert CLA 2011-12-06 02:32:47 EST
Raksha, please investigate.
Comment 12 Dani Megert CLA 2012-04-03 11:46:51 EDT

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