string concatenation in logger inspection

This commit is contained in:
Jindra Petřík
2021-01-29 08:56:18 +01:00
parent 2767f77a66
commit ef143d8ede
12 changed files with 22 additions and 21 deletions

View File

@@ -1621,7 +1621,7 @@ public final class SWF implements SWFContainerItem, Timelined {
for (ScriptPack item : packs) {
ClassPath key = item.getClassPath();
if (classPaths.contains(key)) {
logger.log(Level.SEVERE, "Duplicate pack path found (" + key + ")!");
logger.log(Level.SEVERE, "Duplicate pack path found ({0})!", key);
} else {
classPaths.add(key);
ret.add(item);

View File

@@ -507,7 +507,7 @@ public class ScriptPack extends AS3ClassTreeItem {
continue;
}
addedLines.add(line);
logger.log(Level.FINE, "Script " + path + ": Insert debugline(" + line + ") at pos " + i + " to body " + bodyIndex);
logger.log(Level.FINE, "Script {0}: Insert debugline({1}) at pos {2} to body {3}", new Object[]{path, line, i, bodyIndex});
b.insertInstruction(i + dpos, new AVM2Instruction(0, AVM2Instructions.DebugLine, new int[]{line}));
}
//remove old debug instructions

View File

@@ -2147,7 +2147,7 @@ public class AVM2Code implements Cloneable {
}
}
if (someIgnored) {
logger.log(Level.WARNING, path + ": One or more invalid jump offsets found in the code. Those instructions were ignored.");
logger.log(Level.WARNING, "{0}: One or more invalid jump offsets found in the code. Those instructions were ignored.", path);
}
removeIgnored(body);
}

View File

@@ -90,6 +90,7 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
@@ -189,7 +190,7 @@ public class AVM2Graph extends Graph {
}
public Map<Integer, Set<Integer>> calculateLocalRegsUsage(Set<Integer> ignoredSwitches, String path, Set<GraphPart> allParts) {
logger.fine("--- " + path + " ---");
logger.log(Level.FINE, "--- {0} ---", path);
Map<Integer, Set<Integer>> setLocalPosToGetLocalPos = new TreeMap<>();
Map<GraphPart, Map<Integer, List<Integer>>> partUnresolvedRegisterToGetLocalPos = new HashMap<>();
Map<GraphPart, Map<Integer, Integer>> partRegisterToLastSetLocalPos = new HashMap<>();
@@ -258,10 +259,10 @@ public class AVM2Graph extends Graph {
for (int setLocalPos : setLocalPosToGetLocalPos.keySet()) {
AVM2Instruction ins = avm2code.code.get(setLocalPos);
int regId = ((SetLocalTypeIns) ins.definition).getRegisterId(ins);
logger.fine("set local reg " + regId + " at pos " + (setLocalPos + 1));
logger.log(Level.FINE, "set local reg {0} at pos {1}{2}", new Object[]{regId, setLocalPos, 1});
for (int getLocalPos : setLocalPosToGetLocalPos.get(setLocalPos)) {
logger.fine("- usage at pos " + (getLocalPos + 1));
logger.log(Level.FINE, "- usage at pos {0}{1}", new Object[]{getLocalPos, 1});
}
}
return setLocalPosToGetLocalPos;

View File

@@ -134,7 +134,7 @@ public class ActionIf extends Action {
int jmp = code.adr2pos(targetAddress);
int after = code.adr2pos(getAddress() + length);
if (jmp == -1) {
Logger.getLogger(ActionIf.class.getName()).log(Level.SEVERE, "Invalid IF jump to ofs" + Helper.formatAddress(targetAddress));
Logger.getLogger(ActionIf.class.getName()).log(Level.SEVERE, "Invalid IF jump to ofs{0}", Helper.formatAddress(targetAddress));
ret.add(after);
} else {
ret.add(jmp);

View File

@@ -12,7 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library. */
package com.jpexs.decompiler.flash.action.swf4;
import com.jpexs.decompiler.flash.SWFInputStream;
@@ -125,7 +125,7 @@ public class ActionJump extends Action {
if (ofs == -1) {
int length = getBytesLength();
ofs = code.adr2pos(getAddress() + length);
ofs = code.adr2pos(getAddress() + length);
Logger.getLogger(ActionJump.class.getName()).log(Level.SEVERE, "Invalid jump to ofs{0} from ofs{1}", new Object[]{Helper.formatAddress(targetAddress), Helper.formatAddress(getAddress())});
}
ret.add(ofs);
return ret;

View File

@@ -12,7 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library. */
package com.jpexs.decompiler.flash.exporters.script;
import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler;
@@ -117,7 +117,7 @@ public class AS2ScriptExporter {
try {
executor.shutdown();
if (!executor.awaitTermination(Configuration.exportTimeout.get(), TimeUnit.SECONDS)) {
if (!executor.awaitTermination(Configuration.exportTimeout.get(), TimeUnit.SECONDS)) {
logger.log(Level.SEVERE, "{0} ActionScript export limit reached", Helper.formatTimeToText(Configuration.exportTimeout.get()));
}
} catch (InterruptedException ex) {
} finally {

View File

@@ -430,7 +430,7 @@ public class AS3ScriptExporter {
try {
executor.shutdown();
if (!executor.awaitTermination(Configuration.exportTimeout.get(), TimeUnit.SECONDS)) {
logger.log(Level.SEVERE, Helper.formatTimeToText(Configuration.exportTimeout.get()) + " ActionScript export limit reached");
logger.log(Level.SEVERE, "{0} ActionScript export limit reached", Helper.formatTimeToText(Configuration.exportTimeout.get()));
}
} catch (InterruptedException ex) {
} finally {

View File

@@ -12,7 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library. */
package com.jpexs.decompiler.flash.tags.base;
import com.jpexs.decompiler.flash.SWF;
@@ -267,7 +267,7 @@ public abstract class TextTag extends DrawableTag {
}
textHeight = rec.textHeight;
if (font == null) {
if (font == null) {
Logger.getLogger(TextTag.class.getName()).log(Level.SEVERE, "Font with id={0} was not found.", rec.fontId);
continue;
}