Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/io/ObjectInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ protected ObjectInputStream() throws IOException, SecurityException {
* stream instead of objects.
* @throws IOException Any of the usual Input/Output related exceptions.
*/
public final @Nullable Object readObject()
public final Object readObject()
throws IOException, ClassNotFoundException {
return readObject(Object.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public AbstractStringBuilder append(@Nullable StringBuffer sb) {
/**
* @since 1.8
*/
AbstractStringBuilder append(AbstractStringBuilder asb) {
AbstractStringBuilder append(@Nullable AbstractStringBuilder asb) {
if (asb == null) {
return appendNull();
}
Expand Down Expand Up @@ -1676,6 +1676,7 @@ void getBytes(byte[] dst, int dstBegin, byte coder) {
}

/* for readObject() */
@SuppressWarnings("nullness:assignment.type.incompatible") // This like a false positive to me
void initBytes(char[] value, int off, int len) {
if (String.COMPACT_STRINGS) {
this.value = StringUTF16.compress(value, off, len);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
package java.lang;

import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

import java.util.*;
Expand All @@ -40,7 +41,7 @@
@AnnotatedFor({"interning"})
@UsesObjectEquals class ApplicationShutdownHooks {
/* The set of registered hooks */
private static IdentityHashMap<Thread, Thread> hooks;
private static @Nullable IdentityHashMap<Thread, Thread> hooks;
static {
try {
Shutdown.add(1 /* shutdown hook invocation order */,
Expand Down Expand Up @@ -95,6 +96,7 @@ static synchronized boolean remove(Thread hook) {
* to run in. Hooks are run concurrently and this method waits for
* them to finish.
*/
@SuppressWarnings("nullness:dereference.of.nullable") // AOSEN: hooks is null only if illegal state exception is thrown
static void runHooks() {
Collection<Thread> threads;
synchronized(ApplicationShutdownHooks.class) {
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/Boolean.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public boolean equals(@Nullable Object obj) {
@Pure
@StaticallyExecutable
@EnsuresNonNullIf(expression="#1", result=true)
public static boolean getBoolean(@Nullable String name) {
public static boolean getBoolean(String name) {
boolean result = false;
try {
result = parseBoolean(System.getProperty(name));
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/lang/Character.java
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ private UnicodeBlock(String idName, String... aliases) {
0x100000, // 100000..10FFFF; Supplementary Private Use Area-B
};

private static final UnicodeBlock[] blocks = {
private static final @Nullable UnicodeBlock[] blocks = {
BASIC_LATIN,
LATIN_1_SUPPLEMENT,
LATIN_EXTENDED_A,
Expand Down Expand Up @@ -11474,7 +11474,7 @@ static int toUpperCaseEx(int codePoint) {
*/
@SideEffectFree
@StaticallyExecutable
static char[] toUpperCaseCharArray(int codePoint) {
static char @Nullable [] toUpperCaseCharArray(int codePoint) {
// As of Unicode 6.0, 1:M uppercasings only happen in the BMP.
assert isBmpCodePoint(codePoint);
return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint);
Expand Down Expand Up @@ -11542,7 +11542,7 @@ public static char reverseBytes(char ch) {
*/
@Pure
@StaticallyExecutable
public static String getName(int codePoint) {
public static @Nullable String getName(int codePoint) {
if (!isValidCodePoint(codePoint)) {
throw new IllegalArgumentException(
String.format("Not a valid Unicode code point: 0x%X", codePoint));
Expand Down
3 changes: 2 additions & 1 deletion src/java.base/share/classes/java/lang/CharacterData.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.lang;

import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.common.value.qual.IntRange;
import org.checkerframework.framework.qual.AnnotatedFor;

Expand Down Expand Up @@ -55,7 +56,7 @@ int toUpperCaseEx(int ch) {
return toUpperCase(ch);
}

char[] toUpperCaseCharArray(int ch) {
char @Nullable [] toUpperCaseCharArray(int ch) {
return null;
}

Expand Down
4 changes: 3 additions & 1 deletion src/java.base/share/classes/java/lang/CharacterName.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package java.lang;

import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.AnnotatedFor;

import java.io.DataInputStream;
Expand Down Expand Up @@ -54,6 +55,7 @@
private CharacterName() {
try (@SuppressWarnings("removal") DataInputStream dis = new DataInputStream(new InflaterInputStream(
AccessController.doPrivileged(new PrivilegedAction<>() {
@SuppressWarnings("nullness:return.type.incompatible")
public InputStream run() {
return getClass().getResourceAsStream("uniName.dat");
}
Expand Down Expand Up @@ -144,7 +146,7 @@ public static CharacterName getInstance() {
return cname;
}

public String getName(int cp) {
public @Nullable String getName(int cp) {
int off = 0;
int bk = bkIndices[cp >> 8];
if (bk == -1 || (off = lookup[(bk << 8) + (cp & 0xff)]) == 0)
Expand Down
Loading
Loading