Project

General

Profile

Actions

Bug #3070

closed

Block::remove unexpected semantics

Added by Junxiao Shi almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base
Target version:
Start date:
07/26/2015
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

Block class has a remove method:

void
remove(uint32_t type);

This method is missing Doxygen, is missing a test case, and is unused within ndn-cxx.

Based on function name and signature, either of the following semantics are reasonable:

/** \brief remove all subelements of \p type
 *  \param type TLV-TYPE of subelement to remove
 *  \pre parse() has been invoked
 */

/** \brief remove the first subelements of \p type
 *  \param type TLV-TYPE of subelement to remove
 *  \pre parse() has been invoked
 */

However, the actual behavior is: remove all subelements whose TLV-TYPE is not type.

This semantics is surprising.

To solve this bug:

  1. decide on the correct semantics
  2. add Doxygen
  3. add test case
  4. fix implementation
  5. post a "potential breaking change" notice to ndn-lib mailing list
  6. fix regressions on dependent projects, if any

Related issues 1 (0 open1 closed)

Blocks ndn-cxx - Feature #2879: NDNLPv2: Packet and FieldsClosedEric Newberry06/10/2015

Actions
Actions

Also available in: Atom PDF