test_class.declarator: INPUT_FILE = new File("src/test/resource/resfilter/properties/input.properties")
test_class.modifier: private static final
test_class.original_string: private static final File INPUT_FILE = new File("src/test/resource/resfilter/properties/input.properties");
test_class.type: File
test_class.var_name: INPUT_FILE
test_class.declarator: EXPECTED_WRITE_FILE = new File(
              "src/test/resource/resfilter/properties/write-output.properties")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE = new File(
              "src/test/resource/resfilter/properties/write-output.properties");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE
test_class.declarator: EXPECTED_WRITE_FILE_ALL = new File(
              "src/test/resource/resfilter/properties/write-output-all.properties")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_WRITE_FILE_ALL = new File(
              "src/test/resource/resfilter/properties/write-output-all.properties");
test_class.type: File
test_class.var_name: EXPECTED_WRITE_FILE_ALL
test_class.declarator: EXPECTED_MERGE_FILE = new File(
              "src/test/resource/resfilter/properties/merge-output.properties")
test_class.modifier: private static final
test_class.original_string: private static final File EXPECTED_MERGE_FILE = new File(
              "src/test/resource/resfilter/properties/merge-output.properties");
test_class.type: File
test_class.var_name: EXPECTED_MERGE_FILE
test_class.declarator: PARSE_TEST_INPUT_FILE = new File(
              "src/test/resource/resfilter/properties/parseline-test-input.properties")
test_class.modifier: private static final
test_class.original_string: private static final File PARSE_TEST_INPUT_FILE = new File(
              "src/test/resource/resfilter/properties/parseline-test-input.properties");
test_class.type: File
test_class.var_name: PARSE_TEST_INPUT_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: 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: WRITE_BUNDLE_ALL
test_class.modifier: private static
test_class.original_string: private static LanguageBundle WRITE_BUNDLE_ALL;
test_class.type: LanguageBundle
test_class.var_name: WRITE_BUNDLE_ALL
test_class.declarator: EXPECTED_PROP_DEF_LIST
test_class.modifier: private static
test_class.original_string: private static LinkedList<PropDef> EXPECTED_PROP_DEF_LIST;
test_class.type: LinkedList<PropDef>
test_class.var_name: EXPECTED_PROP_DEF_LIST
test_class.declarator: res = new JavaPropertiesResource()
test_class.modifier: private static final
test_class.original_string: private static final JavaPropertiesResource res = new JavaPropertiesResource();
test_class.type: JavaPropertiesResource
test_class.var_name: res
test_class.declarator: UNESC_TEST_CASES =
      {
          {"", ""},
          {"abc", "abc"},
          {"\\ abc\\u0020", " abc "},
          {"a\\tb\\u0009c", "a\tb\tc"},
          {"a\\=\\b", "a=b"},
          {"a\\\\b", "a\\b"},
          {"\\t\\f\\z", "\t\fz"},
          {"\\a\\b\\c", "abc"},
          {"\\u304A\\u304b", "\u304A\u304B"},
      }
test_class.modifier: private static final
test_class.original_string: private static final String[][] UNESC_TEST_CASES =
      {
          {"", ""},
          {"abc", "abc"},
          {"\\ abc\\u0020", " abc "},
          {"a\\tb\\u0009c", "a\tb\tc"},
          {"a\\=\\b", "a=b"},
          {"a\\\\b", "a\\b"},
          {"\\t\\f\\z", "\t\fz"},
          {"\\a\\b\\c", "abc"},
          {"\\u304A\\u304b", "\u304A\u304B"},
      };
test_class.type: String[][]
test_class.var_name: UNESC_TEST_CASES
test_class.declarator: MESSAGE_PATTERN_TEST_CASES = {
          // {<GP expression>,
          //     <props expression - auto>[,
          //     <props expression - all>,                    // if absent, use <prop expression - auto>
          //     <GP expression after round trip - auto>,     // if absent, use <GP expression>
          //     <GP expression after round trip - all>]}     // if absent, use <GP expression>
          { "You're about to delete {0} rows.",
              "You''re about to delete {0} rows." },
          { "You're about to delete '{0}' rows in Mike's file {0}.",
              "You''re about to delete '{0}' rows in Mike''s file {0}." },
          { "Log shows '{''}' in file {0}",
              "Log shows '{''}' in file {0}" },
          { "Log shows '{''} in file {0}",
              "Log shows '{''} in file {0}",
              "Log shows '{''} in file {0}'", // escape with MessagePatternEscape.ALL
              null,
              "Log shows '{''} in file {0}'"}, // round trip with MessagePatternEscape.ALL
          { "Log shows '{'}' in file {0}",
              "Log shows '{'}'' in file {0}" },
          { "Log shows '{'error'}' in file {0}",
              "Log shows '{'error'}' in file {0}" },
          { "Log shows '{''error''}' in file {0}",
              "Log shows '{''error''}' in file {0}" },
          { "File {0} shows '{''error''}'",
              "File {0} shows '{''error''}'" },
          { "The file isn't in use.",
              "The file isn't in use.",
              "The file isn''t in use." }, // escape with MessagePatternEscape.ALL
          { "File {0} isn't in use.",
              "File {0} isn''t in use."},
      }
