private void modifyArgument(Argument arg, Arguments args)
{
log.debug("Modifying argument: " + arg);
List possibleReplacements = new ArrayList();
PropertyIterator iter = args.iterator();
Argument replacementArg;
while (iter.hasNext())
{
replacementArg = (Argument) iter.next().getObjectValue();
try
{
if (HtmlParsingUtils.isArgumentMatched(replacementArg, arg))
{
possibleReplacements.add(replacementArg);
}
}
catch (Exception ex)
{
log.error("", ex);
}
}
if (possibleReplacements.size() > 0)
{
replacementArg =
(Argument) possibleReplacements.get(
rand.nextInt(possibleReplacements.size()));
arg.setName(replacementArg.getName());
arg.setValue(replacementArg.getValue());
log.debug(
"Just set argument to values: "
+ arg.getName()
+ " = "
+ arg.getValue());