fixed compatibility issues with JDK 1.5

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1489685 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2013-06-05 02:03:07 +00:00
parent c69739c288
commit 63b0cd2802
4 changed files with 17 additions and 4 deletions

View File

@ -70,7 +70,7 @@ public class Complex extends Var2or3ArgFunction implements FreeRefFunction {
}
String suffixValue = OperandResolver.coerceValueToString(suffix);
if (suffixValue.isEmpty()) {
if (suffixValue.length() == 0) {
suffixValue = DEFAULT_SUFFIX;
}
if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase()) || suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase())) {

View File

@ -23,7 +23,7 @@ import org.apache.poi.ss.formula.eval.*;
* @author cedric dot walter @ gmail dot com
*/
public class Quotient extends Fixed2ArgFunction {
@Override
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {
double enumerator = 0;

View File

@ -42,7 +42,6 @@ import java.math.BigDecimal;
public class Rept extends Fixed2ArgFunction {
@Override
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval text, ValueEval number_times) {
ValueEval veText1;

View File

@ -48,9 +48,23 @@ public final class UnhandledDataStructure
}
// 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;