Skip to content

Commit 8ac2c25

Browse files
committed
Adding logger/better exception handling/static access
1 parent 610b00d commit 8ac2c25

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

common/src/main/java/com/genexus/internet/GXNavigationHelper.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package com.genexus.internet;
22
import java.util.*;
3-
import com.genexus.CommonUtil;
43
import com.genexus.common.interfaces.SpecificImplementation;
5-
4+
import com.genexus.diagnostics.core.ILogger;
5+
import com.genexus.diagnostics.core.LogManager;
66
import json.org.json.*;
7-
87
import java.io.Serializable;
98

109
public class GXNavigationHelper implements Serializable
1110
{
12-
private static final long serialVersionUID = 2608956804836620190L;
11+
private static final long serialVersionUID = 2608956804836620190L;
12+
private static final ILogger logger = LogManager.getLogger(GXNavigationHelper.class);
1313

1414
public static String POPUP_LEVEL = "gxPopupLevel";
1515
public static String TAB_ID = "gxTabId";
@@ -116,7 +116,8 @@ public void deleteStack(String popupLevel)
116116
referers.remove(popupLevel);
117117
}
118118

119-
static public String getUrlComponent(String url, String key) {
119+
static public String getUrlComponent(String url, String key)
120+
{
120121
url = SpecificImplementation.GXutil.URLDecode(url);
121122
String result = "";
122123
if (url != null)
@@ -134,8 +135,9 @@ static public String getUrlComponent(String url, String key) {
134135
{
135136
result = url.substring(eqIdx+1, cIdx);
136137
}
137-
catch(Exception e)
138+
catch(IndexOutOfBoundsException e)
138139
{
140+
logger.error(String.format("Searching parm:'%1$s' in url:'%2$s'", key, url), e);
139141
}
140142
}
141143
}
@@ -144,7 +146,7 @@ static public String getUrlComponent(String url, String key) {
144146
return result;
145147
}
146148

147-
public String getUrlPopupLevel(String url)
149+
static public String getUrlPopupLevel(String url)
148150
{
149151
return getUrlComponent( url, POPUP_LEVEL);
150152
}

java/src/main/java/com/genexus/internet/HttpContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public void deleteReferer(String popupLevel)
351351

352352
public void deleteReferer()
353353
{
354-
deleteReferer(getNavigationHelper(false).getUrlPopupLevel(getRequestNavUrl()));
354+
deleteReferer(GXNavigationHelper.getUrlPopupLevel(getRequestNavUrl()));
355355
}
356356

357357
public void pushCurrentUrl()

0 commit comments

Comments
 (0)