What steps will reproduce the problem?
1.Create following class:
public abstract class RequestBuilder<TParameter, TResponse extends
IJsonResponse>
{
private void WriteRequestContent(Object SendObject) throws Exception
{
Gson serializer = new Gson();
String data = null;
if(ConnectRequest.class.isInstance(SendObject)) {
data = serializer.toJson((ConnectRequest)SendObject);
} else { ... }
this.myWebRequest.setRequestProperty("Content-Length", data.length()+"");
OutputStreamWriter wr = new OutputStreamWriter(this.myWebRequest.getOutputStream());
wr.write(data);
wr.flush();
wr.close();
}
public class ConnectRequest
{
// Fields
public ConnectHeader header;
public String method;
public TParameter parameters;
// Methods
public ConnectGroovesharkRequest(ConnectHeader myHeader, TParameter myParameter, String myMethod)
{
this.header = myHeader;
this.parameters = myParameter;
this.method = myMethod;
}
}
}
2.
Execute ;)
3.
Error occurs
What is the expected output? What do you see instead?
Just to convert it to a json-string, instead i got "Expecting parameterized
type, got class Base.RequestBuilder$ConnectRequest."
What version of the product are you using? On what operating system?
Gson 1.5;
What to do? :(
Original issue reported on code.google.com by scilor.hacker@googlemail.com on 27 Oct 2010 at 6:12
Original issue reported on code.google.com by
scilor.hacker@googlemail.com
on 27 Oct 2010 at 6:12