Ignore:
Timestamp:
2016-05-11T02:44:10+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:AssignmentInSubExpressionCheck - Assignments should not be made from within sub-expressions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java

    r9609 r10179  
    4747    private static class CodeSelectionPanel extends JPanel implements ListSelectionListener, DocumentListener {
    4848
    49         public JosmTextField filter;
    50         private ProjectionCodeListModel model;
     49        public final JosmTextField filter = new JosmTextField(30);
     50        private final ProjectionCodeListModel model = new ProjectionCodeListModel();
    5151        public JList<String> selectionList;
    5252        private final List<String> data;
     
    8989
    9090        private void build() {
    91             filter = new JosmTextField(30);
    9291            filter.setColumns(10);
    9392            filter.getDocument().addDocumentListener(this);
    9493
    9594            selectionList = new JList<>(data.toArray(new String[0]));
    96             selectionList.setModel(model = new ProjectionCodeListModel());
     95            selectionList.setModel(model);
    9796            JScrollPane scroll = new JScrollPane(selectionList);
    9897            scroll.setPreferredSize(new Dimension(200, 214));
     
    105104        public String getCode() {
    106105            int idx = selectionList.getSelectedIndex();
    107             if (idx == -1) return lastCode;
     106            if (idx == -1)
     107                return lastCode;
    108108            return filteredData.get(selectionList.getSelectedIndex());
    109109        }
     
    174174                if (matcher2.matches()) {
    175175                    int cmp1 = matcher1.group(1).compareTo(matcher2.group(1));
    176                     if (cmp1 != 0) return cmp1;
     176                    if (cmp1 != 0)
     177                        return cmp1;
    177178                    int num1 = Integer.parseInt(matcher1.group(2));
    178179                    int num2 = Integer.parseInt(matcher2.group(2));
Note: See TracChangeset for help on using the changeset viewer.