Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359005 - [exceptions] NPE in CompilationUnitScope#connectTypeHierarchy()
Summary: [exceptions] NPE in CompilationUnitScope#connectTypeHierarchy()
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal with 24 votes (vote)
Target Milestone: 3.5.1   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
: 350276 359809 360224 366428 367268 378585 380535 401398 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-27 02:37 EDT by ybin0 CLA
Modified: 2013-08-02 10:30 EDT (History)
29 users (show)

See Also:
thatnitind: review? (thatnitind)


Attachments
the file which i am edit for (7.41 KB, patch)
2011-09-27 22:18 EDT, ybin0 CLA
no flags Details | Diff
the edit file (7.38 KB, text/plain)
2011-09-27 22:36 EDT, ybin0 CLA
no flags Details
The patch fixes the issue (1008 bytes, patch)
2012-05-28 15:30 EDT, Victor Rubezhny CLA
thatnitind: iplog+
Details | Diff
proposed patch for this issue (1.90 KB, patch)
2012-07-26 03:43 EDT, Wooyoung Cho CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ybin0 CLA 2011-09-27 02:37:24 EDT
Build Identifier: 20110916-0149

when i update the jsdt from 3.2.4 to 3.3.1,when i save a js file,the eclipse prompt me "Requesting JavaScript AST from selection"
THE ERROR LOG is:
!ENTRY org.eclipse.core.jobs 4 2 2011-09-26 17:51:40.766
!MESSAGE An internal error occurred during: "Requesting JavaScript AST from selection".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:669)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:674)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:387)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:443)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.accept(CompilationUnitProblemFinder.java:174)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:279)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding.getBinding(PackageBinding.java:156)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findBinding(Scope.java:802)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findType(Scope.java:821)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildSuperType(CompilationUnitScope.java:413)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:382)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:320)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnitProblemFinder.accept(CompilationUnitProblemFinder.java:171)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:279)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:249)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2105)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2193)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2184)
	at org.eclipse.wst.jsdt.core.dom.DefaultBindingResolver.resolveName(DefaultBindingResolver.java:1044)
	at org.eclipse.wst.jsdt.core.dom.Name.resolveBinding(Name.java:89)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:149)
	at org.eclipse.wst.jsdt.core.dom.QualifiedName.accept0(QualifiedName.java:170)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.QualifiedName.accept0(QualifiedName.java:173)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.TagElement.accept0(TagElement.java:282)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.JSdoc.accept0(JSdoc.java:206)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:474)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:217)
	at org.eclipse.wst.jsdt.core.dom.Assignment.accept0(Assignment.java:306)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:146)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.JavaScriptUnit.accept0(JavaScriptUnit.java:225)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.perform(OccurrencesFinder.java:92)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2876)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor$7.selectionChanged(JavaEditor.java:2905)
	at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:157)
	at org.eclipse.wst.jsdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:134)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

!ENTRY org.eclipse.ui.workbench 4 2 2011-09-26 17:51:44.291
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findMemberType(Scope.java:520)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getMemberType(Scope.java:1785)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2232)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2184)
	at org.eclipse.wst.jsdt.core.dom.DefaultBindingResolver.resolveName(DefaultBindingResolver.java:1044)
	at org.eclipse.wst.jsdt.core.dom.Name.resolveBinding(Name.java:89)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:149)
	at org.eclipse.wst.jsdt.core.dom.QualifiedName.accept0(QualifiedName.java:170)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.QualifiedName.accept0(QualifiedName.java:173)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.TagElement.accept0(TagElement.java:282)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.JSdoc.accept0(JSdoc.java:206)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.FunctionDeclaration.accept0(FunctionDeclaration.java:474)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.FunctionExpression.accept0(FunctionExpression.java:143)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.visit(OccurrencesFinder.java:217)
	at org.eclipse.wst.jsdt.core.dom.Assignment.accept0(Assignment.java:306)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChild(ASTNode.java:2401)
	at org.eclipse.wst.jsdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:146)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2427)
	at org.eclipse.wst.jsdt.core.dom.JavaScriptUnit.accept0(JavaScriptUnit.java:225)
	at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(ASTNode.java:2354)
	at org.eclipse.wst.jsdt.internal.ui.search.OccurrencesFinder.perform(OccurrencesFinder.java:92)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor.updateOccurrenceAnnotations(JavaEditor.java:2876)
	at org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor$ActivationListener.windowActivated(JavaEditor.java:1220)
	at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1002)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.Workbench.fireWindowActivated(Workbench.java:1000)
	at org.eclipse.ui.internal.WorkbenchWindow$28.shellActivated(WorkbenchWindow.java:3141)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:88)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1263)
	at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:731)
	at org.eclipse.swt.widgets.Display.filterProc(Display.java:1543)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2276)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
	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)



