Changeset 34

Show
Ignore:
Timestamp:
07/06/07 14:41:40 (5 years ago)
Author:
ppal
Message:

better protection against null arguments in toDomainName

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pb/src/com/bbn/pb/Utils.java

    r4 r34  
    176176    } 
    177177 
    178     /* this function returns c if passed in a1.a2.....b.c i.e., the  
    179     last two dotted components */ 
     178    /* this function returns c if passed in a1.a2.....b.c */ 
    180179    public static String getLastSuffix (String hostName) 
    181180    { 
     
    184183    } 
    185184 
     185    /* this function returns the last two dotted components */ 
     186     
    186187    public static String toDomainName (String hostName) 
    187188    { 
     189        if (null== hostName)  
     190                return ""; 
     191         
    188192        StringTokenizer s = new StringTokenizer (hostName, "."); 
    189193        StringBuffer buf = new StringBuffer();