Update of /cvsroot/springframework/spring/src/org/springframework/jms/listener/adapter
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11768/src/org/springframework/jms/listener/adapter
Modified Files:
MessageListenerAdapter.java
Log Message:
fixed MessageListenerAdapter's "getSubscriptionName()" to work without delegate as well (SPR-5309 backport)
Index: MessageListenerAdapter.java
===================================================================
RCS file: /cvsroot/springframework/spring/src/org/springframework/jms/listener/adapter/MessageListenerAdapter.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** MessageListenerAdapter.java 15 Oct 2008 14:42:00 -0000 1.18
--- MessageListenerAdapter.java 17 Mar 2009 20:45:48 -0000 1.19
***************
*** 1,4 ****
/*
! * Copyright 2002-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
--- 1,4 ----
/*
! * Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
***************
*** 18,22 ****
import java.lang.reflect.InvocationTargetException;
-
import javax.jms.Destination;
import javax.jms.InvalidDestinationException;
--- 18,21 ----
***************
*** 367,375 ****
public String getSubscriptionName() {
! if (this.delegate instanceof SubscriptionNameProvider) {
! return ((SubscriptionNameProvider) this.delegate).getSubscriptionName();
}
else {
! return this.delegate.getClass().getName();
}
}
--- 366,375 ----
public String getSubscriptionName() {
! Object delegate = getDelegate();
! if (delegate != this && delegate instanceof SubscriptionNameProvider) {
! return ((SubscriptionNameProvider) delegate).getSubscriptionName();
}
else {
! return delegate.getClass().getName();
}
}
|