test_class.modifier: private static final
test_class.original_string: private static final String[][] MESSAGE_PATTERN_TEST_CASES = {
          // {<GP expression>,
          //     <props expression - auto>[,
          //     <props expression - all>,                    // if absent, use <prop expression - auto>
          //     <GP expression after round trip - auto>,     // if absent, use <GP expression>
          //     <GP expression after round trip - all>]}     // if absent, use <GP expression>
          { "You're about to delete {0} rows.",
              "You''re about to delete {0} rows." },
          { "You're about to delete '{0}' rows in Mike's file {0}.",
              "You''re about to delete '{0}' rows in Mike''s file {0}." },
          { "Log shows '{''}' in file {0}",
              "Log shows '{''}' in file {0}" },
          { "Log shows '{''} in file {0}",
              "Log shows '{''} in file {0}",
              "Log shows '{''} in file {0}'", // escape with MessagePatternEscape.ALL
              null,
              "Log shows '{''} in file {0}'"}, // round trip with MessagePatternEscape.ALL
          { "Log shows '{'}' in file {0}",
              "Log shows '{'}'' in file {0}" },
          { "Log shows '{'error'}' in file {0}",
              "Log shows '{'error'}' in file {0}" },
          { "Log shows '{''error''}' in file {0}",
              "Log shows '{''error''}' in file {0}" },
          { "File {0} shows '{''error''}'",
              "File {0} shows '{''error''}'" },
          { "The file isn't in use.",
              "The file isn't in use.",
              "The file isn''t in use." }, // escape with MessagePatternEscape.ALL
          { "File {0} isn't in use.",
              "File {0} isn''t in use."},
      };
test_class.type: String[][]
test_class.var_name: MESSAGE_PATTERN_TEST_CASES
test_class.file: gp-res-filter/src/test/java/com/ibm/g11n/pipeline/resfilter/impl/JavaPropertiesResourceTest.java
test_class.identifier: JavaPropertiesResourceTest
test_case.body: @Test
      public void testWrite() throws IOException, ResourceFilterException {
          File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".properties");
          tempFile.deleteOnExit();
  
          try (OutputStream os = new FileOutputStream(tempFile)) {
              res.write(os, WRITE_BUNDLE, null);
              os.flush();
              // Properties.store() puts a comment with date and time
              // on the first line, ignore it by passing n=1 to compareFiles()
              assertTrue(ResourceTestUtil.compareFilesUpTo(EXPECTED_WRITE_FILE, tempFile, 5));
              assertTrue(ResourceTestUtil.compareFiles(EXPECTED_WRITE_FILE, tempFile, 6));
          }
      }
