Skip to content

Commit

Permalink
Annotate some nullables
Browse files Browse the repository at this point in the history
  • Loading branch information
jhy committed Aug 14, 2021
1 parent a909600 commit 9d538e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/jsoup/helper/DataUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,25 @@ public static Document load(File in, @Nullable String charsetName, String baseUr
/**
* Parses a Document from an input steam.
* @param in input stream to parse. The stream will be closed after reading.
* @param charsetName character set of input
* @param charsetName character set of input (optional)
* @param baseUri base URI of document, to resolve relative links against
* @return Document
* @throws IOException on IO error
*/
public static Document load(InputStream in, String charsetName, String baseUri) throws IOException {
public static Document load(InputStream in, @Nullable String charsetName, String baseUri) throws IOException {
return parseInputStream(in, charsetName, baseUri, Parser.htmlParser());
}

/**
* Parses a Document from an input steam, using the provided Parser.
* @param in input stream to parse. The stream will be closed after reading.
* @param charsetName character set of input
* @param charsetName character set of input (optional)
* @param baseUri base URI of document, to resolve relative links against
* @param parser alternate {@link Parser#xmlParser() parser} to use.
* @return Document
* @throws IOException on IO error
*/
public static Document load(InputStream in, String charsetName, String baseUri, Parser parser) throws IOException {
public static Document load(InputStream in, @Nullable String charsetName, String baseUri, Parser parser) throws IOException {
return parseInputStream(in, charsetName, baseUri, parser);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jsoup/internal/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static boolean isAscii(String string) {
return true;
}

private static Pattern extraDotSegmentsPattern = Pattern.compile("^/((\\.{1,2}/)+)");
private static final Pattern extraDotSegmentsPattern = Pattern.compile("^/((\\.{1,2}/)+)");
/**
* Create a new absolute URL, from a provided existing absolute URL and a relative URL component.
* @param base the existing absolute base URL
Expand Down

0 comments on commit 9d538e6

Please sign in to comment.