Skip to content

Commit 0e25d79

Browse files
committed
Restrict getDeclarablesByType() to Declarable
1 parent 603e6c8 commit 0e25d79

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-amqp/src/main/java/org/springframework/amqp/core/Declarables.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -59,7 +59,7 @@ public Collection<Declarable> getDeclarables() {
5959
* @return the filtered list.
6060
* @since 2.2
6161
*/
62-
public <T> List<T> getDeclarablesByType(Class<T> type) {
62+
public <T extends Declarable> List<T> getDeclarablesByType(Class<? extends T> type) {
6363
return this.declarables.stream()
6464
.filter(type::isInstance)
6565
.map(type::cast)

0 commit comments

Comments
 (0)