Repository: GoogleContainerTools/jib
File: jib-cli/src/main/java/com/google/cloud/tools/jib/cli/jar/JarProcessor.java (Java)

Code before:
      Predicate<String> isNotSnapshotDependency = isSnapshotDependency.negate();
      List<String> allDependencies = Splitter.onPattern("\\s+").splitToList(classPath.trim());
      List<Path> nonSnapshotDependencies =
          allDependencies
              .stream()
              .filter(isNotSnapshotDependency)
              .map(Paths::get)
              .collect(Collectors.toList());
      List<Path> snapshotDependencies =
          allDependencies
              .stream()
              .filter(isSnapshotDependency)
              .map(Paths::get)
              .collect(Collectors.toList());
      if (!nonSnapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder nonSnapshotDependenciesLayerBuilder =
            FileEntriesLayer.builder().setName("nonSnapshotDependencies");
        nonSnapshotDependencies.forEach(
            path ->
                nonSnapshotDependenciesLayerBuilder.addEntry(
                    path, APP_ROOT.resolve(RelativeUnixPath.get("dependencies")).resolve(path)));
        layers.add(nonSnapshotDependenciesLayerBuilder.build());
      }
      if (!snapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder snapshotDependenciesLayerBuilder =
            FileEntriesLayer.builder().setName("snapshotDependencies");
        snapshotDependencies.forEach(
            path ->
                snapshotDependenciesLayerBuilder.addEntry(
                    path, APP_ROOT.resolve(RelativeUnixPath.get("dependencies")).resolve(path)));
        layers.add(snapshotDependenciesLayerBuilder.build());
      }
    }

    Predicate<Path> isClassFile = path -> path.getFileName().toString().endsWith(".class");
    Predicate<Path> isResourceFile = isClassFile.negate();

    // Determine class and resource files in the directory containing jar contents and create
    // FileEntriesLayer for each type of layer (classes or resources), while maintaining the
    // file's original project structure.
    FileEntriesLayer classesLayer =
        addDirectoryContentsToLayer(
            "classes",
            localExplodedJarRoot,
            isClassFile,
            APP_ROOT.resolve(RelativeUnixPath.get("explodedJar")));
    FileEntriesLayer resourcesLayer =
        addDirectoryContentsToLayer(
            "resources",
            localExplodedJarRoot,
            isResourceFile,

Review comment (suggestion):
Likewise,
```suggestion
            FileEntriesLayer.builder().setName("snapshot dependencies");
```

Code after:
      List<String> allDependencies = Splitter.onPattern("\\s+").splitToList(classPath.trim());
      List<Path> nonSnapshotDependencies =
          allDependencies
              .stream()
              .filter(isSnapshot.negate())
              .map(Paths::get)
              .collect(Collectors.toList());
      List<Path> snapshotDependencies =
          allDependencies.stream().filter(isSnapshot).map(Paths::get).collect(Collectors.toList());
      if (!nonSnapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder nonSnapshotDependenciesLayerBuilder =
            FileEntriesLayer.builder().setName("dependencies");
        nonSnapshotDependencies.forEach(
            path ->
                nonSnapshotDependenciesLayerBuilder.addEntry(
                    path, APP_ROOT.resolve(RelativeUnixPath.get("dependencies")).resolve(path)));
        layers.add(nonSnapshotDependenciesLayerBuilder.build());
      }
      if (!snapshotDependencies.isEmpty()) {
        FileEntriesLayer.Builder snapshotDependenciesLayerBuilder =
            FileEntriesLayer.builder().setName("snapshot dependencies");
        snapshotDependencies.forEach(
            path ->
                snapshotDependenciesLayerBuilder.addEntry(
                    path, APP_ROOT.resolve(RelativeUnixPath.get("dependencies")).resolve(path)));
        layers.add(snapshotDependenciesLayerBuilder.build());
      }
    }

    Predicate<Path> isClassFile = path -> path.getFileName().toString().endsWith(".class");
    Predicate<Path> isResourceFile = isClassFile.negate();

    // Determine class and resource files in the directory containing jar contents and create
    // FileEntriesLayer for each type of layer (classes or resources), while maintaining the
    // file's original project structure.
    FileEntriesLayer classesLayer =
        addDirectoryContentsToLayer(
            "classes",
            localExplodedJarRoot,
            isClassFile,
            APP_ROOT.resolve(RelativeUnixPath.get("explodedJar")));
    FileEntriesLayer resourcesLayer =
        addDirectoryContentsToLayer(
            "resources",
            localExplodedJarRoot,
            isResourceFile,
            APP_ROOT.resolve(RelativeUnixPath.get("explodedJar")));

    layers.add(resourcesLayer);
    layers.add(classesLayer);
    return layers;