Skip to content

Commit

Permalink
SQASH Switch back to Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 13, 2024
1 parent 2a8919b commit 67a0061
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,8 @@ configure(subprojects) {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
languageVersion = JavaLanguageVersion.of(8)
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.IntStream;

public class Web {

Expand All @@ -25,19 +25,19 @@ private Web() {

// these are regarded as "Success" when checking
// http(s) links
public static final Set<Integer> HTTP_SUCCESS_CODES = Set.of(
public static final Set<Integer> HTTP_SUCCESS_CODES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
// tag::HTTP_SUCCESS_CODES[]
200, 201, 202, 203, 204,
205, 206, 207, 208, 226
// end::HTTP_SUCCESS_CODES[]
);
)));

public static final Set<Integer> HTTP_REDIRECT_CODES = Set.of(
public static final Set<Integer> HTTP_REDIRECT_CODES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
// tag::HTTP_REDIRECT_CODES[]
300, 301, 302, 303, 304,
305, 306, 307, 308
// end::HTTP_REDIRECT_CODES[]
);
)));

private static Set<Integer> join (Set<Integer> first, Set<Integer> second) {
Set<Integer> result = new HashSet<>(first);
Expand All @@ -46,13 +46,13 @@ private static Set<Integer> join (Set<Integer> first, Set<Integer> second) {
return Collections.unmodifiableSet(result);
}

public static final Set<Integer> HTTP_WARNING_CODES = join (Set.of(
public static final Set<Integer> HTTP_WARNING_CODES = join (Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
// tag::HTTP_WARNING_CODES[]
100, 101, 102
// end::HTTP_WARNING_CODES[]
), HTTP_REDIRECT_CODES);
))), HTTP_REDIRECT_CODES);

public static final Set<Integer> HTTP_ERROR_CODES = Set.of(
public static final Set<Integer> HTTP_ERROR_CODES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
// tag::HTTP_ERROR_CODES[]
400, 401, 402, 403, 404,
405, 406, 407, 408, 409,
Expand All @@ -64,7 +64,7 @@ private static Set<Integer> join (Set<Integer> first, Set<Integer> second) {
505, 506, 507, 508, 510,
511
// end::HTTP_ERROR_CODES[]
);
)));

public static final Set<String> POSSIBLE_EXTENSIONS = initExtensions();

Expand Down

0 comments on commit 67a0061

Please sign in to comment.