Fix Overzealous Final Usage

This commit is contained in:
Konloch 2024-08-21 09:26:54 -06:00
parent 6f96b0d4f4
commit c02116fb56

AI 샘플 코드 생성 중입니다

Loading...
45 changed files with 137 additions and 157 deletions

View File

@ -522,7 +522,7 @@ public class BytecodeViewer
* @param files the file(s) you wish to open * @param files the file(s) you wish to open
* @param recentFiles if it should append to the recent files menu * @param recentFiles if it should append to the recent files menu
*/ */
public static void openFiles(final File[] files, boolean recentFiles) public static void openFiles(File[] files, boolean recentFiles)
{ {
if (recentFiles) if (recentFiles)
{ {

View File

@ -143,8 +143,7 @@ public final class ASMResourceUtil
} }
} }
public static void renameClassNode(final String oldName, public static void renameClassNode(String oldName, String newName)
final String newName)
{ {
for (ClassNode c : BytecodeViewer.getLoadedClasses()) for (ClassNode c : BytecodeViewer.getLoadedClasses())
{ {

View File

@ -32,7 +32,7 @@ public class ASMUtil
/** /**
* Creates a new ClassNode instances from the provided byte[] * Creates a new ClassNode instances from the provided byte[]
*/ */
public static ClassNode bytesToNode(final byte[] b) public static ClassNode bytesToNode(byte[] b)
{ {
ClassReader cr = new ClassReader(b); ClassReader cr = new ClassReader(b);
ClassNode cn = new ClassNode(); ClassNode cn = new ClassNode();

View File

@ -118,7 +118,7 @@ public class LibraryClassLoader extends ClassLoader implements ILoader<JarConten
} }
@Override @Override
protected String getCommonSuperClass(final String type1, final String type2) { protected String getCommonSuperClass(String type1, String type2) {
ClassNode ccn = classTree.getClass(type1); ClassNode ccn = classTree.getClass(type1);
ClassNode dcn = classTree.getClass(type2); ClassNode dcn = classTree.getClass(type2);

View File

@ -56,7 +56,7 @@ public class SmaliAssembler extends InternalCompiler
try { try {
DiskWriter.replaceFile(tempSmali.getAbsolutePath(), contents, false); DiskWriter.replaceFile(tempSmali.getAbsolutePath(), contents, false);
} catch (final Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
//BytecodeViewer.handleException(e); //BytecodeViewer.handleException(e);
} }

View File

@ -67,7 +67,7 @@ public class FernFlowerDecompiler extends InternalDecompiler
} }
@Override @Override
public String decompileClassNode(final ClassNode cn, byte[] b) public String decompileClassNode(ClassNode cn, byte[] b)
{ {
String start = tempDirectory + fs + MiscUtils.getUniqueName("", ".class"); String start = tempDirectory + fs + MiscUtils.getUniqueName("", ".class");
@ -76,7 +76,7 @@ public class FernFlowerDecompiler extends InternalDecompiler
String exception = ""; String exception = "";
try (FileOutputStream fos = new FileOutputStream(tempClass)) { try (FileOutputStream fos = new FileOutputStream(tempClass)) {
fos.write(b); fos.write(b);
} catch (final IOException e) { } catch (IOException e) {
StringWriter exceptionWriter = new StringWriter(); StringWriter exceptionWriter = new StringWriter();
e.printStackTrace(new PrintWriter(exceptionWriter)); e.printStackTrace(new PrintWriter(exceptionWriter));
e.printStackTrace(); e.printStackTrace();

View File

@ -58,7 +58,7 @@ public class JADXDecompiler extends InternalDecompiler
try (FileOutputStream fos = new FileOutputStream(tempClass)) { try (FileOutputStream fos = new FileOutputStream(tempClass)) {
fos.write(b); fos.write(b);
} catch (final IOException e) { } catch (IOException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }

View File

@ -75,7 +75,7 @@ public class JDGUIDecompiler extends InternalDecompiler
try (FileOutputStream fos = new FileOutputStream(tempClass)) { try (FileOutputStream fos = new FileOutputStream(tempClass)) {
fos.write(b); fos.write(b);
} catch (final IOException e) { } catch (IOException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }

View File

@ -100,7 +100,7 @@ public class ProcyonDecompiler extends InternalDecompiler {
try (FileOutputStream fos = new FileOutputStream(tempClass)) { try (FileOutputStream fos = new FileOutputStream(tempClass)) {
fos.write(b); fos.write(b);
} catch (final IOException e) { } catch (IOException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }
@ -237,9 +237,8 @@ public class ProcyonDecompiler extends InternalDecompiler {
} }
@Override @Override
public boolean tryLoadType(final String internalName, public boolean tryLoadType(String internalName, Buffer buffer) {
final Buffer buffer) { for (ITypeLoader typeLoader : _typeLoaders) {
for (final ITypeLoader typeLoader : _typeLoaders) {
if (typeLoader.tryLoadType(internalName, buffer)) { if (typeLoader.tryLoadType(internalName, buffer)) {
return true; return true;
} }

View File

@ -65,7 +65,7 @@ public class SmaliDisassembler extends InternalDecompiler
try (FileOutputStream fos = new FileOutputStream(tempClass)) { try (FileOutputStream fos = new FileOutputStream(tempClass)) {
fos.write(b); fos.write(b);
} catch (final IOException e) { } catch (IOException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }

View File

@ -868,7 +868,7 @@ public class MainViewerGUI extends JFrame
}); });
} }
public synchronized void updateBusyStatus(final boolean busy) public synchronized void updateBusyStatus(boolean busy)
{ {
SwingUtilities.invokeLater(() -> SwingUtilities.invokeLater(() ->
{ {

View File

@ -30,7 +30,7 @@ import javax.swing.AbstractButton;
public class ButtonHoverAnimation extends MouseAdapter public class ButtonHoverAnimation extends MouseAdapter
{ {
@Override @Override
public void mouseEntered(final MouseEvent e) public void mouseEntered(MouseEvent e)
{ {
final Component component = e.getComponent(); final Component component = e.getComponent();
if (component instanceof AbstractButton) if (component instanceof AbstractButton)
@ -41,7 +41,7 @@ public class ButtonHoverAnimation extends MouseAdapter
} }
@Override @Override
public void mouseExited(final MouseEvent e) public void mouseExited(MouseEvent e)
{ {
final Component component = e.getComponent(); final Component component = e.getComponent();
if (component instanceof AbstractButton) if (component instanceof AbstractButton)

View File

@ -36,7 +36,7 @@ import the.bytecode.club.bytecodeviewer.util.JarUtils;
public class ExportJar extends JFrame public class ExportJar extends JFrame
{ {
public ExportJar(final String jarPath) public ExportJar(String jarPath)
{ {
setSize(new Dimension(250, 277)); setSize(new Dimension(250, 277));
setResizable(false); setResizable(false);

View File

@ -123,7 +123,7 @@ public class JFrameConsole extends JFrame
/** /**
* Trims the console text to prevent killing the swing thread * Trims the console text to prevent killing the swing thread
*/ */
public String trimConsoleText(final String s) public String trimConsoleText(String s)
{ {
int len = s.length(); int len = s.length();

View File

@ -35,7 +35,7 @@ import the.bytecode.club.bytecodeviewer.resources.IconResources;
public abstract class VisibleComponent extends JInternalFrame public abstract class VisibleComponent extends JInternalFrame
{ {
public VisibleComponent(final String title) public VisibleComponent(String title)
{ {
super(title, false, false, false, false); super(title, false, false, false, false);
this.setDefaultIcon(); this.setDefaultIcon();

View File

@ -762,7 +762,7 @@ public class ValuesPanel extends javax.swing.JPanel {
} }
} }
private void scheduleNextStep(final ValuesPanelField valuesPanelField) { private void scheduleNextStep(ValuesPanelField valuesPanelField) {
SwingUtilities.invokeLater(() -> updateValue(valuesPanelField)); SwingUtilities.invokeLater(() -> updateValue(valuesPanelField));
} }
@ -770,7 +770,7 @@ public class ValuesPanel extends javax.swing.JPanel {
return updateInProgress; return updateInProgress;
} }
private void updateValue(final ValuesPanelField valuesPanelField) { private void updateValue(ValuesPanelField valuesPanelField) {
if (valuesPanelField.ordinal() == 0) { if (valuesPanelField.ordinal() == 0) {
long dataSize = codeArea.getDataSize(); long dataSize = codeArea.getDataSize();
clearFields = dataPosition >= dataSize; clearFields = dataPosition >= dataSize;

View File

@ -134,7 +134,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
} }
@Override @Override
public void filesDropped(final File[] files) public void filesDropped(File[] files)
{ {
if (files.length < 1) if (files.length < 1)
return; return;
@ -204,7 +204,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
if (!container.resourceFiles.isEmpty()) if (!container.resourceFiles.isEmpty())
{ {
for (final Entry<String, byte[]> entry : container.resourceFiles.entrySet()) for (Entry<String, byte[]> entry : container.resourceFiles.entrySet())
{ {
String name = entry.getKey(); String name = entry.getKey();
final String[] spl = name.split("/"); final String[] spl = name.split("/");
@ -215,7 +215,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
else else
{ {
ResourceTreeNode parent = root; ResourceTreeNode parent = root;
for (final String s : spl) for (String s : spl)
{ {
ResourceTreeNode child = parent.getChildByUserObject(s); ResourceTreeNode child = parent.getChildByUserObject(s);
@ -233,14 +233,13 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public void expandAll(final JTree tree, final TreePath parent, public void expandAll(JTree tree, TreePath parent, boolean expand) {
final boolean expand) {
// Traverse children // Traverse children
final TreeNode node = (TreeNode) parent.getLastPathComponent(); final TreeNode node = (TreeNode) parent.getLastPathComponent();
if (node.getChildCount() >= 0) { if (node.getChildCount() >= 0) {
for (final Enumeration e = node.children(); e.hasMoreElements(); ) { for (Enumeration e = node.children(); e.hasMoreElements(); ) {
final TreeNode n = (TreeNode) e.nextElement(); TreeNode n = (TreeNode) e.nextElement();
final TreePath path = parent.pathByAddingChild(n); TreePath path = parent.pathByAddingChild(n);
expandAll(tree, path, expand); expandAll(tree, path, expand);
} }
} }
@ -253,7 +252,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
} }
} }
public void removeNode(final JTree tree, final TreePath nodePath) public void removeNode(JTree tree, TreePath nodePath)
{ {
MutableTreeNode node = findNodeByPath(nodePath); MutableTreeNode node = findNodeByPath(nodePath);
@ -542,7 +541,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
quickSearch.addFocusListener(new FocusListener() quickSearch.addFocusListener(new FocusListener()
{ {
@Override @Override
public void focusGained(final FocusEvent arg0) public void focusGained(FocusEvent arg0)
{ {
if (quickSearch.getText().equals(TranslatedStrings.QUICK_FILE_SEARCH_NO_FILE_EXTENSION.toString())) if (quickSearch.getText().equals(TranslatedStrings.QUICK_FILE_SEARCH_NO_FILE_EXTENSION.toString()))
{ {
@ -554,7 +553,7 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
} }
@Override @Override
public void focusLost(final FocusEvent arg0) public void focusLost(FocusEvent arg0)
{ {
if (quickSearch.getText().isEmpty()) if (quickSearch.getText().isEmpty())
{ {

View File

@ -36,7 +36,7 @@ public class ResourceTree extends JTree
private static final long serialVersionUID = -2355167326094772096L; private static final long serialVersionUID = -2355167326094772096L;
DefaultMutableTreeNode treeRoot; DefaultMutableTreeNode treeRoot;
public ResourceTree(final DefaultMutableTreeNode treeRoot) public ResourceTree(DefaultMutableTreeNode treeRoot)
{ {
super(treeRoot); super(treeRoot);
this.treeRoot = treeRoot; this.treeRoot = treeRoot;
@ -45,7 +45,7 @@ public class ResourceTree extends JTree
StringMetricsUtil m = null; StringMetricsUtil m = null;
@Override @Override
public void paint(final Graphics graphics) public void paint(Graphics graphics)
{ {
try try
{ {

View File

@ -36,13 +36,13 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
private static final int CHILD_MAP_BUILD_THRESHOLD = 3; private static final int CHILD_MAP_BUILD_THRESHOLD = 3;
private HashMap<Object, ResourceTreeNode> userObjectToChildMap = null; private HashMap<Object, ResourceTreeNode> userObjectToChildMap = null;
public ResourceTreeNode(final Object o) public ResourceTreeNode(Object o)
{ {
super(o); super(o);
} }
@Override @Override
public void insert(final MutableTreeNode newChild, final int childIndex) public void insert(MutableTreeNode newChild, int childIndex)
{ {
super.insert(newChild, childIndex); super.insert(newChild, childIndex);
addToMap((ResourceTreeNode) newChild); addToMap((ResourceTreeNode) newChild);
@ -54,7 +54,7 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void recursiveSort(final ResourceTreeNode node) private void recursiveSort(ResourceTreeNode node)
{ {
node.children.sort(nodeComparator); node.children.sort(nodeComparator);
for (TreeNode nextNode : (Iterable<TreeNode>) node.children) for (TreeNode nextNode : (Iterable<TreeNode>) node.children)
@ -145,7 +145,7 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
protected Comparator<TreeNode> nodeComparator = new Comparator<TreeNode>() protected Comparator<TreeNode> nodeComparator = new Comparator<TreeNode>()
{ {
@Override @Override
public int compare(final TreeNode o1, final TreeNode o2) public int compare(TreeNode o1, TreeNode o2)
{ {
// To make sure nodes with children are always on top // To make sure nodes with children are always on top
final int firstOffset = o1.getChildCount() > 0 ? -1000 : 0; final int firstOffset = o1.getChildCount() > 0 ? -1000 : 0;
@ -155,7 +155,7 @@ public class ResourceTreeNode extends DefaultMutableTreeNode
} }
@Override @Override
public boolean equals(final Object obj) public boolean equals(Object obj)
{ {
return false; return false;
} }

View File

@ -41,7 +41,7 @@ public class SearchKeyAdapter extends KeyAdapter
} }
@Override @Override
public void keyPressed(final KeyEvent ke) public void keyPressed(KeyEvent ke)
{ {
//only trigger on enter //only trigger on enter
if (ke.getKeyCode() != KeyEvent.VK_ENTER) if (ke.getKeyCode() != KeyEvent.VK_ENTER)

View File

@ -76,7 +76,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent
DefaultComboBoxModel<SearchRadius> radiusModel = new DefaultComboBoxModel<>(); DefaultComboBoxModel<SearchRadius> radiusModel = new DefaultComboBoxModel<>();
for (final SearchRadius st : SEARCH_RADII) for (SearchRadius st : SEARCH_RADII)
radiusModel.addElement(st); radiusModel.addElement(st);
searchRadiusBox = new JComboBox<>(radiusModel); searchRadiusBox = new JComboBox<>(radiusModel);
@ -84,7 +84,7 @@ public class SearchBoxPane extends TranslatedVisibleComponent
searchOpts.add(searchRadiusOpt); searchOpts.add(searchRadiusOpt);
DefaultComboBoxModel<SearchType> typeModel = new DefaultComboBoxModel<>(); DefaultComboBoxModel<SearchType> typeModel = new DefaultComboBoxModel<>();
for (final SearchType st : SEARCH_TYPES) for (SearchType st : SEARCH_TYPES)
typeModel.addElement(st); typeModel.addElement(st);
typeBox = new JComboBox<>(typeModel); typeBox = new JComboBox<>(typeModel);

View File

@ -36,7 +36,7 @@ public enum SearchType
public final SearchPanel panel; public final SearchPanel panel;
SearchType(final SearchPanel panel) SearchType(SearchPanel panel)
{ {
this.panel = panel; this.panel = panel;
} }

View File

@ -12,7 +12,7 @@ public class CloseButtonComponent extends JPanel {
private final JTabbedPane pane; private final JTabbedPane pane;
public CloseButtonComponent(final JTabbedPane pane) { public CloseButtonComponent(JTabbedPane pane) {
super(new FlowLayout(FlowLayout.LEFT, 0, 0)); super(new FlowLayout(FlowLayout.LEFT, 0, 0));
if (pane == null) { if (pane == null) {
throw new NullPointerException("TabbedPane is null"); throw new NullPointerException("TabbedPane is null");

View File

@ -238,7 +238,7 @@ public class DraggableTabbedPane extends JTabbedPane {
public void dropActionChanged(DropTargetDragEvent e) { public void dropActionChanged(DropTargetDragEvent e) {
} }
public void dragOver(final DropTargetDragEvent e) { public void dragOver(DropTargetDragEvent e) {
TabTransferData data = getTabTransferData(e); TabTransferData data = getTabTransferData(e);
if (data == null) return; if (data == null) return;

View File

@ -69,7 +69,7 @@ public class TabExitButton extends JButton implements ActionListener {
} }
@Override @Override
public void actionPerformed(final ActionEvent e) { public void actionPerformed(ActionEvent e) {
final int i = tabbedPane.tabs.indexOfTabComponent(tabbedPane); final int i = tabbedPane.tabs.indexOfTabComponent(tabbedPane);
if (i != -1) { if (i != -1) {
tabbedPane.tabs.remove(i); tabbedPane.tabs.remove(i);
@ -83,7 +83,7 @@ public class TabExitButton extends JButton implements ActionListener {
// paint the cross // paint the cross
@Override @Override
protected void paintComponent(final Graphics g) { protected void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
final Graphics2D g2 = (Graphics2D) g.create(); final Graphics2D g2 = (Graphics2D) g.create();
// shift the image for pressed buttons // shift the image for pressed buttons

View File

@ -47,7 +47,7 @@ public class TabbedPane extends JPanel {
public final static MouseListener buttonHoverAnimation = new ButtonHoverAnimation(); public final static MouseListener buttonHoverAnimation = new ButtonHoverAnimation();
public static final Color BLANK_COLOR = new Color(0, 0, 0, 0); public static final Color BLANK_COLOR = new Color(0, 0, 0, 0);
public TabbedPane(int tabIndex, String tabWorkingName, String fileContainerName, String name, final JTabbedPane existingTabs, ResourceViewer resource) { public TabbedPane(int tabIndex, String tabWorkingName, String fileContainerName, String name, JTabbedPane existingTabs, ResourceViewer resource) {
// unset default FlowLayout' gaps // unset default FlowLayout' gaps
super(new FlowLayout(FlowLayout.LEFT, 0, 0)); super(new FlowLayout(FlowLayout.LEFT, 0, 0));

View File

@ -90,16 +90,16 @@ public class Workspace extends TranslatedVisibleComponent {
} }
//load class resources //load class resources
public void addClassResource(final ResourceContainer container, final String name) { public void addClassResource(ResourceContainer container, String name) {
addResource(container, name, new ClassViewer(container, name)); addResource(container, name, new ClassViewer(container, name));
} }
//Load file resources //Load file resources
public void addFileResource(final ResourceContainer container, final String name) { public void addFileResource(ResourceContainer container, String name) {
addResource(container, name, new FileViewer(container, name)); addResource(container, name, new FileViewer(container, name));
} }
private void addResource(final ResourceContainer container, final String name, final ResourceViewer resourceView) { private void addResource(ResourceContainer container, String name, ResourceViewer resourceView) {
// Warn user and prevent 'nothing' from opening if no Decompiler is selected // Warn user and prevent 'nothing' from opening if no Decompiler is selected
if (BytecodeViewer.viewer.viewPane1.getSelectedDecompiler() == Decompiler.NONE && if (BytecodeViewer.viewer.viewPane1.getSelectedDecompiler() == Decompiler.NONE &&
BytecodeViewer.viewer.viewPane2.getSelectedDecompiler() == Decompiler.NONE && BytecodeViewer.viewer.viewPane2.getSelectedDecompiler() == Decompiler.NONE &&

View File

@ -63,7 +63,7 @@ public class ClassViewer extends ResourceViewer
public List<MethodParser> methods = Arrays.asList(new MethodParser(), new MethodParser(), new MethodParser()); public List<MethodParser> methods = Arrays.asList(new MethodParser(), new MethodParser(), new MethodParser());
public ClassViewer(final ResourceContainer container, final String name) public ClassViewer(ResourceContainer container, String name)
{ {
super(new Resource(name, container.getWorkingName(name), container)); super(new Resource(name, container.getWorkingName(name), container));
@ -82,7 +82,7 @@ public class ClassViewer extends ResourceViewer
} }
@Override @Override
public void refresh(final JButton button) public void refresh(JButton button)
{ {
setPanes(); setPanes();
refreshTitle(); refreshTitle();
@ -292,8 +292,7 @@ public class ClassViewer extends ResourceViewer
/** /**
* Whoever wrote this function, THANK YOU! * Whoever wrote this function, THANK YOU!
*/ */
public static JSplitPane setDividerLocation(final JSplitPane splitter, public static JSplitPane setDividerLocation(JSplitPane splitter, double proportion)
final double proportion)
{ {
if (splitter.isShowing()) { if (splitter.isShowing()) {
if (splitter.getWidth() > 0 && splitter.getHeight() > 0) { if (splitter.getWidth() > 0 && splitter.getHeight() > 0) {

View File

@ -56,7 +56,7 @@ public class FileViewer extends ResourceViewer
public boolean canRefresh; public boolean canRefresh;
public int zoomSteps = 0; public int zoomSteps = 0;
public FileViewer(final ResourceContainer container, final String name) public FileViewer(ResourceContainer container, String name)
{ {
super(new Resource(name, container.getWorkingName(name), container)); super(new Resource(name, container.getWorkingName(name), container));

View File

@ -62,7 +62,7 @@ public abstract class ResourceViewer extends JPanel
} }
public abstract void refresh(final JButton button); public abstract void refresh(JButton button);
/** /**
* Updates the tab's title * Updates the tab's title

View File

@ -41,15 +41,13 @@ import the.bytecode.club.bytecodeviewer.Constants;
*/ */
public class RemappingAnnotationAdapter extends AnnotationVisitor { public class RemappingAnnotationAdapter extends AnnotationVisitor {
protected final org.objectweb.asm.commons.Remapper remapper; protected final Remapper remapper;
public RemappingAnnotationAdapter(final AnnotationVisitor av, public RemappingAnnotationAdapter(AnnotationVisitor av, Remapper remapper) {
final org.objectweb.asm.commons.Remapper remapper) {
this(Constants.ASM_VERSION, av, remapper); this(Constants.ASM_VERSION, av, remapper);
} }
protected RemappingAnnotationAdapter(final int api, protected RemappingAnnotationAdapter(int api, AnnotationVisitor av, Remapper remapper) {
final AnnotationVisitor av, final Remapper remapper) {
super(api, av); super(api, av);
this.remapper = remapper; this.remapper = remapper;
} }

View File

@ -48,12 +48,11 @@ public class RemappingClassAdapter extends ClassVisitor {
protected String className; protected String className;
public RemappingClassAdapter(final ClassVisitor cv, final Remapper remapper) { public RemappingClassAdapter(ClassVisitor cv, Remapper remapper) {
this(Constants.ASM_VERSION, cv, remapper); this(Constants.ASM_VERSION, cv, remapper);
} }
protected RemappingClassAdapter(final int api, final ClassVisitor cv, protected RemappingClassAdapter(int api, ClassVisitor cv, Remapper remapper) {
final Remapper remapper) {
super(api, cv); super(api, cv);
this.remapper = remapper; this.remapper = remapper;
} }

View File

@ -45,12 +45,11 @@ public class RemappingFieldAdapter extends FieldVisitor {
private final org.objectweb.asm.commons.Remapper remapper; private final org.objectweb.asm.commons.Remapper remapper;
public RemappingFieldAdapter(final FieldVisitor fv, final org.objectweb.asm.commons.Remapper remapper) { public RemappingFieldAdapter(FieldVisitor fv, org.objectweb.asm.commons.Remapper remapper) {
this(Constants.ASM_VERSION, fv, remapper); this(Constants.ASM_VERSION, fv, remapper);
} }
protected RemappingFieldAdapter(final int api, final FieldVisitor fv, protected RemappingFieldAdapter(int api, FieldVisitor fv, Remapper remapper) {
final Remapper remapper) {
super(api, fv); super(api, fv);
this.remapper = remapper; this.remapper = remapper;
} }

View File

@ -49,13 +49,11 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
protected final org.objectweb.asm.commons.Remapper remapper; protected final org.objectweb.asm.commons.Remapper remapper;
public RemappingMethodAdapter(final int access, final String desc, public RemappingMethodAdapter(int access, String desc, MethodVisitor mv, org.objectweb.asm.commons.Remapper remapper) {
final MethodVisitor mv, final org.objectweb.asm.commons.Remapper remapper) {
this(Constants.ASM_VERSION, access, desc, mv, remapper); this(Constants.ASM_VERSION, access, desc, mv, remapper);
} }
protected RemappingMethodAdapter(final int api, final int access, protected RemappingMethodAdapter(int api, int access, String desc, MethodVisitor mv, Remapper remapper) {
final String desc, final MethodVisitor mv, final Remapper remapper) {
super(api, access, desc, mv); super(api, access, desc, mv);
this.remapper = remapper; this.remapper = remapper;
} }
@ -124,8 +122,7 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
@Deprecated @Deprecated
@Override @Override
public void visitMethodInsn(final int opcode, final String owner, public void visitMethodInsn(int opcode, String owner, String name, String desc) {
final String name, final String desc) {
if (api >= Constants.ASM_VERSION) { if (api >= Constants.ASM_VERSION) {
super.visitMethodInsn(opcode, owner, name, desc); super.visitMethodInsn(opcode, owner, name, desc);
return; return;
@ -135,8 +132,7 @@ public class RemappingMethodAdapter extends LocalVariablesSorter {
} }
@Override @Override
public void visitMethodInsn(final int opcode, final String owner, public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
final String name, final String desc, final boolean itf) {
if (api < Constants.ASM_VERSION) { if (api < Constants.ASM_VERSION) {
super.visitMethodInsn(opcode, owner, name, desc, itf); super.visitMethodInsn(opcode, owner, name, desc, itf);
return; return;

View File

@ -47,13 +47,11 @@ public class RemappingSignatureAdapter extends SignatureVisitor {
private String className; private String className;
public RemappingSignatureAdapter(final SignatureVisitor v, public RemappingSignatureAdapter(SignatureVisitor v, Remapper remapper) {
final org.objectweb.asm.commons.Remapper remapper) {
this(Constants.ASM_VERSION, v, remapper); this(Constants.ASM_VERSION, v, remapper);
} }
protected RemappingSignatureAdapter(final int api, protected RemappingSignatureAdapter(int api, SignatureVisitor v, Remapper remapper) {
final SignatureVisitor v, final Remapper remapper) {
super(api); super(api);
this.v = v; this.v = v;
this.remapper = remapper; this.remapper = remapper;

View File

@ -114,7 +114,7 @@ public class AllatoriStringDecrypter extends Plugin
scanMethodNode(classNode, method); scanMethodNode(classNode, method);
} }
public int readUnsignedShort(byte[] b, final int index) public int readUnsignedShort(byte[] b, int index)
{ {
return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF); return ((b[index] & 0xFF) << 8) | (b[index + 1] & 0xFF);
} }

View File

@ -37,7 +37,7 @@ public class ImportResource implements Runnable
{ {
try try
{ {
for (final File file : files) for (File file : files)
{ {
final String fn = file.getName(); final String fn = file.getName();
System.out.println("Opening..." + file.getAbsolutePath()); System.out.println("Opening..." + file.getAbsolutePath());
@ -60,7 +60,7 @@ public class ImportResource implements Runnable
Import.FILE.getImporter().open(file); Import.FILE.getImporter().open(file);
} }
} }
catch (final Exception e) catch (Exception e)
{ {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }

View File

@ -137,8 +137,7 @@ public class RegexInsnFinder {
private static final String opcodesAnys = buildRegexItems(opcodesAny, false, private static final String opcodesAnys = buildRegexItems(opcodesAny, false,
false); false);
private static String buildRegexItems(final String[] items, private static String buildRegexItems(String[] items, boolean capture, boolean stdRepl) {
final boolean capture, final boolean stdRepl) {
if (items.length == 0) if (items.length == 0)
return "()"; return "()";
StringBuilder result = new StringBuilder((stdRepl ? "\\b" : "") + "(" + (capture ? "" : "?:") StringBuilder result = new StringBuilder((stdRepl ? "\\b" : "") + "(" + (capture ? "" : "?:")
@ -150,11 +149,11 @@ public class RegexInsnFinder {
return result.toString(); return result.toString();
} }
private static String buildRegexItems(final String[] items) { private static String buildRegexItems(String[] items) {
return buildRegexItems(items, true, true); return buildRegexItems(items, true, true);
} }
public static String processRegex(final String regex) { public static String processRegex(String regex) {
String result = regex.trim(); String result = regex.trim();
result = result.replaceAll("\\bANYINSN *", opcodesAnys); result = result.replaceAll("\\bANYINSN *", opcodesAnys);
result = result.replaceAll(opcodesInts result = result.replaceAll(opcodesInts
@ -207,11 +206,11 @@ public class RegexInsnFinder {
private int[] offsets; private int[] offsets;
private String insnString; private String insnString;
public RegexInsnFinder(final ClassNode clazz, final MethodNode method) { public RegexInsnFinder(ClassNode clazz, MethodNode method) {
setMethod(clazz, method); setMethod(clazz, method);
} }
private AbstractInsnNode[] cleanInsn(final InsnList insnList) { private AbstractInsnNode[] cleanInsn(InsnList insnList) {
final List<AbstractInsnNode> il = new ArrayList<>(); final List<AbstractInsnNode> il = new ArrayList<>();
for (AbstractInsnNode node : insnList) { for (AbstractInsnNode node : insnList) {
@ -229,7 +228,7 @@ public class RegexInsnFinder {
public void refresh() { public void refresh() {
origInstructions = cleanInsn(mn.instructions); origInstructions = cleanInsn(mn.instructions);
final List<AbstractInsnNode> il = new ArrayList<>(); final List<AbstractInsnNode> il = new ArrayList<>();
for (final AbstractInsnNode ain : mn.instructions.toArray()) for (AbstractInsnNode ain : mn.instructions.toArray())
if (ain.getOpcode() >= 0) { if (ain.getOpcode() >= 0) {
il.add(ain); il.add(ain);
} }
@ -245,7 +244,7 @@ public class RegexInsnFinder {
throw new UnexpectedException( throw new UnexpectedException(
"Unknown opcode encountered: " "Unknown opcode encountered: "
+ ain.getOpcode()); + ain.getOpcode());
} catch (final UnexpectedException e) { } catch (UnexpectedException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }
} }
@ -262,7 +261,7 @@ public class RegexInsnFinder {
// without building a string of the whole method. // without building a string of the whole method.
public static boolean staticScan(ClassNode node, MethodNode mn, Pattern pattern) { public static boolean staticScan(ClassNode node, MethodNode mn, Pattern pattern) {
final List<AbstractInsnNode> il = new ArrayList<>(); final List<AbstractInsnNode> il = new ArrayList<>();
for (final AbstractInsnNode ain : mn.instructions.toArray()) for (AbstractInsnNode ain : mn.instructions.toArray())
if (ain.getOpcode() >= 0) { if (ain.getOpcode() >= 0) {
il.add(ain); il.add(ain);
} }
@ -273,7 +272,7 @@ public class RegexInsnFinder {
throw new UnexpectedException( throw new UnexpectedException(
"Unknown opcode encountered: " "Unknown opcode encountered: "
+ ain.getOpcode()); + ain.getOpcode());
} catch (final UnexpectedException e) { } catch (UnexpectedException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
} }
} }
@ -326,12 +325,12 @@ public class RegexInsnFinder {
return insnString; return insnString;
} }
public void setMethod(final ClassNode ci, final MethodNode mi) { public void setMethod(ClassNode ci, MethodNode mi) {
this.mn = mi; this.mn = mi;
refresh(); refresh();
} }
private AbstractInsnNode[] makeResult(final int start, final int end) { private AbstractInsnNode[] makeResult(int start, int end) {
int startIndex = 0; int startIndex = 0;
int endIndex = -1; int endIndex = -1;
for (int i = 0; i < offsets.length - 1; i++) { for (int i = 0; i < offsets.length - 1; i++) {
@ -359,13 +358,13 @@ public class RegexInsnFinder {
* @param regex the regular expression * @param regex the regular expression
* @return the matching instructions * @return the matching instructions
*/ */
public AbstractInsnNode[] find(final String regex) { public AbstractInsnNode[] find(String regex) {
try { try {
final Matcher regexMatcher = Pattern.compile(processRegex(regex), final Matcher regexMatcher = Pattern.compile(processRegex(regex),
Pattern.MULTILINE).matcher(insnString); Pattern.MULTILINE).matcher(insnString);
if (regexMatcher.find()) if (regexMatcher.find())
return makeResult(regexMatcher.start(), regexMatcher.end()); return makeResult(regexMatcher.start(), regexMatcher.end());
} catch (final PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
//ignore, they fucked up regex //ignore, they fucked up regex
} }
return new AbstractInsnNode[0]; return new AbstractInsnNode[0];
@ -377,7 +376,7 @@ public class RegexInsnFinder {
* @param regex the regular expression * @param regex the regular expression
* @return a list with all sets of matching instructions * @return a list with all sets of matching instructions
*/ */
public List<AbstractInsnNode[]> findAll(final String regex) { public List<AbstractInsnNode[]> findAll(String regex) {
final List<AbstractInsnNode[]> results = new ArrayList<>(); final List<AbstractInsnNode[]> results = new ArrayList<>();
try { try {
final Matcher regexMatcher = Pattern.compile(processRegex(regex), final Matcher regexMatcher = Pattern.compile(processRegex(regex),
@ -385,7 +384,7 @@ public class RegexInsnFinder {
while (regexMatcher.find()) { while (regexMatcher.find()) {
results.add(makeResult(regexMatcher.start(), regexMatcher.end())); results.add(makeResult(regexMatcher.start(), regexMatcher.end()));
} }
} catch (final PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
BytecodeViewer.handleException(ex); BytecodeViewer.handleException(ex);
} }
return results; return results;
@ -398,7 +397,7 @@ public class RegexInsnFinder {
* @param regex the regular expression * @param regex the regular expression
* @return the groups with matching instructions * @return the groups with matching instructions
*/ */
public AbstractInsnNode[][] findGroups(final String regex) { public AbstractInsnNode[][] findGroups(String regex) {
try { try {
final Matcher regexMatcher = Pattern.compile(processRegex(regex), final Matcher regexMatcher = Pattern.compile(processRegex(regex),
Pattern.MULTILINE).matcher(insnString); Pattern.MULTILINE).matcher(insnString);
@ -411,7 +410,7 @@ public class RegexInsnFinder {
} }
return result; return result;
} }
} catch (final PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
BytecodeViewer.handleException(ex); BytecodeViewer.handleException(ex);
} }
return new AbstractInsnNode[0][0]; return new AbstractInsnNode[0][0];
@ -424,7 +423,7 @@ public class RegexInsnFinder {
* @param regex the regular expression * @param regex the regular expression
* @return a list with all sets of groups with matching instructions * @return a list with all sets of groups with matching instructions
*/ */
public List<AbstractInsnNode[][]> findAllGroups(final String regex) { public List<AbstractInsnNode[][]> findAllGroups(String regex) {
final List<AbstractInsnNode[][]> results = new ArrayList<>(); final List<AbstractInsnNode[][]> results = new ArrayList<>();
try { try {
final Matcher regexMatcher = Pattern.compile(processRegex(regex), final Matcher regexMatcher = Pattern.compile(processRegex(regex),
@ -438,7 +437,7 @@ public class RegexInsnFinder {
} }
results.add(result); results.add(result);
} }
} catch (final PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
BytecodeViewer.handleException(ex); BytecodeViewer.handleException(ex);
} }
return results; return results;

View File

@ -71,8 +71,7 @@ public class LDCSearch implements SearchPanel
return myPanel; return myPanel;
} }
public void search(final ResourceContainer container, final String resourceWorkingName, final ClassNode node, public void search(ResourceContainer container, String resourceWorkingName, ClassNode node, boolean caseSensitive)
boolean caseSensitive)
{ {
final Iterator<MethodNode> methods = node.methods.iterator(); final Iterator<MethodNode> methods = node.methods.iterator();
final String srchText = searchText.getText(); final String srchText = searchText.getText();

View File

@ -63,7 +63,7 @@ public class MemberWithAnnotationSearch implements SearchPanel {
return myPanel; return myPanel;
} }
public void search(final ResourceContainer container, final String resourceWorkingName, final ClassNode node, boolean caseSensitive) { public void search(ResourceContainer container, String resourceWorkingName, ClassNode node, boolean caseSensitive) {
final String srchText = annotation.getText().trim(); final String srchText = annotation.getText().trim();
if (srchText.isEmpty()) return; if (srchText.isEmpty()) return;

View File

@ -143,7 +143,7 @@ public class MethodCallSearch implements SearchPanel
} }
} }
public void found(final ResourceContainer container, final String resourceWorkingName, final ClassNode node, final MethodNode method, final AbstractInsnNode insnNode) public void found(ResourceContainer container, String resourceWorkingName, ClassNode node, MethodNode method, AbstractInsnNode insnNode)
{ {
BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult( BytecodeViewer.viewer.searchBoxPane.treeRoot.add(new LDCSearchTreeNodeResult(
container, container,

View File

@ -73,7 +73,7 @@ public class RegexSearch implements SearchPanel
} }
@Override @Override
public void search(final ResourceContainer container, final String resourceWorkingName, final ClassNode node, boolean exact) public void search(ResourceContainer container, String resourceWorkingName, ClassNode node, boolean exact)
{ {
final Iterator<MethodNode> methods = node.methods.iterator(); final Iterator<MethodNode> methods = node.methods.iterator();
final String srchText = searchText.getText(); final String srchText = searchText.getText();

View File

@ -102,7 +102,7 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final Component c, final Listener listener) { public FileDrop(Component c, Listener listener) {
this(null, // Logging stream this(null, // Logging stream
c, // Drop target c, // Drop target
BorderFactory.createMatteBorder(2, 2, 2, 2, BorderFactory.createMatteBorder(2, 2, 2, 2,
@ -122,8 +122,8 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final Component c, final boolean recursive, public FileDrop(Component c, boolean recursive,
final Listener listener) { Listener listener) {
this(null, // Logging stream this(null, // Logging stream
c, // Drop target c, // Drop target
BorderFactory.createMatteBorder(2, 2, 2, 2, BorderFactory.createMatteBorder(2, 2, 2, 2,
@ -144,8 +144,8 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final PrintStream out, final Component c, public FileDrop(PrintStream out, Component c,
final Listener listener) { Listener listener) {
this(out, // Logging stream this(out, // Logging stream
c, // Drop target c, // Drop target
BorderFactory.createMatteBorder(2, 2, 2, 2, BorderFactory.createMatteBorder(2, 2, 2, 2,
@ -169,8 +169,8 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final PrintStream out, final Component c, public FileDrop(PrintStream out, Component c,
final boolean recursive, final Listener listener) { boolean recursive, Listener listener) {
this(out, // Logging stream this(out, // Logging stream
c, // Drop target c, // Drop target
BorderFactory.createMatteBorder(2, 2, 2, 2, BorderFactory.createMatteBorder(2, 2, 2, 2,
@ -187,8 +187,8 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final Component c, public FileDrop(Component c,
final Border dragBorder, final Listener listener) { Border dragBorder, Listener listener) {
this(null, // Logging stream this(null, // Logging stream
c, // Drop target c, // Drop target
dragBorder, // Drag border dragBorder, // Drag border
@ -208,9 +208,9 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final Component c, public FileDrop(Component c,
final Border dragBorder, Border dragBorder,
final boolean recursive, final Listener listener) { boolean recursive, Listener listener) {
this(null, c, dragBorder, recursive, listener); this(null, c, dragBorder, recursive, listener);
} // end constructor } // end constructor
@ -227,8 +227,8 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final PrintStream out, final Component c, public FileDrop(PrintStream out, Component c,
final Border dragBorder, final Listener listener) { Border dragBorder, Listener listener) {
this(out, // Logging stream this(out, // Logging stream
c, // Drop target c, // Drop target
dragBorder, // Drag border dragBorder, // Drag border
@ -250,14 +250,14 @@ public class FileDrop {
* @param listener Listens for <tt>filesDropped</tt>. * @param listener Listens for <tt>filesDropped</tt>.
* @since 1.0 * @since 1.0
*/ */
public FileDrop(final PrintStream out, final Component c, public FileDrop(PrintStream out, Component c,
final Border dragBorder, Border dragBorder,
final boolean recursive, final Listener listener) { boolean recursive, Listener listener) {
if (supportsDnD()) { // Make a drop listener if (supportsDnD()) { // Make a drop listener
dropListener = new DropTargetListener() { dropListener = new DropTargetListener() {
@Override @Override
public void dragEnter(final DropTargetDragEvent evt) { public void dragEnter(DropTargetDragEvent evt) {
log(out, "FileDrop: dragEnter event."); log(out, "FileDrop: dragEnter event.");
// Is this an acceptable drag event? // Is this an acceptable drag event?
@ -284,7 +284,7 @@ public class FileDrop {
} // end dragEnter } // end dragEnter
@Override @Override
public void dragOver(final DropTargetDragEvent evt) { // This public void dragOver(DropTargetDragEvent evt) { // This
// is // is
// called // called
// continually // continually
@ -301,7 +301,7 @@ public class FileDrop {
} // end dragOver } // end dragOver
@Override @Override
public void drop(final DropTargetDropEvent evt) { public void drop(DropTargetDropEvent evt) {
log(out, "FileDrop: drop event."); log(out, "FileDrop: drop event.");
try { // Get whatever was dropped try { // Get whatever was dropped
final Transferable tr = evt final Transferable tr = evt
@ -380,12 +380,12 @@ public class FileDrop {
// (KDE/Gnome) support added. // (KDE/Gnome) support added.
} // end else: not a file list } // end else: not a file list
} // end try } // end try
catch (final IOException io) { catch (IOException io) {
log(out, "FileDrop: IOException - abort:"); log(out, "FileDrop: IOException - abort:");
BytecodeViewer.handleException(io); BytecodeViewer.handleException(io);
evt.rejectDrop(); evt.rejectDrop();
} // end catch IOException } // end catch IOException
catch (final UnsupportedFlavorException ufe) { catch (UnsupportedFlavorException ufe) {
log(out, log(out,
"FileDrop: UnsupportedFlavorException - abort:"); "FileDrop: UnsupportedFlavorException - abort:");
BytecodeViewer.handleException( BytecodeViewer.handleException(
@ -403,7 +403,7 @@ public class FileDrop {
} // end drop } // end drop
@Override @Override
public void dragExit(final DropTargetEvent evt) { public void dragExit(DropTargetEvent evt) {
log(out, "FileDrop: dragExit event."); log(out, "FileDrop: dragExit event.");
// If it's a Swing component, reset its border // If it's a Swing component, reset its border
if (c instanceof JComponent) { if (c instanceof JComponent) {
@ -447,7 +447,7 @@ public class FileDrop {
.forName("java.awt.dnd.DnDConstants"); .forName("java.awt.dnd.DnDConstants");
support = true; support = true;
} // end try } // end try
catch (final Throwable t) { catch (Throwable t) {
support = false; support = false;
} // end catch } // end catch
supportsDnD = support; supportsDnD = support;
@ -458,8 +458,7 @@ public class FileDrop {
// BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added. // BEGIN 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
private static final String ZERO_CHAR_STRING = "" + (char) 0; private static final String ZERO_CHAR_STRING = "" + (char) 0;
private static File[] createFileArray(final BufferedReader bReader, private static File[] createFileArray(BufferedReader bReader, PrintStream out) {
final PrintStream out) {
try { try {
final java.util.List list = new java.util.ArrayList(); final java.util.List list = new java.util.ArrayList();
java.lang.String line; java.lang.String line;
@ -473,13 +472,13 @@ public class FileDrop {
final File file = new File( final File file = new File(
new java.net.URI(line)); new java.net.URI(line));
list.add(file); list.add(file);
} catch (final Exception ex) { } catch (Exception ex) {
log(out, "Error with " + line + ": " + ex.getMessage()); log(out, "Error with " + line + ": " + ex.getMessage());
} }
} }
return (File[]) list.toArray(new File[0]); return (File[]) list.toArray(new File[0]);
} catch (final IOException ex) { } catch (IOException ex) {
log(out, "FileDrop: IOException"); log(out, "FileDrop: IOException");
} }
return new File[0]; return new File[0];
@ -487,14 +486,13 @@ public class FileDrop {
// END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added. // END 2007-09-12 Nathan Blomquist -- Linux (KDE/Gnome) support added.
private void makeDropTarget(final PrintStream out, private void makeDropTarget(PrintStream out, Component c, boolean recursive) {
final Component c, final boolean recursive) {
// Make drop target // Make drop target
final DropTarget dt = new DropTarget(); final DropTarget dt = new DropTarget();
try { try {
dt.addDropTargetListener(dropListener); dt.addDropTargetListener(dropListener);
} // end try } // end try
catch (final java.util.TooManyListenersException e) { catch (java.util.TooManyListenersException e) {
BytecodeViewer.handleException(e); BytecodeViewer.handleException(e);
log(out, log(out,
"FileDrop: Drop will not work due to previous error. Do you have another listener attached?"); "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
@ -536,8 +534,7 @@ public class FileDrop {
/** /**
* Determine if the dragged data is a file list. * Determine if the dragged data is a file list.
*/ */
private boolean isDragOk(final PrintStream out, private boolean isDragOk(PrintStream out, DropTargetDragEvent evt) {
final DropTargetDragEvent evt) {
boolean ok = false; boolean ok = false;
// Get data flavors being dragged // Get data flavors being dragged
@ -577,7 +574,7 @@ public class FileDrop {
/** /**
* Outputs <tt>message</tt> to <tt>out</tt> if it's not null. * Outputs <tt>message</tt> to <tt>out</tt> if it's not null.
*/ */
private static void log(final PrintStream out, final String message) { // Log private static void log(PrintStream out, String message) { // Log
// message // message
// if // if
// requested // requested
@ -596,7 +593,7 @@ public class FileDrop {
* @param c The component to unregister as a drop target * @param c The component to unregister as a drop target
* @since 1.0 * @since 1.0
*/ */
public static boolean remove(final Component c) { public static boolean remove(Component c) {
return remove(null, c, true); return remove(null, c, true);
} // end remove } // end remove
@ -611,8 +608,7 @@ public class FileDrop {
* @param recursive Recursively unregister components within a container * @param recursive Recursively unregister components within a container
* @since 1.0 * @since 1.0
*/ */
public static boolean remove(final PrintStream out, public static boolean remove(PrintStream out, Component c, boolean recursive) { // Make sure
final Component c, final boolean recursive) { // Make sure
// we // we
// support // support
// //
@ -691,7 +687,7 @@ public class FileDrop {
* @param source The event source * @param source The event source
* @since 1.1 * @since 1.1
*/ */
public Event(final File[] files, final Object source) { public Event(File[] files, Object source) {
super(source); super(source);
this.files = files; this.files = files;
} // end constructor } // end constructor
@ -796,7 +792,7 @@ public class FileDrop {
* @param data The data to transfer * @param data The data to transfer
* @since 1.1 * @since 1.1
*/ */
public TransferableObject(final Object data) { public TransferableObject(Object data) {
this.data = data; this.data = data;
this.customFlavor = new DataFlavor( this.customFlavor = new DataFlavor(
data.getClass(), MIME_TYPE); data.getClass(), MIME_TYPE);
@ -811,7 +807,7 @@ public class FileDrop {
* @see Fetcher * @see Fetcher
* @since 1.1 * @since 1.1
*/ */
public TransferableObject(final Fetcher fetcher) { public TransferableObject(Fetcher fetcher) {
this.fetcher = fetcher; this.fetcher = fetcher;
} // end constructor } // end constructor
@ -829,7 +825,7 @@ public class FileDrop {
* @see Fetcher * @see Fetcher
* @since 1.1 * @since 1.1
*/ */
public TransferableObject(final Class dataClass, final Fetcher fetcher) { public TransferableObject(Class dataClass, Fetcher fetcher) {
this.fetcher = fetcher; this.fetcher = fetcher;
this.customFlavor = new DataFlavor(dataClass, this.customFlavor = new DataFlavor(dataClass,
MIME_TYPE); MIME_TYPE);

View File

@ -67,7 +67,7 @@ public class JarUtils
* @param jarFile the input jar file * @param jarFile the input jar file
* @throws IOException * @throws IOException
*/ */
public static void importArchiveA(final File jarFile) throws IOException public static void importArchiveA(File jarFile) throws IOException
{ {
ResourceContainer container = new ResourceContainer(jarFile); ResourceContainer container = new ResourceContainer(jarFile);
Map<String, byte[]> files = new LinkedHashMap<>(); Map<String, byte[]> files = new LinkedHashMap<>();
@ -118,7 +118,7 @@ public class JarUtils
* @param jarFile the input jar file * @param jarFile the input jar file
* @throws IOException * @throws IOException
*/ */
public static void importArchiveB(final File jarFile) throws IOException public static void importArchiveB(File jarFile) throws IOException
{ {
//if this ever fails, worst case import Sun's jarsigner code from JDK 7 re-sign the jar to rebuild the CRC, //if this ever fails, worst case import Sun's jarsigner code from JDK 7 re-sign the jar to rebuild the CRC,
// should also rebuild the archive byte offsets // should also rebuild the archive byte offsets
@ -160,7 +160,7 @@ public class JarUtils
BytecodeViewer.addResourceContainer(container); BytecodeViewer.addResourceContainer(container);
} }
public static List<ClassNode> loadClasses(final File jarFile) throws IOException public static List<ClassNode> loadClasses(File jarFile) throws IOException
{ {
List<ClassNode> classes = new ArrayList<>(); List<ClassNode> classes = new ArrayList<>();
try (FileInputStream fis = new FileInputStream(jarFile); try (FileInputStream fis = new FileInputStream(jarFile);
@ -200,7 +200,7 @@ public class JarUtils
* @param zipFile the input zip file * @param zipFile the input zip file
* @throws IOException * @throws IOException
*/ */
public static Map<String, byte[]> loadResources(final File zipFile) throws IOException { public static Map<String, byte[]> loadResources(File zipFile) throws IOException {
if (!zipFile.exists()) if (!zipFile.exists())
return new LinkedHashMap<>(); // just ignore (don't return null for null-safety!) return new LinkedHashMap<>(); // just ignore (don't return null for null-safety!)
@ -234,7 +234,7 @@ public class JarUtils
* @param bytez the class file's byte[] * @param bytez the class file's byte[]
* @return the ClassNode instance * @return the ClassNode instance
*/ */
public static ClassNode getNode(final byte[] bytez) public static ClassNode getNode(byte[] bytez)
{ {
//TODO figure out why is this synchronized and if it's actually needed (probably not) //TODO figure out why is this synchronized and if it's actually needed (probably not)
synchronized (LOCK) synchronized (LOCK)

View File

@ -333,7 +333,7 @@ public class MiscUtils
* @return the read byte[] * @return the read byte[]
* @throws IOException * @throws IOException
*/ */
public static byte[] getBytes(final InputStream is) throws IOException public static byte[] getBytes(InputStream is) throws IOException
{ {
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {