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 2017/11/20 22:48:24 UTC

[Bug 61792] New: Need to rework any code that iterates over chars

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

            Bug ID: 61792
           Summary: Need to rework any code that iterates over chars
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: fanningpj@yahoo.com
  Target Milestone: ---

If we need to iterate over chars, we should use codepoints (ints) instead of
char primitives. Unicode surrogates need 2 java chars to represent one Unicode
codepoint.
DrawTextParagraph.java has an example where we iterate over the chars of a
String.
See
https://stackoverflow.com/questions/1527856/how-can-i-iterate-through-the-unicode-codepoints-of-a-java-string

-- 
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 61792] Need to rework any code that iterates over chars

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

PJ Fanning <fa...@yahoo.com> changed:

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

-- 
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 61792] Need to rework any code that iterates over chars

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

--- Comment #3 from Javen O'Neal <on...@apache.org> ---
https://svn.apache.org/viewvc/poi/trunk/src/resources/devtools/forbidden-signatures.txt?view=log

-- 
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 61792] Need to rework any code that iterates over chars

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

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

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

--- Comment #4 from Dominik Stadler <do...@gmx.at> ---
This seems to be mostly fixed now, is there still anything missing?

-- 
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 61792] Need to rework any code that iterates over chars

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

--- Comment #1 from Javen O'Neal <on...@apache.org> ---
Is there any way to add this to forbidden-apis-check to find the issues and
make sure it stays fixed?

-- 
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 61792] Need to rework any code that iterates over chars

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
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 61792] Need to rework any code that iterates over chars

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

--- Comment #2 from PJ Fanning <fa...@yahoo.com> ---
We should forbid:
Character toLowerCase() and toUpperCase() 
String toLowerCase() and toUpperCase() 

We should only use String toLowerCase(Locale) and toUpperCase(Locale)

-- 
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 61792] Need to rework any code that iterates over chars

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

--- Comment #5 from PJ Fanning <fa...@yahoo.com> ---
Dominik, there are still a lot of places where the POI code iterates over
chars. I suspect that it is best not to proceed with refactoring most of this
code though. The risks of introducing new bugs needs to be weighed up against
the likelihood that the code in question needs to be able to process Unicode
surrogates correctly.

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