Skip to content

Commit

Permalink
Merge pull request #47 from vladimirralev/issue46
Browse files Browse the repository at this point in the history
Fix for #46 debug counter not…
  • Loading branch information
vladimirralev authored Jan 23, 2019
2 parents 13ede11 + 113ac33 commit beaefa3
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/gov/nist/core/ParserCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public abstract class ParserCore {
public static final boolean debug = Debug.parserDebug;

static int nesting_level;
static volatile int nesting_level;

protected LexerCore lexer;

Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/AddressParametersParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ protected AddressParametersParser(String buffer) {

protected void parse(AddressParametersHeader addressParametersHeader)
throws ParseException {
dbg_enter("AddressParametersParser.parse");
if (debug)
dbg_enter("AddressParametersParser.parse");
try {
AddressParser addressParser = new AddressParser(this.getLexer());
AddressImpl addr = addressParser.address(false);
Expand All @@ -69,7 +70,8 @@ protected void parse(AddressParametersHeader addressParametersHeader)
} catch (ParseException ex) {
throw ex;
} finally {
dbg_leave("AddressParametersParser.parse");
if (debug)
dbg_leave("AddressParametersParser.parse");
}
}
}
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/AuthorizationParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ protected AuthorizationParser(Lexer lexer) {
* @throws SIPParseException if the message does not respect the spec.
*/
public SIPHeader parse() throws ParseException {
dbg_enter("parse");
if (debug)
dbg_enter("parse");
try {
headerName(TokenTypes.AUTHORIZATION);
Authorization auth = new Authorization();
super.parse(auth);
return auth;
} finally {
dbg_leave("parse");
if (debug)
dbg_leave("parse");
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/HeaderParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class HeaderParser extends Parser {
* @return an integer with the calendar content for wkday.
*/
protected int wkday() throws ParseException {
dbg_enter("wkday");
if (debug)
dbg_enter("wkday");
try {
String tok = lexer.ttoken();
String id = tok.toLowerCase();
Expand All @@ -69,7 +70,8 @@ else if (TokenNames.SUN.equalsIgnoreCase(id))
else
throw createParseException("bad wkday");
} finally {
dbg_leave("wkday");
if (debug)
dbg_leave("wkday");
}

}
Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/ims/AddressHeaderParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ protected AddressHeaderParser(String buffer) {

protected void parse(AddressHeaderIms addressHeader)
throws ParseException {
dbg_enter("AddressHeaderParser.parse");
if (debug)
dbg_enter("AddressHeaderParser.parse");
try {
AddressParser addressParser = new AddressParser(this.getLexer());
AddressImpl addr = addressParser.address(true);
Expand All @@ -65,7 +66,8 @@ protected void parse(AddressHeaderIms addressHeader)
} catch (ParseException ex) {
throw ex;
} finally {
dbg_leave("AddressParametersParser.parse");
if (debug)
dbg_leave("AddressParametersParser.parse");
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/ims/SecurityClientParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ protected SecurityClientParser(Lexer lexer)

public SIPHeader parse() throws ParseException
{
dbg_enter("SecuriryClient parse");
if (debug)
dbg_enter("SecuriryClient parse");
try {

headerName(TokenTypes.SECURITY_CLIENT);
Expand All @@ -73,7 +74,8 @@ public SIPHeader parse() throws ParseException


} finally {
dbg_leave("SecuriryClient parse");
if (debug)
dbg_leave("SecuriryClient parse");
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/ims/SecurityServerParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ protected SecurityServerParser(Lexer lexer)

public SIPHeader parse() throws ParseException
{
dbg_enter("SecuriryServer parse");
if (debug)
dbg_enter("SecuriryServer parse");
try {

headerName(TokenTypes.SECURITY_SERVER);
Expand All @@ -72,7 +73,8 @@ public SIPHeader parse() throws ParseException
return secServerList;

} finally {
dbg_leave("SecuriryServer parse");
if (debug)
dbg_leave("SecuriryServer parse");
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/gov/nist/javax/sip/parser/ims/SecurityVerifyParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ protected SecurityVerifyParser(Lexer lexer)

public SIPHeader parse() throws ParseException
{
dbg_enter("SecuriryVerify parse");
if (debug)
dbg_enter("SecuriryVerify parse");
try {

headerName(TokenTypes.SECURITY_VERIFY);
Expand All @@ -71,7 +72,8 @@ public SIPHeader parse() throws ParseException
return secVerifyList;

} finally {
dbg_leave("SecuriryVerify parse");
if (debug)
dbg_leave("SecuriryVerify parse");
}
}

Expand Down

0 comments on commit beaefa3

Please sign in to comment.