Skip to content

Commit

Permalink
Perform NullAway build-time checks in spring-jms
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Mar 25, 2024
1 parent e52ee01 commit 2fc78df
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/spring-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ public static Session doGetTransactionalSession(
* @throws JMSException in case of JMS failure
*/
@Nullable
@SuppressWarnings("NullAway")
public static Session doGetTransactionalSession(
ConnectionFactory connectionFactory, ResourceFactory resourceFactory, boolean startConnection)
throws JMSException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ private ConnectionFactory obtainTargetConnectionFactory() {
* @throws jakarta.jms.JMSException if thrown by JMS API methods
* @see #initConnection()
*/
@SuppressWarnings("NullAway")
protected Connection getConnection() throws JMSException {
this.connectionLock.lock();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@ private void decreaseActiveInvokerCount() {
}
}

@SuppressWarnings("NullAway")
private void initResourcesIfNecessary() throws JMSException {
if (getCacheLevel() <= CACHE_CONNECTION) {
updateRecoveryMarker();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ protected void initializeConsumers() throws JMSException {
* @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) {
Expand Down

0 comments on commit 2fc78df

Please sign in to comment.