8252265: Replace @exception with @throws java.util.logging package

@exception should be updated with @throws.

Reviewed-by: dfuchs, lancea
This commit is contained in:
Vipin Sharma 2020-08-29 00:00:10 +05:30
parent 5490b03160
commit bfabf1279d
6 changed files with 45 additions and 45 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -262,10 +262,10 @@ public class FileHandler extends StreamHandler {
* Construct a default {@code FileHandler}. This will be configured
* entirely from {@code LogManager} properties (or their default values).
*
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control"))}.
* @exception NullPointerException if pattern property is an empty String.
* @throws NullPointerException if pattern property is an empty String.
*/
public FileHandler() throws IOException, SecurityException {
checkPermission();
@ -290,10 +290,10 @@ public class FileHandler extends StreamHandler {
* so use this with care.
*
* @param pattern the name of the output file
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern) throws IOException, SecurityException {
if (pattern.length() < 1 ) {
@ -322,10 +322,10 @@ public class FileHandler extends StreamHandler {
*
* @param pattern the name of the output file
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern, boolean append) throws IOException,
SecurityException {
@ -358,11 +358,11 @@ public class FileHandler extends StreamHandler {
* @param pattern the pattern for naming the output file
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*/
public FileHandler(String pattern, int limit, int count)
throws IOException, SecurityException {
@ -396,11 +396,11 @@ public class FileHandler extends StreamHandler {
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*
*/
public FileHandler(String pattern, int limit, int count, boolean append)
@ -427,11 +427,11 @@ public class FileHandler extends StreamHandler {
* @param limit the maximum number of bytes to write to any one file
* @param count the number of files to use
* @param append specifies append mode
* @exception IOException if there are IO problems opening the files.
* @exception SecurityException if a security manager exists and if
* @throws IOException if there are IO problems opening the files.
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @exception IllegalArgumentException if pattern is an empty string
* @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
* @throws IllegalArgumentException if pattern is an empty string
*
* @since 9
*
@ -769,7 +769,7 @@ public class FileHandler extends StreamHandler {
/**
* Close all the files.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -148,7 +148,7 @@ public abstract class Handler {
* should no longer be used. Method calls may either be silently
* ignored or may throw runtime exceptions.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public abstract void close() throws SecurityException;
@ -161,7 +161,7 @@ public abstract class Handler {
* which case the {@code Formatter} will be remembered, but not used.
*
* @param newFormatter the {@code Formatter} to use (may not be null)
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setFormatter(Formatter newFormatter) throws SecurityException {
@ -185,9 +185,9 @@ public abstract class Handler {
*
* @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is
* @throws UnsupportedEncodingException if the named encoding is
* not supported.
*/
public synchronized void setEncoding(String encoding)
@ -223,7 +223,7 @@ public abstract class Handler {
* {@code LogRecord} should be published or discarded.
*
* @param newFilter a {@code Filter} object (may be null)
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setFilter(Filter newFilter) throws SecurityException {
@ -247,7 +247,7 @@ public abstract class Handler {
* errors occur while using this Handler.
*
* @param em the new ErrorManager
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setErrorManager(ErrorManager em) {
@ -262,7 +262,7 @@ public abstract class Handler {
* Retrieves the ErrorManager for this Handler.
*
* @return the ErrorManager for this Handler
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public ErrorManager getErrorManager() {
@ -299,7 +299,7 @@ public abstract class Handler {
* {@code Handlers}.
*
* @param newLevel the new value for the log level
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setLevel(Level newLevel) throws SecurityException {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -1184,7 +1184,7 @@ public class LogManager {
* @param logger the new logger.
* @return true if the argument logger was registered successfully,
* false if a logger of that name already exists.
* @exception NullPointerException if the logger name is null.
* @throws NullPointerException if the logger name is null.
*/
public boolean addLogger(Logger logger) {
final String name = logger.getName();
@ -2439,7 +2439,7 @@ public class LogManager {
* If the check fails we throw a SecurityException, otherwise
* we return normally.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
*/
public void checkAccess() throws SecurityException {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -226,7 +226,7 @@ public class MemoryHandler extends Handler {
* Close the {@code Handler} and free all associated resources.
* This will also close the target {@code Handler}.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override
@ -241,7 +241,7 @@ public class MemoryHandler extends Handler {
* the {@code pushLevel}, then {@code push} will be called.
*
* @param newLevel the new value of the {@code pushLevel}
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
public synchronized void setPushLevel(Level newLevel) throws SecurityException {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -152,7 +152,7 @@ public class SocketHandler extends StreamHandler {
/**
* Close this output stream.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
@Override

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
@ -119,7 +119,7 @@ public class StreamHandler extends Handler {
* Then the output stream is replaced with the new output stream.
*
* @param out New output stream. May not be null.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
*/
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
@ -151,9 +151,9 @@ public class StreamHandler extends Handler {
*
* @param encoding The name of a supported character encoding.
* May be null, to indicate the default platform encoding.
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have {@code LoggingPermission("control")}.
* @exception UnsupportedEncodingException if the named encoding is
* @throws UnsupportedEncodingException if the named encoding is
* not supported.
*/
@Override
@ -282,7 +282,7 @@ public class StreamHandler extends Handler {
* yet been written to the stream, it will be written before the
* "tail" string.
*
* @exception SecurityException if a security manager exists and if
* @throws SecurityException if a security manager exists and if
* the caller does not have LoggingPermission("control").
*/
@Override