mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8176425: Add radix indication in NumberFormatException message for Integer.decode
Reviewed-by: lancea
This commit is contained in:
parent
b71faed5df
commit
b0954bc7ab
4 changed files with 23 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -286,7 +286,7 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
for (int i = 0; i < sa.length; i++) {
|
||||
si[i] = Integer.parseInt(sa[i]);
|
||||
if (si[i] < 0)
|
||||
throw NumberFormatException.forInputString("" + si[i]);
|
||||
throw NumberFormatException.forInputString("" + si[i], 10);
|
||||
}
|
||||
|
||||
String [] da = desired.split("\\.", -1);
|
||||
|
@ -294,7 +294,7 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated
|
|||
for (int i = 0; i < da.length; i++) {
|
||||
di[i] = Integer.parseInt(da[i]);
|
||||
if (di[i] < 0)
|
||||
throw NumberFormatException.forInputString("" + di[i]);
|
||||
throw NumberFormatException.forInputString("" + di[i], 10);
|
||||
}
|
||||
|
||||
int len = Math.max(di.length, si.length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue