Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2015-07-17 02:44:13 -0400
committerLars Vogel2015-07-23 11:01:45 -0400
commit66459816d193415349573d471af6f36e63264ad0 (patch)
tree66d4fe679cbd16793818a19c9a545552909872db
parent12120e2bb7944d0a31586cd28b61da8952a3dfd1 (diff)
downloadorg.eclipse.tycho-66459816d193415349573d471af6f36e63264ad0.tar.gz
org.eclipse.tycho-66459816d193415349573d471af6f36e63264ad0.tar.xz
org.eclipse.tycho-66459816d193415349573d471af6f36e63264ad0.zip
Bug 472669 - Using the diamond operator in Tycho for Java 1.7 bundles
Cleanup for tycho-compiler-jdt, tycho-compiler-plugin and tycho-core Change-Id: I9b49adfd844285a8560a6cc23f505597366479dc Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java10
-rw-r--r--tycho-compiler-jdt/src/test/java/org/eclipse/tycho/compiler/jdt/CompilerMainTest.java2
-rw-r--r--tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java4
-rw-r--r--tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java22
-rw-r--r--tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/CopyMapping.java2
-rw-r--r--tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java10
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java8
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java4
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java4
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java8
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java6
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java10
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractArtifactDependencyWalker.java8
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java4
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java4
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java12
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java8
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java16
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java22
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/project/EclipsePluginProjectImpl.java10
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java14
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/DefaultDependencyArtifacts.java8
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java10
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalDependencyResolver.java6
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/MultiEnvironmentDependencyArtifacts.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/utils/MavenSessionUtils.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/core/utils/TychoProjectUtils.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/dev/DevWorkspaceResolver.java4
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeMainArtifacts.java2
-rw-r--r--tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/WorkspaceTychoOsgiRuntimeLocator.java2
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java2
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironmentTest.java4
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/ArtifactDependencyWalkerTest.java4
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/DefaultDependencyArtifactsTest.java2
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java4
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/EclipseInstallationLayoutTest.java6
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/MavenDependencyCollectorTest.java4
-rw-r--r--tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java2
41 files changed, 130 insertions, 130 deletions
diff --git a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
index dbd36ed8e..36a1a96fb 100644
--- a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
+++ b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
@@ -119,7 +119,7 @@ public class JDTCompiler extends AbstractCompiler {
public String[] buildCompilerArguments(CompilerConfiguration config, CustomCompilerConfiguration custom,
String[] sourceFiles) {
- List<String> args = new ArrayList<String>();
+ List<String> args = new ArrayList<>();
// ----------------------------------------------------------------------
// Set output
@@ -371,7 +371,7 @@ public class JDTCompiler extends AbstractCompiler {
* @throws IOException
*/
protected static List<CompilerMessage> parseModernStream(BufferedReader input) throws IOException {
- List<CompilerMessage> messages = new ArrayList<CompilerMessage>();
+ List<CompilerMessage> messages = new ArrayList<>();
String type = null;
String file = null;
int lineNr = -1;
@@ -529,13 +529,13 @@ public class JDTCompiler extends AbstractCompiler {
String enc = String.valueOf(content, encodeStart, end - encodeStart + 1);
if (isFile) {
if (custom.fileEncodings == null)
- custom.fileEncodings = new HashMap<String, String>();
+ custom.fileEncodings = new HashMap<>();
// use File to translate the string into a
// path with the correct File.seperator
custom.fileEncodings.put(str, enc);
} else {
if (custom.dirEncodings == null)
- custom.dirEncodings = new HashMap<String, String>();
+ custom.dirEncodings = new HashMap<>();
custom.dirEncodings.put(str, enc);
}
}
@@ -549,7 +549,7 @@ public class JDTCompiler extends AbstractCompiler {
String path = String.valueOf(content, start, accessStart - start);
String access = String.valueOf(content, accessStart, end - accessStart + 1);
if (custom.accessRules == null)
- custom.accessRules = new ArrayList<String>();
+ custom.accessRules = new ArrayList<>();
custom.accessRules.add(path);
custom.accessRules.add(access);
}
diff --git a/tycho-compiler-jdt/src/test/java/org/eclipse/tycho/compiler/jdt/CompilerMainTest.java b/tycho-compiler-jdt/src/test/java/org/eclipse/tycho/compiler/jdt/CompilerMainTest.java
index 76e812a0d..36e9f1cda 100644
--- a/tycho-compiler-jdt/src/test/java/org/eclipse/tycho/compiler/jdt/CompilerMainTest.java
+++ b/tycho-compiler-jdt/src/test/java/org/eclipse/tycho/compiler/jdt/CompilerMainTest.java
@@ -83,7 +83,7 @@ public class CompilerMainTest {
private void checkClassPath(ArrayList classpath, String... expectedRelativePaths) {
assertEquals(expectedRelativePaths.length, classpath.size());
- Set<String> actualPaths = new HashSet<String>();
+ Set<String> actualPaths = new HashSet<>();
for (Object cpo : classpath) {
assertTrue(cpo instanceof ClasspathJar);
String path = new String(((ClasspathJar) cpo).normalizedPath());
diff --git a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
index 7d21e68d9..300565316 100644
--- a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
@@ -455,7 +455,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
compilerConfiguration.setSourceEncoding(getEncoding());
if ((compilerArguments != null) || (compilerArgument != null) || compilerArgs != null) {
- LinkedHashMap<String, String> cplrArgsCopy = new LinkedHashMap<String, String>();
+ LinkedHashMap<String, String> cplrArgsCopy = new LinkedHashMap<>();
if (compilerArguments != null) {
for (Iterator i = compilerArguments.entrySet().iterator(); i.hasNext();) {
Map.Entry me = (Map.Entry) i.next();
@@ -572,7 +572,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
scanner.addSourceMapping(mapping);
- Set<File> staleSources = new HashSet<File>();
+ Set<File> staleSources = new HashSet<>();
for (Iterator it = getCompileSourceRoots().iterator(); it.hasNext();) {
String sourceRoot = (String) it.next();
diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
index 53c8084c6..274c3484f 100644
--- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
@@ -162,20 +162,20 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
* A list of inclusion filters for the compiler.
*/
@Parameter
- private Set<String> includes = new HashSet<String>();
+ private Set<String> includes = new HashSet<>();
/**
* A list of exclusion filters for the compiler.
*/
@Parameter
- private Set<String> excludes = new HashSet<String>();
+ private Set<String> excludes = new HashSet<>();
/**
* A list of exclusion filters for non-java resource files which should not be copied to the
* output directory.
*/
@Parameter
- private Set<String> excludeResources = new HashSet<String>();
+ private Set<String> excludeResources = new HashSet<>();
/**
* Whether a bundle is required to explicitly import non-java.* packages from the JDK. This is
@@ -319,7 +319,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
continue;
}
- Set<String> excludes = new HashSet<String>();
+ Set<String> excludes = new HashSet<>();
excludes.addAll(excludeResources);
excludes.addAll(getEclipsePluginProject().getBuildProperties().getBinExcludes());
excludes.add("**/*.java");
@@ -352,7 +352,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
@Override
public List<String> getClasspathElements() throws MojoExecutionException {
- final List<String> classpath = new ArrayList<String>();
+ final List<String> classpath = new ArrayList<>();
for (ClasspathEntry cpe : getClasspath()) {
for (File location : cpe.getLocations()) {
classpath.add(location.getAbsolutePath() + toString(cpe.getAccessRules()));
@@ -392,7 +392,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
@Override
protected final List<String> getCompileSourceRoots() throws MojoExecutionException {
- ArrayList<String> roots = new ArrayList<String>();
+ ArrayList<String> roots = new ArrayList<>();
for (File folder : outputJar.getSourceFolders()) {
roots.add(new File(folder.getAbsoluteFile().toURI().normalize()).toString());
}
@@ -401,7 +401,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
@Override
public List<SourcepathEntry> getSourcepath() throws MojoExecutionException {
- ArrayList<SourcepathEntry> entries = new ArrayList<SourcepathEntry>();
+ ArrayList<SourcepathEntry> entries = new ArrayList<>();
for (BuildOutputJar jar : getEclipsePluginProject().getOutputJars()) {
final File outputDirectory = jar.getOutputDirectory();
for (final File sourcesRoot : jar.getSourceFolders()) {
@@ -519,7 +519,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
private void configureBootclasspathAccessRules(CompilerConfiguration compilerConfiguration)
throws MojoExecutionException {
- List<AccessRule> accessRules = new ArrayList<ClasspathEntry.AccessRule>();
+ List<AccessRule> accessRules = new ArrayList<>();
if (requireJREPackageImports) {
accessRules.addAll(getStrictBootClasspathAccessRules());
@@ -621,7 +621,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
@Override
public List<ClasspathEntry> getClasspath() throws MojoExecutionException {
TychoProject projectType = getBundleProject();
- ArrayList<ClasspathEntry> classpath = new ArrayList<ClasspathEntry>(
+ ArrayList<ClasspathEntry> classpath = new ArrayList<>(
((BundleProject) projectType).getClasspath(project));
if (extraClasspathElements != null) {
@@ -648,7 +648,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
if (b instanceof ProjectArtifact) {
bProject = ((ProjectArtifact) b).getProject();
}
- ArrayList<File> bLocations = new ArrayList<File>();
+ ArrayList<File> bLocations = new ArrayList<>();
bLocations.add(b.getFile()); // TODO properly handle multiple project locations maybe
classpath.add(new DefaultClasspathEntry(DefaultReactorProject.adapt(bProject), null, bLocations,
null));
@@ -713,7 +713,7 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
private void checkTargetLevelCompatibleWithManifestBREEs(String effectiveTargetLevel,
StandardExecutionEnvironment[] manifestBREEs) throws MojoExecutionException {
- List<String> incompatibleBREEs = new ArrayList<String>();
+ List<String> incompatibleBREEs = new ArrayList<>();
for (StandardExecutionEnvironment ee : manifestBREEs) {
if (!ee.isCompatibleCompilerTargetLevel(effectiveTargetLevel)) {
incompatibleBREEs.add(ee.getProfileName() + " (assumes " + ee.getCompilerTargetLevelDefault() + ")");
diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/CopyMapping.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/CopyMapping.java
index 12268b7f0..e8b1bbf19 100644
--- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/CopyMapping.java
+++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/CopyMapping.java
@@ -26,7 +26,7 @@ import org.codehaus.plexus.compiler.util.scan.mapping.SourceMapping;
*/
public class CopyMapping implements SourceMapping {
- List<SourceTargetPair> sourceTargetMappings = new ArrayList<SourceTargetPair>();
+ List<SourceTargetPair> sourceTargetMappings = new ArrayList<>();
@Override
public Set getTargetFiles(File targetDir, String source) throws InclusionScanException {
diff --git a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
index cb1cb5060..04a0befe6 100644
--- a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
+++ b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
@@ -330,7 +330,7 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
- final List<CharSequence> warnings = new ArrayList<CharSequence>();
+ final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
@@ -365,7 +365,7 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
- final List<CharSequence> warnings = new ArrayList<CharSequence>();
+ final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
@@ -395,7 +395,7 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
setVariableValueToObject(mojo, "useProjectSettings", Boolean.TRUE);
- final List<CharSequence> warnings = new ArrayList<CharSequence>();
+ final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
@@ -414,7 +414,7 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
setVariableValueToObject(mojo, "useProjectSettings", Boolean.FALSE);
- final List<CharSequence> warnings = new ArrayList<CharSequence>();
+ final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
@@ -433,7 +433,7 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
MavenProject project = projects.get(0);
AbstractOsgiCompilerMojo mojo = getMojo(projects, project);
setVariableValueToObject(mojo, "useProjectSettings", Boolean.TRUE);
- final List<CharSequence> warnings = new ArrayList<CharSequence>();
+ final List<CharSequence> warnings = new ArrayList<>();
mojo.setLog(new SystemStreamLog() {
@Override
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java b/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java
index a1f6fc3ec..283546292 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/artifacts/configuration/TargetPlatformFilterConfigurationReader.java
@@ -24,7 +24,7 @@ import org.eclipse.tycho.artifacts.TargetPlatformFilterSyntaxException;
public class TargetPlatformFilterConfigurationReader {
public List<TargetPlatformFilter> parseFilterConfiguration(Xpp3Dom filtersElement) {
- List<TargetPlatformFilter> result = new ArrayList<TargetPlatformFilter>();
+ List<TargetPlatformFilter> result = new ArrayList<>();
for (Xpp3Dom filterDom : filtersElement.getChildren()) {
parseFilter(filterDom, result);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java
index c41a4ad04..90d058f82 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/TargetPlatformConfiguration.java
@@ -33,11 +33,11 @@ public class TargetPlatformConfiguration implements DependencyResolverConfigurat
private String resolver;
- private List<TargetEnvironment> environments = new ArrayList<TargetEnvironment>();
+ private List<TargetEnvironment> environments = new ArrayList<>();
private boolean implicitTargetEnvironment = true;
- private final List<File> targets = new ArrayList<File>();
+ private final List<File> targets = new ArrayList<>();
private IncludeSourceMode targetDefinitionIncludeSourceMode = IncludeSourceMode.ignore;
private String pomDependencies;
@@ -53,11 +53,11 @@ public class TargetPlatformConfiguration implements DependencyResolverConfigurat
private OptionalResolutionAction optionalAction = OptionalResolutionAction.REQUIRE;
- private final List<Dependency> extraRequirements = new ArrayList<Dependency>();
+ private final List<Dependency> extraRequirements = new ArrayList<>();
private boolean includePackedArtifacts;
- private Map<String, String> resolverProfileProperties = new HashMap<String, String>();
+ private Map<String, String> resolverProfileProperties = new HashMap<>();
/**
* Returns the list of configured target environments, or the running environment if no
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java
index 849d407bd..7ce9fb47b 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java
@@ -30,7 +30,7 @@ public class CustomExecutionEnvironment implements ExecutionEnvironment {
private static final Pattern JAVA_SECOND_EDITION_VERSIONS_PATTERN = Pattern.compile("(1\\.[0-5])");
private final String profileName;
- private final Set<String> systemPackages = new LinkedHashSet<String>();
+ private final Set<String> systemPackages = new LinkedHashSet<>();
private final Properties properties = new Properties();
// BEGIN construction
@@ -103,7 +103,7 @@ public class CustomExecutionEnvironment implements ExecutionEnvironment {
}
private void setOsgiSystemCapabilities(List<SystemCapability> systemCapabilities) {
- Map<String, MultipleVersionsCapability> capabilityMap = new LinkedHashMap<String, MultipleVersionsCapability>();
+ Map<String, MultipleVersionsCapability> capabilityMap = new LinkedHashMap<>();
for (SystemCapability capability : systemCapabilities) {
if (capability.getType() == Type.OSGI_EE) {
String environmentName = capability.getName();
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java
index a52269c56..9435132c5 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java
@@ -37,7 +37,7 @@ public class ExecutionEnvironmentUtils {
private static Map<String, StandardExecutionEnvironment> fillEnvironmentsMap() {
Properties listProps = readProperties(findInSystemBundle("profile.list"));
String[] profileFiles = listProps.getProperty("java.profiles").split(",");
- Map<String, StandardExecutionEnvironment> envMap = new LinkedHashMap<String, StandardExecutionEnvironment>();
+ Map<String, StandardExecutionEnvironment> envMap = new LinkedHashMap<>();
for (String profileFile : profileFiles) {
Properties props = readProperties(findInSystemBundle(profileFile.trim()));
envMap.put(props.getProperty("osgi.java.profile.name").trim(), new StandardExecutionEnvironment(props));
@@ -85,7 +85,7 @@ public class ExecutionEnvironmentUtils {
}
public static List<String> getProfileNames() {
- return new ArrayList<String>(executionEnvironmentsMap.keySet());
+ return new ArrayList<>(executionEnvironmentsMap.keySet());
}
public static void applyProfileProperties(Properties properties, Properties profileProps) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java
index d2586902a..b24adc2f0 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironment.java
@@ -45,7 +45,7 @@ public class StandardExecutionEnvironment implements Comparable<StandardExecutio
static {
// http://help.eclipse.org/juno/topic/org.eclipse.jdt.doc.user/tasks/task-using_batch_compiler.htm
- Map<String, String> targetAliases = new HashMap<String, String>();
+ Map<String, String> targetAliases = new HashMap<>();
targetAliases.put("jsr14", "1.4");
targetAliases.put("5", "1.5");
targetAliases.put("5.0", "1.5");
@@ -74,7 +74,7 @@ public class StandardExecutionEnvironment implements Comparable<StandardExecutio
this.compilerSourceLevel = profileProperties.getProperty("org.eclipse.jdt.core.compiler.source");
this.compilerTargetLevel = profileProperties
.getProperty("org.eclipse.jdt.core.compiler.codegen.targetPlatform");
- this.systemPackages = new LinkedHashSet<String>(Arrays.asList(profileProperties.getProperty(
+ this.systemPackages = new LinkedHashSet<>(Arrays.asList(profileProperties.getProperty(
"org.osgi.framework.system.packages").split(",")));
this.eeVersion = parseEEVersion(profileProperties.getProperty("org.osgi.framework.system.capabilities"));
this.profileProperties = new Properties();
@@ -82,7 +82,7 @@ public class StandardExecutionEnvironment implements Comparable<StandardExecutio
}
private EEVersion parseEEVersion(String systemCaps) {
- List<EEVersion> eeVersions = new ArrayList<EEVersion>();
+ List<EEVersion> eeVersions = new ArrayList<>();
try {
ManifestElement[] systemCapValues = ManifestElement.parseHeader("org.osgi.framework.system.capabilities",
systemCaps);
@@ -93,7 +93,7 @@ public class StandardExecutionEnvironment implements Comparable<StandardExecutio
version = Version.parseVersion(singleVersion);
} else {
String[] versions = systemCapValues[i].getAttribute("version:List<Version>").split(",");
- List<Version> osgiVersions = new ArrayList<Version>(versions.length);
+ List<Version> osgiVersions = new ArrayList<>(versions.length);
for (String currentVersion : versions) {
osgiVersions.add(Version.parseVersion(currentVersion));
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java
index a07f22479..95624853e 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/MavenDependencyInjector.java
@@ -65,7 +65,7 @@ public final class MavenDependencyInjector {
}
void addDependency(ArtifactDescriptor artifact) {
- List<Dependency> dependencyList = new ArrayList<Dependency>();
+ List<Dependency> dependencyList = new ArrayList<>();
if (artifact.getMavenProject() != null) {
dependencyList.addAll(newProjectDependencies(artifact));
} else {
@@ -84,7 +84,7 @@ public final class MavenDependencyInjector {
+ " can not be represented in Maven model and will not be visible to non-OSGi aware Maven plugins");
return NO_DEPENDENCIES;
}
- List<Dependency> result = new ArrayList<Dependency>();
+ List<Dependency> result = new ArrayList<>();
if (ArtifactType.TYPE_ECLIPSE_PLUGIN.equals(artifact.getKey().getType())) {
for (String classpathElement : getClasspathElements(location)) {
if (".".equals(classpathElement)) {
@@ -134,7 +134,7 @@ public final class MavenDependencyInjector {
private List<Dependency> newProjectDependencies(ArtifactDescriptor artifact) {
ReactorProject dependentMavenProjectProxy = artifact.getMavenProject();
- List<Dependency> result = new ArrayList<Dependency>();
+ List<Dependency> result = new ArrayList<>();
if (!artifact.getMavenProject().sameProject(project)) {
result.add(createProvidedScopeDependency(dependentMavenProjectProxy));
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index b00c3443e..32e086059 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -43,7 +43,7 @@ import org.eclipse.tycho.resolver.TychoResolver;
public class TychoMavenLifecycleParticipant extends AbstractMavenLifecycleParticipant {
private static final String TYCHO_GROUPID = "org.eclipse.tycho";
- private static final Set<String> TYCHO_PLUGIN_IDS = new HashSet<String>(Arrays.asList("tycho-maven-plugin",
+ private static final Set<String> TYCHO_PLUGIN_IDS = new HashSet<>(Arrays.asList("tycho-maven-plugin",
"tycho-p2-director-plugin", "tycho-p2-plugin", "tycho-p2-publisher-plugin", "tycho-p2-repository-plugin",
"tycho-packaging-plugin", "tycho-pomgenerator-plugin", "tycho-source-plugin", "tycho-surefire-plugin",
"tycho-versions-plugin"));
@@ -107,7 +107,7 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
}
protected void validateConsistentTychoVersion(List<MavenProject> projects) throws MavenExecutionException {
- Map<String, Set<MavenProject>> versionToProjectsMap = new HashMap<String, Set<MavenProject>>();
+ Map<String, Set<MavenProject>> versionToProjectsMap = new HashMap<>();
for (MavenProject project : projects) {
for (Plugin plugin : project.getBuild().getPlugins()) {
if (TYCHO_GROUPID.equals(plugin.getGroupId()) && TYCHO_PLUGIN_IDS.contains(plugin.getArtifactId())) {
@@ -120,7 +120,7 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
+ project);
Set<MavenProject> projectSet = versionToProjectsMap.get(version);
if (projectSet == null) {
- projectSet = new LinkedHashSet<MavenProject>();
+ projectSet = new LinkedHashSet<>();
versionToProjectsMap.put(version, projectSet);
}
projectSet.add(project);
@@ -128,7 +128,7 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
}
}
if (versionToProjectsMap.size() > 1) {
- List<String> versions = new ArrayList<String>(versionToProjectsMap.keySet());
+ List<String> versions = new ArrayList<>(versionToProjectsMap.keySet());
Collections.sort(versions);
log.error("Several versions of tycho plugins are configured " + versions + ":");
for (String version : versions) {
@@ -146,7 +146,7 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
// we store intermediate build results in the target/ folder and use the baseDir as unique key
// so multiple modules in the same baseDir would lead to irreproducible/unexpected results
// e.g. with mvn clean. This should really not be supported by maven core
- Set<File> baseDirs = new HashSet<File>();
+ Set<File> baseDirs = new HashSet<>();
for (MavenProject project : projects) {
File basedir = project.getBasedir();
if (baseDirs.contains(basedir)) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractArtifactDependencyWalker.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractArtifactDependencyWalker.java
index b43e0c654..29ffd1512 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractArtifactDependencyWalker.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/AbstractArtifactDependencyWalker.java
@@ -122,7 +122,7 @@ public abstract class AbstractArtifactDependencyWalker implements ArtifactDepend
}
}
- Set<String> bundles = new HashSet<String>();
+ Set<String> bundles = new HashSet<>();
for (ArtifactDescriptor artifact : visited.getVisited()) {
ArtifactKey key = artifact.getKey();
if (ArtifactType.TYPE_ECLIPSE_PLUGIN.equals(key.getType())) {
@@ -240,16 +240,16 @@ public abstract class AbstractArtifactDependencyWalker implements ArtifactDepend
}
protected static class WalkbackPath {
- private Map<ArtifactKey, ArtifactDescriptor> visited = new HashMap<ArtifactKey, ArtifactDescriptor>();
+ private Map<ArtifactKey, ArtifactDescriptor> visited = new HashMap<>();
- private Stack<ArtifactDescriptor> walkback = new Stack<ArtifactDescriptor>();
+ private Stack<ArtifactDescriptor> walkback = new Stack<>();
boolean visited(ArtifactKey key) {
return visited.containsKey(key);
}
public List<ArtifactDescriptor> getWalkback() {
- return new ArrayList<ArtifactDescriptor>(walkback);
+ return new ArrayList<>(walkback);
}
void enter(ArtifactDescriptor artifact) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java
index eeea85924..2ea257fe3 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/BuildPropertiesParserImpl.java
@@ -41,7 +41,7 @@ public class BuildPropertiesParserImpl implements BuildPropertiesParser, Disposa
@Requirement
private Logger logger;
- private final LRUCache<String, BuildProperties> cache = new LRUCache<String, BuildProperties>(50);
+ private final LRUCache<String, BuildProperties> cache = new LRUCache<>(50);
public BuildPropertiesParserImpl() {
// empty to let plexus create new instances
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java
index e21afe6c8..adbf5fab5 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java
@@ -34,10 +34,10 @@ import org.eclipse.tycho.locking.facade.FileLocker;
public class DefaultBundleReader extends AbstractLogEnabled implements BundleReader {
public static final String CACHE_PATH = ".cache/tycho";
- private final LRUCache<String, OsgiManifest> manifestCache = new LRUCache<String, OsgiManifest>(50);
+ private final LRUCache<String, OsgiManifest> manifestCache = new LRUCache<>(50);
private File cacheDir;
- private Set<String> extractedFiles = new HashSet<String>();
+ private Set<String> extractedFiles = new HashSet<>();
@Requirement
private FileLockService fileLockService;
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java
index d9bad3daf..0fb103767 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultReactorProject.java
@@ -50,7 +50,7 @@ public class DefaultReactorProject implements ReactorProject {
}
public static List<ReactorProject> adapt(MavenSession session) {
- ArrayList<ReactorProject> result = new ArrayList<ReactorProject>();
+ ArrayList<ReactorProject> result = new ArrayList<>();
for (MavenProject project : session.getProjects()) {
result.add(adapt(project));
}
@@ -155,7 +155,7 @@ public class DefaultReactorProject implements ReactorProject {
return primary;
}
- LinkedHashSet<Object> result = new LinkedHashSet<Object>(primary);
+ LinkedHashSet<Object> result = new LinkedHashSet<>(primary);
result.addAll(secondary);
return result;
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java
index 9b84cf430..c4bedaa5c 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DependencyComputer.java
@@ -92,14 +92,14 @@ public class DependencyComputer {
}
public List<DependencyEntry> computeDependencies(StateHelper helper, BundleDescription desc) {
- ArrayList<DependencyEntry> entries = new ArrayList<DependencyEntry>();
+ ArrayList<DependencyEntry> entries = new ArrayList<>();
if (desc == null)
return entries;
Map<BundleDescription, ArrayList<AccessRule>> map = retrieveVisiblePackagesFromState(helper, desc);
- HashSet<BundleDescription> added = new HashSet<BundleDescription>();
+ HashSet<BundleDescription> added = new HashSet<>();
// to avoid cycles, e.g. when a bundle imports a package it exports
added.add(desc);
@@ -119,7 +119,7 @@ public class DependencyComputer {
// add Import-Package
// sort by symbolicName_version to get a consistent order
- Map<String, BundleDescription> sortedMap = new TreeMap<String, BundleDescription>();
+ Map<String, BundleDescription> sortedMap = new TreeMap<>();
for (BundleDescription bundle : map.keySet()) {
sortedMap.put(bundle.toString(), bundle);
}
@@ -138,7 +138,7 @@ public class DependencyComputer {
private Map<BundleDescription, ArrayList<AccessRule>> retrieveVisiblePackagesFromState(StateHelper helper,
BundleDescription desc) {
- Map<BundleDescription, ArrayList<AccessRule>> visiblePackages = new HashMap<BundleDescription, ArrayList<AccessRule>>();
+ Map<BundleDescription, ArrayList<AccessRule>> visiblePackages = new HashMap<>();
addVisiblePackagesFromState(helper, desc, visiblePackages);
if (desc.getHost() != null)
addVisiblePackagesFromState(helper, (BundleDescription) desc.getHost().getSupplier(), visiblePackages);
@@ -156,7 +156,7 @@ public class DependencyComputer {
continue;
ArrayList<AccessRule> list = visiblePackages.get(exporter);
if (list == null)
- list = new ArrayList<AccessRule>();
+ list = new ArrayList<>();
AccessRule rule = getRule(helper, desc, exports[i]);
if (!list.contains(rule))
list.add(rule);
@@ -290,7 +290,7 @@ public class DependencyComputer {
* [1] http://blog.meschberger.ch/2008/10/osgi-bundles-require-classes-from.html
*/
public List<AccessRule> computeBootClasspathExtraAccessRules(StateHelper helper, BundleDescription desc) {
- List<AccessRule> result = new ArrayList<AccessRule>();
+ List<AccessRule> result = new ArrayList<>();
ExportPackageDescription[] exports = helper.getVisiblePackages(desc);
for (ExportPackageDescription export : exports) {
BundleDescription host = export.getExporter();
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java
index bf1a0760c..ac65a45ab 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java
@@ -76,7 +76,7 @@ public class EclipseRepositoryProject extends AbstractArtifactBasedProject {
* @return
*/
public List<Category> loadCategories(final MavenProject project) {
- List<Category> categories = new ArrayList<Category>();
+ List<Category> categories = new ArrayList<>();
for (File file : getCategoryFiles(project)) {
try {
categories.add(Category.read(file));
@@ -94,7 +94,7 @@ public class EclipseRepositoryProject extends AbstractArtifactBasedProject {
* @return
*/
protected List<ProductConfiguration> loadProducts(final MavenProject project) {
- List<ProductConfiguration> products = new ArrayList<ProductConfiguration>();
+ List<ProductConfiguration> products = new ArrayList<>();
for (File file : getProductFiles(project)) {
try {
products.add(ProductConfiguration.read(file));
@@ -106,7 +106,7 @@ public class EclipseRepositoryProject extends AbstractArtifactBasedProject {
}
private List<File> getCategoryFiles(MavenProject project) {
- List<File> res = new ArrayList<File>();
+ List<File> res = new ArrayList<>();
File categoryFile = new File(project.getBasedir(), "category.xml");
if (categoryFile.exists()) {
res.add(categoryFile);
@@ -123,7 +123,7 @@ public class EclipseRepositoryProject extends AbstractArtifactBasedProject {
*/
public List<File> getProductFiles(MavenProject project) {
File projectLocation = project.getBasedir();
- List<File> res = new ArrayList<File>();
+ List<File> res = new ArrayList<>();
for (File f : projectLocation.listFiles()) {
if (f.isFile() && f.getName().endsWith(".product")) {
res.add(f);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java
index 8f7a49c9a..941a84b9f 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java
@@ -152,9 +152,9 @@ public class EquinoxResolver {
throws BundleException {
State state = factory.createState(true);
- Map<File, Dictionary<String, String>> systemBundles = new LinkedHashMap<File, Dictionary<String, String>>();
- Map<File, Dictionary<String, String>> externalBundles = new LinkedHashMap<File, Dictionary<String, String>>();
- Map<File, Dictionary<String, String>> projects = new LinkedHashMap<File, Dictionary<String, String>>();
+ Map<File, Dictionary<String, String>> systemBundles = new LinkedHashMap<>();
+ Map<File, Dictionary<String, String>> externalBundles = new LinkedHashMap<>();
+ Map<File, Dictionary<String, String>> projects = new LinkedHashMap<>();
for (ArtifactDescriptor artifact : artifacts.getArtifacts(ArtifactType.TYPE_ECLIPSE_PLUGIN)) {
File location = artifact.getLocation();
@@ -189,10 +189,10 @@ public class EquinoxResolver {
addBundle(state, id++, entry.getKey(), entry.getValue(), true/* override */);
}
- List<Dictionary<Object, Object>> allProps = new ArrayList<Dictionary<Object, Object>>();
+ List<Dictionary<Object, Object>> allProps = new ArrayList<>();
// force our system.bundle
- Hashtable<Object, Object> platformProperties = new Hashtable<Object, Object>(properties);
+ Hashtable<Object, Object> platformProperties = new Hashtable<>(properties);
platformProperties.put(StateImpl.STATE_SYSTEM_BUNDLE, state.getBundle(SYSTEM_BUNDLE_ID).getSymbolicName());
allProps.add(platformProperties);
if (ignoreEE) {
@@ -201,7 +201,7 @@ public class EquinoxResolver {
Properties envProps = ExecutionEnvironmentUtils.getExecutionEnvironment(profile).getProfileProperties();
String systemPackages = envProps.getProperty("org.osgi.framework.system.packages");
String execEnv = envProps.getProperty("org.osgi.framework.executionenvironment");
- Dictionary<Object, Object> prop = new Hashtable<Object, Object>();
+ Dictionary<Object, Object> prop = new Hashtable<>();
prop.put("org.osgi.framework.system.packages", systemPackages);
prop.put("org.osgi.framework.executionenvironment", execEnv);
allProps.add(prop);
@@ -272,7 +272,7 @@ public class EquinoxResolver {
private Dictionary<String, String> getSystemBundleManifest(Properties properties) {
String systemPackages = properties.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES);
- Dictionary<String, String> systemBundleManifest = new Hashtable<String, String>();
+ Dictionary<String, String> systemBundleManifest = new Hashtable<>();
systemBundleManifest.put(Constants.BUNDLE_SYMBOLICNAME, SYSTEM_BUNDLE_SYMBOLIC_NAME);
systemBundleManifest.put(Constants.BUNDLE_VERSION, "0.0.0");
systemBundleManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2");
@@ -307,7 +307,7 @@ public class EquinoxResolver {
}
public ResolverError[] getResolverErrors(State state, BundleDescription bundle) {
- Set<ResolverError> errors = new LinkedHashSet<ResolverError>();
+ Set<ResolverError> errors = new LinkedHashSet<>();
getRelevantErrors(state, errors, bundle);
return (ResolverError[]) errors.toArray(new ResolverError[errors.size()]);
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
index 4a5e938f5..802f20cc4 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
@@ -169,7 +169,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
BundleDescription bundleDescription = state.getBundleByLocation(project.getBasedir().getAbsolutePath());
- List<ClasspathEntry> classpath = new ArrayList<ClasspathEntry>();
+ List<ClasspathEntry> classpath = new ArrayList<>();
// project itself
ArtifactDescriptor artifact = getArtifact(artifacts, project.getBasedir(), bundleDescription.getSymbolicName());
@@ -181,7 +181,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
addExtraClasspathEntries(classpath, projectProxy, artifacts);
// dependencies
- List<AccessRule> strictBootClasspathAccessRules = new ArrayList<AccessRule>();
+ List<AccessRule> strictBootClasspathAccessRules = new ArrayList<>();
strictBootClasspathAccessRules.add(new DefaultAccessRule("java/**", false));
for (DependencyEntry entry : dependencyComputer.computeDependencies(state.getStateHelper(), bundleDescription)) {
if (EquinoxResolver.SYSTEM_BUNDLE_ID == entry.desc.getBundleId()) {
@@ -306,7 +306,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
* Returns project compile classpath entries.
*/
private List<File> getThisProjectClasspath(ArtifactDescriptor bundle, ReactorProject project) {
- LinkedHashSet<File> classpath = new LinkedHashSet<File>();
+ LinkedHashSet<File> classpath = new LinkedHashSet<>();
EclipsePluginProject pdeProject = getEclipsePluginProject(project);
@@ -325,7 +325,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
}
}
- return new ArrayList<File>(classpath);
+ return new ArrayList<>(classpath);
}
/**
@@ -335,7 +335,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
*/
private List<File> getOtherProjectClasspath(ArtifactDescriptor bundle, ReactorProject otherProject,
String nestedPath) {
- LinkedHashSet<File> classpath = new LinkedHashSet<File>();
+ LinkedHashSet<File> classpath = new LinkedHashSet<>();
EclipsePluginProject pdeProject = getEclipsePluginProject(otherProject);
@@ -356,7 +356,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
classpath.add(new File(otherProject.getBasedir(), cp));
}
}
- return new ArrayList<File>(classpath);
+ return new ArrayList<>(classpath);
}
private void addExtraClasspathEntries(List<ClasspathEntry> classpath, ReactorProject project,
@@ -410,7 +410,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
}
private List<File> getBundleClasspath(ArtifactDescriptor bundle) {
- LinkedHashSet<File> classpath = new LinkedHashSet<File>();
+ LinkedHashSet<File> classpath = new LinkedHashSet<>();
for (String cp : parseBundleClasspath(bundle)) {
File entry;
@@ -425,11 +425,11 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
}
}
- return new ArrayList<File>(classpath);
+ return new ArrayList<>(classpath);
}
private List<File> getBundleEntry(ArtifactDescriptor bundle, String nestedPath) {
- LinkedHashSet<File> classpath = new LinkedHashSet<File>();
+ LinkedHashSet<File> classpath = new LinkedHashSet<>();
File entry;
if (".".equals(nestedPath)) {
@@ -442,7 +442,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
classpath.add(entry);
}
- return new ArrayList<File>(classpath);
+ return new ArrayList<>(classpath);
}
private String[] parseBundleClasspath(ArtifactDescriptor bundle) {
@@ -468,7 +468,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
// validate if os/ws/arch are not null and actually match the filter
if (ws != null && os != null && arch != null) {
- Map<String, String> properties = new HashMap<String, String>();
+ Map<String, String> properties = new HashMap<>();
properties.put(PlatformPropertiesUtils.OSGI_WS, ws);
properties.put(PlatformPropertiesUtils.OSGI_OS, os);
properties.put(PlatformPropertiesUtils.OSGI_ARCH, arch);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/project/EclipsePluginProjectImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/project/EclipsePluginProjectImpl.java
index e64d9c54a..1f34611b0 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/project/EclipsePluginProjectImpl.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/project/EclipsePluginProjectImpl.java
@@ -28,7 +28,7 @@ public class EclipsePluginProjectImpl implements EclipsePluginProject {
private final ReactorProject project;
private final BuildProperties buildProperties;
- private final LinkedHashMap<String, BuildOutputJar> outputJars = new LinkedHashMap<String, BuildOutputJar>();
+ private final LinkedHashMap<String, BuildOutputJar> outputJars = new LinkedHashMap<>();
private final BuildOutputJar dotOutputJar;
public EclipsePluginProjectImpl(ReactorProject project, BuildPropertiesParser buildPropertiesParser)
@@ -36,12 +36,12 @@ public class EclipsePluginProjectImpl implements EclipsePluginProject {
this.project = project;
this.buildProperties = buildPropertiesParser.parse(project.getBasedir());
- LinkedHashMap<String, BuildOutputJar> jars = new LinkedHashMap<String, BuildOutputJar>();
+ LinkedHashMap<String, BuildOutputJar> jars = new LinkedHashMap<>();
for (String jarName : buildProperties.getJarsCompileOrder()) {
jars.put(jarName, null);
}
- List<String> extraClasspath = new ArrayList<String>();
+ List<String> extraClasspath = new ArrayList<>();
extraClasspath.addAll(buildProperties.getJarsExtraClasspath());
String dotJarName = null;
@@ -82,7 +82,7 @@ public class EclipsePluginProjectImpl implements EclipsePluginProject {
}
private List<File> toFileList(File parent, List<String> names) throws IOException {
- ArrayList<File> result = new ArrayList<File>();
+ ArrayList<File> result = new ArrayList<>();
for (String name : names) {
// don't call getCanonicalFile here because otherwise we'll be forced to call getCanonical* everywhere
result.add(new File(new File(parent, name).toURI().normalize()));
@@ -97,7 +97,7 @@ public class EclipsePluginProjectImpl implements EclipsePluginProject {
@Override
public List<BuildOutputJar> getOutputJars() {
- return new ArrayList<BuildOutputJar>(outputJars.values());
+ return new ArrayList<>(outputJars.values());
}
@Override
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java
index 8f725aa2a..8e2c8f0ee 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/ArtifactCollection.java
@@ -37,12 +37,12 @@ import org.osgi.framework.Version;
public class ArtifactCollection {
private static final Version VERSION_0_0_0 = new Version("0.0.0");
- protected final Map<ArtifactKey, ArtifactDescriptor> artifacts = new LinkedHashMap<ArtifactKey, ArtifactDescriptor>();
+ protected final Map<ArtifactKey, ArtifactDescriptor> artifacts = new LinkedHashMap<>();
- protected final Map<File, Map<String, ArtifactDescriptor>> locations = new LinkedHashMap<File, Map<String, ArtifactDescriptor>>();
+ protected final Map<File, Map<String, ArtifactDescriptor>> locations = new LinkedHashMap<>();
public List<ArtifactDescriptor> getArtifacts(String type) {
- ArrayList<ArtifactDescriptor> result = new ArrayList<ArtifactDescriptor>();
+ ArrayList<ArtifactDescriptor> result = new ArrayList<>();
for (Map.Entry<ArtifactKey, ArtifactDescriptor> entry : artifacts.entrySet()) {
if (type.equals(entry.getKey().getType())) {
result.add(entry.getValue());
@@ -53,7 +53,7 @@ public class ArtifactCollection {
}
public List<ArtifactDescriptor> getArtifacts() {
- return new ArrayList<ArtifactDescriptor>(artifacts.values());
+ return new ArrayList<>(artifacts.values());
}
public void addArtifactFile(ArtifactKey key, File location, Set<Object> installableUnits) {
@@ -95,7 +95,7 @@ public class ArtifactCollection {
throw new IllegalStateException("Inconsistent artifact with key " + artifact.getKey());
}
- units = new LinkedHashSet<Object>(original.getInstallableUnits());
+ units = new LinkedHashSet<>(original.getInstallableUnits());
units.addAll(artifact.getInstallableUnits());
} else {
units = artifact.getInstallableUnits();
@@ -122,7 +122,7 @@ public class ArtifactCollection {
Map<String, ArtifactDescriptor> classified = locations.get(location);
if (classified == null) {
- classified = new LinkedHashMap<String, ArtifactDescriptor>();
+ classified = new LinkedHashMap<>();
locations.put(location, classified);
}
@@ -186,7 +186,7 @@ public class ArtifactCollection {
}
// features with matching id, sorted by version, highest version first
- SortedMap<Version, ArtifactDescriptor> relevantArtifacts = new TreeMap<Version, ArtifactDescriptor>(
+ SortedMap<Version, ArtifactDescriptor> relevantArtifacts = new TreeMap<>(
new Comparator<Version>() {
@Override
public int compare(Version o1, Version o2) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/DefaultDependencyArtifacts.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/DefaultDependencyArtifacts.java
index 81853f900..c57ab485d 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/DefaultDependencyArtifacts.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/DefaultDependencyArtifacts.java
@@ -25,12 +25,12 @@ public class DefaultDependencyArtifacts extends ArtifactCollection implements De
/**
* ArtifactKey cache used to correlate equal instances to reduce memory usage
*/
- private static final WeakHashMap<ArtifactKey, ArtifactKey> KEY_CACHE = new WeakHashMap<ArtifactKey, ArtifactKey>();
+ private static final WeakHashMap<ArtifactKey, ArtifactKey> KEY_CACHE = new WeakHashMap<>();
/**
* ArtifactDescriptor cache used to correlate equal instances to reduce memory usage
*/
- private static final WeakHashMap<ArtifactDescriptor, ArtifactDescriptor> ARTIFACT_CACHE = new WeakHashMap<ArtifactDescriptor, ArtifactDescriptor>();
+ private static final WeakHashMap<ArtifactDescriptor, ArtifactDescriptor> ARTIFACT_CACHE = new WeakHashMap<>();
/**
* 'this' project, i.e. the project the dependencies were resolved for. can be null.
@@ -41,7 +41,7 @@ public class DefaultDependencyArtifacts extends ArtifactCollection implements De
* Set of installable unit in the target platform of the module that do not come from the local
* reactor.
*/
- protected final Set<Object/* IInstallableUnit */> nonReactorUnits = new LinkedHashSet<Object>();
+ protected final Set<Object/* IInstallableUnit */> nonReactorUnits = new LinkedHashSet<>();
public DefaultDependencyArtifacts() {
this(null);
@@ -80,7 +80,7 @@ public class DefaultDependencyArtifacts extends ArtifactCollection implements De
@Override
public Set<?/* IInstallableUnit */> getInstallableUnits() {
- Set<Object> units = new LinkedHashSet<Object>();
+ Set<Object> units = new LinkedHashSet<>();
for (ArtifactDescriptor artifact : artifacts.values()) {
if (project == null || !project.equals(artifact.getMavenProject())) {
units.addAll(artifact.getInstallableUnits());
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
index 7d03848bc..4361cc64e 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java
@@ -72,7 +72,7 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
}
public Set<File> getFeatures(File site) {
- Set<File> result = new LinkedHashSet<File>();
+ Set<File> result = new LinkedHashSet<>();
File[] features = new File(site, FEATURES).listFiles(new FEATURE_FILTER());
if (features != null) {
result.addAll(Arrays.asList(features));
@@ -82,7 +82,7 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
}
public Set<File> getInstalledPlugins() {
- Set<File> result = new LinkedHashSet<File>();
+ Set<File> result = new LinkedHashSet<>();
try {
result.addAll(readBundlesTxt(location));
} catch (IOException e) {
@@ -92,7 +92,7 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
}
public Set<File> getPlugins(File site) {
- Set<File> result = new LinkedHashSet<File>();
+ Set<File> result = new LinkedHashSet<>();
addPlugins(result, new File(site, PLUGINS).listFiles());
@@ -121,7 +121,7 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
}
public Set<File> getSites() {
- Set<File> result = new LinkedHashSet<File>();
+ Set<File> result = new LinkedHashSet<>();
if (location == null) {
return result;
@@ -283,7 +283,7 @@ public class EclipseInstallationLayout extends AbstractLogEnabled {
return null;
}
- ArrayList<File> plugins = new ArrayList<File>();
+ ArrayList<File> plugins = new ArrayList<>();
BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(bundlesInfo)));
String line;
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalDependencyResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalDependencyResolver.java
index c295d1558..af66e6a08 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalDependencyResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/LocalDependencyResolver.java
@@ -150,7 +150,7 @@ public class LocalDependencyResolver extends AbstractLogEnabled implements Depen
if (configuration != null
&& TargetPlatformConfiguration.POM_DEPENDENCIES_CONSIDER.equals(configuration.getPomDependencies())) {
- Map<String, MavenProject> projectIds = new HashMap<String, MavenProject>(session.getProjects().size() * 2);
+ Map<String, MavenProject> projectIds = new HashMap<>(session.getProjects().size() * 2);
// make a list of reactor projects
for (MavenProject p : session.getProjects()) {
String key = ArtifactUtils.key(p.getGroupId(), p.getArtifactId(), p.getVersion());
@@ -176,13 +176,13 @@ public class LocalDependencyResolver extends AbstractLogEnabled implements Depen
}
}
// handle rest of dependencies
- ArrayList<String> scopes = new ArrayList<String>();
+ ArrayList<String> scopes = new ArrayList<>();
scopes.add(Artifact.SCOPE_COMPILE);
Collection<Artifact> artifacts;
try {
artifacts = projectDependenciesResolver.resolve(project, scopes, session);
} catch (MultipleArtifactsNotFoundException e) {
- Collection<Artifact> missing = new HashSet<Artifact>(e.getMissingArtifacts());
+ Collection<Artifact> missing = new HashSet<>(e.getMissingArtifacts());
for (Iterator<Artifact> it = missing.iterator(); it.hasNext();) {
Artifact a = it.next();
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/MultiEnvironmentDependencyArtifacts.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/MultiEnvironmentDependencyArtifacts.java
index c12e55d6e..e06d2472a 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/MultiEnvironmentDependencyArtifacts.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/MultiEnvironmentDependencyArtifacts.java
@@ -19,7 +19,7 @@ import org.eclipse.tycho.artifacts.DependencyArtifacts;
import org.eclipse.tycho.core.shared.TargetEnvironment;
public class MultiEnvironmentDependencyArtifacts extends DefaultDependencyArtifacts {
- public Map<TargetEnvironment, DependencyArtifacts> platforms = new LinkedHashMap<TargetEnvironment, DependencyArtifacts>();
+ public Map<TargetEnvironment, DependencyArtifacts> platforms = new LinkedHashMap<>();
public MultiEnvironmentDependencyArtifacts() {
this(null);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/utils/MavenSessionUtils.java b/tycho-core/src/main/java/org/eclipse/tycho/core/utils/MavenSessionUtils.java
index 1e730aa7f..4f84ae558 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/utils/MavenSessionUtils.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/utils/MavenSessionUtils.java
@@ -38,7 +38,7 @@ public class MavenSessionUtils {
}
public static Map<File, MavenProject> getBasedirMap(List<MavenProject> projects) {
- HashMap<File, MavenProject> result = new HashMap<File, MavenProject>();
+ HashMap<File, MavenProject> result = new HashMap<>();
for (MavenProject project : projects) {
result.put(project.getBasedir(), project);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/utils/TychoProjectUtils.java b/tycho-core/src/main/java/org/eclipse/tycho/core/utils/TychoProjectUtils.java
index 03a7894a4..da3ff3bb7 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/utils/TychoProjectUtils.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/utils/TychoProjectUtils.java
@@ -100,7 +100,7 @@ public class TychoProjectUtils {
List<DependencySeed> dependencySeeds = (List<DependencySeed>) project
.getContextValue(TychoConstants.CTX_DEPENDENCY_SEEDS);
if (dependencySeeds == null) {
- dependencySeeds = new ArrayList<DependencySeed>();
+ dependencySeeds = new ArrayList<>();
project.setContextValue(TychoConstants.CTX_DEPENDENCY_SEEDS, dependencySeeds);
}
return dependencySeeds;
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/dev/DevWorkspaceResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/dev/DevWorkspaceResolver.java
index 8bbbddfe6..a60d3127f 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/dev/DevWorkspaceResolver.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/dev/DevWorkspaceResolver.java
@@ -80,8 +80,8 @@ public class DevWorkspaceResolver implements Initializable {
@Override
public void initialize() throws InitializationException {
- Map<File, String> workspaceDeventries = new HashMap<File, String>();
- Map<File, File> workspaceBasedirs = new HashMap<File, File>();
+ Map<File, String> workspaceDeventries = new HashMap<>();
+ Map<File, File> workspaceBasedirs = new HashMap<>();
ArtifactCollection workspaceBundles = new ArtifactCollection();
String stateLocation = System.getProperty(SYSPROP_STATELOCATION);
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
index 4a750f7f6..35f1b6bc1 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeLocator.java
@@ -224,7 +224,7 @@ public class TychoOsgiRuntimeLocator implements EquinoxRuntimeLocator {
}
protected List<ArtifactRepository> getPluginRepositories(MavenSession session) {
- List<ArtifactRepository> repositories = new ArrayList<ArtifactRepository>();
+ List<ArtifactRepository> repositories = new ArrayList<>();
for (MavenProject project : session.getProjects()) {
repositories.addAll(project.getPluginArtifactRepositories());
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeMainArtifacts.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeMainArtifacts.java
index 25a98fb9b..8f05a64ed 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeMainArtifacts.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/TychoOsgiRuntimeMainArtifacts.java
@@ -22,7 +22,7 @@ public class TychoOsgiRuntimeMainArtifacts implements TychoOsgiRuntimeArtifacts
private static final List<Dependency> ARTIFACTS;
static {
- ARTIFACTS = new ArrayList<Dependency>();
+ ARTIFACTS = new ArrayList<>();
String tychoVersion = TychoVersion.getTychoVersion();
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/WorkspaceTychoOsgiRuntimeLocator.java b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/WorkspaceTychoOsgiRuntimeLocator.java
index d32521f33..5c18df9e4 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/WorkspaceTychoOsgiRuntimeLocator.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/osgi/runtime/WorkspaceTychoOsgiRuntimeLocator.java
@@ -58,7 +58,7 @@ class WorkspaceTychoOsgiRuntimeLocator {
// the above fails with IOException if .product file is not available or can't be read
// we get here only when we have valid product instance
- Set<String> missing = new LinkedHashSet<String>();
+ Set<String> missing = new LinkedHashSet<>();
for (PluginRef pluginRef : product.getPlugins()) {
DevBundleInfo bundleInfo = workspaceState.getBundleInfo(pluginRef.getId(), pluginRef.getVersion());
if (bundleInfo != null) {
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java
index a24e1fe68..076af0108 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironmentTest.java
@@ -133,7 +133,7 @@ public class CustomExecutionEnvironmentTest {
@Test
public void testJavaSEVersionNameMappings() throws Exception {
- List<SystemCapability> javaSeVersions = new ArrayList<SystemCapability>();
+ List<SystemCapability> javaSeVersions = new ArrayList<>();
for (String version : new String[] { "1.2.0", "1.3.0", "1.4.0", "1.5.0", "1.6.0", "1.7.0" }) {
SystemCapability capability = new SystemCapability(Type.OSGI_EE, "JavaSE", version);
javaSeVersions.add(capability);
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironmentTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironmentTest.java
index dcae65367..2fe7a7dfb 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironmentTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/ee/StandardExecutionEnvironmentTest.java
@@ -166,12 +166,12 @@ public class StandardExecutionEnvironmentTest {
@Test
public void testCompare() throws Exception {
- List<StandardExecutionEnvironment> expectedList = new ArrayList<StandardExecutionEnvironment>(Arrays.asList(
+ List<StandardExecutionEnvironment> expectedList = new ArrayList<>(Arrays.asList(
osgiMin10Environment, osgiMin11Environment, osgiMin12Environment, cdc10Environment, cdc11Environment,
jre11Environment, j2SE12Environment, j2SE13Environment, j2SE14Environment, j2SE5Enviroment,
javaSE6Enviroment, javaSE7Enviroment, javaSECompact1Enviroment, javaSECompact2Enviroment,
javaSECompact3Enviroment, javaSE8Enviroment));
- List<StandardExecutionEnvironment> actualList = new ArrayList<StandardExecutionEnvironment>(expectedList);
+ List<StandardExecutionEnvironment> actualList = new ArrayList<>(expectedList);
Collections.shuffle(actualList);
Collections.sort(actualList);
assertEquals(expectedList, actualList);
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/ArtifactDependencyWalkerTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/ArtifactDependencyWalkerTest.java
index 71671ad6e..e0de295c4 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/ArtifactDependencyWalkerTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/ArtifactDependencyWalkerTest.java
@@ -38,8 +38,8 @@ import org.sonatype.aether.util.DefaultRepositorySystemSession;
public class ArtifactDependencyWalkerTest extends AbstractTychoMojoTestCase {
public void testProductDepdendencies() throws Exception {
- final ArrayList<PluginDescription> plugins = new ArrayList<PluginDescription>();
- final ArrayList<FeatureDescription> features = new ArrayList<FeatureDescription>();
+ final ArrayList<PluginDescription> plugins = new ArrayList<>();
+ final ArrayList<FeatureDescription> features = new ArrayList<>();
walkProduct("src/test/resources/dependencywalker/plugin_based.product", plugins, features);
assertEquals(0, features.size());
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DefaultDependencyArtifactsTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DefaultDependencyArtifactsTest.java
index d553ada73..e7b1164ba 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DefaultDependencyArtifactsTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DefaultDependencyArtifactsTest.java
@@ -147,7 +147,7 @@ public class DefaultDependencyArtifactsTest {
}
private Set<Object> asSet(Object... values) {
- Set<Object> result = new LinkedHashSet<Object>();
+ Set<Object> result = new LinkedHashSet<>();
for (Object v : values) {
result.add(v);
}
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java
index ff911db5f..047b9d65f 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/DependencyComputerTest.java
@@ -143,11 +143,11 @@ public class DependencyComputerTest extends AbstractTychoMojoTestCase {
List<DependencyEntry> bundle2Dependencies = computeDependencies(bundle2Project);
assertEquals(1, bundle2Dependencies.size());
DependencyEntry dependencyBundle2 = bundle2Dependencies.get(0);
- Set<String> accessRules = new HashSet<String>();
+ Set<String> accessRules = new HashSet<>();
for (AccessRule rule : dependencyBundle2.rules) {
accessRules.add(rule.getPattern());
}
- assertEquals(new HashSet<String>(asList("javax/net/ssl/*", "org/osgi/framework/*")), accessRules);
+ assertEquals(new HashSet<>(asList("javax/net/ssl/*", "org/osgi/framework/*")), accessRules);
}
private List<DependencyEntry> computeDependencies(MavenProject project) throws BundleException {
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/EclipseInstallationLayoutTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/EclipseInstallationLayoutTest.java
index b79d32108..4ddba9e46 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/EclipseInstallationLayoutTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/EclipseInstallationLayoutTest.java
@@ -56,7 +56,7 @@ public class EclipseInstallationLayoutTest extends PlexusTestCase {
File targetPlatform = new File("src/test/resources/targetplatforms/wtp-3.0").getCanonicalFile();
EclipseInstallationLayout finder = getPluginFinder(targetPlatform);
- List<File> plugins = new ArrayList<File>();
+ List<File> plugins = new ArrayList<>();
for (File site : finder.getSites()) {
plugins.addAll(getCannonicalFiles(finder.getPlugins(site)));
}
@@ -85,7 +85,7 @@ public class EclipseInstallationLayoutTest extends PlexusTestCase {
}
private List<File> getCannonicalFiles(Set<File> files) throws IOException {
- ArrayList<File> result = new ArrayList<File>();
+ ArrayList<File> result = new ArrayList<>();
for (File file : files) {
result.add(file.getCanonicalFile());
}
@@ -96,7 +96,7 @@ public class EclipseInstallationLayoutTest extends PlexusTestCase {
File targetPlatform = new File("src/test/resources/targetplatforms/simple").getCanonicalFile();
EclipseInstallationLayout finder = getPluginFinder(targetPlatform);
- List<File> sites = new ArrayList<File>(finder.getSites());
+ List<File> sites = new ArrayList<>(finder.getSites());
assertEquals(2, sites.size());
assertEquals(targetPlatform, sites.get(0));
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/MavenDependencyCollectorTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/MavenDependencyCollectorTest.java
index 6853fa9dc..83e7d4908 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/MavenDependencyCollectorTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/MavenDependencyCollectorTest.java
@@ -95,11 +95,11 @@ public class MavenDependencyCollectorTest extends AbstractTychoMojoTestCase {
File pom = new File(getBasedir("projects/sourceFolders"), "pom.xml");
List<MavenProject> projects = getSortedProjects(newMavenExecutionRequest(pom));
MavenProject project = (MavenProject) projects.get(0);
- List<File> sourceRootFiles = new ArrayList<File>();
+ List<File> sourceRootFiles = new ArrayList<>();
for (String compileRoot : project.getCompileSourceRoots()) {
sourceRootFiles.add(new File(compileRoot));
}
- List<File> testRootFiles = new ArrayList<File>();
+ List<File> testRootFiles = new ArrayList<>();
for (String testCompileRoot : project.getTestCompileSourceRoots()) {
testRootFiles.add(new File(testCompileRoot));
}
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
index 8ea17334c..9df75efa6 100644
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/test/TychoTest.java
@@ -120,7 +120,7 @@ public class TychoTest extends AbstractTychoMojoTestCase {
List<MavenProject> projects = getSortedProjects(basedir);
- List<String> artifactIds = new ArrayList<String>();
+ List<String> artifactIds = new ArrayList<>();
for (MavenProject project : projects) {
artifactIds.add(project.getArtifactId());
}

Back to the top