Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355982

Summary: NPE in RhinoPropertyTester
Product: [WebTools] JSDT Reporter: David Plass <davidplass>
Component: DebugAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Michael Rennie <Michael_Rennie>
Severity: normal    
Priority: P3 CC: thatnitind
Version: 3.3   
Target Milestone: 3.4 M2   
Hardware: All   
OS: Linux   
Whiteboard:

Description David Plass CLA 2011-08-26 16:55:02 EDT
Build Identifier: Build id: I20110428-0848

When there is no file extension, there is an NPE in RhinoPropertyTester:
java.lang.NullPointerException
       at org.eclipse.wst.jsdt.debug.internal.rhino.ui.RhinoPropertyTester.isScript(RhinoPropertyTester.java:64)
       at org.eclipse.wst.jsdt.debug.internal.rhino.ui.RhinoPropertyTester.test(RhinoPropertyTester.java:45)
       at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
       at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
       at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
       at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
       at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
       at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150)
       at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
       at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
       at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
       at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
       at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287)
       at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.getShortcutsForSelection(LaunchingResourceManager.java:456)
       at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.computeLabels(LaunchingResourceManager.java:236)
       at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager$2.run(LaunchingResourceManager.java:138)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The line in question is:

			return file.getFileExtension().equals("js"); //$NON-NLS-1$

But getFileExtension can return null if there is no extension.

Reproducible: Didn't try
Comment 1 Nitin Dahyabhai CLA 2011-08-29 11:19:37 EDT
NPE avoided.
Comment 2 David Plass CLA 2011-08-29 11:30:07 EDT
Sorry, I'm confused. Why did you mark this as fixed in 3.4 M2, if I just found it in 3.7?
Comment 3 Michael Rennie CLA 2011-08-29 13:14:05 EDT
(In reply to comment #2)
> Sorry, I'm confused. Why did you mark this as fixed in 3.4 M2, if I just found
> it in 3.7?

The release numbers for JSDT do not correspond directly to those of the platform. For example the current dev stream of the platform is 3.8 M2 and the current dev stream of JSDT is 3.4 M2