Use parseInt without substring method
This commit is contained in:
committed by
Arjen Poutsma
parent
79d3f5c64c
commit
804b343cab
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -174,7 +174,7 @@ public class HtmlCharacterEntityReferencesTests {
|
||||
private int nextReferredCharacterId() throws IOException {
|
||||
String reference = nextWordToken();
|
||||
if (reference != null && reference.startsWith("&#") && reference.endsWith(";")) {
|
||||
return Integer.parseInt(reference.substring(2, reference.length() - 1));
|
||||
return Integer.parseInt(reference, 2, reference.length() - 1, 10);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user