8230723: Remove default constructors from java.lang and java.io

Reviewed-by: bpb, rriggs
This commit is contained in:
Joe Darcy 2019-09-09 10:13:42 -07:00
parent c84e19f3ca
commit 10f1f10f2e
10 changed files with 54 additions and 4 deletions

View file

@ -55,6 +55,11 @@ public abstract class InputStream implements Closeable {
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
* stream is initially open. The stream is closed by calling the

View file

@ -1321,6 +1321,10 @@ public class ObjectInputStream
* Provide access to the persistent fields read from the input stream.
*/
public abstract static class GetField {
/**
* Constructor for subclasses to call.
*/
public GetField() {}
/**
* Get the ObjectStreamClass that describes the fields in the stream.

View file

@ -879,6 +879,10 @@ public class ObjectOutputStream
* @since 1.2
*/
public abstract static class PutField {
/**
* Constructor for subclasses to call.
*/
public PutField() {}
/**
* Put the value of the named boolean field into the persistent field.

View file

@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@ -46,6 +46,11 @@ import java.util.Objects;
* @since 1.0
*/
public abstract class OutputStream implements Closeable, Flushable {
/**
* Constructor for subclasses to call.
*/
public OutputStream() {}
/**
* Returns a new {@code OutputStream} which discards all bytes. The
* returned stream is initially open. The stream is closed by calling