Skip to content

Commit

Permalink
8252537: Updated @exception with @throws
Browse files Browse the repository at this point in the history
8252536: Replace @exception with @throws for core-libs
8252539: Replace @exception with @throws java.rmi.activation package
8252540: Replace @exception with @throws java.rmi.registry package
8252541: Replace @exception with @throws java.rmi.server package

Reviewed-by: rriggs, sspitsyn, lancea
  • Loading branch information
Vipin Sharma authored and Lance Andersen committed Oct 2, 2020
1 parent 406db1c commit dffe9db
Show file tree
Hide file tree
Showing 86 changed files with 2,109 additions and 2,109 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
Expand Down Expand Up @@ -105,9 +105,9 @@ public interface ClassLoadingMXBean extends PlatformManagedObject {
* @param value {@code true} to enable the verbose output;
* {@code false} to disable.
*
* @exception java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*/
public void setVerbose(boolean value);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
Expand Down Expand Up @@ -465,7 +465,7 @@ public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
* MXBeans are registered into the platform {@code MBeanServer}
* at the first time this method is called.
*
* @exception SecurityException if there is a security manager
* @throws SecurityException if there is a security manager
* and the caller does not have the permission required by
* {@link javax.management.MBeanServerFactory#createMBeanServer}.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
Expand Down Expand Up @@ -283,9 +283,9 @@ public interface MemoryMXBean extends PlatformManagedObject {
* @param value {@code true} to enable verbose output;
* {@code false} to disable.
*
* @exception java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*/
public void setVerbose(boolean value);

Expand Down
32 changes: 16 additions & 16 deletions src/java.naming/share/classes/javax/naming/CompositeName.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ protected CompositeName(Enumeration<String> comps) {
* description.
*
* @param n The non-null string to parse.
* @exception InvalidNameException If n has invalid composite name syntax.
* @throws InvalidNameException If n has invalid composite name syntax.
*/
public CompositeName(String n) throws InvalidNameException {
impl = new NameImpl(null, n); // null means use default syntax
Expand Down Expand Up @@ -321,7 +321,7 @@ public int hashCode() {
*
* @return a negative integer, zero, or a positive integer as this Name
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException if obj is not a CompositeName.
* @throws ClassCastException if obj is not a CompositeName.
*/
public int compareTo(Object obj) {
if (!(obj instanceof CompositeName)) {
Expand Down Expand Up @@ -380,7 +380,7 @@ public Enumeration<String> getAll() {
* @param posn The 0-based index of the component to retrieve.
* Must be in the range [0,size()).
* @return The non-null component at index posn.
* @exception ArrayIndexOutOfBoundsException if posn is outside the
* @throws ArrayIndexOutOfBoundsException if posn is outside the
* specified range.
*/
public String get(int posn) {
Expand All @@ -396,7 +396,7 @@ public String get(int posn) {
* Must be in the range [0,size()].
* @return A composite name consisting of the components at indexes in
* the range [0,posn).
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
*/
public Name getPrefix(int posn) {
Expand All @@ -414,7 +414,7 @@ public Name getPrefix(int posn) {
* @return A composite name consisting of the components at indexes in
* the range [posn,size()). If posn is equal to
* size(), an empty composite name is returned.
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
*/
public Name getSuffix(int posn) {
Expand Down Expand Up @@ -465,7 +465,7 @@ public boolean endsWith(Name n) {
*
* @param suffix The non-null components to add.
* @return The updated CompositeName, not a new one. Cannot be null.
* @exception InvalidNameException If suffix is not a composite name.
* @throws InvalidNameException If suffix is not a composite name.
*/
public Name addAll(Name suffix)
throws InvalidNameException
Expand All @@ -490,8 +490,8 @@ public Name addAll(Name suffix)
* @param posn The index in this name at which to add the new
* components. Must be in the range [0,size()].
* @return The updated CompositeName, not a new one. Cannot be null.
* @exception InvalidNameException If n is not a composite name.
* @exception ArrayIndexOutOfBoundsException
* @throws InvalidNameException If n is not a composite name.
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
*/
public Name addAll(int posn, Name n)
Expand All @@ -511,8 +511,8 @@ public Name addAll(int posn, Name n)
*
* @param comp The non-null component to add.
* @return The updated CompositeName, not a new one. Cannot be null.
* @exception InvalidNameException If adding comp at end of the name
* would violate the name's syntax.
* @throws InvalidNameException If adding comp at end of the name
* would violate the name's syntax.
*/
public Name add(String comp) throws InvalidNameException {
impl.add(comp);
Expand All @@ -530,10 +530,10 @@ public Name add(String comp) throws InvalidNameException {
* @param posn The index at which to add the new component.
* Must be in the range [0,size()].
* @return The updated CompositeName, not a new one. Cannot be null.
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
* @exception InvalidNameException If adding comp at the specified position
* would violate the name's syntax.
* @throws InvalidNameException If adding comp at the specified position
* would violate the name's syntax.
*/
public Name add(int posn, String comp)
throws InvalidNameException
Expand All @@ -551,11 +551,11 @@ public Name add(int posn, String comp)
* @param posn The index of the component to delete.
* Must be in the range [0,size()).
* @return The component removed (a String).
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range (includes case where
* composite name is empty).
* @exception InvalidNameException If deleting the component
* would violate the name's syntax.
* @throws InvalidNameException If deleting the component
* would violate the name's syntax.
*/
public Object remove(int posn) throws InvalidNameException{
return impl.remove(posn);
Expand Down
40 changes: 20 additions & 20 deletions src/java.naming/share/classes/javax/naming/CompoundName.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ protected CompoundName(Enumeration<String> comps, Properties syntax) {
* @param syntax A non-null list of properties that specify the syntax of
* this compound name. See class description for
* contents of properties.
* @exception InvalidNameException If 'n' violates the syntax specified
* @throws InvalidNameException If 'n' violates the syntax specified
* by {@code syntax}.
*/
public CompoundName(String n, Properties syntax) throws InvalidNameException {
Expand Down Expand Up @@ -304,7 +304,7 @@ public Object clone() {
* @param obj The non-null object to compare against.
* @return a negative integer, zero, or a positive integer as this Name
* is less than, equal to, or greater than the given Object.
* @exception ClassCastException if obj is not a CompoundName.
* @throws ClassCastException if obj is not a CompoundName.
* @see #equals(java.lang.Object)
*/
public int compareTo(Object obj) {
Expand Down Expand Up @@ -352,7 +352,7 @@ public Enumeration<String> getAll() {
* @param posn The 0-based index of the component to retrieve.
* Must be in the range [0,size()).
* @return The component at index posn.
* @exception ArrayIndexOutOfBoundsException if posn is outside the
* @throws ArrayIndexOutOfBoundsException if posn is outside the
* specified range.
*/
public String get(int posn) {
Expand All @@ -371,7 +371,7 @@ public String get(int posn) {
* Must be in the range [0,size()].
* @return A compound name consisting of the components at indexes in
* the range [0,posn).
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
*/
public Name getPrefix(int posn) {
Expand All @@ -391,7 +391,7 @@ public Name getPrefix(int posn) {
* @return A compound name consisting of the components at indexes in
* the range [posn,size()). If posn is equal to
* size(), an empty compound name is returned.
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
*/
public Name getSuffix(int posn) {
Expand Down Expand Up @@ -449,9 +449,9 @@ public boolean endsWith(Name n) {
* is not used or checked. They might be in the future.
* @param suffix The non-null components to add.
* @return The updated CompoundName, not a new one. Cannot be null.
* @exception InvalidNameException If suffix is not a compound name,
* or if the addition of the components violates the syntax
* of this compound name (e.g. exceeding number of components).
* @throws InvalidNameException If suffix is not a compound name,
* or if the addition of the components violates the syntax
* of this compound name (e.g. exceeding number of components).
*/
public Name addAll(Name suffix) throws InvalidNameException {
if (suffix instanceof CompoundName) {
Expand All @@ -477,11 +477,11 @@ public Name addAll(Name suffix) throws InvalidNameException {
* @param posn The index in this name at which to add the new
* components. Must be in the range [0,size()].
* @return The updated CompoundName, not a new one. Cannot be null.
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
* @exception InvalidNameException If n is not a compound name,
* or if the addition of the components violates the syntax
* of this compound name (e.g. exceeding number of components).
* @throws InvalidNameException If n is not a compound name,
* or if the addition of the components violates the syntax
* of this compound name (e.g. exceeding number of components).
*/
public Name addAll(int posn, Name n) throws InvalidNameException {
if (n instanceof CompoundName) {
Expand All @@ -498,8 +498,8 @@ public Name addAll(int posn, Name n) throws InvalidNameException {
*
* @param comp The non-null component to add.
* @return The updated CompoundName, not a new one. Cannot be null.
* @exception InvalidNameException If adding comp at end of the name
* would violate the compound name's syntax.
* @throws InvalidNameException If adding comp at end of the name
* would violate the compound name's syntax.
*/
public Name add(String comp) throws InvalidNameException{
impl.add(comp);
Expand All @@ -516,11 +516,11 @@ public Name add(String comp) throws InvalidNameException{
* @param comp The non-null component to add.
* @param posn The index at which to add the new component.
* Must be in the range [0,size()].
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range.
* @return The updated CompoundName, not a new one. Cannot be null.
* @exception InvalidNameException If adding comp at the specified position
* would violate the compound name's syntax.
* @throws InvalidNameException If adding comp at the specified position
* would violate the compound name's syntax.
*/
public Name add(int posn, String comp) throws InvalidNameException{
impl.add(posn, comp);
Expand All @@ -536,11 +536,11 @@ public Name add(int posn, String comp) throws InvalidNameException{
* @param posn The index of the component to delete.
* Must be in the range [0,size()).
* @return The component removed (a String).
* @exception ArrayIndexOutOfBoundsException
* @throws ArrayIndexOutOfBoundsException
* If posn is outside the specified range (includes case where
* compound name is empty).
* @exception InvalidNameException If deleting the component
* would violate the compound name's syntax.
* @throws InvalidNameException If deleting the component
* would violate the compound name's syntax.
*/
public Object remove(int posn) throws InvalidNameException {
return impl.remove(posn);
Expand Down
14 changes: 7 additions & 7 deletions src/java.naming/share/classes/javax/naming/InitialContext.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
Expand Down Expand Up @@ -297,8 +297,8 @@ private static String getURLScheme(String str) {
* and cache it in defaultInitCtx.
* Set <code>gotDefault</code> so that we know we've tried this before.
* @return The non-null cached initial context.
* @exception NoInitialContextException If cannot find an initial context.
* @exception NamingException If a naming exception was encountered.
* @throws NoInitialContextException If cannot find an initial context.
* @throws NamingException If a naming exception was encountered.
*/
protected Context getDefaultInitCtx() throws NamingException{
if (!gotDefault) {
Expand All @@ -323,8 +323,8 @@ protected Context getDefaultInitCtx() throws NamingException{
* @param name The non-null name for which to get the context.
* @return A URL context for <code>name</code> or the cached
* initial context. The result cannot be null.
* @exception NoInitialContextException If cannot find an initial context.
* @exception NamingException In a naming exception is encountered.
* @throws NoInitialContextException If cannot find an initial context.
* @throws NamingException In a naming exception is encountered.
* @see javax.naming.spi.NamingManager#getURLContext
*/
protected Context getURLOrDefaultInitCtx(String name)
Expand Down Expand Up @@ -379,8 +379,8 @@ protected Context getURLOrDefaultInitCtx(String name)
* @param name The non-null name for which to get the context.
* @return A URL context for <code>name</code> or the cached
* initial context. The result cannot be null.
* @exception NoInitialContextException If cannot find an initial context.
* @exception NamingException In a naming exception is encountered.
* @throws NoInitialContextException If cannot find an initial context.
* @throws NamingException In a naming exception is encountered.
*
* @see javax.naming.spi.NamingManager#getURLContext
*/
Expand Down
6 changes: 3 additions & 3 deletions src/java.naming/share/classes/javax/naming/LinkRef.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
Expand Down Expand Up @@ -97,8 +97,8 @@ public LinkRef(String linkName) {
* Retrieves the name of this link.
*
* @return The non-null name of this link.
* @exception MalformedLinkException If a link name could not be extracted
* @exception NamingException If a naming exception was encountered.
* @throws MalformedLinkException If a link name could not be extracted
* @throws NamingException If a naming exception was encountered.
*/
public String getLinkName() throws NamingException {
if (className != null && className.equals(linkClassName)) {
Expand Down
6 changes: 3 additions & 3 deletions src/java.naming/share/classes/javax/naming/NameParser.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
Expand Down Expand Up @@ -49,9 +49,9 @@ public interface NameParser {
* @param name The non-null string name to parse.
* @return A non-null parsed form of the name using the naming convention
* of this parser.
* @exception InvalidNameException If name does not conform to
* @throws InvalidNameException If name does not conform to
* syntax defined for the namespace.
* @exception NamingException If a naming exception was encountered.
* @throws NamingException If a naming exception was encountered.
*/
Name parse(String name) throws NamingException;
}
Loading

1 comment on commit dffe9db

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on dffe9db Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.