United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-7013876 : RemoveCommentReader fails to correctly recognize comments in PAC file

Details
Type:
Bug
Submit Date:
2011-01-21
Status:
Closed
Updated Date:
2012-03-20
Project Name:
JDK
Resolved Date:
2012-02-16
Component:
deploy
OS:
windows_xp
Sub-Component:
webstart
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
6
Fixed Versions:
6

Related Reports
Duplicate:
Relates:
Relates:

Sub Tasks

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



Hardware and Software, Engineered to Work Together