Skip to content

Commit

Permalink
Random @Nullable annotations: Thread and AbstractPreferences. (#60
Browse files Browse the repository at this point in the history
)
  • Loading branch information
cpovirk authored Oct 7, 2024
1 parent a14a10e commit 8f47457
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ public Thread() {
*
* @see <a href="#inheritance">Inheritance when creating threads</a>
*/
public Thread(Runnable task) {
public Thread(@Nullable Runnable task) {
this(null, null, 0, task, 0, null);
}

Expand Down Expand Up @@ -1268,7 +1268,7 @@ public Thread(@Nullable ThreadGroup group, String name) {
*
* @see <a href="#inheritance">Inheritance when creating threads</a>
*/
public Thread(Runnable task, String name) {
public Thread(@Nullable Runnable task, String name) {
this(null, checkName(name), 0, task, 0, null);
}

Expand Down Expand Up @@ -1322,7 +1322,7 @@ public Thread(Runnable task, String name) {
*
* @see <a href="#inheritance">Inheritance when creating threads</a>
*/
public Thread(@Nullable ThreadGroup group, Runnable task, String name) {
public Thread(@Nullable ThreadGroup group, @Nullable Runnable task, String name) {
this(group, checkName(name), 0, task, 0, null);
}

Expand Down Expand Up @@ -1469,7 +1469,7 @@ public Thread(@Nullable ThreadGroup group, @Nullable Runnable task, String name,
* @since 9
* @see <a href="#inheritance">Inheritance when creating threads</a>
*/
public Thread(ThreadGroup group, Runnable task, String name,
public Thread(@Nullable ThreadGroup group, @Nullable Runnable task, String name,
long stackSize, boolean inheritInheritableThreadLocals) {
this(group, checkName(name),
(inheritInheritableThreadLocals ? 0 : NO_INHERIT_THREAD_LOCALS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public abstract class AbstractPreferences extends Preferences {
* ({@code '/'}), or {@code parent} is {@code null} and
* name isn't {@code ""}.
*/
protected AbstractPreferences(AbstractPreferences parent, String name) {
protected AbstractPreferences(@Nullable AbstractPreferences parent, String name) {
if (parent==null) {
if (!name.isEmpty())
throw new IllegalArgumentException("Root name '"+name+
Expand Down

0 comments on commit 8f47457

Please sign in to comment.