JDK-7013876 : RemoveCommentReader fails to correctly recognize comments in PAC file
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2011-01-21
  • Updated: 2012-03-20
  • Resolved: 2012-02-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
When Java WebStart begins, it attempts to discover the web proxy information from the default browser settings.  In our case it downloads the auto proxy javascript file from http://xxxxxxxx/wpad.dat .  In order to correctly use the code encapsulated in the auto proxy file it needs to parse it through Internet Explorer���s javascript engine.
Prior to doing this, WebStart will attempt to strip out all the comments in the auto proxy file along with replacing newline characters (\n) with spaces using com.sun.deploy.net.proxy.RemoveCommentReader.
 
When RemoveCommentReader.read is executed and the buffer is not completely filled with data but the last character in the read data is the opening / of a comment block the code fails to recognise that fact and will not properly strip the comments out.
 
This leaves the javascript on a single line but with an inline comment. Since code exists after the left in comments, the javascript engine fails to correctly parse the code and we an the error.
 
The issue is seen intermittently due to the variability in the network when downloading the auto proxy file. The bug is only exposed if the file is read in chunks that happen to end mid-way through the opening // or /* of a comment block.



REPRODUCIBILITY :
This bug can be reproduced occasionally.

Comments
EVALUATION This bug has been fixed in 7063183, which has been putback into JRE 7u2, but JRE6 still has this problem, need to backport to JDK6 update release.
2012-02-16