Repository: jenkinsci/jenkins
File: core/src/main/java/hudson/model/UpdateSite.java (Java)

Code before:
    }

    public FormValidation doVerifySignature() throws IOException {
        return verifySignatureInternal(getJSONObject());
    }

    /**
     * Extension point to allow implementations of {@link UpdateSite} to create a custom
     * {@link UpdateCenter.InstallationJob}.
     *
     * @param plugin      the plugin to create the {@link UpdateCenter.InstallationJob} for.
     * @param uc          the {@link UpdateCenter}.
     * @param dynamicLoad {@code true} if the plugin should be attempted to be dynamically loaded.
     * @return the {@link UpdateCenter.InstallationJob}.
     * @since 2.9
     */
    protected UpdateCenter.InstallationJob createInstallationJob(Plugin plugin, UpdateCenter uc, boolean dynamicLoad) {
        return uc.new InstallationJob(plugin, this, Jenkins.getAuthentication2(), dynamicLoad);
    }

    /**
     * Verifies the signature in the update center data file.
     */
    @Restricted(NoExternalUse.class)
    public final FormValidation verifySignatureInternal(JSONObject o) throws IOException {
        FormValidation result = getJsonSignatureValidator().verifySignature(o);

        if (result.kind == FormValidation.Kind.ERROR) {
            String message = result.getMessage();
            if (message != null) {
//                String siteUrl = getUrl();
                String updatedMessage;

                if (message.contains("update site") && message.contains(" Path") && !message.contains(url)) {
                    // Ensure the update site URL is included in error messages by replacing the site identifier in messages of the 'update site … Path' pattern or appending it otherwise.
                    updatedMessage = message.replaceAll(
                            "(update site\\s+).*?(\\s+Path)",
                            "$1" + url + "$2"
                    );
                } else {
                    // Do not alter message structure; only add URL context
                    updatedMessage = message + " (URL: " + url + ")";
                }
                return FormValidation.error(updatedMessage);
            }
        }

        return result;
    }

    /**

Review comment (suggestion):
Since you're changing this line anyway, it would be nice to use the non-deprecated method instead of continuing to use the deprecated method.  This proposed change is optional, since it does not alter the correctness of the change.
```suggestion
        FormValidation result = getJsonSignatureValidator(null).verifySignature(o);
```

Code after:
    }

    public FormValidation doVerifySignature() throws IOException {
        return verifySignatureInternal(getJSONObject());
    }

    /**
     * Extension point to allow implementations of {@link UpdateSite} to create a custom
     * {@link UpdateCenter.InstallationJob}.
     *
     * @param plugin      the plugin to create the {@link UpdateCenter.InstallationJob} for.
     * @param uc          the {@link UpdateCenter}.
     * @param dynamicLoad {@code true} if the plugin should be attempted to be dynamically loaded.
     * @return the {@link UpdateCenter.InstallationJob}.
     * @since 2.9
     */
    protected UpdateCenter.InstallationJob createInstallationJob(Plugin plugin, UpdateCenter uc, boolean dynamicLoad) {
        return uc.new InstallationJob(plugin, this, Jenkins.getAuthentication2(), dynamicLoad);
    }

    /**
     * Verifies the signature in the update center data file.
     */
    @Restricted(NoExternalUse.class)
    public final FormValidation verifySignatureInternal(JSONObject o) throws IOException {
        FormValidation result = getJsonSignatureValidator(null).verifySignature(o);

        if (result.kind == FormValidation.Kind.ERROR) {
            String message = result.getMessage();
            if (message != null) {
//                String siteUrl = getUrl();
                String updatedMessage;

                if (message.contains("update site") && message.contains(" Path") && !message.contains(url)) {
                    // Ensure the update site URL is included in error messages by replacing the site identifier in messages of the 'update site … Path' pattern or appending it otherwise.
                    updatedMessage = message.replaceAll(
                            "(update site\\s+).*?(\\s+Path)",
                            "$1" + url + "$2"
                    );
                } else {
                    // Do not alter message structure; only add URL context
                    updatedMessage = message + " (URL: " + url + ")";
                }
                return FormValidation.error(updatedMessage);
            }
        }

        return result;
    }

    /**