Browse Source

Merge "Make ArchiveFormats final and implement equals()"

stable-3.4
Dave Borowitz 11 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
257546a08e
  1. 12
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java
  2. 12
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java
  3. 12
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java
  4. 12
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java
  5. 12
      org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java

12
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TarFormat.java

@ -61,7 +61,7 @@ import org.eclipse.jgit.lib.ObjectLoader;
/** /**
* Unix TAR format (ustar + some PAX extensions). * Unix TAR format (ustar + some PAX extensions).
*/ */
public class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> { public final class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$ .unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$
@ -118,4 +118,14 @@ public class TarFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
@Override
public boolean equals(Object other) {
return (other instanceof TarFormat);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }

12
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/Tbz2Format.java

@ -57,7 +57,7 @@ import org.eclipse.jgit.lib.ObjectLoader;
/** /**
* bzip2-compressed tarball (tar.bz2) format. * bzip2-compressed tarball (tar.bz2) format.
*/ */
public class Tbz2Format implements ArchiveCommand.Format<ArchiveOutputStream> { public final class Tbz2Format implements ArchiveCommand.Format<ArchiveOutputStream> {
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar.bz2", ".tbz", ".tbz2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ .unmodifiableList(Arrays.asList(".tar.bz2", ".tbz", ".tbz2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@ -78,4 +78,14 @@ public class Tbz2Format implements ArchiveCommand.Format<ArchiveOutputStream> {
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
@Override
public boolean equals(Object other) {
return (other instanceof Tbz2Format);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }

12
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TgzFormat.java

@ -57,7 +57,7 @@ import org.eclipse.jgit.lib.ObjectLoader;
/** /**
* gzip-compressed tarball (tar.gz) format. * gzip-compressed tarball (tar.gz) format.
*/ */
public class TgzFormat implements ArchiveCommand.Format<ArchiveOutputStream> { public final class TgzFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar.gz", ".tgz")); //$NON-NLS-1$ //$NON-NLS-2$ .unmodifiableList(Arrays.asList(".tar.gz", ".tgz")); //$NON-NLS-1$ //$NON-NLS-2$
@ -78,4 +78,14 @@ public class TgzFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
@Override
public boolean equals(Object other) {
return (other instanceof TgzFormat);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }

12
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/TxzFormat.java

@ -57,7 +57,7 @@ import org.eclipse.jgit.lib.ObjectLoader;
/** /**
* Xz-compressed tar (tar.xz) format. * Xz-compressed tar (tar.xz) format.
*/ */
public class TxzFormat implements ArchiveCommand.Format<ArchiveOutputStream> { public final class TxzFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar.xz", ".txz")); //$NON-NLS-1$ //$NON-NLS-2$ .unmodifiableList(Arrays.asList(".tar.xz", ".txz")); //$NON-NLS-1$ //$NON-NLS-2$
@ -78,4 +78,14 @@ public class TxzFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
@Override
public boolean equals(Object other) {
return (other instanceof TxzFormat);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }

12
org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java

@ -60,7 +60,7 @@ import org.eclipse.jgit.lib.ObjectLoader;
/** /**
* PKWARE's ZIP format. * PKWARE's ZIP format.
*/ */
public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> { public final class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$ .unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$
@ -105,4 +105,14 @@ public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> {
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
@Override
public boolean equals(Object other) {
return (other instanceof ZipFormat);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
} }

Loading…
Cancel
Save