Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.6
-
None
-
java 1.6 running under windows or linux
-
Important
Description
When a bean being serialized into a JSON string contains a member of type URL the JSONWriter identifys the URL itself as a bean type, this recusrivly looks at all the properties of the URL object and reteives the reader methods for each one which it invokes and repeats the process based on the returned object.
The URL class contains a bunch of properties including content which has the getContent method as the reader.
when this method is invoked the URL class will make the HTTP request and return the html content, if the URL is not valid it will thrown an exception.
THe following is a list of the properties and the associated reader methods from the URL class
Property name authority
Accessor method is public java.lang.String java.net.URL.getAuthority()
Property name content
Accessor method is public final java.lang.Object java.net.URL.getContent() throws java.io.IOException
Property name defaultPort
Accessor method is public int java.net.URL.getDefaultPort()
Property name file
Accessor method is public java.lang.String java.net.URL.getFile()
Property name host
Accessor method is public java.lang.String java.net.URL.getHost()
Property name path
Accessor method is public java.lang.String java.net.URL.getPath()
Property name port
Accessor method is public int java.net.URL.getPort()
Property name protocol
Accessor method is public java.lang.String java.net.URL.getProtocol()
Property name query
Accessor method is public java.lang.String java.net.URL.getQuery()
Property name ref
Accessor method is public java.lang.String java.net.URL.getRef()
Property name userInfo
Accessor method is public java.lang.String java.net.URL.getUserInfo()
i think the JSONWriter needs a special case for the URL object as you would not want the getContent method being invoked.