}\r
\r
String suffixValue = OperandResolver.coerceValueToString(suffix);\r
- if (suffixValue.isEmpty()) {\r
+ if (suffixValue.length() == 0) {\r
suffixValue = DEFAULT_SUFFIX;\r
}\r
if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase()) || suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase())) {\r
* @author cedric dot walter @ gmail dot com\r
*/\r
public class Quotient extends Fixed2ArgFunction {\r
- @Override\r
+\r
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {\r
\r
double enumerator = 0;\r
}
// Save that requested portion of the data
- _buf = Arrays.copyOfRange(buf, offset, offsetEnd);
+ _buf = copyOfRange(buf, offset, offsetEnd);
+
}
+ /**
+ * YK: Arrays.copyOfRange is not in JDK 1.5
+ */
+ static byte[] copyOfRange(byte[] original, int from, int to) {
+ int newLength = to - from;
+ if (newLength < 0)
+ throw new IllegalArgumentException(from + " > " + to);
+ byte[] copy = new byte[newLength];
+ System.arraycopy(original, from, copy, 0,
+ Math.min(original.length - from, newLength));
+ return copy;
+ }
+
byte[] getBuf()
{
return _buf;