mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8263684: Avoid wrapping into BufferedWriter twice
Reviewed-by: prappo
This commit is contained in:
parent
9820f3d480
commit
74f30ad38b
1 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2021, 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
|
||||||
|
@ -74,7 +74,9 @@ public class ElementListWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void generateElementListFile(DocletEnvironment docEnv) throws DocFileIOException {
|
protected void generateElementListFile(DocletEnvironment docEnv) throws DocFileIOException {
|
||||||
try (BufferedWriter out = new BufferedWriter(file.openWriter())) {
|
try (Writer fileWriter = file.openWriter();
|
||||||
|
BufferedWriter out = (fileWriter instanceof BufferedWriter b) ? b
|
||||||
|
: new BufferedWriter(fileWriter)) {
|
||||||
if (configuration.showModules) {
|
if (configuration.showModules) {
|
||||||
for (ModuleElement mdle : configuration.modulePackages.keySet()) {
|
for (ModuleElement mdle : configuration.modulePackages.keySet()) {
|
||||||
if (!(options.noDeprecated() && utils.isDeprecated(mdle))) {
|
if (!(options.noDeprecated() && utils.isDeprecated(mdle))) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue