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

Fix CodeQL warnings #4053

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
@@ -1,15 +1,13 @@
package com.microsoft.applicationinsights.etw_testapp;

import com.microsoft.applicationinsights.agent.internal.diagnostics.etw.DiagnosticsLoggerProxy;
import java.util.concurrent.atomic.AtomicInteger;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.atomic.AtomicInteger;

import com.microsoft.applicationinsights.agent.internal.diagnostics.etw.DiagnosticsLoggerProxy;

@RestController
public class EtwTestController {
private static final DiagnosticsLoggerProxy DIAGNOSTICS_LOGGER = new DiagnosticsLoggerProxy();
Expand Down Expand Up @@ -51,7 +49,6 @@ public ResponseEntity<String> logPage(
default:
return ResponseEntity.notFound().build();
}
return ResponseEntity.ok(
level.toUpperCase() + " " + n + (t == null ? "" : "<br/>\n" + t.toString()));
return ResponseEntity.ok();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.microsoft.applicationinsights.etw_testapp;

import com.microsoft.applicationinsights.agent.internal.diagnostics.etw.DiagnosticsLoggerProxy;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.time.Duration;
Expand All @@ -11,9 +12,6 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BinaryOperator;

import com.microsoft.applicationinsights.agent.internal.diagnostics.etw.DiagnosticsLoggerProxy;

import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -246,14 +244,7 @@ public ResponseEntity<String> startTest(
period = Duration.parse("PT" + periodStr);
}
} catch (NumberFormatException | DateTimeParseException e) {
return ResponseEntity.badRequest()
.body(
"<p>Period parameter 'T' could not parse \""
+ periodStr
+ "\"</p>"
+ "<p><pre>"
+ ExceptionUtils.getStackTrace(e)
+ "</p>");
return ResponseEntity.badRequest().body("Period parameter could not be parsed");
}

final long startTime;
Expand Down
Loading