JAL-3032 avoid assignments on the same line as synchronized
[jalview.git] / src / jalview / gui / PaintRefresher.java
index ced5544..54fe488 100755 (executable)
@@ -39,7 +39,7 @@ import java.util.Map;
  */
 public class PaintRefresher
 {
-  static Map<String, List<Component>> components = new HashMap<String, List<Component>>();
+  static Map<String, List<Component>> components = new HashMap<>();
 
   /**
    * Add the given component to those registered under the given sequence set
@@ -60,7 +60,7 @@ public class PaintRefresher
     }
     else
     {
-      List<Component> vcoms = new ArrayList<Component>();
+      List<Component> vcoms = new ArrayList<>();
       vcoms.add(comp);
       components.put(seqSetId, vcoms);
     }
@@ -186,8 +186,8 @@ public class PaintRefresher
             System.err.println(
                     "IMPLEMENTATION PROBLEM: DATASET out of sync due to an insert whilst calling PaintRefresher.validateSequences(AlignmentI, ALignmentI)");
           }
-          List<SequenceI> alsq;
-          synchronized (alsq = comp.getSequences())
+          List<SequenceI> alsq = comp.getSequences();
+          synchronized (alsq)
           {
             alsq.add(i, a1[i]);
           }
@@ -240,7 +240,7 @@ public class PaintRefresher
     {
       return new AlignmentPanel[0];
     }
-    List<AlignmentPanel> tmp = new ArrayList<AlignmentPanel>();
+    List<AlignmentPanel> tmp = new ArrayList<>();
     for (Component comp : comps)
     {
       if (comp instanceof AlignmentPanel)