Log warning in case of unparseable minimum Java version
@@ -1138,7 +1138,9 @@ public class UpdateSite {
return minimumJavaVersion != null && new VersionNumber(minimumJavaVersion).isNewerThan(
new VersionNumber(System.getProperty("java.specification.version")));
} catch (NumberFormatException nfe) {
- return false; // plugin doesn't declare a minimum Java version
+ logBadMinJavaVersion("'minimumJavaVersion' was specified for plugin ''{0}'' but unparseable (received {1})", this.name,
+ minimumJavaVersion);
+ return false; // treat this as undeclared minimum Java version
}
}
@@ -1169,8 +1171,8 @@ public class UpdateSite {
try {
versionNumber = minimumJavaVersion == null ? null : new VersionNumber(minimumJavaVersion);
} catch (NumberFormatException nfe) {
- LOGGER.log(Level.WARNING, "'minimumJavaVersion' was specified for plugin '{0}' but unparseable (received {1})",
- new String[]{this.name, minimumJavaVersion});
+ logBadMinJavaVersion("'minimumJavaVersion' was specified for plugin ''{0}'' but unparseable (received {1})", this.name,
+ minimumJavaVersion);
}
for (Plugin p: getNeededDependencies()) {
VersionNumber v = p.getNeededDependenciesMinimumJavaVersion();
@@ -1184,6 +1186,10 @@ public class UpdateSite {
return versionNumber;
}
+ private void logBadMinJavaVersion(String s, String pluginName, String minimumJavaVersion) {
+ LOGGER.log(Level.WARNING, s, new String[]{pluginName, minimumJavaVersion});
+ }
+
public boolean isNeededDependenciesForNewerJenkins() {
return isNeededDependenciesForNewerJenkins(new PluginManager.MetadataCache());
}
