diff --git a/maven-compat/src/main/java/org/apache/maven/project/ModelUtils.java b/maven-compat/src/main/java/org/apache/maven/project/ModelUtils.java index 92b5eb9df4..1af061d36b 100644 --- a/maven-compat/src/main/java/org/apache/maven/project/ModelUtils.java +++ b/maven-compat/src/main/java/org/apache/maven/project/ModelUtils.java @@ -98,7 +98,7 @@ public final class ModelUtils if ( !handleAsInheritance || ( parentInherited == null ) || Boolean.valueOf( parentInherited ) ) { - Plugin childPlugin = (Plugin) childPlugins.get( parentPlugin.getKey() ); + Plugin childPlugin = childPlugins.get( parentPlugin.getKey() ); if ( ( childPlugin != null ) && !assembledPlugins.contains( childPlugin ) ) { diff --git a/maven-compat/src/test/java/org/apache/maven/project/ModelUtilsTest.java b/maven-compat/src/test/java/org/apache/maven/project/ModelUtilsTest.java index 9c0cbd18c5..6c3df9a0a8 100644 --- a/maven-compat/src/test/java/org/apache/maven/project/ModelUtilsTest.java +++ b/maven-compat/src/test/java/org/apache/maven/project/ModelUtilsTest.java @@ -432,7 +432,7 @@ public class ModelUtilsTest // this block prevents MNG-1703 assertEquals( 1, child.getDependencies().size() ); - Dependency dep2 = (Dependency) child.getDependencies().get( 0 ); + Dependency dep2 = child.getDependencies().get( 0 ); assertEquals( dep.getManagementKey(), dep2.getManagementKey() ); } diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java b/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java index eafbc7475a..d0ffa71a2a 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectSorter.java @@ -104,7 +104,7 @@ public class ProjectSorter vertices.put( project.getVersion(), dag.addVertex( projectId ) ); } - for ( Vertex projectVertex : (List) dag.getVerticies() ) + for ( Vertex projectVertex : dag.getVerticies() ) { String projectId = projectVertex.getLabel(); diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 04c02a32f3..37a5884c40 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -464,7 +464,7 @@ public class MavenCli ClassRealm coreRealm = cliRequest.classWorld.getClassRealm( "plexus.core" ); if ( coreRealm == null ) { - coreRealm = (ClassRealm) cliRequest.classWorld.getRealms().iterator().next(); + coreRealm = cliRequest.classWorld.getRealms().iterator().next(); } ClassRealm extRealm = cliRequest.classWorld.newRealm( "maven.ext", null );