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 testMerge() throws IOException, ResourceFilterException {
          File tempFile;
  
          tempFile = File.createTempFile(this.getClass().getSimpleName(), ".strings");
          tempFile.deleteOnExit();
  
          try (OutputStream os = new FileOutputStream(tempFile);
                  InputStream is = new FileInputStream(MERGE_INPUT_1_FILE)) {
              res.merge(is, os, MERGE_BUNDLE, new FilterOptions(Locale.ENGLISH));
              os.flush();
              assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_1_FILE, tempFile));
          }
  
          tempFile = File.createTempFile(this.getClass().getSimpleName(), ".strings");
          tempFile.deleteOnExit();
  
          try (OutputStream os = new FileOutputStream(tempFile);
                  InputStream is = new FileInputStream(MERGE_INPUT_2_FILE)) {
              res.merge(is, os, MERGE_BUNDLE, new FilterOptions(Locale.JAPANESE));
              os.flush();
              assertTrue(ResourceTestUtil.compareFiles(EXPECTED_MERGE_2_FILE, tempFile));
          }
      }
test_case.class_method_signature: IOSStringsResourceTest.testMerge()
test_case.full_signature: @Test public void testMerge()
test_case.identifier: testMerge
test_case.invocations: createTempFile getSimpleName getClass deleteOnExit merge flush assertTrue compareFiles createTempFile getSimpleName getClass deleteOnExit merge flush assertTrue compareFiles
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMerge()
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 void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options) throws IOException, ResourceFilterException {
          // put res data into a map for easier searching
          Map<String, ResourceString> resMap = Utils.createResourceStringMap(languageBundle.getResourceStrings());
  
          BufferedReader reader = new BufferedReader(new InputStreamReader(baseStream, CHAR_SET));
          BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outStream, CHAR_SET));
  
          BreakIterator brkItr = Utils.getWordBreakIterator(options);
  
          String line;
          while ((line = reader.readLine()) != null) {
              if (line.matches("^\\s*\".*")) { // begins with quote char
                  // new entry
                  StringBuilder entry = new StringBuilder(128);
                  List<String> rawLines = new LinkedList<String>();
  
                  // keep appending lines until entry termination via semi-colon
                  // also keep a list of lines read so they can be written back
                  // if the key is not found
                  do {
                      entry.append(line.trim()).append(' ');
                      rawLines.add(line);
                  } 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();
  
                  if (!resMap.containsKey(key)) {
                      for (String rawLine : rawLines) {
                          writer.write(rawLine);
                      }
                      writer.newLine();
                      continue;
                  }
  
                  writer.write(formatEntry(key, resMap.get(key).getValue(), resMap.get(key).getNotes(), brkItr));
              } else {
                  writer.write(line);
                  writer.newLine();
              }
          }
  
          writer.flush();
      }
focal_method.class_method_signature: IOSStringsResource.merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.full_signature: @Override public void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.identifier: merge
focal_method.invocations: createResourceStringMap getResourceStrings getWordBreakIterator readLine matches append append trim add matches readLine split toString trim substring indexOf containsKey write newLine write formatEntry getValue get getNotes get write newLine flush
focal_method.modifiers: @Override public
focal_method.parameters: (InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.return: void
focal_method.signature: void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)