File tree 4 files changed +12
-12
lines changed
src/java.base/share/classes/java/util
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2012, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -74,9 +74,9 @@ public final class Optional<T> {
74
74
*
75
75
* @apiNote
76
76
* Though it may be tempting to do so, avoid testing if an object is empty
77
- * by comparing with {@code ==} against instances returned by
77
+ * by comparing with {@code ==} or {@code !=} against instances returned by
78
78
* {@code Optional.empty()}. There is no guarantee that it is a singleton.
79
- * Instead, use {@link #isPresent()}.
79
+ * Instead, use {@link #isEmpty()} or {@link # isPresent()}.
80
80
*
81
81
* @param <T> The type of the non-existent value
82
82
* @return an empty {@code Optional}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2012, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -83,9 +83,9 @@ private OptionalDouble() {
83
83
*
84
84
* @apiNote
85
85
* Though it may be tempting to do so, avoid testing if an object is empty
86
- * by comparing with {@code ==} against instances returned by
86
+ * by comparing with {@code ==} or {@code !=} against instances returned by
87
87
* {@code OptionalDouble.empty()}. There is no guarantee that it is a singleton.
88
- * Instead, use {@link #isPresent()}.
88
+ * Instead, use {@link #isEmpty()} or {@link # isPresent()}.
89
89
*
90
90
* @return an empty {@code OptionalDouble}.
91
91
*/
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2012, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -83,9 +83,9 @@ private OptionalInt() {
83
83
*
84
84
* @apiNote
85
85
* Though it may be tempting to do so, avoid testing if an object is empty
86
- * by comparing with {@code ==} against instances returned by
86
+ * by comparing with {@code ==} or {@code !=} against instances returned by
87
87
* {@code OptionalInt.empty()}. There is no guarantee that it is a singleton.
88
- * Instead, use {@link #isPresent()}.
88
+ * Instead, use {@link #isEmpty()} or {@link # isPresent()}.
89
89
*
90
90
* @return an empty {@code OptionalInt}
91
91
*/
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2012, 2018 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -83,9 +83,9 @@ private OptionalLong() {
83
83
*
84
84
* @apiNote
85
85
* Though it may be tempting to do so, avoid testing if an object is empty
86
- * by comparing with {@code ==} against instances returned by
86
+ * by comparing with {@code ==} or {@code !=} against instances returned by
87
87
* {@code OptionalLong.empty()}. There is no guarantee that it is a singleton.
88
- * Instead, use {@link #isPresent()}.
88
+ * Instead, use {@link #isEmpty()} or {@link # isPresent()}.
89
89
*
90
90
* @return an empty {@code OptionalLong}.
91
91
*/
You can’t perform that action at this time.
0 commit comments