mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8230723: Remove default constructors from java.lang and java.io
Reviewed-by: bpb, rriggs
This commit is contained in:
parent
c84e19f3ca
commit
10f1f10f2e
10 changed files with 54 additions and 4 deletions
|
@ -55,6 +55,11 @@ public abstract class InputStream implements Closeable {
|
||||||
|
|
||||||
private static final int DEFAULT_BUFFER_SIZE = 8192;
|
private static final int DEFAULT_BUFFER_SIZE = 8192;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for subclasses to call.
|
||||||
|
*/
|
||||||
|
public InputStream() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new {@code InputStream} that reads no bytes. The returned
|
* Returns a new {@code InputStream} that reads no bytes. The returned
|
||||||
* stream is initially open. The stream is closed by calling the
|
* stream is initially open. The stream is closed by calling the
|
||||||
|
|
|
@ -1321,6 +1321,10 @@ public class ObjectInputStream
|
||||||
* Provide access to the persistent fields read from the input stream.
|
* Provide access to the persistent fields read from the input stream.
|
||||||
*/
|
*/
|
||||||
public abstract static class GetField {
|
public abstract static class GetField {
|
||||||
|
/**
|
||||||
|
* Constructor for subclasses to call.
|
||||||
|
*/
|
||||||
|
public GetField() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ObjectStreamClass that describes the fields in the stream.
|
* Get the ObjectStreamClass that describes the fields in the stream.
|
||||||
|
|
|
@ -879,6 +879,10 @@ public class ObjectOutputStream
|
||||||
* @since 1.2
|
* @since 1.2
|
||||||
*/
|
*/
|
||||||
public abstract static class PutField {
|
public abstract static class PutField {
|
||||||
|
/**
|
||||||
|
* Constructor for subclasses to call.
|
||||||
|
*/
|
||||||
|
public PutField() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Put the value of the named boolean field into the persistent field.
|
* Put the value of the named boolean field into the persistent field.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1994, 2019, 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
|
||||||
|
@ -46,6 +46,11 @@ import java.util.Objects;
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public abstract class OutputStream implements Closeable, Flushable {
|
public abstract class OutputStream implements Closeable, Flushable {
|
||||||
|
/**
|
||||||
|
* Constructor for subclasses to call.
|
||||||
|
*/
|
||||||
|
public OutputStream() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new {@code OutputStream} which discards all bytes. The
|
* Returns a new {@code OutputStream} which discards all bytes. The
|
||||||
* returned stream is initially open. The stream is closed by calling
|
* returned stream is initially open. The stream is closed by calling
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2019, 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
|
||||||
|
@ -51,6 +51,11 @@ import java.lang.ref.*;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class InheritableThreadLocal<T> extends ThreadLocal<T> {
|
public class InheritableThreadLocal<T> extends ThreadLocal<T> {
|
||||||
|
/**
|
||||||
|
* Creates an inheritable thread local variable.
|
||||||
|
*/
|
||||||
|
public InheritableThreadLocal() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the child's initial value for this inheritable thread-local
|
* Computes the child's initial value for this inheritable thread-local
|
||||||
* variable as a function of the parent's value at the time the child
|
* variable as a function of the parent's value at the time the child
|
||||||
|
|
|
@ -115,6 +115,11 @@ interface LiveStackFrame extends StackFrame {
|
||||||
* of primitive type.
|
* of primitive type.
|
||||||
*/
|
*/
|
||||||
public abstract class PrimitiveSlot {
|
public abstract class PrimitiveSlot {
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
PrimitiveSlot() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the size, in bytes, of the slot.
|
* Returns the size, in bytes, of the slot.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,4 +49,9 @@ package java.lang;
|
||||||
public class ThreadDeath extends Error {
|
public class ThreadDeath extends Error {
|
||||||
@java.io.Serial
|
@java.io.Serial
|
||||||
private static final long serialVersionUID = -4417128565033088268L;
|
private static final long serialVersionUID = -4417128565033088268L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a {@code ThreadDeath}.
|
||||||
|
*/
|
||||||
|
public ThreadDeath() {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2017, 2019, 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
|
||||||
|
@ -458,6 +458,11 @@ abstract class ClassSpecializer<T,K,S extends ClassSpecializer<T,K,S>.SpeciesDat
|
||||||
* Subclasses can modify the behavior.
|
* Subclasses can modify the behavior.
|
||||||
*/
|
*/
|
||||||
public class Factory {
|
public class Factory {
|
||||||
|
/**
|
||||||
|
* Constructs a factory.
|
||||||
|
*/
|
||||||
|
Factory() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a concrete subclass of the top class for a given combination of bound types.
|
* Get a concrete subclass of the top class for a given combination of bound types.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2017, 2019, 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
|
||||||
|
@ -40,6 +40,12 @@ import static java.util.Objects.requireNonNull;
|
||||||
* @since 11
|
* @since 11
|
||||||
*/
|
*/
|
||||||
public final class ConstantBootstraps {
|
public final class ConstantBootstraps {
|
||||||
|
/**
|
||||||
|
* Do not call.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval=true, since="14")
|
||||||
|
public ConstantBootstraps() {}
|
||||||
|
|
||||||
// implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant:
|
// implements the upcall from the JVM, MethodHandleNatives.linkDynamicConstant:
|
||||||
/*non-public*/
|
/*non-public*/
|
||||||
static Object makeConstant(MethodHandle bootstrapMethod,
|
static Object makeConstant(MethodHandle bootstrapMethod,
|
||||||
|
|
|
@ -43,6 +43,12 @@ import java.util.StringJoiner;
|
||||||
* @since 1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public class Modifier {
|
public class Modifier {
|
||||||
|
/**
|
||||||
|
* Do not call.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval=true, since="14")
|
||||||
|
public Modifier() {}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return {@code true} if the integer argument includes the
|
* Return {@code true} if the integer argument includes the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue