Skip to content

[MNG-6847] Use diamond operator #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class DefaultDownloadManager implements DownloadManager {

private WagonManager wagonManager;

private Map<String, File> cache = new HashMap<String, File>();
private Map<String, File> cache = new HashMap<>();

/**
* Create an instance of the {@code DefaultDownloadManager}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public final class Locator {
*/
public Locator(List<LocatorStrategy> strategies, MessageHolder messageHolder) {
this.messageHolder = messageHolder;
this.strategies = new ArrayList<LocatorStrategy>(strategies);
this.strategies = new ArrayList<>(strategies);
}

/**
* Create instance.
*/
public Locator() {
this.messageHolder = new DefaultMessageHolder();
this.strategies = new ArrayList<LocatorStrategy>();
this.strategies = new ArrayList<>();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class DefaultMessageHolder implements MessageHolder {

private List<Message> messages = new ArrayList<Message>();
private List<Message> messages = new ArrayList<>();

private Message currentMessage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class MessageLevels {
private static final List<String> LEVEL_NAMES;

static {
List<String> names = new ArrayList<String>();
List<String> names = new ArrayList<>();
names.add("DEBUG");
names.add("INFO");
names.add("WARN");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @version $Id$
*/
public abstract class AbstractResourceInclusionScanner implements ResourceInclusionScanner {
private final List<SourceMapping> sourceMappings = new ArrayList<SourceMapping>();
private final List<SourceMapping> sourceMappings = new ArrayList<>();

/** {@inheritDoc} */
public final void addSourceMapping(SourceMapping sourceMapping) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Set<File> getIncludedSources(File sourceDir, File targetDir) throws Inclu

String[] potentialIncludes = scanForSources(sourceDir, sourceIncludes, sourceExcludes);

Set<File> matchingSources = new HashSet<File>();
Set<File> matchingSources = new HashSet<>();

for (int i = 0; i < potentialIncludes.length; i++) {
String path = potentialIncludes[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public SuffixMapping(String sourceSuffix, Set<String> targetSuffixes) {

/** {@inheritDoc} */
public Set<File> getTargetFiles(File targetDir, String source) {
Set<File> targetFiles = new HashSet<File>();
Set<File> targetFiles = new HashSet<>();

if (source.endsWith(sourceSuffix)) {
String base = source.substring(0, source.length() - sourceSuffix.length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void testShouldRemovePreviouslyAddedStrategy() {
}

public void testResolutionFallsThroughStrategyStackAndReturnsNullIfNotResolved() {
List<LocatorStrategy> strategies = new ArrayList<LocatorStrategy>();
List<LocatorStrategy> strategies = new ArrayList<>();

strategies.add(new LoggingLocatorStrategy());
strategies.add(new LoggingLocatorStrategy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void testShouldReturnOneClassFileAndOneXmlFileForSingleJavaFile() throws

File basedir = new File(".");

Set<String> targets = new HashSet<String>();
Set<String> targets = new HashSet<>();
targets.add(".class");
targets.add(".xml");

Expand All @@ -90,7 +90,7 @@ public void testShouldReturnNoTargetFilesWhenSourceFileHasWrongSuffix() throws I

File basedir = new File(".");

Set<String> targets = new HashSet<String>();
Set<String> targets = new HashSet<>();
targets.add(".class");
targets.add(".xml");

Expand Down