Bug 511970 - [1.8] NPE in TypeVariableBinding.computeUniqueKey
Summary: [1.8] NPE in TypeVariableBinding.computeUniqueKey
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-09 07:05 EST by David Karnok CLA
Modified: 2023-01-16 15:46 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Karnok CLA 2017-02-09 07:05:43 EST
Eclipse version:
  Version: Neon.2 Release (4.6.2)
  Build id: 20161208-0600

The following unit tests causes an unhandled Exception when I attempt to run it via context menu > Run > Run as JUnit test. In fact, the submenu below Run and Debug there doesnt't even show up.

    import java.util.Iterator;
    import java.util.function.Function;

    public class LambdaUniqueKey {
    
        class O<T> {
            <R> O<R> g(Function<T, Iterable<R>> it) {
                return null;
            }
        }
        
        <T, R> void s(Function<O<Integer>, O<R>> mapper) {
            
        }
        
        @Test
        public void m() {
            this.s(f -> f.g(s -> () -> new Iterator<Integer>() {
                @Override
                public boolean hasNext() {
                    return true;
                };
                
                @Override
                public Integer next() {
                    return 1;
                };
            }));
        }
    }

Exception:

	java.lang.NullPointerException
		at org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding.computeUniqueKey(TypeVariableBinding.java:362)
		at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.computeUniqueKey(ParameterizedTypeBinding.java:358)
		at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.computeUniqueKey(ParameterizedTypeBinding.java:358)
		at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.computeUniqueKey(MethodBinding.java:429)
		at org.eclipse.jdt.internal.compiler.lookup.Binding.computeUniqueKey(Binding.java:118)
		at org.eclipse.jdt.internal.core.LambdaFactory.createLambdaMethod(LambdaFactory.java:49)
		at org.eclipse.jdt.internal.core.LambdaExpression.<init>(LambdaExpression.java:56)
		at org.eclipse.jdt.internal.core.LambdaFactory.createLambdaExpression(LambdaFactory.java:26)
		at org.eclipse.jdt.internal.core.util.HandleFactory.createElement(HandleFactory.java:216)
		at org.eclipse.jdt.internal.core.util.HandleFactory.createElement(HandleFactory.java:211)
		at org.eclipse.jdt.internal.core.util.HandleFactory.createElement(HandleFactory.java:182)
		at org.eclipse.jdt.internal.core.util.HandleFactory.createElement(HandleFactory.java:162)
		at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.rememberAllTypes(HierarchyResolver.java:486)
		at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:831)
		at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:628)
		at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:116)
		at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:151)
		at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:315)
		at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1286)
		at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90)
		at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724)
		at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:790)
		at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:743)
		at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:695)
		at org.eclipse.jdt.internal.launching.JavaLaunchableTester.hasSuperclass(JavaLaunchableTester.java:467)
		at org.eclipse.jdt.internal.launching.JavaLaunchableTester.test(JavaLaunchableTester.java:611)
		at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
		at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:100)
		at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
		at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:22)
		at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
		at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:31)
		at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
		at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:160)
		at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
		at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:75)
		at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
		at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:55)
		at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:281)
		at org.eclipse.debug.ui.actions.ContextualLaunchAction.isApplicable(ContextualLaunchAction.java:287)
		at org.eclipse.debug.ui.actions.ContextualLaunchAction.fillMenu(ContextualLaunchAction.java:218)
		at org.eclipse.debug.ui.actions.ContextualLaunchAction$1.menuShown(ContextualLaunchAction.java:141)
		at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:256)
		at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
		at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1088)
		at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:802)
		at org.eclipse.jface.action.ActionContributionItem.copyMenu(ActionContributionItem.java:1243)
		at org.eclipse.jface.action.ActionContributionItem.handleShowProxy(ActionContributionItem.java:1223)
		at org.eclipse.jface.action.ActionContributionItem.lambda$7(ActionContributionItem.java:1186)
		at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
		at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1103)
		at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1084)
		at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:5160)
		at org.eclipse.swt.widgets.Control.windowProc(Control.java:4828)
		at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:359)
		at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1656)
		at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2199)
		at org.eclipse.swt.widgets.Display.windowProc(Display.java:5123)
		at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
		at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:262)
		at org.eclipse.swt.widgets.Display.runPopups(Display.java:4277)
		at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3818)
		at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
		at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
		at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
		at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
		at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
		at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
		at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
		at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
		at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
		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:673)
		at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
		at org.eclipse.equinox.launcher.Main.run(Main.java:1519)

Session data:

	eclipse.buildId=4.6.2.M20161124-1400
	java.version=1.8.0_121
	java.vendor=Oracle Corporation
	BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=hu_HU
	Framework arguments:  -product org.eclipse.epp.package.jee.product
	Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
Comment 1 David Karnok CLA 2017-02-09 07:14:27 EST
Same crash with 

Version: Oxygen Release Milestone 5 (4.7.0 M5)
Build id: 20170202-1353
Comment 2 Eclipse Genie CLA 2020-08-06 15:53:30 EDT
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 3 Eclipse Genie CLA 2023-01-16 15:46:38 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.