Skip to content

Commit 98fbe0e

Browse files
Remove duplicate calls to addPackage (#4285)
* Check for mixed SDK versions * Format code * format + api * Init noops if mixed versions detected * Add BuildConfig * config entries for agentless module sdk names * Add MANIFEST.MF for JARs * Throw on startup; use manifests for backend; reuse code for otel * Format code * Format code * changelog * api * changelog * Remove duplicate addPackage calls * remove test assertion for package * remove test assertion for package --------- Co-authored-by: Sentry Github Bot <bot+github-bot@sentry.io>
1 parent bfbc9e1 commit 98fbe0e

File tree

26 files changed

+0
-52
lines changed

26 files changed

+0
-52
lines changed

sentry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ public class FragmentLifecycleIntegration(
5757
application.registerActivityLifecycleCallbacks(this)
5858
options.logger.log(DEBUG, "FragmentLifecycleIntegration installed.")
5959
addIntegrationToSdkVersion("FragmentLifecycle")
60-
SentryIntegrationPackageStorage.getInstance()
61-
.addPackage("maven:io.sentry:sentry-android-fragment", BuildConfig.VERSION_NAME)
6260
}
6361

6462
override fun close() {

sentry-android-navigation/src/main/java/io/sentry/android/navigation/SentryNavigationListener.kt

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public class SentryNavigationListener @JvmOverloads constructor(
5050

5151
init {
5252
addIntegrationToSdkVersion("NavigationListener")
53-
SentryIntegrationPackageStorage.getInstance()
54-
.addPackage("maven:io.sentry:sentry-android-navigation", BuildConfig.VERSION_NAME)
5553
}
5654

5755
override fun onDestinationChanged(

sentry-android-replay/src/main/java/io/sentry/android/replay/ReplayIntegration.kt

-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ public class ReplayIntegration(
158158
}
159159

160160
addIntegrationToSdkVersion("Replay")
161-
SentryIntegrationPackageStorage.getInstance()
162-
.addPackage("maven:io.sentry:sentry-android-replay", BuildConfig.VERSION_NAME)
163161

164162
finalizePreviousReplay()
165163
}

sentry-android-timber/src/main/java/io/sentry/android/timber/SentryTimberIntegration.kt

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class SentryTimberIntegration(
3535
Timber.plant(tree)
3636

3737
logger.log(SentryLevel.DEBUG, "SentryTimberIntegration installed.")
38-
SentryIntegrationPackageStorage.getInstance().addPackage("maven:io.sentry:sentry-android-timber", VERSION_NAME)
3938
addIntegrationToSdkVersion("Timber")
4039
}
4140

sentry-apollo-3/src/main/java/io/sentry/apollo3/SentryApollo3HttpInterceptor.kt

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class SentryApollo3HttpInterceptor @JvmOverloads constructor(
5353
SentryIntegrationPackageStorage.getInstance()
5454
.addIntegration("Apollo3ClientError")
5555
}
56-
SentryIntegrationPackageStorage.getInstance()
57-
.addPackage("maven:io.sentry:sentry-apollo-3", BuildConfig.VERSION_NAME)
5856
}
5957

6058
private val regex: Regex by lazy {

sentry-apollo-3/src/test/java/io/sentry/apollo3/SentryApollo3InterceptorTest.kt

-3
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,6 @@ class SentryApollo3InterceptorTest {
323323
fun `sets SDKVersion Info`() {
324324
assertNotNull(fixture.scopes.options.sdkVersion)
325325
assert(fixture.scopes.options.sdkVersion!!.integrationSet.contains("Apollo3"))
326-
val packageInfo = fixture.scopes.options.sdkVersion!!.packageSet.firstOrNull { pkg -> pkg.name == "maven:io.sentry:sentry-apollo-3" }
327-
assertNotNull(packageInfo)
328-
assert(packageInfo.version == BuildConfig.VERSION_NAME)
329326
}
330327

331328
@Test

sentry-apollo-4/src/main/java/io/sentry/apollo4/SentryApollo4HttpInterceptor.kt

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class SentryApollo4HttpInterceptor @JvmOverloads constructor(
5252
SentryIntegrationPackageStorage.getInstance()
5353
.addIntegration("Apollo4ClientError")
5454
}
55-
SentryIntegrationPackageStorage.getInstance()
56-
.addPackage("maven:io.sentry:sentry-apollo-4", BuildConfig.VERSION_NAME)
5755
}
5856

5957
private val regex: Regex by lazy {

sentry-apollo-4/src/test/java/io/sentry/apollo4/SentryApollo4HttpInterceptorTest.kt

-3
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,6 @@ abstract class SentryApollo4HttpInterceptorTest(
331331
fun `sets SDKVersion Info`() {
332332
assertNotNull(fixture.scopes.options.sdkVersion)
333333
assert(fixture.scopes.options.sdkVersion!!.integrationSet.contains("Apollo4"))
334-
val packageInfo = fixture.scopes.options.sdkVersion!!.packageSet.firstOrNull { pkg -> pkg.name == "maven:io.sentry:sentry-apollo-4" }
335-
assertNotNull(packageInfo)
336-
assert(packageInfo.version == BuildConfig.VERSION_NAME)
337334
}
338335

339336
@Test

sentry-apollo/src/main/java/io/sentry/apollo/SentryApolloInterceptor.kt

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class SentryApolloInterceptor(
4747

4848
init {
4949
addIntegrationToSdkVersion("Apollo")
50-
SentryIntegrationPackageStorage.getInstance().addPackage("maven:io.sentry:sentry-apollo", BuildConfig.VERSION_NAME)
5150
}
5251

5352
override fun interceptAsync(request: InterceptorRequest, chain: ApolloInterceptorChain, dispatcher: Executor, callBack: CallBack) {

sentry-compose-helper/src/jvmMain/java/io/sentry/compose/gestures/ComposeGestureTargetLocator.java

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public final class ComposeGestureTargetLocator implements GestureTargetLocator {
4141
public ComposeGestureTargetLocator(final @NotNull ILogger logger) {
4242
this.logger = logger;
4343
SentryIntegrationPackageStorage.getInstance().addIntegration("ComposeUserInteraction");
44-
SentryIntegrationPackageStorage.getInstance()
45-
.addPackage("maven:io.sentry:sentry-compose", BuildConfig.VERSION_NAME);
4644
}
4745

4846
@Override

sentry-compose/src/androidMain/kotlin/io/sentry/compose/SentryNavigationIntegration.kt

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ internal class SentryLifecycleObserver(
3434

3535
init {
3636
addIntegrationToSdkVersion("ComposeNavigation")
37-
SentryIntegrationPackageStorage.getInstance().addPackage("maven:io.sentry:sentry-compose", BuildConfig.VERSION_NAME)
3837
}
3938

4039
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {

sentry-graphql-22/src/main/java/io/sentry/graphql22/SentryInstrumentation.java

-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ public SentryInstrumentation(
9494
new SentryGraphqlInstrumentation(
9595
beforeSpan, subscriptionHandler, exceptionReporter, ignoredErrorTypes, TRACE_ORIGIN);
9696
SentryIntegrationPackageStorage.getInstance().addIntegration("GraphQL-v22");
97-
SentryIntegrationPackageStorage.getInstance()
98-
.addPackage("maven:io.sentry:sentry-graphql-22", BuildConfig.VERSION_NAME);
9997
}
10098

10199
/**

sentry-graphql/src/main/java/io/sentry/graphql/SentryInstrumentation.java

-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ public SentryInstrumentation(
9191
new SentryGraphqlInstrumentation(
9292
beforeSpan, subscriptionHandler, exceptionReporter, ignoredErrorTypes, TRACE_ORIGIN);
9393
SentryIntegrationPackageStorage.getInstance().addIntegration("GraphQL");
94-
SentryIntegrationPackageStorage.getInstance()
95-
.addPackage("maven:io.sentry:sentry-graphql", BuildConfig.VERSION_NAME);
9694
}
9795

9896
/**

sentry-jdbc/src/main/java/io/sentry/jdbc/SentryJdbcEventListener.java

-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ public void onAfterAnyExecute(
7979

8080
private void addPackageAndIntegrationInfo() {
8181
SentryIntegrationPackageStorage.getInstance().addIntegration("JDBC");
82-
SentryIntegrationPackageStorage.getInstance()
83-
.addPackage("maven:io.sentry:sentry-jdbc", BuildConfig.VERSION_NAME);
8482
}
8583

8684
private void applyDatabaseDetailsToSpan(

sentry-jul/src/main/java/io/sentry/jul/SentryHandler.java

-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ public void close() throws SecurityException {
310310
}
311311

312312
private void addPackageAndIntegrationInfo() {
313-
SentryIntegrationPackageStorage.getInstance()
314-
.addPackage("maven:io.sentry:sentry-jul", BuildConfig.VERSION_NAME);
315313
SentryIntegrationPackageStorage.getInstance().addIntegration("Jul");
316314
}
317315

sentry-log4j2/src/main/java/io/sentry/log4j2/SentryAppender.java

-2
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ public void append(final @NotNull LogEvent eventObject) {
282282
}
283283

284284
private void addPackageAndIntegrationInfo() {
285-
SentryIntegrationPackageStorage.getInstance()
286-
.addPackage("maven:io.sentry:sentry-log4j2", BuildConfig.VERSION_NAME);
287285
SentryIntegrationPackageStorage.getInstance().addIntegration("Log4j");
288286
}
289287
}

sentry-logback/src/main/java/io/sentry/logback/SentryAppender.java

-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ private String formatted(@NotNull ILoggingEvent loggingEvent) {
229229
}
230230

231231
private void addPackageAndIntegrationInfo() {
232-
SentryIntegrationPackageStorage.getInstance()
233-
.addPackage("maven:io.sentry:sentry-logback", BuildConfig.VERSION_NAME);
234232
SentryIntegrationPackageStorage.getInstance().addIntegration("Logback");
235233
}
236234

sentry-okhttp/src/main/java/io/sentry/okhttp/SentryOkHttpInterceptor.kt

-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ public open class SentryOkHttpInterceptor(
6363

6464
init {
6565
addIntegrationToSdkVersion("OkHttp")
66-
SentryIntegrationPackageStorage.getInstance()
67-
.addPackage("maven:io.sentry:sentry-okhttp", BuildConfig.VERSION_NAME)
6866
}
6967

7068
@Suppress("LongMethod")

sentry-openfeign/src/main/java/io/sentry/openfeign/SentryFeignClient.java

-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public SentryFeignClient(
5454
}
5555

5656
private void addPackageAndIntegrationInfo() {
57-
SentryIntegrationPackageStorage.getInstance()
58-
.addPackage("maven:io.sentry:sentry-openfeign", BuildConfig.VERSION_NAME);
5957
addIntegrationToSdkVersion("OpenFeign");
6058
}
6159

sentry-quartz/src/main/java/io/sentry/quartz/SentryJobListener.java

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public SentryJobListener() {
4141
public SentryJobListener(final @NotNull IScopes scopes) {
4242
this.scopes = Objects.requireNonNull(scopes, "scopes are required");
4343
SentryIntegrationPackageStorage.getInstance().addIntegration("Quartz");
44-
SentryIntegrationPackageStorage.getInstance()
45-
.addPackage("maven:io.sentry:sentry-quartz", BuildConfig.VERSION_NAME);
4644
}
4745

4846
@Override

sentry-servlet-jakarta/src/main/java/io/sentry/servlet/jakarta/SentryServletContainerInitializer.java

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,5 @@ public void onStartup(@Nullable Set<Class<?>> c, @NotNull ServletContext ctx)
2626
throws ServletException {
2727
ctx.addListener(SentryServletRequestListener.class);
2828
SentryIntegrationPackageStorage.getInstance().addIntegration("Servlet-Jakarta");
29-
SentryIntegrationPackageStorage.getInstance()
30-
.addPackage("maven:io.sentry:sentry-servlet-jakarta", BuildConfig.VERSION_NAME);
3129
}
3230
}

sentry-servlet/src/main/java/io/sentry/servlet/SentryServletContainerInitializer.java

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,5 @@ public void onStartup(@Nullable Set<Class<?>> c, @NotNull ServletContext ctx)
2626
throws ServletException {
2727
ctx.addListener(SentryServletRequestListener.class);
2828
SentryIntegrationPackageStorage.getInstance().addIntegration("Servlet");
29-
SentryIntegrationPackageStorage.getInstance()
30-
.addPackage("maven:io.sentry:sentry-servlet", BuildConfig.VERSION_NAME);
3129
}
3230
}

sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java

-3
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ static class ApacheHttpClientTransportFactoryAutoconfiguration {
466466
}
467467

468468
private static void addPackageAndIntegrationInfo() {
469-
SentryIntegrationPackageStorage.getInstance()
470-
.addPackage(
471-
"maven:io.sentry:sentry-spring-boot-starter-jakarta", BuildConfig.VERSION_NAME);
472469
SentryIntegrationPackageStorage.getInstance().addIntegration("SpringBoot3");
473470
}
474471
}

sentry-spring-boot/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java

-2
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,6 @@ static class ApacheHttpClientTransportFactoryAutoconfiguration {
436436
}
437437

438438
private static void addPackageAndIntegrationInfo() {
439-
SentryIntegrationPackageStorage.getInstance()
440-
.addPackage("maven:io.sentry:sentry-spring-boot-starter", BuildConfig.VERSION_NAME);
441439
SentryIntegrationPackageStorage.getInstance().addIntegration("SpringBoot");
442440
}
443441
}

sentry-spring-jakarta/src/main/java/io/sentry/spring/jakarta/SentryHubRegistrar.java

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ private void registerSentryExceptionResolver(
9898
}
9999

100100
private static void addPackageAndIntegrationInfo() {
101-
SentryIntegrationPackageStorage.getInstance()
102-
.addPackage("maven:io.sentry:sentry-spring-jakarta", BuildConfig.VERSION_NAME);
103101
SentryIntegrationPackageStorage.getInstance().addIntegration("Spring6");
104102
}
105103
}

sentry-spring/src/main/java/io/sentry/spring/SentryHubRegistrar.java

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ private void registerSentryExceptionResolver(
9898
}
9999

100100
private static void addPackageAndIntegrationInfo() {
101-
SentryIntegrationPackageStorage.getInstance()
102-
.addPackage("maven:io.sentry:sentry-spring", BuildConfig.VERSION_NAME);
103101
SentryIntegrationPackageStorage.getInstance().addIntegration("Spring");
104102
}
105103
}

0 commit comments

Comments
 (0)