Skip to content

Commit 2fc78df

Browse files
committed
Perform NullAway build-time checks in spring-jms
See spring-projectsgh-32475
1 parent e52ee01 commit 2fc78df

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

Diff for: gradle/spring-module.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ tasks.withType(JavaCompile).configureEach {
118118
disableAllChecks = true
119119
option("NullAway:CustomContractAnnotations", "org.springframework.lang.Contract")
120120
option("NullAway:AnnotatedPackages", "org.springframework.core,org.springframework.expression," +
121-
"org.springframework.web")
121+
"org.springframework.web,org.springframework.jms")
122122
option("NullAway:UnannotatedSubPackages", "org.springframework.instrument,org.springframework.context.index," +
123123
"org.springframework.asm,org.springframework.cglib,org.springframework.objenesis," +
124124
"org.springframework.javapoet,org.springframework.aot.nativex.substitution")

Diff for: spring-jms/src/main/java/org/springframework/jms/connection/ConnectionFactoryUtils.java

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ public static Session doGetTransactionalSession(
285285
* @throws JMSException in case of JMS failure
286286
*/
287287
@Nullable
288+
@SuppressWarnings("NullAway")
288289
public static Session doGetTransactionalSession(
289290
ConnectionFactory connectionFactory, ResourceFactory resourceFactory, boolean startConnection)
290291
throws JMSException {

Diff for: spring-jms/src/main/java/org/springframework/jms/connection/SingleConnectionFactory.java

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ private ConnectionFactory obtainTargetConnectionFactory() {
332332
* @throws jakarta.jms.JMSException if thrown by JMS API methods
333333
* @see #initConnection()
334334
*/
335+
@SuppressWarnings("NullAway")
335336
protected Connection getConnection() throws JMSException {
336337
this.connectionLock.lock();
337338
try {

Diff for: spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java

+1
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,7 @@ private void decreaseActiveInvokerCount() {
14401440
}
14411441
}
14421442

1443+
@SuppressWarnings("NullAway")
14431444
private void initResourcesIfNecessary() throws JMSException {
14441445
if (getCacheLevel() <= CACHE_CONNECTION) {
14451446
updateRecoveryMarker();

Diff for: spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java

+1
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ protected void initializeConsumers() throws JMSException {
315315
* @throws JMSException if thrown by JMS methods
316316
* @see #executeListener
317317
*/
318+
@SuppressWarnings("NullAway")
318319
protected MessageConsumer createListenerConsumer(final Session session) throws JMSException {
319320
Destination destination = getDestination();
320321
if (destination == null) {

0 commit comments

Comments
 (0)