Skip to content

Commit dffe9db

Browse files
Vipin SharmaLance Andersen
authored andcommitted
8252537: Updated @exception with @throws
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
1 parent 406db1c commit dffe9db

File tree

86 files changed

+2109
-2109
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2109
-2109
lines changed

src/java.management/share/classes/java/lang/management/ClassLoadingMXBean.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -105,9 +105,9 @@ public interface ClassLoadingMXBean extends PlatformManagedObject {
105105
* @param value {@code true} to enable the verbose output;
106106
* {@code false} to disable.
107107
*
108-
* @exception java.lang.SecurityException if a security manager
109-
* exists and the caller does not have
110-
* ManagementPermission("control").
108+
* @throws java.lang.SecurityException if a security manager
109+
* exists and the caller does not have
110+
* ManagementPermission("control").
111111
*/
112112
public void setVerbose(boolean value);
113113

src/java.management/share/classes/java/lang/management/ManagementFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -465,7 +465,7 @@ public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
465465
* MXBeans are registered into the platform {@code MBeanServer}
466466
* at the first time this method is called.
467467
*
468-
* @exception SecurityException if there is a security manager
468+
* @throws SecurityException if there is a security manager
469469
* and the caller does not have the permission required by
470470
* {@link javax.management.MBeanServerFactory#createMBeanServer}.
471471
*

src/java.management/share/classes/java/lang/management/MemoryMXBean.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -283,9 +283,9 @@ public interface MemoryMXBean extends PlatformManagedObject {
283283
* @param value {@code true} to enable verbose output;
284284
* {@code false} to disable.
285285
*
286-
* @exception java.lang.SecurityException if a security manager
287-
* exists and the caller does not have
288-
* ManagementPermission("control").
286+
* @throws java.lang.SecurityException if a security manager
287+
* exists and the caller does not have
288+
* ManagementPermission("control").
289289
*/
290290
public void setVerbose(boolean value);
291291

src/java.naming/share/classes/javax/naming/CompositeName.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected CompositeName(Enumeration<String> comps) {
231231
* description.
232232
*
233233
* @param n The non-null string to parse.
234-
* @exception InvalidNameException If n has invalid composite name syntax.
234+
* @throws InvalidNameException If n has invalid composite name syntax.
235235
*/
236236
public CompositeName(String n) throws InvalidNameException {
237237
impl = new NameImpl(null, n); // null means use default syntax
@@ -321,7 +321,7 @@ public int hashCode() {
321321
*
322322
* @return a negative integer, zero, or a positive integer as this Name
323323
* is less than, equal to, or greater than the given Object.
324-
* @exception ClassCastException if obj is not a CompositeName.
324+
* @throws ClassCastException if obj is not a CompositeName.
325325
*/
326326
public int compareTo(Object obj) {
327327
if (!(obj instanceof CompositeName)) {
@@ -380,7 +380,7 @@ public Enumeration<String> getAll() {
380380
* @param posn The 0-based index of the component to retrieve.
381381
* Must be in the range [0,size()).
382382
* @return The non-null component at index posn.
383-
* @exception ArrayIndexOutOfBoundsException if posn is outside the
383+
* @throws ArrayIndexOutOfBoundsException if posn is outside the
384384
* specified range.
385385
*/
386386
public String get(int posn) {
@@ -396,7 +396,7 @@ public String get(int posn) {
396396
* Must be in the range [0,size()].
397397
* @return A composite name consisting of the components at indexes in
398398
* the range [0,posn).
399-
* @exception ArrayIndexOutOfBoundsException
399+
* @throws ArrayIndexOutOfBoundsException
400400
* If posn is outside the specified range.
401401
*/
402402
public Name getPrefix(int posn) {
@@ -414,7 +414,7 @@ public Name getPrefix(int posn) {
414414
* @return A composite name consisting of the components at indexes in
415415
* the range [posn,size()). If posn is equal to
416416
* size(), an empty composite name is returned.
417-
* @exception ArrayIndexOutOfBoundsException
417+
* @throws ArrayIndexOutOfBoundsException
418418
* If posn is outside the specified range.
419419
*/
420420
public Name getSuffix(int posn) {
@@ -465,7 +465,7 @@ public boolean endsWith(Name n) {
465465
*
466466
* @param suffix The non-null components to add.
467467
* @return The updated CompositeName, not a new one. Cannot be null.
468-
* @exception InvalidNameException If suffix is not a composite name.
468+
* @throws InvalidNameException If suffix is not a composite name.
469469
*/
470470
public Name addAll(Name suffix)
471471
throws InvalidNameException
@@ -490,8 +490,8 @@ public Name addAll(Name suffix)
490490
* @param posn The index in this name at which to add the new
491491
* components. Must be in the range [0,size()].
492492
* @return The updated CompositeName, not a new one. Cannot be null.
493-
* @exception InvalidNameException If n is not a composite name.
494-
* @exception ArrayIndexOutOfBoundsException
493+
* @throws InvalidNameException If n is not a composite name.
494+
* @throws ArrayIndexOutOfBoundsException
495495
* If posn is outside the specified range.
496496
*/
497497
public Name addAll(int posn, Name n)
@@ -511,8 +511,8 @@ public Name addAll(int posn, Name n)
511511
*
512512
* @param comp The non-null component to add.
513513
* @return The updated CompositeName, not a new one. Cannot be null.
514-
* @exception InvalidNameException If adding comp at end of the name
515-
* would violate the name's syntax.
514+
* @throws InvalidNameException If adding comp at end of the name
515+
* would violate the name's syntax.
516516
*/
517517
public Name add(String comp) throws InvalidNameException {
518518
impl.add(comp);
@@ -530,10 +530,10 @@ public Name add(String comp) throws InvalidNameException {
530530
* @param posn The index at which to add the new component.
531531
* Must be in the range [0,size()].
532532
* @return The updated CompositeName, not a new one. Cannot be null.
533-
* @exception ArrayIndexOutOfBoundsException
533+
* @throws ArrayIndexOutOfBoundsException
534534
* If posn is outside the specified range.
535-
* @exception InvalidNameException If adding comp at the specified position
536-
* would violate the name's syntax.
535+
* @throws InvalidNameException If adding comp at the specified position
536+
* would violate the name's syntax.
537537
*/
538538
public Name add(int posn, String comp)
539539
throws InvalidNameException
@@ -551,11 +551,11 @@ public Name add(int posn, String comp)
551551
* @param posn The index of the component to delete.
552552
* Must be in the range [0,size()).
553553
* @return The component removed (a String).
554-
* @exception ArrayIndexOutOfBoundsException
554+
* @throws ArrayIndexOutOfBoundsException
555555
* If posn is outside the specified range (includes case where
556556
* composite name is empty).
557-
* @exception InvalidNameException If deleting the component
558-
* would violate the name's syntax.
557+
* @throws InvalidNameException If deleting the component
558+
* would violate the name's syntax.
559559
*/
560560
public Object remove(int posn) throws InvalidNameException{
561561
return impl.remove(posn);

src/java.naming/share/classes/javax/naming/CompoundName.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected CompoundName(Enumeration<String> comps, Properties syntax) {
192192
* @param syntax A non-null list of properties that specify the syntax of
193193
* this compound name. See class description for
194194
* contents of properties.
195-
* @exception InvalidNameException If 'n' violates the syntax specified
195+
* @throws InvalidNameException If 'n' violates the syntax specified
196196
* by {@code syntax}.
197197
*/
198198
public CompoundName(String n, Properties syntax) throws InvalidNameException {
@@ -304,7 +304,7 @@ public Object clone() {
304304
* @param obj The non-null object to compare against.
305305
* @return a negative integer, zero, or a positive integer as this Name
306306
* is less than, equal to, or greater than the given Object.
307-
* @exception ClassCastException if obj is not a CompoundName.
307+
* @throws ClassCastException if obj is not a CompoundName.
308308
* @see #equals(java.lang.Object)
309309
*/
310310
public int compareTo(Object obj) {
@@ -352,7 +352,7 @@ public Enumeration<String> getAll() {
352352
* @param posn The 0-based index of the component to retrieve.
353353
* Must be in the range [0,size()).
354354
* @return The component at index posn.
355-
* @exception ArrayIndexOutOfBoundsException if posn is outside the
355+
* @throws ArrayIndexOutOfBoundsException if posn is outside the
356356
* specified range.
357357
*/
358358
public String get(int posn) {
@@ -371,7 +371,7 @@ public String get(int posn) {
371371
* Must be in the range [0,size()].
372372
* @return A compound name consisting of the components at indexes in
373373
* the range [0,posn).
374-
* @exception ArrayIndexOutOfBoundsException
374+
* @throws ArrayIndexOutOfBoundsException
375375
* If posn is outside the specified range.
376376
*/
377377
public Name getPrefix(int posn) {
@@ -391,7 +391,7 @@ public Name getPrefix(int posn) {
391391
* @return A compound name consisting of the components at indexes in
392392
* the range [posn,size()). If posn is equal to
393393
* size(), an empty compound name is returned.
394-
* @exception ArrayIndexOutOfBoundsException
394+
* @throws ArrayIndexOutOfBoundsException
395395
* If posn is outside the specified range.
396396
*/
397397
public Name getSuffix(int posn) {
@@ -449,9 +449,9 @@ public boolean endsWith(Name n) {
449449
* is not used or checked. They might be in the future.
450450
* @param suffix The non-null components to add.
451451
* @return The updated CompoundName, not a new one. Cannot be null.
452-
* @exception InvalidNameException If suffix is not a compound name,
453-
* or if the addition of the components violates the syntax
454-
* of this compound name (e.g. exceeding number of components).
452+
* @throws InvalidNameException If suffix is not a compound name,
453+
* or if the addition of the components violates the syntax
454+
* of this compound name (e.g. exceeding number of components).
455455
*/
456456
public Name addAll(Name suffix) throws InvalidNameException {
457457
if (suffix instanceof CompoundName) {
@@ -477,11 +477,11 @@ public Name addAll(Name suffix) throws InvalidNameException {
477477
* @param posn The index in this name at which to add the new
478478
* components. Must be in the range [0,size()].
479479
* @return The updated CompoundName, not a new one. Cannot be null.
480-
* @exception ArrayIndexOutOfBoundsException
480+
* @throws ArrayIndexOutOfBoundsException
481481
* If posn is outside the specified range.
482-
* @exception InvalidNameException If n is not a compound name,
483-
* or if the addition of the components violates the syntax
484-
* of this compound name (e.g. exceeding number of components).
482+
* @throws InvalidNameException If n is not a compound name,
483+
* or if the addition of the components violates the syntax
484+
* of this compound name (e.g. exceeding number of components).
485485
*/
486486
public Name addAll(int posn, Name n) throws InvalidNameException {
487487
if (n instanceof CompoundName) {
@@ -498,8 +498,8 @@ public Name addAll(int posn, Name n) throws InvalidNameException {
498498
*
499499
* @param comp The non-null component to add.
500500
* @return The updated CompoundName, not a new one. Cannot be null.
501-
* @exception InvalidNameException If adding comp at end of the name
502-
* would violate the compound name's syntax.
501+
* @throws InvalidNameException If adding comp at end of the name
502+
* would violate the compound name's syntax.
503503
*/
504504
public Name add(String comp) throws InvalidNameException{
505505
impl.add(comp);
@@ -516,11 +516,11 @@ public Name add(String comp) throws InvalidNameException{
516516
* @param comp The non-null component to add.
517517
* @param posn The index at which to add the new component.
518518
* Must be in the range [0,size()].
519-
* @exception ArrayIndexOutOfBoundsException
519+
* @throws ArrayIndexOutOfBoundsException
520520
* If posn is outside the specified range.
521521
* @return The updated CompoundName, not a new one. Cannot be null.
522-
* @exception InvalidNameException If adding comp at the specified position
523-
* would violate the compound name's syntax.
522+
* @throws InvalidNameException If adding comp at the specified position
523+
* would violate the compound name's syntax.
524524
*/
525525
public Name add(int posn, String comp) throws InvalidNameException{
526526
impl.add(posn, comp);
@@ -536,11 +536,11 @@ public Name add(int posn, String comp) throws InvalidNameException{
536536
* @param posn The index of the component to delete.
537537
* Must be in the range [0,size()).
538538
* @return The component removed (a String).
539-
* @exception ArrayIndexOutOfBoundsException
539+
* @throws ArrayIndexOutOfBoundsException
540540
* If posn is outside the specified range (includes case where
541541
* compound name is empty).
542-
* @exception InvalidNameException If deleting the component
543-
* would violate the compound name's syntax.
542+
* @throws InvalidNameException If deleting the component
543+
* would violate the compound name's syntax.
544544
*/
545545
public Object remove(int posn) throws InvalidNameException {
546546
return impl.remove(posn);

src/java.naming/share/classes/javax/naming/InitialContext.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -297,8 +297,8 @@ private static String getURLScheme(String str) {
297297
* and cache it in defaultInitCtx.
298298
* Set <code>gotDefault</code> so that we know we've tried this before.
299299
* @return The non-null cached initial context.
300-
* @exception NoInitialContextException If cannot find an initial context.
301-
* @exception NamingException If a naming exception was encountered.
300+
* @throws NoInitialContextException If cannot find an initial context.
301+
* @throws NamingException If a naming exception was encountered.
302302
*/
303303
protected Context getDefaultInitCtx() throws NamingException{
304304
if (!gotDefault) {
@@ -323,8 +323,8 @@ protected Context getDefaultInitCtx() throws NamingException{
323323
* @param name The non-null name for which to get the context.
324324
* @return A URL context for <code>name</code> or the cached
325325
* initial context. The result cannot be null.
326-
* @exception NoInitialContextException If cannot find an initial context.
327-
* @exception NamingException In a naming exception is encountered.
326+
* @throws NoInitialContextException If cannot find an initial context.
327+
* @throws NamingException In a naming exception is encountered.
328328
* @see javax.naming.spi.NamingManager#getURLContext
329329
*/
330330
protected Context getURLOrDefaultInitCtx(String name)
@@ -379,8 +379,8 @@ protected Context getURLOrDefaultInitCtx(String name)
379379
* @param name The non-null name for which to get the context.
380380
* @return A URL context for <code>name</code> or the cached
381381
* initial context. The result cannot be null.
382-
* @exception NoInitialContextException If cannot find an initial context.
383-
* @exception NamingException In a naming exception is encountered.
382+
* @throws NoInitialContextException If cannot find an initial context.
383+
* @throws NamingException In a naming exception is encountered.
384384
*
385385
* @see javax.naming.spi.NamingManager#getURLContext
386386
*/

src/java.naming/share/classes/javax/naming/LinkRef.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -97,8 +97,8 @@ public LinkRef(String linkName) {
9797
* Retrieves the name of this link.
9898
*
9999
* @return The non-null name of this link.
100-
* @exception MalformedLinkException If a link name could not be extracted
101-
* @exception NamingException If a naming exception was encountered.
100+
* @throws MalformedLinkException If a link name could not be extracted
101+
* @throws NamingException If a naming exception was encountered.
102102
*/
103103
public String getLinkName() throws NamingException {
104104
if (className != null && className.equals(linkClassName)) {

src/java.naming/share/classes/javax/naming/NameParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -49,9 +49,9 @@ public interface NameParser {
4949
* @param name The non-null string name to parse.
5050
* @return A non-null parsed form of the name using the naming convention
5151
* of this parser.
52-
* @exception InvalidNameException If name does not conform to
52+
* @throws InvalidNameException If name does not conform to
5353
* syntax defined for the namespace.
54-
* @exception NamingException If a naming exception was encountered.
54+
* @throws NamingException If a naming exception was encountered.
5555
*/
5656
Name parse(String name) throws NamingException;
5757
}

0 commit comments

Comments
 (0)