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

Bug 312801

Summary: Provide better JavaScript filename error message
Product: [WebTools] JSDT Reporter: Troy Bishop <tjbishop>
Component: GeneralAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: trivial    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Possible patch thatnitind: iplog+

Description Troy Bishop CLA 2010-05-13 10:56:11 EDT
Build Identifier: WTP 3.2

Using the JavaScript tooling it is possible to get the following error written to the .log file:

!ENTRY org.eclipse.wst.validation
!MESSAGE JavaScript file name must end with .js
!STACK 0
java.lang.IllegalArgumentException: JavaScript file name must end with .js
at org.eclipse.wst.jsdt.internal.core.PackageFragment.getClassFile(Unknown Source)
at org.eclipse.wst.jsdt.internal.core.util.HandleFactory.createOpenable(Unknown Source)
at org.eclipse.wst.jsdt.internal.core.NameLookup.findBindingSearch(Unknown Source)
at org.eclipse.wst.jsdt.internal.core.NameLookup.findBinding(Unknown Source) 
...

The message for the java.lang.IllegalArgumentException is not very helpful as it does not say what file has an invalid javascript extension.  Attached is a patch which I believe will improve this.

Reproducible: Always
Comment 1 Troy Bishop CLA 2010-05-13 10:56:32 EDT
Created attachment 168392 [details]
Possible patch
Comment 2 Nitin Dahyabhai CLA 2010-05-13 16:24:22 EDT
Troy, *please* give us more specific build IDs than that in the future.

As strings are frozen, pushing out to 3.3.
Comment 3 Nitin Dahyabhai CLA 2010-09-27 17:23:12 EDT
Committed to HEAD, thanks, Troy!