string concatenation in logger inspection

This commit is contained in:
Jindra Petřík
2021-02-08 20:15:19 +01:00
parent 2767f77a66
commit ef143d8ede
12 changed files with 22 additions and 21 deletions
@@ -265,7 +265,7 @@ public class DebuggerHandler implements DebugConnectionListener {
public boolean addBreakPoint(String scriptName, int line) {
synchronized (this) {
Logger.getLogger(DebuggerHandler.class
.getName()).log(Level.FINE, "adding bp " + scriptName + ":" + line);
.getName()).log(Level.FINE, "adding bp {0}:{1}", new Object[]{scriptName, line});
if (isBreakpointToRemove(scriptName, line)) {
toRemoveBPointMap.get(scriptName).remove(line);
if (toRemoveBPointMap.get(scriptName).isEmpty()) {
@@ -275,12 +275,12 @@ public class DebuggerHandler implements DebugConnectionListener {
}
if (isBreakpointConfirmed(scriptName, line)) {
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "bp " + scriptName + ":" + line + " already confirmed");
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "bp {0}:{1} already confirmed", new Object[]{scriptName, line});
return true;
}
if (isBreakpointInvalid(scriptName, line)) {
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "bp " + scriptName + ":" + line + " already invalid");
Logger.getLogger(DebuggerHandler.class.getName()).log(Level.FINE, "bp {0}:{1} already invalid", new Object[]{scriptName, line});
return false;
}
if (!toAddBPointMap.containsKey(scriptName)) {
@@ -289,7 +289,7 @@ public class DebuggerHandler implements DebugConnectionListener {
toAddBPointMap.get(scriptName).add(line);
Logger
.getLogger(DebuggerHandler.class
.getName()).log(Level.FINE, "bp " + scriptName + ":" + line + " added to todo");
.getName()).log(Level.FINE, "bp {0}:{1} added to todo", new Object[]{scriptName, line});
}
try {
sendBreakPoints(false);
@@ -2224,14 +2224,14 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
@Override
public boolean handle(TextTag textTag) {
String msg = translate("error.text.import");
logger.log(Level.SEVERE, msg + getTextTagInfo(textTag));
logger.log(Level.SEVERE, "{0}{1}", new Object[]{msg, getTextTagInfo(textTag)});
return View.showConfirmDialog(MainPanel.this, msg, translate("error"), JOptionPane.OK_CANCEL_OPTION, showAgainImportError, JOptionPane.OK_OPTION) != JOptionPane.OK_OPTION;
}
@Override
public boolean handle(TextTag textTag, String message, long line) {
String msg = translate("error.text.invalid.continue").replace("%text%", message).replace("%line%", Long.toString(line));
logger.log(Level.SEVERE, msg + getTextTagInfo(textTag));
logger.log(Level.SEVERE, "{0}{1}", new Object[]{msg, getTextTagInfo(textTag)});
return View.showConfirmDialog(MainPanel.this, msg, translate("error"), JOptionPane.OK_CANCEL_OPTION, showAgainInvalidText, JOptionPane.OK_OPTION) != JOptionPane.OK_OPTION;
}
});
@@ -73,7 +73,7 @@ public class Win32ProcessTools extends ProcessTools {
mbi = new MEMORY_BASIC_INFORMATION();
BaseTSD.SIZE_T t = Kernel32.INSTANCE.VirtualQueryEx(hOtherProcess, lpMem, mbi, new BaseTSD.SIZE_T(mbi.size()));
if (t.longValue() == 0) {
Logger.getLogger(Win32ProcessTools.class.getName()).log(Level.SEVERE, "Cannot get page ranges. Last error:" + Kernel32.INSTANCE.GetLastError());
Logger.getLogger(Win32ProcessTools.class.getName()).log(Level.SEVERE, "Cannot get page ranges. Last error:{0}", Kernel32.INSTANCE.GetLastError());
break;
}
ret.add(mbi);