private void searchInTree ( String resourceKey , int styl , TimeUnit timeUnit , String srcPluralCount , String searchPluralCount , Map < String , Object [ ] > countToPatterns ) { ULocale parentLocale = locale ; String srcTimeUnitName = timeUnit . toString ( ) ; while ( parentLocale != null ) { try { // look for pattern for srcPluralCount in locale tree ICUResourceBundle unitsRes = ( ICUResourceBundle ) UResourceBundle . getBundleInstance ( ICUData . ICU_UNIT_BASE_NAME , parentLocale ) ; unitsRes = unitsRes . getWithFallback ( resourceKey ) ; ICUResourceBundle oneUnitRes = unitsRes . getWithFallback ( srcTimeUnitName ) ; String pattern = oneUnitRes . getStringWithFallback ( searchPluralCount ) ; final MessageFormat messageFormat = new MessageFormat ( pattern , locale ) ; Object [ ] pair = countToPatterns . get ( srcPluralCount ) ; if ( pair == null ) { pair = new Object [ 2 ] ; countToPatterns . put ( srcPluralCount , pair ) ; } pair [ styl ] = messageFormat ; return ; } catch ( MissingResourceException e ) { } parentLocale = parentLocale . getFallback ( ) ; } // if no unitsShort resource was found even after fallback to root locale // then search the units resource fallback from the current level to root if ( parentLocale == null && resourceKey . equals ( "unitsShort" ) ) { searchInTree ( "units" , styl , timeUnit , srcPluralCount , searchPluralCount , countToPatterns ) ; if ( countToPatterns . get ( srcPluralCount ) != null && countToPatterns . get ( srcPluralCount ) [ styl ] != null ) { return ; } } // if not found the pattern for this plural count at all, // fall-back to plural count "other" if ( searchPluralCount . equals ( "other" ) ) { // set default fall back the same as the resource in root MessageFormat messageFormat = null ; if ( timeUnit == TimeUnit . SECOND ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_SECOND , locale ) ; } else if ( timeUnit == TimeUnit . MINUTE ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_MINUTE , locale ) ; } else if ( timeUnit == TimeUnit . HOUR ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_HOUR , locale ) ; } else if ( timeUnit == TimeUnit . WEEK ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_WEEK , locale ) ; } else if ( timeUnit == TimeUnit . DAY ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_DAY , locale ) ; } else if ( timeUnit == TimeUnit . MONTH ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_MONTH , locale ) ; } else if ( timeUnit == TimeUnit . YEAR ) { messageFormat = new MessageFormat ( DEFAULT_PATTERN_FOR_YEAR , locale ) ; } Object [ ] pair = countToPatterns . get ( srcPluralCount ) ; if ( pair == null ) { pair = new Object [ 2 ] ; countToPatterns . put ( srcPluralCount , pair ) ; } pair [ styl ] = messageFormat ; } else { // fall back to rule "other", and search in parents searchInTree ( resourceKey , styl , timeUnit , srcPluralCount , "other" , countToPatterns ) ; } }
then other is the searchPluralCount .