Skip to content

Commit b458c42

Browse files
adinauerclaude
andcommitted
fix(spring): Suppress RestTemplate removal warnings
Keep the Spring 7 sample compiling with warnings treated as errors after the Spring Boot 4.2 dependency bump. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8fde3be commit b458c42

12 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎sentry-samples/sentry-samples-spring-7/src/main/java/io/sentry/samples/spring7/WebConfig.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class WebConfig {
2424
* @return RestTemplate
2525
*/
2626
@Bean
27+
@SuppressWarnings("removal")
2728
RestTemplate restTemplate(IScopes scopes) {
2829
RestTemplate restTemplate = new RestTemplate();
2930
SentrySpanClientHttpRequestInterceptor sentryRestTemplateInterceptor =

‎sentry-samples/sentry-samples-spring-7/src/main/java/io/sentry/samples/spring7/web/PersonService.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
@Service
99
public class PersonService {
10+
@SuppressWarnings("removal")
1011
private final RestTemplate restTemplate;
1112

13+
@SuppressWarnings("removal")
1214
public PersonService(RestTemplate restTemplate) {
1315
this.restTemplate = restTemplate;
1416
}

‎sentry-samples/sentry-samples-spring-boot-4-log4j2/src/main/java/io/sentry/samples/spring/boot4/SentryDemoApplication.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
@SpringBootApplication
2323
@EnableCaching
2424
@EnableScheduling
25+
@SuppressWarnings("removal")
2526
public class SentryDemoApplication {
2627
public static void main(String[] args) {
2728
SpringApplication.run(SentryDemoApplication.class, args);

‎sentry-samples/sentry-samples-spring-boot-4-log4j2/src/main/java/io/sentry/samples/spring/boot4/TodoController.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import reactor.core.scheduler.Schedulers;
1313

1414
@RestController
15+
@SuppressWarnings("removal")
1516
public class TodoController {
1617
private final RestTemplate restTemplate;
1718
private final WebClient webClient;

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/src/main/java/io/sentry/samples/spring/boot4/SentryDemoApplication.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
@SpringBootApplication
2424
@EnableScheduling
25+
@SuppressWarnings("removal")
2526
public class SentryDemoApplication {
2627
public static void main(String[] args) {
2728
SpringApplication.run(SentryDemoApplication.class, args);

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry-noagent/src/main/java/io/sentry/samples/spring/boot4/TodoController.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import reactor.core.scheduler.Schedulers;
1919

2020
@RestController
21+
@SuppressWarnings("removal")
2122
public class TodoController {
2223
private final RestTemplate restTemplate;
2324
private final WebClient webClient;

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry/src/main/java/io/sentry/samples/spring/boot4/SentryDemoApplication.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@SpringBootApplication
2525
@EnableCaching
2626
@EnableScheduling
27+
@SuppressWarnings("removal")
2728
public class SentryDemoApplication {
2829
public static void main(String[] args) {
2930
SpringApplication.run(SentryDemoApplication.class, args);

‎sentry-samples/sentry-samples-spring-boot-4-opentelemetry/src/main/java/io/sentry/samples/spring/boot4/TodoController.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import reactor.core.scheduler.Schedulers;
1919

2020
@RestController
21+
@SuppressWarnings("removal")
2122
public class TodoController {
2223
private final RestTemplate restTemplate;
2324
private final WebClient webClient;

‎sentry-samples/sentry-samples-spring-boot-4-otlp/src/main/java/io/sentry/samples/spring/boot4/otlp/SentryDemoApplication.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
@SpringBootApplication
2626
@EnableCaching
2727
@EnableScheduling
28+
@SuppressWarnings("removal")
2829
public class SentryDemoApplication {
2930
public static void main(String[] args) {
3031
SpringApplication.run(SentryDemoApplication.class, args);

‎sentry-samples/sentry-samples-spring-boot-4-otlp/src/main/java/io/sentry/samples/spring/boot4/otlp/TodoController.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import reactor.core.scheduler.Schedulers;
1313

1414
@RestController
15+
@SuppressWarnings("removal")
1516
public class TodoController {
1617
private final RestTemplate restTemplate;
1718
private final WebClient webClient;

0 commit comments

Comments
 (0)