Bug 128088 [typing] file save and cut& paste too slow
When I try to do a file save OR cut and paste in the editor, Eclipse goes into busy mode for 3-5 secs atleast. And this happens often. My project has a few thousand files. My machine is powerful. I dont see this happen on small projects. I have attached a thread dump when I was doing a cut. Full thread dump Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode): "Worker-5" prio=5 tid=0x031392a8 nid=0x137c waiting for monitor entry [3cdf000.. 3cdfd8c] at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManag er$3.run(SelectionListenerWithASTManager.java:142) - waiting to lock <0x11889530> (a java.lang.Object) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) "Text Viewer Hover Presenter" daemon prio=2 tid=0x02e17198 nid=0x10ec in Object. wait() [3c7f000..3c7fd8c] at java.lang.Object.wait(Native Method) - waiting on <0x116f4a58> (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider .java:470) - locked <0x116f4a58> (a java.lang.Object) at org.eclipse.jdt.internal.ui.text.java.hover.NLSStringHover.getHoverIn fo(NLSStringHover.java:84) at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverIn fo(BestMatchHover.java:102) at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy. getHoverInfo(JavaEditorTextHoverProxy.java:69) at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverMa nager.java:160) "Worker-4" prio=5 tid=0x031494a0 nid=0x80 waiting on condition [3c3f000..3c3fd8c ] at java.lang.Thread.sleep(Native Method) at org.eclipse.jdt.internal.core.search.processing.JobManager$1$Progress Job.run(JobManager.java:323) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) "Worker-3" prio=5 tid=0x032d9890 nid=0x17c8 in Object.wait() [3b6f000..3b6fd8c] at java.lang.Object.wait(Native Method) - waiting on <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:173) - locked <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:20 5) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:69) "Worker-2" prio=5 tid=0x03307760 nid=0x610 in Object.wait() [3b2f000..3b2fd8c] at java.lang.Object.wait(Native Method) - waiting on <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:173) - locked <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:20 5) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:69) "Worker-1" prio=5 tid=0x02e2e188 nid=0x1194 in Object.wait() [3aef000..3aefd8c] at java.lang.Object.wait(Native Method) - waiting on <0x116f4a58> (a java.lang.Object) at java.lang.Object.wait(Object.java:429) at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider .java:470) - locked <0x116f4a58> (a java.lang.Object) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManag er$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java: 165) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManag er$3.run(SelectionListenerWithASTManager.java:142) - locked <0x11889530> (a java.lang.Object) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=2 tid=0x02d97638 n id=0x12e4 runnable [394f000..394fd8c] at org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject.hashCode( HashtableOfArrayToObject.java:100) at org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject.hashCode( HashtableOfArrayToObject.java:94) at org.eclipse.jdt.internal.core.util.HashtableOfArrayToObject.get(Hasht ableOfArrayToObject.java:70) at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.computeChildren( JarPackageFragmentRoot.java:100) at org.eclipse.jdt.internal.core.PackageFragmentRoot.buildStructure(Pack ageFragmentRoot.java:174) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:23 3) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement. java:488) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement. java:232) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement. java:218) at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.jav a:173) at org.eclipse.jdt.internal.core.JavaProjectElementInfo.getProjectCache( JavaProjectElementInfo.java:195) at org.eclipse.jdt.internal.core.JavaProjectElementInfo.newNameLookup(Ja vaProjectElementInfo.java:260) at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.j ava:2419) at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(Searchable Environment.java:60) at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(Searchable Environment.java:74) at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(Cancel ableNameEnvironment.java:26) at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(Co mpilationUnitProblemFinder.java:148) at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(Co mpilationUnitProblemFinder.java:214) at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOp eration(ReconcileWorkingCopyOperation.java:79) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperati on.java:718) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaMod elOperation.java:777) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUn it.java:1081) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(J avaReconcilingStrategy.java:98) - locked <0x11735188> (a org.eclipse.jdt.internal.core.CompilationUnit) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatfo rm.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconci le(JavaReconcilingStrategy.java:82) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initial Reconcile(JavaReconcilingStrategy.java:174) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initial Reconcile(CompositeReconcilingStrategy.java:114) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.ini tialReconcile(JavaCompositeReconcilingStrategy.java:120) at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoR econciler.java:103) at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaRe conciler.java:328) - locked <0x117084b8> (a java.lang.Object) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread .run(AbstractReconciler.java:170) "Java indexing" daemon prio=4 tid=0x03070930 nid=0xf2c waiting on condition [390 f000..390fd8c] at java.lang.Thread.sleep(Native Method) at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobMan ager.java:380) at java.lang.Thread.run(Thread.java:534) "Worker-0" prio=5 tid=0x03042f00 nid=0x12f4 in Object.wait() [37af000..37afd8c] at java.lang.Object.wait(Native Method) - waiting on <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.sleep(WorkerPool.java:173) - locked <0x11507eb0> (a org.eclipse.core.internal.jobs.WorkerPool) at org.eclipse.core.internal.jobs.WorkerPool.startJob(WorkerPool.java:20 5) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:69) "Start Level Event Dispatcher" daemon prio=5 tid=0x02e70370 nid=0x1384 in Object .wait() [303f000..303fd8c] at java.lang.Object.wait(Native Method) - waiting on <0x114457f8> (a org.eclipse.osgi.framework.eventmgr.EventMa nager$EventThread) at java.lang.Object.wait(Object.java:429) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextE vent(EventManager.java:349) - locked <0x114457f8> (a org.eclipse.osgi.framework.eventmgr.EventManage r$EventThread) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(Even tManager.java:287) "Framework Event Dispatcher" daemon prio=5 tid=0x0037f598 nid=0x1104 in Object.w ait() [2fff000..2fffd8c] at java.lang.Object.wait(Native Method) - waiting on <0x114220d8> (a org.eclipse.osgi.framework.eventmgr.EventMa nager$EventThread) at java.lang.Object.wait(Object.java:429) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextE vent(EventManager.java:349) - locked <0x114220d8> (a org.eclipse.osgi.framework.eventmgr.EventManage r$EventThread) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(Even tManager.java:287) "State Data Manager" daemon prio=5 tid=0x0036ad20 nid=0x9d4 waiting on condition [2fbf000..2fbfd8c] at java.lang.Thread.sleep(Native Method) at org.eclipse.osgi.framework.adaptor.core.StateManager.run(StateManager .java:289) at java.lang.Thread.run(Thread.java:534) "Signal Dispatcher" daemon prio=10 tid=0x0003dd20 nid=0xea4 waiting on condition [0..0] "Finalizer" daemon prio=9 tid=0x0003b240 nid=0x15d0 in Object.wait() [2c2f000..2 c2fd8c] at java.lang.Object.wait(Native Method) - waiting on <0x113dd428> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111) - locked <0x113dd428> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) "Reference Handler" daemon prio=10 tid=0x00039e38 nid=0x2b0 in Object.wait() [2b ef000..2befd8c] at java.lang.Object.wait(Native Method) - waiting on <0x113dd490> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:429) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115) - locked <0x113dd490> (a java.lang.ref.Reference$Lock) "main" prio=7 tid=0x00035be0 nid=0xee8 waiting for monitor entry [7f000..7fc40] at org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector.d etectHyperlinks(JavaElementHyperlinkDetector.java:73) - waiting to lock <0x11735188> (a org.eclipse.jdt.internal.core.Compilat ionUnit) at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(Hype rlinkManager.java:232) - locked <0x117c2508> (a [Lorg.eclipse.jface.text.hyperlink.IHyperlinkDe tector;) at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(Hyperlink Manager.java:419) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 145) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.jav a:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:10 3) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformAct ivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja va:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) "VM Thread" prio=5 tid=0x0030c6f8 nid=0x16ec runnable "VM Periodic Task Thread" prio=10 tid=0x0030d7b0 nid=0x16f4 waiting on condition "Suspend Checker Thread" prio=10 tid=0x0003d3b8 nid=0x142c runnable
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/AbstractJavaEditorTextHover.java
* @since 2.1
	 */
	protected String getHoverInfo(IJavaElement[] javaElements) {
		return null;
	}
	/*
	 * @see ITextHoverExtension#getHoverControlCreator()
	 * @since 3.0
	 */
	public IInformationControlCreator getHoverControlCreator() {
		return new IInformationControlCreator() {
			public IInformationControl createInformationControl(Shell parent) {
				return new DefaultInformationControl(parent, SWT.NONE, new HTMLTextPresenter(true), getTooltipAffordanceString());
			}
		};
	}
	/**
	 * Returns the tool tip affordance string.
	 *
	 * @return the affordance string or <code>null</code> if disabled or no key binding is defined
	 * @since 3.0
	 */
	protected String getTooltipAffordanceString() {
		if (fBindingService == null || !JavaPlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE))
			return null;
		String keySequence= fBindingService.getBestActiveBindingFormattedFor(IJavaEditorActionDefinitionIds.SHOW_JAVADOC);
		return Messages.format(JavaHoverMessages.JavaTextHover_makeStickyHint, keySequence == null ? "" : keySequence); 
	}
}