5423 address codacy complaints

This commit is contained in:
William Schaefer 2019-09-04 17:46:52 -04:00
parent b1f8f630be
commit 8aba6c9d9e
8 changed files with 25 additions and 14 deletions

View File

@ -116,7 +116,7 @@ class FileSearch {
// Sort and group the results // Sort and group the results
searchResults.sortGroupsAndFiles(); searchResults.sortGroupsAndFiles();
LinkedHashMap<String, List<ResultFile>> resultHashMap = searchResults.toLinkedHashMap(); Map<String, List<ResultFile>> resultHashMap = searchResults.toLinkedHashMap();
for (String groupName : resultHashMap.keySet()) { for (String groupName : resultHashMap.keySet()) {
groupCache.put(groupName, resultHashMap.get(groupName)); groupCache.put(groupName, resultHashMap.get(groupName));
} }
@ -251,7 +251,7 @@ class FileSearch {
// Collect everything in the search results // Collect everything in the search results
SearchResults searchResults = new SearchResults(groupSortingType, groupAttributeType, fileSortingMethod); SearchResults searchResults = new SearchResults(groupSortingType, groupAttributeType, fileSortingMethod);
searchResults.add(resultFiles); searchResults.add(resultFiles);
LinkedHashMap<String, List<ResultFile>> resultHashMap = searchResults.toLinkedHashMap(); Map<String, List<ResultFile>> resultHashMap = searchResults.toLinkedHashMap();
for (String groupName : resultHashMap.keySet()) { for (String groupName : resultHashMap.keySet()) {
groupCache.put(groupName, resultHashMap.get(groupName)); groupCache.put(groupName, resultHashMap.get(groupName));
} }

View File

@ -43,6 +43,10 @@
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="thumbnailPanel"> <Container class="javax.swing.JPanel" name="thumbnailPanel">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents> <SubComponents>

View File

@ -49,7 +49,7 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
thumbnailPanel = new javax.swing.JPanel(); javax.swing.JPanel thumbnailPanel = new javax.swing.JPanel();
thumbnailLabel = new javax.swing.JLabel(); thumbnailLabel = new javax.swing.JLabel();
fileSizeLabel = new javax.swing.JLabel(); fileSizeLabel = new javax.swing.JLabel();
countLabel = new javax.swing.JLabel(); countLabel = new javax.swing.JLabel();
@ -87,7 +87,6 @@ public class ImageThumbnailPanel extends javax.swing.JPanel implements ListCellR
private javax.swing.JLabel countLabel; private javax.swing.JLabel countLabel;
private javax.swing.JLabel fileSizeLabel; private javax.swing.JLabel fileSizeLabel;
private javax.swing.JLabel thumbnailLabel; private javax.swing.JLabel thumbnailLabel;
private javax.swing.JPanel thumbnailPanel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
@NbBundle.Messages({"# {0} - fileSize", @NbBundle.Messages({"# {0} - fileSize",

View File

@ -18,6 +18,8 @@
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="thumbnailListScrollPane"> <Container class="javax.swing.JScrollPane" name="thumbnailListScrollPane">
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>
<Constraints> <Constraints>

View File

@ -50,7 +50,7 @@ public class ImageThumbnailViewer extends javax.swing.JPanel {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
thumbnailListScrollPane = new javax.swing.JScrollPane(); javax.swing.JScrollPane thumbnailListScrollPane = new javax.swing.JScrollPane();
thumbnailList = new javax.swing.JList<>(); thumbnailList = new javax.swing.JList<>();
setLayout(new java.awt.BorderLayout()); setLayout(new java.awt.BorderLayout());
@ -68,7 +68,6 @@ public class ImageThumbnailViewer extends javax.swing.JPanel {
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JList<ImageThumbnailWrapper> thumbnailList; private javax.swing.JList<ImageThumbnailWrapper> thumbnailList;
private javax.swing.JScrollPane thumbnailListScrollPane;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
/** /**

View File

@ -238,10 +238,18 @@
<Dimension value="[777, 125]"/> <Dimension value="[777, 125]"/>
</Property> </Property>
</Properties> </Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="instancesPanel"> <Container class="javax.swing.JPanel" name="instancesPanel">
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/> <JSplitPaneConstraints position="right"/>
@ -269,6 +277,8 @@
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="instancesScrollPane"> <Container class="javax.swing.JScrollPane" name="instancesScrollPane">
<AuxValues> <AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues> </AuxValues>

View File

@ -313,9 +313,9 @@ public class ResultsPanel extends javax.swing.JPanel {
javax.swing.JLabel gotoPageLabel = new javax.swing.JLabel(); javax.swing.JLabel gotoPageLabel = new javax.swing.JLabel();
gotoPageField = new javax.swing.JTextField(); gotoPageField = new javax.swing.JTextField();
javax.swing.JLabel pageSizeLabel = new javax.swing.JLabel(); javax.swing.JLabel pageSizeLabel = new javax.swing.JLabel();
resultsSplitPane = new javax.swing.JSplitPane(); javax.swing.JSplitPane resultsSplitPane = new javax.swing.JSplitPane();
instancesPanel = new javax.swing.JPanel(); javax.swing.JPanel instancesPanel = new javax.swing.JPanel();
instancesScrollPane = new javax.swing.JScrollPane(); javax.swing.JScrollPane instancesScrollPane = new javax.swing.JScrollPane();
instancesList = new javax.swing.JList<>(); instancesList = new javax.swing.JList<>();
resultsViewerPanel = new javax.swing.JPanel(); resultsViewerPanel = new javax.swing.JPanel();
@ -540,13 +540,10 @@ public class ResultsPanel extends javax.swing.JPanel {
private javax.swing.JLabel currentPageLabel; private javax.swing.JLabel currentPageLabel;
private javax.swing.JTextField gotoPageField; private javax.swing.JTextField gotoPageField;
private javax.swing.JList<AbstractFile> instancesList; private javax.swing.JList<AbstractFile> instancesList;
private javax.swing.JPanel instancesPanel;
private javax.swing.JScrollPane instancesScrollPane;
private javax.swing.JButton nextPageButton; private javax.swing.JButton nextPageButton;
private javax.swing.JSpinner pageSizeSpinner; private javax.swing.JSpinner pageSizeSpinner;
private javax.swing.JPanel pagingPanel; private javax.swing.JPanel pagingPanel;
private javax.swing.JButton previousPageButton; private javax.swing.JButton previousPageButton;
private javax.swing.JSplitPane resultsSplitPane;
private javax.swing.JPanel resultsViewerPanel; private javax.swing.JPanel resultsViewerPanel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables

View File

@ -150,8 +150,8 @@ class SearchResults {
* *
* @return the grouped and sorted results * @return the grouped and sorted results
*/ */
LinkedHashMap<String, List<ResultFile>> toLinkedHashMap() throws FileSearchException { Map<String, List<ResultFile>> toLinkedHashMap() throws FileSearchException {
LinkedHashMap<String, List<ResultFile>> map = new LinkedHashMap<>(); Map<String, List<ResultFile>> map = new LinkedHashMap<>();
// Sort the groups and files // Sort the groups and files
sortGroupsAndFiles(); sortGroupsAndFiles();