Perform NullAway build-time checks in spring-jms

See gh-32475
This commit is contained in:
Sébastien Deleuze
2024-03-25 11:27:04 +01:00
parent e52ee01ec8
commit 2fc78dfb69
5 changed files with 5 additions and 1 deletions

View File

@@ -118,7 +118,7 @@ tasks.withType(JavaCompile).configureEach {
disableAllChecks = true
option("NullAway:CustomContractAnnotations", "org.springframework.lang.Contract")
option("NullAway:AnnotatedPackages", "org.springframework.core,org.springframework.expression," +
"org.springframework.web")
"org.springframework.web,org.springframework.jms")
option("NullAway:UnannotatedSubPackages", "org.springframework.instrument,org.springframework.context.index," +
"org.springframework.asm,org.springframework.cglib,org.springframework.objenesis," +
"org.springframework.javapoet,org.springframework.aot.nativex.substitution")

View File

@@ -285,6 +285,7 @@ public abstract class ConnectionFactoryUtils {
* @throws JMSException in case of JMS failure
*/
@Nullable
@SuppressWarnings("NullAway")
public static Session doGetTransactionalSession(
ConnectionFactory connectionFactory, ResourceFactory resourceFactory, boolean startConnection)
throws JMSException {

View File

@@ -332,6 +332,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
* @throws jakarta.jms.JMSException if thrown by JMS API methods
* @see #initConnection()
*/
@SuppressWarnings("NullAway")
protected Connection getConnection() throws JMSException {
this.connectionLock.lock();
try {

View File

@@ -1440,6 +1440,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
}
}
@SuppressWarnings("NullAway")
private void initResourcesIfNecessary() throws JMSException {
if (getCacheLevel() <= CACHE_CONNECTION) {
updateRecoveryMarker();

View File

@@ -315,6 +315,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
* @throws JMSException if thrown by JMS methods
* @see #executeListener
*/
@SuppressWarnings("NullAway")
protected MessageConsumer createListenerConsumer(final Session session) throws JMSException {
Destination destination = getDestination();
if (destination == null) {