Message11993

Author jamesmudd
Recipients jamesmudd, jeff.allen, stefan.richthofer
Date 2018-05-17.20:17:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526588237.1.0.682650639539.issue2672@psf.upfronthosting.co.za>
In-reply-to
Content
Ok I don't mind the one liner either your right its faster. Style wise I would prefer an if e.g

            if(value == Integer.MIN_VALUE) {
                number = Long.toString(-((long)value));
            } else {
                number = Integer.toString(value);
            }

Just had a quick look and I think this bug is present in other places too. Long should be ok as that will go though IntegerFormatter.format_d(BigInteger) but the bug is present in the other int formatting i.e to hex, octal, binary, char. These need tests and fixing to.

Actually no I think the nicest solution might be to call the BigInteger equivalent methods if value == Integer.MIN_VALUE. What do you think of this idea?

I will work on a pull request to fix all the cases I know of.
History
Date User Action Args
2018-05-17 20:17:17jamesmuddsetmessageid: <1526588237.1.0.682650639539.issue2672@psf.upfronthosting.co.za>
2018-05-17 20:17:17jamesmuddsetrecipients: + jamesmudd, jeff.allen, stefan.richthofer
2018-05-17 20:17:17jamesmuddlinkissue2672 messages
2018-05-17 20:17:16jamesmuddcreate