8300864: Declare some fields in java.io as final

Reviewed-by: rriggs, lancea
This commit is contained in:
Per Minborg 2023-01-23 17:40:13 +00:00
parent a56598f5a5
commit 079255e312
8 changed files with 112 additions and 112 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 2023, 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
@ -72,7 +72,7 @@ public class FileOutputStream extends OutputStream
/**
* Access to FileDescriptor internals.
*/
private static final JavaIOFileDescriptorAccess fdAccess =
private static final JavaIOFileDescriptorAccess FD_ACCESS =
SharedSecrets.getJavaIOFileDescriptorAccess();
/**
@ -316,7 +316,7 @@ public class FileOutputStream extends OutputStream
*/
@Override
public void write(int b) throws IOException {
boolean append = fdAccess.getAppend(fd);
boolean append = FD_ACCESS.getAppend(fd);
long comp = Blocker.begin();
try {
write(b, append);
@ -346,7 +346,7 @@ public class FileOutputStream extends OutputStream
*/
@Override
public void write(byte[] b) throws IOException {
boolean append = fdAccess.getAppend(fd);
boolean append = FD_ACCESS.getAppend(fd);
long comp = Blocker.begin();
try {
writeBytes(b, 0, b.length, append);
@ -367,7 +367,7 @@ public class FileOutputStream extends OutputStream
*/
@Override
public void write(byte[] b, int off, int len) throws IOException {
boolean append = fdAccess.getAppend(fd);
boolean append = FD_ACCESS.getAppend(fd);
long comp = Blocker.begin();
try {
writeBytes(b, off, len, append);