Skip to content

Commit f43faac

Browse files
committed
Removing usage of isUUID as no longer needed
1 parent d63c6cf commit f43faac

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

core/src/main/java/com/microsoft/applicationinsights/TelemetryConfiguration.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,10 @@ public String getInstrumentationKey() {
186186
* @throws IllegalArgumentException when the new value is null or empty
187187
*/
188188
public void setInstrumentationKey(String key) {
189-
if (!Sanitizer.isUUID(key)) {
190-
InternalLogger.INSTANCE.trace("Telemetry Configuration: instrumentation key '%s' is not in UUID format", key);
191-
}
189+
//No longer checking for UUID
190+
// if (!Sanitizer.isUUID(key)) {
191+
// InternalLogger.INSTANCE.trace("Telemetry Configuration: instrumentation key '%s' is not in UUID format", key);
192+
// }
192193

193194
// A non null, non empty instrumentation key is a must
194195
if (Strings.isNullOrEmpty(key)) {

core/src/main/java/com/microsoft/applicationinsights/telemetry/TelemetryContext.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ public String getInstrumentationKey() {
167167
* @param instrumentationKey The instrumentation key
168168
*/
169169
public void setInstrumentationKey(String instrumentationKey) {
170-
if (!Sanitizer.isUUID(instrumentationKey)) {
171-
InternalLogger.INSTANCE.trace("Telemetry Configuration: illegal instrumentation key: %s", instrumentationKey);
172-
}
170+
//No longer checking for UUID
171+
// if (!Sanitizer.isUUID(instrumentationKey)) {
172+
// InternalLogger.INSTANCE.trace("Telemetry Configuration: illegal instrumentation key: %s", instrumentationKey);
173+
// }
173174

174175
this.instrumentationKey = instrumentationKey;
175176
}

web/src/test/java/com/microsoft/applicationinsights/web/extensibility/modules/WebSessionTrackingTelemetryModuleTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ public void initialize(Telemetry telemetry) {
6969
SessionContext requestSessionContext = requestTelemetry.getContext().getSession();
7070

7171
if (expectedSessionId == null) {
72-
Assert.assertTrue(Sanitizer.isUUID(requestSessionContext.getId()));
72+
//No longer testing for UUID
73+
//Assert.assertTrue(Sanitizer.isUUID(requestSessionContext.getId()));
7374
Assert.assertNotEquals(requestSessionContext.getId(), HttpHelper.getCookie());
7475
} else {
7576
Assert.assertEquals(expectedSessionId, requestSessionContext.getId());

web/src/test/java/com/microsoft/applicationinsights/web/extensibility/modules/WebUserTrackingTelemetryModuleTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public void initialize(Telemetry telemetry) {
5555
UserContext requestUserContext = requestTelemetry.getContext().getUser();
5656

5757
if (expectedUserId == null) {
58-
Assert.assertTrue(Sanitizer.isUUID(requestUserContext.getId()));
58+
//No longer testing for UUID
59+
//Assert.assertTrue(Sanitizer.isUUID(requestUserContext.getId()));
5960
Assert.assertNotEquals(requestUserContext.getId(), HttpHelper.getCookie());
6061
} else {
6162
Assert.assertEquals(expectedUserId, requestUserContext.getId());

0 commit comments

Comments
 (0)