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
e3bbd87918
commit
09c79ffed4
@ -70,7 +70,7 @@ public class Complex extends Var2or3ArgFunction implements FreeRefFunction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String suffixValue = OperandResolver.coerceValueToString(suffix);
|
String suffixValue = OperandResolver.coerceValueToString(suffix);
|
||||||
if (suffixValue.isEmpty()) {
|
if (suffixValue.length() == 0) {
|
||||||
suffixValue = DEFAULT_SUFFIX;
|
suffixValue = DEFAULT_SUFFIX;
|
||||||
}
|
}
|
||||||
if (suffixValue.equals(DEFAULT_SUFFIX.toUpperCase()) || suffixValue.equals(SUPPORTED_SUFFIX.toUpperCase())) {
|
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
|
* @author cedric dot walter @ gmail dot com
|
||||||
*/
|
*/
|
||||||
public class Quotient extends Fixed2ArgFunction {
|
public class Quotient extends Fixed2ArgFunction {
|
||||||
@Override
|
|
||||||
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {
|
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval venumerator, ValueEval vedenominator) {
|
||||||
|
|
||||||
double enumerator = 0;
|
double enumerator = 0;
|
||||||
|
@ -42,7 +42,6 @@ import java.math.BigDecimal;
|
|||||||
public class Rept extends Fixed2ArgFunction {
|
public class Rept extends Fixed2ArgFunction {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval text, ValueEval number_times) {
|
public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval text, ValueEval number_times) {
|
||||||
|
|
||||||
ValueEval veText1;
|
ValueEval veText1;
|
||||||
|
@ -48,7 +48,21 @@ public final class UnhandledDataStructure
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save that requested portion of the data
|
// 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()
|
byte[] getBuf()
|
||||||
|
Loading…
Reference in New Issue
Block a user