mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8250678: ModuleDescriptor.Version parsing treats empty segments inconsistently
Reviewed-by: mchung, alanb
This commit is contained in:
parent
4bd5bfd8e2
commit
e198594753
2 changed files with 12 additions and 15 deletions
|
@ -1033,13 +1033,6 @@ public class ModuleDescriptor
|
|||
|
||||
while (i < n) {
|
||||
c = v.charAt(i);
|
||||
if (c >= '0' && c <= '9')
|
||||
i = takeNumber(v, i, pre);
|
||||
else
|
||||
i = takeString(v, i, pre);
|
||||
if (i >= n)
|
||||
break;
|
||||
c = v.charAt(i);
|
||||
if (c == '.' || c == '-') {
|
||||
i++;
|
||||
continue;
|
||||
|
@ -1048,6 +1041,10 @@ public class ModuleDescriptor
|
|||
i++;
|
||||
break;
|
||||
}
|
||||
if (c >= '0' && c <= '9')
|
||||
i = takeNumber(v, i, pre);
|
||||
else
|
||||
i = takeString(v, i, pre);
|
||||
}
|
||||
|
||||
if (c == '+' && i >= n)
|
||||
|
@ -1055,17 +1052,14 @@ public class ModuleDescriptor
|
|||
|
||||
while (i < n) {
|
||||
c = v.charAt(i);
|
||||
if (c >= '0' && c <= '9')
|
||||
i = takeNumber(v, i, build);
|
||||
else
|
||||
i = takeString(v, i, build);
|
||||
if (i >= n)
|
||||
break;
|
||||
c = v.charAt(i);
|
||||
if (c == '.' || c == '-' || c == '+') {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (c >= '0' && c <= '9')
|
||||
i = takeNumber(v, i, build);
|
||||
else
|
||||
i = takeString(v, i, build);
|
||||
}
|
||||
|
||||
this.version = v;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue