test_class.declarator: RAND = new Random()
test_class.modifier: private static final
test_class.original_string: private static final Random RAND = new Random();
test_class.type: Random
test_class.var_name: RAND
test_class.declarator: COMPRESSIBLE_MIME_TYPE = "text/plain"
test_class.modifier: private static final
test_class.original_string: private static final String COMPRESSIBLE_MIME_TYPE = "text/plain";
test_class.type: String
test_class.var_name: COMPRESSIBLE_MIME_TYPE
test_class.declarator: INCOMPRESSIBLE_MIME_TYPE = "image/png"
test_class.modifier: private static final
test_class.original_string: private static final String INCOMPRESSIBLE_MIME_TYPE = "image/png";
test_class.type: String
test_class.var_name: INCOMPRESSIBLE_MIME_TYPE
test_class.declarator: UNKNOWN_MIME_TYPE = "unkown/unknown"
test_class.modifier: private static final
test_class.original_string: private static final String UNKNOWN_MIME_TYPE = "unkown/unknown";
test_class.type: String
test_class.var_name: UNKNOWN_MIME_TYPE
test_class.file: vault-core/src/test/java/org/apache/jackrabbit/vault/fs/impl/io/CompressionUtilTest.java
test_class.identifier: CompressionUtilTest
test_case.body: @Test
      @Ignore("Because it does not always succeed due to usage of random bytes")
      public void testCompressibilityEstimation()
              throws IOException, RepositoryException {
          assertTrue(seemsCompressible(newArtifact(incompressibleData(50*1024), null)) < 0);
          assertTrue(seemsCompressible(newArtifact(compressibleData(50*1024), null)) > 0);
      }
