test_class.declarator: INPUT = new File("src/test/resource/resfilter/ios/input.strings")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT = new File("src/test/resource/resfilter/ios/input.strings");
test_class.type: File
test_class.var_name: INPUT
test_class.declarator: EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/ios/write-output.strings")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE = new File("src/test/resource/resfilter/ios/write-output.strings");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE
test_class.declarator: MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/ios/merge-input-1.strings")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_1_FILE = new File("src/test/resource/resfilter/ios/merge-input-1.strings");
test_class.type: File
test_class.var_name: MERGE_INPUT_1_FILE
test_class.declarator: MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/ios/merge-input-2.strings")
test_class.modifier: private static final
test_class.original_string: private static final File MERGE_INPUT_2_FILE = new File("src/test/resource/resfilter/ios/merge-input-2.strings");
test_class.type: File
test_class.var_name: MERGE_INPUT_2_FILE
test_class.declarator: EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/ios/merge-output-1.strings")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_1_FILE = new File("src/test/resource/resfilter/ios/merge-output-1.strings");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_1_FILE
test_class.declarator: EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/ios/merge-output-2.strings")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_2_FILE = new File("src/test/resource/resfilter/ios/merge-output-2.strings");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_2_FILE
test_class.declarator: EXPECTED_INPUT_RES_LIST
test_class.modifier: private static final
test_class.original_string: private static final Collection<ResourceString> EXPECTED_INPUT_RES_LIST;
test_class.type: Collection<ResourceString>
test_class.var_name: EXPECTED_INPUT_RES_LIST
test_class.declarator: EXPECTED_GLOBAL_NOTES = Arrays.asList(
              " This is the first global comment... ",
              " This is the 2nd global comment... ")
test_class.modifier: private static final
test_class.original_string: private static final List<String> EXPECTED_GLOBAL_NOTES = Arrays.asList(
              " This is the first global comment... ",
              " This is the 2nd global comment... ");
test_class.type: List<String>
test_class.var_name: EXPECTED_GLOBAL_NOTES
test_class.declarator: WRITE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle WRITE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: WRITE_BUNDLE
test_class.declarator: MERGE_BUNDLE
test_class.modifier: private static
test_class.original_string: private static LanguageBundle MERGE_BUNDLE;
test_class.type: LanguageBundle
test_class.var_name: MERGE_BUNDLE
test_class.declarator: res = new IOSStringsResource()
test_class.modifier: private static final
test_class.original_string: private static final IOSStringsResource res = new IOSStringsResource();
test_class.type: IOSStringsResource
test_class.var_name: res
test_class.file: gp-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/impl/IOSStringsResourceTest.java
test_class.identifier: IOSStringsResourceTest
test_case.body: @Test
      public void testParse() throws IOException, ResourceFilterException {
          assertTrue("The input test file <" + INPUT + "> does not exist.", INPUT.exists());
  
          try (InputStream is = new FileInputStream(INPUT)) {
              LanguageBundle bundle = res.parse(is, null);
              List<ResourceString> resStrList = new ArrayList<>(bundle.getResourceStrings());
              Collections.sort(resStrList, new ResourceStringComparator());
              assertEquals("ResourceStrings did not match.", EXPECTED_INPUT_RES_LIST, resStrList);
              List<String> globalNotes = bundle.getNotes();
              assertEquals("Global comments did not match.", EXPECTED_GLOBAL_NOTES, globalNotes);
          }
      }
