diff options
author | Jonathan Nieder <jrn@google.com> | 2014-04-11 14:01:56 -0700 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2014-04-11 14:01:56 -0700 |
commit | 0a14909bcfd2cc7b6bbfa172a15d305d38ab85f2 (patch) | |
tree | f91b35017beee03443b12f09a0151b099d08a24a /org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java | |
parent | ffb0f05d02d0afe25ae1ebd4a0166ee4909e4d59 (diff) | |
download | jgit-0a14909bcfd2cc7b6bbfa172a15d305d38ab85f2.tar.gz jgit-0a14909bcfd2cc7b6bbfa172a15d305d38ab85f2.zip |
Make ArchiveFormats final and implement equals()
This should make it easier to modify ArchiveCommand to allow an
archive format to be registered twice while still noticing if
different callers try to register different implementations for
the same format.
Change-Id: I32261bc8dc1877a853b49e0da0a6e78921791812
Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java')
-rw-r--r-- | org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java b/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java index a2bfbeeb16..e58c7e910b 100644 --- a/org.eclipse.jgit.archive/src/org/eclipse/jgit/archive/ZipFormat.java +++ b/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. */ -public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> { +public final class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> { private static final List<String> SUFFIXES = Collections .unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$ @@ -105,4 +105,14 @@ public class ZipFormat implements ArchiveCommand.Format<ArchiveOutputStream> { public Iterable<String> suffixes() { return SUFFIXES; } + + @Override + public boolean equals(Object other) { + return (other instanceof ZipFormat); + } + + @Override + public int hashCode() { + return getClass().hashCode(); + } } |