8319462: Signature.ClassTypeSig::classDesc() incorrect for inner class types

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2023-11-07 12:22:40 +00:00 committed by Adam Sotona
parent 541ff7149f
commit d22e368cb5
2 changed files with 25 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2023, 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
@ -118,7 +118,9 @@ public sealed interface Signature {
/** {@return the class name, as a symbolic descriptor} */
default ClassDesc classDesc() {
return ClassDesc.ofInternalName(className());
var outer = outerType();
return outer.isEmpty() ? ClassDesc.ofInternalName(className())
: outer.get().classDesc().nested(className());
}
/** {@return the type arguments of the class} */