Reproducible: Always

Steps to Reproduce:
1.save a js file
2.
3.
Comment 1 Nitin Dahyabhai CLA 2011-09-27 10:48:15 EDT
Hmm, null classScope again.  Can you attach the file you were working on?
Comment 2 ybin0 CLA 2011-09-27 22:18:54 EDT
Created attachment 204133 [details]
the file which i am edit for
Comment 3 ybin0 CLA 2011-09-27 22:36:12 EDT
Created attachment 204136 [details]
the edit file
Comment 4 ybin0 CLA 2011-09-27 22:38:17 EDT
when open this file in jsdt

then, add the following code:
XXCMP.url.xxxxx = function(123) {
	dd=123;
	
	return xxx;
};

then save the file

maybe get the "Requesting JavaScript AST from selection" ERROR

but not every time you can get it.....

just some times
Comment 5 ybin0 CLA 2011-09-27 22:42:10 EDT
Comment on attachment 204133 [details]
the file which i am edit for

this file is wrong...........just skip it:)
Comment 6 ybin0 CLA 2011-09-27 22:43:05 EDT
Comment on attachment 204133 [details]
the file which i am edit for

this file is wrong..... just forget it
Comment 7 Nitin Dahyabhai CLA 2011-10-25 13:17:02 EDT
*** Bug 359809 has been marked as a duplicate of this bug. ***
Comment 8 Nitin Dahyabhai CLA 2011-10-25 13:17:10 EDT
*** Bug 360224 has been marked as a duplicate of this bug. ***
Comment 9 Nitin Dahyabhai CLA 2011-11-11 18:05:20 EST
*** Bug 350276 has been marked as a duplicate of this bug. ***
Comment 10 jan kumer CLA 2011-12-12 09:39:25 EST
It seems like marking/selecting some random JS code, with Mark occurrences feature enabled, is causing exceptions.

To reproduce an issue make sure you have that feature enabled: Toggle Mark Occurrences (Alt+Shift+O)
Comment 11 Nitin Dahyabhai CLA 2011-12-12 11:30:00 EST
*** Bug 366428 has been marked as a duplicate of this bug. ***
Comment 12 Marcus CLA 2012-02-01 03:29:53 EST
I can confirm this on Windows 7, too (Version: Indigo Service Release 1
Build id: 20110916-0149). Not only Linux.
Comment 13 jel md CLA 2012-03-07 15:48:20 EST
This bug is driving me nuts. Stupid error dialog is popping up every few seconds - makes the editor almost completely unusable.
Comment 14 David Karlin CLA 2012-03-13 08:17:28 EDT
I have the same problem under Mac OS X 10.7.3, Eclipse for PHP Developers version 3.0.2
Comment 15 Scott Denton CLA 2012-03-15 07:15:26 EDT
Same problem here too. Windows XP. Eclipse IDE for JavaScript Web Developers. Version: Indigo Service Release 2. Build id: 20120216-1857
Comment 16 August Li CLA 2012-03-16 05:47:14 EDT
It can sometimes be replicated by these steps: Does not happen everytime though.

function test(){  //step 1: add a space here

    return true; //step 2: move cursor to this line with return
}
Comment 17 Nitin Dahyabhai CLA 2012-03-16 08:34:50 EDT
*** Bug 367268 has been marked as a duplicate of this bug. ***
Comment 18 Scott Denton CLA 2012-04-03 09:00:11 EDT
I agree with August Li, it seems to be triggered by Mark Occurrences around "return" in a function in a js file. For instance, if you have "return false;", then add a white space after the ;, then delete that whitespace again, I get the error below. Immediately after you click ok on the error, it Mark Occurrences on the "return", which hints at the cause.

An internal error occurred during: "Requesting JavaScript AST from selection".
java.lang.NullPointerException.

