test_class.declarator: dir
test_class.modifier: private
test_class.original_string: private File dir;
test_class.type: File
test_class.var_name: dir
test_class.declarator: docViewFile
test_class.modifier: private
test_class.original_string: private File docViewFile;
test_class.type: File
test_class.var_name: docViewFile
test_class.file: vault-core/src/test/java/org/apache/jackrabbit/vault/fs/io/DocViewFormatTest.java
test_class.identifier: DocViewFormatTest
test_case.body: @Test
      public void testFormatting() throws IOException {
          List<Pattern> patterns = Collections.singletonList(Pattern.compile(".+\\.xml"));
          DocViewFormat format = new DocViewFormat();
          assertFalse("malformed.xml is expected to be malformed", format.format(dir, patterns, false).isEmpty());
          try (InputStream input = this.getClass().getResourceAsStream("DocViewFormat/formatted.xml")) {
              final String expected = IOUtils.toString(input, StandardCharsets.UTF_8);
              final String result = FileUtils.readFileToString(docViewFile, StandardCharsets.UTF_8);
              assertEquals(expected, result);
          }
          assertTrue("malformed.xml is expected to be formatted", format.format(dir, patterns, true).isEmpty());
      }
test_case.class_method_signature: DocViewFormatTest.testFormatting()
test_case.full_signature: @Test public void testFormatting()
test_case.identifier: testFormatting
test_case.invocations: singletonList compile assertFalse isEmpty format getResourceAsStream getClass toString readFileToString assertEquals assertTrue isEmpty format
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFormatting()
focal_class.declarator: format
focal_class.modifier: private final
focal_class.original_string: private final OutputFormat format;
focal_class.type: OutputFormat
focal_class.var_name: format
focal_class.declarator: formattingBuffer
focal_class.modifier: private
focal_class.original_string: private WeakReference<ByteArrayOutputStream> formattingBuffer;
focal_class.type: WeakReference<ByteArrayOutputStream>
focal_class.var_name: formattingBuffer
focal_class.file: vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/DocViewFormat.java
focal_class.identifier: DocViewFormat
focal_class.class_method_signature: DocViewFormat.DocViewFormat()
focal_class.full_signature: public  DocViewFormat()
focal_class.identifier: DocViewFormat
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  DocViewFormat()
focal_class.class_method_signature: DocViewFormat.getXmlOutputFormat()
focal_class.full_signature: public OutputFormat getXmlOutputFormat()
focal_class.identifier: getXmlOutputFormat
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: OutputFormat
focal_class.signature: OutputFormat getXmlOutputFormat()
focal_class.class_method_signature: DocViewFormat.format(File file, boolean dryRun)
focal_class.full_signature: public boolean format(File file, boolean dryRun)
focal_class.identifier: format
focal_class.modifiers: public
focal_class.parameters: (File file, boolean dryRun)
focal_class.return: boolean
focal_class.signature: boolean format(File file, boolean dryRun)
focal_class.class_method_signature: DocViewFormat.format(File directory, List<Pattern> filenamePatterns, final boolean dryRun)
focal_class.full_signature: public List<String> format(File directory, List<Pattern> filenamePatterns, final boolean dryRun)
focal_class.identifier: format
focal_class.modifiers: public
focal_class.parameters: (File directory, List<Pattern> filenamePatterns, final boolean dryRun)
focal_class.return: List<String>
focal_class.signature: List<String> format(File directory, List<Pattern> filenamePatterns, final boolean dryRun)
focal_class.class_method_signature: DocViewFormat.format(File file, Checksum original, Checksum formatted)
focal_class.full_signature: private byte[] format(File file, Checksum original, Checksum formatted)
focal_class.identifier: format
focal_class.modifiers: private
focal_class.parameters: (File file, Checksum original, Checksum formatted)
focal_class.return: byte[]
focal_class.signature: byte[] format(File file, Checksum original, Checksum formatted)
focal_method.body: public boolean format(File file, boolean dryRun) throws IOException {
          CRC32 originalCrc32 = new CRC32();
          CRC32 formattedCrc32 = new CRC32();
          byte[] formatted = format(file, originalCrc32, formattedCrc32);
  
          final boolean changed = originalCrc32.getValue() != formattedCrc32.getValue();
          if (changed && !dryRun) {
              try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file))) {
                  IOUtils.copy(new ByteArrayInputStream(formatted), out);
              }
          }
          return changed;
      }
focal_method.class_method_signature: DocViewFormat.format(File file, boolean dryRun)
focal_method.full_signature: public boolean format(File file, boolean dryRun)
focal_method.identifier: format
focal_method.invocations: format getValue getValue copy
focal_method.modifiers: public
focal_method.parameters: (File file, boolean dryRun)
focal_method.return: boolean
focal_method.signature: boolean format(File file, boolean dryRun)