Checkstyle fix

This commit is contained in:
Jindra Petřík
2025-04-13 14:13:27 +02:00
parent 859a2f8bdb
commit b1c5f9d0c6
85 changed files with 2486 additions and 2340 deletions
@@ -132,8 +132,8 @@ import com.jpexs.decompiler.flash.importers.SpriteImporter;
import com.jpexs.decompiler.flash.importers.SwfXmlImporter;
import com.jpexs.decompiler.flash.importers.SymbolClassImporter;
import com.jpexs.decompiler.flash.importers.TextImporter;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
import com.jpexs.decompiler.flash.importers.amf.AmfParseException;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
import com.jpexs.decompiler.flash.importers.svg.SvgImporter;
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
@@ -361,7 +361,7 @@ public class CommandLineArgumentParser {
if (filter == null) {
out.println(PREFIX + "myfile.swf");
exampleFound = true;
}
}
if (filter == null || filter.equals("export") || filter.equals("format") || filter.equals("selectclass") || filter.equals("onerror")) {
out.println(PREFIX + "-export script \"C:\\decompiled\" myfile.swf");
@@ -1741,7 +1741,7 @@ public class CommandLineArgumentParser {
System.err.println("Process affinity setting is only available on Windows platform.");
}
}
private static void parseChangeImport(Stack<String> args, Map<String, String> changedImports) {
if (args.size() < 2) {
System.err.println("source and target of import expected");
@@ -1749,7 +1749,7 @@ public class CommandLineArgumentParser {
}
changedImports.put(args.pop(), args.pop());
}
private static UrlResolver parseImportAssets(Stack<String> args, Map<String, String> changedImports) {
if (args.isEmpty()) {
System.err.println("importassets options expected");
@@ -1760,7 +1760,7 @@ public class CommandLineArgumentParser {
boolean doResolve = false;
boolean doAsk = false;
boolean localOnly = false;
for (String impOption:impOptionsArr) {
for (String impOption : impOptionsArr) {
switch (impOption) {
case "yes":
doResolve = true;
@@ -2068,7 +2068,7 @@ public class CommandLineArgumentParser {
startTimeSwf = System.currentTimeMillis();
System.out.println("Start exporting " + inFile.getName());
}
OpenableSourceInfo sourceInfo = new OpenableSourceInfo(null, inFile.getAbsolutePath(), inFile.getName());
SWF swf;
try {
@@ -2247,7 +2247,7 @@ public class CommandLineArgumentParser {
boolean exportAs3Script = exportAllScript || exportFormats.contains("script_as3");
if (exportAs2Script || exportAs3Script) {
System.out.println("Exporting scripts...");
String scriptsFolder = Path.combine(outDir, ScriptExportSettings.EXPORT_FOLDER_NAME);
Path.createDirectorySafe(new File(scriptsFolder));
String singleFileName = Path.combine(scriptsFolder, swf.getShortFileName() + scriptExportSettings.getFileExtension());
@@ -3516,7 +3516,7 @@ public class CommandLineArgumentParser {
if (format == null) {
format = "html";
}
if (!format.equals("html")) {
badArguments("doc");
}
@@ -32,6 +32,7 @@ import java.util.Scanner;
/**
* Console Url resolver
*
* @author JPEXS
*/
public class ConsoleUrlResolver implements UrlResolver {
@@ -42,7 +43,7 @@ public class ConsoleUrlResolver implements UrlResolver {
private boolean ignoredInfoPrinted = false;
private Character toAll = null;
private Map<String, String> importSources = new HashMap<>();
/**
@@ -64,14 +65,14 @@ public class ConsoleUrlResolver implements UrlResolver {
Character choice = toAll;
String currentUrl = url;
if (importSources.containsKey(url)) {
currentUrl = importSources.get(url);
if (currentUrl.isEmpty()) {
return null;
}
choice = 'y';
} else {
} else {
if (choice == null && doResolve) {
choice = 'y';
}
@@ -86,9 +87,8 @@ public class ConsoleUrlResolver implements UrlResolver {
choice = ask(url);
}
}
while(choice != 'n') {
while (choice != 'n') {
if (choice == 'c') {
System.out.println("Enter new location instead (empty to cancel):");
Scanner sc = new Scanner(System.in);
@@ -115,7 +115,7 @@ public class ConsoleUrlResolver implements UrlResolver {
File swf = new File(new File(basePath).getParentFile(), currentUrl);
if (swf.exists()) {
try {
SWF ret = open(new FileInputStream(swf), swf.getAbsolutePath(), swf.getName());
SWF ret = open(new FileInputStream(swf), swf.getAbsolutePath(), swf.getName());
return ret;
} catch (Exception ex) {
//ignore
@@ -144,10 +144,10 @@ public class ConsoleUrlResolver implements UrlResolver {
}
return null;
}
private SWF open(InputStream is, String file, String fileTitle) throws Exception {
OpenableSourceInfo sourceInfo = new OpenableSourceInfo(is, file, fileTitle);
return new SWF(new BufferedInputStream(is), sourceInfo.getFile(), sourceInfo.getFileTitle(), null, Configuration.parallelSpeedUp.get(), false, true, this, null /*??*/);
return new SWF(new BufferedInputStream(is), sourceInfo.getFile(), sourceInfo.getFileTitle(), null, Configuration.parallelSpeedUp.get(), false, true, this, null /*??*/);
}
private String prompt() {