mirror of https://github.com/apache/maven.git
[MNG-6847] Use diamond operator (#1264)
Co-authored-by: Moderne <team@moderne.io>
This commit is contained in:
parent
7f86d1d996
commit
889ceb42a4
|
@ -176,7 +176,7 @@ class ArtifactResolverTest extends AbstractArtifactComponentTestCase {
|
||||||
public void testReadRepoFromModel() throws Exception {
|
public void testReadRepoFromModel() throws Exception {
|
||||||
Artifact m = createArtifact(TestMavenWorkspaceReader.ARTIFACT_ID, TestMavenWorkspaceReader.VERSION);
|
Artifact m = createArtifact(TestMavenWorkspaceReader.ARTIFACT_ID, TestMavenWorkspaceReader.VERSION);
|
||||||
ArtifactMetadataSource source = getContainer().lookup(ArtifactMetadataSource.class, "maven");
|
ArtifactMetadataSource source = getContainer().lookup(ArtifactMetadataSource.class, "maven");
|
||||||
ResolutionGroup group = source.retrieve(m, localRepository(), new ArrayList<ArtifactRepository>());
|
ResolutionGroup group = source.retrieve(m, localRepository(), new ArrayList<>());
|
||||||
List<ArtifactRepository> repositories = group.getResolutionRepositories();
|
List<ArtifactRepository> repositories = group.getResolutionRepositories();
|
||||||
assertEquals(1, repositories.size(), "There should be one repository!");
|
assertEquals(1, repositories.size(), "There should be one repository!");
|
||||||
ArtifactRepository repository = repositories.get(0);
|
ArtifactRepository repository = repositories.get(0);
|
||||||
|
|
|
@ -240,7 +240,7 @@ public final class PlexusXmlBeanConverter implements PlexusBeanConverter {
|
||||||
final Object bean = newImplementation(clazz);
|
final Object bean = newImplementation(clazz);
|
||||||
|
|
||||||
// build map of all known bean properties belonging to the chosen implementation
|
// build map of all known bean properties belonging to the chosen implementation
|
||||||
final Map<String, BeanProperty<Object>> propertyMap = new HashMap<String, BeanProperty<Object>>();
|
final Map<String, BeanProperty<Object>> propertyMap = new HashMap<>();
|
||||||
for (final BeanProperty<Object> property : new BeanProperties(clazz)) {
|
for (final BeanProperty<Object> property : new BeanProperties(clazz)) {
|
||||||
final String name = property.getName();
|
final String name = property.getName();
|
||||||
if (!propertyMap.containsKey(name)) {
|
if (!propertyMap.containsKey(name)) {
|
||||||
|
|
|
@ -192,7 +192,7 @@ public final class InputLocation implements java.io.Serializable, Cloneable, Inp
|
||||||
public void setOtherLocation(Object key, InputLocation location) {
|
public void setOtherLocation(Object key, InputLocation location) {
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
if (this.locations == null) {
|
if (this.locations == null) {
|
||||||
this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
|
this.locations = new java.util.LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
this.locations.put(key, location);
|
this.locations.put(key, location);
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ public final class InputLocation implements java.io.Serializable, Cloneable, Inp
|
||||||
} else if (targetLocations == null) {
|
} else if (targetLocations == null) {
|
||||||
locations = sourceLocations;
|
locations = sourceLocations;
|
||||||
} else {
|
} else {
|
||||||
locations = new java.util.LinkedHashMap<Object, InputLocation>();
|
locations = new java.util.LinkedHashMap<>();
|
||||||
for (java.util.Iterator<Integer> it = indices.iterator(); it.hasNext(); ) {
|
for (java.util.Iterator<Integer> it = indices.iterator(); it.hasNext(); ) {
|
||||||
InputLocation location;
|
InputLocation location;
|
||||||
Integer index = it.next();
|
Integer index = it.next();
|
||||||
|
|
Loading…
Reference in New Issue