[ 
https://issues.apache.org/jira/browse/HDDS-16348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109686#comment-18109686
 ] 

Attila Doroszlai commented on HDDS-16348:
-----------------------------------------

Thanks [~henrychen] for the patch.  Please search Jira for existing issues.

> StorageSize.parse fails on values with surrounding whitespace
> -------------------------------------------------------------
>
>                 Key: HDDS-16348
>                 URL: https://issues.apache.org/jira/browse/HDDS-16348
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Henry Chen
>            Assignee: Henry Chen
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 2.3.0
>
>
> StorageSize.parse() trims its input but computes the substring offset from
> the untrimmed string (StorageSize.java:88-89), so any surrounding whitespace
> breaks parsing:
>   " 10MB"     -> NumberFormatException: For input string: "10m"
>   "  128MB  " -> StringIndexOutOfBoundsException
> Reachable from config, since ConfigurationSource.getStorageSize() uses get()
> instead of getTrimmed() and XML values are commonly indented.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to