groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Arickx (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8763) CharSequence.toInteger() only deals with base 10 integer literals
Date Wed, 22 Aug 2018 08:28:00 GMT
Philip Arickx created GROOVY-8763:
-------------------------------------

             Summary: CharSequence.toInteger() only deals with base 10 integer literals
                 Key: GROOVY-8763
                 URL: https://issues.apache.org/jira/browse/GROOVY-8763
             Project: Groovy
          Issue Type: Bug
          Components: groovy-jdk
    Affects Versions: 2.5.2
            Reporter: Philip Arickx


{{'0644'.toInteger() }}resolves to 644 (base 10)

{{'0x123'.toInteger() }}fails with an exception

The groovy JDK docs for the method state "Parse a CharSequence into an Integer"

 

Either the docs should be updated, stating explicitly the parsing happens in base 10, or the
method should be altered to accept the various non-base 10 integer literal notations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message