X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcommands%2FEditCommand.java;h=b813dcfa13cc6d6a551ff7cb8dd96cf2ef35563e;hb=0ddbb5cb5c0ae3e53d344c624c717d5ca3085d5f;hp=cac843f8488e9877ae5abbdd535e90a497b22fb6;hpb=be762d8d9c71a7aa3121e845c45911c7192b7827;p=jalview.git diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index cac843f..b813dcf 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -114,7 +114,7 @@ public class EditCommand implements CommandI public abstract Action getUndoAction(); }; - private List edits = new ArrayList(); + private List edits = new ArrayList<>(); String description; @@ -605,8 +605,8 @@ public class EditCommand implements CommandI // readd it to the alignment if (command.alIndex[i] < command.al.getHeight()) { - List sequences; - synchronized (sequences = command.al.getSequences()) + List sequences = command.al.getSequences(); + synchronized (sequences) { if (!(command.alIndex[i] < 0)) { @@ -789,7 +789,7 @@ public class EditCommand implements CommandI if (modifyVisibility && !insert) { // only occurs if a sequence was added or deleted. - command.deletedAnnotationRows = new Hashtable(); + command.deletedAnnotationRows = new Hashtable<>(); } if (command.fullAlignmentHeight) { @@ -948,7 +948,7 @@ public class EditCommand implements CommandI if (!insert) { - command.deletedAnnotations = new Hashtable(); + command.deletedAnnotations = new Hashtable<>(); } int aSize; @@ -1138,7 +1138,7 @@ public class EditCommand implements CommandI return; } - List oldsf = new ArrayList(); + List oldsf = new ArrayList<>(); int cSize = j - i; @@ -1196,7 +1196,7 @@ public class EditCommand implements CommandI if (command.editedFeatures == null) { - command.editedFeatures = new Hashtable>(); + command.editedFeatures = new Hashtable<>(); } command.editedFeatures.put(seq, oldsf); @@ -1233,7 +1233,7 @@ public class EditCommand implements CommandI */ public Map priorState(boolean forUndo) { - Map result = new HashMap(); + Map result = new HashMap<>(); if (getEdits() == null) { return result; @@ -1266,7 +1266,7 @@ public class EditCommand implements CommandI * Work backwards through the edit list, deriving the sequences before each * was applied. The final result is the sequence set before any edits. */ - Iterator editList = new ReverseListIterator(getEdits()); + Iterator editList = new ReverseListIterator<>(getEdits()); while (editList.hasNext()) { Edit oldEdit = editList.next(); @@ -1427,7 +1427,7 @@ public class EditCommand implements CommandI } else { - return new ReverseListIterator(getEdits()); + return new ReverseListIterator<>(getEdits()); } } }