8323554: The typos in Javadoc: "@return if "

Reviewed-by: prr
This commit is contained in:
Sergey Bylokhov 2024-01-17 19:35:05 +00:00
parent 51dbd36c74
commit de237fb058
14 changed files with 107 additions and 100 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2024, 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
@ -58,7 +58,8 @@ public abstract class GestureEvent {
}
/**
* @return if the event has been consumed
* @return {@code true} if the event has been consumed, otherwise
* {@code false}
*/
protected boolean isConsumed() {
return consumed;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -230,14 +230,12 @@ public class DragSource implements Serializable {
}
/**
* Reports
* whether or not drag
* {@code Image} support
* is available on the underlying platform.
* Reports whether or not drag {@code Image} support is available on the
* underlying platform.
*
* @return if the Drag Image support is available on this platform
* @return {@code true} if the Drag Image support is available on this
* platform, otherwise {@code false}
*/
public static boolean isDragImageSupported() {
Toolkit t = Toolkit.getDefaultToolkit();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -242,15 +242,13 @@ public final class DropTargetContext implements Serializable {
}
/**
* This method returns a {@code boolean}
* indicating if the given {@code DataFlavor} is
* supported by this {@code DropTargetContext}.
* This method returns a {@code boolean} indicating if the given
* {@code DataFlavor} is supported by this {@code DropTargetContext}.
*
* @param df the {@code DataFlavor}
*
* @return if the {@code DataFlavor} specified is supported
* @param df the {@code DataFlavor} to test
* @return {@code true} if the {@code DataFlavor} specified is supported,
* otherwise {@code false}
*/
protected boolean isDataFlavorSupported(DataFlavor df) {
return getCurrentDataFlavorsAsList().contains(df);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -154,14 +154,13 @@ public class DropTargetDragEvent extends DropTargetEvent {
}
/**
* This method returns a {@code boolean} indicating
* if the specified {@code DataFlavor} is supported.
* This method returns a {@code boolean} indicating if the specified
* {@code DataFlavor} is supported.
*
* @param df the {@code DataFlavor} to test
*
* @return if a particular DataFlavor is supported
* @param df the {@code DataFlavor} to test
* @return {@code true} if a particular {@code DataFlavor} is supported,
* otherwise {@code false}
*/
public boolean isDataFlavorSupported(DataFlavor df) {
return getDropTargetContext().isDataFlavorSupported(df);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -188,15 +188,13 @@ public class DropTargetDropEvent extends DropTargetEvent {
}
/**
* This method returns a {@code boolean} indicating if the
* specified {@code DataFlavor} is available
* from the source.
* This method returns a {@code boolean} indicating if the specified
* {@code DataFlavor} is available from the source.
*
* @param df the {@code DataFlavor} to test
*
* @return if the DataFlavor specified is available from the source
* @param df the {@code DataFlavor} to test
* @return {@code true} if the {@code DataFlavor} specified is available
* from the source, otherwise {@code false}
*/
public boolean isDataFlavorSupported(DataFlavor df) {
return getDropTargetContext().isDataFlavorSupported(df);
}
@ -256,12 +254,12 @@ public class DropTargetDropEvent extends DropTargetEvent {
}
/**
* This method returns an {@code int} indicating if
* the source is in the same JVM as the target.
* This method returns a {@code boolean} indicating if the source is in the
* same JVM as the target.
*
* @return if the Source is in the same JVM
* @return {@code true} if the Source is in the same JVM, otherwise
* {@code false}
*/
public boolean isLocalTransfer() {
return isLocalTx;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -78,11 +78,12 @@ public interface DropTargetContextPeer {
Transferable getTransferable() throws InvalidDnDOperationException;
/**
* Return whether or not the DragSource Transferable is in the
* same JVM as the Target.
* @return if the DragSource Transferable is in the same JVM as the Target
* Return whether or not the DragSource Transferable is in the same JVM as
* the Target.
*
* @return {@code true} if the DragSource Transferable is in the same JVM as
* the Target, otherwise {@code false}
*/
boolean isTransferableJVMLocal();
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2024, 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
@ -497,8 +497,10 @@ public interface ComponentPeer {
/**
* Updates internal data structures related to the component's GC.
* @param gc the reference graphics configuration
* @return if the peer needs to be recreated for the changes to take effect
*
* @param gc the reference graphics configuration
* @return {@code true} if the peer needs to be recreated for the changes to
* take effect, otherwise {@code false}
* @since 1.7
*/
boolean updateGraphicsData(GraphicsConfiguration gc);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -203,12 +203,11 @@ public class BeanContextSupport extends BeanContextChildSupport
}
/**
* Reports whether or not this
* {@code BeanContext} is empty.
* A {@code BeanContext} is considered
* empty when it contains zero
* nested children.
* @return if there are not children
* Reports whether or not this {@code BeanContext} is empty. A
* {@code BeanContext} is considered empty when it contains zero nested
* children.
*
* @return {@code true} if there are no children, otherwise {@code false}
*/
public boolean isEmpty() {
synchronized(children) {
@ -217,10 +216,11 @@ public class BeanContextSupport extends BeanContextChildSupport
}
/**
* Determines whether or not the specified object
* is currently a child of this {@code BeanContext}.
* @param o the Object in question
* @return if this object is a child
* Determines whether or not the specified object is currently a child of
* this {@code BeanContext}.
*
* @param o the Object in question
* @return {@code true} if this object is a child, otherwise {@code false}
*/
public boolean contains(Object o) {
synchronized(children) {
@ -229,10 +229,11 @@ public class BeanContextSupport extends BeanContextChildSupport
}
/**
* Determines whether or not the specified object
* is currently a child of this {@code BeanContext}.
* @param o the Object in question
* @return if this object is a child
* Determines whether or not the specified object is currently a child of
* this {@code BeanContext}.
*
* @param o the Object in question
* @return {@code true} if this object is a child, otherwise {@code false}
*/
public boolean containsKey(Object o) {
synchronized(children) {
@ -839,10 +840,10 @@ public class BeanContextSupport extends BeanContextChildSupport
}
/**
* Is this {@code BeanContext} in the
* process of being serialized?
* @return if this {@code BeanContext} is
* currently being serialized
* Is this {@code BeanContext} in the process of being serialized?
*
* @return {@code true} if this {@code BeanContext} is currently being
* serialized, otherwise {@code false}
*/
public boolean isSerializing() { return serializing; }

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -318,12 +318,12 @@ public class JTextArea extends JTextComponent {
}
/**
* Gets the line-wrapping policy of the text area. If set
* to true the lines will be wrapped if they are too long
* to fit within the allocated width. If set to false,
* the lines will always be unwrapped.
* Gets the line-wrapping policy of the text area. If set to {@code true}
* the lines will be wrapped if they are too long to fit within the
* allocated width. If set to {@code false}, the lines will always be
* unwrapped.
*
* @return if lines will be wrapped
* @return {@code true} if lines will be wrapped, otherwise {@code false}
*/
public boolean getLineWrap() {
return wrap;
@ -350,14 +350,13 @@ public class JTextArea extends JTextComponent {
}
/**
* Gets the style of wrapping used if the text area is wrapping
* lines. If set to true the lines will be wrapped at word
* boundaries (ie whitespace) if they are too long
* to fit within the allocated width. If set to false,
* the lines will be wrapped at character boundaries.
* Gets the style of wrapping used if the text area is wrapping lines. If
* set to {@code true} the lines will be wrapped at word boundaries (ie
* whitespace) if they are too long to fit within the allocated width. If
* set to {@code false}, the lines will be wrapped at character boundaries.
*
* @return if the wrap style should be word boundaries
* instead of character boundaries
* @return {@code true} if the wrap style should be word boundaries instead
* of character boundaries, otherwise {@code false}
* @see #setWrapStyleWord
*/
public boolean getWrapStyleWord() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -1101,7 +1101,8 @@ public class BasicOptionPaneUI extends OptionPaneUI {
/**
* Returns if the width of children should be synchronized.
*
* @return if the width of children should be synchronized
* @return {@code true} if the width of children should be synchronized,
* otherwise {@code false}
*/
public boolean getSyncAllWidths() {
return syncAllWidths;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -2075,9 +2075,11 @@ public class BasicSliderUI extends SliderUI{
}
/**
* Returns if scrolling should occur
* @param direction the direction.
* @return if scrolling should occur
* Returns if scrolling should occur.
*
* @param direction the direction
* @return {@code true} if scrolling should occur, otherwise
* {@code false}
*/
public boolean shouldScroll(int direction) {
Rectangle r = thumbRect;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2024, 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
@ -134,10 +134,10 @@ public class BoxView extends CompositeView {
/**
* Determines if the layout is valid along the given axis.
* @return if the layout is valid along the given axis
*
* @param axis either <code>View.X_AXIS</code> or <code>View.Y_AXIS</code>
*
* @param axis either {@code View.X_AXIS} or {@code View.Y_AXIS}
* @return {@code true} if the layout is valid along the given axis,
* otherwise {@code false}
* @since 1.4
*/
protected boolean isLayoutValid(int axis) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2024, 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
@ -207,9 +207,11 @@ public class GlyphView extends View implements TabableView, Cloneable {
}
/**
* Determine if the glyphs should be underlined. If true,
* an underline should be drawn through the baseline.
* @return if the glyphs should be underlined
* Determine if the glyphs should be underlined. If {@code true}, an
* underline should be drawn through the baseline.
*
* @return {@code true} if the glyphs should be underlined, otherwise
* {@code false}
*/
public boolean isUnderline() {
AttributeSet attr = getAttributes();
@ -217,10 +219,11 @@ public class GlyphView extends View implements TabableView, Cloneable {
}
/**
* Determine if the glyphs should have a strikethrough
* line. If true, a line should be drawn through the center
* of the glyphs.
* @return if the glyphs should have a strikethrough line
* Determine if the glyphs should have a strikethrough line. If
* {@code true}, a line should be drawn through the center of the glyphs.
*
* @return {@code true} if the glyphs should have a strikethrough line,
* otherwise {@code false}
*/
public boolean isStrikeThrough() {
AttributeSet attr = getAttributes();
@ -229,7 +232,9 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine if the glyphs should be rendered as superscript.
* @return if the glyphs should be rendered as superscript
*
* @return {@code true} if the glyphs should be rendered as superscript,
* otherwise {@code false}
*/
public boolean isSubscript() {
AttributeSet attr = getAttributes();
@ -238,7 +243,9 @@ public class GlyphView extends View implements TabableView, Cloneable {
/**
* Determine if the glyphs should be rendered as subscript.
* @return if the glyphs should be rendered as subscript
*
* @return {@code true} if the glyphs should be rendered as subscript,
* otherwise {@code false}
*/
public boolean isSuperscript() {
AttributeSet attr = getAttributes();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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
@ -200,9 +200,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
}
/**
* @return if the flavor is supported
* @return {@code true} if the flavor is supported, otherwise {@code false}
*/
public boolean isDataFlavorSupported(DataFlavor df) {
Transferable localTransferable = local;
@ -289,7 +288,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
throws IOException;
/**
* @return if the transfer is a local one
* @return {@code true} if the transfer is a local one, otherwise
* {@code false}
*/
public boolean isTransferableJVMLocal() {
return local != null || getJVMLocalSourceTransferable() != null;