]> source.dussan.org Git - jgit.git/commitdiff
UserAgent: remove deprecated #getAgent, #hasAgent methods 42/1200442/2
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 30 Aug 2024 19:54:50 +0000 (21:54 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 3 Sep 2024 14:11:03 +0000 (16:11 +0200)
Change-Id: Ib53de6dabea7f73ecfde85cb30f49fa05ee48551

org.eclipse.jgit/src/org/eclipse/jgit/transport/UserAgent.java

index 7b052ad4a77702fae2630f2471e1b04ab456cb9b..b23ee97dcb88dbd9aa8f85273e4b9a906ce52954 100644 (file)
 
 package org.eclipse.jgit.transport;
 
-import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_AGENT;
-
-import java.util.Set;
-
 import org.eclipse.jgit.util.StringUtils;
 
 /**
@@ -91,43 +87,6 @@ public class UserAgent {
                userAgent = StringUtils.isEmptyOrNull(agent) ? null : clean(agent);
        }
 
-       /**
-        *
-        * @param options
-        *            options
-        * @param transportAgent
-        *            name of transport agent
-        * @return The transport agent.
-        * @deprecated Capabilities with &lt;key&gt;=&lt;value&gt; shape are now
-        *             parsed alongside other capabilities in the ReceivePack flow.
-        */
-       @Deprecated
-       static String getAgent(Set<String> options, String transportAgent) {
-               if (options == null || options.isEmpty()) {
-                       return transportAgent;
-               }
-               for (String o : options) {
-                       if (o.startsWith(OPTION_AGENT)
-                                       && o.length() > OPTION_AGENT.length()
-                                       && o.charAt(OPTION_AGENT.length()) == '=') {
-                               return o.substring(OPTION_AGENT.length() + 1);
-                       }
-               }
-               return transportAgent;
-       }
-
-       /**
-        *
-        * @param options
-        *            options
-        * @return True if the transport agent is set. False otherwise.
-        * @deprecated Capabilities with &lt;key&gt;=&lt;value&gt; shape are now
-        *             parsed alongside other capabilities in the ReceivePack flow.
-        */
-       @Deprecated
-       static boolean hasAgent(Set<String> options) {
-               return getAgent(options, null) != null;
-       }
 
        private UserAgent() {
        }