Skip to content

8332103: since-checker - Add missing @ since tags to java.desktop #19192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/java.desktop/share/classes/java/awt/geom/Path2D.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 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 @@ -292,6 +292,9 @@ public Float(Shape s, AffineTransform at) {
}
}

/**
* @since 10
*/
Comment on lines +295 to +297
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's required…

If it is, you should also add explicit {@inheritDoc}:

Suggested change
/**
* @since 10
*/
/**
* {@inheritDoc}
*
* @since 10
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You don't need an explicit {@inheritDoc} although you may choose to do so for explicit clarity.

  2. @since can be omitted for a member if the value would be the same as on the enclosing class

  3. When present, @since on a method should indicate the first release in which the method is available for use on that class, with that VM signature (includes args and return type)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarification, @jonathan-gibbons. So, @since is required here.

I prefer an explicit {@inheritDoc}, this way the javadoc comment doesn't look empty. I'm fine without adding {@inheritDoc} though.

@Override
public final void trimToSize() {
// trim arrays:
Expand Down Expand Up @@ -1178,6 +1181,9 @@ public Double(Shape s, AffineTransform at) {
}
}

/**
* @since 10
*/
@Override
public final void trimToSize() {
// trim arrays:
Expand Down
4 changes: 3 additions & 1 deletion src/java.desktop/share/classes/java/beans/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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 @@ -108,5 +108,7 @@
* Long-Term Persistence</a>, an article in
* <em>The Swing Connection</em>.</li>
* </ul>
*
* @since 1.1
*/
package java.beans;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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 @@ -183,6 +183,8 @@ public void removeAllElements() {
*
* @param c the collection which contains the elements to add
* @throws NullPointerException if {@code c} is null
*
* @since 11
*/
public void addAll(Collection<? extends E> c) {
if (c.isEmpty()) {
Expand All @@ -205,6 +207,8 @@ public void addAll(Collection<? extends E> c) {
* @throws ArrayIndexOutOfBoundsException if {@code index} does not
* fall within the range of number of elements currently held
* @throws NullPointerException if {@code c} is null
*
* @since 11
*/
public void addAll(int index, Collection<? extends E> c) {
if (index < 0 || index > getSize()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, 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 @@ -530,6 +530,8 @@ public void removeRange(int fromIndex, int toIndex) {
*
* @param c the collection which contains the elements to add
* @throws NullPointerException if {@code c} is null
*
* @since 11
*/
public void addAll(Collection<? extends E> c) {
if (c.isEmpty()) {
Expand All @@ -552,6 +554,8 @@ public void addAll(Collection<? extends E> c) {
* @throws ArrayIndexOutOfBoundsException if {@code index} does not
* fall within the range of number of elements currently held
* @throws NullPointerException if {@code c} is null
*
* @since 11
*/
public void addAll(int index, Collection<? extends E> c) {
if (index < 0 || index > getSize()) {
Expand Down
10 changes: 9 additions & 1 deletion src/java.desktop/share/classes/javax/swing/JSlider.java
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 @@ -1461,6 +1461,8 @@ public AccessibleStateSet getAccessibleStateSet() {
*
* @param e a {@code ChangeEvent} object. Must not be {@code null}
* @throws NullPointerException if the parameter is {@code null}
*
* @since 16
*/
public void stateChanged(ChangeEvent e) {
if (e == null) {
Expand Down Expand Up @@ -1561,6 +1563,8 @@ public AccessibleAction getAccessibleAction() {
* which decrements the slider value
*
* @return the zero-based number of Actions in this object
*
* @since 17
*/
public int getAccessibleActionCount() {
return 2;
Expand All @@ -1572,6 +1576,8 @@ public int getAccessibleActionCount() {
* @param i zero-based index of the actions
* @return a String description of the action
* @see #getAccessibleActionCount
*
* @since 17
*/
public String getAccessibleActionDescription(int i) {
if (i == 0) {
Expand All @@ -1590,6 +1596,8 @@ public String getAccessibleActionDescription(int i) {
* action (index 1) is AccessibleAction.DECREMENT.
* @return true if the action was performed, otherwise false
* @see #getAccessibleActionCount
*
* @since 17
*/
public boolean doAccessibleAction(int i) {
if (i < 0 || i > 1) {
Expand Down
4 changes: 3 additions & 1 deletion src/java.desktop/share/classes/javax/swing/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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 @@ -149,5 +149,7 @@
* </ul>
*
* @serial exclude
*
* @since 1.2
*/
package javax.swing;
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public class BasicSliderUI extends SliderUI{

/**
* Constructs a {@code BasicSliderUI}.
*
* @since 16
* @deprecated This constructor was exposed erroneously and will be removed in a future release.
* Use {@link #BasicSliderUI(JSlider)} instead.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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 @@ -139,5 +139,7 @@
* <bind style="style" type="region" key="Table"/>
* <bind style="style" type="region" key="List"/>
* }</pre>
*
* @since 1.5
Comment on lines +142 to +143
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, I verified the javax.swing.plaf.synth package is available in Java 5 but it wasn't in Java 1.4.

*/
package javax.swing.plaf.synth;
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 @@ -648,6 +648,8 @@ public void write(Writer out, Document doc, int pos, int len)
* beginning of the previous line if the caret is
* already at the beginning of the line.
* @see #getActions
*
* @since 20
*/
public static final String beginLineUpAction = "caret-begin-line-and-up";

Expand All @@ -657,6 +659,8 @@ public void write(Writer out, Document doc, int pos, int len)
* end of the next line if the caret is already
* at the end of the line.
* @see #getActions
*
* @since 20
*/
public static final String endLineDownAction = "caret-end-line-and-down";

Expand Down