[lworld] RFR: 8292753: [lworld] javac is accepting erroneous synchronized statements [v2]
Vicente Romero
vromero at openjdk.org
Tue Aug 23 18:36:19 UTC 2022
> javac should issue an error for this code:
>
> value class C<T extends C> {
> void m(T t) {
> synchronized(t) {}
> }
> }
>
> as type variable T is bounded by a value class. Also code like this one should be rejected:
>
> value class C<T extends C> {
> void foo(Object o) {
> synchronized ((C & I)o) {} // one of the superclasses of the intersection type is a value class
> }
> }
Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
forgot to add the bug number to the test
-------------
Changes:
- all: https://git.openjdk.org/valhalla/pull/724/files
- new: https://git.openjdk.org/valhalla/pull/724/files/56b9c163..9fef9d8a
Webrevs:
- full: https://webrevs.openjdk.org/?repo=valhalla&pr=724&range=01
- incr: https://webrevs.openjdk.org/?repo=valhalla&pr=724&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/valhalla/pull/724.diff
Fetch: git fetch https://git.openjdk.org/valhalla pull/724/head:pull/724
PR: https://git.openjdk.org/valhalla/pull/724
More information about the valhalla-dev
mailing list