Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one bug, few potential NPE on equals methods, a variable name typo #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ protected GraphData(String key) {
@Override
public boolean equals(Object obj)
{
if (obj == null) {
return key == null;
}

return Objects.equal(key, ((GraphData)obj).key);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private EventVolume processServiceVolume(String serviceId, BaseVolumeInput input

EventFilter eventFilter = input.getEventFilter(apiClient, serviceId);

Set<String> smiliarIds = new HashSet<String>();
Set<String> similarIds = new HashSet<String>();

for (EventResult event : eventsMap.values()) {

Expand All @@ -110,14 +110,14 @@ private EventVolume processServiceVolume(String serviceId, BaseVolumeInput input
result.sum += event.stats.hits;
break;
}

if ((event.stats.hits > 0) && (!similarIds.contains(event.id))) {
result.count++;
}
}

if ((event.stats.hits > 0) && (!smiliarIds.contains(event.id))) {
result.count++;
}


if (event.similar_event_ids != null) {
smiliarIds.addAll(event.similar_event_ids);
similarIds.addAll(event.similar_event_ids);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static List<Series> processSingleQuery(ApiClient apiClient, String query)

int endIndex = trimmedQuery.lastIndexOf(')');

if (endIndex < endIndex) {
if (endIndex == -1) {
throw new IllegalArgumentException("Missing closing parenthesis: " + query);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public static GroupByKey of(String key, DateTime time) {

@Override
public boolean equals(Object obj) {
if (obj == null) {
return ((key == null) &&
(time == null));
}

GroupByKey other = (GroupByKey) obj;

if (!key.equals(other.key)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,11 @@ protected RegresionWindowCacheLoader(ApiClient apiClient, RegressionInput input)
@Override
public boolean equals(Object obj) {

if (obj == null) {
return ((input == null) &&
(apiClient == null));
}

RegresionWindowCacheLoader other = (RegresionWindowCacheLoader) obj;

if (!apiClient.getHostname().equals(other.apiClient.getHostname())) {
Expand Down