[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: Re: RFR: 8065773: JDI: UOE is not thrown, when redefineClasses changes a class modifier [v3]
From: Leonid Mesnik <lmesnik () openjdk ! java ! net>
Date: 2021-01-29 20:53:04
Message-ID: _sJ1G5DNGTJugStrCAJgZjshl0abGIIXDQNnAoPL0MY=.f3dfcfe0-616e-432d-96d1-df569cdc18af () github ! com
[Download RAW message or body]
> The test failed because it expects that public/protected/default/private and static \
> modifiers differ on the JVM level like in Java source code. However, only the \
> ACC_PUBLIC modifier has an effect on interfaces.
> Here is my proposal from bug comments:
>
> I looked at the test and checked bytecode and spec.
>
> Indeed, the bytecode of all redefineclasses021bi redefined classes differs only by \
> ACC_PUBLIC attribute. So there is no sense to test other access levels even they \
> exist in JLS.
> The last redefinition adds 'static' modifier and verifies that there is no UOE is \
> thrown. However static modifiers are also not set for interfaces because according \
> to JLS it is set implicitly. \
> https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.5.1 "A member \
> interface is implicitly static ( §9.1.1). It is permitted for the declaration of a \
> member interface to redundantly specify the static modifier." The test already has \
> been fixed to verify that UOE is not thrown but it just doesn't do anything, \
> assuming that bytecode is the same. So I believe this test case might safely be \
> deleted.
>
> It is also InnerClasses_attribute in redefineclasses021b which points to attributes \
> of the inner class. However, the spec says that it used by the compiler only. Also, \
> the test doesn't redefine this class but interface only. See \
> https://docs.oracle.com/javase/specs/jvms/se13/html/jvms-4.html: \
> "inner_class_access_flags The value of the inner_class_access_flags item is a mask \
> of flags used to denote access permissions to and properties of the class or \
> interface C as declared in the source code from which this class file was compiled. \
> It is used by a compiler to recover the original information when the source code \
> is not available. The flags are specified in Table 4.7.6-A."
> So I think it is enough just to check public vs not public access modifiers.
Leonid Mesnik has updated the pull request incrementally with one additional commit \
since the last revision:
type fixed.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/2093/files
- new: https://git.openjdk.java.net/jdk/pull/2093/files/40c97ff0..f1b2df7f
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2093&range=02
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2093&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/2093.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2093/head:pull/2093
PR: https://git.openjdk.java.net/jdk/pull/2093
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic