Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312801 - Provide better JavaScript filename error message
Summary: Provide better JavaScript filename error message
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-13 10:56 EDT by Troy Bishop CLA
Modified: 2010-09-27 17:23 EDT (History)
0 users

See Also:


Attachments
Possible patch (4.69 KB, patch)
2010-05-13 10:56 EDT, Troy Bishop CLA
thatnitind: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!