Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse 4.7 hangs on every modification of code in groovy editor #327

Closed
godfuture opened this issue Aug 17, 2017 · 11 comments
Closed

Eclipse 4.7 hangs on every modification of code in groovy editor #327

godfuture opened this issue Aug 17, 2017 · 11 comments

Comments

@godfuture
Copy link

godfuture commented Aug 17, 2017

eclipse.buildId=4.7.0.I20170612-0950
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product -data file:/C:/DEV_DATA/XE/4.29/ -product org.eclipse.epp.package.java.product
Groovy-Eclipse Feature	2.9.2.xx-201708160036-e47	org.codehaus.groovy.eclipse.feature.feature.group	Codehaus.org

I am writing a script with project references to our companys business objects. When doing code changes or switching tab, Eclipse is freezing for many seconds.

This behavior applies also to MyEclipse 2016 CI.

I don't know if this errors from log have anything to do with this issue:

!ENTRY org.eclipse.ui 4 0 2017-08-17 12:55:32.796
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:820)
	at org.eclipse.ui.menus.CommandContributionItem.lambda$3(CommandContributionItem.java:797)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	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:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NullPointerException
	at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1282)
	at org.eclipse.ui.internal.WorkbenchPage$12.run(WorkbenchPage.java:4329)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4325)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:4305)
	at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:132)
	at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:87)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	... 36 more

!ENTRY org.eclipse.jdt.groovy.core 4 0 2017-08-17 13:15:07.317
!MESSAGE Groovy-Eclipse Type Inferencing: Error visiting method run in class AllegroPushInterface_Deals_Daily_ScriptableJob
!STACK 0
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.checkParameterizedSuperTypeCollisions(ClassScope.java:806)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkParameterizedTypes(CompilationUnitScope.java:298)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:262)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:288)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.accept(CompilationUnitProblemFinder.java:125)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:193)
	at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:201)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:549)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:612)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.resolveSingleImport(CompilationUnitScope.java:828)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:3271)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:3000)
	at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:51)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:496)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:592)
	at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:588)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesWithSuspendedTempErrorHandlingPolicy(SourceTypeBinding.java:1940)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1827)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1521)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:262)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initialize(JDTClassNode.java:226)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.lazyClassInit(JDTClassNode.java:159)
	at org.codehaus.groovy.ast.ClassNode.getUnresolvedInterfaces(ClassNode.java:1143)
	at org.codehaus.groovy.ast.ClassNode.getUnresolvedInterfaces(ClassNode.java:1133)
	at org.eclipse.jdt.groovy.search.VariableScope.findAllInterfaces(VariableScope.java:928)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findMethodDeclaration(SimpleTypeLookup.java:568)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findDeclaration(SimpleTypeLookup.java:493)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findTypeForNameWithKnownObjectExpression(SimpleTypeLookup.java:348)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.findType(SimpleTypeLookup.java:220)
	at org.eclipse.jdt.groovy.search.SimpleTypeLookup.lookupType(SimpleTypeLookup.java:88)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.lookupExpressionType(TypeInferencingVisitorWithRequestor.java:2278)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.handleSimpleExpression(TypeInferencingVisitorWithRequestor.java:1833)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstantExpression(TypeInferencingVisitorWithRequestor.java:1081)
	at org.codehaus.groovy.ast.expr.ConstantExpression.visit(ConstantExpression.java:85)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitMethodCallExpression(TypeInferencingVisitorWithRequestor.java:1420)
	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBinaryExpression(TypeInferencingVisitorWithRequestor.java:866)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitDeclarationExpression(CodeVisitorSupport.java:250)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitDeclarationExpression(ClassCodeVisitorSupport.java:154)
	at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:74)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:281)
	at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
	at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:40)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:251)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitBlockStatement(TypeInferencingVisitorWithRequestor.java:938)
	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:148)
	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:159)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitConstructorOrMethod(TypeInferencingVisitorWithRequestor.java:1133)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:519)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitJDT(TypeInferencingVisitorWithRequestor.java:392)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:351)
	at org.codehaus.groovy.eclipse.editor.highlighting.GatherSemanticReferences.findSemanticHighlightingReferences(GatherSemanticReferences.java:46)
	at org.codehaus.groovy.eclipse.editor.highlighting.GroovySemanticReconciler.reconciled(GroovySemanticReconciler.java:226)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.reconciled(CompilationUnitEditor.java:1687)
	at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconciled(JavaReconcilingStrategy.java:219)
	at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconciled(JavaCompositeReconcilingStrategy.java:164)
	at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:144)
	at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:95)
	at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:420)
	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:174)

