8337302: Undefined type variable results in null

Reviewed-by: liach
This commit is contained in:
Rafael Winterhalter 2024-09-18 12:33:56 +00:00 committed by Chen Liang
parent aeba1ea7c4
commit 1d070a3238
3 changed files with 86 additions and 12 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, 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
@ -106,7 +106,11 @@ public class CoreReflectionFactory implements GenericsFactory {
}
public TypeVariable<?> findTypeVariable(String name){
return getScope().lookup(name);
TypeVariable<?> variable = getScope().lookup(name);
if (variable == null) {
throw new TypeNotPresentException(name, null);
}
return variable;
}
public Type makeNamedType(String name){