mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8067801
: Enforce null check for underlying I/O streams
Reviewed-by: lancea
This commit is contained in:
parent
60530bae7c
commit
a7016e3b5d
3 changed files with 86 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2017, 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
|
||||
|
@ -59,6 +59,9 @@ class FilterInputStream extends InputStream {
|
|||
* this instance is to be created without an underlying stream.
|
||||
*/
|
||||
protected FilterInputStream(InputStream in) {
|
||||
if (in == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1994, 2017, 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
|
||||
|
@ -67,6 +67,10 @@ public class FilterOutputStream extends OutputStream {
|
|||
* created without an underlying stream.
|
||||
*/
|
||||
public FilterOutputStream(OutputStream out) {
|
||||
if (out == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
this.out = out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue