Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Commit

Permalink
checkstyle formatting corrections, no code changes!
Browse files Browse the repository at this point in the history
  • Loading branch information
grogu01 authored and grogu01 committed Jul 21, 2017
1 parent 820b3af commit 3618e63
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ private String executeApi(String callType, String callParams, boolean checkError
boolean retry = false;

String logsForUser = EpaUtils.getProperty(LOGS_FOR_USER, null);
if (!callType.startsWith("acct_") && (callType != "cp_list") && (logsForUser != null) && !logsForUser.isEmpty()) {
if (!callType.startsWith("acct_")
&& (callType != "cp_list")
&& (logsForUser != null)
&& !logsForUser.isEmpty()) {
callParams += "&acct=" + URLEncoder.encode(logsForUser, EpaUtils.getEncoding());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public class AssetDownloader extends AbstractHandler {
private final String path;
private final String key;

/**
* AssetDownloader constructor.
* @param successor successor
* @param path download path
* @param key key top extract
*/
public AssetDownloader(Handler successor, String path, String key) {
super(successor);
this.path = path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.ca.apm.swat.epaplugins.asm.AsmRequestHelper;
Expand All @@ -17,12 +20,6 @@
import com.wily.introscope.epagent.EpaUtils;
import com.wily.util.feedback.Module;

import java.util.Map;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONException;

/**
* Base class for implementations of the {@link Monitor} interface.
* @author Guenter Grossberger - CA APM SWAT Team
Expand All @@ -45,7 +42,7 @@ public class BaseMonitor extends AbstractMonitor implements AsmProperties {

/**
* Monitor base class.
* @param successor
* @param successor successor in chain
* @param name name of the monitor
* @param type monitor type
* @param folder folder of the monitor
Expand Down Expand Up @@ -226,16 +223,20 @@ public Map<String, String> generateMetrics(
JSONObject resultObj = innerJsonArray.getJSONObject(i);
try {
// find the monitor
Monitor m = MonitorFactory.findMonitor(resultObj.getString("name"));
if(m != null) {
Monitor mon =
MonitorFactory.findMonitor(resultObj.getString("name"));
if (mon != null) {
// hand over parsing to a monitor-specific handler chain
m.generateMetrics(metricMap, resultObj.toString(), metricTree);
mon.generateMetrics(metricMap,
resultObj.toString(),
metricTree);
} else {
// recursively generate metrics for these tags
generateMetrics(metricMap, resultObj.toString(), metricTree);
}
} catch(JSONException e) {
EpaUtils.getFeedback().debug(module, "Missing name key for log record.");
} catch (JSONException e) {
EpaUtils.getFeedback().debug(module,
"Missing name key for log record.");
} catch (AsmException e) {
handleException(e, metricTree, metricMap, module);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public interface Handler {

/**
* @return next Handler in chain
* @return next Handler in chain.
*/
public Handler getSuccessor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Map<String, String> generateMetrics(
JSONObject h1 = new JSONObject(harString);
JSONObject h2 = h1.optJSONObject("har");

JsonHar har = new JsonHar(h2 != null? h2 : h1);
JsonHar har = new JsonHar(h2 != null ? h2 : h1);

int step = 1;

Expand Down Expand Up @@ -130,7 +130,7 @@ private String getEntryMetric(Entry entry, String metricName) {

private void addMetric(Map<String, String> metricMap, String metricName, String value) {

value = StringUtils.escapeHTMLSpecialCharacters(value);
value = StringUtils.escapeHTMLSpecialCharacters(value);

if (EpaUtils.getFeedback().isDebugEnabled(module)) {
EpaUtils.getFeedback().debug(module, "METRIC: " + metricName + ":" + value);
Expand Down Expand Up @@ -223,8 +223,8 @@ private Map<String, String> reportEntryMetrics(
String text = url;

if ((null != text) && (0 < text.length())) {
// lopal05: now normalize URL, we dont't want anything behing '?' as that may result in metric tree
// explosion. Each new request creating new path / element.
// lopal05: now normalize URL, we dont't want anything behind '?' as that may result
// in metric tree explosion. Each new request creating new path / element.
int indexOfChar = text.indexOf(";");
if (indexOfChar > 0) {
text = text.substring(0, indexOfChar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ private MetricMap reportJMeterStep(String metricTree,
String text = stepChild.getTextContent();

if ((null != text) && (0 < text.length())) {
// lopal05: now normalize URL, we dont't want anything behing '?' as that may result in metric tree
// explosion. Each new request creating new path / element.
// lopal05: now normalize URL, we dont't want anything behind '?' as that
// may result in metric tree explosion. Each new request creating new
// path / element.
int indexOfChar = text.indexOf(";");
if (indexOfChar > 0) {
text = text.substring(0, indexOfChar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class ScriptMonitor extends BaseMonitor {
* @param name name of the monitor
* @param folder folder of the monitor
* @param tags tags of the monitor
* @param url
* @param active
* @param url URL
* @param active is active?
*/
protected ScriptMonitor(String name,
String folder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public Map<String, String> generateMetrics(Map<String, String> map,
metricTree));
}
// replace all occu
return getSuccessor().generateMetrics(map, xmlString.replaceAll("&", "&amp;"), metricTree);
return getSuccessor().generateMetrics(map,
xmlString.replaceAll("&", "&amp;"),
metricTree);

} else {
EpaUtils.getFeedback().error(module, AsmMessages.getMessage(
Expand Down

0 comments on commit 3618e63

Please sign in to comment.