You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/03/27 18:33:18 UTC

[Bug 63294] New: Add CellType enum variant of FormulaRecord.getCachedResultType()

https://bz.apache.org/bugzilla/show_bug.cgi?id=63294

            Bug ID: 63294
           Summary: Add CellType enum variant of
                    FormulaRecord.getCachedResultType()
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: shawn@thena.net
  Target Milestone: ---

CellType.getCode() has been deprecated since POI 3.15.  But it's still used in
org.apache.poi.hssf.record.FormulaRecord and OldFormulaRecord:

public final class FormulaRecord extends CellRecord implements Cloneable {
    ...
    public int getCachedResultType() {
        if (specialCachedValue == null) {
            return CellType.NUMERIC.getCode();
        }
        return specialCachedValue.getValueType();
    }
    ...
}

It would be nice to have a variant of the getCachedResultType() method that
returns 'CellType' instead of 'int' so I can remove code that calls deprecated
'CellType.forInt(code)'.

For example:

FormulaRecord fr = ...;
//noinspection deprecation
switch (CellType.forInt(fr.getCachedResultType())) {
    case BOOLEAN:
        emit(fr.getCachedBooleanValue(), fr);
        break;
    case NUMERIC:
        emit(getFormattedValue(fr.getValue(), fr), fr);
        break;
    ...
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63294] Add CellType enum variant of FormulaRecord.getCachedResultType()

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63294

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
After r1876948 there are new methods with "Enum" suffix in the name to be used
for now and deprecation warnings on the previously used methods so we can
remove them in a future version and replace them with the enum-variant finally
in yet another future version.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org