Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8251123: doclint warnings about missing javadoc tags and comments
Reviewed-by: jdv, prr
  • Loading branch information
mrserb committed Oct 6, 2020
1 parent c9d1dcc commit f397b60
Show file tree
Hide file tree
Showing 69 changed files with 1,091 additions and 447 deletions.
5 changes: 4 additions & 1 deletion src/java.desktop/share/classes/java/applet/Applet.java
Expand Up @@ -99,7 +99,10 @@ public Applet() throws HeadlessException {
/**
* Read an applet from an object input stream.
*
* @param s an object input stream
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}
* @serial
Expand Down
5 changes: 4 additions & 1 deletion src/java.desktop/share/classes/java/awt/AWTEvent.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 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 @@ -87,6 +87,9 @@
*/
public abstract class AWTEvent extends EventObject {

/**
* The private data.
*/
private byte[] bdata;

/**
Expand Down
30 changes: 24 additions & 6 deletions src/java.desktop/share/classes/java/awt/AWTKeyStroke.java
@@ -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
Expand All @@ -22,18 +22,20 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package java.awt;

import java.awt.event.KeyEvent;
import sun.awt.AppContext;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.lang.reflect.Field;

import sun.awt.AppContext;
import sun.swing.SwingAccessor;

/**
Expand Down Expand Up @@ -77,9 +79,25 @@ public class AWTKeyStroke implements Serializable {
//A key withing the cache
private static AWTKeyStroke APP_CONTEXT_KEYSTROKE_KEY = new AWTKeyStroke();

/**
* The character value for a keyboard key.
*/
private char keyChar = KeyEvent.CHAR_UNDEFINED;

/**
* The key code for this {@code AWTKeyStroke}.
*/
private int keyCode = KeyEvent.VK_UNDEFINED;

/**
* The bitwise-ored combination of any modifiers.
*/
private int modifiers;

/**
* {@code true} if this {@code AWTKeyStroke} corresponds to a key release;
* {@code false} otherwise.
*/
private boolean onKeyRelease;

static {
Expand Down
34 changes: 21 additions & 13 deletions src/java.desktop/share/classes/java/awt/Button.java
Expand Up @@ -25,14 +25,20 @@

package java.awt;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.peer.ButtonPeer;
import java.beans.BeanProperty;
import java.util.EventListener;
import java.awt.event.*;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import javax.accessibility.*;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.EventListener;

import javax.accessibility.Accessible;
import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleValue;

/**
* This class creates a labeled button. The application can cause
Expand Down Expand Up @@ -428,9 +434,8 @@ protected String paramString() {

/* Serialization support.
*/

/*
* Button Serial Data Version.
/**
* Serialized data version.
* @serial
*/
private int buttonSerializedDataVersion = 1;
Expand All @@ -449,7 +454,8 @@ protected String paramString() {
* {@code actionListenerK} indicating an
* {@code ActionListener} object
*
* @param s the {@code ObjectOutputStream} to write
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
* @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
* @see java.awt.Component#actionListenerK
* @see #readObject(ObjectInputStream)
Expand All @@ -469,10 +475,12 @@ private void writeObject(ObjectOutputStream s)
* receive action events fired by the button.
* Unrecognized keys or values will be ignored.
*
* @param s the {@code ObjectInputStream} to read
* @exception HeadlessException if
* {@code GraphicsEnvironment.isHeadless} returns
* {@code true}
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}
* @serial
* @see #removeActionListener(ActionListener)
* @see #addActionListener(ActionListener)
Expand Down
33 changes: 20 additions & 13 deletions src/java.desktop/share/classes/java/awt/CardLayout.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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 All @@ -25,15 +25,14 @@

package java.awt;

import java.util.Hashtable;
import java.util.Vector;
import java.util.Enumeration;

import java.io.Serializable;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamField;
import java.io.IOException;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;

/**
* A {@code CardLayout} object is a layout manager for a
Expand Down Expand Up @@ -68,8 +67,8 @@ public class CardLayout implements LayoutManager2,
*/
Vector<Card> vector = new Vector<>();

/*
* A pair of Component and String that represents its name.
/**
* A pair of component and string that represents its name.
*/
class Card implements Serializable {
static final long serialVersionUID = 6640330810709497518L;
Expand Down Expand Up @@ -110,10 +109,10 @@ public Card(String cardName, Component cardComponent) {
/**
* @serialField tab Hashtable
* deprecated, for forward compatibility only
* @serialField hgap int
* @serialField vgap int
* @serialField vector Vector
* @serialField currentCard int
* @serialField hgap int the horizontal Layout gap
* @serialField vgap int the vertical Layout gap
* @serialField vector Vector the pairs of components and their names
* @serialField currentCard int the index of Component currently displayed
*/
private static final ObjectStreamField[] serialPersistentFields = {
new ObjectStreamField("tab", Hashtable.class),
Expand Down Expand Up @@ -559,6 +558,11 @@ public String toString() {

/**
* Reads serializable fields from stream.
*
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
*/
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream s)
Expand Down Expand Up @@ -591,6 +595,9 @@ private void readObject(ObjectInputStream s)

/**
* Writes serializable fields to stream.
*
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
*/
private void writeObject(ObjectOutputStream s)
throws IOException
Expand Down
37 changes: 24 additions & 13 deletions src/java.desktop/share/classes/java/awt/Checkbox.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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 All @@ -22,16 +22,24 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package java.awt;

import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.peer.CheckboxPeer;
import java.awt.event.*;
import java.util.EventListener;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import javax.accessibility.*;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.EventListener;

import javax.accessibility.Accessible;
import javax.accessibility.AccessibleAction;
import javax.accessibility.AccessibleContext;
import javax.accessibility.AccessibleRole;
import javax.accessibility.AccessibleState;
import javax.accessibility.AccessibleStateSet;
import javax.accessibility.AccessibleValue;

/**
* A check box is a graphical component that can be in either an
Expand Down Expand Up @@ -602,8 +610,8 @@ protected String paramString() {
/* Serialization support.
*/

/*
* Serialized data version
/**
* Serialized data version.
* @serial
*/
private int checkboxSerializedDataVersion = 1;
Expand All @@ -615,7 +623,8 @@ protected String paramString() {
* {@code ItemListeners} are detected and
* no attempt is made to serialize them.
*
* @param s the {@code ObjectOutputStream} to write
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
* @serialData {@code null} terminated sequence of 0
* or more pairs; the pair consists of a {@code String}
* and an {@code Object}; the {@code String} indicates
Expand All @@ -642,10 +651,12 @@ private void writeObject(ObjectOutputStream s)
* item events fired by the {@code Checkbox}.
* Unrecognized keys or values will be ignored.
*
* @param s the {@code ObjectInputStream} to read
* @exception HeadlessException if
* {@code GraphicsEnvironment.isHeadless} returns
* {@code true}
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
* returns {@code true}
* @serial
* @see #removeItemListener(ItemListener)
* @see #addItemListener(ItemListener)
Expand Down
21 changes: 13 additions & 8 deletions src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java
Expand Up @@ -25,6 +25,7 @@

package java.awt;

import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.peer.CheckboxMenuItemPeer;
Expand Down Expand Up @@ -426,8 +427,8 @@ public String paramString() {
/* Serialization support.
*/

/*
* Serial Data Version
/**
* Serialized data version.
* @serial
*/
private int checkboxMenuItemSerializedDataVersion = 1;
Expand All @@ -439,7 +440,8 @@ public String paramString() {
* {@code ItemListeners} are detected and
* no attempt is made to serialize them.
*
* @param s the {@code ObjectOutputStream} to write
* @param s the {@code ObjectOutputStream} to write
* @throws IOException if an I/O error occurs
* @serialData {@code null} terminated sequence of
* 0 or more pairs; the pair consists of a {@code String}
* and an {@code Object}; the {@code String} indicates
Expand All @@ -460,17 +462,20 @@ private void writeObject(ObjectOutputStream s)
s.writeObject(null);
}

/*
/**
* Reads the {@code ObjectInputStream} and if it
* isn't {@code null} adds a listener to receive
* item events fired by the {@code Checkbox} menu item.
* Unrecognized keys or values will be ignored.
*
* @param s the {@code ObjectInputStream} to read
* @param s the {@code ObjectInputStream} to read
* @throws ClassNotFoundException if the class of a serialized object could
* not be found
* @throws IOException if an I/O error occurs
* @serial
* @see removeActionListener()
* @see addActionListener()
* @see #writeObject
* @see #removeActionListener(ActionListener)
* @see #addActionListener(ActionListener)
* @see #writeObject(ObjectOutputStream)
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException
Expand Down

1 comment on commit f397b60

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on f397b60 Oct 6, 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.