[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-dev
Subject:    DO NOT REPLY [Bug 41288]  - Parse error for integers >= 2**31 in attributes
From:       bugzilla () apache ! org
Date:       2007-03-28 13:05:13
Message-ID: 20070328130513.560BA714066 () brutus ! apache ! org
[Download RAW message or body]

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41288>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41288





------- Additional Comments From x00000000@freenet.de  2007-03-28 06:05 -------
Wouldn't it be possible to just catch the NumberFormatException and reparse
it as a float:

                try {
                    int val = Integer.parseInt(sval);
                    nextIgnoreSpaces();
                    return CSSLexicalUnit.createInteger(val, prev);
                } catch (NumberFormatException e) {
                    // fall through
                }

instead of

                long lVal = Long.parseLong( sval );      // fix #41288
                if ( lVal >= Integer.MIN_VALUE && lVal <= Integer.MAX_VALUE ){
                    // we can safely convert to int
                    int iVal = (int) lVal;
                    nextIgnoreSpaces();
                    return CSSLexicalUnit.createInteger( iVal, prev);
                }

                // we are too large for an int: convert to float
                // we can just fall-through to the float-handling ...

(I proposed this in bug 38207 but failed to post it here too.)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic