You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ye...@apache.org on 2013/06/05 04:03:08 UTC
svn commit: r1489685 - in /poi/trunk/src:
java/org/apache/poi/ss/formula/functions/
scratchpad/src/org/apache/poi/hwpf/model/
Author: yegor
Date: Wed Jun 5 02:03:07 2013
New Revision: 1489685
URL: http://svn.apache.org/r1489685
Log:
fixed compatibility issues with JDK 1.5
Modified:
poi/trunk/src/java/org/apache/poi/ss/formula/functions/Complex.java
poi/trunk/src/java/org/apache/poi/ss/formula/functions/Quotient.java
poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java
poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/UnhandledDataStructure.java
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/Complex.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/Complex.java?rev=1489685&r1=1489684&r2=1489685&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/Complex.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/Complex.java Wed Jun 5 02:03:07 2013
@@ -70,7 +70,7 @@ public class Complex extends Var2or3ArgF
}
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())) {
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/Quotient.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/Quotient.java?rev=1489685&r1=1489684&r2=1489685&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/Quotient.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/Quotient.java Wed Jun 5 02:03:07 2013
@@ -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;
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java?rev=1489685&r1=1489684&r2=1489685&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/functions/Rept.java Wed Jun 5 02:03:07 2013
@@ -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;
Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/UnhandledDataStructure.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/UnhandledDataStructure.java?rev=1489685&r1=1489684&r2=1489685&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/UnhandledDataStructure.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/model/UnhandledDataStructure.java Wed Jun 5 02:03:07 2013
@@ -48,9 +48,23 @@ public final class UnhandledDataStructur
}
// 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;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org