From 72bba7bd53389407037ef63a14bab6aa5e6bc3ef Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sun, 6 Mar 2022 18:52:59 +0100 Subject: [PATCH] Don't use final for method parameters See https://wiki.eclipse.org/EGit/Contributor_Guide#Use_of_the_.22final.22_modifier Change-Id: Idc6ed85483e381689e5085c4a1bacd75d26f5489 --- .../eclipse/jgit/transport/PushProcess.java | 10 ++++----- .../org/eclipse/jgit/transport/RefSpec.java | 3 +-- .../jgit/transport/RemoteRefUpdate.java | 21 ++++++++----------- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java index c76cee6984..942dad46e0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java @@ -77,9 +77,8 @@ class PushProcess { * been gotten * @throws TransportException */ - PushProcess(final Transport transport, - final Collection toPush, PrePushHook prePush) - throws TransportException { + PushProcess(Transport transport, Collection toPush, + PrePushHook prePush) throws TransportException { this(transport, toPush, prePush, null); } @@ -98,9 +97,8 @@ class PushProcess { * OutputStream to write messages to * @throws TransportException */ - PushProcess(final Transport transport, - final Collection toPush, PrePushHook prePush, - OutputStream out) throws TransportException { + PushProcess(Transport transport, Collection toPush, + PrePushHook prePush, OutputStream out) throws TransportException { this.walker = new RevWalk(transport.local); this.transport = transport; this.toPush = new LinkedHashMap<>(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java index 51fda84f33..56d0036a20 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefSpec.java @@ -349,8 +349,7 @@ public class RefSpec implements Serializable { * The wildcard status of the new source disagrees with the * wildcard status of the new destination. */ - public RefSpec setSourceDestination(final String source, - final String destination) { + public RefSpec setSourceDestination(String source, String destination) { if (isWildcard(source) != isWildcard(destination)) throw new IllegalStateException(JGitText.get().sourceDestinationMustMatch); final RefSpec r = new RefSpec(this); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java index b90ae813e4..218e62c10a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteRefUpdate.java @@ -165,9 +165,8 @@ public class RemoteRefUpdate { * @throws java.lang.IllegalArgumentException * if some required parameter was null */ - public RemoteRefUpdate(final Repository localDb, final String srcRef, - final String remoteName, final boolean forceUpdate, - final String localName, final ObjectId expectedOldObjectId) + public RemoteRefUpdate(Repository localDb, String srcRef, String remoteName, + boolean forceUpdate, String localName, ObjectId expectedOldObjectId) throws IOException { this(localDb, srcRef, srcRef != null ? localDb.resolve(srcRef) : ObjectId.zeroId(), remoteName, forceUpdate, localName, @@ -211,9 +210,8 @@ public class RemoteRefUpdate { * @throws java.lang.IllegalArgumentException * if some required parameter was null */ - public RemoteRefUpdate(final Repository localDb, final Ref srcRef, - final String remoteName, final boolean forceUpdate, - final String localName, final ObjectId expectedOldObjectId) + public RemoteRefUpdate(Repository localDb, Ref srcRef, String remoteName, + boolean forceUpdate, String localName, ObjectId expectedOldObjectId) throws IOException { this(localDb, srcRef != null ? srcRef.getName() : null, srcRef != null ? srcRef.getObjectId() : null, remoteName, @@ -263,10 +261,9 @@ public class RemoteRefUpdate { * @throws java.lang.IllegalArgumentException * if some required parameter was null */ - public RemoteRefUpdate(final Repository localDb, final String srcRef, - final ObjectId srcId, final String remoteName, - final boolean forceUpdate, final String localName, - final ObjectId expectedOldObjectId) throws IOException { + public RemoteRefUpdate(Repository localDb, String srcRef, ObjectId srcId, + String remoteName, boolean forceUpdate, String localName, + ObjectId expectedOldObjectId) throws IOException { this(localDb, srcRef, srcId, remoteName, forceUpdate, localName, null, expectedOldObjectId); } @@ -339,8 +336,8 @@ public class RemoteRefUpdate { * local tracking branch or srcRef of base object no longer can * be resolved to any object. */ - public RemoteRefUpdate(final RemoteRefUpdate base, - final ObjectId newExpectedOldObjectId) throws IOException { + public RemoteRefUpdate(RemoteRefUpdate base, + ObjectId newExpectedOldObjectId) throws IOException { this(base.localDb, base.srcRef, base.newObjectId, base.remoteName, base.forceUpdate, (base.trackingRefUpdate == null ? null : base.trackingRefUpdate -- 2.39.5