@ -42,6 +42,8 @@
* /
* /
package org.eclipse.jgit.transport ;
package org.eclipse.jgit.transport ;
import static java.util.Objects.requireNonNull ;
import java.util.ArrayList ;
import java.util.ArrayList ;
import java.util.HashSet ;
import java.util.HashSet ;
import java.util.List ;
import java.util.List ;
@ -71,16 +73,18 @@ public final class FetchV2Request extends FetchRequest {
private final boolean doneReceived ;
private final boolean doneReceived ;
private FetchV2Request ( List < ObjectId > peerHas ,
FetchV2Request ( @NonNull List < ObjectId > peerHas ,
TreeMap < String , ObjectId > wantedRefs , Set < ObjectId > wantIds ,
@NonNull TreeMap < String , ObjectId > wantedRefs ,
Set < ObjectId > clientShallowCommits , int deepenSince ,
@NonNull Set < ObjectId > wantIds ,
List < String > deepenNotRefs , int depth , long filterBlobLimit ,
@NonNull Set < ObjectId > clientShallowCommits , int deepenSince ,
boolean doneReceived , Set < String > clientCapabilities ) {
@NonNull List < String > deepenNotRefs , int depth ,
long filterBlobLimit ,
boolean doneReceived , @NonNull Set < String > clientCapabilities ) {
super ( wantIds , depth , clientShallowCommits , filterBlobLimit , clientCapabilities ) ;
super ( wantIds , depth , clientShallowCommits , filterBlobLimit , clientCapabilities ) ;
this . peerHas = peerHas ;
this . peerHas = requireNonNull ( peerHas ) ;
this . wantedRefs = wantedRefs ;
this . wantedRefs = requireNonNull ( wantedRefs ) ;
this . deepenSince = deepenSince ;
this . deepenSince = deepenSince ;
this . deepenNotRefs = deepenNotRefs ;
this . deepenNotRefs = requireNonNull ( deepenNotRefs ) ;
this . doneReceived = doneReceived ;
this . doneReceived = doneReceived ;
}
}
@ -134,17 +138,17 @@ public final class FetchV2Request extends FetchRequest {
/** A builder for {@link FetchV2Request}. */
/** A builder for {@link FetchV2Request}. */
static final class Builder {
static final class Builder {
List < ObjectId > peerHas = new ArrayList < > ( ) ;
final List < ObjectId > peerHas = new ArrayList < > ( ) ;
TreeMap < String , ObjectId > wantedRefs = new TreeMap < > ( ) ;
final TreeMap < String , ObjectId > wantedRefs = new TreeMap < > ( ) ;
Set < ObjectId > wantIds = new HashSet < > ( ) ;
final Set < ObjectId > wantIds = new HashSet < > ( ) ;
Set < ObjectId > clientShallowCommits = new HashSet < > ( ) ;
final Set < ObjectId > clientShallowCommits = new HashSet < > ( ) ;
List < String > deepenNotRefs = new ArrayList < > ( ) ;
final List < String > deepenNotRefs = new ArrayList < > ( ) ;
Set < String > clientCapabilities = new HashSet < > ( ) ;
final Set < String > clientCapabilities = new HashSet < > ( ) ;
int depth ;
int depth ;