test_case.class_method_signature: JavaPropertiesResourceTest.testWrite()
test_case.full_signature: @Test public void testWrite()
test_case.identifier: testWrite
test_case.invocations: createTempFile getSimpleName getClass deleteOnExit write flush assertTrue compareFilesUpTo assertTrue compareFiles
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWrite()
focal_class.declarator: enc
focal_class.modifier: private final
focal_class.original_string: private final Encoding enc;
focal_class.type: Encoding
focal_class.var_name: enc
focal_class.declarator: msgPatEsc
focal_class.modifier: private final
focal_class.original_string: private final MessagePatternEscape msgPatEsc;
focal_class.type: MessagePatternEscape
focal_class.var_name: msgPatEsc
focal_class.declarator: BACKSLASH = '\\'
focal_class.modifier: private static final
focal_class.original_string: private static final char BACKSLASH = '\\';
focal_class.type: char
focal_class.var_name: BACKSLASH
focal_class.file: gp-res-filter/src/main/java/com/ibm/g11n/pipeline/resfilter/impl/JavaPropertiesResource.java
focal_class.identifier: JavaPropertiesResource
focal_class.class_method_signature: JavaPropertiesResource.JavaPropertiesResource(Encoding enc, MessagePatternEscape msgPatEsc)
focal_class.full_signature: public  JavaPropertiesResource(Encoding enc, MessagePatternEscape msgPatEsc)
focal_class.identifier: JavaPropertiesResource
focal_class.modifiers: public
focal_class.parameters: (Encoding enc, MessagePatternEscape msgPatEsc)
focal_class.signature:  JavaPropertiesResource(Encoding enc, MessagePatternEscape msgPatEsc)
focal_class.class_method_signature: JavaPropertiesResource.JavaPropertiesResource()
focal_class.full_signature: public  JavaPropertiesResource()
focal_class.identifier: JavaPropertiesResource
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  JavaPropertiesResource()
focal_class.class_method_signature: JavaPropertiesResource.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: JavaPropertiesResource.isContinuationLine(String s)
focal_class.full_signature: private boolean isContinuationLine(String s)
focal_class.identifier: isContinuationLine
focal_class.modifiers: private
focal_class.parameters: (String s)
focal_class.return: boolean
focal_class.signature: boolean isContinuationLine(String s)
focal_class.class_method_signature: JavaPropertiesResource.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: JavaPropertiesResource.getCharset()
focal_class.full_signature: private Charset getCharset()
focal_class.identifier: getCharset
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Charset
focal_class.signature: Charset getCharset()
focal_class.class_method_signature: JavaPropertiesResource.escape(String str, EscapeSpace escSpace, boolean isUTF8)
focal_class.full_signature: private static String escape(String str, EscapeSpace escSpace, boolean isUTF8)
focal_class.identifier: escape
focal_class.modifiers: private static
focal_class.parameters: (String str, EscapeSpace escSpace, boolean isUTF8)
focal_class.return: String
focal_class.signature: String escape(String str, EscapeSpace escSpace, boolean isUTF8)
focal_class.class_method_signature: JavaPropertiesResource.escapePropKey(String str)
focal_class.full_signature: static String escapePropKey(String str)
focal_class.identifier: escapePropKey
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String escapePropKey(String str)
focal_class.class_method_signature: JavaPropertiesResource.escapePropKey(String str, boolean isUTF8)
focal_class.full_signature: static String escapePropKey(String str, boolean isUTF8)
focal_class.identifier: escapePropKey
focal_class.modifiers: static
focal_class.parameters: (String str, boolean isUTF8)
focal_class.return: String
focal_class.signature: String escapePropKey(String str, boolean isUTF8)
focal_class.class_method_signature: JavaPropertiesResource.escapePropValue(String str)
focal_class.full_signature: static String escapePropValue(String str)
focal_class.identifier: escapePropValue
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String escapePropValue(String str)
focal_class.class_method_signature: JavaPropertiesResource.escapePropValue(String str, boolean isUTF8)
focal_class.full_signature: static String escapePropValue(String str, boolean isUTF8)
focal_class.identifier: escapePropValue
focal_class.modifiers: static
focal_class.parameters: (String str, boolean isUTF8)
focal_class.return: String
focal_class.signature: String escapePropValue(String str, boolean isUTF8)
focal_class.class_method_signature: JavaPropertiesResource.appendUnicodeEscape(StringBuilder buf, char codeUnit)
focal_class.full_signature: static void appendUnicodeEscape(StringBuilder buf, char codeUnit)
focal_class.identifier: appendUnicodeEscape
focal_class.modifiers: static
focal_class.parameters: (StringBuilder buf, char codeUnit)
focal_class.return: void
focal_class.signature: void appendUnicodeEscape(StringBuilder buf, char codeUnit)
focal_class.class_method_signature: JavaPropertiesResource.unescapePropKey(String str)
focal_class.full_signature: static String unescapePropKey(String str)
focal_class.identifier: unescapePropKey
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String unescapePropKey(String str)
focal_class.class_method_signature: JavaPropertiesResource.unescapePropValue(String str)
focal_class.full_signature: static String unescapePropValue(String str)
focal_class.identifier: unescapePropValue
focal_class.modifiers: static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String unescapePropValue(String str)
focal_class.class_method_signature: JavaPropertiesResource.unescape(String str)
focal_class.full_signature: private static String unescape(String str)
focal_class.identifier: unescape
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String unescape(String str)
focal_class.class_method_signature: JavaPropertiesResource.escapeOnlyUnicode(String str)
focal_class.full_signature: private static String escapeOnlyUnicode(String str)
focal_class.identifier: escapeOnlyUnicode
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String escapeOnlyUnicode(String str)
focal_class.class_method_signature: JavaPropertiesResource.unescapeOnlyUnicode(String str)
focal_class.full_signature: private static String unescapeOnlyUnicode(String str)
focal_class.identifier: unescapeOnlyUnicode
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String unescapeOnlyUnicode(String str)
focal_class.class_method_signature: JavaPropertiesResource.unescapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.full_signature: static String unescapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.identifier: unescapeMessagePattern
focal_class.modifiers: static
focal_class.parameters: (String inputStr, MessagePatternEscape msgPatEsc)
focal_class.return: String
focal_class.signature: String unescapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.class_method_signature: JavaPropertiesResource.escapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.full_signature: static String escapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.identifier: escapeMessagePattern
focal_class.modifiers: static
focal_class.parameters: (String inputStr, MessagePatternEscape msgPatEsc)
focal_class.return: String
focal_class.signature: String escapeMessagePattern(String inputStr, MessagePatternEscape msgPatEsc)
focal_class.class_method_signature: JavaPropertiesResource.hasArgs(MessagePattern msgPat)
focal_class.full_signature: static boolean hasArgs(MessagePattern msgPat)
focal_class.identifier: hasArgs
focal_class.modifiers: static
focal_class.parameters: (MessagePattern msgPat)
focal_class.return: boolean
focal_class.signature: boolean hasArgs(MessagePattern msgPat)
focal_class.class_method_signature: JavaPropertiesResource.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: JavaPropertiesResource.getLeadingSpacesLength(String s)
focal_class.full_signature: private static int getLeadingSpacesLength(String s)
focal_class.identifier: getLeadingSpacesLength
focal_class.modifiers: private static
focal_class.parameters: (String s)
focal_class.return: int
focal_class.signature: int getLeadingSpacesLength(String s)
focal_class.class_method_signature: JavaPropertiesResource.stripLeadingSpaces(String s)
focal_class.full_signature: private static String stripLeadingSpaces(String s)
focal_class.identifier: stripLeadingSpaces
focal_class.modifiers: private static
focal_class.parameters: (String s)
focal_class.return: String
focal_class.signature: String stripLeadingSpaces(String s)
focal_class.class_method_signature: JavaPropertiesResource.isPropsWhiteSpaceChar(char c)
focal_class.full_signature: private static boolean isPropsWhiteSpaceChar(char c)
focal_class.identifier: isPropsWhiteSpaceChar
focal_class.modifiers: private static
focal_class.parameters: (char c)
focal_class.return: boolean
focal_class.signature: boolean isPropsWhiteSpaceChar(char c)
focal_class.superclass: extends ResourceFilter
focal_method.body: @Override
      public void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options) throws IOException, ResourceFilterException {
  
          List<ResourceString> resStrings = languageBundle.getSortedResourceStrings();
          BreakIterator brkItr = Utils.getWordBreakIterator(options);
  
          PrintWriter pw = new PrintWriter(new OutputStreamWriter(outStream, getCharset()));
          for (String note : languageBundle.getNotes()) {
              if (enc == Encoding.UTF_8) {
                  // No needs to escape raw Unicode charters
                  pw.println("#" + note);
              } else {
                  // Needs to escape Unicode characters
                  pw.println("#" + escapeOnlyUnicode(note));
              }
          }
          if (!languageBundle.getNotes().isEmpty()) {
              pw.println();
          }
          pw.println("#"+new Date().toString());
          for (ResourceString res : resStrings) {
              String value = res.getValue();  
              value = escapeMessagePattern(value, msgPatEsc);
              PropDef pd = new PropDef(res.getKey(),value,PropDef.PropSeparator.EQUAL,res.getNotes());
              pd.print(pw, brkItr, (enc == Encoding.UTF_8));
          }
          pw.close();
      }
focal_method.class_method_signature: JavaPropertiesResource.write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.full_signature: @Override public void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.identifier: write
focal_method.invocations: getSortedResourceStrings getWordBreakIterator getCharset getNotes println println escapeOnlyUnicode isEmpty getNotes println println toString getValue escapeMessagePattern getKey getNotes print close
focal_method.modifiers: @Override public
focal_method.parameters: (OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)
focal_method.return: void
focal_method.signature: void write(OutputStream outStream, LanguageBundle languageBundle,
              FilterOptions options)