Skip to content

Commit

Permalink
[MNG-6847] Use diamond operator
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne committed Aug 20, 2023
1 parent 85680e5 commit b3486cd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
22 changes: 11 additions & 11 deletions src/test/java/org/apache/maven/plugins/ejb/EjbMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ public void testClientJarDefaultInclusionsExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testClientJarInclusions() throws Exception {
final List<String> inclusions = new LinkedList<String>();
final List<String> inclusions = new LinkedList<>();
inclusions.add("**/*Include.class");

final MavenProjectResourcesStub project = createTestProject("client-includes");
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<String>(), null);
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<>(), null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -262,11 +262,11 @@ public void testClientJarInclusions() throws Exception {
*/
public void testClientJarExclusions() throws Exception {

final List<String> exclusions = new LinkedList<String>();
final List<String> exclusions = new LinkedList<>();
exclusions.add("**/*Exclude.class");

final MavenProjectResourcesStub project = createTestProject("client-excludes");
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<String>(), exclusions, null);
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<>(), exclusions, null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -302,12 +302,12 @@ public void testClientJarExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testMainJarExclusions() throws Exception {
final List<String> exclusions = new LinkedList<String>();
final List<String> exclusions = new LinkedList<>();
exclusions.add("**/*Exclude.class");

final MavenProjectResourcesStub project = createTestProject("main-excludes");
final EjbMojo mojo =
lookupMojoWithSettings(project, new LinkedList<String>(), new LinkedList<String>(), exclusions);
lookupMojoWithSettings(project, new LinkedList<>(), new LinkedList<>(), exclusions);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -343,12 +343,12 @@ public void testMainJarExclusions() throws Exception {
* @throws Exception if any exception occurs
*/
public void testClientJarInclusionsWithSubPackage() throws Exception {
final List<String> inclusions = new LinkedList<String>();
final List<String> inclusions = new LinkedList<>();
inclusions.add("org/sample/ejb/*.class");

final MavenProjectResourcesStub project = createTestProject("client-includes-subpackage");

final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<String>(), null);
final EjbMojo mojo = lookupMojoWithSettings(project, inclusions, new LinkedList<>(), null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -385,11 +385,11 @@ public void testClientJarInclusionsWithSubPackage() throws Exception {
*/
public void testClientJarExclusionsWithEmptyPackage() throws Exception {

final LinkedList<String> exclusions = new LinkedList<String>();
final LinkedList<String> exclusions = new LinkedList<>();
exclusions.add("org/sample/ejb/**");

final MavenProjectResourcesStub project = createTestProject("client-excludes-emptypackage");
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<String>(), exclusions, null);
final EjbMojo mojo = lookupMojoWithSettings(project, new LinkedList<>(), exclusions, null);

// put this on the target output dir
project.addFile("META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE);
Expand Down Expand Up @@ -562,7 +562,7 @@ protected EjbMojo lookupMojoWithSettings(
}

protected EjbMojo lookupMojoWithDefaultSettings(final MavenProject project) throws Exception {
return lookupMojoWithSettings(project, new LinkedList<String>(), new LinkedList<String>(), null);
return lookupMojoWithSettings(project, new LinkedList<>(), new LinkedList<>(), null);
}

protected void assertJarCreation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public MavenProjectBuildStub(String key) throws Exception {
super(key);

this.build = new Build();
this.resourcesFileList = new ArrayList<String>();
this.sourceFileList = new ArrayList<String>();
this.rootFileList = new ArrayList<String>();
this.directoryList = new ArrayList<String>();
this.targetClassesList = new ArrayList<String>();
this.dataMap = new HashMap<String, String>();
this.resourcesFileList = new ArrayList<>();
this.sourceFileList = new ArrayList<>();
this.rootFileList = new ArrayList<>();
this.directoryList = new ArrayList<>();
this.targetClassesList = new ArrayList<>();
this.dataMap = new HashMap<>();
setupBuild();

model.setBuild(build);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ public Properties getProperties() {
}

public List<Profile> getProfiles() {
return new LinkedList<Profile>();
return new LinkedList<>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class JarContentChecker {
private Map<File, Boolean> directoryMap;

public JarContentChecker() {
fileMap = new HashMap<File, Boolean>();
directoryMap = new HashMap<File, Boolean>();
fileMap = new HashMap<>();
directoryMap = new HashMap<>();
}

public void addDirectory(File dir) {
Expand Down

0 comments on commit b3486cd

Please sign in to comment.