summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-03 00:42:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-02-03 00:42:39 +0000
commitf7cf7266182f3f6060fada8159c5e0751fef357e (patch)
tree80edb8d9954d3f5b0b28eabc4ea260dc6557e4e0
parentf047dc8b8bdb6d11adc78872582aee33bdd9260d (diff)
parentd95b40018b1f3be542e9f1f9f6b84fdf8bdac61c (diff)
downloadnist-sip-simpleperf-release.tar.gz
Merge "Snap for 11400057 from 640e83f19f58a8f82678e96e88fe8e5d0dff57b8 to simpleperf-release" into simpleperf-releasesimpleperf-release
-rw-r--r--java/gov/nist/javax/sip/header/SIPHeaderList.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/java/gov/nist/javax/sip/header/SIPHeaderList.java b/java/gov/nist/javax/sip/header/SIPHeaderList.java
index d11506a..f248303 100644
--- a/java/gov/nist/javax/sip/header/SIPHeaderList.java
+++ b/java/gov/nist/javax/sip/header/SIPHeaderList.java
@@ -208,7 +208,7 @@ public abstract class SIPHeaderList<HDR extends SIPHeader> extends SIPHeader imp
*
* @return SIPHeader first element of the list.
*/
- public Header getFirst() {
+ public HDR getFirst() {
if (hlist == null || hlist.isEmpty())
return null;
else
@@ -220,7 +220,7 @@ public abstract class SIPHeaderList<HDR extends SIPHeader> extends SIPHeader imp
*
* @return SIPHeader last element of the list.
*/
- public Header getLast() {
+ public HDR getLast() {
if (hlist == null || hlist.isEmpty())
return null;
return hlist.get(hlist.size() - 1);
@@ -277,18 +277,21 @@ public abstract class SIPHeaderList<HDR extends SIPHeader> extends SIPHeader imp
/**
* Remove the first element of this list.
*/
- public void removeFirst() {
- if (hlist.size() != 0)
- hlist.remove(0);
-
+ public HDR removeFirst() {
+ if (hlist.size() != 0) {
+ return hlist.remove(0);
+ }
+ return null;
}
/**
* Remove the last element of this list.
*/
- public void removeLast() {
- if (hlist.size() != 0)
- hlist.remove(hlist.size() - 1);
+ public HDR removeLast() {
+ if (hlist.size() != 0) {
+ return hlist.remove(hlist.size() - 1);
+ }
+ return null;
}
/**