Bug 306286 - JavaScript Syntax Validator does not interpret File Param on builder.parse statement correctly
Summary: JavaScript Syntax Validator does not interpret File Param on builder.parse st...
Status: CLOSED DUPLICATE of bug 306976
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2010-03-17 17:03 EDT by Mike L Curles CLA
Modified: 2010-04-02 16:21 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike L Curles CLA 2010-03-17 17:03:45 EDT
Build Identifier: 

The below commands in a JavaScript file give the following error message "File Cannot be Resolved to a type" but works fine in IE, FireFox and Netscape...

String fSep = System.getProperty("file.separator");
String cDir = getServletContext().getRealPath("config");
System.out.println("CMplus Config Dir: " + cDir + fSep + "cmconfig.xml");
                                   
//Declare variables
	Document document;
	DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	
//Read XML file

      try {

           DocumentBuilder builder = factory.newDocumentBuilder(); //Build document:
           document = builder.parse(new File(cDir + fSep + "cmconfig.xml"));
           nodeList = document.getElementsByTagName("CMHost"); //Generate the NodeList;

                      .
                      .
                      .
             }
 

Reproducible: Always

Steps to Reproduce:
1. Place the above code in a .jsp file in eclipse 
2.
3.
Comment 1 Chris Jaun CLA 2010-04-02 14:44:21 EDT
I don't understand your bug report. All the code you supplied looks like Java, not JavaScript.

If this was intended to be opened against JSDT please provide specific steps to reproduce your scenario.
Comment 2 Mike L Curles CLA 2010-04-02 15:23:12 EDT
(In reply to comment #1)
> I don't understand your bug report. All the code you supplied looks like Java,
> not JavaScript.
> If this was intended to be opened against JSDT please provide specific steps to
> reproduce your scenario.

Hi... This was closed the other day...  It's definately JavaScript...  I missed including the <%@ page import="java.io.File" %> statement...  Once I included it...the Jsp Validator worked fine...  Maybe the validation error message could be a little more exact/descriptive...  

Regards
Comment 3 Nitin Dahyabhai CLA 2010-04-02 16:21:56 EDT

*** This bug has been marked as a duplicate of bug 306976 ***