~ken-vandine/+junk/libphonenumber-7.1.0-4ubuntu1

« back to all changes in this revision

Viewing changes to tools/java/java-build/src/com/google/i18n/phonenumbers/buildtools/GeneratePhonePrefixData.java

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2014-09-03 07:12:50 UTC
  • Revision ID: package-import@ubuntu.com-20140903071250-wzcgxhpc7w5k9pbb
Tags: 6.3~svn698-3
More patches for JDK 1.5 build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
      throws IOException {
146
146
    final SortedMap<Integer, String> phonePrefixMap = new TreeMap<Integer, String>();
147
147
    parseTextFile(input, new PhonePrefixMappingHandler() {
148
 
      @Override
149
148
      public void process(int prefix, String location) {
150
149
        if (phonePrefixMap.put(prefix, location) != null) {
151
150
          throw new RuntimeException(String.format("duplicated prefix %d", prefix));
194
193
      final Set<Integer> phonePrefixes = new HashSet<Integer>();
195
194
      FileInputStream inputStream = new FileInputStream(countryCodeFile);
196
195
      parseTextFile(inputStream, new PhonePrefixMappingHandler() {
197
 
        @Override
198
196
        public void process(int prefix, String location) {
199
197
          phonePrefixes.add(Integer.parseInt(String.valueOf(prefix).substring(0, 4)));
200
198
        }
414
412
    Iterator<Map.Entry<Integer, String>> it = map.entrySet().iterator();
415
413
    while (it.hasNext()) {
416
414
      Map.Entry<Integer, String> mapping = it.next();
417
 
      if (mapping.getValue().isEmpty()) {
 
415
      if (mapping.getValue().length() == 0) {
418
416
        it.remove();
419
417
      }
420
418
    }