The following document contains the results of PMD's CPD 6.13.0.

Duplications

File Line
io/wcm/handler/url/impl/modes/FullUrlForceNonSecureUrlMode.java 75
io/wcm/handler/url/impl/modes/FullUrlForceSecureUrlMode.java 76
    return config.getSiteUrl();
  }

  @SuppressWarnings("deprecation")
  @Override
  public String getResourceUrlPrefix(@NotNull Adaptable adaptable, @NotNull Set<String> runModes,
      @Nullable Page currentPage, @Nullable Resource targetResource) {

    // if integrator template mode with placeholders is active return resource url placeholder
    IntegratorHandler integratorHandler = AdaptTo.notNull(adaptable, IntegratorHandler.class);
    if (integratorHandler.isIntegratorTemplateMode()
        && integratorHandler.getIntegratorMode().isUseUrlPlaceholders()) {
      return IntegratorPlaceholder.URL_CONTENT_PROXY;
    }

    UrlConfig config = getUrlConfigForTarget(adaptable, targetResource);

    // in author mode return author site url
    if (!forcePublish && RunMode.isAuthor(runModes) && config.hasSiteUrlAuthor()) {
      return config.getSiteUrlAuthor();
    }

    // return non-secure site url
    return config.getSiteUrl();
File Line
io/wcm/handler/url/impl/modes/FullUrlForceNonSecureUrlMode.java 75
io/wcm/handler/url/impl/modes/FullUrlForceSecureUrlMode.java 76
io/wcm/handler/url/impl/modes/FullUrlProtocolRelativeUrlMode.java 85
    return config.getSiteUrl();
  }

  @SuppressWarnings("deprecation")
  @Override
  public String getResourceUrlPrefix(@NotNull Adaptable adaptable, @NotNull Set<String> runModes,
      @Nullable Page currentPage, @Nullable Resource targetResource) {

    // if integrator template mode with placeholders is active return resource url placeholder
    IntegratorHandler integratorHandler = AdaptTo.notNull(adaptable, IntegratorHandler.class);
    if (integratorHandler.isIntegratorTemplateMode()
        && integratorHandler.getIntegratorMode().isUseUrlPlaceholders()) {
      return IntegratorPlaceholder.URL_CONTENT_PROXY;
    }

    UrlConfig config = getUrlConfigForTarget(adaptable, targetResource);

    // in author mode return author site url
    if (!forcePublish && RunMode.isAuthor(runModes) && config.hasSiteUrlAuthor()) {
      return config.getSiteUrlAuthor();
    }

    // return non-secure site url
    return config.getSiteUrl();
File Line
io/wcm/handler/url/impl/modes/FullUrlForceNonSecureUrlMode.java 76
io/wcm/handler/url/impl/modes/FullUrlForceSecureUrlMode.java 77
io/wcm/handler/url/impl/modes/FullUrlProtocolRelativeUrlMode.java 86
io/wcm/handler/url/impl/modes/FullUrlUrlMode.java 90
  }

  @SuppressWarnings("deprecation")
  @Override
  public String getResourceUrlPrefix(@NotNull Adaptable adaptable, @NotNull Set<String> runModes,
      @Nullable Page currentPage, @Nullable Resource targetResource) {

    // if integrator template mode with placeholders is active return resource url placeholder
    IntegratorHandler integratorHandler = AdaptTo.notNull(adaptable, IntegratorHandler.class);
    if (integratorHandler.isIntegratorTemplateMode()
        && integratorHandler.getIntegratorMode().isUseUrlPlaceholders()) {
      return IntegratorPlaceholder.URL_CONTENT_PROXY;
    }

    UrlConfig config = getUrlConfigForTarget(adaptable, targetResource);

    // in author mode return author site url
    if (!forcePublish && RunMode.isAuthor(runModes) && config.hasSiteUrlAuthor()) {
      return config.getSiteUrlAuthor();
    }

Back to top

Version: 1.3.3-SNAPSHOT. Last Published: 2019-12-04.