public static String concatPackages ( final String package1 , final String package2 ) { if ( ( package1 == null ) || ( package1 . length ( ) == 0 ) ) { if ( ( package2 == null ) || ( package2 . length ( ) == 0 ) ) { return "" ; } else { return package2 ; } } else { if ( ( package2 == null ) || ( package2 . length ( ) == 0 ) ) { return package1 ; } else { return package1 + "." + package2 ; } } }
Merge two packages into one . If any package is null or empty no . will be added . If both packages are null an empty string will be returned .