1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
Description: Add JDK9 swing patch
Origin: vendor
Author: tony mancill <tmancill@debian.org>
--- a/src/main/java/net/sf/jabref/gui/FindUnlinkedFilesDialog.java
+++ b/src/main/java/net/sf/jabref/gui/FindUnlinkedFilesDialog.java
@@ -398,8 +398,10 @@ public class FindUnlinkedFilesDialog ext
private void expandTree(JTree currentTree, TreePath parent, boolean expand) {
TreeNode node = (TreeNode) parent.getLastPathComponent();
if (node.getChildCount() >= 0) {
- for (Enumeration<TreeNode> e = node.children(); e.hasMoreElements();) {
- TreePath path = parent.pathByAddingChild(e.nextElement());
+ final Enumeration e = node.children();
+ while (e.hasMoreElements()) {
+ final TreeNode tNode = (TreeNode) e.nextElement();
+ TreePath path = parent.pathByAddingChild(tNode);
expandTree(currentTree, path, expand);
}
}
@@ -637,9 +639,10 @@ public class FindUnlinkedFilesDialog ext
*/
private List<File> getFileListFromNode(CheckableTreeNode node) {
List<File> filesList = new ArrayList<>();
- Enumeration<CheckableTreeNode> children = node.depthFirstEnumeration();
+ final Enumeration children = node.depthFirstEnumeration();
List<CheckableTreeNode> nodesToRemove = new ArrayList<>();
- for (CheckableTreeNode child : Collections.list(children)) {
+ while (children.hasMoreElements()) {
+ final CheckableTreeNode child = (CheckableTreeNode) children.nextElement();
if (child.isLeaf() && child.isSelected()) {
File nodeFile = ((FileNodeWrapper) child.getUserObject()).file;
if ((nodeFile != null) && nodeFile.isFile()) {
@@ -1081,8 +1084,9 @@ public class FindUnlinkedFilesDialog ext
public void setSelected(boolean bSelected) {
isSelected = bSelected;
- Enumeration<CheckableTreeNode> tmpChildren = this.children();
- for (CheckableTreeNode child : Collections.list(tmpChildren)) {
+ final Enumeration tmpChildren = this.children();
+ while (tmpChildren.hasMoreElements()) {
+ CheckableTreeNode child = (CheckableTreeNode) tmpChildren.nextElement();
child.setSelected(bSelected);
}
--- a/src/main/java/net/sf/jabref/collab/EntryChange.java
+++ b/src/main/java/net/sf/jabref/collab/EntryChange.java
@@ -74,8 +74,9 @@ class EntryChange extends Change {
public boolean makeChange(BasePanel panel, BibDatabase secondary, NamedCompound undoEdit) {
boolean allAccepted = true;
- Enumeration<Change> e = children();
- for (Change c : Collections.list(e)) {
+ Enumeration e = children();
+ while (e.hasMoreElements()) {
+ final Change c = (Change) e.nextElement();
if (c.isAcceptable() && c.isAccepted()) {
c.makeChange(panel, secondary, undoEdit);
} else {
--- a/src/main/java/net/sf/jabref/collab/ChangeDisplayDialog.java
+++ b/src/main/java/net/sf/jabref/collab/ChangeDisplayDialog.java
@@ -86,9 +86,10 @@ class ChangeDisplayDialog extends JDialo
// Perform all accepted changes:
// Store all edits in an Undoable object:
NamedCompound ce = new NamedCompound(Localization.lang("Merged external changes"));
- Enumeration<Change> enumer = root.children();
+ Enumeration enumer = root.children();
boolean anyDisabled = false;
- for (Change c : Collections.list(enumer)) {
+ while (enumer.hasMoreElements()) {
+ final Change c = (Change) enumer.nextElement();
boolean allAccepted = false;
if (c.isAcceptable() && c.isAccepted()) {
allAccepted = c.makeChange(panel, localSecondary, ce);
|