Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Added Java 22 version downgrader
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Apr 10, 2024
1 parent 3e06ea1 commit 5b01aed
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To use JavaDowngrader as a library in your application, check out the [Usage (As
If you just want to downgrade .jar files you can check out the [Usage (Standalone)](#usage-standalonebootstrap) section.

## Features
- Supports up to Java 21 and down to Java 8
- Supports up to Java 22 and down to Java 8
- Downgrades language features
- Downgrades important Java API calls
- Can be applied during runtime
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/raphimc/javadowngrader/JavaDowngrader.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.raphimc.javadowngrader.transformer.j18.Java19ToJava18;
import net.raphimc.javadowngrader.transformer.j19.Java20ToJava19;
import net.raphimc.javadowngrader.transformer.j20.Java21ToJava20;
import net.raphimc.javadowngrader.transformer.j21.Java22ToJava21;
import net.raphimc.javadowngrader.transformer.j8.Java9ToJava8;
import net.raphimc.javadowngrader.transformer.j9.Java10ToJava9;
import org.objectweb.asm.tree.ClassNode;
Expand All @@ -42,6 +43,7 @@ public class JavaDowngrader {
private static final List<DowngradingTransformer> TRANSFORMER = new ArrayList<>();

static {
TRANSFORMER.add(new Java22ToJava21());
TRANSFORMER.add(new Java21ToJava20());
TRANSFORMER.add(new Java20ToJava19());
TRANSFORMER.add(new Java19ToJava18());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This file is part of JavaDowngrader - https://github.com/RaphiMC/JavaDowngrader
* Copyright (C) 2023-2024 RK_01/RaphiMC and contributors
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.javadowngrader.transformer.j21;

import net.raphimc.javadowngrader.transformer.DowngradingTransformer;
import org.objectweb.asm.Opcodes;

public class Java22ToJava21 extends DowngradingTransformer {

public Java22ToJava21() {
super(Opcodes.V22, Opcodes.V21);
}

}

0 comments on commit 5b01aed

Please sign in to comment.