Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Java Generator problems

Discussion topic

Back to topic list

Java Generator problems

Author musachy
Full name Musachy Barroso
Date 2006-05-27 11:22:27 PDT
Message Hi all,

I'm using the code from head cvs and I found a couple of problems wih the
Java generator.

1. The Java generator is using "getResponse().getSt​atusCode()", but
getResponse() return an String. Looking at the Jython generator I figured it
should be getResponseCode() instead.

2. The Java generator is using "params", but "params" is never is never
defined in the generated code. I replaced "params" for "list.toArray()".
"list" was not initialized before its first use, so instead of "List list;"
I made it genarate "List list = new ArrayList();"

After this changes I was able to compile the genrated code, but I was
getting a cast exception because paramsToNV(Object[] params) was assuming
that the type of the arry was PyTuple when it as NameValuePair, I changed it

public NameValuePair[] paramsToNV(Object[] params)
    int i;
    NameValuePair[] res = new NameValuePair[params.length];
    for (i = 0; i < params.length; i++) {
      Object param = params[i];
      if(param instanceof PyTuple) {
          PyTuple pyParam = (PyTuple) param;
          res[i] = new NameValuePair(pyPara​m.__getitem__(0).toS​tring(),
      else if(param instanceof NameValuePair)
          res[i] = (NameValuePair)param;
    return res;

I'm going to do some basic integration with eclipse, so if you guys have
some ideas already of how you want to do that let me know. I can also submit
a patch to fix the Java generator if you want. I think it woul be a good
idea to use HttpStatus constants instead of numbers ins the status code


"Hey you! Would you help me to carry the stone?" Pink Floyd

« Previous message in topic | 1 of 3 | Next message in topic »


Show all messages in topic

Java Generator problems musachy Musachy Barroso 2006-05-27 11:22:27 PDT
     Re: [maxq-dev] Java Generator problems oliverbock Oliver Bock 2006-05-28 01:55:12 PDT
         Re: [maxq-dev] Java Generator problems musachy Musachy Barroso 2006-05-28 08:40:39 PDT
Messages per page: