Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-09-28 18:49:18 +0000
committerRyan D. Brooks2015-09-28 18:49:18 +0000
commit071fcbc5cca4e22e650bb459701f5fc9be701013 (patch)
treeac629d866ecfea675bc4e134c68315440282d560 /plugins/org.eclipse.osee.ote.define
parentb4f6f62b0d3af365b67a3786dbb24c97fa638536 (diff)
downloadorg.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.tar.gz
org.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.tar.xz
org.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.zip
refactor: Use type inference when invoking a generic constructor
Diffstat (limited to 'plugins/org.eclipse.osee.ote.define')
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteToAttributeMap.java2
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java6
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java6
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java6
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java6
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/BaseOutfileParser.java2
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/CollectionParser.java2
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/OteOutfileParser.java2
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/SaxChunkCollector.java4
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java2
-rw-r--r--plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileParserExtensionManager.java6
13 files changed, 26 insertions, 26 deletions
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
index 68838712afe..89e38b3f91c 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/ArtifactTestRunOperator.java
@@ -35,10 +35,10 @@ import org.eclipse.osee.ote.define.AUTOGEN.OteAttributeTypes;
* @author Roberto E. Escobar
*/
public class ArtifactTestRunOperator implements TestRunOperator {
- private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
+ private static final OteArtifactFetcher<Artifact> TEST_RUN_ARTIFACT_FETCHER = new OteArtifactFetcher<>(
CoreArtifactTypes.TestRun);
- private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER = new OteArtifactFetcher<Artifact>(
+ private static final OteArtifactFetcher<Artifact> TEST_SCRIPT_ARTIFACT_FETCHER = new OteArtifactFetcher<>(
CoreArtifactTypes.TestCase);
private final Artifact artifact;
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java
index aa5a5771f17..daa1c390744 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteArtifactFetcher.java
@@ -73,7 +73,7 @@ public class OteArtifactFetcher<T extends Artifact> {
@SuppressWarnings("unchecked")
public Set<T> getAllArtifacts(IOseeBranch branch) throws OseeArgumentException {
checkForNull(branch);
- Set<T> toReturn = new HashSet<T>();
+ Set<T> toReturn = new HashSet<>();
try {
Collection<Artifact> artifacts = ArtifactQuery.getArtifactListFromType(oteArtifactType, branch);
for (Artifact artifact : artifacts) {
@@ -94,7 +94,7 @@ public class OteArtifactFetcher<T extends Artifact> {
* @return artifact instances indexed by descriptive name
*/
public Map<String, T> getAllArtifactsIndexedByName(Branch branch) throws OseeArgumentException {
- Map<String, T> toReturn = new HashMap<String, T>();
+ Map<String, T> toReturn = new HashMap<>();
Set<T> testScripts = getAllArtifacts(branch);
for (T artifact : testScripts) {
toReturn.put(artifact.getName(), artifact);
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteToAttributeMap.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteToAttributeMap.java
index 04252d6949c..a4159ad789b 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteToAttributeMap.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/artifacts/OteToAttributeMap.java
@@ -39,7 +39,7 @@ public class OteToAttributeMap {
private static Map<TestRunField, IAttributeType> outfileFieldToAttributeMap;
private OteToAttributeMap() {
- outfileFieldToAttributeMap = new HashMap<TestRunField, IAttributeType>();
+ outfileFieldToAttributeMap = new HashMap<>();
outfileFieldToAttributeMap.put(TestRunField.USER_ID, CoreAttributeTypes.UserId);
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
index 4cbf101b51d..b299a29661c 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/jobs/FindCommitableJob.java
@@ -66,8 +66,8 @@ public class FindCommitableJob extends Job {
public IStatus run(final IProgressMonitor monitor) {
IStatus toReturn = Status.CANCEL_STATUS;
monitor.beginTask(getName(), artifactsToSort.size());
- commitable = new ArrayList<Artifact>();
- nonCommitable = new ArrayList<Artifact>();
+ commitable = new ArrayList<>();
+ nonCommitable = new ArrayList<>();
ThreadedWorkerFactory<Object> outfileToArtifactFactory = new ThreadedWorkerFactory<Object>() {
@@ -83,7 +83,7 @@ public class FindCommitableJob extends Job {
};
- ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<Object>(outfileToArtifactFactory, false);
+ ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<>(outfileToArtifactFactory, false);
try {
executor.executeWorkersBlocking();
} catch (OseeCoreException ex) {
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
index cbc643596e0..08eceaa66e2 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/ImportOutfileOperation.java
@@ -100,7 +100,7 @@ public class ImportOutfileOperation {
}
private String toString(Artifact[] artifacts) {
- List<String> toReturn = new ArrayList<String>();
+ List<String> toReturn = new ArrayList<>();
for (Artifact artifact : artifacts) {
toReturn.add(artifact.getName());
}
@@ -117,13 +117,13 @@ public class ImportOutfileOperation {
}
private Map<IOseeBranch, List<Artifact>> getArtifactsByBranch(Object[] items) {
- Map<IOseeBranch, List<Artifact>> branchMap = new HashMap<IOseeBranch, List<Artifact>>();
+ Map<IOseeBranch, List<Artifact>> branchMap = new HashMap<>();
for (Object object : items) {
Artifact testRun = (Artifact) object;
IOseeBranch branch = testRun.getBranch();
List<Artifact> artList = branchMap.get(branch);
if (artList == null) {
- artList = new ArrayList<Artifact>();
+ artList = new ArrayList<>();
branchMap.put(branch, artList);
}
artList.add(testRun);
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
index 9b30b4f97ca..55897e65f13 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/LinkTestRunToTestScriptOperation.java
@@ -33,8 +33,8 @@ public class LinkTestRunToTestScriptOperation {
public LinkTestRunToTestScriptOperation(Artifact... artifacts) {
this.artifacts = Arrays.asList(artifacts);
- this.unlinked = new ArrayList<Artifact>();
- this.linked = new ArrayList<Artifact>();
+ this.unlinked = new ArrayList<>();
+ this.linked = new ArrayList<>();
}
public void execute(final IProgressMonitor monitor) throws OseeCoreException {
@@ -56,7 +56,7 @@ public class LinkTestRunToTestScriptOperation {
};
- ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<Object>(outfileToArtifactFactory, true);
+ ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<>(outfileToArtifactFactory, true);
executor.executeWorkersBlocking();
}
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
index 9bd76b78400..411ce734475 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/operations/OutfileToArtifactOperation.java
@@ -46,8 +46,8 @@ public class OutfileToArtifactOperation {
public OutfileToArtifactOperation(IOseeBranch branch, URI... filesToImport) {
this.branch = branch;
this.filesToImport = Arrays.asList(filesToImport);
- this.results = new ArrayList<Artifact>();
- this.filesWithErrors = new ArrayList<URI>();
+ this.results = new ArrayList<>();
+ this.filesWithErrors = new ArrayList<>();
}
public void execute(final IProgressMonitor monitor) throws Exception {
@@ -69,7 +69,7 @@ public class OutfileToArtifactOperation {
};
- ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<Object>(outfileToArtifactFactory, false);
+ ThreadedWorkerExecutor<Object> executor = new ThreadedWorkerExecutor<>(outfileToArtifactFactory, false);
executor.executeWorkersBlocking();
}
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/BaseOutfileParser.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/BaseOutfileParser.java
index edd937077a7..962e96240a1 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/BaseOutfileParser.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/BaseOutfileParser.java
@@ -24,7 +24,7 @@ public abstract class BaseOutfileParser {
private final Set<IDataListener> listeners;
public BaseOutfileParser() {
- this.listeners = new HashSet<IDataListener>();
+ this.listeners = new HashSet<>();
}
public void registerListener(IDataListener listener) {
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/CollectionParser.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/CollectionParser.java
index 86a844f881b..e7dc1d747f2 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/CollectionParser.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/CollectionParser.java
@@ -25,7 +25,7 @@ public class CollectionParser extends AbstractSaxHandler implements ICollectionS
}
public CollectionParser() {
- collectors = new ArrayList<SaxChunkCollector>();
+ collectors = new ArrayList<>();
}
@Override
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/OteOutfileParser.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/OteOutfileParser.java
index 951d50b71c8..7e6c8dea854 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/OteOutfileParser.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/OteOutfileParser.java
@@ -36,7 +36,7 @@ public class OteOutfileParser extends BaseOutfileParser {
public OteOutfileParser() {
super();
- collectors = new ArrayList<SaxChunkCollector>();
+ collectors = new ArrayList<>();
collectors.add(new SaxChunkCollector(new ConfigHandler(), "Config"));
collectors.add(new SaxChunkCollector(new RuntimeVersionsHandler(), "RuntimeVersions"));
collectors.add(new SaxChunkCollector(new SystemInfoHandler(), "SystemInfo"));
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/SaxChunkCollector.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/SaxChunkCollector.java
index ebb7e0e5218..ded7bda1eb9 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/SaxChunkCollector.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/parser/SaxChunkCollector.java
@@ -27,12 +27,12 @@ public class SaxChunkCollector {
private String currentLocalName;
public SaxChunkCollector(ISaxElementHandler handler, String... collect) {
- this.collectionElement = new HashSet<String>();
+ this.collectionElement = new HashSet<>();
for (String item : collect) {
collectionElement.add(item);
}
this.handler = handler;
- collectionChunks = new ArrayList<String>();
+ collectionChunks = new ArrayList<>();
builder = new StringBuilder(5000);
}
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
index adcaa370f27..148b6dd92c7 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileDataCollector.java
@@ -33,7 +33,7 @@ public class OutfileDataCollector implements IDataListener {
protected final Map<String, String> collectedData;
public OutfileDataCollector() {
- this.collectedData = new HashMap<String, String>();
+ this.collectedData = new HashMap<>();
}
@Override
diff --git a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileParserExtensionManager.java b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileParserExtensionManager.java
index bb83bfee38a..ae01238038c 100644
--- a/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileParserExtensionManager.java
+++ b/plugins/org.eclipse.osee.ote.define/src/org/eclipse/osee/ote/define/utilities/OutfileParserExtensionManager.java
@@ -44,8 +44,8 @@ public class OutfileParserExtensionManager {
private static OutfileParserExtensionManager instance = null;
private OutfileParserExtensionManager() {
- contributions = new HashMap<String, BaseOutfileParser>();
- extensionsToParsers = new HashCollection<String, BaseOutfileParser>(false, HashSet.class);
+ contributions = new HashMap<>();
+ extensionsToParsers = new HashCollection<>(false, HashSet.class);
}
public static OutfileParserExtensionManager getInstance() {
@@ -109,7 +109,7 @@ public class OutfileParserExtensionManager {
}
private Set<String> getSupportedExtensions(String rawExtensions) {
- Set<String> toReturn = new HashSet<String>();
+ Set<String> toReturn = new HashSet<>();
for (String value : rawExtensions.split(";")) {
value = value.trim();
if (Strings.isValid(value)) {

Back to the top