If I go to Window-->Preferences->Javascript-->Editor-->Mark Occurrences then untick 'Mark occurrences of the selected element in the current file', I don't seem to get the error anymore (so far...).
Comment 19 Andrey Martemyanov CLA 2012-04-18 03:54:06 EDT
Same problem. Linux 32bit. Eclipse IDE for JavaScript Web Developers.
Version: Indigo Service Release 2 Build id: 20120216-1857
Comment 20 Victor Rubezhny CLA 2012-05-12 18:26:00 EDT
My steps to reproduce are in #378585, which is probably a duplicate of this issue. Reproduced in Ubuntu 64-bit. 
The only difference is that it is triggered by a hover calculation in wrong place (IMHO, the hover shouldn't be calculated on string literals, but it does).
Comment 21 Victor Rubezhny CLA 2012-05-17 05:49:42 EDT
(In reply to comment #1)
> Hmm, null classScope again.  Can you attach the file you were working on?

I believe that the problem is in org.eclipse.wst.jsdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(CompilationUnit) method which calls cleanUp() method on CompilationUnitDeclaration (which subsequently cleans up all the references/bindings as well as all the SourceTypeBindings collected). But later (in hover calculation in my case or or in occurrences finder in this issue's stacktrace) those SourceTypeBinding-s are still needed to resolve types, but they (SourceTypeBinding-s) are already cleared by ReconcileWorkingOperation, so they aren't usable anymore.

Not sure would it be a problem if not to call cleanUp() method on unit declaration during reconciling operation (in ReconcileWorkingCopyOperation.makeConsistent() method), but excluding this call in my local workspace helps to prevent this NPE.

So, probably the CompilationUnitDeclaration is not to be cleaned up by reconcile operation (and it's not in case the working copy is not consistent - see ReconcileWorkingCopyOperation.makeConsistent() method source).
Comment 22 Nobody - feel free to take it CLA 2012-05-27 13:28:32 EDT
Hello, 

I’ve run into this issue as well. 

There are several cases when this exception occurs in this bug report:

https://github.com/vtst/ow/issues/62


Thanks!
Comment 23 Victor Rubezhny CLA 2012-05-28 15:30:00 EDT
Created attachment 216370 [details]
The patch fixes the issue

(As addition to comment #21)

Java Reconciler, which actually invokes ReconcileWorkingCopyOperation operation, after its AST is created, marks the resulting AST as protected and read-only as well as doesn't clean ups its units (probably resolved at this moment) due to allow further usage of the resulting AST and units as well as all the bindings collected. 

So, I'm strong in my feeling that there should be NO calls to the following clean up methods from ReconcileWorkingCopyOperation.makeConsistent(...) method's finally block:

  if (unit != null) {
    unit.cleanUp();
    if (unit.scope!=null)
      unit.scope.cleanup();
  }

The patch attached removes this clean up calls and allows the bindings collected to stay accessible after a reconciling operation.
Comment 24 Victor Homyakov CLA 2012-06-29 05:56:04 EDT
Still present in Eclipse Java EE IDE for Web Developers.
Version: Juno Release
Build id: 20120322-1740

(Web Tools 3.4.0)
Comment 25 Henrik von der Friedensburg CLA 2012-07-08 05:29:40 EDT
Is this bug getting fixed any time soon? It's driving me nuts and renders eclipse totally useless for any javascript development, which is very sad.

I'm on Mac OS X Eclipse version:
Version: Indigo Service Release 2
Build id: 20120216-1857
Comment 26 Wooyoung Cho CLA 2012-07-26 03:43:21 EDT
Created attachment 219198 [details]
proposed patch for this issue

This patch will fix this issue.

The NPE occurs while Mark Occurrences finds exit points of a function. Mark Occurrences tries to resolve return expression to determine whether the function returns void. I think this behaviour comes from JDT(Java) and resolving is not required for JavaScript because there's no 'void' type in JavaScript. 
The 'throw' statement also causes NPE by similar reason. It tries to resolve type of exception value to match with catch clause. This is definitely Java style and is also unnecessary for JavaScript.
Comment 27 Kyle Watson CLA 2012-07-30 18:45:57 EDT
Thanks for the patch, but how do I apply it?  Are there steps for applying a patch for a bug fix anywhere?
Comment 28 Wooyoung Cho CLA 2012-07-30 22:01:26 EDT
Checkout the source of JSDT and use 'patch' command with the patch file. Then build JSDT ui plugin to get the patched JSDT.
Comment 29 Nitin Dahyabhai CLA 2012-10-18 14:08:41 EDT
*** Bug 380535 has been marked as a duplicate of this bug. ***
Comment 30 Redsandro CLA 2013-02-11 08:12:17 EST
This was a problem in Indigo 3.7, right?

I still have this problem in 3.8 fully updated WTP. Am I missing something or is the patch not merged?
Comment 31 Nitin Dahyabhai CLA 2013-02-21 10:51:09 EST
*** Bug 401398 has been marked as a duplicate of this bug. ***
Comment 32 Chris Jaun CLA 2013-06-27 10:39:15 EDT
*** Bug 378585 has been marked as a duplicate of this bug. ***
Comment 33 Chris Jaun CLA 2013-06-27 10:39:56 EDT
May want to look at Bug 378585 for other reproduce steps.
Comment 34 Chris Jaun CLA 2013-08-02 10:30:52 EDT
This appears to have been fixed in 3.5.1 indirectly by the updates here: 
http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/commit/?id=ec87a3b8e0a51fc2baec20756c00429d9e68a587

Fixing up the classScopes was addressed there.