Bug #279

SubscriptionBase.isActive() does not return the expected result

Added by Philipp Buluschek almost 4 years ago. Updated almost 4 years ago.

Status:Closed Start date:11/15/2014
Priority:Low Due date:
Assignee:Stefano Lenzi % Done:

0%

Category:zigbee.zcl.library Spent time: -
Target version:org.aaloa.zb4osgi.zigbee.zcl.library-0.9.0
Has a patch:No Has license agreement signed:No

Description

In SubscriptionBase.updateConfiguration() there is a check whether the subscription "isActive" before sending a configuration request to the device.

The isActive() method returns "true", if it there are no subscribers ( listeners.size()==0 ). So the configuration is only updated when no listeners are registered. This seems reverse to the intended behavior and also contradicts the method comment.

If it has listeners, do send the update.
If it has no listeners, do not send, or even send a subscription cancellation...

Note that isActive() seems to be used with this wrong behavior elsewhere in the code...

Associated revisions

Revision 1105
Added by Stefano Lenzi almost 4 years ago

Added JUnit for verifying isActive() method ( refs #279 )

Revision 1106
Added by Stefano Lenzi almost 4 years ago

Improved Javadoc documentation for method getReportingOverwrite() ( refs #279 )

Revision 1107
Added by Stefano Lenzi almost 4 years ago

Fixing method isActive() and verified the behavior of the code that it using it ( refs #279 )

History

#1 Updated by Stefano Lenzi almost 4 years ago

  • Category set to zigbee.zcl.library
  • Status changed from New to In Progress
  • Assignee set to Stefano Lenzi
  • Priority changed from Normal to Low
  • Target version set to org.aaloa.zb4osgi.zigbee.zcl.library-0.9.0

#2 Updated by Stefano Lenzi almost 4 years ago

  • Status changed from In Progress to Resolved

I have fixed the method and add JUnit to discover the bug.
I have also verified that the behavior of the classes using isActive() is valid, and it is because

                if ( configuration.getReportingOverwrite() || subscription.isActive() == false ) {

the above check was always true thanks to the configuration.getReportingOverwrite() method

Please close if you agree

#3 Updated by Stefano Lenzi almost 4 years ago

  • Status changed from Resolved to Closed

Fixed the issue

Also available in: Atom PDF