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

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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

--- Comment #1 from Javen O'Neal <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61792

--- Comment #2 from PJ Fanning <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61792

--- Comment #3 from Javen O'Neal <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61792

Dominik Stadler <[hidden email]> changed:

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

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61792

Dominik Stadler <[hidden email]> changed:

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

--- Comment #4 from Dominik Stadler <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61792

--- Comment #5 from PJ Fanning <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]