Bug #280

RESEND_ONLY_EXCEPTION is not correctly taken into account

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

Status:Closed Start date:01/09/2015
Priority:Lowest Due date:
Assignee:Stefano Lenzi % Done:

100%

Category:zigbee.CC2530.driver Spent time: -
Target version:org.aaloa.zb4osgi.zigbee.CC2530.driver-0.3.0
Has a patch:No Has license agreement signed:No

Description

In DriverCC2530

boolean b = RESEND_ONLY_EXCEPTION_DEFAULT;
try {
  aux = Integer.parseInt(System.getProperty(RESEND_ONLY_EXCEPTION_KEY));
  logger.debug("Using RESEND_MAX_RETRY set from enviroment {}", aux);
} catch (NumberFormatException ex) {
  logger.debug("Using RESEND_MAX_RETRY set as DEFAULT {}", aux);
}
RESEND_ONLY_EXCEPTION = b;

should probably be

boolean b = RESEND_ONLY_EXCEPTION_DEFAULT;
try {
    b = Boolean.getBoolean(RESEND_ONLY_EXCEPTION_KEY);
    logger.debug("Using RESEND_ONLY_EXCEPTION set from enviroment {}", b);
} catch (NumberFormatException ex) {
    logger.debug("Using RESEND_ONLY_EXCEPTION set as DEFAULT {}", b);
}
RESEND_ONLY_EXCEPTION = b;


Subtasks

Task #289: Backport parsing issue 280 to EZ430_RF2480 driverClosedStefano Lenzi

Associated revisions

Revision 1135
Added by Stefano Lenzi over 3 years ago

Fixing parsing of RESEND_ONLY_EXCEPTION_KEY properties ( refs #280 )

Revision 1136
Added by Stefano Lenzi over 3 years ago

Fixing minor compilation issue ( refs #280 )

Revision 1137
Added by Stefano Lenzi over 3 years ago

Added JUnit for testing the bug ( refs #280 )

Revision 1138
Added by Stefano Lenzi over 3 years ago

Removed unused dependencies and fixed test in case of null ( refs #280 )

History

#1 Updated by Philipp Buluschek almost 4 years ago

Actually, the correct code (which handles the absence of property correctly) is rather:

String property = System.getProperty(RESEND_ONLY_EXCEPTION_KEY);
if(property != null){
    RESEND_ONLY_EXCEPTION = Boolean.parseBoolean(property);
    logger.debug("Using RESEND_ONLY_EXCEPTION set from environment {}", RESEND_ONLY_EXCEPTION);
} else {
    RESEND_ONLY_EXCEPTION = RESEND_ONLY_EXCEPTION_DEFAULT;
    logger.debug("Using RESEND_ONLY_EXCEPTION set as DEFAULT {}", RESEND_ONLY_EXCEPTION);
}

#2 Updated by Stefano Lenzi almost 4 years ago

  • Category set to zigbee.CC2530.driver
  • 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.CC2530.driver-1.X

Working on it

#3 Updated by Stefano Lenzi over 3 years ago

  • Status changed from In Progress to Closed
  • Target version changed from org.aaloa.zb4osgi.zigbee.CC2530.driver-1.X to org.aaloa.zb4osgi.zigbee.CC2530.driver-0.3.0

Fixed

Also available in: Atom PDF