!ENTRY org.eclipse.jdt.groovy.core 4 0 2017-08-17 13:15:07.460
!MESSAGE Groovy-Eclipse Type Inferencing: Error visiting types for AllegroPushInterface_Deals_Daily_ScriptableJob.groovy
!STACK 0
java.lang.IllegalStateException: 'type' was null or an unhandled type: null
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureType(JDTClassNodeBuilder.java:90)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createJDTClassNode(JDTResolver.java:459)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.convertToClassNode(JDTResolver.java:435)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.methodBindingToMethodNode(JDTClassNode.java:348)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:270)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initialize(JDTClassNode.java:226)
	at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.lazyClassInit(JDTClassNode.java:159)
	at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1124)
	at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1114)
	at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:1108)
	at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:1046)
	at org.codehaus.groovy.ast.ClassNode.isScript(ClassNode.java:1274)
	at org.codehaus.groovy.eclipse.core.search.FindAllReferencesRequestor.acceptASTNode(FindAllReferencesRequestor.java:81)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.notifyRequestor(TypeInferencingVisitorWithRequestor.java:2313)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitClassReference(TypeInferencingVisitorWithRequestor.java:734)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitImports(TypeInferencingVisitorWithRequestor.java:607)
	at org.eclipse.jdt.groovy.search.TypeInferencingVisitorWithRequestor.visitCompilationUnit(TypeInferencingVisitorWithRequestor.java:349)
	at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.internalFindOccurences(GroovyOccurrencesFinder.java:156)
	at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.getOccurrences(GroovyOccurrencesFinder.java:84)
	at org.codehaus.groovy.eclipse.search.GroovyOccurrencesFinder.findOccurrences(GroovyOccurrencesFinder.java:210)
	at org.codehaus.groovy.eclipse.editor.GroovyEditor.updateOccurrenceAnnotations(GroovyEditor.java:1327)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor$6.selectionChanged(JavaEditor.java:3364)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:182)
	at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
@eric-milles
Copy link
Member

eric-milles commented Aug 17, 2017 via email

@godfuture
Copy link
Author

Due to license reasons I can't provide the script here. But I guess the logs reflect not the amount of occurrences that appear in UI. The UI freezes quite frequent, but logs appear not really often. So my suggestion is that the issue is not logged at all.

Is there a debug log?

@eric-milles
Copy link
Member

It's not the logging that is causing the slowness in the UI. It is type lookup during reconcile. When Eclipse is unable to initialize a class into its model, it can slow down the editor quite a bit.

Without more information, all I can do is try to address the issues noted in the log entries you included. Could you update to the latest snapshot build? I added some context information to the 'type' was null or an unhandled type: null exception. This could help pinpoint the type and method that is causing the exception.

@mpiggott
Copy link

The UI freezes quite frequent, but logs appear not really often. So my suggestion is that the issue is not logged at all.

Have you looked at whether this is related to content assist? I experienced performance issues with the Code Recommenders plugins in previous versions.

@godfuture
Copy link
Author

godfuture commented Aug 23, 2017

@eric-milles I did the update to latest snapshot. In the log file I can't figure out any additional statements.
@mpiggott , I indeed had issues with content assist:

!ENTRY org.eclipse.jdt.ui 2 0 2017-08-23 21:29:29.664
!MESSAGE The 'Groovy Code Completions' proposal computer from the 'org.codehaus.groovy.eclipse.codeassist.completion' plug-in did not complete normally. The extension took too long to return from the 'computeCompletionProposals()' operation.

But the freezes still occurred after disabling content assist:
image
image

@mpiggott
Copy link

I indeed had issues with content assist:

In 4.6 I had removed the Code Recommenders plugins from my install, I would take a stab at unchecking them here see if it fixes the issue for you.

I should also say, I'm not involved in the groovy-eclipse project I was just looking at the issues list.

@godfuture
Copy link
Author

I would like to supply more detailed logs. How could I deliver logs that may give more information about what is going on during code changes?

Thank you a lot!

@eric-milles
Copy link
Member

eric-milles commented Aug 30, 2017 via email

@godfuture
Copy link
Author

I do not know how to send you messages besides this thread, sorry...

It seems as I have to be invited for team login. Do you have other ways of getting in contact? Skype?

@eric-milles
Copy link
Member

eric-milles commented Sep 1, 2017 via email

@eric-milles
Copy link
Member

Per our discussion, it looks like the source of the UI slowness is the reconcile process. Eclipse tries to synch up the editor contents with the Groovy/Java model. And it is taking in excess of 20 seconds.

Also, I did remember where the shortcut for adding a type inferencing suggestion is. Put your editor selection over an underlined variable in your script and press Ctrl-1 to open the Quick Assist menu. "Add inferencing suggestion" should be a choice in the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants