提交 2e73c532 编写于 作者: D dcherepanov

6877895: Some AWT's methods should specify throwing NPE for null arg value

Reviewed-by: art, anthony
上级 877d817e
...@@ -2154,6 +2154,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -2154,6 +2154,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* *
* @param d the dimension specifying the new size * @param d the dimension specifying the new size
* of this component * of this component
* @throws NullPointerException if {@code d} is {@code null}
* @see #setSize * @see #setSize
* @see #setBounds * @see #setBounds
* @see #invalidate * @see #invalidate
...@@ -2351,6 +2352,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -2351,6 +2352,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* invalidates the component hierarchy. * invalidates the component hierarchy.
* *
* @param r the new bounding rectangle for this component * @param r the new bounding rectangle for this component
* @throws NullPointerException if {@code r} is {@code null}
* @see #getBounds * @see #getBounds
* @see #setLocation(int, int) * @see #setLocation(int, int)
* @see #setLocation(Point) * @see #setLocation(Point)
...@@ -4545,6 +4547,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -4545,6 +4547,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* where the point's <i>x</i> and <i>y</i> coordinates are defined * where the point's <i>x</i> and <i>y</i> coordinates are defined
* to be relative to the coordinate system of this component. * to be relative to the coordinate system of this component.
* @param p the point * @param p the point
* @throws NullPointerException if {@code p} is {@code null}
* @see #getComponentAt(Point) * @see #getComponentAt(Point)
* @since JDK1.1 * @since JDK1.1
*/ */
...@@ -5879,7 +5882,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -5879,7 +5882,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @exception ClassCastException if <code>listenerType</code> * @exception ClassCastException if <code>listenerType</code>
* doesn't specify a class or interface that implements * doesn't specify a class or interface that implements
* <code>java.util.EventListener</code> * <code>java.util.EventListener</code>
* * @throws NullPointerException if {@code listenerType} is {@code null}
* @see #getComponentListeners * @see #getComponentListeners
* @see #getFocusListeners * @see #getFocusListeners
* @see #getHierarchyListeners * @see #getHierarchyListeners
...@@ -8038,6 +8041,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -8038,6 +8041,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* Prints a listing of this component to the specified output * Prints a listing of this component to the specified output
* stream. * stream.
* @param out a print stream * @param out a print stream
* @throws NullPointerException if {@code out} is {@code null}
* @since JDK1.0 * @since JDK1.0
*/ */
public void list(PrintStream out) { public void list(PrintStream out) {
...@@ -8050,6 +8054,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -8050,6 +8054,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @param out a print stream * @param out a print stream
* @param indent number of spaces to indent * @param indent number of spaces to indent
* @see java.io.PrintStream#println(java.lang.Object) * @see java.io.PrintStream#println(java.lang.Object)
* @throws NullPointerException if {@code out} is {@code null}
* @since JDK1.0 * @since JDK1.0
*/ */
public void list(PrintStream out, int indent) { public void list(PrintStream out, int indent) {
...@@ -8062,6 +8067,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -8062,6 +8067,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
/** /**
* Prints a listing to the specified print writer. * Prints a listing to the specified print writer.
* @param out the print writer to print to * @param out the print writer to print to
* @throws NullPointerException if {@code out} is {@code null}
* @since JDK1.1 * @since JDK1.1
*/ */
public void list(PrintWriter out) { public void list(PrintWriter out) {
...@@ -8073,6 +8079,7 @@ public abstract class Component implements ImageObserver, MenuContainer, ...@@ -8073,6 +8079,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* the specified print writer. * the specified print writer.
* @param out the print writer to print to * @param out the print writer to print to
* @param indent the number of spaces to indent * @param indent the number of spaces to indent
* @throws NullPointerException if {@code out} is {@code null}
* @see java.io.PrintStream#println(java.lang.Object) * @see java.io.PrintStream#println(java.lang.Object)
* @since JDK1.1 * @since JDK1.1
*/ */
......
...@@ -1231,6 +1231,7 @@ public class Container extends Component { ...@@ -1231,6 +1231,7 @@ public class Container extends Component {
* reflect the changes. * reflect the changes.
* *
* @param comp the component to be removed * @param comp the component to be removed
* @throws NullPointerException if {@code comp} is {@code null}
* @see #add * @see #add
* @see #invalidate * @see #invalidate
* @see #validate * @see #validate
...@@ -2154,6 +2155,7 @@ public class Container extends Component { ...@@ -2154,6 +2155,7 @@ public class Container extends Component {
* @exception ClassCastException if <code>listenerType</code> * @exception ClassCastException if <code>listenerType</code>
* doesn't specify a class or interface that implements * doesn't specify a class or interface that implements
* <code>java.util.EventListener</code> * <code>java.util.EventListener</code>
* @exception NullPointerException if {@code listenerType} is {@code null}
* *
* @see #getContainerListeners * @see #getContainerListeners
* *
...@@ -2705,6 +2707,7 @@ public class Container extends Component { ...@@ -2705,6 +2707,7 @@ public class Container extends Component {
* If there is no child component at the requested point and the * If there is no child component at the requested point and the
* point is within the bounds of the container the container itself * point is within the bounds of the container the container itself
* is returned. * is returned.
* @throws NullPointerException if {@code p} is {@code null}
* @see Component#contains * @see Component#contains
* @see #getComponentAt * @see #getComponentAt
* @since 1.2 * @since 1.2
...@@ -2969,6 +2972,7 @@ public class Container extends Component { ...@@ -2969,6 +2972,7 @@ public class Container extends Component {
* *
* @param out a print stream * @param out a print stream
* @param indent the number of spaces to indent * @param indent the number of spaces to indent
* @throws NullPointerException if {@code out} is {@code null}
* @see Component#list(java.io.PrintStream, int) * @see Component#list(java.io.PrintStream, int)
* @since JDK1.0 * @since JDK1.0
*/ */
...@@ -2995,6 +2999,7 @@ public class Container extends Component { ...@@ -2995,6 +2999,7 @@ public class Container extends Component {
* *
* @param out a print writer * @param out a print writer
* @param indent the number of spaces to indent * @param indent the number of spaces to indent
* @throws NullPointerException if {@code out} is {@code null}
* @see Component#list(java.io.PrintWriter, int) * @see Component#list(java.io.PrintWriter, int)
* @since JDK1.1 * @since JDK1.1
*/ */
......
...@@ -377,6 +377,7 @@ public class ScrollPane extends Container implements Accessible { ...@@ -377,6 +377,7 @@ public class ScrollPane extends Container implements Accessible {
* This is a convenience method which interfaces with the Adjustable * This is a convenience method which interfaces with the Adjustable
* objects which represent the state of the scrollbars. * objects which represent the state of the scrollbars.
* @param p the Point representing the position to scroll to * @param p the Point representing the position to scroll to
* @throws NullPointerException if {@code p} is {@code null}
*/ */
public void setScrollPosition(Point p) { public void setScrollPosition(Point p) {
setScrollPosition(p.x, p.y); setScrollPosition(p.x, p.y);
......
...@@ -1888,6 +1888,7 @@ public class Window extends Container implements Accessible { ...@@ -1888,6 +1888,7 @@ public class Window extends Container implements Accessible {
* @exception ClassCastException if <code>listenerType</code> * @exception ClassCastException if <code>listenerType</code>
* doesn't specify a class or interface that implements * doesn't specify a class or interface that implements
* <code>java.util.EventListener</code> * <code>java.util.EventListener</code>
* @exception NullPointerException if {@code listenerType} is {@code null}
* *
* @see #getWindowListeners * @see #getWindowListeners
* @since 1.3 * @since 1.3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册