Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
762 B
22 lines
762 B
4 years ago
|
package org.openrs2.deob.ast.transform
|
||
5 years ago
|
|
||
|
import com.github.javaparser.ast.CompilationUnit
|
||
|
import com.github.javaparser.ast.expr.MethodCallExpr
|
||
|
import com.github.javaparser.ast.expr.ObjectCreationExpr
|
||
|
import com.github.javaparser.ast.expr.TypeExpr
|
||
4 years ago
|
import org.openrs2.deob.ast.Library
|
||
|
import org.openrs2.deob.ast.LibraryGroup
|
||
|
import org.openrs2.deob.ast.util.walk
|
||
4 years ago
|
import javax.inject.Singleton
|
||
5 years ago
|
|
||
4 years ago
|
@Singleton
|
||
4 years ago
|
public class ValueOfTransformer : Transformer() {
|
||
4 years ago
|
override fun transformUnit(group: LibraryGroup, library: Library, unit: CompilationUnit) {
|
||
4 years ago
|
unit.walk { expr: ObjectCreationExpr ->
|
||
5 years ago
|
if (expr.type.isBoxedType) {
|
||
|
expr.replace(MethodCallExpr(TypeExpr(expr.type), "valueOf", expr.arguments))
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|