Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8350964

Add an ArtifactResolver.fetch(clazz) method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • security-libs
    • None
    • b15

      There are 3 places in test with similar code

          private static Path fetch????(Class<?> clazz) {
              try {
                  return ArtifactResolver.resolve(clazz).entrySet().stream()
                          .findAny().get().getValue();
              } catch (ArtifactResolverException e) {
                  Throwable cause = e.getCause();
                  if (cause == null) {
                      throw new SkippedException("Cannot resolve artifact, "
                              + "please check if JIB jar is present in classpath.", e);
                  }

                  throw new SkippedException("Fetch artifact failed: " + clazz, e);
              }
          }

      It can be combined into one utility method.

            mdonovan Matthew Donovan
            weijun Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: