Skip to content

Commit

Permalink
8323554: The typos in Javadoc: "@return if "
Browse files Browse the repository at this point in the history
  • Loading branch information
mrserb committed Jan 10, 2024
1 parent d89602a commit c6bcf51
Show file tree
Hide file tree
Showing 14 changed files with 107 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -58,7 +58,8 @@ public void consume() {
}

/**
* @return if the event has been consumed
* @return {@code true} if the event has been consumed, otherwise
* {@code false}
*/
protected boolean isConsumed() {
return consumed;
Expand Down
12 changes: 5 additions & 7 deletions src/java.desktop/share/classes/java/awt/dnd/DragSource.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -230,14 +230,12 @@ public static DragSource getDefaultDragSource() {
}

/**
* 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();

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -242,15 +242,13 @@ protected List<DataFlavor> getCurrentDataFlavorsAsList() {
}

/**
* 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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -154,14 +154,13 @@ public List<DataFlavor> getCurrentDataFlavorsAsList() {
}

/**
* 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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -188,15 +188,13 @@ public List<DataFlavor> getCurrentDataFlavorsAsList() {
}

/**
* 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);
}
Expand Down Expand Up @@ -256,12 +254,12 @@ public void dropComplete(boolean success) {
}

/**
* This method returns an {@code int} indicating if
* the source is in the same JVM as the target.
* This method returns an {@code int} 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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -497,8 +497,10 @@ void createBuffers(int numBuffers, BufferCapabilities caps)

/**
* 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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -203,12 +203,11 @@ public int size() {
}

/**
* 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) {
Expand All @@ -217,10 +216,11 @@ public boolean isEmpty() {
}

/**
* 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) {
Expand All @@ -229,10 +229,11 @@ public boolean contains(Object o) {
}

/**
* 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) {
Expand Down Expand Up @@ -839,10 +840,10 @@ public boolean avoidingGui() {
}

/**
* 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; }

Expand Down
25 changes: 12 additions & 13 deletions src/java.desktop/share/classes/javax/swing/JTextArea.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -318,12 +318,12 @@ public void setLineWrap(boolean wrap) {
}

/**
* 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;
Expand All @@ -350,14 +350,13 @@ public void setWrapStyleWord(boolean word) {
}

/**
* 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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -1101,7 +1101,8 @@ public void setSyncAllWidths(boolean newValue) {
/**
* 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -2075,9 +2075,11 @@ public void mousePressed(MouseEvent e) {
}

/**
* 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;
Expand Down
8 changes: 4 additions & 4 deletions src/java.desktop/share/classes/javax/swing/text/BoxView.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -134,10 +134,10 @@ public void layoutChanged(int axis) {

/**
* 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) {
Expand Down
Loading

0 comments on commit c6bcf51

Please sign in to comment.