UploadPack: Add @Nullable annotations
The class has several methods where passing a null parameter is valid. Annotate those parameters as @Nullable. Change-Id: Ie08893ee3ab34c1ffb2db875b4ab049ad065c697 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
d386943b83
commit
3d203114bd
|
@ -413,7 +413,7 @@ public final Map<String, Ref> getAdvertisedRefs() {
|
|||
* configured {@link #getRefFilter()}. If null, assumes all refs
|
||||
* were advertised.
|
||||
*/
|
||||
public void setAdvertisedRefs(Map<String, Ref> allRefs) {
|
||||
public void setAdvertisedRefs(@Nullable Map<String, Ref> allRefs) {
|
||||
if (allRefs != null)
|
||||
refs = allRefs;
|
||||
else
|
||||
|
@ -537,7 +537,7 @@ public void setRequestPolicy(RequestPolicy policy) {
|
|||
* custom validator for client want list.
|
||||
* @since 3.1
|
||||
*/
|
||||
public void setRequestValidator(RequestValidator validator) {
|
||||
public void setRequestValidator(@Nullable RequestValidator validator) {
|
||||
requestValidator = validator != null ? validator
|
||||
: new AdvertisedRequestValidator();
|
||||
}
|
||||
|
@ -571,7 +571,8 @@ public RefFilter getRefFilter() {
|
|||
* @param advertiseRefsHook
|
||||
* the hook; may be null to show all refs.
|
||||
*/
|
||||
public void setAdvertiseRefsHook(AdvertiseRefsHook advertiseRefsHook) {
|
||||
public void setAdvertiseRefsHook(
|
||||
@Nullable AdvertiseRefsHook advertiseRefsHook) {
|
||||
if (advertiseRefsHook != null)
|
||||
this.advertiseRefsHook = advertiseRefsHook;
|
||||
else
|
||||
|
@ -600,7 +601,7 @@ public void setProtocolV2Hook(ProtocolV2Hook hook) {
|
|||
* @param refFilter
|
||||
* the filter; may be null to show all refs.
|
||||
*/
|
||||
public void setRefFilter(RefFilter refFilter) {
|
||||
public void setRefFilter(@Nullable RefFilter refFilter) {
|
||||
this.refFilter = refFilter != null ? refFilter : RefFilter.DEFAULT;
|
||||
}
|
||||
|
||||
|
@ -619,7 +620,7 @@ public PreUploadHook getPreUploadHook() {
|
|||
* @param hook
|
||||
* the hook; if null no special actions are taken.
|
||||
*/
|
||||
public void setPreUploadHook(PreUploadHook hook) {
|
||||
public void setPreUploadHook(@Nullable PreUploadHook hook) {
|
||||
preUploadHook = hook != null ? hook : PreUploadHook.NULL;
|
||||
}
|
||||
|
||||
|
@ -640,7 +641,7 @@ public PostUploadHook getPostUploadHook() {
|
|||
* the hook; if null no special actions are taken.
|
||||
* @since 4.1
|
||||
*/
|
||||
public void setPostUploadHook(PostUploadHook hook) {
|
||||
public void setPostUploadHook(@Nullable PostUploadHook hook) {
|
||||
postUploadHook = hook != null ? hook : PostUploadHook.NULL;
|
||||
}
|
||||
|
||||
|
@ -651,7 +652,7 @@ public void setPostUploadHook(PostUploadHook hook) {
|
|||
* configuration controlling packing parameters. If null the
|
||||
* source repository's settings will be used.
|
||||
*/
|
||||
public void setPackConfig(PackConfig pc) {
|
||||
public void setPackConfig(@Nullable PackConfig pc) {
|
||||
this.packConfig = pc;
|
||||
}
|
||||
|
||||
|
@ -663,7 +664,7 @@ public void setPackConfig(PackConfig pc) {
|
|||
* repository's settings will be used.
|
||||
* @since 3.1
|
||||
*/
|
||||
public void setTransferConfig(TransferConfig tc) {
|
||||
public void setTransferConfig(@Nullable TransferConfig tc) {
|
||||
this.transferConfig = tc != null ? tc : new TransferConfig(db);
|
||||
if (transferConfig.isAllowTipSha1InWant()) {
|
||||
setRequestPolicy(transferConfig.isAllowReachableSha1InWant()
|
||||
|
|
Loading…
Reference in New Issue