[
https://issues.apache.org/jira/browse/ODFTOOLKIT-411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hugo Ojendiz updated ODFTOOLKIT-411:
------------------------------------
Description:
When a named range has *only one* cell, the function throws a
{{java.lang.ArrayIndexOutOfBoundsException}}
{noformat}
nov 25, 2015 2:54:42 PM org.odftoolkit.simple.table.Table getCellRangeByName
SEVERE: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.odftoolkit.simple.table.Table.getCellRangeByName(Table.java:2625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
{noformat}
This is due the lines in
{code:title=Table.java ln: 2830 col: 21}
String cellRange = nameRange.getTableCellRangeAddressAttribute();
String[] addresses = cellRange.split(":");
return getCellRangeByPosition(addresses[0], addresses[1]);
{code}
if the named range only has one cell, the {{cellRange}} contains only one
address and the algorithm is expecting: {{"address:addess"}}
was:
When a named range has *only one* cell, the function throws a
{{java.lang.ArrayIndexOutOfBoundsException}}
{panel}
nov 25, 2015 2:54:42 PM org.odftoolkit.simple.table.Table getCellRangeByName
SEVERE: 1
java.lang.ArrayIndexOutOfBoundsException: 1
at org.odftoolkit.simple.table.Table.getCellRangeByName(Table.java:2625)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
{panel}
This is due the lines in
{code:title=Table.java ln: 2830 col: 21}
String cellRange = nameRange.getTableCellRangeAddressAttribute();
String[] addresses = cellRange.split(":");
return getCellRangeByPosition(addresses[0], addresses[1]);
{code}
if the named range only has one cell, the {{cellRange}} contains only one
address and the algorithm is expecting: {{"address:addess"}}
> org.odftoolkit.simple.table.Table getCellRangeByName throws
> ArrayIndexOutOfBoundsException
> ------------------------------------------------------------------------------------------
>
> Key: ODFTOOLKIT-411
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-411
> Project: ODF Toolkit
> Issue Type: Bug
> Components: simple api
> Affects Versions: 0.6.1-incubating
> Reporter: Hugo Ojendiz
> Priority: Minor
> Labels: named-range
>
> When a named range has *only one* cell, the function throws a
> {{java.lang.ArrayIndexOutOfBoundsException}}
> {noformat}
> nov 25, 2015 2:54:42 PM org.odftoolkit.simple.table.Table getCellRangeByName
> SEVERE: 1
> java.lang.ArrayIndexOutOfBoundsException: 1
> at
> org.odftoolkit.simple.table.Table.getCellRangeByName(Table.java:2625)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> {noformat}
> This is due the lines in
> {code:title=Table.java ln: 2830 col: 21}
> String cellRange = nameRange.getTableCellRangeAddressAttribute();
> String[] addresses = cellRange.split(":");
> return getCellRangeByPosition(addresses[0], addresses[1]);
> {code}
> if the named range only has one cell, the {{cellRange}} contains only one
> address and the algorithm is expecting: {{"address:addess"}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)