Bug 56930

Summary: XSSFWorkbook ignores XSSFName's that have the same name
Product: POI Reporter: liad.matas
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: An example of getName error

Description liad.matas 2014-09-08 17:30:16 UTC
Created attachment 31976 [details]
An example of getName error

Methods in XSSFWorkbook seem to ignore the fact that we can have several XSSFName's with the same name in different scopes.

XSSFWorkbook.getName(String name), XSSFWorkbook.getNameIndex(String name), XSSFWorkbook.removeName(String name), and possibly other methods are affected by this.

In the attachment you can see that getName returns the 1st XSSFName it finds. A better solution would be to return a collection of results.
Comment 1 Dominik Stadler 2016-03-13 21:36:22 UTC
In r1734863 we have now added a getNames() method to Workbook and its  implementations. We did not remove the existing getName() methods to keep backwards compatibility with existing code.