You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2016/05/16 09:57:19 UTC
svn commit: r1744003 - in /poi/trunk/src/java/org/apache/poi/ss/formula:
CollaboratingWorkbooksEnvironment.java Formula.java
FormulaCellCacheEntry.java ParseNode.java
Author: kiwiwings
Date: Mon May 16 09:57:19 2016
New Revision: 1744003
URL: http://svn.apache.org/viewvc?rev=1744003&view=rev
Log:
Sonar fixes - array is stored directly
Modified:
poi/trunk/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java
poi/trunk/src/java/org/apache/poi/ss/formula/Formula.java
poi/trunk/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java
poi/trunk/src/java/org/apache/poi/ss/formula/ParseNode.java
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java?rev=1744003&r1=1744002&r2=1744003&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/CollaboratingWorkbooksEnvironment.java Mon May 16 09:57:19 2016
@@ -117,7 +117,7 @@ public final class CollaboratingWorkbook
unhookOldEnvironments(evaluators);
hookNewEnvironment(evaluators, this);
_unhooked = false;
- _evaluators = evaluators;
+ _evaluators = evaluators.clone();
_evaluatorsByName = evaluatorsByName;
}
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/Formula.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/Formula.java?rev=1744003&r1=1744002&r2=1744003&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/Formula.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/Formula.java Mon May 16 09:57:19 2016
@@ -42,7 +42,7 @@ public class Formula {
private final int _encodedTokenLen;
private Formula(byte[] byteEncoding, int encodedTokenLen) {
- _byteEncoding = byteEncoding;
+ _byteEncoding = byteEncoding.clone();
_encodedTokenLen = encodedTokenLen;
// if (false) { // set to true to eagerly check Ptg decoding
// LittleEndianByteArrayInputStream in = new LittleEndianByteArrayInputStream(byteEncoding);
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java?rev=1744003&r1=1744002&r2=1744003&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/FormulaCellCacheEntry.java Mon May 16 09:57:19 2016
@@ -27,8 +27,6 @@ import org.apache.poi.ss.formula.Formula
/**
* Stores the cached result of a formula evaluation, along with the set of sensitive input cells
- *
- * @author Josh Micich
*/
final class FormulaCellCacheEntry extends CellCacheEntry {
@@ -57,8 +55,13 @@ final class FormulaCellCacheEntry extend
public void setSensitiveInputCells(CellCacheEntry[] sensitiveInputCells) {
// need to tell all cells that were previously used, but no longer are,
// that they are not consumed by this cell any more
- changeConsumingCells(sensitiveInputCells == null ? CellCacheEntry.EMPTY_ARRAY : sensitiveInputCells);
- _sensitiveInputCells = sensitiveInputCells;
+ if (sensitiveInputCells == null) {
+ _sensitiveInputCells = null;
+ changeConsumingCells(CellCacheEntry.EMPTY_ARRAY);
+ } else {
+ _sensitiveInputCells = sensitiveInputCells.clone();
+ changeConsumingCells(_sensitiveInputCells);
+ }
}
public void clearFormulaEntry() {
Modified: poi/trunk/src/java/org/apache/poi/ss/formula/ParseNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/ss/formula/ParseNode.java?rev=1744003&r1=1744002&r2=1744003&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/ss/formula/ParseNode.java (original)
+++ poi/trunk/src/java/org/apache/poi/ss/formula/ParseNode.java Mon May 16 09:57:19 2016
@@ -28,8 +28,6 @@ import org.apache.poi.ss.formula.functio
* Represents a syntactic element from a formula by encapsulating the corresponding <tt>Ptg</tt>
* token. Each <tt>ParseNode</tt> may have child <tt>ParseNode</tt>s in the case when the wrapped
* <tt>Ptg</tt> is non-atomic.
- *
- * @author Josh Micich
*/
final class ParseNode {
@@ -44,7 +42,7 @@ final class ParseNode {
throw new IllegalArgumentException("token must not be null");
}
_token = token;
- _children = children;
+ _children = children.clone();
_isIf = isIf(token);
int tokenCount = 1;
for (int i = 0; i < children.length; i++) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org