Bug 60399

Summary: Validation NameRange doesn't reconize 'dot' character
Product: POI Reporter: renau.couture-legare
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED WORKSFORME    
Severity: regression    
Priority: P2    
Version: 3.15-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description renau.couture-legare 2016-11-21 15:46:22 UTC
With 3.14, I didn't get this problem, but since I upgraded to 3.15, I've got it.

The documentation about the name we can set to a cell say that we can have a 'period' character as long that it isn't the first character of the string.
When I see the code, there's no validation about that character and it's now throw me an IllegalArgumentException

Either is the documentation on "Name" isn't right or the code has a bug.

Thanks

Link to doc:
https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Name.html#setNameName(java.lang.String)
Comment 1 Dominik Stadler 2016-11-21 16:37:37 UTC
Do you have a piece of code that shows the changed behavior? A unit-test would be best so we can more easily reproduce this.
Comment 2 Javen O'Neal 2016-11-21 16:56:50 UTC
https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Name.html#setNameName(java.lang.String)

Please see bug 56781 and bug 60246, which were fixed in 3.16 beta 1.

These [1] are the rules that we have attempted to implement. If these rules have not been implemented correctly, then we need to fix it.
[1] https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4d0f13ac-53b7-422e-afd2-abd7ff379c64#bmsyntax_rules_for_names
Comment 3 Javen O'Neal 2016-11-21 17:14:33 UTC
I interpreted the following rule to mean that a named range with the name of "." is not allowed. Is this named range allowed in Excel? If so, what versions (file format and application)? If this is the case, either I have misinterpreted this sentence or Microsoft's documentation is incorrect.

> Valid characters
> The first character of a name must be a 
> letter, an underscore character (_), or a 
> backslash (\). Remaining characters in the 
> name can be letters, numbers, periods, and 
> underscore characters.[1]

[1] https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4d0f13ac-53b7-422e-afd2-abd7ff379c64#bmsyntax_rules_for_names
Comment 4 Dominik Stadler 2017-08-01 07:46:06 UTC
No update for quite some time, therefore setting this to WORKSFORME for now, please reopen if you think the current logic in the latest release is still broken.