test_case.class_method_signature: IOSStringsResourceTest.testParse()
test_case.full_signature: @Test public void testParse()
test_case.identifier: testParse
test_case.invocations: assertTrue exists parse getResourceStrings sort assertEquals getNotes assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParse()
focal_class.declarator: CHAR_SET = "UTF-8"
focal_class.modifier: private static final
focal_class.original_string: private static final String CHAR_SET = "UTF-8";
focal_class.type: String
focal_class.var_name: CHAR_SET
focal_class.declarator: COMMENT_BEGIN = "/*"
focal_class.modifier: private static final
focal_class.original_string: private static final String COMMENT_BEGIN = "/*";
focal_class.type: String
focal_class.var_name: COMMENT_BEGIN
focal_class.declarator: COMMENT_END = "*/"
focal_class.modifier: private static final
focal_class.original_string: private static final String COMMENT_END = "*/";
focal_class.type: String
focal_class.var_name: COMMENT_END
focal_class.file: gp-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/impl/IOSStringsResource.java
focal_class.identifier: IOSStringsResource
focal_class.class_method_signature: IOSStringsResource.parse(InputStream inStream, FilterOptions options)
focal_class.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream inStream, FilterOptions options)
focal_class.return: LanguageBundle
focal_class.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_class.class_method_signature: IOSStringsResource.write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.full_signature: @Override public void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.return: void
focal_class.signature: void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.class_method_signature: IOSStringsResource.merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.full_signature: @Override public void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.identifier: merge
focal_class.modifiers: @Override public
focal_class.parameters: (InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.return: void
focal_class.signature: void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_class.class_method_signature: IOSStringsResource.formatEntry(String key, String value, List<String> notes, BreakIterator brkItr)
focal_class.full_signature: static String formatEntry(String key, String value, List<String> notes, BreakIterator brkItr)
focal_class.identifier: formatEntry
focal_class.modifiers: static
focal_class.parameters: (String key, String value, List<String> notes, BreakIterator brkItr)
focal_class.return: String
focal_class.signature: String formatEntry(String key, String value, List<String> notes, BreakIterator brkItr)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public LanguageBundle parse(InputStream inStream, FilterOptions options)
              throws IOException, ResourceFilterException {
  
          BufferedReader reader = new BufferedReader(new InputStreamReader(inStream, CHAR_SET));
          LanguageBundleBuilder bb = new LanguageBundleBuilder(true);
          String line;
          List<String> notes = new ArrayList<>();
          Boolean commentIsGlobal = true;
          while ((line = reader.readLine()) != null) {
              if (line.trim().startsWith(COMMENT_BEGIN)) {// begins with /*
                  // skip comments until line ends with */
                  // the short circuit expression evaluation handles both
                  // single and multi lined comments
                  String comment = line.substring(line.indexOf(COMMENT_BEGIN)+2);
                  Boolean commentEndProcessed = false;
                  while (!commentEndProcessed && line != null) {
                      if (comment.trim().endsWith(COMMENT_END)) {
                          comment = comment.substring(0, comment.lastIndexOf(COMMENT_END));
                          commentEndProcessed = true;
                      }
                      notes.add(comment);
                      if (!commentEndProcessed) {
                          line = reader.readLine();
                          comment = line;
                      }
                  }
              } else if (commentIsGlobal && line.isEmpty()) {
                  commentIsGlobal = false;
                  if (!notes.isEmpty()) {
                      bb.addNotes(notes);
                      notes.clear();
                  }
              } else if (line.matches("^\\s*\".*")) { // begins with quote char
                  // new entry
                  StringBuilder entry = new StringBuilder(128);
  
                  // keep appending lines until entry termination via semi-colon
                  do {
                      entry.append(line.trim()).append(' ');
                  } while (!line.matches(".*[^\\\\];\\s*$") && (line = reader.readLine()) != null);
  
                  // split across " = "
                  String[] parts = entry.toString().split("\"\\s*=\\s*\"");
                  String key = parts[0].substring(parts[0].indexOf('"') + 1).trim();
                  String value = parts[1].substring(0, parts[1].lastIndexOf('"')).trim();
  
                  if (notes.isEmpty()) {
                      bb.addResourceString(key, value);
                  } else {
                      bb.addResourceString(ResourceString.with(key, value).notes(notes));
                      notes.clear();
                  }
              }
          }
          return bb.build();
      }
focal_method.class_method_signature: IOSStringsResource.parse(InputStream inStream, FilterOptions options)
focal_method.full_signature: @Override public LanguageBundle parse(InputStream inStream, FilterOptions options)
focal_method.identifier: parse
focal_method.invocations: readLine startsWith trim substring indexOf endsWith trim substring lastIndexOf add readLine isEmpty isEmpty addNotes clear matches append append trim matches readLine split toString trim substring indexOf trim substring lastIndexOf isEmpty addResourceString addResourceString notes with clear build
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream inStream, FilterOptions options)
focal_method.return: LanguageBundle
focal_method.signature: LanguageBundle parse(InputStream inStream, FilterOptions options)