Skip to content

Commit 06dd221

Browse files
committed
Seal public abstract API classes that are not supposed to be extended.
1 parent 3edbad7 commit 06dd221

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Location.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -54,7 +54,7 @@
5454
* @see DynamicObject
5555
* @since 0.8 or earlier
5656
*/
57-
public abstract class Location {
57+
public abstract sealed class Location permits LocationImpl {
5858
/**
5959
* Constructor for subclasses.
6060
*

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/LocationImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
/** @since 0.17 or earlier */
5050
@SuppressWarnings("deprecation")
51-
abstract class LocationImpl extends Location {
51+
abstract non-sealed class LocationImpl extends Location {
5252
/**
5353
* @since 0.17 or earlier
5454
*/

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Property.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -46,7 +46,7 @@
4646
*
4747
* @since 0.8 or earlier
4848
*/
49-
public abstract class Property {
49+
public abstract sealed class Property permits PropertyImpl {
5050
/**
5151
* Constructor for subclasses.
5252
*

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/Shape.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
* @see Property
7979
* @since 0.8 or earlier
8080
*/
81-
public abstract class Shape {
81+
public abstract sealed class Shape permits ShapeImpl {
8282
static final int OBJECT_FLAGS_MASK = 0x0000_ffff;
8383
static final int OBJECT_FLAGS_SHIFT = 0;
8484
static final int OBJECT_SHARED = 1 << 16;

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/ShapeImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
* @since 0.17 or earlier
8181
*/
8282
@SuppressWarnings("deprecation")
83-
abstract class ShapeImpl extends Shape {
83+
abstract sealed class ShapeImpl extends Shape permits ShapeBasic, ShapeExt {
8484
/** Shape and object flags. */
8585
protected final int flags;
8686

0 commit comments

Comments
 (0)