Skip to content

Commit b08dfc2

Browse files
committed
build-logic: Use Java 21
1 parent 727a5a3 commit b08dfc2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build-logic/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ dependencies {
1212
}
1313

1414
java {
15-
sourceCompatibility = JavaVersion.VERSION_17
16-
targetCompatibility = JavaVersion.VERSION_17
15+
sourceCompatibility = JavaVersion.VERSION_21
16+
targetCompatibility = JavaVersion.VERSION_21
1717
}
1818

1919
gradlePlugin {

build-logic/src/main/java/juuxel/adorn/gradle/action/InlineServiceLoader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void run(Task task) throws IOException {
4949
if (serviceImpls.size() != 1) {
5050
throw new IllegalArgumentException("Service file " + serviceType + " must have exactly one provider");
5151
}
52-
implType = serviceImpls.get(0).replace('.', '/');
52+
implType = serviceImpls.getFirst().replace('.', '/');
5353
} catch (IOException e) {
5454
throw new UncheckedIOException(e);
5555
}

build-logic/src/main/java/juuxel/adorn/gradle/asm/MethodBodyPattern.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public record MethodBodyPattern(List<InsnPattern<?>> patterns) {
1919
@SuppressWarnings("unchecked")
2020
public boolean match(MethodNode mn, Consumer<MatchContext> visitor) {
2121
for (AbstractInsnNode insn : mn.instructions) {
22-
var start = (InsnPattern<AbstractInsnNode>) patterns.get(0);
22+
var start = (InsnPattern<AbstractInsnNode>) patterns.getFirst();
2323
if (start.type().isInstance(insn) && start.filter().test(insn)) {
2424
Stream<AbstractInsnNode> insnStream = Stream.iterate(insn.getNext(), it -> it.getNext() != null, AbstractInsnNode::getNext)
2525
.filter(it -> !(it instanceof LabelNode)
@@ -35,7 +35,7 @@ public boolean match(MethodNode mn, Consumer<MatchContext> visitor) {
3535
.collect(Collectors.toCollection(ArrayList::new));
3636

3737
if (matches.size() != patterns.size() - 1) continue;
38-
matches.add(0, insn);
38+
matches.addFirst(insn);
3939
var context = new MatchContext() {
4040
@Override
4141
public List<AbstractInsnNode> instructions() {

0 commit comments

Comments
 (0)