https://bz.apache.org/bugzilla/show_bug.cgi?id=68229

            Bug ID: 68229
           Summary: removeRelationship(String)@PackageRelationshipCollecti
                    on can have an error on sorted list
           Product: POI
           Version: 5.3.x-dev
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: zhong...@pku.org.cn
  Target Milestone: ---

I noticed that NPOI fixed a bug:

https://github.com/nissl-lab/npoi/commit/4e85b803eb29b1de2a85813e1d43baac32daaa81

The buggy code is as follows:

public void RemoveRelationship(String id)
{
  ...
  internalRelationshipsByTargetName.Values.Remove(rel);
...}

The fixed code is as follows:

public void RemoveRelationship(String id)
{
  ...
 
internalRelationshipsByTargetName.RemoveAt(internalRelationshipsByTargetName.IndexOfValue(rel));
...}

NPOI programmers fixed a sortedlist remove error. POI still uses the buggy way:

 public void removeRelationship(String id) {
        PackageRelationship rel = relationshipsByID.get(id);
        if (rel != null) {
            relationshipsByID.remove(rel.getId());
            internalRelationshipsByTargetName.values().remove(rel);
        }
    }

It can have the identical error.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to