Community
Participate
Working Groups
I'm yet not able to identify the cause but when navigating to other source files I get an error popup. the stacktrace below is what gets logged. All open files do not contain compile errors. Build id: I20120515-2200 java.lang.IllegalArgumentException at org.eclipse.jdt.core.Signature.appendTypeArgumentSignatures(Signature.java:825) at org.eclipse.jdt.core.Signature.appendClassTypeSignature(Signature.java:615) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:911) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:855) at org.eclipse.jdt.core.Signature.toCharArray(Signature.java:2637) at org.eclipse.jdt.core.Signature.getSignatureSimpleName(Signature.java:1870) at org.eclipse.jdt.core.Signature.getSignatureSimpleName(Signature.java:1914) at org.eclipse.jdt.internal.core.SourceMapper$LocalVariableElementKey.<init>(SourceMapper.java:96) at org.eclipse.jdt.internal.core.SourceMapper.enterAbstractMethod(SourceMapper.java:836) at org.eclipse.jdt.internal.core.SourceMapper.enterMethod(SourceMapper.java:774) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:368) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:693) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:455) at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:934) at org.eclipse.jdt.internal.core.SourceMapper.mapSource(SourceMapper.java:1404) at org.eclipse.jdt.internal.core.SourceMapper.mapSource(SourceMapper.java:1339) at org.eclipse.jdt.internal.core.ClassFile.mapSource(ClassFile.java:659) at org.eclipse.jdt.internal.core.ClassFile.openBuffer(ClassFile.java:635) at org.eclipse.jdt.internal.core.Openable.getBuffer(Openable.java:288) at org.eclipse.jdt.internal.core.ClassFile.getBuffer(ClassFile.java:359) at org.eclipse.jdt.internal.core.ClassFile.getSourceRange(ClassFile.java:523) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.getEditorID(EditorUtility.java:421) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:179) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228) at org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlink.open(JavaElementHyperlink.java:77) at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseUp(HyperlinkManager.java:429) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4130) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3976) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3615) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1021) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:915) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
Another stacktrace with other locations but same problem: java.lang.IllegalArgumentException at org.eclipse.jdt.core.Signature.appendTypeArgumentSignatures(Signature.java:825) at org.eclipse.jdt.core.Signature.appendClassTypeSignature(Signature.java:615) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:911) at org.eclipse.jdt.core.Signature.appendTypeSignature(Signature.java:855) at org.eclipse.jdt.core.Signature.toCharArray(Signature.java:2637) at org.eclipse.jdt.core.Signature.getSignatureSimpleName(Signature.java:1870) at org.eclipse.jdt.core.Signature.getSignatureSimpleName(Signature.java:1914) at org.eclipse.jdt.internal.core.SourceMapper$LocalVariableElementKey.<init>(SourceMapper.java:96) at org.eclipse.jdt.internal.core.SourceMapper.enterAbstractMethod(SourceMapper.java:836) at org.eclipse.jdt.internal.core.SourceMapper.enterMethod(SourceMapper.java:774) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:368) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:693) at org.eclipse.jdt.internal.compiler.SourceElementNotifier.notifySourceElementRequestor(SourceElementNotifier.java:455) at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:934) at org.eclipse.jdt.internal.core.SourceMapper.mapSource(SourceMapper.java:1404) at org.eclipse.jdt.internal.core.SourceMapper.mapSource(SourceMapper.java:1339) at org.eclipse.jdt.internal.core.ClassFile.mapSource(ClassFile.java:659) at org.eclipse.jdt.internal.core.ClassFile.openBuffer(ClassFile.java:635) at org.eclipse.jdt.internal.core.Openable.getBuffer(Openable.java:288) at org.eclipse.jdt.internal.core.ClassFile.getBuffer(ClassFile.java:359) at org.eclipse.jdt.internal.core.BinaryMember.getCategories(BinaryMember.java:98) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabelComposer.appendCategoryLabel(JavaElementLabelComposer.java:630) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabelComposer.appendTypeLabel(JavaElementLabelComposer.java:1025) at org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabelComposer.appendElementLabel(JavaElementLabelComposer.java:285) at org.eclipse.jdt.ui.JavaElementLabels.getElementLabel(JavaElementLabels.java:531) at org.eclipse.jdt.ui.JavaElementLabels.getStyledElementLabel(JavaElementLabels.java:506) at org.eclipse.jdt.ui.JavaElementLabels.getStyledTextLabel(JavaElementLabels.java:434) at org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider.getStyledText(JavaUILabelProvider.java:178) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.getStyledText(DelegatingStyledCellLabelProvider.java:195) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.getStyledText(DecoratingStyledCellLabelProvider.java:192) at org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.update(DelegatingStyledCellLabelProvider.java:103) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider.update(DecoratingStyledCellLabelProvider.java:134) at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:953) at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:113) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1033) at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:485) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2167) at org.eclipse.jface.viewers.StructuredViewer.internalUpdate(StructuredViewer.java:2150) at org.eclipse.jface.viewers.StructuredViewer.update(StructuredViewer.java:2089) at org.eclipse.jface.viewers.ColumnViewer.update(ColumnViewer.java:554) at org.eclipse.jface.viewers.StructuredViewer.update(StructuredViewer.java:2033) at org.eclipse.jface.viewers.StructuredViewer.handleLabelProviderChanged(StructuredViewer.java:1191) at org.eclipse.jdt.internal.ui.javaeditor.JavaOutlinePage$JavaOutlineViewer.handleLabelProviderChanged(JavaOutlinePage.java:454) at org.eclipse.jface.viewers.ContentViewer$1.labelProviderChanged(ContentViewer.java:97) at org.eclipse.jface.viewers.BaseLabelProvider$1.run(BaseLabelProvider.java:74) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.BaseLabelProvider.fireLabelProviderChanged(BaseLabelProvider.java:72) at org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider$1.labelProviderChanged(DecoratingStyledCellLabelProvider.java:77) at org.eclipse.ui.internal.decorators.DecoratorManager$1.run(DecoratorManager.java:430) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.decorators.DecoratorManager.fireListener(DecoratorManager.java:428) at org.eclipse.ui.internal.decorators.DecorationScheduler$3.runInUIThread(DecorationScheduler.java:530) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3940) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3617) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1021) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:915) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
(In reply to comment #0) > I'm yet not able to identify the cause but when navigating to other source > files I get an error popup. the stacktrace below is what gets logged. All open > files do not contain compile errors. Stacktrace indicates that you did a Ctrl+Click. Can you also include the source file and the location where you did that?
It seems that whatever method of KMeansCluster I *select*, e.g. in outline view, it raises this exception. e.g. org.apache.mahout.clustering.kmeans.KMeansClusterer.clusterPoints(Iterable<Vector>, List<Cluster>, DistanceMeasure, int, double)) The class is contained in a binary plug-in project. Should I attach this project?
(In reply to comment #3) > The class is contained in a binary plug-in project. Should I attach this > project? That should also be good enough.
The mahout project is a bit large (33mb). I made the project temporarily available here: https://www.dropbox.com/s/o1sdvatzz5y3w5n/org.apache.mahout.zip
Thanks for the example, Marcel. I can reproduce. I see it fail even when just opening class KMeansCluster in an editor. In my case it falls over a scrambled type signature of method public void emitPointToNearestCluster(org.apache.mahout.math.Vector point, Iterable clusters, org.apache.hadoop.mapreduce.Mapper$Context context) The third parameter has this type signature: Lorg/apache/hadoop/mapreduce/Mapper<**Lorg/apache/hadoop/io/Text;Lorg/apache/mahout/clustering/ClusterObservations;>.Context; but the BinaryMethod ends up with this type signature: QMapper<**QText;QContext; i.e., we are missing this section: Lorg/apache/mahout/clustering/ClusterObservations;>. Upon failing to find the terminating '>' we read over the end of the singature. I'm investigating what makes us drop the mentioned section. It seems to be related to the '.', like we would interpret this Lorg/apache/mahout/clustering/ClusterObservations;>.Context; as a qualified name whose last segment in "Context", without noticing the intermediate '>'!
This happens inside org.eclipse.jdt.internal.core.SourceMapper.convertTypeNamesToSigs(char[][]) , which converts Mapper<?,?,Text,ClusterObservations>.Context to an invalid signature: QMapper<**QText;QContext; This is because convertTypeNamesToSigs creates unqualified signatures, converting, eofr example, QX<QMap.Entry> to QX<QEntry> by recording the position of the last 'Q' and the next obtained dot. However, in the given scenario, the last recorded Q belongs to ClusterObservations but the '.' belongs to Mapper => The bug is that '>' is not handled at all. This, however is an old standing bug.
(In reply to comment #6) > Thanks for the example, Marcel. > > I can reproduce. Oops, mid-air collision! :)
Created attachment 215901 [details] patch under test
(In reply to comment #8) > (In reply to comment #6) > > Thanks for the example, Marcel. > > > > I can reproduce. > Oops, mid-air collision! :) Now I had the collision, while writing pretty much the same analysis. You beat me to it :) So we seem to agree.
I'm not too much into the code in SourceMapper but the suggested patch seems to fail for nested qualified inner types, e.g. Mapper<?,?,Text,Mapper<?,?,Text,ClusterObservations>.Context>.Context produces QMapper<**QText;QContextQContext; whereas I'd expect QContext;
Iterable<Mapper<?,?,Text,ClusterObservations>.Context> will yield QIterable<QContextQContext;>; which does not look right either.
(In reply to comment #11) > I'm not too much into the code in SourceMapper but the suggested patch seems to > fail for nested qualified inner types, e.g. exactly, we need to somehow count nesting levels
(In reply to comment #12) > Iterable<Mapper<?,?,Text,ClusterObservations>.Context> > > will yield > > QIterable<QContextQContext;>; > > which does not look right either. Yeah, mine was a "weekend patch" :) Anyway, I dont think this will make it to Juno. Srikanth, I'll target this for 4.3 , unless you think otherwise.
Created attachment 215908 [details] alternative patch Here's a somewhat more refined solution (incl. a little main for easy testing / playing). For some more or less random examples here's what it does: java.lang.String -> QString; apache.Mapper<?,?,ap.Text,ap.ClusterObservations>.Context -> QContext; apache.Mapper<?,?,ap.Text,ap.ClusterObservations>.Context<java.lang.String> -> QContext<QString;>; app.Mapper<?,?,ap.Text,ap2.ClusterObservations> -> QMapper<**QText;QClusterObservations;>; Context<String> -> QContext<QString;>; Mapper<?,?,Text,ClusterObservations>.Context<String> -> QContext<QString;>; Iterable<Mapper<?,?,Text,ClusterObservations>.Context> -> QIterable<QContext;>; java.util.Iterable<Mapper<?,?,Text,ClusterObservations>.Context> -> QIterable<QContext;>; Mapper<?,?,Text,Mapper<?,?,Text,ClusterObservations>.Context>.Context -> QContext; While this bug doesn't seem to be a regression it has bad consequences for someone trying to work with specific (legal!) class files. The patch uses a small lookahead function to find the matching '>' for a given '<'. I noticed that methods in SourceMapper and Signature tend to process strings in a single loop. I tried another solution first, which indeed avoids the lookahead, but that solution is significantly more involved. My patch passes all of JDT/Core's tests. New unit tests still need to be written.
Stephan, thanks for the patch. Assigning it to you so that you can release it in 3.9 / 4.3 M1
Released for 4.3 M2 via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=7df383b00e8453025afa0d0c65533607ef343fe1 White box tests have been added to class SignatureTests (I needed to make one internal method public for access by unit tests, but I think this is OK since the class itself is internal too, shouldn't be accessed by clients anyway).
Verified for 4.3 M2 via code inspection
*** Bug 391030 has been marked as a duplicate of this bug. ***