Skip to content

Upgrade parent POM to version 44 and fix the checkstyle violations #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.extensions</groupId>
<artifactId>maven-extensions</artifactId>
<version>41</version>
<version>44</version>
<relativePath />
</parent>

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/apache/maven/buildcache/hash/HashFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
* HashFactory
*/
public enum HashFactory {
SHA1(new SHA("SHA-1")),
SHA256(new SHA("SHA-256")),
SHA384(new SHA("SHA-384")),
SHA512(new SHA("SHA-512")),
XX(new Zah("XX", LongHashFunction.xx(), Zah.MemoryPolicy.Standard)),
XXMM(new Zah("XXMM", LongHashFunction.xx(), Zah.MemoryPolicy.MemoryMappedBuffers)),
METRO(new Zah("METRO", LongHashFunction.metro(), Zah.MemoryPolicy.Standard)),
METRO_MM(new Zah("METRO+MM", LongHashFunction.metro(), Zah.MemoryPolicy.MemoryMappedBuffers));
sha1(new SHA("SHA-1")),
sha256(new SHA("SHA-256")),
sha384(new SHA("SHA-384")),
sha512(new SHA("SHA-512")),
xx(new Zah("XX", LongHashFunction.xx(), Zah.MemoryPolicy.Standard)),
xxmm(new Zah("XXMM", LongHashFunction.xx(), Zah.MemoryPolicy.MemoryMappedBuffers)),
metro(new Zah("METRO", LongHashFunction.metro(), Zah.MemoryPolicy.Standard)),
metroMm(new Zah("METRO+MM", LongHashFunction.metro(), Zah.MemoryPolicy.MemoryMappedBuffers));

private static final Map<String, HashFactory> LOOKUP = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void name() throws Exception {
final org.apache.maven.artifact.Artifact attachedArtifact =
new DefaultArtifact("ag", "aa", "av", "as", "at", "ac", new DefaultArtifactHandler());
buildInfo.setAttachedArtifacts(Build.createAttachedArtifacts(
Collections.singletonList(attachedArtifact), HashFactory.XX.createAlgorithm()));
Collections.singletonList(attachedArtifact), HashFactory.xx.createAlgorithm()));
buildInfo.setProjectsInputInfo(main);
buildInfo.setExecutions(createExecutions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,20 @@ private ExclusionResolver createExclusionResolver(
* - other-file.json
*/
private class FsTree {
public Path txtFileRootFolder;
public Path javaFileRootFolder;
public Path jsonFileRootFolder;
public Path folder1;
public Path txtFileFolder1;
public Path javaFileFolder1;
public Path jsonFileFolder1;
public Path subFolder1;
public Path txtFileSubFolder1;
public Path javaFileSubFolder1;
public Path jsonFileSubFolder1;
public Path folder2;
public Path txtFileFolder2;
public Path javaFileFolder2;
public Path jsonFileFolder2;
private Path txtFileRootFolder;
private Path javaFileRootFolder;
private Path jsonFileRootFolder;
private Path folder1;
private Path txtFileFolder1;
private Path javaFileFolder1;
private Path jsonFileFolder1;
private Path subFolder1;
private Path txtFileSubFolder1;
private Path javaFileSubFolder1;
private Path jsonFileSubFolder1;
private Path folder2;
private Path txtFileFolder2;
private Path javaFileFolder2;
private Path jsonFileFolder2;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.apache.maven.buildcache.hash.HashChecksum;
import org.junit.jupiter.api.Test;

import static org.apache.maven.buildcache.hash.HashFactory.SHA256;
import static org.apache.maven.buildcache.hash.HashFactory.sha256;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class SHAHashTest {
Expand All @@ -56,8 +56,8 @@ public class SHAHashTest {
private static final String WORLD_CHECKSUM = "63e5c163c81ee9a3ed99d365ff963ecea340cc455deeac7c4b63ac75b9cf4706";
private static final String FULL_CHECKSUM = "7305db9b2abccd706c256db3d97e5ff48d677cfe4d3a5904afb7da0e3950e1e2";

private static final HashAlgorithm ALGORITHM = SHA256.createAlgorithm();
private static final HashChecksum CHECKSUM = SHA256.createChecksum(0);
private static final HashAlgorithm ALGORITHM = sha256.createAlgorithm();
private static final HashChecksum CHECKSUM = sha256.createChecksum(0);

@Test
public void testEmptyArray() {
Expand Down
26 changes: 13 additions & 13 deletions src/test/java/org/apache/maven/buildcache/checksum/XXHashTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
import org.apache.maven.buildcache.hash.HashChecksum;
import org.junit.jupiter.api.Test;

import static org.apache.maven.buildcache.hash.HashFactory.XX;
import static org.apache.maven.buildcache.hash.HashFactory.XXMM;
import static org.apache.maven.buildcache.hash.HashFactory.xx;
import static org.apache.maven.buildcache.hash.HashFactory.xxmm;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class XXHashTest {
Expand All @@ -60,7 +60,7 @@ public class XXHashTest {
private static final String WORLD_CHECKSUM = "cb21505d7a714523";
private static final String FULL_CHECKSUM = "b8ca8fa824d335e9";

private static final HashAlgorithm ALGORITHM = XX.createAlgorithm();
private static final HashAlgorithm ALGORITHM = xx.createAlgorithm();

@Test
public void testEmptyArray() {
Expand Down Expand Up @@ -92,32 +92,32 @@ public void testSimpleChecksum() {

@Test
public void testEmptyBuffer() {
assertEmptyBuffer(XX.createChecksum(0));
assertEmptyBuffer(XXMM.createChecksum(0));
assertEmptyBuffer(xx.createChecksum(0));
assertEmptyBuffer(xxmm.createChecksum(0));
}

@Test
public void testSingleHash() {
assertSingleHash(XX.createChecksum(1));
assertSingleHash(XXMM.createChecksum(1));
assertSingleHash(xx.createChecksum(1));
assertSingleHash(xxmm.createChecksum(1));
}

@Test
public void testSingleChecksum() {
assertSingleChecksum(XX.createChecksum(1));
assertSingleChecksum(XXMM.createChecksum(1));
assertSingleChecksum(xx.createChecksum(1));
assertSingleChecksum(xxmm.createChecksum(1));
}

@Test
public void testNotFullChecksum() {
assertSingleChecksum(XX.createChecksum(2));
assertSingleChecksum(XXMM.createChecksum(2));
assertSingleChecksum(xx.createChecksum(2));
assertSingleChecksum(xxmm.createChecksum(2));
}

@Test
public void testFullChecksum() {
assertFullChecksum(XX.createChecksum(2));
assertFullChecksum(XXMM.createChecksum(2));
assertFullChecksum(xx.createChecksum(2));
assertFullChecksum(xxmm.createChecksum(2));
}

private void assertEmptyBuffer(HashChecksum checksum) {
Expand Down
24 changes: 12 additions & 12 deletions src/test/java/org/apache/maven/buildcache/hash/PerfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,33 @@ String doTest(HashFactory hashFactory, HashState state) throws IOException {
}

@Benchmark
public String SHA1(HashState state) throws IOException {
return doTest(HashFactory.SHA1, state);
public String sha1(HashState state) throws IOException {
return doTest(HashFactory.sha1, state);
}

@Benchmark
public String SHA256(HashState state) throws IOException {
return doTest(HashFactory.SHA256, state);
public String sha256(HashState state) throws IOException {
return doTest(HashFactory.sha256, state);
}

@Benchmark
public String XX(HashState state) throws IOException {
return doTest(HashFactory.XX, state);
public String xx(HashState state) throws IOException {
return doTest(HashFactory.xx, state);
}

@Benchmark
public String XXMM(HashState state) throws IOException {
return doTest(HashFactory.XXMM, state);
public String xxmm(HashState state) throws IOException {
return doTest(HashFactory.xxmm, state);
}

@Benchmark
public String METRO(HashState state) throws IOException {
return doTest(HashFactory.METRO, state);
public String metro(HashState state) throws IOException {
return doTest(HashFactory.metro, state);
}

@Benchmark
public String METRO_MM(HashState state) throws IOException {
return doTest(HashFactory.METRO_MM, state);
public String metroMm(HashState state) throws IOException {
return doTest(HashFactory.metroMm, state);
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void simple(Verifier verifier) throws VerificationException {
}

@Test
void simple_build_change_version_reuse_build_cache(Verifier verifier) throws VerificationException {
void simpleBuildChangeVersionReuseBuildCache(Verifier verifier) throws VerificationException {
verifier.setAutoclean(false);

verifier.setLogFileName("../log-1.txt");
Expand Down
Loading