diff options
author | Alexander Kurtakov | 2016-01-21 09:45:47 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-03-01 15:28:11 +0000 |
commit | 9b4a1d6dbcd5d844ba817f900b95dcd8ffb846be (patch) | |
tree | e0c76bd68ebe57247baf38b99506778d530ba000 | |
parent | d3ddd8664978d4f4ad1732937cea73cc18dcad43 (diff) | |
download | eclipse.platform-9b4a1d6dbcd5d844ba817f900b95dcd8ffb846be.tar.gz eclipse.platform-9b4a1d6dbcd5d844ba817f900b95dcd8ffb846be.tar.xz eclipse.platform-9b4a1d6dbcd5d844ba817f900b95dcd8ffb846be.zip |
Bug 482106 - Reduce warnings in workbenchY20160310-0830Y20160310-0800Y20160303-0800I20160308-0800
Remove redundant type arguments in o.e.ant.ui.
Change-Id: If7effa4e63ecbd126aea0292f764dc109160a642
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
69 files changed, 193 insertions, 193 deletions
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java index 208579ee9..d5d85eedf 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Element.java @@ -24,7 +24,7 @@ public class Element extends Atom implements IElement { private boolean fUndefined = true; private boolean fText; private IModel fModel; - private Map<String, IAttribute> fMap = new HashMap<String, IAttribute>(4); + private Map<String, IAttribute> fMap = new HashMap<>(4); private Dfm fElementDfm; /** diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Model.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Model.java index af790942b..c2836f0f0 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Model.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Model.java @@ -66,7 +66,7 @@ public class Model implements IModel { throw new IllegalStateException(AntDTDSchemaMessages.Model_model_may_not_be_changed); if (fContentsList == null) - fContentsList = new LinkedList<IModel>(); + fContentsList = new LinkedList<>(); fContentsList.add(model); } @@ -106,12 +106,12 @@ public class Model implements IModel { copy.fMixed = fMixed; copy.fLeaf = fLeaf; if (fContents != null) { - copy.fContentsList = new LinkedList<IModel>(); + copy.fContentsList = new LinkedList<>(); for (int i = 0; i < fContents.length; i++) { copy.fContentsList.add(fContents[i]); } } else if (fContentsList != null) { - copy.fContentsList = new LinkedList<IModel>(); + copy.fContentsList = new LinkedList<>(); Iterator<IModel> it = fContentsList.iterator(); while (it.hasNext()) { copy.fContentsList.add(it.next()); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/NfmParser.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/NfmParser.java index 36bf9ab83..09234f2bc 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/NfmParser.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/NfmParser.java @@ -49,12 +49,12 @@ public class NfmParser { // Make list of dfms in graph - ArrayList<Dfm> dfms = new ArrayList<Dfm>(); + ArrayList<Dfm> dfms = new ArrayList<>(); collect(dfm, dfms); // Detect accept conflicts - HashMap<Dfm, Dfm> duplicates = new HashMap<Dfm, Dfm>(); + HashMap<Dfm, Dfm> duplicates = new HashMap<>(); detect(dfms, duplicates); // Replace duplicate dfms in graph diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java index 74c4ae8c0..79a59c35d 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/Schema.java @@ -22,7 +22,7 @@ import org.eclipse.ant.internal.ui.dtd.ISchema; * @author Bob Foster */ public class Schema implements ISchema { - private HashMap<String, IElement> fElementMap = new HashMap<String, IElement>(); + private HashMap<String, IElement> fElementMap = new HashMap<>(); private Exception fErrorException; /** diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java index 89526153f..2a95b895e 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/schema/SchemaFactory.java @@ -36,7 +36,7 @@ public class SchemaFactory implements DeclHandler { private Element fElement; private Schema fSchema; - private static HashSet<String> fTypes = new HashSet<String>(); + private static HashSet<String> fTypes = new HashSet<>(); private Exception fErrorException; static { fTypes.add("CDATA"); //$NON-NLS-1$ @@ -124,7 +124,7 @@ public class SchemaFactory implements DeclHandler { private String[] parseValues(String type, char separator) { int start = 0, pos, len = type.length(); - LinkedList<String> values = new LinkedList<String>(); + LinkedList<String> values = new LinkedList<>(); while (start < len) { pos = type.indexOf(separator, start); if (pos < 0) diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/Factory.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/Factory.java index 1db74d026..ecdde9011 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/Factory.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/dtd/util/Factory.java @@ -53,7 +53,7 @@ public class Factory { // a free object only causes memory allocation // when the list has been previously collected. head = new Head(); - free = new SoftReference<Head>(head); + free = new SoftReference<>(head); } return head; } @@ -62,5 +62,5 @@ public class Factory { public FactoryObject next; } - private SoftReference<Head> free = new SoftReference<Head>(new Head()); + private SoftReference<Head> free = new SoftReference<>(new Head()); } diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java index 32feb019a..ed5bbcaa5 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/AntEditorCompletionProcessor.java @@ -283,7 +283,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im matchingTemplateProposals = determineTemplateProposalsForContext(documentOffset); } else { ICompletionProposal[] templateProposals = determineTemplateProposalsForContext(documentOffset); - List<ICompletionProposal> templateProposalList = new ArrayList<ICompletionProposal>(templateProposals.length); + List<ICompletionProposal> templateProposalList = new ArrayList<>(templateProposals.length); for (int i = 0; i < templateProposals.length; i++) { if (templateProposals[i].getDisplayString().toLowerCase().startsWith(prefix)) { templateProposalList.add(templateProposals[i]); @@ -327,7 +327,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im templates = getTemplates(contextTypeId); } - List<ICompletionProposal> matches = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> matches = new ArrayList<>(); for (int i = 0; i < templates.length; i++) { Template template = templates[i]; try { @@ -511,7 +511,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im private ICompletionProposal[] getDefaultValueProposals(String prefix) { Map<String, Target> targets = getTargets(); - List<AntCompletionProposal> defaultProposals = new ArrayList<AntCompletionProposal>(targets.size()); + List<AntCompletionProposal> defaultProposals = new ArrayList<>(targets.size()); Iterator<Target> itr = targets.values().iterator(); Target target; String targetName; @@ -545,7 +545,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im id = ((AntTaskNode) node).getId(); } Set<String> refIds = references.keySet(); - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(refIds.size()); + List<ICompletionProposal> proposals = new ArrayList<>(refIds.size()); String refId; ICompletionProposal proposal; int prefixLength = prefix.length(); @@ -576,7 +576,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im } private ICompletionProposal[] getExtensionOfValueProposals(String prefix) { - List<ICompletionProposal> extensions = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> extensions = new ArrayList<>(); Map<String, Target> targets = getTargets(); Set<String> targetNames = targets.keySet(); for (String targetName : targetNames) { @@ -605,7 +605,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im Map<String, Target> targets = getTargets(); Set<String> targetNames = targets.keySet(); - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(targets.size() - 2); // current target and implicit target + List<ICompletionProposal> proposals = new ArrayList<>(targets.size() - 2); // current target and implicit target for (String targetName : targetNames) { if (targetName.equals(currentTargetName)) { continue; @@ -639,7 +639,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im } private ICompletionProposal[] getDependsValueProposals(IDocument document, String prefix) { - List<String> possibleDependencies = new ArrayList<String>(); + List<String> possibleDependencies = new ArrayList<>(); String currentTargetName = getEnclosingTargetName(document, lineNumber, columnNumber); if (currentTargetName == null) { return NO_PROPOSALS; @@ -663,7 +663,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im possibleDependencies.remove(dependencies.nextElement()); } } - ArrayList<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(possibleDependencies.size()); + ArrayList<ICompletionProposal> proposals = new ArrayList<>(possibleDependencies.size()); for (String targetName : possibleDependencies) { ICompletionProposal proposal = new AntCompletionProposal(targetName, cursorPosition - prefix.length(), prefix.length(), targetName.length(), getTargetImage(targetName), targetName, targets.get(targetName).getDescription(), AntCompletionProposal.TASK_PROPOSAL); proposals.add(proposal); @@ -680,7 +680,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im * prefix, that all proposals should start with. The prefix may be an empty string. */ protected ICompletionProposal[] getAttributeProposals(String taskName, String prefix) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); IElement element = getDtd().getElement(taskName); if (element != null) { Iterator<String> keys = element.getAttributes().keySet().iterator(); @@ -892,7 +892,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im * the prefix that all proposals should start with. The prefix may be an empty string. */ private ICompletionProposal[] getAttributeValueProposals(String taskName, String attributeName, String prefix) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); IElement taskElement = getDtd().getElement(taskName); if (taskElement != null) { IAttribute attribute = taskElement.getAttributes().get(attributeName); @@ -987,8 +987,8 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im * Note that the completion mode must be property mode, otherwise it is not safe to call this method. */ protected ICompletionProposal[] getPropertyProposals(IDocument document, String prefix, int aCursorPosition) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(); - Map<String, ICompletionProposal> displayStringToProposals = new HashMap<String, ICompletionProposal>(); + List<ICompletionProposal> proposals = new ArrayList<>(); + Map<String, ICompletionProposal> displayStringToProposals = new HashMap<>(); Map<String, Object> properties = findPropertiesFromDocument(); Image image = AntUIImages.getImage(IAntUIConstants.IMG_PROPERTY); @@ -1054,7 +1054,7 @@ public class AntEditorCompletionProcessor extends TemplateCompletionProcessor im * the prefix that all proposals should start with. The prefix may be an empty string. */ protected ICompletionProposal[] getTaskProposals(IDocument document, String parentName, String prefix) { - List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>(250); + List<ICompletionProposal> proposals = new ArrayList<>(250); ICompletionProposal proposal; if (areTasksOrTypesValidChildren(parentName)) { // use the definitions in the project as that includes more than what is defined in the DTD diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java index 7a6d6c335..437f741a9 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/OccurrencesFinder.java @@ -65,9 +65,9 @@ public class OccurrencesFinder { if (occurrencesIdentifier == null) { return null; } - List<IAntElement> nodes = new ArrayList<IAntElement>(1); + List<IAntElement> nodes = new ArrayList<>(1); nodes.add(fAntModel.getProjectNode()); - List<IAntElement> usages = new ArrayList<IAntElement>(); + List<IAntElement> usages = new ArrayList<>(); usages.add(node); scanNodesForOccurrences(nodes, usages, occurrencesIdentifier); String identifier; @@ -81,7 +81,7 @@ public class OccurrencesFinder { if (length == 0) { return null; } - List<Position> positions = new ArrayList<Position>(usages.size()); + List<Position> positions = new ArrayList<>(usages.size()); for (IAntElement currentNode : usages) { List<Integer> offsets = currentNode.computeIdentifierOffsets(identifier); if (offsets != null) { diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java index 1724ce1fa..3fc90ec09 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/TaskDescriptionProvider.java @@ -78,7 +78,7 @@ public class TaskDescriptionProvider { void addChild(String name, ProposalNode node) { if (nodes == null) { - nodes = new HashMap<String, ProposalNode>(9); + nodes = new HashMap<>(9); } nodes.put(name, node); } @@ -134,7 +134,7 @@ public class TaskDescriptionProvider { * Parses the task description XML file and stores the information. */ protected void initialize() { - taskNodes = new HashMap<String, ProposalNode>(); + taskNodes = new HashMap<>(); Document doc = parseFile(TASKS_DESCRIPTION_XML_FILE_NAME); Node root = doc.getDocumentElement(); NodeList tasks = root.getChildNodes(); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/actions/RunToLineAdapter.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/actions/RunToLineAdapter.java index 9634e9af3..ec017a8eb 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/actions/RunToLineAdapter.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/actions/RunToLineAdapter.java @@ -92,7 +92,7 @@ public class RunToLineAdapter implements IRunToLineTarget { } private Map<String, Object> getRunToLineAttributes() { - Map<String, Object> attributes = new HashMap<String, Object>(); + Map<String, Object> attributes = new HashMap<>(); attributes.put(IMarker.TRANSIENT, Boolean.TRUE); attributes.put(IAntDebugConstants.ANT_RUN_TO_LINE, Boolean.TRUE); return attributes; diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java index 8248e3762..44c552997 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlDocumentFormattingStrategy.java @@ -24,7 +24,7 @@ import org.eclipse.jface.text.formatter.IFormattingContext; public class XmlDocumentFormattingStrategy extends ContextBasedFormattingStrategy { /** Documents to be formatted by this strategy */ - private final LinkedList<IDocument> fDocuments = new LinkedList<IDocument>(); + private final LinkedList<IDocument> fDocuments = new LinkedList<>(); /** access to the preferences store * */ private FormattingPreferences prefs; diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlElementFormattingStrategy.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlElementFormattingStrategy.java index f73638a5b..05024b8a8 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlElementFormattingStrategy.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlElementFormattingStrategy.java @@ -30,9 +30,9 @@ public class XmlElementFormattingStrategy extends ContextBasedFormattingStrategy private final FormattingPreferences prefs; /** Documents to be formatted by this strategy */ - private final LinkedList<IDocument> fDocuments = new LinkedList<IDocument>(); + private final LinkedList<IDocument> fDocuments = new LinkedList<>(); /** Partitions to be formatted by this strategy */ - private final LinkedList<TypedPosition> fPartitions = new LinkedList<TypedPosition>(); + private final LinkedList<TypedPosition> fPartitions = new LinkedList<>(); public XmlElementFormattingStrategy() { this.prefs = new FormattingPreferences(); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlFormatter.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlFormatter.java index 34563a839..ecb54a36e 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlFormatter.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlFormatter.java @@ -202,7 +202,7 @@ public class XmlFormatter { } private static int[] variablesToOffsets(TemplateVariable[] variables, int start) { - List<Integer> list = new ArrayList<Integer>(); + List<Integer> list = new ArrayList<>(); for (int i = 0; i != variables.length; i++) { int[] offsets = variables[i].getOffsets(); for (int j = 0; j != offsets.length; j++) { diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java index 9eb99a228..289912299 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/formatter/XmlTagFormatter.java @@ -55,7 +55,7 @@ public class XmlTagFormatter { protected static class Tag { - private List<AttributePair> fAttributes = new ArrayList<AttributePair>(); + private List<AttributePair> fAttributes = new ArrayList<>(); private boolean fClosed; @@ -274,7 +274,7 @@ public class XmlTagFormatter { } } - List<AttributePair> attributePairs = new ArrayList<AttributePair>(); + List<AttributePair> attributePairs = new ArrayList<>(); CharacterIterator iter = new StringCharacterIterator(elementText.substring(getElementName(elementText).length() + 2)); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java index c145e9434..aef7386ed 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntAnnotationModel.java @@ -31,8 +31,8 @@ import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel; public class AntAnnotationModel extends ResourceMarkerAnnotationModel implements IProblemRequestor { - private List<XMLProblemAnnotation> fGeneratedAnnotations = new ArrayList<XMLProblemAnnotation>(); - private List<IProblem> fCollectedProblems = new ArrayList<IProblem>(); + private List<XMLProblemAnnotation> fGeneratedAnnotations = new ArrayList<>(); + private List<IProblem> fCollectedProblems = new ArrayList<>(); public AntAnnotationModel(IFile file) { super(file); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java index c3a51ca43..19a8c1f19 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntExternalAnnotationModel.java @@ -24,8 +24,8 @@ import org.eclipse.jface.text.source.AnnotationModelEvent; public class AntExternalAnnotationModel extends AnnotationModel implements IProblemRequestor { - private List<XMLProblemAnnotation> fGeneratedAnnotations = new ArrayList<XMLProblemAnnotation>(); - private List<IProblem> fCollectedProblems = new ArrayList<IProblem>(); + private List<XMLProblemAnnotation> fGeneratedAnnotations = new ArrayList<>(); + private List<IProblem> fCollectedProblems = new ArrayList<>(); /* * (non-Javadoc) diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java index 80d2858be..029466900 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/AntFoldingStructureProvider.java @@ -39,7 +39,7 @@ public class AntFoldingStructureProvider { /** * A mapping of the foldable position to the <code>AntElementNode<code> that represent that region */ - private Map<Position, IAntElement> fPositionToElement = new HashMap<Position, IAntElement>(); + private Map<Position, IAntElement> fPositionToElement = new HashMap<>(); public AntFoldingStructureProvider(AntEditor editor) { fEditor = editor; @@ -48,7 +48,7 @@ public class AntFoldingStructureProvider { private void updateFoldingRegions(ProjectionAnnotationModel model, Set<Position> currentRegions) { Annotation[] deletions = computeDifferences(model, currentRegions); - Map<Annotation, Position> additionsMap = new HashMap<Annotation, Position>(); + Map<Annotation, Position> additionsMap = new HashMap<>(); for (Iterator<Position> iter = currentRegions.iterator(); iter.hasNext();) { Position position = iter.next(); IAntElement node = fPositionToElement.get(position); @@ -61,7 +61,7 @@ public class AntFoldingStructureProvider { } private Annotation[] computeDifferences(ProjectionAnnotationModel model, Set<Position> additions) { - List<Annotation> deletions = new ArrayList<Annotation>(); + List<Annotation> deletions = new ArrayList<>(); for (Iterator<Annotation> iter = model.getAnnotationIterator(); iter.hasNext();) { Object annotation = iter.next(); if (annotation instanceof ProjectionAnnotation) { @@ -78,15 +78,15 @@ public class AntFoldingStructureProvider { } public void updateFoldingRegions(AntModel antModel) { - fPositionToElement = new HashMap<Position, IAntElement>(); + fPositionToElement = new HashMap<>(); try { ProjectionAnnotationModel model = fEditor.getAdapter(ProjectionAnnotationModel.class); if (model == null) { return; } - Set<Position> currentRegions = new HashSet<Position>(); - List<IAntElement> root = new ArrayList<IAntElement>(); + Set<Position> currentRegions = new HashSet<>(); + List<IAntElement> root = new ArrayList<>(); AntProjectNode node = antModel.getProjectNode(); if (node != null && node.getOffset() != -1) { root.add(node); diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java index a7efdb9d7..c443751b8 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/text/NotifyingReconciler.java @@ -20,7 +20,7 @@ import org.eclipse.jface.text.reconciler.MonoReconciler; public class NotifyingReconciler extends MonoReconciler { - private ArrayList<IReconcilingParticipant> fReconcilingParticipants = new ArrayList<IReconcilingParticipant>(); + private ArrayList<IReconcilingParticipant> fReconcilingParticipants = new ArrayList<>(); /** * Constructor for NotifyingReconciler. @@ -49,7 +49,7 @@ public class NotifyingReconciler extends MonoReconciler { } protected void notifyReconcilingParticipants() { - Iterator<IReconcilingParticipant> i = new ArrayList<IReconcilingParticipant>(fReconcilingParticipants).iterator(); + Iterator<IReconcilingParticipant> i = new ArrayList<>(fReconcilingParticipants).iterator(); while (i.hasNext()) { i.next().reconciled(); } diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java index 814f58e60..e364686dd 100644 --- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java +++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java @@ -93,7 +93,7 @@ public class ProjectHelper extends ProjectHelper2 { private UnknownElement task = null; private Task currentTask = null; - private Map<String, String> fNormalizedFileNames = new HashMap<String, String>(); + private Map<String, String> fNormalizedFileNames = new HashMap<>(); /* * (non-Javadoc) diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java index d9e4926f2..105811a8e 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/AntUtil.java @@ -195,11 +195,11 @@ public final class AntUtil { private static Map<String, String> getAllProperties(ILaunchConfiguration config) throws CoreException { String allArgs = config.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String) null); - Map<String, String> properties = new HashMap<String, String>(); + Map<String, String> properties = new HashMap<>(); if (allArgs != null) { String[] arguments = ExternalToolsUtil.parseStringIntoList(allArgs); // filter arguments to avoid resolving variables that will prompt the user - List<String> filtered = new ArrayList<String>(); + List<String> filtered = new ArrayList<>(); Pattern pattern = Pattern.compile("\\$\\{.*_prompt.*\\}"); //$NON-NLS-1$ IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); for (int i = 0; i < arguments.length; i++) { @@ -229,7 +229,7 @@ public final class AntUtil { if (project == null || !project.hasChildren()) { return null; } - List<IAntElement> targets = new ArrayList<IAntElement>(); + List<IAntElement> targets = new ArrayList<>(); for (IAntElement node : project.getChildNodes()) { if (node instanceof AntTargetNode) { targets.add(node); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java index 93a48fb89..f31fb08bf 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java @@ -35,7 +35,7 @@ public class ColorManager implements ISharedTextColors { return fgColorManager; } - protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10); + protected Map<RGB, Color> fColorTable = new HashMap<>(10); @Override public Color getColor(RGB rgb) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java index d7ec27bf6..65bed28f7 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/AbstractJavacPatternMatcher.java @@ -37,8 +37,8 @@ public abstract class AbstractJavacPatternMatcher implements IPatternMatchListen protected TextConsole fConsole; private static Pattern fgLineNumberPattern = Pattern.compile("\\d+"); //$NON-NLS-1$ - private static List<AbstractJavacPatternMatcher> fgPatternMatchers = new ArrayList<AbstractJavacPatternMatcher>(); - private Map<String, IFile> fFileNameToIFile = new HashMap<String, IFile>(); + private static List<AbstractJavacPatternMatcher> fgPatternMatchers = new ArrayList<>(); + private Map<String, IFile> fFileNameToIFile = new HashMap<>(); private JavacMarkerCreator fMarkerCreator; protected static final Integer fgWarningType = new Integer(IMarker.SEVERITY_WARNING); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java index 2bba1bdb8..10d7d4403 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/console/JavacMarkerCreator.java @@ -38,8 +38,8 @@ public class JavacMarkerCreator { private final TextConsole fConsole; private IProcess fProcess; - private static List<IFile> fgFilesToBeCleaned = new ArrayList<IFile>(); - private Map<IFile, List<MarkerInfo>> fFileToMarkerInfo = new HashMap<IFile, List<MarkerInfo>>(); + private static List<IFile> fgFilesToBeCleaned = new ArrayList<>(); + private Map<IFile, List<MarkerInfo>> fFileToMarkerInfo = new HashMap<>(); private final boolean fUseCustomMessage; private class MarkerInfo { @@ -99,7 +99,7 @@ public class JavacMarkerCreator { info.setType(type); List<MarkerInfo> infos = fFileToMarkerInfo.get(file); if (infos == null) { - infos = new ArrayList<MarkerInfo>(); + infos = new ArrayList<>(); fFileToMarkerInfo.put(file, infos); } infos.add(info); @@ -113,7 +113,7 @@ public class JavacMarkerCreator { try { for (MarkerInfo info : infos) { IMarker marker = file.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); - Map<String, Object> attributes = new HashMap<String, Object>(3); + Map<String, Object> attributes = new HashMap<>(3); attributes.put(IMarker.LINE_NUMBER, new Integer(info.fLineNumber)); String message = getMessage(info); attributes.put(IMarker.MESSAGE, message); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java index ae881e004..bb3867691 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntBuildfileExportPage.java @@ -63,7 +63,7 @@ import com.ibm.icu.text.MessageFormat; public class AntBuildfileExportPage extends WizardPage { private CheckboxTableViewer fTableViewer; - private List<IJavaProject> fSelectedJavaProjects = new ArrayList<IJavaProject>(); + private List<IJavaProject> fSelectedJavaProjects = new ArrayList<>(); private Button compatibilityCheckbox; private Button compilerCheckbox; private Text buildfilenameText; @@ -252,8 +252,8 @@ public class AntBuildfileExportPage extends WizardPage { complete = false; } try { - List<String> projectsWithErrors = new ArrayList<String>(); - List<String> projectsWithWarnings = new ArrayList<String>(); + List<String> projectsWithErrors = new ArrayList<>(); + List<String> projectsWithWarnings = new ArrayList<>(); findCyclicProjects(getProjects(false), projectsWithErrors, projectsWithWarnings); if (projectsWithErrors.size() > 0) { String message = DataTransferMessages.AntBuildfileExportPage_cycle_error_in_projects; @@ -311,7 +311,7 @@ public class AntBuildfileExportPage extends WizardPage { */ public boolean generateBuildfiles() { setErrorMessage(null); - final List<String> projectNames = new ArrayList<String>(); + final List<String> projectNames = new ArrayList<>(); final Set<IJavaProject> projects; try { projects = getProjects(true); @@ -385,7 +385,7 @@ public class AntBuildfileExportPage extends WizardPage { */ private Set<IJavaProject> getProjects(boolean displayConfirmation) throws JavaModelException { // collect all projects to create buildfiles for - Set<IJavaProject> projects = new TreeSet<IJavaProject>(ExportUtil.getJavaProjectComparator()); + Set<IJavaProject> projects = new TreeSet<>(ExportUtil.getJavaProjectComparator()); Iterator<IJavaProject> javaProjects = fSelectedJavaProjects.iterator(); while (javaProjects.hasNext()) { IJavaProject javaProject = javaProjects.next(); @@ -399,7 +399,7 @@ public class AntBuildfileExportPage extends WizardPage { String message = DataTransferMessages.AntBuildfileExportPage_3 + ExportUtil.NEWLINE + ExportUtil.toString(confirmOverwrite, ExportUtil.NEWLINE); if (!MessageDialog.openQuestion(getShell(), DataTransferMessages.AntBuildfileExportPage_4, message)) { - return new TreeSet<IJavaProject>(ExportUtil.getJavaProjectComparator()); + return new TreeSet<>(ExportUtil.getJavaProjectComparator()); } } return projects; @@ -439,7 +439,7 @@ public class AntBuildfileExportPage extends WizardPage { * @return set of project names */ private List<String> getConfirmOverwriteSet(Set<IJavaProject> javaProjects) { - List<String> result = new ArrayList<String>(javaProjects.size()); + List<String> result = new ArrayList<>(javaProjects.size()); for (IJavaProject project : javaProjects) { String projectRoot = ExportUtil.getProjectRoot(project); if (ExportUtil.existsUserFile(projectRoot + buildfilenameText.getText())) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java index fd2143ede..2d4ef73f5 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/AntNewJavaProjectPage.java @@ -92,7 +92,7 @@ public class AntNewJavaProjectPage extends WizardPage { AntProjectNode projectNode = fAntModel == null ? null : fAntModel.getProjectNode(); if (fAntModel != null && projectNode != null) { setProjectName(); // page will be validated on setting the project name - List<AntTaskNode> javacNodes = new ArrayList<AntTaskNode>(); + List<AntTaskNode> javacNodes = new ArrayList<>(); getJavacNodes(javacNodes, projectNode); fTableViewer.setInput(javacNodes.toArray()); if (!javacNodes.isEmpty()) { @@ -463,7 +463,7 @@ public class AntNewJavaProjectPage extends WizardPage { } private List<?> resolveJavacTasks(List<?> javacNodes) { - List<Object> resolvedJavacTasks = new ArrayList<Object>(javacNodes.size()); + List<Object> resolvedJavacTasks = new ArrayList<>(javacNodes.size()); Iterator<?> nodes = javacNodes.iterator(); while (nodes.hasNext()) { AntTaskNode taskNode = (AntTaskNode) nodes.next(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java index 52831dafa..1043bc763 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/BuildFileCreator.java @@ -94,7 +94,7 @@ public class BuildFileCreator { private String projectRoot; private Map<String, String> variable2valueMap; private Shell shell; - private Set<String> visited = new TreeSet<String>(); // record used subclasspaths + private Set<String> visited = new TreeSet<>(); // record used subclasspaths private Node classpathNode; /** @@ -110,7 +110,7 @@ public class BuildFileCreator { this.project = project; this.projectName = project.getProject().getName(); this.projectRoot = ExportUtil.getProjectRoot(project); - this.variable2valueMap = new LinkedHashMap<String, String>(); + this.variable2valueMap = new LinkedHashMap<>(); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); this.doc = dbf.newDocumentBuilder().newDocument(); this.shell = shell; @@ -128,7 +128,7 @@ public class BuildFileCreator { * thrown when user cancels task */ public static List<String> createBuildFiles(Set<IJavaProject> projects, Shell shell, IProgressMonitor pm) throws JavaModelException, ParserConfigurationException, TransformerConfigurationException, TransformerException, IOException, CoreException, InterruptedException { - List<String> res = new ArrayList<String>(); + List<String> res = new ArrayList<>(); try { createBuildFilesLoop(projects, shell, pm, res); } @@ -143,7 +143,7 @@ public class BuildFileCreator { private static void createBuildFilesLoop(Set<IJavaProject> projects, Shell shell, IProgressMonitor pm, List<String> res) throws CoreException, ParserConfigurationException, JavaModelException, TransformerConfigurationException, TransformerFactoryConfigurationError, TransformerException, UnsupportedEncodingException { // determine files to create/change - List<IFile> files = new ArrayList<IFile>(); + List<IFile> files = new ArrayList<>(); for (Iterator<IJavaProject> iter = projects.iterator(); iter.hasNext();) { IJavaProject currentProject = iter.next(); IFile file = currentProject.getProject().getFile(BuildFileCreator.BUILD_XML); @@ -216,7 +216,7 @@ public class BuildFileCreator { boolean lines = JavaCore.GENERATE.equals(project.getOption(JavaCore.COMPILER_LINE_NUMBER_ATTR, true)); boolean vars = JavaCore.GENERATE.equals(project.getOption(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, true)); - List<String> debuglevel = new ArrayList<String>(); + List<String> debuglevel = new ArrayList<>(); if (source) { debuglevel.add("source"); //$NON-NLS-1$ } @@ -520,7 +520,7 @@ public class BuildFileCreator { // Check filter for copying resources String filter = project.getOption(JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, true); StringTokenizer tokenizer = new StringTokenizer(filter, ","); //$NON-NLS-1$ - ArrayList<String> filters = new ArrayList<String>(); + ArrayList<String> filters = new ArrayList<>(); while (tokenizer.hasMoreTokens()) { filters.add(tokenizer.nextToken()); } @@ -687,9 +687,9 @@ public class BuildFileCreator { // Side effect: Eclipse inclusion and exclusion filters apply to the specified source directory. // Ant inclusion and exclusion filters apply to all source directories. // This may lead to unexpected behavior. - HashMap<String, List<String>> class2sources = new HashMap<String, List<String>>(); - HashMap<String, List<String>> class2includes = new HashMap<String, List<String>>(); - HashMap<String, List<String>> class2excludes = new HashMap<String, List<String>>(); + HashMap<String, List<String>> class2sources = new HashMap<>(); + HashMap<String, List<String>> class2includes = new HashMap<>(); + HashMap<String, List<String>> class2excludes = new HashMap<>(); for (int i = 0; i < srcDirs.size(); i++) { String srcDir = srcDirs.get(i); if (!EclipseClasspath.isReference(srcDir)) { @@ -700,9 +700,9 @@ public class BuildFileCreator { List<String> list2 = class2includes.get(classDir); List<String> list3 = class2excludes.get(classDir); if (list == null) { - list = new ArrayList<String>(); - list2 = new ArrayList<String>(); - list3 = new ArrayList<String>(); + list = new ArrayList<>(); + list2 = new ArrayList<>(); + list3 = new ArrayList<>(); class2sources.put(classDir, list); class2includes.put(classDir, list2); class2excludes.put(classDir, list3); @@ -781,7 +781,7 @@ public class BuildFileCreator { * Create target build-refprojects which compiles projects which reference current project. */ private void createBuildRef() throws JavaModelException { - Set<IJavaProject> refProjects = new TreeSet<IJavaProject>(ExportUtil.getJavaProjectComparator()); + Set<IJavaProject> refProjects = new TreeSet<>(ExportUtil.getJavaProjectComparator()); IJavaProject[] projects = project.getJavaModel().getJavaProjects(); for (int i = 0; i < projects.length; i++) { List<IJavaProject> subProjects = ExportUtil.getClasspathProjects(projects[i]); @@ -1117,7 +1117,7 @@ public class BuildFileCreator { // Case 2: Run all tests in project, package or source folder String container = conf.getAttribute("org.eclipse.jdt.junit.CONTAINER" /* JUnitBaseLaunchConfiguration.LAUNCH_CONTAINER_ATTR */, IAntCoreConstants.EMPTY_STRING); //$NON-NLS-1$ IType[] types = ExportUtil.findTestsInContainer(container); - Set<IType> sortedTypes = new TreeSet<IType>(ExportUtil.getITypeComparator()); + Set<IType> sortedTypes = new TreeSet<>(ExportUtil.getITypeComparator()); sortedTypes.addAll(Arrays.asList(types)); for (Iterator<IType> iter = sortedTypes.iterator(); iter.hasNext();) { IType type = iter.next(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java index 98d7d5cf2..bb51af315 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/EclipseClasspath.java @@ -45,18 +45,18 @@ import org.w3c.dom.Element; */ public class EclipseClasspath { - protected List<String> srcDirs = new ArrayList<String>(); - protected List<String> classDirs = new ArrayList<String>(); - protected List<List<String>> inclusionLists = new ArrayList<List<String>>(); - protected List<List<String>> exclusionLists = new ArrayList<List<String>>(); + protected List<String> srcDirs = new ArrayList<>(); + protected List<String> classDirs = new ArrayList<>(); + protected List<List<String>> inclusionLists = new ArrayList<>(); + protected List<List<String>> exclusionLists = new ArrayList<>(); - protected Map<String, String> variable2valueMap = new LinkedHashMap<String, String>(); - protected List<String> rawClassPathEntries = new ArrayList<String>(); - protected List<String> rawClassPathEntriesAbsolute = new ArrayList<String>(); + protected Map<String, String> variable2valueMap = new LinkedHashMap<>(); + protected List<String> rawClassPathEntries = new ArrayList<>(); + protected List<String> rawClassPathEntriesAbsolute = new ArrayList<>(); private IJavaProject project; - private static Map<String, IClasspathContainer> userLibraryCache = new HashMap<String, IClasspathContainer>(); + private static Map<String, IClasspathContainer> userLibraryCache = new HashMap<>(); /** * Initialize object with classpath of given project. @@ -83,7 +83,7 @@ public class EclipseClasspath { IRuntimeClasspathEntry[] runtimeEntries; // see AbstractJavaLaunchConfigurationDelegate runtimeEntries = JavaRuntime.computeUnresolvedRuntimeClasspath(conf); - List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>(runtimeEntries.length); + List<IClasspathEntry> classpathEntries = new ArrayList<>(runtimeEntries.length); for (int i = 0; i < runtimeEntries.length; i++) { IRuntimeClasspathEntry entry = runtimeEntries[i]; if (bootstrap && (entry.getClasspathProperty() == IRuntimeClasspathEntry.BOOTSTRAP_CLASSES) || !bootstrap @@ -142,7 +142,7 @@ public class EclipseClasspath { rawClassPathEntries.add(classDir); rawClassPathEntriesAbsolute.add(classDirAbsolute); IPath[] inclusions = entry.getInclusionPatterns(); - List<String> inclusionList = new ArrayList<String>(); + List<String> inclusionList = new ArrayList<>(); for (int j = 0; j < inclusions.length; j++) { if (inclusions[j] != null) { inclusionList.add(ExportUtil.removeProjectRoot(inclusions[j].toString(), project.getProject())); @@ -150,7 +150,7 @@ public class EclipseClasspath { } inclusionLists.add(inclusionList); IPath[] exclusions = entry.getExclusionPatterns(); - List<String> exclusionList = new ArrayList<String>(); + List<String> exclusionList = new ArrayList<>(); for (int j = 0; j < exclusions.length; j++) { if (exclusions[j] != null) { exclusionList.add(ExportUtil.removeProjectRoot(exclusions[j].toString(), project.getProject())); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java index f73324b67..ae14c0472 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/ExportUtil.java @@ -219,7 +219,7 @@ public class ExportUtil { * @return set of IJavaProject objects */ public static List<IJavaProject> getClasspathProjects(IJavaProject project) throws JavaModelException { - List<IJavaProject> projects = new ArrayList<IJavaProject>(); + List<IJavaProject> projects = new ArrayList<>(); IClasspathEntry entries[] = project.getRawClasspath(); addClasspathProjects(projects, entries); return sortProjectsUsingBuildOrder(projects); @@ -246,7 +246,7 @@ public class ExportUtil { * @return set of IJavaProject objects */ public static List<IJavaProject> getClasspathProjectsRecursive(IJavaProject project) throws JavaModelException { - LinkedList<IJavaProject> result = new LinkedList<IJavaProject>(); + LinkedList<IJavaProject> result = new LinkedList<>(); getClasspathProjectsRecursive(project, result); return sortProjectsUsingBuildOrder(result); } @@ -273,7 +273,7 @@ public class ExportUtil { if (javaProjects.isEmpty()) { return javaProjects; } - List<IJavaProject> result = new ArrayList<IJavaProject>(javaProjects.size()); + List<IJavaProject> result = new ArrayList<>(javaProjects.size()); IWorkspace workspace = ResourcesPlugin.getWorkspace(); String[] buildOrder = workspace.getDescription().getBuildOrder(); if (buildOrder == null) {// default build order @@ -534,7 +534,7 @@ public class ExportUtil { * @return new list without duplicates */ public static List<String> removeDuplicates(List<String> l) { - List<String> res = new ArrayList<String>(); + List<String> res = new ArrayList<>(); for (Iterator<String> iter = l.iterator(); iter.hasNext();) { String element = iter.next(); if (!res.contains(element)) { @@ -594,7 +594,7 @@ public class ExportUtil { * thrown if project is under version control, but not connected */ public static Set<IFile> validateEdit(Shell shell, List<IFile> files) throws CoreException { - Set<IFile> confirmedFiles = new TreeSet<IFile>(getIFileComparator()); + Set<IFile> confirmedFiles = new TreeSet<>(getIFileComparator()); if (files.size() == 0) { return confirmedFiles; } diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/SourceAnalyzer.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/SourceAnalyzer.java index 49b012735..16795fed8 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/SourceAnalyzer.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/datatransfer/SourceAnalyzer.java @@ -55,13 +55,13 @@ public class SourceAnalyzer { */ public static void checkCycles(IJavaProject currentProject, EclipseClasspath classpath, Shell shell) { StringBuffer message = new StringBuffer(); - Map<String, String> src2dir = new TreeMap<String, String>(); // map string to string - Map<String, Set<String>> srcdir2classes = new TreeMap<String, Set<String>>(); // map string to Set of strings + Map<String, String> src2dir = new TreeMap<>(); // map string to string + Map<String, Set<String>> srcdir2classes = new TreeMap<>(); // map string to Set of strings determineSources(currentProject, classpath, src2dir, srcdir2classes); Map<String, Set<String>> srcdir2sourcedirs = determineRequiredSrcDirs(src2dir, srcdir2classes); String projectName = currentProject.getProject().getName(); - List<String> cycle = new ArrayList<String>(); + List<String> cycle = new ArrayList<>(); if (isCyclic(srcdir2sourcedirs, cycle)) { showCycleWarning(projectName, shell, cycle, message); return; @@ -108,7 +108,7 @@ public class SourceAnalyzer { } Set<String> classes = srcdir2classes.get(srcDir); if (classes == null) { - classes = new TreeSet<String>(); + classes = new TreeSet<>(); } classes.addAll(getRequiredClasses(classFile)); srcdir2classes.put(srcDir, classes); @@ -122,7 +122,7 @@ public class SourceAnalyzer { * @return Map string to Set of strings. (Maps source dir to Set of required source dirs.) */ private static Map<String, Set<String>> determineRequiredSrcDirs(Map<String, String> src2dir, Map<String, Set<String>> srcdir2classes) { - Map<String, Set<String>> srcdir2sourcedirs = new TreeMap<String, Set<String>>(); // map string to Set of strings + Map<String, Set<String>> srcdir2sourcedirs = new TreeMap<>(); // map string to Set of strings for (Iterator<String> iter = srcdir2classes.keySet().iterator(); iter.hasNext();) { String srcDir = iter.next(); Set<String> classes = srcdir2classes.get(srcDir); @@ -133,7 +133,7 @@ public class SourceAnalyzer { if (classsrc != null && !classsrc.equals(srcDir)) { Set<String> sourcedirs = srcdir2sourcedirs.get(srcDir); if (sourcedirs == null) { - sourcedirs = new TreeSet<String>(); + sourcedirs = new TreeSet<>(); } sourcedirs.add(classsrc); srcdir2sourcedirs.put(srcDir, sourcedirs); @@ -188,7 +188,7 @@ public class SourceAnalyzer { * @return set of strings, each contains a full qualified class name (forward slash as package separator) */ public static Set<String> getRequiredClasses(IFile file) { - Set<String> classes = new TreeSet<String>(); + Set<String> classes = new TreeSet<>(); IClassFile classFile = JavaCore.createClassFileFrom(file); IClassFileReader reader = ToolFactory.createDefaultClassFileReader(classFile, IClassFileReader.CONSTANT_POOL); if (reader == null) { @@ -221,7 +221,7 @@ public class SourceAnalyzer { * @return filenames relative to directory (without extension and with forward slashes) */ public static Set<String> findFiles(File dir, String extension) { - Set<String> visited = new TreeSet<String>(); + Set<String> visited = new TreeSet<>(); findFiles(dir, dir, extension, visited); return visited; } @@ -253,8 +253,8 @@ public class SourceAnalyzer { private static boolean isAcyclic(Map<String, Set<String>> srcdir2sourcedirs, List<String> cycle) { // standard graph theory - List<String> visited = new ArrayList<String>(); - List<String> exited = new ArrayList<String>(); + List<String> visited = new ArrayList<>(); + List<String> exited = new ArrayList<>(); for (Iterator<String> iter = srcdir2sourcedirs.keySet().iterator(); iter.hasNext();) { String srcdir = iter.next(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java index 69a9a001d..6549257be 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntBuilderTargetsTab.java @@ -56,7 +56,7 @@ public class AntBuilderTargetsTab extends AbstractLaunchConfigurationTab { private Text fAutoBuildTargetText; private Text fDuringCleanTargetText; - private Map<String, String> fAttributeToTargets = new HashMap<String, String>(); + private Map<String, String> fAttributeToTargets = new HashMap<>(); private static final String NOT_ENABLED = AntLaunchConfigurationMessages.AntBuilderTargetsTab_0; private static final String DEFAULT_TARGET_SELECTED = AntLaunchConfigurationMessages.AntBuilderTargetsTab_10; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchShortcut.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchShortcut.java index c7bcd194e..95e2435e4 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchShortcut.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchShortcut.java @@ -207,7 +207,7 @@ public class AntLaunchShortcut implements ILaunchShortcut2 { if (type != null) { try { ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type); - ArrayList<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>(); + ArrayList<ILaunchConfiguration> list = new ArrayList<>(); IPath location = null; for (int i = 0; i < configs.length; i++) { if (configs[i].exists()) { @@ -422,7 +422,7 @@ public class AntLaunchShortcut implements ILaunchShortcut2 { * @return list of launch configurations */ public static List<ILaunchConfiguration> findExistingLaunchConfigurations(IFile file) { - List<ILaunchConfiguration> validConfigs = new ArrayList<ILaunchConfiguration>(); + List<ILaunchConfiguration> validConfigs = new ArrayList<>(); if (file != null) { IPath filePath = file.getLocation(); if (filePath != null) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java index aeb2b344e..72bc2a528 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntPropertiesTab.java @@ -188,7 +188,7 @@ public class AntPropertiesTab extends AbstractLaunchConfigurationTab implements Object[] items = fAntPropertiesBlock.getProperties(); Map<String, String> properties = null; if (items.length > 0) { - properties = new HashMap<String, String>(items.length); + properties = new HashMap<>(items.length); for (int i = 0; i < items.length; i++) { Property property = (Property) items[i]; properties.put(property.getName(), property.getValue(false)); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntTargetsTab.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntTargetsTab.java index 0df98e1c5..cb2ff3570 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntTargetsTab.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntTargetsTab.java @@ -639,7 +639,7 @@ public class AntTargetsTab extends AbstractLaunchConfigurationTab { public void initializeFrom(ILaunchConfiguration configuration) { fInitializing = true; fLaunchConfiguration = configuration; - fOrderedTargets = new ArrayList<AntTargetNode>(); + fOrderedTargets = new ArrayList<>(); setErrorMessage(null); setMessage(null); setDirty(true); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TargetOrderDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TargetOrderDialog.java index cb15f00d0..d0d02fbdf 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TargetOrderDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TargetOrderDialog.java @@ -127,7 +127,7 @@ public class TargetOrderDialog extends Dialog implements ISelectionChangedListen if (targets.isEmpty()) { return; } - List<AntTargetNode> list = new ArrayList<AntTargetNode>(Arrays.asList(fTargets)); + List<AntTargetNode> list = new ArrayList<>(Arrays.asList(fTargets)); int bottom = list.size() - 1; int index = 0; for (int i = targets.size() - 1; i >= 0; i--) { @@ -151,7 +151,7 @@ public class TargetOrderDialog extends Dialog implements ISelectionChangedListen } int top = 0; int index = 0; - List<AntTargetNode> list = new ArrayList<AntTargetNode>(Arrays.asList(fTargets)); + List<AntTargetNode> list = new ArrayList<>(Arrays.asList(fTargets)); Iterator<AntTargetNode> entries = targets.iterator(); while (entries.hasNext()) { AntTargetNode target = entries.next(); @@ -183,7 +183,7 @@ public class TargetOrderDialog extends Dialog implements ISelectionChangedListen * @return targets for an action */ private List<AntTargetNode> getOrderedSelection() { - List<AntTargetNode> targets = new ArrayList<AntTargetNode>(); + List<AntTargetNode> targets = new ArrayList<>(); List<?> selection = ((IStructuredSelection) fViewer.getSelection()).toList(); for (int i = 0; i < fTargets.length; i++) { AntTargetNode target = fTargets[i]; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TaskLinkManager.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TaskLinkManager.java index abeca1e4f..d7eef1749 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TaskLinkManager.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/TaskLinkManager.java @@ -39,7 +39,7 @@ import org.eclipse.ui.console.IHyperlink; */ public class TaskLinkManager { - private static Map<String, IFile> fFileNameToIFile = new HashMap<String, IFile>(); + private static Map<String, IFile> fFileNameToIFile = new HashMap<>(); /** * Not to be called. diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntAugmentTaskNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntAugmentTaskNode.java index 8eea88e0b..b6f8be9c2 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntAugmentTaskNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntAugmentTaskNode.java @@ -99,7 +99,7 @@ public class AntAugmentTaskNode extends AntTaskNode { if (text == null || text.length() == 0) { return null; } - ArrayList<Integer> list = new ArrayList<Integer>(); + ArrayList<Integer> list = new ArrayList<>(); int idx = text.indexOf(attrId); if (idx > -1) { list.add(new Integer(getOffset() + idx)); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntDefiningTaskNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntDefiningTaskNode.java index d283033ff..682ece299 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntDefiningTaskNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntDefiningTaskNode.java @@ -88,11 +88,11 @@ public class AntDefiningTaskNode extends AntTaskNode { try { ComponentHelper helper = ComponentHelper.getComponentHelper(getProjectNode().getProject()); ((AntModel) getAntModel()).removeDefinerTasks(getIdentifier(), helper.getAntTypeTable()); - Hashtable<String, AntTypeDefinition> old = new Hashtable<String, AntTypeDefinition>(helper.getAntTypeTable()); + Hashtable<String, AntTypeDefinition> old = new Hashtable<>(helper.getAntTypeTable()); getTask().maybeConfigure(); getTask().execute(); Iterator<String> newNames = helper.getAntTypeTable().keySet().iterator(); - List<String> defined = new ArrayList<String>(); + List<String> defined = new ArrayList<>(); while (newNames.hasNext()) { String name = newNames.next(); if (old.get(name) == null) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java index 748ad03f0..f61bb6963 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntElementNode.java @@ -209,7 +209,7 @@ public class AntElementNode implements IAdaptable, IAntElement { childElement.setParent(this); synchronized (this) { if (fChildNodes == null) { - fChildNodes = new ArrayList<IAntElement>(); + fChildNodes = new ArrayList<>(); } fChildNodes.add(childElement); childElement.setIndex(fChildNodes.size() - 1); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java index 77dc33eac..989840315 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java @@ -106,11 +106,11 @@ public class AntModel implements IAntModel { * <P> * On top of the stack is the innermost element. */ - private Stack<AntElementNode> fStillOpenElements = new Stack<AntElementNode>(); + private Stack<AntElementNode> fStillOpenElements = new Stack<>(); - private Map<Task, AntTaskNode> fTaskToNode = new HashMap<Task, AntTaskNode>(); + private Map<Task, AntTaskNode> fTaskToNode = new HashMap<>(); - private List<AntTaskNode> fTaskNodes = new ArrayList<AntTaskNode>(); + private List<AntTaskNode> fTaskNodes = new ArrayList<>(); private final Object fDirtyLock = new Object(); private boolean fIsDirty = true; @@ -124,7 +124,7 @@ public class AntModel implements IAntModel { private IDocumentListener fListener; private AntEditorMarkerUpdater fMarkerUpdater = null; - private List<AntElementNode> fNonStructuralNodes = new ArrayList<AntElementNode>(1); + private List<AntElementNode> fNonStructuralNodes = new ArrayList<>(1); private IPreferenceChangeListener fCoreListener = new IPreferenceChangeListener() { @Override @@ -319,18 +319,18 @@ public class AntModel implements IAntModel { private void reset() { fCurrentTargetNode = null; - fStillOpenElements = new Stack<AntElementNode>(); - fTaskToNode = new HashMap<Task, AntTaskNode>(); - fTaskNodes = new ArrayList<AntTaskNode>(); + fStillOpenElements = new Stack<>(); + fTaskToNode = new HashMap<>(); + fTaskNodes = new ArrayList<>(); fNodeBeingResolved = null; fNodeBeingResolvedIndex = -1; fLastNode = null; fCurrentNodeIdentifiers = null; fNamespacePrefixMappings = null; - fNonStructuralNodes = new ArrayList<AntElementNode>(1); + fNonStructuralNodes = new ArrayList<>(1); if (fDefinersToText != null) { - fPreviousDefinersToText = new HashMap<String, String>(fDefinersToText); + fPreviousDefinersToText = new HashMap<>(fDefinersToText); fDefinersToText = null; } } @@ -414,8 +414,8 @@ public class AntModel implements IAntModel { private void prepareForFullIncremental() { fProjectNode.reset(); - fTaskToNode = new HashMap<Task, AntTaskNode>(); - fTaskNodes = new ArrayList<AntTaskNode>(); + fTaskToNode = new HashMap<>(); + fTaskNodes = new ArrayList<>(); } private void initializeProject(Project project, ClassLoader loader) { @@ -557,7 +557,7 @@ public class AntModel implements IAntModel { } private void resolveBuildfile() { - Collection<AntTaskNode> nodeCopy = new ArrayList<AntTaskNode>(fTaskNodes); + Collection<AntTaskNode> nodeCopy = new ArrayList<>(fTaskNodes); Iterator<AntTaskNode> iter = nodeCopy.iterator(); while (iter.hasNext()) { AntTaskNode node = iter.next(); @@ -895,7 +895,7 @@ public class AntModel implements IAntModel { @Override public void addEntity(String entityName, String entityPath) { if (fEntityNameToPath == null) { - fEntityNameToPath = new HashMap<String, String>(); + fEntityNameToPath = new HashMap<>(); } fEntityNameToPath.put(entityName, entityPath); } @@ -1815,8 +1815,8 @@ public class AntModel implements IAntModel { @Override public void setDefiningTaskNodeText(AntDefiningTaskNode node) { if (fDefinersToText == null) { - fDefinersToText = new HashMap<String, String>(); - fCurrentNodeIdentifiers = new HashMap<String, String>(); + fDefinersToText = new HashMap<>(); + fCurrentNodeIdentifiers = new HashMap<>(); } String nodeIdentifier = node.getIdentifier(); @@ -1855,8 +1855,8 @@ public class AntModel implements IAntModel { protected void addDefinedTasks(List<String> newTasks, AntDefiningTaskNode node) { if (fTaskNameToDefiningNode == null) { - fTaskNameToDefiningNode = new HashMap<String, AntDefiningTaskNode>(); - fDefinerNodeIdentifierToDefinedTasks = new HashMap<String, List<String>>(); + fTaskNameToDefiningNode = new HashMap<>(); + fDefinerNodeIdentifierToDefinedTasks = new HashMap<>(); } String identifier = node.getIdentifier(); @@ -1939,7 +1939,7 @@ public class AntModel implements IAntModel { @Override public void addPrefixMapping(String prefix, String uri) { if (fNamespacePrefixMappings == null) { - fNamespacePrefixMappings = new HashMap<String, String>(); + fNamespacePrefixMappings = new HashMap<>(); } fNamespacePrefixMappings.put(prefix, uri); } diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java index e056369d5..b39d886e7 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelCore.java @@ -41,7 +41,7 @@ public class AntModelCore implements IBreakpointsListener { return inst; } - private List<IAntModelListener> fModelChangeListeners = new ArrayList<IAntModelListener>(); + private List<IAntModelListener> fModelChangeListeners = new ArrayList<>(); private AntModelCore() { } @@ -61,7 +61,7 @@ public class AntModelCore implements IBreakpointsListener { public void notifyAntModelListeners(AntModelChangeEvent event) { Iterator<IAntModelListener> i; synchronized (fModelChangeListeners) { - i = new ArrayList<IAntModelListener>(fModelChangeListeners).iterator(); + i = new ArrayList<>(fModelChangeListeners).iterator(); } while (i.hasNext()) { i.next().antModelChanged(event); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNode.java index 226bcfd74..9c232d624 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntProjectNode.java @@ -150,7 +150,7 @@ public class AntProjectNode extends AntElementNode { if (textToSearch == null || textToSearch.length() == 0 || identifier.length() == 0) { return null; } - List<Integer> results = new ArrayList<Integer>(1); + List<Integer> results = new ArrayList<>(1); String newidentifier = new StringBuffer("\"").append(identifier).append('"').toString(); //$NON-NLS-1$ int defaultTargetNameOffset = textToSearch.indexOf(IAntCoreConstants.DEFAULT); defaultTargetNameOffset = textToSearch.indexOf(newidentifier, defaultTargetNameOffset); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java index 7e7119ced..1cd179cab 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java @@ -138,7 +138,7 @@ public class AntPropertyNode extends AntTaskNode { */ public void addProperty(String propertyName, String value) { if (fProperties == null) { - fProperties = new HashMap<String, String>(1); + fProperties = new HashMap<>(1); } fProperties.put(propertyName, value); } @@ -236,7 +236,7 @@ public class AntPropertyNode extends AntTaskNode { if (textToSearch == null || textToSearch.length() == 0 || identifier.length() == 0) { return null; } - List<Integer> results = new ArrayList<Integer>(); + List<Integer> results = new ArrayList<>(); if (fBaseLabel != null) { if (fBaseLabel.equals(identifier)) { int nameOffset = textToSearch.indexOf(IAntCoreConstants.NAME); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTargetNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTargetNode.java index 410655480..bf03df39e 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTargetNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTargetNode.java @@ -206,7 +206,7 @@ public class AntTargetNode extends AntElementNode { if (textToSearch == null || textToSearch.length() == 0 || identifier.length() == 0) { return null; } - List<Integer> results = new ArrayList<Integer>(); + List<Integer> results = new ArrayList<>(); if (getTargetName().equals(identifier)) { int nameOffset = textToSearch.indexOf(IAntCoreConstants.NAME); nameOffset = textToSearch.indexOf(identifier, nameOffset); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTaskNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTaskNode.java index 41fb0c9da..eeabfdd76 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTaskNode.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntTaskNode.java @@ -185,7 +185,7 @@ public class AntTaskNode extends AntElementNode { if (textToSearch == null || textToSearch.length() == 0 || identifier.length() == 0) { return null; } - List<Integer> results = new ArrayList<Integer>(); + List<Integer> results = new ArrayList<>(); RuntimeConfigurable wrapper = getTask().getRuntimeConfigurableWrapper(); Map<String, Object> attributeMap = wrapper.getAttributeMap(); Set<String> keys = attributeMap.keySet(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java index 873a7c2a1..60565e9eb 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractAntEditorPreferencePage.java @@ -51,7 +51,7 @@ public abstract class AbstractAntEditorPreferencePage extends PreferencePage imp protected List<IStatus> fStatusList; private boolean fInitialized = false; - private Map<Button, String> fCheckBoxes = new HashMap<Button, String>(); + private Map<Button, String> fCheckBoxes = new HashMap<>(); private SelectionListener fCheckBoxListener = new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { @@ -65,7 +65,7 @@ public abstract class AbstractAntEditorPreferencePage extends PreferencePage imp } }; - private Map<Text, String> fTextFields = new HashMap<Text, String>(); + private Map<Text, String> fTextFields = new HashMap<>(); private ModifyListener fTextFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -76,7 +76,7 @@ public abstract class AbstractAntEditorPreferencePage extends PreferencePage imp } }; - private Map<Text, String[]> fNumberFields = new HashMap<Text, String[]>(); + private Map<Text, String[]> fNumberFields = new HashMap<>(); private ModifyListener fNumberFieldListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { @@ -270,7 +270,7 @@ public abstract class AbstractAntEditorPreferencePage extends PreferencePage imp List<IStatus> statusList = getStatusList(); if (statusList != null) { - List<IStatus> temp = new ArrayList<IStatus>(statusList.size() + 1); + List<IStatus> temp = new ArrayList<>(statusList.size() + 1); temp.add(status); temp.addAll(statusList); status = getMostSevere(temp); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractClasspathEntry.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractClasspathEntry.java index 9bef2bd0d..aea4aed2e 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractClasspathEntry.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AbstractClasspathEntry.java @@ -18,7 +18,7 @@ import org.eclipse.ant.core.IAntClasspathEntry; public abstract class AbstractClasspathEntry implements IClasspathEntry { - protected List<IAntClasspathEntry> fChildEntries = new ArrayList<IAntClasspathEntry>(); + protected List<IAntClasspathEntry> fChildEntries = new ArrayList<>(); protected IClasspathEntry fParent = null; /* diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java index ad4a76200..688df97c0 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathBlock.java @@ -140,7 +140,7 @@ public class AntClasspathBlock { * @return targets for an action */ private List<IAntClasspathEntry> getOrderedSelection(IClasspathEntry parent) { - List<IAntClasspathEntry> targets = new ArrayList<IAntClasspathEntry>(); + List<IAntClasspathEntry> targets = new ArrayList<>(); List<?> selection = ((IStructuredSelection) treeViewer.getSelection()).toList(); IAntClasspathEntry[] entries = parent.getEntries(); for (int i = 0; i < entries.length; i++) { @@ -154,7 +154,7 @@ public class AntClasspathBlock { private void handleMoveDown() { List<IAntClasspathEntry> targets = getOrderedSelection(currentParent); - List<IAntClasspathEntry> list = new ArrayList<IAntClasspathEntry>(Arrays.asList(currentParent.getEntries())); + List<IAntClasspathEntry> list = new ArrayList<>(Arrays.asList(currentParent.getEntries())); int bottom = list.size() - 1; int index = 0; for (int i = targets.size() - 1; i >= 0; i--) { @@ -183,7 +183,7 @@ public class AntClasspathBlock { List<IAntClasspathEntry> targets = getOrderedSelection(currentParent); int top = 0; int index = 0; - List<IAntClasspathEntry> list = new ArrayList<IAntClasspathEntry>(Arrays.asList(currentParent.getEntries())); + List<IAntClasspathEntry> list = new ArrayList<>(Arrays.asList(currentParent.getEntries())); Iterator<IAntClasspathEntry> entries = targets.iterator(); while (entries.hasNext()) { IAntClasspathEntry target = entries.next(); @@ -269,7 +269,7 @@ public class AntClasspathBlock { } private void addJars() { - List<IAntClasspathEntry> allEntries = new ArrayList<IAntClasspathEntry>(); + List<IAntClasspathEntry> allEntries = new ArrayList<>(); if (currentParent != null) { allEntries.addAll(Arrays.asList(currentParent.getEntries())); } else { @@ -279,7 +279,7 @@ public class AntClasspathBlock { } } - List<IPath> selectedPaths = new ArrayList<IPath>(allEntries.size()); + List<IPath> selectedPaths = new ArrayList<>(allEntries.size()); Iterator<IAntClasspathEntry> iterator = allEntries.iterator(); while (iterator.hasNext()) { IAntClasspathEntry entry = iterator.next(); @@ -568,7 +568,7 @@ public class AntClasspathBlock { if (classpathEntries == null) { return Collections.EMPTY_LIST; } - List<String> found = new ArrayList<String>(2); + List<String> found = new ArrayList<>(2); for (int i = 0; i < classpathEntries.length; i++) { String file; Object entry = classpathEntries[i]; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathContentProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathContentProvider.java index 276f3e098..82fad92a0 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathContentProvider.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathContentProvider.java @@ -176,7 +176,7 @@ public class AntClasspathContentProvider implements ITreeContentProvider { return ((ClasspathModel) parentElement).getEntries(); } if (parentElement == null) { - List<Object> all = new ArrayList<Object>(); + List<Object> all = new ArrayList<>(); Object[] topEntries = model.getEntries(); for (int i = 0; i < topEntries.length; i++) { Object object = topEntries[i]; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathPage.java index b2a1d0cd3..0727f9e7a 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntClasspathPage.java @@ -124,10 +124,10 @@ public class AntClasspathPage implements IAntBlockContainer { } catch (MalformedURLException e) { AntUIPlugin.log(e); - return new ArrayList<IAntClasspathEntry>(0); + return new ArrayList<>(0); } - List<IAntClasspathEntry> entries = new ArrayList<IAntClasspathEntry>(urls.length); + List<IAntClasspathEntry> entries = new ArrayList<>(urls.length); for (int i = 0; i < urls.length; i++) { AntClasspathEntry entry = new AntClasspathEntry(urls[i]); entries.add(entry); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeAssistPreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeAssistPreferencePage.java index a999f1530..fb0566cc3 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeAssistPreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeAssistPreferencePage.java @@ -36,7 +36,7 @@ public class AntCodeAssistPreferencePage extends AbstractAntEditorPreferencePage @Override protected OverlayPreferenceStore createOverlayStore() { - ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<OverlayPreferenceStore.OverlayKey>(); + ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AntEditorPreferenceConstants.CODEASSIST_AUTOINSERT)); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeFormatterPreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeFormatterPreferencePage.java index f756bac92..dc8cd593c 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeFormatterPreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntCodeFormatterPreferencePage.java @@ -45,7 +45,7 @@ public class AntCodeFormatterPreferencePage extends AbstractAntEditorPreferenceP @Override protected OverlayPreferenceStore createOverlayStore() { - List<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<OverlayPreferenceStore.OverlayKey>(); + List<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AntEditorPreferenceConstants.FORMATTER_WRAP_LONG)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AntEditorPreferenceConstants.FORMATTER_ALIGN)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AntEditorPreferenceConstants.FORMATTER_MAX_LINE_LENGTH)); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntContentProvider.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntContentProvider.java index 58d9d29c2..8c6e46f84 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntContentProvider.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntContentProvider.java @@ -25,7 +25,7 @@ import org.eclipse.jface.viewers.ViewerComparator; * Content provider that maintains a generic list of objects which are shown in a table viewer. */ public class AntContentProvider implements IStructuredContentProvider { - protected List<Object> elements = new ArrayList<Object>(); + protected List<Object> elements = new ArrayList<>(); protected TableViewer tableViewer; private ViewerComparator fComparator = null; /** diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntEditorPreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntEditorPreferencePage.java index 810cf3fa8..29441548c 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntEditorPreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntEditorPreferencePage.java @@ -252,7 +252,7 @@ public class AntEditorPreferencePage extends AbstractAntEditorPreferencePage { private Button fItalicCheckBox; private TableViewer fHighlightingColorListViewer; - private final List<HighlightingColorListItem> fHighlightingColorList = new ArrayList<HighlightingColorListItem>(5); + private final List<HighlightingColorListItem> fHighlightingColorList = new ArrayList<>(5); private SourceViewer fPreviewViewer; private AntPreviewerUpdater fPreviewerUpdater; @@ -286,7 +286,7 @@ public class AntEditorPreferencePage extends AbstractAntEditorPreferencePage { { AntPreferencesMessages.AntEditorPreferencePage_Ant_editor_tags_4, IAntEditorColorConstants.TAG_COLOR, null }, { AntPreferencesMessages.AntEditorPreferencePage_Ant_editor_comments_5, IAntEditorColorConstants.XML_COMMENT_COLOR, null }, { AntPreferencesMessages.AntEditorPreferencePage_26, IAntEditorColorConstants.XML_DTD_COLOR, null } }; - ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<OverlayPreferenceStore.OverlayKey>(); + ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys = new ArrayList<>(); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION)); overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY)); @@ -597,8 +597,8 @@ public class AntEditorPreferencePage extends AbstractAntEditorPreferencePage { } private Composite createProblemsTabContent(TabFolder folder) { - fComboBoxes = new ArrayList<Combo>(); - fProblemLabels = new ArrayList<Label>(); + fComboBoxes = new ArrayList<>(); + fProblemLabels = new ArrayList<>(); initializeWorkingValues(); String[] errorWarningIgnoreLabels = new String[] { AntPreferencesMessages.AntEditorPreferencePage_11, @@ -655,7 +655,7 @@ public class AntEditorPreferencePage extends AbstractAntEditorPreferencePage { } private void initializeWorkingValues() { - fWorkingValues = new HashMap<String, String>(fProblemPreferenceKeys.length); + fWorkingValues = new HashMap<>(fProblemPreferenceKeys.length); for (int i = 0; i < fProblemPreferenceKeys.length; i++) { String key = fProblemPreferenceKeys[i]; fWorkingValues.put(key, getPreferenceStore().getString(key)); @@ -663,7 +663,7 @@ public class AntEditorPreferencePage extends AbstractAntEditorPreferencePage { } private void restoreWorkingValuesToDefaults() { - fWorkingValues = new HashMap<String, String>(fProblemPreferenceKeys.length); + fWorkingValues = new HashMap<>(fProblemPreferenceKeys.length); for (int i = 0; i < fProblemPreferenceKeys.length; i++) { String key = fProblemPreferenceKeys[i]; fWorkingValues.put(key, getPreferenceStore().getDefaultString(key)); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java index b0d283b7a..99c7e2b0d 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPage.java @@ -194,7 +194,7 @@ public abstract class AntPage { } } }); - ArrayList<ColumnSorter> sorters = new ArrayList<ColumnSorter>(fTableColumnHeaders.length); + ArrayList<ColumnSorter> sorters = new ArrayList<>(fTableColumnHeaders.length); for (int i = 0; i < fTableColumnHeaders.length; i++) { tableLayout.addColumnData(fTableColumnLayouts[i]); TableColumn column = new TableColumn(table, SWT.NONE, i); @@ -323,7 +323,7 @@ public abstract class AntPage { List<IAntClasspathEntry> entries = getPreferencePage().getLibraryEntries(); Object[] elements = contentProvider.getElements(tableViewer.getInput()); - List<Object> contents = new ArrayList<Object>(elements.length); + List<Object> contents = new ArrayList<>(elements.length); Object element; AntObject antObject; for (int i = 0; i < elements.length; i++) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java index 572612adc..dad0e14ad 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesBlock.java @@ -173,7 +173,7 @@ public class AntPropertiesBlock { String filterMessage = AntPreferencesMessages.AntPropertiesFileSelectionDialog_14; Object[] existingFiles = getPropertyFiles(); - List<IFile> propFiles = new ArrayList<IFile>(existingFiles.length); + List<IFile> propFiles = new ArrayList<>(existingFiles.length); for (int j = 0; j < existingFiles.length; j++) { String file = (String) existingFiles[j]; try { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesPage.java index 9a772efcc..184464c85 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntPropertiesPage.java @@ -159,7 +159,7 @@ public class AntPropertiesPage implements IAntBlockContainer { protected List<Property> getProperties() { Object[] allProperties = antPropertiesBlock.getProperties(); - List<Property> properties = new ArrayList<Property>(allProperties.length); + List<Property> properties = new ArrayList<>(allProperties.length); for (int i = 0; i < allProperties.length; i++) { Property property = (Property) allProperties[i]; if (!property.isDefault()) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java index 3d9865221..062dd74bb 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntRuntimePreferencePage.java @@ -173,7 +173,7 @@ public class AntRuntimePreferencePage extends PreferencePage implements IWorkben } protected List<IAntClasspathEntry> getLibraryEntries() { - List<IAntClasspathEntry> urls = new ArrayList<IAntClasspathEntry>(); + List<IAntClasspathEntry> urls = new ArrayList<>(); urls.addAll(Arrays.asList(classpathPage.getAntHomeEntries())); urls.addAll(Arrays.asList(classpathPage.getAdditionalEntries())); urls.addAll(Arrays.asList(classpathPage.getContributedEntries())); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTasksPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTasksPage.java index b2ffd1356..f774782fb 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTasksPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTasksPage.java @@ -69,7 +69,7 @@ public class AntTasksPage extends AntPage { private AddCustomDialog getCustomDialog(String title, String helpContext) { Iterator<Object> tasks = getContents(true).iterator(); - List<String> names = new ArrayList<String>(); + List<String> names = new ArrayList<>(); while (tasks.hasNext()) { Task task = (Task) tasks.next(); names.add(task.getTaskName()); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTypesPage.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTypesPage.java index a4a4a64ff..d0ff4eeec 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTypesPage.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/AntTypesPage.java @@ -109,7 +109,7 @@ public class AntTypesPage extends AntPage { private AddCustomDialog getCustomDialog(String title, String helpContext) { Iterator<Object> types = getContents(true).iterator(); - List<String> names = new ArrayList<String>(); + List<String> names = new ArrayList<>(); while (types.hasNext()) { Type aTask = (Type) types.next(); names.add(aTask.getTypeName()); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/ClasspathModel.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/ClasspathModel.java index 601a5d248..d100548ec 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/ClasspathModel.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/ClasspathModel.java @@ -235,7 +235,7 @@ public class ClasspathModel extends AbstractClasspathEntry { } private IAntClasspathEntry[] getUserEntries() { - List<IAntClasspathEntry> userEntries = new ArrayList<IAntClasspathEntry>(fChildEntries.size()); + List<IAntClasspathEntry> userEntries = new ArrayList<>(fChildEntries.size()); for (IAntClasspathEntry element : fChildEntries) { if (element instanceof GlobalClasspathEntries) { continue; diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileFilter.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileFilter.java index 47c99e66f..92a30a7a4 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileFilter.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileFilter.java @@ -75,7 +75,7 @@ public class FileFilter extends ViewerFilter { BusyIndicator.showWhile(AntUIPlugin.getStandardDisplay(), new Runnable() { @Override public void run() { - fFiles = new HashSet<IResource>(); + fFiles = new HashSet<>(); traverse(ResourcesPlugin.getWorkspace().getRoot(), fFiles); } }); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/MinimizedFileSystemElement.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/MinimizedFileSystemElement.java index dca511856..04268f413 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/MinimizedFileSystemElement.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/MinimizedFileSystemElement.java @@ -82,12 +82,12 @@ class MinimizedFileSystemElement implements IWorkbenchAdapter, IAdaptable { private void addChild(MinimizedFileSystemElement child) { if (child.isDirectory()) { if (folders == null) { - folders = new ArrayList<MinimizedFileSystemElement>(1); + folders = new ArrayList<>(1); } folders.add(child); } else { if (files == null) { - files = new ArrayList<MinimizedFileSystemElement>(1); + files = new ArrayList<>(1); } files.add(child); } @@ -151,7 +151,7 @@ class MinimizedFileSystemElement implements IWorkbenchAdapter, IAdaptable { List<Object> children = provider.getChildren(fileSystemObject); if (children == null) { - children = new ArrayList<Object>(1); + children = new ArrayList<>(1); } Iterator<Object> childrenEnum = children.iterator(); while (childrenEnum.hasNext()) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/refactoring/LaunchConfigurationBuildfileChange.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/refactoring/LaunchConfigurationBuildfileChange.java index e9c385cfb..b83380e1b 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/refactoring/LaunchConfigurationBuildfileChange.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/refactoring/LaunchConfigurationBuildfileChange.java @@ -117,7 +117,7 @@ public class LaunchConfigurationBuildfileChange extends Change { * Create a change for each launch configuration from the given list which needs to be updated for this IProject rename. */ private static List<Change> createChangesForProjectRename(ILaunchConfiguration[] configs, String projectName, String newProjectName) throws CoreException { - List<Change> changes = new ArrayList<Change>(); + List<Change> changes = new ArrayList<>(); for (int i = 0; i < configs.length; i++) { ILaunchConfiguration launchConfiguration = configs[i]; String launchConfigurationProjectName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); @@ -138,7 +138,7 @@ public class LaunchConfigurationBuildfileChange extends Change { * Create a change for each launch configuration from the given list which needs to be updated for this buildfile rename. */ private static List<Change> createChangesForBuildfileRename(IFile buildfile, ILaunchConfiguration[] configs, String projectName, String newBuildfileName) throws CoreException { - List<Change> changes = new ArrayList<Change>(); + List<Change> changes = new ArrayList<>(); for (int i = 0; i < configs.length; i++) { ILaunchConfiguration launchConfiguration = configs[i]; String launchConfigurationProjectName = launchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java index e3eec525e..65310ceb7 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/AntView.java @@ -95,7 +95,7 @@ public class AntView extends ViewPart implements IResourceChangeListener, IShowI * * @since 3.5.00 */ - private List<AntProjectNode> fInput = new ArrayList<AntProjectNode>(); + private List<AntProjectNode> fInput = new ArrayList<>(); private boolean filterInternalTargets = false; private InternalTargetFilter fInternalTargetFilter = null; @@ -257,7 +257,7 @@ public class AntView extends ViewPart implements IResourceChangeListener, IShowI * Initialize the actions for this view */ private void initializeActions() { - updateProjectActions = new ArrayList<IUpdate>(5); + updateProjectActions = new ArrayList<>(5); addBuildFileAction = new AddBuildFilesAction(this); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AddBuildFilesAction.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AddBuildFilesAction.java index 5fe17aef3..b5af12469 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AddBuildFilesAction.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AddBuildFilesAction.java @@ -95,7 +95,7 @@ public class AddBuildFilesAction extends Action { private List<IFile> getBuildFiles() { AntProjectNode[] existingProjects = view.getProjects(); - List<IFile> buildFiles = new ArrayList<IFile>(existingProjects.length); + List<IFile> buildFiles = new ArrayList<>(existingProjects.length); for (int j = 0; j < existingProjects.length; j++) { AntProjectNode existingProject = existingProjects[j]; buildFiles.add(AntUtil.getFile(existingProject.getBuildFileName())); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AntOpenWithMenu.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AntOpenWithMenu.java index f1c198520..6dc102e75 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AntOpenWithMenu.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/AntOpenWithMenu.java @@ -50,7 +50,7 @@ public class AntOpenWithMenu extends ContributionItem { private IEditorRegistry fRegistry = PlatformUI.getWorkbench().getEditorRegistry(); private static final String SYSTEM_EDITOR_ID = PlatformUI.PLUGIN_ID + ".SystemEditor"; //$NON-NLS-1$ - private static Map<ImageDescriptor, Image> imageCache = new Hashtable<ImageDescriptor, Image>(11); + private static Map<ImageDescriptor, Image> imageCache = new Hashtable<>(11); private AntElementNode fNode; @@ -207,7 +207,7 @@ public class AntOpenWithMenu extends ContributionItem { boolean defaultFound = false; boolean antFound = false; - List<String> alreadyAddedEditors = new ArrayList<String>(editors.length); + List<String> alreadyAddedEditors = new ArrayList<>(editors.length); for (int i = 0; i < editors.length; i++) { IEditorDescriptor editor = editors[i]; if (alreadyAddedEditors.contains(editor.getId())) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RefreshBuildFilesAction.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RefreshBuildFilesAction.java index c5c0a6c24..95da22fe6 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RefreshBuildFilesAction.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RefreshBuildFilesAction.java @@ -100,7 +100,7 @@ public class RefreshBuildFilesAction extends Action implements IUpdate { */ private Set<AntProjectNode> getSelectedProjects() { IStructuredSelection selection = (IStructuredSelection) fView.getViewer().getSelection(); - HashSet<AntProjectNode> set = new HashSet<AntProjectNode>(); + HashSet<AntProjectNode> set = new HashSet<>(); Iterator<?> iter = selection.iterator(); Object data; while (iter.hasNext()) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RemoveProjectAction.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RemoveProjectAction.java index 89779347c..52bf78c8f 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RemoveProjectAction.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/RemoveProjectAction.java @@ -46,7 +46,7 @@ public class RemoveProjectAction extends Action implements IUpdate { IStructuredSelection selection = (IStructuredSelection) view.getViewer().getSelection(); Iterator<?> iter = selection.iterator(); Object element; - List<AntProjectNode> projectNodes = new ArrayList<AntProjectNode>(); + List<AntProjectNode> projectNodes = new ArrayList<>(); while (iter.hasNext()) { element = iter.next(); if (element instanceof AntProjectNode) { diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java index 91b4d23ef..1c1e08d91 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/views/actions/SearchForBuildFilesDialog.java @@ -57,7 +57,7 @@ public class SearchForBuildFilesDialog extends InputDialog { /** * List of <code>IFile</code> objects that were found */ - private List<IResource> results = new ArrayList<IResource>(); + private List<IResource> results = new ArrayList<>(); /** * List of <code>IResource</code> objects in which to search. * @@ -305,7 +305,7 @@ public class SearchForBuildFilesDialog extends InputDialog { return; } IAdaptable[] elements = set.getElements(); - searchScopes = new ArrayList<IResource>(); + searchScopes = new ArrayList<>(); for (int i = 0; i < elements.length; i++) { // Try to get an IResource object from each element IResource resource = null; @@ -356,7 +356,7 @@ public class SearchForBuildFilesDialog extends InputDialog { settings.put(IAntUIPreferenceConstants.ANTVIEW_INCLUDE_ERROR_SEARCH_RESULTS, includeErrorResultButton.getSelection()); settings.put(IAntUIPreferenceConstants.ANTVIEW_LAST_WORKINGSET_SEARCH_SCOPE, getWorkingSetName()); settings.put(IAntUIPreferenceConstants.ANTVIEW_USE_WORKINGSET_SEARCH_SCOPE, workingSetScopeButton.getSelection()); - results = new ArrayList<IResource>(); // Clear previous results + results = new ArrayList<>(); // Clear previous results ResourceProxyVisitor visitor = new ResourceProxyVisitor(); if (searchScopes == null || searchScopes.isEmpty()) { try { |