Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/cafesip/sipunit/EventSubscriber.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ protected Request createRequestMessage(String method, int duration, String event
AddressFactory addrFactory = parent.getAddressFactory();
HeaderFactory hdrFactory = parent.getHeaderFactory();

Request req = null;
Request req;

if (dialog == null) {
// first time sending a request
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/cafesip/sipunit/MessageDigestAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static String calculateResponse(String algorithm, String username_value,

// The following follows closely the algorithm for generating a response
// digest as specified by rfc2617
String A1 = null;
String A1;

if (algorithm == null || algorithm.trim().length() == 0
|| algorithm.trim().equalsIgnoreCase("MD5")) {
Expand All @@ -86,7 +86,7 @@ public static String calculateResponse(String algorithm, String username_value,
+ cnonce_value;
}

String A2 = null;
String A2;
if (qop_value == null || qop_value.trim().length() == 0
|| qop_value.trim().equalsIgnoreCase("auth")) {
A2 = Method + ":" + digest_uri_value;
Expand All @@ -96,7 +96,7 @@ public static String calculateResponse(String algorithm, String username_value,
A2 = Method + ":" + digest_uri_value + ":" + H(entity_body);
}

String request_digest = null;
String request_digest;
if (cnonce_value != null && qop_value != null
&& (qop_value.equals("auth") || (qop_value.equals("auth-int")))) {
request_digest =
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cafesip/sipunit/SipCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ public boolean respondToReinvite(SipTransaction siptrans, int statusCode, String
initErrorInfo();

try {
ContactHeader contact_hdr = null;
ContactHeader contact_hdr;
if (newContact == null) {
contact_hdr = (ContactHeader) parent.getContactInfo().getContactHeader().clone();
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/cafesip/sipunit/SipSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public void processResponse(ResponseEvent response) {
return;
}

SipTransaction sip_trans = null;
SipTransaction sip_trans;

synchronized (respTransactions) {
sip_trans = (SipTransaction) respTransactions.get(trans);
Expand Down Expand Up @@ -480,7 +480,7 @@ public void processTimeout(TimeoutEvent timeout) {
return;
}

SipTransaction sip_trans = null;
SipTransaction sip_trans;
synchronized (respTransactions) {
sip_trans = (SipTransaction) respTransactions.get(trans);
}
Expand Down Expand Up @@ -1688,7 +1688,7 @@ public boolean sendUnidirectionalResponse(RequestEvent request, int statusCode,

public AuthorizationHeader getAuthorization(String method, String uri, String requestBody,
WWWAuthenticateHeader authHeader, String username, String password) throws SecurityException {
String response = null;
String response;
try {
response = MessageDigestAlgorithm.calculateResponse(authHeader.getAlgorithm(), username,
authHeader.getRealm(), new String(password), authHeader.getNonce(),
Expand All @@ -1701,7 +1701,7 @@ public AuthorizationHeader getAuthorization(String method, String uri, String re
"The received authenticate header was malformatted: " + exc.getMessage());
}

AuthorizationHeader authorization = null;
AuthorizationHeader authorization;
try {
if (authHeader instanceof ProxyAuthenticateHeader) {
authorization =
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cafesip/sipunit/SipStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class SipStack implements SipListener {
private static final Properties defaultProperties = new Properties();

static {
String host = null;
String host;
try {
host = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class ExampleTestWithProxyNoAuth {
private static final Properties defaultProperties = new Properties();

static {
String host = null;
String host;
try {
host = InetAddress.getLocalHost().getHostAddress();
} catch (UnknownHostException e) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/cafesip/sipunit/test/util/AuthUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class AuthUtil {
*/
public static WWWAuthenticateHeader getAuthenticationHeader(SipRequest message,
HeaderFactory headerFactory, String realm) throws Exception {
WWWAuthenticateHeader header = null;
WWWAuthenticateHeader header;
String htype =
message.getRequestEvent().getRequest().getMethod().equals(Request.REGISTER) == true ? WWWAuthenticateHeader.NAME
: ProxyAuthenticateHeader.NAME;
Expand Down