mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8344943: Mark not subclassable classes final in java.base exported classes
Reviewed-by: weijun, liach, djelinski
This commit is contained in:
parent
76f792b552
commit
8e8f800071
22 changed files with 44 additions and 47 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, 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
|
||||
|
@ -113,7 +113,7 @@ import jdk.internal.reflect.Reflection;
|
|||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
public class Package extends NamedPackage implements java.lang.reflect.AnnotatedElement {
|
||||
public final class Package extends NamedPackage implements java.lang.reflect.AnnotatedElement {
|
||||
/**
|
||||
* Return the name of this package.
|
||||
*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
@ -120,7 +120,7 @@ import jdk.internal.reflect.Reflection;
|
|||
* @since 1.0
|
||||
*/
|
||||
|
||||
public class Runtime {
|
||||
public final class Runtime {
|
||||
private static final Runtime currentRuntime = new Runtime();
|
||||
|
||||
private static Version version;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2025, 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
|
||||
|
@ -41,12 +41,12 @@ import static jdk.internal.constant.ConstantUtils.validateMemberName;
|
|||
* A <a href="package-summary.html#nominal">nominal descriptor</a> for an
|
||||
* {@code invokedynamic} call site.
|
||||
*
|
||||
* <p>Concrete subtypes of {@linkplain DynamicCallSiteDesc} should be immutable
|
||||
* and their behavior should not rely on object identity.
|
||||
* <p>A {@code DynamicCallSiteDesc} is immutable and its behavior does not
|
||||
* rely on object identity.
|
||||
*
|
||||
* @since 12
|
||||
*/
|
||||
public class DynamicCallSiteDesc {
|
||||
public final class DynamicCallSiteDesc {
|
||||
|
||||
private final DirectMethodHandleDesc bootstrapMethod;
|
||||
private final ConstantDesc[] bootstrapArgs;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
|
@ -69,7 +69,7 @@ import static jdk.internal.constant.ConstantUtils.*;
|
|||
*
|
||||
* @since 1.7
|
||||
*/
|
||||
public class MethodHandleProxies {
|
||||
public final class MethodHandleProxies {
|
||||
|
||||
private MethodHandleProxies() { } // do not instantiate
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2025, 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
|
||||
|
@ -84,7 +84,7 @@ import static java.lang.invoke.MethodType.methodType;
|
|||
* @author John Rose, JSR 292 EG
|
||||
* @since 1.7
|
||||
*/
|
||||
public class MethodHandles {
|
||||
public final class MethodHandles {
|
||||
|
||||
private MethodHandles() { } // do not instantiate
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2009, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2009, 2025, 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
|
||||
|
@ -91,7 +91,7 @@ import jdk.internal.module.ModuleInfo;
|
|||
* @since 9
|
||||
*/
|
||||
|
||||
public class ModuleDescriptor
|
||||
public final class ModuleDescriptor
|
||||
implements Comparable<ModuleDescriptor>
|
||||
{
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2025, 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
|
||||
|
@ -52,7 +52,7 @@ import java.util.StringJoiner;
|
|||
* @author Kenneth Russell
|
||||
* @since 1.1
|
||||
*/
|
||||
public class Modifier {
|
||||
public final class Modifier {
|
||||
/**
|
||||
* Do not call.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2025, 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
|
||||
|
@ -48,7 +48,7 @@ import static java.util.Objects.requireNonNull;
|
|||
*
|
||||
* @since 16
|
||||
*/
|
||||
public class ObjectMethods {
|
||||
public final class ObjectMethods {
|
||||
|
||||
private ObjectMethods() { }
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2025, 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
|
||||
|
@ -74,7 +74,7 @@ import sun.invoke.util.Wrapper;
|
|||
*
|
||||
* @since 21
|
||||
*/
|
||||
public class SwitchBootstraps {
|
||||
public final class SwitchBootstraps {
|
||||
|
||||
private SwitchBootstraps() {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue