8325217: MethodSymbol.getModifiers() returns SEALED for restricted methods
Reviewed-by: jlahoda
This commit is contained in:
parent
1c691938e9
commit
8dc43aa0fe
@ -1994,7 +1994,8 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
|
|||||||
|
|
||||||
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
@Override @DefinedBy(Api.LANGUAGE_MODEL)
|
||||||
public Set<Modifier> getModifiers() {
|
public Set<Modifier> getModifiers() {
|
||||||
long flags = flags();
|
// just in case the method is restricted but that is not a modifier
|
||||||
|
long flags = flags() & ~RESTRICTED;
|
||||||
return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & ~ABSTRACT : flags);
|
return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & ~ABSTRACT : flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8316972
|
* @bug 8316972 8325217
|
||||||
* @summary Add javadoc support for restricted methods
|
* @summary Add javadoc support for restricted methods
|
||||||
* @library /tools/lib ../../lib
|
* @library /tools/lib ../../lib
|
||||||
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
* @modules jdk.javadoc/jdk.javadoc.internal.tool
|
||||||
@ -107,9 +107,8 @@ public class TestRestricted extends JavadocTester {
|
|||||||
"""
|
"""
|
||||||
<h3>restrictedMethod</h3>
|
<h3>restrictedMethod</h3>
|
||||||
<div class="horizontal-scroll">
|
<div class="horizontal-scroll">
|
||||||
<div class="member-signature"><span class="modifiers">sealed</span> <span clas\
|
<div class="member-signature"><span class="return-type">void</span> <span \
|
||||||
s="return-type">void</span> <span class="element-name">restrictedMethod</span>\
|
class="element-name">restrictedMethod</span>()</div>
|
||||||
()</div>
|
|
||||||
<div class="restricted-block" id="restricted-restrictedMethod()"><span class="restr\
|
<div class="restricted-block" id="restricted-restrictedMethod()"><span class="restr\
|
||||||
icted-label"><code>restrictedMethod</code> is a restricted method of the Java platf\
|
icted-label"><code>restrictedMethod</code> is a restricted method of the Java platf\
|
||||||
orm.</span>
|
orm.</span>
|
||||||
@ -121,9 +120,8 @@ public class TestRestricted extends JavadocTester {
|
|||||||
"""
|
"""
|
||||||
<h3>restrictedPreviewMethod</h3>
|
<h3>restrictedPreviewMethod</h3>
|
||||||
<div class="horizontal-scroll">
|
<div class="horizontal-scroll">
|
||||||
<div class="member-signature"><span class="modifiers">sealed</span> <span clas\
|
<div class="member-signature"><span class="return-type">int</span> <span class=\
|
||||||
s="return-type">int</span> <span class="element-name">restrictedPreviewMethod<\
|
"element-name">restrictedPreviewMethod</span>()</div>
|
||||||
/span>()</div>
|
|
||||||
<div class="preview-block" id="preview-restrictedPreviewMethod()"><span class="prev\
|
<div class="preview-block" id="preview-restrictedPreviewMethod()"><span class="prev\
|
||||||
iew-label"><code>restrictedPreviewMethod</code> is a preview API of the Java platfo\
|
iew-label"><code>restrictedPreviewMethod</code> is a preview API of the Java platfo\
|
||||||
rm.</span>
|
rm.</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user