Don't use final for method parameters

See https://wiki.eclipse.org/EGit/Contributor_Guide#Use_of_the_.22final.22_modifier

Change-Id: Idc6ed85483e381689e5085c4a1bacd75d26f5489
This commit is contained in:
Matthias Sohn 2022-03-06 18:52:59 +01:00
parent 8a2c769417
commit 72bba7bd53
3 changed files with 14 additions and 20 deletions

View File

@ -77,9 +77,8 @@ class PushProcess {
* been gotten * been gotten
* @throws TransportException * @throws TransportException
*/ */
PushProcess(final Transport transport, PushProcess(Transport transport, Collection<RemoteRefUpdate> toPush,
final Collection<RemoteRefUpdate> toPush, PrePushHook prePush) PrePushHook prePush) throws TransportException {
throws TransportException {
this(transport, toPush, prePush, null); this(transport, toPush, prePush, null);
} }
@ -98,9 +97,8 @@ class PushProcess {
* OutputStream to write messages to * OutputStream to write messages to
* @throws TransportException * @throws TransportException
*/ */
PushProcess(final Transport transport, PushProcess(Transport transport, Collection<RemoteRefUpdate> toPush,
final Collection<RemoteRefUpdate> toPush, PrePushHook prePush, PrePushHook prePush, OutputStream out) throws TransportException {
OutputStream out) throws TransportException {
this.walker = new RevWalk(transport.local); this.walker = new RevWalk(transport.local);
this.transport = transport; this.transport = transport;
this.toPush = new LinkedHashMap<>(); this.toPush = new LinkedHashMap<>();

View File

@ -349,8 +349,7 @@ public RefSpec setDestination(String destination) {
* The wildcard status of the new source disagrees with the * The wildcard status of the new source disagrees with the
* wildcard status of the new destination. * wildcard status of the new destination.
*/ */
public RefSpec setSourceDestination(final String source, public RefSpec setSourceDestination(String source, String destination) {
final String destination) {
if (isWildcard(source) != isWildcard(destination)) if (isWildcard(source) != isWildcard(destination))
throw new IllegalStateException(JGitText.get().sourceDestinationMustMatch); throw new IllegalStateException(JGitText.get().sourceDestinationMustMatch);
final RefSpec r = new RefSpec(this); final RefSpec r = new RefSpec(this);

View File

@ -165,9 +165,8 @@ public enum Status {
* @throws java.lang.IllegalArgumentException * @throws java.lang.IllegalArgumentException
* if some required parameter was null * if some required parameter was null
*/ */
public RemoteRefUpdate(final Repository localDb, final String srcRef, public RemoteRefUpdate(Repository localDb, String srcRef, String remoteName,
final String remoteName, final boolean forceUpdate, boolean forceUpdate, String localName, ObjectId expectedOldObjectId)
final String localName, final ObjectId expectedOldObjectId)
throws IOException { throws IOException {
this(localDb, srcRef, srcRef != null ? localDb.resolve(srcRef) this(localDb, srcRef, srcRef != null ? localDb.resolve(srcRef)
: ObjectId.zeroId(), remoteName, forceUpdate, localName, : ObjectId.zeroId(), remoteName, forceUpdate, localName,
@ -211,9 +210,8 @@ public RemoteRefUpdate(final Repository localDb, final String srcRef,
* @throws java.lang.IllegalArgumentException * @throws java.lang.IllegalArgumentException
* if some required parameter was null * if some required parameter was null
*/ */
public RemoteRefUpdate(final Repository localDb, final Ref srcRef, public RemoteRefUpdate(Repository localDb, Ref srcRef, String remoteName,
final String remoteName, final boolean forceUpdate, boolean forceUpdate, String localName, ObjectId expectedOldObjectId)
final String localName, final ObjectId expectedOldObjectId)
throws IOException { throws IOException {
this(localDb, srcRef != null ? srcRef.getName() : null, this(localDb, srcRef != null ? srcRef.getName() : null,
srcRef != null ? srcRef.getObjectId() : null, remoteName, srcRef != null ? srcRef.getObjectId() : null, remoteName,
@ -263,10 +261,9 @@ public RemoteRefUpdate(final Repository localDb, final Ref srcRef,
* @throws java.lang.IllegalArgumentException * @throws java.lang.IllegalArgumentException
* if some required parameter was null * if some required parameter was null
*/ */
public RemoteRefUpdate(final Repository localDb, final String srcRef, public RemoteRefUpdate(Repository localDb, String srcRef, ObjectId srcId,
final ObjectId srcId, final String remoteName, String remoteName, boolean forceUpdate, String localName,
final boolean forceUpdate, final String localName, ObjectId expectedOldObjectId) throws IOException {
final ObjectId expectedOldObjectId) throws IOException {
this(localDb, srcRef, srcId, remoteName, forceUpdate, localName, null, this(localDb, srcRef, srcId, remoteName, forceUpdate, localName, null,
expectedOldObjectId); expectedOldObjectId);
} }
@ -339,8 +336,8 @@ private RemoteRefUpdate(Repository localDb, String srcRef, ObjectId srcId,
* local tracking branch or srcRef of base object no longer can * local tracking branch or srcRef of base object no longer can
* be resolved to any object. * be resolved to any object.
*/ */
public RemoteRefUpdate(final RemoteRefUpdate base, public RemoteRefUpdate(RemoteRefUpdate base,
final ObjectId newExpectedOldObjectId) throws IOException { ObjectId newExpectedOldObjectId) throws IOException {
this(base.localDb, base.srcRef, base.newObjectId, base.remoteName, this(base.localDb, base.srcRef, base.newObjectId, base.remoteName,
base.forceUpdate, base.forceUpdate,
(base.trackingRefUpdate == null ? null : base.trackingRefUpdate (base.trackingRefUpdate == null ? null : base.trackingRefUpdate