Skip to content

Commit

Permalink
Cleanup diamond <> operator
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobaccan authored and slawekjaranowski committed Aug 8, 2022
1 parent cb92e97 commit 8c8dce6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/codehaus/mojo/flatten/Dependencies.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Dependencies()
{

super();
this.key2DependencyMap = new HashMap<String, Dependency>();
this.key2DependencyMap = new HashMap<>();
}

/**
Expand Down Expand Up @@ -117,7 +117,7 @@ public Dependency resolve( Dependency dependency )
public List<Dependency> toList()
{

List<Dependency> result = new ArrayList<Dependency>( this.key2DependencyMap.values() );
List<Dependency> result = new ArrayList<>( this.key2DependencyMap.values() );
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class FlattenDescriptor
public FlattenDescriptor()
{
super();
this.name2handlingMap = new HashMap<String, ElementHandling>();
this.name2handlingMap = new HashMap<>();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/codehaus/mojo/flatten/FlattenMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ protected static List<Repository> createFlattenedRepositories( List<Repository>
{
if ( repositories != null )
{
List<Repository> flattenedRepositories = new ArrayList<Repository>( repositories.size() );
List<Repository> flattenedRepositories = new ArrayList<>( repositories.size() );
for ( Repository repo : repositories )
{
// filter inherited repository section from super POM (see MOJO-2042)...
Expand Down Expand Up @@ -906,7 +906,7 @@ public void injectProfile( Model model, Profile profile, ModelBuildingRequest re
public List<Profile> getActiveProfiles( Collection<Profile> profiles, ProfileActivationContext context,
ModelProblemCollector problems )
{
List<Profile> activeProfiles = new ArrayList<Profile>( profiles.size() );
List<Profile> activeProfiles = new ArrayList<>( profiles.size() );

for ( Profile profile : profiles )
{
Expand Down Expand Up @@ -996,7 +996,7 @@ protected static boolean isBuildTimeDriven( Activation activation )
*/
protected List<Dependency> createFlattenedDependencies( Model effectiveModel )
throws MojoExecutionException {
List<Dependency> flattenedDependencies = new ArrayList<Dependency>();
List<Dependency> flattenedDependencies = new ArrayList<>();
// resolve all direct and inherited dependencies...
try {
createFlattenedDependencies( effectiveModel, flattenedDependencies );
Expand Down Expand Up @@ -1078,7 +1078,7 @@ private void createFlattenedDependenciesDirect( List<Dependency> projectDependen
private void createFlattenedDependenciesAll( List<Dependency> projectDependencies, List<Dependency> flattenedDependencies )
throws DependencyTreeBuilderException, ArtifactDescriptorException
{
final Queue<DependencyNode> dependencyNodeLinkedList = new LinkedList<DependencyNode>();
final Queue<DependencyNode> dependencyNodeLinkedList = new LinkedList<>();
final Set<String> processedDependencies = new HashSet<>();

final Artifact projectArtifact = this.project.getArtifact();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public class CiInterpolatorImpl implements Interpolator {

private Map existingAnswers = new HashMap();

private List<ValueSource> valueSources = new ArrayList<ValueSource>();
private List<ValueSource> valueSources = new ArrayList<>();

private List<InterpolationPostProcessor> postProcessors = new ArrayList<InterpolationPostProcessor>();
private List<InterpolationPostProcessor> postProcessors = new ArrayList<>();

private boolean cacheAnswers = false;

Expand Down Expand Up @@ -131,7 +131,7 @@ public String interpolate( String input, RecursionInterceptor recursionIntercept
{
try
{
return interpolate( input, recursionInterceptor, new HashSet<String>() );
return interpolate( input, recursionInterceptor, new HashSet<>() );
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public CiModelInterpolator()
private static final Collection<String> TRANSLATED_PATH_EXPRESSIONS;

static {
Collection<String> translatedPrefixes = new HashSet<String>();
Collection<String> translatedPrefixes = new HashSet<>();

// MNG-1927, MNG-2124, MNG-3355:
// If the build section is present and the project directory is
Expand Down Expand Up @@ -107,7 +107,7 @@ public CiModelInterpolator()
@Requirement
private UrlNormalizer urlNormalizer;

private static final Map<Class<?>, InterpolateObjectAction.CacheItem> CACHED_ENTRIES = new ConcurrentHashMap<Class<?>, InterpolateObjectAction.CacheItem>(
private static final Map<Class<?>, InterpolateObjectAction.CacheItem> CACHED_ENTRIES = new ConcurrentHashMap<>(
80, 0.75f, 2);
// Empirical data from 3.x, actual =40

Expand Down Expand Up @@ -198,7 +198,7 @@ public InterpolateObjectAction(Object target, List<? extends ValueSource> valueS
this.valueSources = valueSources;
this.postProcessors = postProcessors;

this.interpolationTargets = new LinkedList<Object>();
this.interpolationTargets = new LinkedList<>();
interpolationTargets.add(target);

this.modelInterpolator = modelInterpolator;
Expand Down Expand Up @@ -289,7 +289,7 @@ private boolean isQualifiedForInterpolation(Field field, Class<?> fieldType) {
CacheItem(Class clazz) {
this.isQualifiedForInterpolation = isQualifiedForInterpolation(clazz);
this.isArray = clazz.isArray();
List<CacheField> fields = new ArrayList<CacheField>();
List<CacheField> fields = new ArrayList<>();
for (Field currentField : clazz.getDeclaredFields()) {
Class<?> type = currentField.getType();
if (isQualifiedForInterpolation(currentField, type)) {
Expand Down Expand Up @@ -499,7 +499,7 @@ protected List<ValueSource> createValueSources(final Model model, final File pro
}

// NOTE: Order counts here!
List<ValueSource> valueSources = new ArrayList<ValueSource>(9);
List<ValueSource> valueSources = new ArrayList<>(9);

if (projectDir != null) {
ValueSource basedirValueSource = new PrefixedValueSourceWrapper(new AbstractValueSource(false) {
Expand Down Expand Up @@ -545,7 +545,7 @@ public Object getValue(String expression) {

protected List<? extends InterpolationPostProcessor> createPostProcessors(final Model model, final File projectDir,
final ModelBuildingRequest config) {
List<InterpolationPostProcessor> processors = new ArrayList<InterpolationPostProcessor>(2);
List<InterpolationPostProcessor> processors = new ArrayList<>(2);
if (projectDir != null) {
processors.add(new PathTranslatingPostProcessor(PROJECT_PREFIXES, TRANSLATED_PATH_EXPRESSIONS, projectDir,
pathTranslator));
Expand Down Expand Up @@ -664,7 +664,7 @@ public UrlNormalizingPostProcessor(UrlNormalizer normalizer) {
}

public Object execute(String expression, Object value) {
Set<String> expressions = new HashSet<String>();
Set<String> expressions = new HashSet<>();
expressions.add("project.url");
expressions.add("project.scm.url");
expressions.add("project.scm.connection");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class ReactorModelPool
{

private Map<Coordinates, File> models = new HashMap<Coordinates, File>();
private Map<Coordinates, File> models = new HashMap<>();

public File find( String groupId, String artifactId, String version )
{
Expand Down

0 comments on commit 8c8dce6

Please sign in to comment.