If a consumer calls TypeReader#readObjectType() directly - they may inadvertantly read a malformed input.
public ObjectType readObjectType() {
final int start = this.index();
this.advance();
while (this.available() && this.peek() != ';') {
this.advance();
}
if (this.peek() != ';') throw new IllegalStateException("Incomplete descriptor provided!");
this.advance();
return new ObjectType(this.substring(start + 1, this.index() - 1));
}
There is no validation that the first character is L - therefore any character could be in its place. This is not a problem with readType() or readFieldType() as they will only pass onto readObjectType() in the circumstance that the check that needs be introduced here is done.
An exception should be thrown when calling readObjectType() with the input Cjava/lang/String;
If a consumer calls
TypeReader#readObjectType()
directly - they may inadvertantly read a malformed input.There is no validation that the first character is
L
- therefore any character could be in its place. This is not a problem withreadType()
orreadFieldType()
as they will only pass ontoreadObjectType()
in the circumstance that the check that needs be introduced here is done.readObjectType()
with the inputCjava/lang/String;