From d9ac7ddf1026123fee6c4477d172d614522dfc08 Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Thu, 15 Nov 2018 21:27:20 -0800 Subject: [PATCH] Remove unnecessary modifiers from interfaces From Oracle's "Defining an interface": "All abstract, default, and static methods in an interface are implicitly public, so you can omit the public modifier." (Without any modifier, the interface methods are also abstract, so we omit also the "abstract") "In addition, an interface can contain constant declarations. All constant values defined in an interface are implicitly public, static, and final. Once again, you can omit these modifiers." This makes the code more consistent. Now all interfaces under org.eclipse.jgit follow the guidelines. Change-Id: I4fe6deb111899ec1b4318ab5a6050f3851fa1fd3 Signed-off-by: Ivan Frade --- .../jgit/api/TransportConfigCallback.java | 2 +- .../attributes/AttributesNodeProvider.java | 4 +- .../jgit/attributes/AttributesProvider.java | 2 +- .../jgit/attributes/FilterCommandFactory.java | 4 +- .../src/org/eclipse/jgit/fnmatch/Head.java | 2 +- .../jgit/lib/AsyncObjectLoaderQueue.java | 8 +-- .../jgit/lib/AsyncObjectSizeQueue.java | 8 +-- .../org/eclipse/jgit/lib/AsyncOperation.java | 4 +- .../eclipse/jgit/lib/BlobObjectChecker.java | 2 +- .../org/eclipse/jgit/lib/CheckoutEntry.java | 4 +- .../org/eclipse/jgit/lib/ProgressMonitor.java | 2 +- .../src/org/eclipse/jgit/lib/Ref.java | 18 +++--- .../src/org/eclipse/jgit/lib/ReflogEntry.java | 16 ++--- .../org/eclipse/jgit/lib/ReflogReader.java | 10 ++- .../jgit/revwalk/AsyncRevObjectQueue.java | 2 +- .../org/eclipse/jgit/revwalk/DepthWalk.java | 12 ++-- .../jgit/transport/AdvertiseRefsHook.java | 6 +- .../eclipse/jgit/transport/Connection.java | 12 ++-- .../jgit/transport/FetchConnection.java | 12 ++-- .../jgit/transport/NonceGenerator.java | 4 +- .../jgit/transport/PostReceiveHook.java | 4 +- .../jgit/transport/PostUploadHook.java | 4 +- .../jgit/transport/PreReceiveHook.java | 4 +- .../eclipse/jgit/transport/PreUploadHook.java | 8 +-- .../jgit/transport/PushConnection.java | 4 +- .../org/eclipse/jgit/transport/RefFilter.java | 4 +- .../jgit/transport/TransportBundle.java | 2 +- .../jgit/transport/http/HttpConnection.java | 62 +++++++++---------- .../transport/http/HttpConnectionFactory.java | 4 +- .../resolver/ReceivePackFactory.java | 2 +- .../resolver/RepositoryResolver.java | 2 +- .../transport/resolver/UploadPackFactory.java | 2 +- 32 files changed, 117 insertions(+), 119 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java index f60926c562..d73453c5af 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/TransportConfigCallback.java @@ -68,5 +68,5 @@ public interface TransportConfigCallback { * @param transport * a {@link org.eclipse.jgit.transport.Transport} object. */ - public void configure(Transport transport); + void configure(Transport transport); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNodeProvider.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNodeProvider.java index f1d7d7be0e..2d1cde12e0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNodeProvider.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesNodeProvider.java @@ -63,7 +63,7 @@ public interface AttributesNodeProvider { * @throws java.io.IOException * if an error is raised while parsing the attributes file */ - public AttributesNode getInfoAttributesNode() throws IOException; + AttributesNode getInfoAttributesNode() throws IOException; /** * Retrieve the {@link org.eclipse.jgit.attributes.AttributesNode} that @@ -76,6 +76,6 @@ public interface AttributesNodeProvider { * attributes file * @see CoreConfig#getAttributesFile() */ - public AttributesNode getGlobalAttributesNode() throws IOException; + AttributesNode getGlobalAttributesNode() throws IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesProvider.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesProvider.java index 1545e3523d..7b51f6dd32 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesProvider.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/AttributesProvider.java @@ -53,5 +53,5 @@ public interface AttributesProvider { * * @return the currently active attributes */ - public Attributes getAttributes(); + Attributes getAttributes(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java index 11b76b0d90..78573d2a63 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java @@ -69,7 +69,7 @@ public interface FilterCommandFactory { * thrown when the command constructor throws an * java.io.IOException */ - public FilterCommand create(Repository db, InputStream in, - OutputStream out) throws IOException; + FilterCommand create(Repository db, InputStream in, OutputStream out) + throws IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java index 49839f8e6e..e8f6844dda 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/fnmatch/Head.java @@ -54,5 +54,5 @@ interface Head { * the character which decides which heads are returned. * @return a list of heads based on the input. */ - public abstract List getNextHeads(char c); + List getNextHeads(char c); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectLoaderQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectLoaderQueue.java index b4ea0e907f..659c67c5ab 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectLoaderQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectLoaderQueue.java @@ -78,7 +78,7 @@ public interface AsyncObjectLoaderQueue extends * @throws java.io.IOException * the object store cannot be accessed. */ - public boolean next() throws MissingObjectException, IOException; + boolean next() throws MissingObjectException, IOException; /** * Get the current object, null if the implementation lost track. @@ -87,14 +87,14 @@ public interface AsyncObjectLoaderQueue extends * Implementations may for performance reasons discard the caller's * ObjectId and provider their own through {@link #getObjectId()}. */ - public T getCurrent(); + T getCurrent(); /** * Get the ObjectId of the current object. Never null. * * @return the ObjectId of the current object. Never null. */ - public ObjectId getObjectId(); + ObjectId getObjectId(); /** * Obtain a loader to read the object. @@ -115,5 +115,5 @@ public interface AsyncObjectLoaderQueue extends * @throws java.io.IOException * the object store cannot be accessed. */ - public ObjectLoader open() throws IOException; + ObjectLoader open() throws IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectSizeQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectSizeQueue.java index 03efcd295e..6b8642f119 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectSizeQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncObjectSizeQueue.java @@ -73,7 +73,7 @@ public interface AsyncObjectSizeQueue extends * @throws java.io.IOException * the object store cannot be accessed. */ - public boolean next() throws MissingObjectException, IOException; + boolean next() throws MissingObjectException, IOException; /** *

getCurrent.

@@ -82,19 +82,19 @@ public interface AsyncObjectSizeQueue extends * Implementations may for performance reasons discard the caller's * ObjectId and provider their own through {@link #getObjectId()}. */ - public T getCurrent(); + T getCurrent(); /** * Get the ObjectId of the current object. Never null. * * @return the ObjectId of the current object. Never null. */ - public ObjectId getObjectId(); + ObjectId getObjectId(); /** * Get the size of the current object. * * @return the size of the current object. */ - public long getSize(); + long getSize(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncOperation.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncOperation.java index 00555b0907..27b9c2038a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncOperation.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/AsyncOperation.java @@ -68,10 +68,10 @@ public interface AsyncOperation { * @return false if the task could not be cancelled, typically because it * has already completed normally; true otherwise */ - public boolean cancel(boolean mayInterruptIfRunning); + boolean cancel(boolean mayInterruptIfRunning); /** * Release resources used by the operation, including cancellation. */ - public void release(); + void release(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobObjectChecker.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobObjectChecker.java index 3fa3168327..7878351ce8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobObjectChecker.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobObjectChecker.java @@ -55,7 +55,7 @@ import org.eclipse.jgit.errors.CorruptObjectException; */ public interface BlobObjectChecker { /** No-op implementation of {@link BlobObjectChecker}. */ - public static final BlobObjectChecker NULL_CHECKER = + BlobObjectChecker NULL_CHECKER = new BlobObjectChecker() { @Override public void update(byte[] in, int p, int len) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CheckoutEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CheckoutEntry.java index cfc0cc86d1..84ff0a8936 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/CheckoutEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/CheckoutEntry.java @@ -12,13 +12,13 @@ public interface CheckoutEntry { * * @return the name of the branch before checkout */ - public abstract String getFromBranch(); + String getFromBranch(); /** * Get the name of the branch after checkout * * @return the name of the branch after checkout */ - public abstract String getToBranch(); + String getToBranch(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ProgressMonitor.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ProgressMonitor.java index d81ee45c9e..9d8d71a0be 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ProgressMonitor.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ProgressMonitor.java @@ -49,7 +49,7 @@ package org.eclipse.jgit.lib; */ public interface ProgressMonitor { /** Constant indicating the total work units cannot be predicted. */ - public static final int UNKNOWN = 0; + int UNKNOWN = 0; /** * Advise the monitor of the total number of subtasks. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java index b000558944..faabbf892f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java @@ -61,7 +61,7 @@ import org.eclipse.jgit.annotations.Nullable; */ public interface Ref { /** Location where a {@link Ref} is stored. */ - public static enum Storage { + enum Storage { /** * The ref does not exist yet, updating it may create it. *

@@ -131,7 +131,7 @@ public interface Ref { * @return name of this ref. */ @NonNull - public String getName(); + String getName(); /** * Test if this reference is a symbolic reference. @@ -144,7 +144,7 @@ public interface Ref { * @return true if this is a symbolic reference; false if this reference * contains its own ObjectId. */ - public abstract boolean isSymbolic(); + boolean isSymbolic(); /** * Traverse target references until {@link #isSymbolic()} is false. @@ -163,7 +163,7 @@ public interface Ref { * @return the reference that actually stores the ObjectId value. */ @NonNull - public abstract Ref getLeaf(); + Ref getLeaf(); /** * Get the reference this reference points to, or {@code this}. @@ -178,7 +178,7 @@ public interface Ref { * @return the target reference, or {@code this}. */ @NonNull - public abstract Ref getTarget(); + Ref getTarget(); /** * Cached value of this ref. @@ -188,7 +188,7 @@ public interface Ref { * symbolic ref pointing to an unborn branch. */ @Nullable - public abstract ObjectId getObjectId(); + ObjectId getObjectId(); /** * Cached value of ref^{} (the ref peeled to commit). @@ -198,14 +198,14 @@ public interface Ref { * does not refer to an annotated tag. */ @Nullable - public abstract ObjectId getPeeledObjectId(); + ObjectId getPeeledObjectId(); /** * Whether the Ref represents a peeled tag. * * @return whether the Ref represents a peeled tag. */ - public abstract boolean isPeeled(); + boolean isPeeled(); /** * How was this ref obtained? @@ -216,5 +216,5 @@ public interface Ref { * @return type of ref. */ @NonNull - public abstract Storage getStorage(); + Storage getStorage(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogEntry.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogEntry.java index 51f2ea0ab7..824bbc4201 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogEntry.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogEntry.java @@ -57,7 +57,7 @@ public interface ReflogEntry { * * @since 4.9 */ - public static final String PREFIX_CREATED = "created"; //$NON-NLS-1$ + String PREFIX_CREATED = "created"; //$NON-NLS-1$ /** * Prefix used in reflog messages when the ref was updated with a fast @@ -69,7 +69,7 @@ public interface ReflogEntry { * * @since 4.9 */ - public static final String PREFIX_FAST_FORWARD = "fast-forward"; //$NON-NLS-1$ + String PREFIX_FAST_FORWARD = "fast-forward"; //$NON-NLS-1$ /** * Prefix used in reflog messages when the ref was force updated. @@ -80,35 +80,35 @@ public interface ReflogEntry { * * @since 4.9 */ - public static final String PREFIX_FORCED_UPDATE = "forced-update"; //$NON-NLS-1$ + String PREFIX_FORCED_UPDATE = "forced-update"; //$NON-NLS-1$ /** * Get the commit id before the change * * @return the commit id before the change */ - public abstract ObjectId getOldId(); + ObjectId getOldId(); /** * Get the commit id after the change * * @return the commit id after the change */ - public abstract ObjectId getNewId(); + ObjectId getNewId(); /** * Get user performing the change * * @return user performing the change */ - public abstract PersonIdent getWho(); + PersonIdent getWho(); /** * Get textual description of the change * * @return textual description of the change */ - public abstract String getComment(); + String getComment(); /** * Parse checkout @@ -117,6 +117,6 @@ public interface ReflogEntry { * information about a branch switch, or null if the entry is not a * checkout */ - public abstract CheckoutEntry parseCheckout(); + CheckoutEntry parseCheckout(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogReader.java index f97b07e08c..4f104d2d7c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ReflogReader.java @@ -59,7 +59,7 @@ public interface ReflogReader { * @return the latest reflog entry, or null if no log * @throws java.io.IOException */ - public abstract ReflogEntry getLastEntry() throws IOException; + ReflogEntry getLastEntry() throws IOException; /** * Get all reflog entries in reverse order @@ -67,7 +67,7 @@ public interface ReflogReader { * @return all reflog entries in reverse order * @throws java.io.IOException */ - public abstract List getReverseEntries() throws IOException; + List getReverseEntries() throws IOException; /** * Get specific entry in the reflog relative to the last entry which is @@ -77,7 +77,7 @@ public interface ReflogReader { * @return reflog entry or null if not found * @throws java.io.IOException */ - public abstract ReflogEntry getReverseEntry(int number) throws IOException; + ReflogEntry getReverseEntry(int number) throws IOException; /** * Get all reflog entries in reverse order @@ -87,7 +87,5 @@ public interface ReflogReader { * @return all reflog entries in reverse order * @throws java.io.IOException */ - public abstract List getReverseEntries(int max) - throws IOException; - + List getReverseEntries(int max) throws IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AsyncRevObjectQueue.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AsyncRevObjectQueue.java index d263184622..98654f14c2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AsyncRevObjectQueue.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/AsyncRevObjectQueue.java @@ -66,5 +66,5 @@ public interface AsyncRevObjectQueue extends AsyncOperation { * @throws java.io.IOException * the object store cannot be accessed. */ - public RevObject next() throws MissingObjectException, IOException; + RevObject next() throws MissingObjectException, IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java index 2eca12be52..0201f0b602 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java @@ -65,14 +65,14 @@ public interface DepthWalk { * * @return Depth to filter to. */ - public int getDepth(); + int getDepth(); /** * @return the deepen-since value; if not 0, this walk only returns commits * whose commit time is at or after this limit * @since 5.2 */ - public default int getDeepenSince() { + default int getDeepenSince() { return 0; } @@ -80,7 +80,7 @@ public interface DepthWalk { * @return the objects specified by the client using --shallow-exclude * @since 5.2 */ - public default List getDeepenNots() { + default List getDeepenNots() { return Collections.emptyList(); } @@ -90,20 +90,20 @@ public interface DepthWalk { * * @return flag marking commits that should become unshallow. */ - public RevFlag getUnshallowFlag(); + RevFlag getUnshallowFlag(); /** * Get flag marking commits that are interesting again. * * @return flag marking commits that are interesting again. */ - public RevFlag getReinterestingFlag(); + RevFlag getReinterestingFlag(); /** * @return flag marking commits that are to be excluded because of --shallow-exclude * @since 5.2 */ - public RevFlag getDeepenNotFlag(); + RevFlag getDeepenNotFlag(); /** RevCommit with a depth (in commits) from a root. */ public static class Commit extends RevCommit { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java index ed05c733f3..72b4255df9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AdvertiseRefsHook.java @@ -55,7 +55,7 @@ public interface AdvertiseRefsHook { * {@link UploadPack#setAdvertisedRefs(java.util.Map)} and * {@link BaseReceivePack#setAdvertisedRefs(java.util.Map,java.util.Set)}. */ - public static final AdvertiseRefsHook DEFAULT = new AdvertiseRefsHook() { + AdvertiseRefsHook DEFAULT = new AdvertiseRefsHook() { @Override public void advertiseRefs(UploadPack uploadPack) { // Do nothing. @@ -77,7 +77,7 @@ public interface AdvertiseRefsHook { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * abort; the message will be sent to the user. */ - public void advertiseRefs(UploadPack uploadPack) + void advertiseRefs(UploadPack uploadPack) throws ServiceMayNotContinueException; /** @@ -90,6 +90,6 @@ public interface AdvertiseRefsHook { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * abort; the message will be sent to the user. */ - public void advertiseRefs(BaseReceivePack receivePack) + void advertiseRefs(BaseReceivePack receivePack) throws ServiceMayNotContinueException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java index d4c514e636..19a1ab0b93 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Connection.java @@ -68,7 +68,7 @@ public interface Connection extends AutoCloseable { * modifiable. The collection can be empty if the remote side has no * refs (it is an empty/newly created repository). */ - public Map getRefsMap(); + Map getRefsMap(); /** * Get the complete list of refs advertised as available for fetching or @@ -82,7 +82,7 @@ public interface Connection extends AutoCloseable { * collection can be empty if the remote side has no refs (it is an * empty/newly created repository). */ - public Collection getRefs(); + Collection getRefs(); /** * Get a single advertised ref by name. @@ -95,7 +95,7 @@ public interface Connection extends AutoCloseable { * name of the ref to obtain. * @return the requested ref; null if the remote did not advertise this ref. */ - public Ref getRef(String name); + Ref getRef(String name); /** * {@inheritDoc} @@ -115,7 +115,7 @@ public interface Connection extends AutoCloseable { * the signature to prevent them from doing so. */ @Override - public void close(); + void close(); /** * Get the additional messages, if any, returned by the remote process. @@ -132,7 +132,7 @@ public interface Connection extends AutoCloseable { * newline (LF) character. The empty string is returned if the * remote produced no additional messages. */ - public String getMessages(); + String getMessages(); /** * User agent advertised by the remote server. @@ -141,5 +141,5 @@ public interface Connection extends AutoCloseable { * server does not advertise this version. * @since 4.0 */ - public String getPeerUserAgent(); + String getPeerUserAgent(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java index f0c45d5fb6..1eb7cbd93a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchConnection.java @@ -109,7 +109,7 @@ public interface FetchConnection extends Connection { * protocol error, or error on remote side, or connection was * already used for fetch. */ - public void fetch(final ProgressMonitor monitor, + void fetch(final ProgressMonitor monitor, final Collection want, final Set have) throws TransportException; @@ -151,7 +151,7 @@ public interface FetchConnection extends Connection { * already used for fetch. * @since 3.0 */ - public void fetch(final ProgressMonitor monitor, + void fetch(final ProgressMonitor monitor, final Collection want, final Set have, OutputStream out) throws TransportException; @@ -173,7 +173,7 @@ public interface FetchConnection extends Connection { * @return true if the last fetch call implicitly included tag objects; * false if tags were not implicitly obtained. */ - public boolean didFetchIncludeTags(); + boolean didFetchIncludeTags(); /** * Did the last {@link #fetch(ProgressMonitor, Collection, Set)} validate @@ -196,7 +196,7 @@ public interface FetchConnection extends Connection { * client side in order to succeed; false if the last fetch assumed * the remote peer supplied a complete graph. */ - public boolean didFetchTestConnectivity(); + boolean didFetchTestConnectivity(); /** * Set the lock message used when holding a pack out of garbage collection. @@ -208,7 +208,7 @@ public interface FetchConnection extends Connection { * * @param message message to use when holding a pack in place. */ - public void setPackLockMessage(String message); + void setPackLockMessage(String message); /** * All locks created by the last @@ -218,5 +218,5 @@ public interface FetchConnection extends Connection { * fetch. The caller must release these after refs are updated in * order to safely permit garbage collection. */ - public Collection getPackLocks(); + Collection getPackLocks(); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/NonceGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/NonceGenerator.java index 51fe9070c0..fc22034340 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/NonceGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/NonceGenerator.java @@ -66,7 +66,7 @@ public interface NonceGenerator { * @return The nonce to be signed by the pusher * @throws java.lang.IllegalStateException */ - public String createNonce(Repository db, long timestamp) + String createNonce(Repository db, long timestamp) throws IllegalStateException; /** @@ -91,6 +91,6 @@ public interface NonceGenerator { * @return a NonceStatus indicating the trustworthiness of the received * nonce. */ - public NonceStatus verify(String received, String sent, + NonceStatus verify(String received, String sent, Repository db, boolean allowSlop, int slop); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java index 5cbb6f5dfb..ba5d2f3c8f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostReceiveHook.java @@ -63,7 +63,7 @@ import java.util.Collection; */ public interface PostReceiveHook { /** A simple no-op hook. */ - public static final PostReceiveHook NULL = new PostReceiveHook() { + PostReceiveHook NULL = new PostReceiveHook() { @Override public void onPostReceive(final ReceivePack rp, final Collection commands) { @@ -81,6 +81,6 @@ public interface PostReceiveHook { * unmodifiable set of successfully completed commands. May be * the empty set. */ - public void onPostReceive(ReceivePack rp, + void onPostReceive(ReceivePack rp, Collection commands); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java index 09667eb01a..3aa3b127e5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PostUploadHook.java @@ -57,7 +57,7 @@ import org.eclipse.jgit.storage.pack.PackStatistics; */ public interface PostUploadHook { /** A simple no-op hook. */ - public static final PostUploadHook NULL = new PostUploadHook() { + PostUploadHook NULL = new PostUploadHook() { @Override public void onPostUpload(PackStatistics stats) { // Do nothing. @@ -72,5 +72,5 @@ public interface PostUploadHook { * {@link org.eclipse.jgit.internal.storage.pack.PackWriter} for * the uploaded pack */ - public void onPostUpload(PackStatistics stats); + void onPostUpload(PackStatistics stats); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java index 77c1a8af29..30845d3b68 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreReceiveHook.java @@ -79,7 +79,7 @@ import java.util.Collection; */ public interface PreReceiveHook { /** A simple no-op hook. */ - public static final PreReceiveHook NULL = new PreReceiveHook() { + PreReceiveHook NULL = new PreReceiveHook() { @Override public void onPreReceive(final ReceivePack rp, final Collection commands) { @@ -99,5 +99,5 @@ public interface PreReceiveHook { * unmodifiable set of valid commands still pending execution. * May be the empty set. */ - public void onPreReceive(ReceivePack rp, Collection commands); + void onPreReceive(ReceivePack rp, Collection commands); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java index 2e1cd5800a..65dc241584 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PreUploadHook.java @@ -59,7 +59,7 @@ import org.eclipse.jgit.lib.ObjectId; */ public interface PreUploadHook { /** A simple no-op hook. */ - public static final PreUploadHook NULL = new PreUploadHook() { + PreUploadHook NULL = new PreUploadHook() { @Override public void onBeginNegotiateRound(UploadPack up, Collection wants, int cntOffered) @@ -96,7 +96,7 @@ public interface PreUploadHook { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * abort; the message will be sent to the user. */ - public void onBeginNegotiateRound(UploadPack up, + void onBeginNegotiateRound(UploadPack up, Collection wants, int cntOffered) throws ServiceMayNotContinueException; @@ -120,7 +120,7 @@ public interface PreUploadHook { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * abort; the message will be sent to the user. */ - public void onEndNegotiateRound(UploadPack up, + void onEndNegotiateRound(UploadPack up, Collection wants, int cntCommon, int cntNotFound, boolean ready) throws ServiceMayNotContinueException; @@ -141,7 +141,7 @@ public interface PreUploadHook { * @throws org.eclipse.jgit.transport.ServiceMayNotContinueException * abort; the message will be sent to the user. */ - public void onSendPack(UploadPack up, Collection wants, + void onSendPack(UploadPack up, Collection wants, Collection haves) throws ServiceMayNotContinueException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushConnection.java index ff2939a3d6..7f98d4dcc9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushConnection.java @@ -113,7 +113,7 @@ public interface PushConnection extends Connection { * created. Non-critical errors concerning only isolated refs * should be placed in refUpdates. */ - public void push(final ProgressMonitor monitor, + void push(final ProgressMonitor monitor, final Map refUpdates) throws TransportException; @@ -163,7 +163,7 @@ public interface PushConnection extends Connection { * should be placed in refUpdates. * @since 3.0 */ - public void push(final ProgressMonitor monitor, + void push(final ProgressMonitor monitor, final Map refUpdates, OutputStream out) throws TransportException; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java index 992ddc6e53..d6d6198f5b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefFilter.java @@ -61,7 +61,7 @@ public interface RefFilter { /** * The default filter, allows all refs to be shown. */ - public static final RefFilter DEFAULT = new RefFilter() { + RefFilter DEFAULT = new RefFilter() { @Override public Map filter (Map refs) { return refs; @@ -76,5 +76,5 @@ public interface RefFilter { * @return * the filtered map of refs. */ - public Map filter(Map refs); + Map filter(Map refs); } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundle.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundle.java index 6a285e59f5..ee851cc620 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundle.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportBundle.java @@ -58,5 +58,5 @@ public interface TransportBundle extends PackTransport { /** * Bundle signature */ - public static final String V2_BUNDLE_SIGNATURE = "# v2 git bundle"; //$NON-NLS-1$ + String V2_BUNDLE_SIGNATURE = "# v2 git bundle"; //$NON-NLS-1$ } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java index d815bc354e..92965f8558 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnection.java @@ -69,25 +69,25 @@ public interface HttpConnection { /** * @see HttpURLConnection#HTTP_OK */ - public static final int HTTP_OK = java.net.HttpURLConnection.HTTP_OK; + int HTTP_OK = java.net.HttpURLConnection.HTTP_OK; /** * @see HttpURLConnection#HTTP_MOVED_PERM * @since 4.7 */ - public static final int HTTP_MOVED_PERM = java.net.HttpURLConnection.HTTP_MOVED_PERM; + int HTTP_MOVED_PERM = java.net.HttpURLConnection.HTTP_MOVED_PERM; /** * @see HttpURLConnection#HTTP_MOVED_TEMP * @since 4.9 */ - public static final int HTTP_MOVED_TEMP = java.net.HttpURLConnection.HTTP_MOVED_TEMP; + int HTTP_MOVED_TEMP = java.net.HttpURLConnection.HTTP_MOVED_TEMP; /** * @see HttpURLConnection#HTTP_SEE_OTHER * @since 4.9 */ - public static final int HTTP_SEE_OTHER = java.net.HttpURLConnection.HTTP_SEE_OTHER; + int HTTP_SEE_OTHER = java.net.HttpURLConnection.HTTP_SEE_OTHER; /** * HTTP 1.1 additional MOVED_TEMP status code; value = 307. @@ -95,22 +95,22 @@ public interface HttpConnection { * @see #HTTP_MOVED_TEMP * @since 4.9 */ - public static final int HTTP_11_MOVED_TEMP = 307; + int HTTP_11_MOVED_TEMP = 307; /** * @see HttpURLConnection#HTTP_NOT_FOUND */ - public static final int HTTP_NOT_FOUND = java.net.HttpURLConnection.HTTP_NOT_FOUND; + int HTTP_NOT_FOUND = java.net.HttpURLConnection.HTTP_NOT_FOUND; /** * @see HttpURLConnection#HTTP_UNAUTHORIZED */ - public static final int HTTP_UNAUTHORIZED = java.net.HttpURLConnection.HTTP_UNAUTHORIZED; + int HTTP_UNAUTHORIZED = java.net.HttpURLConnection.HTTP_UNAUTHORIZED; /** * @see HttpURLConnection#HTTP_FORBIDDEN */ - public static final int HTTP_FORBIDDEN = java.net.HttpURLConnection.HTTP_FORBIDDEN; + int HTTP_FORBIDDEN = java.net.HttpURLConnection.HTTP_FORBIDDEN; /** * Get response code @@ -119,7 +119,7 @@ public interface HttpConnection { * @return the HTTP Status-Code, or -1 * @throws java.io.IOException */ - public int getResponseCode() throws IOException; + int getResponseCode() throws IOException; /** * Get URL @@ -127,7 +127,7 @@ public interface HttpConnection { * @see HttpURLConnection#getURL() * @return the URL. */ - public URL getURL(); + URL getURL(); /** * Get response message @@ -136,7 +136,7 @@ public interface HttpConnection { * @return the HTTP response message, or null * @throws java.io.IOException */ - public String getResponseMessage() throws IOException; + String getResponseMessage() throws IOException; /** * Get list of header fields @@ -144,7 +144,7 @@ public interface HttpConnection { * @see HttpURLConnection#getHeaderFields() * @return a Map of header fields */ - public Map> getHeaderFields(); + Map> getHeaderFields(); /** * Set request property @@ -156,7 +156,7 @@ public interface HttpConnection { * @param value * the value associated with it. */ - public void setRequestProperty(String key, String value); + void setRequestProperty(String key, String value); /** * Set request method @@ -170,7 +170,7 @@ public interface HttpConnection { * @throws java.net.ProtocolException * if any. */ - public void setRequestMethod(String method) + void setRequestMethod(String method) throws ProtocolException; /** @@ -181,7 +181,7 @@ public interface HttpConnection { * a boolean indicating whether or not to allow * caching */ - public void setUseCaches(boolean usecaches); + void setUseCaches(boolean usecaches); /** * Set connect timeout @@ -191,7 +191,7 @@ public interface HttpConnection { * an int that specifies the connect timeout value * in milliseconds */ - public void setConnectTimeout(int timeout); + void setConnectTimeout(int timeout); /** * Set read timeout @@ -201,7 +201,7 @@ public interface HttpConnection { * an int that specifies the timeout value to be * used in milliseconds */ - public void setReadTimeout(int timeout); + void setReadTimeout(int timeout); /** * Get content type @@ -210,7 +210,7 @@ public interface HttpConnection { * @return the content type of the resource that the URL references, or * null if not known. */ - public String getContentType(); + String getContentType(); /** * Get input stream @@ -222,7 +222,7 @@ public interface HttpConnection { * @throws java.io.IOException * if any. */ - public InputStream getInputStream() throws IOException; + InputStream getInputStream() throws IOException; /** * Get header field @@ -233,7 +233,7 @@ public interface HttpConnection { * @return the value of the named header field, or null if * there is no such field in the header. */ - public String getHeaderField(String name); + String getHeaderField(String name); /** * Get content length @@ -243,7 +243,7 @@ public interface HttpConnection { * references, {@code -1} if the content length is not known, or if * the content length is greater than Integer.MAX_VALUE. */ - public int getContentLength(); + int getContentLength(); /** * Set whether or not to follow HTTP redirects. @@ -253,7 +253,7 @@ public interface HttpConnection { * a boolean indicating whether or not to follow * HTTP redirects. */ - public void setInstanceFollowRedirects(boolean followRedirects); + void setInstanceFollowRedirects(boolean followRedirects); /** * Set if to do output @@ -262,7 +262,7 @@ public interface HttpConnection { * @param dooutput * the new value. */ - public void setDoOutput(boolean dooutput); + void setDoOutput(boolean dooutput); /** * Set fixed length streaming mode @@ -271,7 +271,7 @@ public interface HttpConnection { * @param contentLength * The number of bytes which will be written to the OutputStream. */ - public void setFixedLengthStreamingMode(int contentLength); + void setFixedLengthStreamingMode(int contentLength); /** * Get output stream @@ -280,7 +280,7 @@ public interface HttpConnection { * @return an output stream that writes to this connection. * @throws java.io.IOException */ - public OutputStream getOutputStream() throws IOException; + OutputStream getOutputStream() throws IOException; /** * Set chunked streaming mode @@ -290,7 +290,7 @@ public interface HttpConnection { * The number of bytes to write in each chunk. If chunklen is * less than or equal to zero, a default value will be used. */ - public void setChunkedStreamingMode(int chunklen); + void setChunkedStreamingMode(int chunklen); /** * Get request method @@ -298,7 +298,7 @@ public interface HttpConnection { * @see HttpURLConnection#getRequestMethod() * @return the HTTP request method */ - public String getRequestMethod(); + String getRequestMethod(); /** * Whether we use a proxy @@ -306,7 +306,7 @@ public interface HttpConnection { * @see HttpURLConnection#usingProxy() * @return a boolean indicating if the connection is using a proxy. */ - public boolean usingProxy(); + boolean usingProxy(); /** * Connect @@ -314,7 +314,7 @@ public interface HttpConnection { * @see HttpURLConnection#connect() * @throws java.io.IOException */ - public void connect() throws IOException; + void connect() throws IOException; /** * Configure the connection so that it can be used for https communication. @@ -332,7 +332,7 @@ public interface HttpConnection { * @throws java.security.NoSuchAlgorithmException * @throws java.security.KeyManagementException */ - public void configure(KeyManager[] km, TrustManager[] tm, + void configure(KeyManager[] km, TrustManager[] tm, SecureRandom random) throws NoSuchAlgorithmException, KeyManagementException; @@ -345,6 +345,6 @@ public interface HttpConnection { * @throws java.security.NoSuchAlgorithmException * @throws java.security.KeyManagementException */ - public void setHostnameVerifier(HostnameVerifier hostnameverifier) + void setHostnameVerifier(HostnameVerifier hostnameverifier) throws NoSuchAlgorithmException, KeyManagementException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnectionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnectionFactory.java index bd9d61fe66..11691451f2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnectionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/http/HttpConnectionFactory.java @@ -62,7 +62,7 @@ public interface HttpConnectionFactory { * @return a {@link org.eclipse.jgit.transport.http.HttpConnection} * @throws java.io.IOException */ - public HttpConnection create(URL url) throws IOException; + HttpConnection create(URL url) throws IOException; /** * Creates a new connection to a destination defined by a @@ -75,6 +75,6 @@ public interface HttpConnectionFactory { * @return a {@link org.eclipse.jgit.transport.http.HttpConnection} * @throws java.io.IOException */ - public HttpConnection create(URL url, Proxy proxy) + HttpConnection create(URL url, Proxy proxy) throws IOException; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java index 4967169776..b850d1ef94 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/ReceivePackFactory.java @@ -57,7 +57,7 @@ public interface ReceivePackFactory { /** * A factory disabling the ReceivePack service for all repositories */ - public static final ReceivePackFactory DISABLED = new ReceivePackFactory() { + ReceivePackFactory DISABLED = new ReceivePackFactory() { @Override public ReceivePack create(Object req, Repository db) throws ServiceNotEnabledException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java index a305e4cea3..4816f21bcc 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/RepositoryResolver.java @@ -57,7 +57,7 @@ public interface RepositoryResolver { /** * Resolver configured to open nothing. */ - public static final RepositoryResolver NONE = new RepositoryResolver() { + RepositoryResolver NONE = new RepositoryResolver() { @Override public Repository open(Object req, String name) throws RepositoryNotFoundException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java index 40d1ffdc56..bb43b136d8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/resolver/UploadPackFactory.java @@ -57,7 +57,7 @@ public interface UploadPackFactory { /** * A factory disabling the UploadPack service for all repositories. */ - public static final UploadPackFactory DISABLED = new UploadPackFactory() { + UploadPackFactory DISABLED = new UploadPackFactory() { @Override public UploadPack create(Object req, Repository db) throws ServiceNotEnabledException { -- 2.39.5