Skip to content

Commit

Permalink
[MNG-8179] Upgrade Parent to 43
Browse files Browse the repository at this point in the history
  • Loading branch information
slawekjaranowski committed Jul 11, 2024
1 parent 5223ff6 commit e7e0cbb
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ private int ordinalOfCksumPolicy(String policy) {
}
}

@SuppressWarnings("checkstyle:magicnumber")
private int ordinalOfUpdatePolicy(String policy) {
if (ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY.equals(policy)) {
return 1440;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import org.apache.maven.building.Problem.Severity;
import org.junit.Test;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class DefaultProblemCollectorTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@
import org.apache.maven.plugin.version.PluginVersionResolutionException;
import org.apache.maven.project.MavenProject;

import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.*;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.A;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.B;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.C;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.X;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.Y;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.Z;
import static org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub.getProjectBuildList;

/**
* @author Kristian Rosenvold
Expand All @@ -57,7 +63,7 @@ public void testConcurrencyGraphPrimaryVersion()

final List<MavenProject> subsequent = graph.markAsFinished(A);
assertEquals(2, subsequent.size());
assertEquals(ProjectDependencyGraphStub.B, subsequent.get(0));
assertEquals(B, subsequent.get(0));
assertEquals(C, subsequent.get(1));

final List<MavenProject> bDescendants = graph.markAsFinished(B);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,21 @@
import org.apache.maven.lifecycle.DefaultLifecycles;
import org.apache.maven.lifecycle.Lifecycle;

import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.*;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.CLEAN;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.COMPILE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.INITIALIZE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.INSTALL;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PACKAGE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.POST_CLEAN;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.POST_SITE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PRE_CLEAN;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PRE_SITE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PROCESS_RESOURCES;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PROCESS_TEST_RESOURCES;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.SITE;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.SITE_DEPLOY;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.TEST;
import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.VALIDATE;

/**
* @author Kristian Rosenvold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* @author jdcasey
*/
public final class CLIReportingUtils {
// CHECKSTYLE_OFF: MagicNumber
public static final long MB = 1024 * 1024;

private static final long ONE_SECOND = 1000L;
Expand All @@ -47,7 +46,6 @@ public final class CLIReportingUtils {
private static final long ONE_HOUR = 60 * ONE_MINUTE;

private static final long ONE_DAY = 24 * ONE_HOUR;
// CHECKSTYLE_ON: MagicNumber

public static final String BUILD_VERSION_PROPERTY = "version";

Expand Down Expand Up @@ -159,13 +157,11 @@ public static String formatTimestamp(long timestamp) {
}

public static String formatDuration(long duration) {
// CHECKSTYLE_OFF: MagicNumber
long ms = duration % 1000;
long s = (duration / ONE_SECOND) % 60;
long m = (duration / ONE_MINUTE) % 60;
long h = (duration / ONE_HOUR) % 24;
long d = duration / ONE_DAY;
// CHECKSTYLE_ON: MagicNumber

String format;
if (d > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
import org.apache.maven.cli.logging.Slf4jConfigurationFactory;
import org.apache.maven.cli.logging.Slf4jLoggerManager;
import org.apache.maven.cli.logging.Slf4jStdoutLogger;
import org.apache.maven.cli.transfer.*;
import org.apache.maven.cli.transfer.ConsoleMavenTransferListener;
import org.apache.maven.cli.transfer.QuietMavenTransferListener;
import org.apache.maven.cli.transfer.SimplexTransferListener;
import org.apache.maven.cli.transfer.Slf4jMavenTransferListener;
import org.apache.maven.eventspy.internal.EventSpyDispatcher;
import org.apache.maven.exception.DefaultExceptionHandler;
import org.apache.maven.exception.ExceptionHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public String format(long size, ScaleUnit unit) {
return format(size, unit, false);
}

@SuppressWarnings("checkstyle:magicnumber")
public String format(long size, ScaleUnit unit, boolean omitSymbol) {
if (size < 0L) {
throw new IllegalArgumentException("file size cannot be negative: " + size);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
package org.apache.maven.model.interpolation;

import java.io.File;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public MetadataGenerator newInstance(RepositorySystemSession session, DeployRequ
return new PluginsMetadataGenerator(session, request);
}

@SuppressWarnings("checkstyle:magicnumber")
@Override
public float getPriority() {
return 10; // G level MD should be deployed as 3rd MD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public MetadataGenerator newInstance(RepositorySystemSession session, DeployRequ
return new RemoteSnapshotMetadataGenerator(session, request);
}

@SuppressWarnings("checkstyle:magicnumber")
@Override
public float getPriority() {
return 30; // GAV level metadata should be deployed 1st MD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public MetadataGenerator newInstance(RepositorySystemSession session, DeployRequ
return new VersionsMetadataGenerator(session, request);
}

@SuppressWarnings("checkstyle:magicnumber")
@Override
public float getPriority() {
return 20; // GA level metadata should be deployed 2nd MD
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>42</version>
<version>43</version>
<relativePath />
</parent>

Expand Down

0 comments on commit e7e0cbb

Please sign in to comment.