mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-29 01:21:52 +00:00
Clean up some warnings during the build (#750)
This commit is contained in:
@@ -652,7 +652,7 @@ public class CachingProjectBuilder implements ProjectBuilder {
|
||||
return noErrors;
|
||||
}
|
||||
|
||||
@SuppressWarnings("checkstyle:methodlength")
|
||||
@SuppressWarnings({"checkstyle:methodlength", "deprecation"})
|
||||
private void initProject(
|
||||
MavenProject project,
|
||||
Map<File, MavenProject> projects,
|
||||
|
@@ -49,10 +49,15 @@ public class DependencyGraph<K> {
|
||||
private final Map<K, Set<K>> transitiveUpstreams;
|
||||
private final Map<K, List<K>> downstreams;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static DependencyGraph<MavenProject> fromMaven(MavenSession session) {
|
||||
|
||||
final ProjectDependencyGraph graph = session.getProjectDependencyGraph();
|
||||
return fromMaven(graph);
|
||||
Map<String, Object> data = session.getRequest().getData();
|
||||
DependencyGraph<MavenProject> graph = (DependencyGraph<MavenProject>) data.get(DependencyGraph.class.getName());
|
||||
if (graph == null) {
|
||||
graph = fromMaven(session.getProjectDependencyGraph());
|
||||
data.put(DependencyGraph.class.getName(), graph);
|
||||
}
|
||||
return graph;
|
||||
}
|
||||
|
||||
static DependencyGraph<MavenProject> fromMaven(ProjectDependencyGraph graph) {
|
||||
|
@@ -99,8 +99,7 @@ public class SmartBuilder implements Builder {
|
||||
|
||||
session.getRepositorySession().getData().set(ReactorBuildStatus.class, reactorBuildStatus);
|
||||
|
||||
DependencyGraph<MavenProject> graph =
|
||||
(DependencyGraph<MavenProject>) session.getRequest().getData().get(DependencyGraph.class.getName());
|
||||
DependencyGraph<MavenProject> graph = DependencyGraph.fromMaven(session);
|
||||
|
||||
// log overall build info
|
||||
final int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
|
||||
|
@@ -53,7 +53,6 @@ public class ClientDispatcher extends BuildEventListener {
|
||||
final MavenSession session = event.getSession();
|
||||
final int degreeOfConcurrency = session.getRequest().getDegreeOfConcurrency();
|
||||
final DependencyGraph<MavenProject> dependencyGraph = DependencyGraph.fromMaven(session);
|
||||
session.getRequest().getData().put(DependencyGraph.class.getName(), dependencyGraph);
|
||||
|
||||
final int maxThreads =
|
||||
degreeOfConcurrency == 1 ? 1 : dependencyGraph.computeMaxWidth(degreeOfConcurrency, 1000);
|
||||
|
@@ -61,6 +61,7 @@ public class DaemonPrompter extends AbstractInputHandler implements Prompter, In
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String prompt(String message, List possibleValues, String defaultReply) throws PrompterException {
|
||||
return doPrompt(message, possibleValues, defaultReply, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user