Closed GoogleCodeExporter closed 9 years ago
Hi,
I think I will change the statementArgs to prevent the populating of the list
with the effect callback:
/**
* {@inheritDoc}
* @see org.odlabs.wiquery.core.javascript.ChainableStatement#statementArgs()
*/
public CharSequence[] statementArgs() {
int size = this.parameters.size();
boolean effectIsSet = this.effectCallback() != null;
if(effectIsSet) {
size++;
}
CharSequence[] args = new CharSequence[this.parameters.size()];
int count = 0;
for (CharSequence charSequence : this.parameters) {
args[count] = charSequence;
count++;
}
if(effectIsSet) {
args[count + 1] = this.effectCallback().render();
}
return args;
}
What do you think about this ?
Thanks
Regards
Julien Roche
Original comment by roche....@gmail.com
on 26 Mar 2011 at 8:50
Oups, I mean:
/**
* {@inheritDoc}
* @see org.odlabs.wiquery.core.javascript.ChainableStatement#statementArgs()
*/
public CharSequence[] statementArgs() {
int size = this.parameters.size();
boolean effectIsSet = this.effectCallback() != null;
if(effectIsSet) {
size++;
}
CharSequence[] args = new CharSequence[this.parameters.size()];
int count = 0;
for (CharSequence charSequence : this.parameters) {
args[count] = charSequence;
count++;
}
if(effectIsSet) {
args[count] = this.effectCallback().render();
}
return args;
}
Original comment by roche....@gmail.com
on 26 Mar 2011 at 8:59
And of course use the size :) That should do it!
Thanks.
int size = this.parameters.size();
boolean effectIsSet = (this.effectCallback() != null);
if (effectIsSet) {
size++;
}
CharSequence[] args = new CharSequence[size];
int count = 0;
for (CharSequence charSequence : this.parameters) {
args[count] = charSequence;
count++;
}
if (effectIsSet) {
args[count] = this.effectCallback().render();
}
return args;
Original comment by norc...@gmail.com
on 29 Mar 2011 at 11:56
Roger that
I will push the patch tonight.
Best regards
Julien Roche
Original comment by roche....@gmail.com
on 29 Mar 2011 at 11:59
Original comment by roche....@gmail.com
on 29 Mar 2011 at 11:59
Fix in commit r737
Original comment by roche....@gmail.com
on 31 Mar 2011 at 8:41
Original comment by roche....@gmail.com
on 31 Mar 2011 at 8:41
Sorry but the commit was a bit dodgy, it crashed the tests in 1.5. I altered
the code so it is safer and easier to read.
Original comment by hielke.hoeve
on 6 Apr 2011 at 2:23
Original issue reported on code.google.com by
norc...@gmail.com
on 22 Mar 2011 at 11:51