Changeset 8056


Ignore:
Timestamp:
2004-08-25T16:17:57+12:00 (20 years ago)
Author:
mdewsnip
Message:

Fixed a bug where the subcollection regular expression was parsed incorrectly and would slowly get eaten away... character by character...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r8015 r8056  
    15401540        // Then finally the pattern used to build the subcollection partition
    15411541        String full_pattern_str = tokenizer.nextToken();
    1542         // To make life easier I'm going to parse this up now.
    1543         boolean exclusion = (full_pattern_str.substring(1, 2).equals(EXCLAMATION_CHARACTER));
    1544         // Set inclusion/exclusion flag, remove any exclaimation mark and the speech marks
    1545         if(exclusion) {
    1546             full_pattern_str = full_pattern_str.substring(2, full_pattern_str.length() - 1);
     1542        // Set inclusion/exclusion flag and remove any exclamation mark
     1543        boolean exclusion = full_pattern_str.startsWith(EXCLAMATION_CHARACTER);
     1544        if (exclusion) {
     1545            full_pattern_str = full_pattern_str.substring(1, full_pattern_str.length());
    15471546            command_element.setAttribute(TYPE_ATTRIBUTE, EXCLUDE_STR);
    15481547        }
    15491548        else {
    1550             full_pattern_str = full_pattern_str.substring(1, full_pattern_str.length() - 1);
    15511549            command_element.setAttribute(TYPE_ATTRIBUTE, INCLUDE_STR);
    15521550        }
Note: See TracChangeset for help on using the changeset viewer.