Skip to content
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

cleanup some warnings and use java8 #172

Merged
merged 3 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest,windows-latest, macOS-latest]
java: [8, 11, 14, 15-ea]
java: [8, 11, 14, 15, 16, 17-ea]
jdk: [adopt, zulu]
fail-fast: false

runs-on: ${{ matrix.os }}
Expand All @@ -44,8 +45,9 @@ jobs:
maven-${{ matrix.os }}-

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: ${{ matrix.jdk }}
java-version: ${{ matrix.java }}

- name: Build with Maven
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/codehaus/plexus/archiver/AbstractArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public abstract class AbstractArchiver
* of {@link ArchiveEntry} by {@link #getResources()}.
* </ul>
*/
private final List<Object> resources = new ArrayList<Object>();
private final List<Object> resources = new ArrayList<>();

private boolean includeEmptyDirs = true;

Expand All @@ -98,7 +98,7 @@ public abstract class AbstractArchiver
// On lunix-like systems, we replace windows backslashes with forward slashes
private final boolean replacePathSlashesToJavaPaths = File.separatorChar == '/';

private final List<Closeable> closeables = new ArrayList<Closeable>();
private final List<Closeable> closeables = new ArrayList<>();

/**
* since 2.2 is on by default
Expand All @@ -113,27 +113,27 @@ public abstract class AbstractArchiver
private Date lastModifiedDate;

/**
* @sine 4.2.0
* @since 4.2.0
*/
private Comparator<String> filenameComparator;

/**
* @sine 4.2.0
* @since 4.2.0
*/
private int overrideUid = -1;

/**
* @sine 4.2.0
* @since 4.2.0
*/
private String overrideUserName;

/**
* @sine 4.2.0
* @since 4.2.0
*/
private int overrideGid = -1;

/**
* @sine 4.2.0
* @since 4.2.0
*/
private String overrideGroupName;

Expand Down Expand Up @@ -695,7 +695,7 @@ public Map<String, ArchiveEntry> getFiles()
{
try
{
final Map<String, ArchiveEntry> map = new HashMap<String, ArchiveEntry>();
final Map<String, ArchiveEntry> map = new HashMap<>();
for ( final ResourceIterator iter = getResources(); iter.hasNext(); )
{
final ArchiveEntry entry = iter.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -57,7 +55,7 @@ public abstract class AbstractUnArchiver

private FileMapper[] fileMappers;

private List finalizers;
private List<ArchiveFinalizer> finalizers;

private FileSelector[] fileSelectors;

Expand Down Expand Up @@ -166,14 +164,14 @@ public void addArchiveFinalizer( final ArchiveFinalizer finalizer )
{
if ( finalizers == null )
{
finalizers = new ArrayList();
finalizers = new ArrayList<>();
}

finalizers.add( finalizer );
}

@Override
public void setArchiveFinalizers( final List archiveFinalizers )
public void setArchiveFinalizers( final List<ArchiveFinalizer> archiveFinalizers )
{
finalizers = archiveFinalizers;
}
Expand All @@ -183,10 +181,8 @@ private void runArchiveFinalizers()
{
if ( finalizers != null )
{
for ( Object finalizer1 : finalizers )
for ( ArchiveFinalizer finalizer : finalizers )
{
final ArchiveFinalizer finalizer = (ArchiveFinalizer) finalizer1;

finalizer.finalizeArchiveExtraction( this );
}
}
Expand Down