Suppress warnings about deprecated BaseReceivePack
Upstream JGit has deprecated the BaseReceivePack class in favor of ReceivePack, but the interface we're using it with (AdvertiseRefsHook) still references BaseReceivePack which means we can't change any of our code to use ReceivePack. Suppress all the warnings. Change-Id: I4e4615963649056ddcddfbe01bb2e8625f7d2fb7
This commit is contained in:
@@ -32,6 +32,7 @@ public class HookUtil {
|
||||
* @return map of refs that were advertised.
|
||||
* @throws ServiceMayNotContinueException if a problem occurred.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Map<String, Ref> ensureAllRefsAdvertised(BaseReceivePack rp)
|
||||
throws ServiceMayNotContinueException {
|
||||
Map<String, Ref> refs = rp.getAdvertisedRefs();
|
||||
|
||||
@@ -72,6 +72,7 @@ public class HackPushNegotiateHook implements AdvertiseRefsHook {
|
||||
throw new UnsupportedOperationException("HackPushNegotiateHook cannot be used for UploadPack");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void advertiseRefs(BaseReceivePack rp) throws ServiceMayNotContinueException {
|
||||
Map<String, Ref> r = rp.getAdvertisedRefs();
|
||||
@@ -96,6 +97,7 @@ public class HackPushNegotiateHook implements AdvertiseRefsHook {
|
||||
}
|
||||
|
||||
// Scan history until the advertisement is full.
|
||||
@SuppressWarnings("deprecation")
|
||||
RevWalk rw = rp.getRevWalk();
|
||||
rw.reset();
|
||||
try {
|
||||
|
||||
@@ -81,6 +81,7 @@ public class ReceiveCommitsAdvertiseRefsHook implements AdvertiseRefsHook {
|
||||
"ReceiveCommitsAdvertiseRefsHook cannot be used for UploadPack");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void advertiseRefs(BaseReceivePack rp) throws ServiceMayNotContinueException {
|
||||
Map<String, Ref> advertisedRefs = HookUtil.ensureAllRefsAdvertised(rp);
|
||||
|
||||
Reference in New Issue
Block a user