public int aggregate(int[] values, int nodata)
{
int max = -Integer.MAX_VALUE;
for (int i=0; i<values.length; i++)
{
<BUG>if (values[i] != nodata)
max = Math.max(max, values[i]);
}</BUG>
return (max == -Integer.MAX_VALUE) ? nodata : max;
}

public int aggregate(int[] values, int nodata)
{
int max = -Integer.MAX_VALUE;
for (int i=0; i<values.length; i++)
{
if (values[i] != nodata)
{
max = Math.max(max, values[i]);
}
}
return (max == -Integer.MAX_VALUE) ? nodata : max;
}
