some netbeans inspection fixes

This commit is contained in:
honfika@gmail.com
2015-08-11 14:40:56 +02:00
parent 80bf0556fd
commit 427e7ea70d
11 changed files with 26 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ import java.util.logging.Logger;
*/
public class ChromeCache implements CacheImplementation {
private static ChromeCache instance;
private static volatile ChromeCache instance;
private File tempDir;

View File

@@ -33,7 +33,7 @@ import java.util.logging.Logger;
*/
public class FirefoxCache implements CacheImplementation {
private static FirefoxCache instance;
private static volatile FirefoxCache instance;
private FirefoxCache() {
}

View File

@@ -186,8 +186,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
Main.startWork(workText + " \"" + txt + "\"" + decAdd + " - (" + pos + "/" + allpacks.size() + ") " + pack.getClassPath().toString() + "... ", worker);
try {
if (pat.matcher(SWF.getCached(pack).text).find()) {
ABCPanelSearchResult searchResult = new ABCPanelSearchResult();
searchResult.scriptPack = pack;
ABCPanelSearchResult searchResult = new ABCPanelSearchResult(pack);
found.add(searchResult);
}
} catch (InterruptedException ex) {
@@ -655,7 +654,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
@Override
public void updateSearchPos(ABCPanelSearchResult item) {
ScriptPack pack = item.scriptPack;
ScriptPack pack = item.getScriptPack();
setAbc(pack.abc);
decompiledTextArea.setScript(pack);
hilightScript(pack);

View File

@@ -24,7 +24,15 @@ import com.jpexs.decompiler.flash.abc.ScriptPack;
*/
public class ABCPanelSearchResult {
public ScriptPack scriptPack;
private ScriptPack scriptPack;
public ABCPanelSearchResult(ScriptPack scriptPack) {
this.scriptPack = scriptPack;
}
public ScriptPack getScriptPack() {
return scriptPack;
}
@Override
public String toString() {

View File

@@ -411,7 +411,6 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
long highlightOffset = h.getProperties().offset;
List<AVM2Instruction> list = abc.bodies.get(bi).getCode().code;
AVM2Instruction lastIns = null;
long inspos = 0;
AVM2Instruction selIns = null;
for (AVM2Instruction ins : list) {
if (highlightOffset == ins.getOffset()) {
@@ -419,13 +418,13 @@ public class DecompiledEditorPane extends LineMarkedEditorPane implements CaretL
break;
}
if (ins.getOffset() > highlightOffset) {
inspos = highlightOffset - lastIns.offset;
selIns = lastIns;
break;
}
lastIns = ins;
}
if (selIns != null) {
//long inspos = highlightOffset - selIns.offset;
if (!codeOnly && ((selIns.definition instanceof ConstructSuperIns) || (selIns.definition instanceof CallSuperIns) || (selIns.definition instanceof CallSuperVoidIns))) {
Highlighting tc = Highlighting.searchPos(classHighlights, pos);
if (tc != null) {

View File

@@ -858,7 +858,7 @@ public class ActionPanel extends JPanel implements SearchListener<ActionSearchRe
@Override
public void updateSearchPos(ActionSearchResult item) {
TagTreeModel ttm = (TagTreeModel) mainPanel.tagTree.getModel();
TreePath tp = ttm.getTreePath(item.src);
TreePath tp = ttm.getTreePath(item.getSrc());
mainPanel.tagTree.setSelectionPath(tp);
mainPanel.tagTree.scrollPathToVisible(tp);
decompiledEditor.setCaretPosition(0);

View File

@@ -24,15 +24,19 @@ import com.jpexs.decompiler.flash.tags.base.ASMSource;
*/
public class ActionSearchResult {
public ASMSource src;
private ASMSource src;
public String path;
private String path;
public ActionSearchResult(ASMSource src, String path) {
this.src = src;
this.path = path;
}
public ASMSource getSrc() {
return src;
}
@Override
public String toString() {
return path;

View File

@@ -161,11 +161,9 @@ public class Debugger {
ss.setReuseAddress(true);
while (true) {
Socket s = ss.accept();
if (s != null) {
DebugHandler h = new DebugHandler(port, s);
handlers.put(h.id, h);
h.start();
}
DebugHandler h = new DebugHandler(port, s);
handlers.put(h.id, h);
h.start();
}
} catch (IOException ex) {
//ignore

View File

@@ -44,7 +44,7 @@ public class DebuggerTools {
public static final String DEBUGGER_PACKAGE = "com.jpexs.decompiler.flash.debugger";
private static Debugger debugger;
private static volatile Debugger debugger;
private static ScriptPack getDebuggerScriptPack(SWF swf) {
List<ABC> allAbcList = new ArrayList<>();

View File

@@ -184,9 +184,6 @@ public class DumpTree extends JTree {
JFileChooser fc = new JFileChooser();
String selDir = Configuration.lastOpenDir.get();
fc.setCurrentDirectory(new File(selDir));
if (!selDir.endsWith(File.separator)) {
selDir += File.separator;
}
JFrame f = new JFrame();
View.setWindowIcon(f);
if (fc.showSaveDialog(f) == JFileChooser.APPROVE_OPTION) {

View File

@@ -237,7 +237,7 @@ public class LineMarkedEditorPane extends UndoFixedEditorPane implements LinkHan
@Override
public void mouseMoved(MouseEvent e) {
ctrlDown = (e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) > 0;
ctrlDown = (e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0;
lastPos = e.getPoint();
update();