Changeset 44


Ignore:
Timestamp:
02/16/12 19:29:33 (13 years ago)
Author:
phdmakk
Message:

+ minor fix for undefined regexes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/org.etsi.common/src/org/etsi/common/MiscTools.java

    r43 r44  
    173173 
    174174        //TODO: cloned from NamingConventionsChecker => needs to be unified and reused 
     175        //note: if regExp is not set it defaults to false quietly 
    175176        public static boolean regExpMatch(String regExp, String subject) { 
    176177                boolean matches = false; 
    177                 Pattern pattern = Pattern.compile(regExp); 
    178                 Matcher matcher = pattern.matcher(subject); 
    179 //              System.out.println(regExp + " : " + subject); 
    180                 if (matcher.matches()) { 
    181                         matches = true; 
     178                if (regExp!=null){ 
     179                        Pattern pattern = Pattern.compile(regExp); 
     180                        Matcher matcher = pattern.matcher(subject); 
     181        //              System.out.println(regExp + " : " + subject); 
     182                        if (matcher.matches()) { 
     183                                matches = true; 
     184                        } 
    182185                } 
    183186                return matches; 
Note: See TracChangeset for help on using the changeset viewer.