Skip to content

Commit

Permalink
[MNG-7416] Simplify Boolean expressions and returns (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne authored Sep 26, 2023
1 parent 247bff7 commit b7138b0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,7 @@ public boolean equals(Object o) {
if (!Objects.equals(defaultValue, that.defaultValue)) {
return false;
}
if (!Objects.equals(property, that.property)) {
return false;
}

return true;
return Objects.equals(property, that.property);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public List<MojoFieldVisitor> findFieldWithAnnotation(Class<?> annotation) {
}

public List<MojoFieldVisitor> findFieldWithAnnotation(Set<String> annotationClassNames) {
List<MojoFieldVisitor> mojoFieldVisitors = new ArrayList<MojoFieldVisitor>();
List<MojoFieldVisitor> mojoFieldVisitors = new ArrayList<>();

for (MojoFieldVisitor mojoFieldVisitor : this.fieldVisitors) {
Map<String, MojoAnnotationVisitor> filedVisitorMap = mojoFieldVisitor.getAnnotationVisitorMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ private Map<String, JavaField> extractFieldParameterTags(JavaClass javaClass) {
if (superClass != null) {
rawParams = extractFieldParameterTags(superClass);
} else {
rawParams = new TreeMap<String, JavaField>();
rawParams = new TreeMap<>();
}

for (JavaField field : javaClass.getFields()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.maven.tools.plugin.generator.Generator;
import org.apache.maven.tools.plugin.generator.PluginDescriptorFilesGenerator;
import org.apache.maven.tools.plugin.util.PluginUtils;
import org.codehaus.plexus.component.repository.ComponentDependency;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.logging.console.ConsoleLogger;
import org.codehaus.plexus.util.FileUtils;
Expand Down Expand Up @@ -87,7 +86,7 @@ private PluginToolsRequest createRequest(String directory) {

PluginDescriptor pluginDescriptor = new PluginDescriptor();
pluginDescriptor.setGoalPrefix("test");
pluginDescriptor.setDependencies(new ArrayList<ComponentDependency>());
pluginDescriptor.setDependencies(new ArrayList<>());

return new DefaultPluginToolsRequest(project, pluginDescriptor).setEncoding("UTF-8");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AntPropertyHelper extends PropertyHelper {
private Log log;
private ExpressionEvaluator exprEvaluator;
private MavenProject mavenProject;
private Map<String, String> artifactMap = new HashMap<String, String>();
private Map<String, String> artifactMap = new HashMap<>();

/**
* @deprecated use the other constructor
Expand Down

0 comments on commit b7138b0

Please sign in to comment.