Changeset 7558

Show
Ignore:
Timestamp:
03/25/09 16:36:14 (16 months ago)
Author:
wtoconnor
Message:

Make sure articleList is set by Adds and Removes of articles.

Add and Removed worked before the Update fix. However in the process of fixing update we failed to take in to account problems with Add and Remove.

Addresses #1215

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • head/ambra/libs/otm-models/src/main/java/org/topazproject/ambra/models/Issue.java

    r7548 r7558  
    4646   */ 
    4747  public void addArticle(URI article) { 
    48     List<URI> uriList = getArticleList(); 
    49  
     48    /* 
     49     * Since we are doing an on-the-fly data migration (unwisely) 
     50     * we need to update articleList if it has not been done yet. 
     51     */ 
     52    if (articleList.isEmpty() && !super.getSimpleCollection().isEmpty()) 
     53      articleList =  new ArrayList<URI>(super.getSimpleCollection()); 
     54     
    5055    //Only add if not there 
    51     if (!uriList.contains(article)) 
    52       uriList.add(article); 
     56    if (!articleList.contains(article)) 
     57      articleList.add(article); 
    5358 
    5459    //Shadow this addition in the simple collection 
     
    6267   */ 
    6368  public void removeArticle(URI article) { 
    64     List<URI> uriList = getArticleList(); 
     69    /* 
     70     * Since we are doing an on-the-fly data migration (unwisely) 
     71     * we need to update articleList if it has not been done yet. 
     72     */ 
     73    if (articleList.isEmpty() && !super.getSimpleCollection().isEmpty()) 
     74      articleList =  new ArrayList<URI>(super.getSimpleCollection()); 
    6575 
    66     if (uriList.contains(article)) 
    67       uriList.remove(article); 
     76    if (articleList.contains(article)) 
     77      articleList.remove(article); 
    6878 
    6979    //Shadow this removal in the simple collection