2022-03-07 09:34:54 +00:00
|
|
|
package lombok.bytecode;
|
|
|
|
|
|
|
|
import com.zwitserloot.cmdreader.CmdReader;
|
|
|
|
import com.zwitserloot.cmdreader.Description;
|
|
|
|
import com.zwitserloot.cmdreader.InvalidCommandLineException;
|
|
|
|
import com.zwitserloot.cmdreader.Mandatory;
|
|
|
|
import com.zwitserloot.cmdreader.Sequential;
|
|
|
|
import com.zwitserloot.cmdreader.Shorthand;
|
|
|
|
import java.io.File;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import lombok.core.LombokApp;
|
2022-03-22 17:19:32 +00:00
|
|
|
/* loaded from: com.discord-120109.apk:lombok/bytecode/PoolConstantsApp.SCL.lombok */
|
2022-03-07 09:34:54 +00:00
|
|
|
public class PoolConstantsApp extends LombokApp {
|
|
|
|
|
2022-03-22 17:19:32 +00:00
|
|
|
/* loaded from: com.discord-120109.apk:lombok/bytecode/PoolConstantsApp$CmdArgs.SCL.lombok */
|
2022-03-07 09:34:54 +00:00
|
|
|
public static class CmdArgs {
|
|
|
|
@Mandatory
|
|
|
|
@Description("paths to class files to be printed. If a directory is named, all files (recursively) in that directory will be printed.")
|
|
|
|
@Sequential
|
|
|
|
private List<String> classFiles = new ArrayList();
|
|
|
|
@Description("Shows this help text")
|
|
|
|
@Shorthand({"h", "?"})
|
|
|
|
boolean help = false;
|
|
|
|
|
|
|
|
static /* synthetic */ List access$0(CmdArgs cmdArgs) {
|
|
|
|
return cmdArgs.classFiles;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // lombok.core.LombokApp
|
|
|
|
public String getAppName() {
|
|
|
|
return "Xprintpool";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // lombok.core.LombokApp
|
|
|
|
public String getAppDescription() {
|
|
|
|
return "Prints the content of the constant pool to standard out.";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // lombok.core.LombokApp
|
|
|
|
public boolean isDebugTool() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // lombok.core.LombokApp
|
|
|
|
public int runApp(List<String> list) throws Exception {
|
|
|
|
CmdReader of = CmdReader.of(CmdArgs.class);
|
|
|
|
try {
|
|
|
|
CmdArgs cmdArgs = (CmdArgs) of.make((String[]) list.toArray(new String[0]));
|
|
|
|
if (cmdArgs.help) {
|
|
|
|
System.out.println(of.generateCommandLineHelp("java -jar lombok.jar -printpool"));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
List<File> cmdArgsToFiles = PostCompilerApp.cmdArgsToFiles(CmdArgs.access$0(cmdArgs));
|
|
|
|
int i = 0;
|
|
|
|
boolean z2 = cmdArgsToFiles.size() > 1;
|
|
|
|
Iterator<File> it = cmdArgsToFiles.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
File next = it.next();
|
|
|
|
if (!next.exists() || !next.isFile()) {
|
|
|
|
System.out.printf("Cannot find file '%s'\n", next.getAbsolutePath());
|
|
|
|
} else {
|
|
|
|
i++;
|
|
|
|
if (z2) {
|
|
|
|
System.out.printf("Processing '%s'\n", next.getAbsolutePath());
|
|
|
|
}
|
|
|
|
System.out.println(new ClassFileMetaData(PostCompilerApp.readFile(next)).poolContent());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
System.out.printf("Total files visited: %d\n", Integer.valueOf(i));
|
|
|
|
}
|
|
|
|
return i == 0 ? 1 : 0;
|
|
|
|
} catch (InvalidCommandLineException e) {
|
|
|
|
System.err.println(e.getMessage());
|
|
|
|
System.err.println(of.generateCommandLineHelp("java -jar lombok.jar -printpool"));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|