test_case.class_method_signature: CompressionUtilTest.testCompressibilityEstimation()
test_case.full_signature: @Test @Ignore("Because it does not always succeed due to usage of random bytes") public void testCompressibilityEstimation()
test_case.identifier: testCompressibilityEstimation
test_case.invocations: assertTrue seemsCompressible newArtifact incompressibleData assertTrue seemsCompressible newArtifact compressibleData
test_case.modifiers: @Test @Ignore("Because it does not always succeed due to usage of random bytes") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCompressibilityEstimation()
focal_class.declarator: log = LoggerFactory.getLogger(CompressionUtil.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(CompressionUtil.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: ENV_SUPPORTS_COMPRESSION_LEVEL_CHANGE = checkEnvironmentSupportsCompressionSwitch()
focal_class.modifier: public static final
focal_class.original_string: public static final boolean ENV_SUPPORTS_COMPRESSION_LEVEL_CHANGE = checkEnvironmentSupportsCompressionSwitch();
focal_class.type: boolean
focal_class.var_name: ENV_SUPPORTS_COMPRESSION_LEVEL_CHANGE
focal_class.declarator: MIN_AUTO_DETECTION_LENGTH = 115 * 1024
focal_class.modifier: private static final
focal_class.original_string: private static final long MIN_AUTO_DETECTION_LENGTH = 115 * 1024;
focal_class.type: long
focal_class.var_name: MIN_AUTO_DETECTION_LENGTH
focal_class.declarator: SAMPLE_LENGTH = 256
focal_class.modifier: private static final
focal_class.original_string: private static final int SAMPLE_LENGTH = 256;
focal_class.type: int
focal_class.var_name: SAMPLE_LENGTH
focal_class.declarator: INCOMPRESSIBLE_MIME_TYPES = new HashSet<String>(Arrays.asList(
              "image/gif",
              "image/jpeg",
              "image/png",
              "multipart/x-gzip",
              "video/mp4",
              "application/gzip",
              "application/java-archive",
              "application/mp4",
              "application/x-7z-compressed",
              "application/x-compressed",
              "application/x-gzip",
              "application/x-rar-compressed",
              "application/zip",
              "application/zlib",
              "audio/mpeg"
      ))
focal_class.modifier: private static final
focal_class.original_string: private static final Set<String> INCOMPRESSIBLE_MIME_TYPES = new HashSet<String>(Arrays.asList(
              "image/gif",
              "image/jpeg",
              "image/png",
              "multipart/x-gzip",
              "video/mp4",
              "application/gzip",
              "application/java-archive",
              "application/mp4",
              "application/x-7z-compressed",
              "application/x-compressed",
              "application/x-gzip",
              "application/x-rar-compressed",
              "application/zip",
              "application/zlib",
              "audio/mpeg"
      ));
focal_class.type: Set<String>
focal_class.var_name: INCOMPRESSIBLE_MIME_TYPES
focal_class.declarator: COMPRESSIBLE_MIME_TYPES = new HashSet<String>(Arrays.asList(
              "application/xml",
              "application/java",
              "application/json",
              "application/javascript",
              "application/ecmascript"
      ))
focal_class.modifier: private static final
focal_class.original_string: private static final Set<String> COMPRESSIBLE_MIME_TYPES = new HashSet<String>(Arrays.asList(
              "application/xml",
              "application/java",
              "application/json",
              "application/javascript",
              "application/ecmascript"
      ));
focal_class.type: Set<String>
focal_class.var_name: COMPRESSIBLE_MIME_TYPES
focal_class.file: vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/CompressionUtil.java
focal_class.identifier: CompressionUtil
focal_class.class_method_signature: CompressionUtil.isCompressible(@NotNull Artifact artifact)
focal_class.full_signature: public static int isCompressible(@NotNull Artifact artifact)
focal_class.identifier: isCompressible
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Artifact artifact)
focal_class.return: int
focal_class.signature: int isCompressible(@NotNull Artifact artifact)
focal_class.class_method_signature: CompressionUtil.isCompressibleContentType(@NotNull String mimeType)
focal_class.full_signature: static boolean isCompressibleContentType(@NotNull String mimeType)
focal_class.identifier: isCompressibleContentType
focal_class.modifiers: static
focal_class.parameters: (@NotNull String mimeType)
focal_class.return: boolean
focal_class.signature: boolean isCompressibleContentType(@NotNull String mimeType)
focal_class.class_method_signature: CompressionUtil.isIncompressibleContentType(@NotNull String mimeType)
focal_class.full_signature: static boolean isIncompressibleContentType(@NotNull String mimeType)
focal_class.identifier: isIncompressibleContentType
focal_class.modifiers: static
focal_class.parameters: (@NotNull String mimeType)
focal_class.return: boolean
focal_class.signature: boolean isIncompressibleContentType(@NotNull String mimeType)
focal_class.class_method_signature: CompressionUtil.seemsCompressible(@NotNull Artifact artifact)
focal_class.full_signature: static int seemsCompressible(@NotNull Artifact artifact)
focal_class.identifier: seemsCompressible
focal_class.modifiers: static
focal_class.parameters: (@NotNull Artifact artifact)
focal_class.return: int
focal_class.signature: int seemsCompressible(@NotNull Artifact artifact)
focal_class.class_method_signature: CompressionUtil.isCompressible(byte[] data, int len)
focal_class.full_signature: private static boolean isCompressible(byte[] data, int len)
focal_class.identifier: isCompressible
focal_class.modifiers: private static
focal_class.parameters: (byte[] data, int len)
focal_class.return: boolean
focal_class.signature: boolean isCompressible(byte[] data, int len)
focal_class.class_method_signature: CompressionUtil.checkEnvironmentSupportsCompressionSwitch()
focal_class.full_signature: private static boolean checkEnvironmentSupportsCompressionSwitch()
focal_class.identifier: checkEnvironmentSupportsCompressionSwitch
focal_class.modifiers: private static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean checkEnvironmentSupportsCompressionSwitch()
focal_method.body: static int seemsCompressible(@NotNull Artifact artifact) {
          try (InputStream stream = artifact.getInputStream()) {
              byte[] sample = IOUtils.toByteArray(stream, SAMPLE_LENGTH);
              return isCompressible(sample, SAMPLE_LENGTH) ? 1 : -1;
          } catch (RepositoryException | IOException e) {
              log.warn(e.getMessage(), e);
          }
          return 0;
      }
focal_method.class_method_signature: CompressionUtil.seemsCompressible(@NotNull Artifact artifact)
focal_method.full_signature: static int seemsCompressible(@NotNull Artifact artifact)
focal_method.identifier: seemsCompressible
focal_method.invocations: getInputStream toByteArray isCompressible warn getMessage
focal_method.modifiers: static
focal_method.parameters: (@NotNull Artifact artifact)
focal_method.return: int
focal_method.signature: int seemsCompressible(@NotNull Artifact artifact)