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

Bug 320525

Summary: JSP discoverer : use case with NullPointerException
Product: [Modeling] MoDisco Reporter: Fabien Giquel <fabien.giquel>
Component: TechnologiesAssignee: Fabien Giquel <fabien.giquel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hugo.bruneliere, modisco.web-inbox, nicolas.guyomar
Version: 0.9.0Flags: fabien.giquel: indigo+
Target Milestone: 0.9.0 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
The JSP file in error
none
Patch to fix the NullPointer in JavaScript Parsing fabien.giquel: iplog+

Description Fabien Giquel CLA 2010-07-21 11:55:16 EDT
Created attachment 174873 [details]
The JSP file in error

The attached JSP fragment causes a NullPointerException (caused by a ArrayIndexOutOfBounds) when using the JSP discoverer
Comment 1 Nicolas Guyomar CLA 2010-07-23 06:17:27 EDT
Hi Fabien,

This bug was due to a digit (1000) sticked to the ' %> ' jsp closing tag, resulting in being interpreted as a percentage ' 1000% '

The closing tag was never encountered, that's why the parser reached the end of file still looking for it.

The attached patch detects the end of file while parsing a JavaScript element, and  log an MoDisco Info message to inform that the end of file as been reached

1. I, Nicolas Guyomar, and others contributors listed in this bug, authored
100% of the content
2. I have the rights to donate the content to Eclipse under the EPL
3. I have already provided the filled Employer Consent Forms to the Foundation


Regards

Nicolas
Comment 2 Nicolas Guyomar CLA 2010-07-23 06:18:23 EDT
Created attachment 175048 [details]
Patch to fix the NullPointer in JavaScript Parsing
Comment 3 Fabien Giquel CLA 2010-07-23 06:32:22 EDT
Thank you Nicolas for your contribution.
Your contribution is less than 250 lines.

It has been committed into SVN.

Fabien.
Comment 4 Hugo Bruneliere CLA 2010-10-05 04:23:58 EDT
The patch has been successfully applied.