mirror of https://github.com/apache/poi.git
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:
parent
c69739c288
commit
63b0cd2802
|
@ -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())) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue