"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/hudson/Util.java" between
jenkins-jenkins-2.280.tar.gz and jenkins-jenkins-2.281.tar.gz

About: Jenkins is a automation server (written in Java) which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software (for e.g. as Continuous Integration and Continuous Delivery server). Weekly release.

Util.java  (jenkins-jenkins-2.280):Util.java  (jenkins-jenkins-2.281)
skipping to change at line 1473 skipping to change at line 1473
* *
* @param supplier The supplier to call if the method is indeed overridden . * @param supplier The supplier to call if the method is indeed overridden .
* @param base The base type. * @param base The base type.
* @param derived The derived type. * @param derived The derived type.
* @param methodName The name of the method. * @param methodName The name of the method.
* @param types The types of the arguments for the method. * @param types The types of the arguments for the method.
* @return {@code true} when {@code derived} provides the specified method o ther than as inherited from {@code base}. * @return {@code true} when {@code derived} provides the specified method o ther than as inherited from {@code base}.
* @throws IllegalArgumentException When {@code derived} does not derive fro m {@code base}, or when {@code base} * @throws IllegalArgumentException When {@code derived} does not derive fro m {@code base}, or when {@code base}
* does not contain the specified method. * does not contain the specified method.
* @throws AbstractMethodError If the derived class doesn't override the giv en method. * @throws AbstractMethodError If the derived class doesn't override the giv en method.
* @since TODO * @since 2.259
*/ */
public static <T> T ifOverridden(Supplier<T> supplier, @NonNull Class<?> bas e, @NonNull Class<?> derived, @NonNull String methodName, @NonNull Class<?>... t ypes) { public static <T> T ifOverridden(Supplier<T> supplier, @NonNull Class<?> bas e, @NonNull Class<?> derived, @NonNull String methodName, @NonNull Class<?>... t ypes) {
if (isOverridden(base, derived, methodName, types)) { if (isOverridden(base, derived, methodName, types)) {
return supplier.get(); return supplier.get();
} else { } else {
throw new AbstractMethodError("The class " + derived.getName() + " m ust override at least one of the " throw new AbstractMethodError("The class " + derived.getName() + " m ust override at least one of the "
+ base.getSimpleName() + "." + methodName + " methods"); + base.getSimpleName() + "." + methodName + " methods");
} }
} }
skipping to change at line 1563 skipping to change at line 1563
/** /**
* Return true if the systemId denotes an absolute URI . * Return true if the systemId denotes an absolute URI .
* *
* The same algorithm can be seen in {@link URI}, but * The same algorithm can be seen in {@link URI}, but
* implementing this by ourselves allow it to be more lenient about * implementing this by ourselves allow it to be more lenient about
* escaping of URI. * escaping of URI.
* *
* @deprecated Use {@code isAbsoluteOrSchemeRelativeUri} instead if your goa l is to prevent open redirects * @deprecated Use {@code isAbsoluteOrSchemeRelativeUri} instead if your goa l is to prevent open redirects
*/ */
@Deprecated @Deprecated
@RestrictedSince("1.651.2 / 2.TODO") @RestrictedSince("1.651.2 / 2.3")
@Restricted(NoExternalUse.class) @Restricted(NoExternalUse.class)
public static boolean isAbsoluteUri(@NonNull String uri) { public static boolean isAbsoluteUri(@NonNull String uri) {
int idx = uri.indexOf(':'); int idx = uri.indexOf(':');
if (idx<0) return false; // no ':'. can't be absolute if (idx<0) return false; // no ':'. can't be absolute
// #, ?, and / must not be before ':' // #, ?, and / must not be before ':'
return idx<_indexOf(uri, '#') && idx<_indexOf(uri,'?') && idx<_indexOf(u ri,'/'); return idx<_indexOf(uri, '#') && idx<_indexOf(uri,'?') && idx<_indexOf(u ri,'/');
} }
/** /**
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)