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 2015/05/12 13:33:38 UTC

[Bug 57923] New: ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumer()

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

            Bug ID: 57923
           Summary: ArrayIndexOutOfBoundsException in
                    org.apache.poi.hssf.record.NameRecord.getExternSheetNu
                    mer()
           Product: POI
           Version: 3.11-FINAL
          Hardware: PC
            Status: NEW
          Severity: critical
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: g.youansisiewe@lucanet.com

Hey Guys,

We have a problem with the POI API.
We want to check whether the external spreadsheet, to which a formula refers,
is integrated properly. For this we call the method HSSFName.getSheetName ().

During this call, we get an ArrayIndexOutOfBoundsException. The reason is that,
in this case the object Name (Konrekt HSSFName) does not refer to any formula
and there is accordingly no PTGs. That's why flies here
"Ptg PTG = field_13_name_definition.getTokens () [0];" a
ArrayIndexOutOfBoundsException.

Our suggestion would be as follows:

The method org.apache.poi.hssf.record.NameRecord.getExternSheetNumer () should
be rewritten:

public int getExternSheetNumber(){
                Ptg[] ptgs = field_13_name_definition.getTokens();
        if (ptgs.lenght < 1) {
            return 0;
        }
        Ptg ptg = ptgs[0];

        if (ptg.getClass() == Area3DPtg.class){
            return ((Area3DPtg) ptg).getExternSheetIndex();

        }
        if (ptg.getClass() == Ref3DPtg.class){
            return ((Ref3DPtg) ptg).getExternSheetIndex();
        }
        return 0;
    }

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

GYO <g....@lucanet.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ArrayIndexOutOfBoundsExcept |ArrayIndexOutOfBoundsExcept
                   |ion in                      |ion in
                   |org.apache.poi.hssf.record. |org.apache.poi.hssf.record.
                   |NameRecord.getExternSheetNu |NameRecord.getExternSheetNu
                   |mer()                       |mber()
                 OS|                            |All

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
Can you provide a sample file and sample code which shows the Exception on
HSSFName.getSheetName()

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

--- Comment #5 from GYO <g....@lucanet.com> ---
Is the fix also available in Version 3.11?
How can i get the actuel POI-Version with the fix?

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

--- Comment #1 from Nick Burch <ap...@gagravarr.org> ---
Any chance you could retest with 3.12 final?

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

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

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

--- Comment #4 from Dominik Stadler <do...@gmx.at> ---
Nevermind, the following is sufficient to reproduce the problem:

        NameRecord record = new NameRecord();
        assertEquals(0, record.getExternSheetNumber());

this is fixed via r1686689 now.

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

--- Comment #6 from Andreas Beeker <ki...@apache.org> ---
We usually don't backport features, only for CVEs.
So you need to grab a nightly until we push the next beta or final release.
See [1] or [2] for download infos 

[1] http://poi.apache.org/download.html
[2] https://builds.apache.org/job/POI/lastSuccessfulBuild/artifact/build/dist/

-- 
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 57923] ArrayIndexOutOfBoundsException in org.apache.poi.hssf.record.NameRecord.getExternSheetNumber()

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

--- Comment #2 from GYO <g....@lucanet.com> ---
The Problem still occurs in the version 3.12 Final

-- 
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