diff --git a/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelHandlerImpl.java b/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelHandlerImpl.java index fd56ee2..5f26e92 100644 --- a/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelHandlerImpl.java +++ b/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelHandlerImpl.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -126,7 +127,7 @@ public synchronized void setInterviewText(final Interview interview, final Strin * @return tokenized text */ private List determineTokensFromText(final String text) { - final List paragraphs = new LinkedList<>(); + final List paragraphs = new ArrayList<>(); // split text into paragraphs at line separators for (final String singleParagraph : text.split(ModelHandlerImpl.REGEX_PARAGRAPH_SEPARATOR)) { // separate paragraph into tokens (ideally words) at whitespaces @@ -401,10 +402,10 @@ private void resolveIntersectedCategoryAssignments(final List> p * even part (second, fourth, ...) */ private List> collectInterruptedSelectionParts(final List selectedTokens) { - final List> parts = new LinkedList<>(); + final List> parts = new ArrayList<>(); // determine the first token out of the targeted range to end the following loop on final TextToken firstTokenAfterSelection = selectedTokens.get(selectedTokens.size() - 1).getFollowingToken(); - List currentPart = new LinkedList<>(); + List currentPart = new ArrayList<>(); // alternate between selected and unselected sections (i.e. token ranges) boolean currentPartSelected = true; TextToken currentToken = selectedTokens.get(0); @@ -415,7 +416,7 @@ private List> collectInterruptedSelectionParts(final List(); + currentPart = new ArrayList<>(); } currentPart.add(currentToken); currentToken = currentToken.getFollowingToken(); @@ -734,7 +735,7 @@ public Map, AtomicLong>> extractDetailPatter // iterate over all given interviews for (final Interview singleInterview : interviews) { final Map, AtomicLong> patternOccurences = new HashMap<>(); - final List> currentPattern = new LinkedList<>(); + final List> currentPattern = new ArrayList<>(); // iterate over the whole detail category sequence for (final DetailCategory singleDetail : this.extractDetailSequence(singleInterview)) { currentPattern.add(new ArrayList<>(maxLength)); @@ -766,7 +767,7 @@ public Map, AtomicLong>> extractDetailPatter @Override public List extractDetailSequence(final Interview interview) { - final List sequence = new LinkedList<>(); + final List sequence = new ArrayList<>(); // iterate over all paragraphs for (final TextToken singleParagraph : interview.getText()) { // iterate over all tokens of the current paragraph @@ -904,7 +905,7 @@ private void appendCategoryStringForToken(final StringBuilder builder, final Tex private static class CategoryConflictHandler { /** Registered unresolved detail category changes, i.e. started but not ended and/or ended but not started. */ - final LinkedList categoryChanges = new LinkedList<>(); + final Deque categoryChanges = new LinkedList<>(); /** * Add another start or end of a detail category to this conflict handler. diff --git a/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelParseServiceImpl.java b/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelParseServiceImpl.java index 61fd7a4..7c2c9b4 100644 --- a/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelParseServiceImpl.java +++ b/scitos.ais/scitos.ais.core/src/main/java/org/hmx/scitos/ais/core/ModelParseServiceImpl.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -188,7 +188,7 @@ public Entry> parseModelFromXml(final Document doc, final Fi // retrieve interviews from document final Element interviewRoot = DomUtil.getChildElement(doc.getDocumentElement(), ModelParseServiceImpl.TAG_INTERVIEW_ROOT); if (interviewRoot != null) { - final List containedInterviews = new LinkedList<>(); + final List containedInterviews = new ArrayList<>(); for (final Element singleInterview : DomUtil.getChildElements(interviewRoot, ModelParseServiceImpl.TAG_INTERVIEW)) { containedInterviews.add(this.parseInterviewFromXml(singleInterview, categories)); } @@ -287,7 +287,7 @@ MutableDetailCategoryModel parseDetailCategoriesFromXml(final Document doc) thro */ private List parseDetailCategoriesFromXmlRecursively(final List categories, final DetailCategory parentCategory) throws HmxException { - final List result = new LinkedList<>(); + final List result = new ArrayList<>(); for (final Element singleCategoryElement : categories) { // parse mandatory category attributes final String code = singleCategoryElement.getAttribute(ModelParseServiceImpl.ATTR_CATEGORY_CODE); @@ -458,7 +458,7 @@ private Interview parseInterviewFromXml(final Element interviewElement, final Mu throw new HmxException(Message.ERROR_FILE_INVALID, new IllegalArgumentException("invalid " + ModelParseServiceImpl.TAG_INTERVIEW + " definition")); } - final List text = new LinkedList<>(); + final List text = new ArrayList<>(); for (final Element singleParagraph : DomUtil.getChildElements(interviewElement, ModelParseServiceImpl.TAG_INTERVIEW_PARAGRAPH)) { text.add(this.parseTextParagraphFromXml(singleParagraph, categories)); } @@ -556,7 +556,7 @@ private Element parseXmlFromOpenViewElements(final Document doc, final List o * @return successfully parsed list of model elements that were open in the view, when the document was created */ private List parseOpenViewElementsFromXml(final Document doc, final AisProject parsedProject) { - final List openViewElements = new LinkedList<>(); + final List openViewElements = new ArrayList<>(); final Element viewsRoot = DomUtil.getChildElement(doc.getDocumentElement(), ModelParseServiceImpl.TAG_VIEWS); if (viewsRoot != null) { for (final Element singleView : DomUtil.getChildElements(viewsRoot)) { diff --git a/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/ModelParseServiceTest.java b/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/ModelParseServiceTest.java index 0f2b9b0..f3c2c8a 100644 --- a/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/ModelParseServiceTest.java +++ b/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/ModelParseServiceTest.java @@ -6,7 +6,7 @@ import java.io.File; import java.util.Arrays; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; @@ -67,7 +67,7 @@ public void testParseModelToAndFromXml_1() throws HmxException { modelHandler.setInterviewText(modelHandler.createInterview("a"), "1 2 3\n4 5 6 7 8 9\n10"); modelHandler.createInterview("b"); // all interview views open, and a sub model group - final List openViewElements = new LinkedList<>(model.getInterviews()); + final List openViewElements = new ArrayList<>(model.getInterviews()); openViewElements.add("a"); final Document xml = this.service.parseXmlFromModel(model, openViewElements); final Entry> parsed = this.service.parseModelFromXml(xml, new File("test.aisp")); diff --git a/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/i18n/AisMessageTest.java b/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/i18n/AisMessageTest.java index 83a344f..c46e73d 100644 --- a/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/i18n/AisMessageTest.java +++ b/scitos.ais/scitos.ais.core/src/test/java/org/hmx/scitos/ais/core/i18n/AisMessageTest.java @@ -2,7 +2,7 @@ import java.util.Collections; import java.util.Enumeration; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; @@ -25,8 +25,8 @@ public class AisMessageTest { public void testMessageAvailability() { final ResourceBundle bundle = ResourceBundle.getBundle(AisMessage.class.getName(), Locale.ENGLISH, new XmlResourceBundleControl()); Assert.assertNotNull(bundle); - final List unusedMessages = new LinkedList<>(); - final List unavailableMessages = new LinkedList<>(); + final List unusedMessages = new ArrayList<>(); + final List unavailableMessages = new ArrayList<>(); final Enumeration availableKeys = bundle.getKeys(); while (availableKeys.hasMoreElements()) { unusedMessages.add(availableKeys.nextElement()); diff --git a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/AisProject.java b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/AisProject.java index c95d530..6661f20 100644 --- a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/AisProject.java +++ b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/AisProject.java @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -40,7 +39,7 @@ public final class AisProject implements IMultiObjectModel categories; /** The contained interviews. */ - private final List interviews = new LinkedList<>(); + private final List interviews = new ArrayList<>(); /** * Main constructor. @@ -129,7 +128,7 @@ public Map> getSubModelObjects() { if (subModelMap.containsKey(groupKey)) { groupedInterviews = subModelMap.get(groupKey); } else { - groupedInterviews = new LinkedList<>(); + groupedInterviews = new ArrayList<>(); subModelMap.put(groupKey, groupedInterviews); } groupedInterviews.add(singleInterview); @@ -144,7 +143,7 @@ public List provide() { @Override public List provideSelectables() { - final List selectables = new LinkedList<>(); + final List selectables = new ArrayList<>(); for (final DetailCategory singleCategory : this.categories) { if (singleCategory.isSelectable()) { selectables.add(singleCategory); @@ -155,7 +154,7 @@ public List provideSelectables() { @Override public AisProject clone() { - final List clonedInterviews = new LinkedList<>(); + final List clonedInterviews = new ArrayList<>(); for (final Interview singleInterview : this.getInterviews()) { clonedInterviews.add(singleInterview.clone()); } diff --git a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/Interview.java b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/Interview.java index 39d78f8..ecedcf7 100644 --- a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/Interview.java +++ b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/Interview.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.domain.IModel; @@ -36,7 +36,7 @@ public final class Interview implements IModel, Comparable /** The index (i.e. number) of this interview in the project containing it. */ private int index; /** The actual interview including assigned details (i.e. applied scoring). */ - private final List text = new LinkedList<>(); + private final List text = new ArrayList<>(); /** * Main constructor. @@ -127,7 +127,7 @@ public Interview setText(final List text) { public Interview reset(final Interview replacingState) { this.setParticipantId(replacingState.getParticipantId()); this.setIndex(replacingState.getIndex()); - final List copiedParagraphs = new LinkedList<>(); + final List copiedParagraphs = new ArrayList<>(); for (final TextToken singleParagraph : replacingState.getText()) { copiedParagraphs.add(singleParagraph.clone()); } diff --git a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/MutableDetailCategoryModel.java b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/MutableDetailCategoryModel.java index 14a5d03..05b7062 100644 --- a/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/MutableDetailCategoryModel.java +++ b/scitos.ais/scitos.ais.domain/src/main/java/org/hmx/scitos/ais/domain/model/MutableDetailCategoryModel.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.LinkedHashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -94,7 +93,7 @@ public List provide() { @Override public List provideSelectables() { - final List selectables = new LinkedList<>(); + final List selectables = new ArrayList<>(); for (final DetailCategory singleCategory : this.categoryByCode.values()) { if (singleCategory.isSelectable()) { selectables.add(singleCategory); @@ -120,7 +119,7 @@ public List getRootCategories() { * @return detail category that have the given one as their parent */ public List getChildCategories(final DetailCategory parent) { - final List children = new LinkedList<>(); + final List children = new ArrayList<>(); for (final DetailCategory singleCategory : this.categoryByCode.values()) { if (ComparisonUtil.isNullAwareEqual(singleCategory.getParent(), parent)) { children.add(singleCategory); diff --git a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/AisViewProject.java b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/AisViewProject.java index 3019e2b..c83ba02 100644 --- a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/AisViewProject.java +++ b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/AisViewProject.java @@ -22,7 +22,7 @@ import java.io.File; import java.io.IOException; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; import java.util.stream.IntStream; @@ -57,7 +57,7 @@ public final class AisViewProject implements IViewProject, ModelChan /** The path this project has been loaded from and/or last saved to. It is used as the default path for the next requested save operation. */ private File savePath; /** The elements displayed in open tabs when this view project was last loaded/saved. */ - private final List openTabElements = new LinkedList<>(); + private final List openTabElements = new ArrayList<>(); /** * Creates a new project in the specified {@link ScitosClient}. diff --git a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/AbstractAisProjectView.java b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/AbstractAisProjectView.java index f263bff..b79c56a 100644 --- a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/AbstractAisProjectView.java +++ b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/AbstractAisProjectView.java @@ -21,7 +21,7 @@ import java.awt.Component; import java.awt.LayoutManager; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.swing.JButton; import javax.swing.JMenuItem; @@ -67,7 +67,7 @@ protected AbstractAisProjectView(final AisViewProject project, final M model, fi @Override public List createEditMenuItems() { - final List editMenuItems = new LinkedList<>(); + final List editMenuItems = new ArrayList<>(); final JMenuItem importInterviewsItem = new JMenuItem(AisMessage.PROJECT_IMPORT_INTERVIEWS.get(), ScitosIcon.FILE_ODS.create()); importInterviewsItem.addActionListener(event -> this.getProject().importInterviewsFromOds()); editMenuItems.add(importInterviewsItem); @@ -83,7 +83,7 @@ public List createEditMenuItems() { @Override public List createToolBarItems() { - final List toolBarItems = new LinkedList<>(); + final List toolBarItems = new ArrayList<>(); final JButton addInterviewButton = new JButton(ScitosIcon.CLIPBOARD_ADD.create()); addInterviewButton.setToolTipText(AisMessage.INTERVIEW_NEW.get()); addInterviewButton.addActionListener(event -> this.createInterview()); diff --git a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/DetailCategoryTreeModel.java b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/DetailCategoryTreeModel.java index 132e6cf..aef9333 100644 --- a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/DetailCategoryTreeModel.java +++ b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/DetailCategoryTreeModel.java @@ -21,6 +21,7 @@ import java.awt.Color; import java.util.AbstractMap.SimpleEntry; +import java.util.ArrayList; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; @@ -61,7 +62,7 @@ final class DetailCategoryTreeModel extends AbstractTreeTableModel { super(new Object()); final MutableDetailCategoryModel model = new MutableDetailCategoryModel(); model.addAll(categoryProvider.provide()); - this.rootCategories = new LinkedList<>(); + this.rootCategories = new ArrayList<>(); this.categoryChildren = new HashMap<>(); for (final DetailCategory singleRoot : model.getRootCategories()) { this.rootCategories.add(this.addCategoryTreeToMap(model, singleRoot)); @@ -79,7 +80,7 @@ final class DetailCategoryTreeModel extends AbstractTreeTableModel { * @return row object representing the given category */ private DetailCategoryRow addCategoryTreeToMap(final MutableDetailCategoryModel model, final DetailCategory detail) { - final List children = new LinkedList<>(); + final List children = new ArrayList<>(); for (final DetailCategory singleChild : model.getChildCategories(detail)) { children.add(this.addCategoryTreeToMap(model, singleChild)); } @@ -106,7 +107,7 @@ TreePath addChildCategoryRow(final TreePath parent) { } else { final Object parentRow = parent.getLastPathComponent(); if (!this.categoryChildren.containsKey(parentRow)) { - this.categoryChildren.put((DetailCategoryRow) parentRow, new LinkedList<>()); + this.categoryChildren.put((DetailCategoryRow) parentRow, new ArrayList<>()); } parentsChildren = this.categoryChildren.get(parentRow); // inherit color from parent @@ -313,7 +314,7 @@ public void setValueAt(final Object value, final Object node, final int column) * @return all detail categories in unsorted list */ private List getFlatCategoryList() { - final List categories = new LinkedList<>(this.rootCategories); + final List categories = new ArrayList<>(this.rootCategories); for (final List childCategories : this.categoryChildren.values()) { categories.addAll(childCategories); } diff --git a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewPanel.java b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewPanel.java index 1dd9b89..7c69955 100644 --- a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewPanel.java +++ b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewPanel.java @@ -29,7 +29,7 @@ import java.awt.event.HierarchyEvent; import java.awt.event.HierarchyListener; import java.util.ArrayList; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.swing.JPanel; @@ -227,7 +227,7 @@ final boolean containsValidSelection() { * @return selected text token ui components */ final List getSelection() { - final List selection = new LinkedList<>(); + final List selection = new ArrayList<>(); for (final Component singleParagraph : this.getViewPortView().getComponents()) { for (final Component singleToken : ((Container) singleParagraph).getComponents()) { if (((TextTokenComponent) singleToken).isSelected()) { diff --git a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewView.java b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewView.java index 10d5f81..0680605 100644 --- a/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewView.java +++ b/scitos.ais/scitos.ais.view/src/main/java/org/hmx/scitos/ais/view/swing/components/InterviewView.java @@ -23,7 +23,7 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.swing.JButton; @@ -50,7 +50,7 @@ public final class InterviewView extends AbstractAisProjectView { */ private IUndoManagedView viewPanel; /** The main tool bar items that belong to this view – in order to enable/disable them according to the current selection. */ - private final List detailToolBarItems = new LinkedList<>(); + private final List detailToolBarItems = new ArrayList<>(); /** * Main constructor. diff --git a/scitos.core/src/main/java/org/hmx/scitos/core/AbstractModelHandler.java b/scitos.core/src/main/java/org/hmx/scitos/core/AbstractModelHandler.java index 657b6f4..4dfa50f 100644 --- a/scitos.core/src/main/java/org/hmx/scitos/core/AbstractModelHandler.java +++ b/scitos.core/src/main/java/org/hmx/scitos/core/AbstractModelHandler.java @@ -19,7 +19,7 @@ package org.hmx.scitos.core; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.domain.IModel; @@ -48,7 +48,7 @@ public abstract class AbstractModelHandler> implements IMode */ protected AbstractModelHandler(final M model) { this.model = model; - this.listeners = new LinkedList<>(); + this.listeners = new ArrayList<>(); } @Override diff --git a/scitos.core/src/main/java/org/hmx/scitos/core/util/ClassPathUtil.java b/scitos.core/src/main/java/org/hmx/scitos/core/util/ClassPathUtil.java index ebbdd30..c1e380c 100644 --- a/scitos.core/src/main/java/org/hmx/scitos/core/util/ClassPathUtil.java +++ b/scitos.core/src/main/java/org/hmx/scitos/core/util/ClassPathUtil.java @@ -24,7 +24,7 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Enumeration; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarFile; @@ -45,7 +45,7 @@ public final class ClassPathUtil { * @see Class#getResourceAsStream(String) */ public static List getFileResourcePaths(final Class clazz, final String fileNameRegex) { - final List paths = new LinkedList<>(); + final List paths = new ArrayList<>(); // check if this is being executed from within a jar file final Pattern pattern = Pattern.compile(fileNameRegex); final File jarFile = new File(clazz.getProtectionDomain().getCodeSource().getLocation().getPath()); diff --git a/scitos.core/src/main/java/org/hmx/scitos/core/util/DomUtil.java b/scitos.core/src/main/java/org/hmx/scitos/core/util/DomUtil.java index 5459ad0..9969d11 100644 --- a/scitos.core/src/main/java/org/hmx/scitos/core/util/DomUtil.java +++ b/scitos.core/src/main/java/org/hmx/scitos/core/util/DomUtil.java @@ -20,7 +20,7 @@ package org.hmx.scitos.core.util; import java.util.Arrays; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.w3c.dom.Document; @@ -128,7 +128,7 @@ public static Element getChildElement(final Node parentNode, final String childN * @return all child elements with the given name */ public static List getChildElements(final Node parentNode, final String... childNodeNames) { - final List children = new LinkedList<>(); + final List children = new ArrayList<>(); final NodeList candidates = parentNode.getChildNodes(); final int childCount = candidates.getLength(); final List targetNodeNames = Arrays.asList(childNodeNames); diff --git a/scitos.core/src/test/java/org/hmx/scitos/core/UndoManagerTest.java b/scitos.core/src/test/java/org/hmx/scitos/core/UndoManagerTest.java index c10dda9..521cda4 100644 --- a/scitos.core/src/test/java/org/hmx/scitos/core/UndoManagerTest.java +++ b/scitos.core/src/test/java/org/hmx/scitos/core/UndoManagerTest.java @@ -1,5 +1,6 @@ package org.hmx.scitos.core; +import java.util.ArrayList; import java.util.Deque; import java.util.LinkedList; import java.util.List; @@ -87,7 +88,7 @@ public void testUndo() { public void testUndoMultipleTimes() { final int iterationCount = 3; this.undoManager.setLimit(iterationCount); - final List oldStates = new LinkedList<>(); + final Deque oldStates = new LinkedList<>(); for (int iteration = 0; iteration < iterationCount; iteration++) { oldStates.add(this.managedModel.clone()); this.managedModel.changeState(); @@ -116,7 +117,7 @@ public void testRedo() { public void testRedoMultipleTimes() { final int iterationCount = 3; this.undoManager.setLimit(iterationCount); - final List originalStates = new LinkedList<>(); + final List originalStates = new ArrayList<>(); for (int iteration = 0; iteration < iterationCount; iteration++) { this.managedModel.changeState(); originalStates.add(this.managedModel.clone()); @@ -125,7 +126,7 @@ public void testRedoMultipleTimes() { for (int iteration = 0; iteration < iterationCount; iteration++) { this.undoManager.undo(); } - final List redoStates = new LinkedList<>(); + final List redoStates = new ArrayList<>(); for (int iteration = 0; iteration < iterationCount; iteration++) { redoStates.add(this.undoManager.redo()); } diff --git a/scitos.core/src/test/java/org/hmx/scitos/core/i18n/MessageTest.java b/scitos.core/src/test/java/org/hmx/scitos/core/i18n/MessageTest.java index 6d01733..4346960 100644 --- a/scitos.core/src/test/java/org/hmx/scitos/core/i18n/MessageTest.java +++ b/scitos.core/src/test/java/org/hmx/scitos/core/i18n/MessageTest.java @@ -2,7 +2,7 @@ import java.util.Collections; import java.util.Enumeration; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; @@ -25,8 +25,8 @@ public class MessageTest { public void testMessageAvailability() { final ResourceBundle bundle = ResourceBundle.getBundle(Message.class.getName(), Locale.ENGLISH, new XmlResourceBundleControl()); Assert.assertNotNull(bundle); - final List unusedMessages = new LinkedList<>(); - final List unavailableMessages = new LinkedList<>(); + final List unusedMessages = new ArrayList<>(); + final List unavailableMessages = new ArrayList<>(); final Enumeration availableKeys = bundle.getKeys(); while (availableKeys.hasMoreElements()) { unusedMessages.add(availableKeys.nextElement()); diff --git a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelHandlerImpl.java b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelHandlerImpl.java index 1874be6..a9165c3 100755 --- a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelHandlerImpl.java +++ b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelHandlerImpl.java @@ -22,7 +22,7 @@ import java.awt.Font; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.core.AbstractModelHandler; @@ -537,7 +537,7 @@ private void mergePropositionsWithEnclosedChildren(final Proposition firstPart, secondPart.setPriorChildren(firstLaterChildren); } else { // make sure all enclosed children are in the same list to keep the ability to merge and indent of enclosed - final List combinedChildren = new LinkedList<>(firstLaterChildren); + final List combinedChildren = new ArrayList<>(firstLaterChildren); combinedChildren.addAll(secondPriorChildren); secondPart.setPriorChildren(combinedChildren); } diff --git a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelParseServiceImpl.java b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelParseServiceImpl.java index aee9076..0eade5f 100644 --- a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelParseServiceImpl.java +++ b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/ModelParseServiceImpl.java @@ -467,7 +467,7 @@ public Entry> parseModelFromXml(final Document xml, final File newPericope.setComment(DomUtil.getNullableAttribute(pericopeNode, ModelParseServiceImpl.ATT_ROOT_COMMENT)); // Creates an List of Propositions for the rootPropositions - final List text = new LinkedList<>(); + final List text = new ArrayList<>(); // all top level children, including the root Propositions for (final Element topLevelProposition : DomUtil.getChildElements(pericopeNode, ModelParseServiceImpl.TAG_PROPOSITION)) { text.add(this.parsePropositionFromXml(topLevelProposition, languageModel)); @@ -651,7 +651,7 @@ private LookupLanguageModel parseLanguageModelFromXml(final Element syntacticalM * @return successfully parsed functions */ private List parseSyntacticalFunctionsFromXml(final Element parentNode) { - final LinkedList result = new LinkedList<>(); + final ArrayList result = new ArrayList<>(); for (final Element singleFunctionNode : DomUtil.getChildElements(parentNode, ModelParseServiceImpl.TAG_LANGMODEL_FUNCTION, ModelParseServiceImpl.TAG_LANGMODEL_FUNCTIONGROUP)) { if (ModelParseServiceImpl.TAG_LANGMODEL_FUNCTION.equals(singleFunctionNode.getTagName())) { @@ -761,7 +761,7 @@ public RelationModel parseRelationModelFromXml(final Document xml) throws HmxExc private RelationModel parseRelationModelFromXml(final Element semanticalModelNode) throws HmxException { final RelationModel model = new RelationModel(); for (final Element singleGroupNode : DomUtil.getChildElements(semanticalModelNode, ModelParseServiceImpl.TAG_RELMODEL_GROUP)) { - final List group = new LinkedList<>(); + final List group = new ArrayList<>(); for (final Element singleTemplateNode : DomUtil.getChildElements(singleGroupNode, ModelParseServiceImpl.TAG_RELMODEL_RELATION)) { final List roles = new ArrayList<>(3); for (final Element singleRoleNode : DomUtil.getChildElements(singleTemplateNode, ModelParseServiceImpl.TAG_RELMODEL_ASSOCIATE)) { @@ -816,7 +816,7 @@ private Proposition parsePropositionFromXml(final Element propositionNode, final throw new HmxException(Message.ERROR_FILE_INVALID); } // collect the contained ClauseItems - final List itemList = new LinkedList<>(); + final List itemList = new ArrayList<>(); for (final Element singleClauseItem : DomUtil.getChildElements(tempItemElement, ModelParseServiceImpl.TAG_CLAUSE_ITEM)) { itemList.add(this.parseClauseItemFromXml(singleClauseItem, languageModel)); } @@ -835,7 +835,7 @@ private Proposition parsePropositionFromXml(final Element propositionNode, final // adds prior propositions to the Proposition according to the xml code final Element priorPropositionsElement = DomUtil.getChildElement(propositionNode, ModelParseServiceImpl.TAG_PRIOR_PROP_SUB_TREE); if (priorPropositionsElement != null) { - final List priorChildren = new LinkedList<>(); + final List priorChildren = new ArrayList<>(); // calls itself to add every prior Proposition contained in the Proposition for (final Element singlePriorChild : DomUtil.getChildElements(priorPropositionsElement, ModelParseServiceImpl.TAG_PROPOSITION)) { priorChildren.add(this.parsePropositionFromXml(singlePriorChild, languageModel)); @@ -845,7 +845,7 @@ private Proposition parsePropositionFromXml(final Element propositionNode, final // adds later propositions to the proposition according to the xml code final Element laterPropositionsElement = DomUtil.getChildElement(propositionNode, ModelParseServiceImpl.TAG_LATER_PROP_SUB_TREE); if (laterPropositionsElement != null) { - final List laterChildren = new LinkedList<>(); + final List laterChildren = new ArrayList<>(); // calls itself to add every later Proposition contained in the Proposition for (final Element singleLaterChild : DomUtil.getChildElements(laterPropositionsElement, ModelParseServiceImpl.TAG_PROPOSITION)) { laterChildren.add(this.parsePropositionFromXml(singleLaterChild, languageModel)); diff --git a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/option/HmxLanguageOption.java b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/option/HmxLanguageOption.java index da60818..c334faf 100644 --- a/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/option/HmxLanguageOption.java +++ b/scitos.hmx/scitos.hmx.core/src/main/java/org/hmx/scitos/hmx/core/option/HmxLanguageOption.java @@ -23,7 +23,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -84,7 +84,7 @@ public HmxLanguageOption(final ModelParseServiceImpl modelParseService) { // apply general option file naming convention this.filePath = OptionHandler.buildOptionFilePath(HmxLanguageOption.class); // initialize user defined language models - this.userModels = new LinkedList<>(); + this.userModels = new ArrayList<>(); // retrieve settings from persistent storage (i.e. file) final File targetFile = new File(this.filePath); if (targetFile.exists() && targetFile.canRead()) { diff --git a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelHandlerImplTest.java b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelHandlerImplTest.java index 6fb9138..d8ba554 100644 --- a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelHandlerImplTest.java +++ b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelHandlerImplTest.java @@ -22,7 +22,7 @@ import java.awt.Font; import java.util.Arrays; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.core.HmxException; @@ -57,7 +57,7 @@ public class ModelHandlerImplTest { */ @BeforeClass public static void setUp() { - final List functions = new LinkedList<>(); + final List functions = new ArrayList<>(); functions.add(new SyntacticalFunction("A", "A Function", false, null)); functions.add(new SyntacticalFunction("B", "Second Function", true, "some description")); functions.add(new SyntacticalFunctionGroup("Group", null, Arrays.asList(new SyntacticalFunction("C", "Nested Function", false, null), diff --git a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelParseServiceImplTest.java b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelParseServiceImplTest.java index e26bf19..649168d 100644 --- a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelParseServiceImplTest.java +++ b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/ModelParseServiceImplTest.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map.Entry; @@ -386,7 +386,7 @@ public void testGetSystemRelationModel() throws HmxException { final AssociateRole nucleus = new AssociateRole("Nucleus", true); model.add(Arrays.asList(new RelationTemplate(sequentialNucleus, sequentialNucleus, sequentialNucleus, null), new RelationTemplate( simultaneousNucleus, simultaneousNucleus, simultaneousNucleus, null), new RelationTemplate(nucleus, nucleus, nucleus, null))); - final List secondGroup = new LinkedList<>(); + final List secondGroup = new ArrayList<>(); secondGroup.add(new RelationTemplate(new AssociateRole("Orienter", false), null, new AssociateRole("Content", true), null)); secondGroup.add(new RelationTemplate(new AssociateRole("Circumstance", false), null, nucleus, null)); secondGroup.add(new RelationTemplate(new AssociateRole("Move", false), null, new AssociateRole("Goal", true), null)); diff --git a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/i18n/HmxMessageTest.java b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/i18n/HmxMessageTest.java index 5ee2554..ab82224 100644 --- a/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/i18n/HmxMessageTest.java +++ b/scitos.hmx/scitos.hmx.core/src/test/java/org/hmx/scitos/hmx/core/i18n/HmxMessageTest.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.Enumeration; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.MissingResourceException; @@ -44,8 +44,8 @@ public class HmxMessageTest { public void testMessageAvailability() { final ResourceBundle bundle = ResourceBundle.getBundle(HmxMessage.class.getName(), Locale.ENGLISH, new XmlResourceBundleControl()); Assert.assertNotNull(bundle); - final List unusedMessages = new LinkedList<>(); - final List unavailableMessages = new LinkedList<>(); + final List unusedMessages = new ArrayList<>(); + final List unavailableMessages = new ArrayList<>(); final Enumeration availableKeys = bundle.getKeys(); while (availableKeys.hasMoreElements()) { unusedMessages.add(availableKeys.nextElement()); diff --git a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/LanguageModel.java b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/LanguageModel.java index 0e8662f..83343cb 100644 --- a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/LanguageModel.java +++ b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/LanguageModel.java @@ -23,7 +23,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.hmx.domain.ISyntacticalFunctionProvider; @@ -51,8 +51,8 @@ public class LanguageModel implements ISyntacticalFunctionProvider, Serializable public LanguageModel(final String name, final boolean leftToRightOriented) { this.name = name; this.leftToRightOriented = leftToRightOriented; - this.recommendedFonts = new LinkedList<>(); - this.functionGroups = new LinkedList<>(); + this.recommendedFonts = new ArrayList<>(); + this.functionGroups = new ArrayList<>(); } /** diff --git a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Pericope.java b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Pericope.java index 18a8e9c..e18a1c0 100755 --- a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Pericope.java +++ b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Pericope.java @@ -22,7 +22,7 @@ import java.awt.Font; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.domain.IModel; @@ -40,7 +40,7 @@ public final class Pericope implements IModel, IPropositionParent, ICo /** The origin text language's syntactical model. */ private LanguageModel languageModel; /** The top level propositions, that in turn can contain more subordinated propositions. */ - private final List text = new LinkedList<>(); + private final List text = new ArrayList<>(); /** * The origin text's font, to allow the analysis of languages that require a special {@link Font} in order to be displayed properly. */ @@ -155,7 +155,7 @@ public List getText() { * @return ordered list of all {@code Proposition}s */ public List getFlatText() { - final List result = new LinkedList<>(); + final List result = new ArrayList<>(); for (final Proposition singleTopLevelProposition : this.text) { // recursively fill result list this.collectFlatText(singleTopLevelProposition, result); @@ -197,7 +197,7 @@ private void collectFlatText(final Proposition target, final List f * @return ordered list of all relations */ public List getFlatRelations() { - final List result = new LinkedList<>(); + final List result = new ArrayList<>(); // get the first Proposition AbstractConnectable currentFocus = this.getPropositionAt(0); while (currentFocus != null) { diff --git a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Proposition.java b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Proposition.java index 6b1900e..4164380 100755 --- a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Proposition.java +++ b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Proposition.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.domain.util.CollectionUtil; @@ -44,7 +44,7 @@ public final class Proposition extends AbstractConnectable implements Cloneable, /** * The included {@link ClauseItem}s containing the represented origin text part. */ - private final List items = new LinkedList<>(); + private final List items = new ArrayList<>(); /** The identifying label. */ private String label; /** The syntactical indentation function. */ @@ -389,7 +389,7 @@ public void addLastPriorChild(final Proposition childProposition) { */ private void addPriorChild(final Proposition childProposition, final boolean asLeadingChild) { if (this.priorChildren == null) { - this.priorChildren = new LinkedList<>(); + this.priorChildren = new ArrayList<>(); } childProposition.setParent(this); if (asLeadingChild) { @@ -429,7 +429,7 @@ public void addLastLaterChild(final Proposition childProposition) { */ private void addLaterChild(final Proposition childProposition, final boolean asLeadingChild) { if (this.laterChildren == null) { - this.laterChildren = new LinkedList<>(); + this.laterChildren = new ArrayList<>(); } childProposition.setParent(this); if (asLeadingChild) { diff --git a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Relation.java b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Relation.java index 0b55606..ebb62f6 100755 --- a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Relation.java +++ b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/Relation.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.hmx.domain.model.RelationTemplate.AssociateRole; @@ -34,7 +34,7 @@ public final class Relation extends AbstractConnectable implements Cloneable, Iterable { /** The subordinated elements forming this relation. */ - private final List associates = new LinkedList<>(); + private final List associates = new ArrayList<>(); /** * Constructor: for a {@code Relation} between the specified associates with the respective role and weight. diff --git a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/RelationModel.java b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/RelationModel.java index c7904f6..9c2c6d9 100644 --- a/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/RelationModel.java +++ b/scitos.hmx/scitos.hmx.domain/src/main/java/org/hmx/scitos/hmx/domain/model/RelationModel.java @@ -22,7 +22,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.hmx.domain.ISemanticalRelationProvider; @@ -37,7 +37,7 @@ public class RelationModel implements ISemanticalRelationProvider, Serializable, * Constructor: initializing an empty set of template groups. */ public RelationModel() { - this.relationTemplateGroups = new LinkedList<>(); + this.relationTemplateGroups = new ArrayList<>(); } /** diff --git a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/components/AnalysisPanel.java b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/components/AnalysisPanel.java index 1b0f83b..808aa28 100644 --- a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/components/AnalysisPanel.java +++ b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/components/AnalysisPanel.java @@ -32,7 +32,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @@ -532,7 +532,7 @@ public void submitChangesToModel() { @Override public List getSelectedPropositions(final Proposition defaultSelected) { - final List result = new LinkedList<>(); + final List result = new ArrayList<>(); for (ViewProposition singleProposition : this.propositionList) { if (singleProposition.isChecked() || singleProposition.getRepresented() == defaultSelected) { result.add(singleProposition.getRepresented()); @@ -543,7 +543,7 @@ public List getSelectedPropositions(final Proposition defaultSelect @Override public List getSelectedConnectables(final AbstractConnectable defaultSelected) { - final List list = new LinkedList<>(); + final List list = new ArrayList<>(); // REQUIREMENT: whole model is represented in the view AbstractConnectable nextToCheck = this.propositionList.get(0).getRepresented(); while (nextToCheck != null) { diff --git a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/elements/ViewProposition.java b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/elements/ViewProposition.java index 3fedbcf..19d3c50 100644 --- a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/elements/ViewProposition.java +++ b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/elements/ViewProposition.java @@ -29,7 +29,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -223,7 +223,7 @@ public ViewProposition(final IPericopeView viewReference, final Proposition repr this.functionLabel = this.initFunctionLabel(); if (viewSettings.isShowingClauseItems()) { this.originText = null; - this.items = new LinkedList<>(); + this.items = new ArrayList<>(); } else { this.originText = new ScaledTextField(); this.items = null; diff --git a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/option/RelationTreeModel.java b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/option/RelationTreeModel.java index 40d9b3c..dd5f9c2 100644 --- a/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/option/RelationTreeModel.java +++ b/scitos.hmx/scitos.hmx.view/src/main/java/org/hmx/scitos/hmx/view/swing/option/RelationTreeModel.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -73,7 +73,7 @@ final class RelationTreeModel extends AbstractTreeTableModel implements ISemanti super(new Object()); // setup delegate structure (as the TreeModel cannot handle the mutable data objects as immediate nodes) for (final List singleGroup : relationProvider.provideRelationTemplates()) { - final List relationTemplatesInGroup = new LinkedList<>(); + final List relationTemplatesInGroup = new ArrayList<>(); for (final RelationTemplate singleTemplate : singleGroup) { // map each relation template to a random UUID final UUID templateId = UUID.randomUUID(); @@ -282,7 +282,7 @@ public void setValueAt(final Object value, final Object node, final int column) */ public TreePath addGroupEntry() { final UUID groupId = UUID.randomUUID(); - this.relationGroups.put(groupId, new LinkedList<>()); + this.relationGroups.put(groupId, new ArrayList<>()); final TreePath rootPath = new TreePath(this.getRoot()); this.modelSupport.fireChildAdded(rootPath, this.relationGroups.size() - 1, groupId); return rootPath.pathByAddingChild(groupId); diff --git a/scitos.view/src/main/java/org/hmx/scitos/view/ContextMenuBuilder.java b/scitos.view/src/main/java/org/hmx/scitos/view/ContextMenuBuilder.java index 741aa42..6949a07 100644 --- a/scitos.view/src/main/java/org/hmx/scitos/view/ContextMenuBuilder.java +++ b/scitos.view/src/main/java/org/hmx/scitos/view/ContextMenuBuilder.java @@ -22,7 +22,7 @@ import java.awt.Font; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import org.hmx.scitos.core.HmxException; @@ -33,7 +33,7 @@ public class ContextMenuBuilder implements Iterable { /** The menu's entries - menu items, separators and/or submenus. */ - private final List entryList = new LinkedList<>(); + private final List entryList = new ArrayList<>(); /** The menu's title/caption. */ private final String caption; diff --git a/scitos.view/src/main/java/org/hmx/scitos/view/swing/MainView.java b/scitos.view/src/main/java/org/hmx/scitos/view/swing/MainView.java index 3ff8b59..7cfd3da 100644 --- a/scitos.view/src/main/java/org/hmx/scitos/view/swing/MainView.java +++ b/scitos.view/src/main/java/org/hmx/scitos/view/swing/MainView.java @@ -36,7 +36,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -86,7 +86,7 @@ public class MainView extends JPanel { /** The client instance containing this view. */ final ScitosClient client; /** The currently open view projects. */ - private final List>> openProjects = new LinkedList<>(); + private final List>> openProjects = new ArrayList<>(); /** The divided pane containing the project tree on the left and the tab stack on the right. */ private final JSplitPane splitPane; @@ -277,9 +277,9 @@ public void revalidateClient(final boolean refreshToolBarItems) { * Clear the tree structure and rebuild it with the currently open projects. This re-applies the single selected node. */ public void resetTreeStructure() { - final List> expandedProjectNodes = new LinkedList<>(); + final List> expandedProjectNodes = new ArrayList<>(); final Map, Set> expandedModelGroupNodes = new HashMap<>(); - final List> expandedSubModelNodes = new LinkedList<>(); + final List> expandedSubModelNodes = new ArrayList<>(); this.collectExpandedNodeObjects(expandedProjectNodes, expandedModelGroupNodes, expandedSubModelNodes); this.rootNode.removeAllChildren(); // iterate all currently open projects @@ -373,7 +373,7 @@ private void collectExpandedNodeObjects(final List> expandedProj */ private void expandObjectNodes(final List> projects, final Map, Set> modelGroups, final List> subModels) { - final List nodes = new LinkedList<>(); + final List nodes = new ArrayList<>(); for (final IViewProject singleProject : projects) { nodes.add(this.getProjectNode(singleProject)); } @@ -417,9 +417,9 @@ void selectNodeForCurrentTab() { * tree node to refresh */ void refreshElement(final ScitosTreeNode node) { - final List> expandedProjectNodes = new LinkedList<>(); + final List> expandedProjectNodes = new ArrayList<>(); final Map, Set> expandedModelGroupNodes = new HashMap<>(); - final List> expandedSubModelNodes = new LinkedList<>(); + final List> expandedSubModelNodes = new ArrayList<>(); this.collectExpandedNodeObjects(expandedProjectNodes, expandedModelGroupNodes, expandedSubModelNodes); ((DefaultTreeModel) this.projectTree.getModel()).reload(node); this.expandObjectNodes(expandedProjectNodes, expandedModelGroupNodes, expandedSubModelNodes); @@ -838,7 +838,7 @@ boolean closeProject(final IViewProject project) { if (!CollectionUtil.containsInstance(this.openProjects, project)) { return Collections.emptyList(); } - final List> openTabs = new LinkedList<>(); + final List> openTabs = new ArrayList<>(); for (final Component singleTab : this.tabStack.getComponents()) { if (singleTab instanceof AbstractProjectView) { final AbstractProjectView associatedTab = (AbstractProjectView) singleTab; @@ -859,7 +859,7 @@ boolean closeProject(final IViewProject project) { */ void updateOpenTabElementsForProject(final IViewProject project) { if (project != null) { - final List tabElements = new LinkedList<>(); + final List tabElements = new ArrayList<>(); for (final AbstractProjectView singleTab : this.getOpenTabsForProject(project)) { singleTab.submitChangesToModel(); tabElements.add(singleTab.getModel()); diff --git a/scitos.view/src/main/java/org/hmx/scitos/view/swing/option/OptionView.java b/scitos.view/src/main/java/org/hmx/scitos/view/swing/option/OptionView.java index 3f4c11c..98d4e99 100644 --- a/scitos.view/src/main/java/org/hmx/scitos/view/swing/option/OptionView.java +++ b/scitos.view/src/main/java/org/hmx/scitos/view/swing/option/OptionView.java @@ -24,7 +24,7 @@ import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; import javax.swing.JDialog; @@ -69,7 +69,7 @@ public void actionPerformed(final ActionEvent event) { } }); this.dialog.setModal(true); - this.optionNodes = new LinkedList<>(); + this.optionNodes = new ArrayList<>(); DefaultMutableTreeNode firstNode = null; for (final IOptionPanelService singleService : optionPanelProvider.getServices()) { // adding node to the category tree