未验证 提交 befe5fcc 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #4131 from StefanSpieker/JENKINS-36720

JENKINS-36720: Fixed some spotbugs findings 
......@@ -88,8 +88,8 @@ public class ExtensionComponent<T> implements Comparable<ExtensionComponent<T>>
public int compareTo(ExtensionComponent<T> that) {
double a = this.ordinal();
double b = that.ordinal();
if (a>b) return -1;
if (a<b) return 1;
if (Double.compare(a, b) > 0) return -1;
if (Double.compare(a, b) < 0) return 1;
// make the order bit more deterministic among extensions of the same ordinal
if (this.instance instanceof Descriptor && that.instance instanceof Descriptor) {
......
package hudson.cli;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Extension;
import hudson.model.Job;
import hudson.model.Run;
......@@ -9,6 +10,9 @@ import java.io.Serializable;
import org.apache.commons.io.IOUtils;
import org.kohsuke.args4j.Argument;
// TODO: Remove Serializable
@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "The Serializable should be removed.")
@Extension
public class SetBuildDescriptionCommand extends CLICommand implements Serializable {
......
......@@ -67,6 +67,7 @@ import org.kohsuke.stapler.StaplerResponse;
public class FileParameterValue extends ParameterValue {
private static final String FOLDER_NAME = "fileParameters";
private static final Pattern PROHIBITED_DOUBLE_DOT = Pattern.compile(".*[\\\\/]\\.\\.[\\\\/].*");
private static final long serialVersionUID = -143427023159076073L;
/**
* Escape hatch for SECURITY-1074, fileParameter used to escape their expected folder.
......
......@@ -63,6 +63,8 @@ public class HealthReport implements Serializable, Comparable<HealthReport> {
private static final String HEALTH_UNKNOWN_IMG = "empty.png";
private static final Map<String, String> iconIMGToClassMap = new HashMap<>();
private static final long serialVersionUID = 7451361788415642230L;
static {
iconIMGToClassMap.put(HEALTH_OVER_80_IMG, HEALTH_OVER_80);
iconIMGToClassMap.put(HEALTH_61_TO_80_IMG, HEALTH_61_TO_80);
......
......@@ -64,6 +64,7 @@ public final class JDK extends ToolInstallation implements NodeSpecific<JDK>, En
* @since 1.577
*/
public static final String DEFAULT_NAME = "(System)";
private static final long serialVersionUID = -3318291200160313357L;
@Restricted(NoExternalUse.class)
public static boolean isDefaultName(String name) {
......
......@@ -105,16 +105,16 @@ public class HudsonAuthenticationEntryPoint extends AuthenticationProcessingFilt
"<meta http-equiv='refresh' content='1;url=%1$s'/>" +
"<script>window.location.replace('%1$s');</script>" +
"</head>" +
"<body style='background-color:white; color:white;'>\n" +
"\n\n"+
"Authentication required\n"+
"<!--\n",loginForm);
"<body style='background-color:white; color:white;'>%n" +
"%n%n"+
"Authentication required%n"+
"<!--%n",loginForm);
if (cause!=null)
cause.report(out);
out.printf(
"-->\n\n"+
"-->%n%n"+
"</body></html>");
// Turn Off "Show Friendly HTTP Error Messages" Feature on the Server Side.
// See http://support.microsoft.com/kb/294807
......
package hudson.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
......@@ -58,7 +59,9 @@ public class TaskActionTest {
Thread.sleep(10);
}
ByteArrayOutputStream os = new ByteArrayOutputStream();
annotatedText.writeLogTo(0, os);
final long length = annotatedText.writeLogTo(0, os);
// Windows based systems will be 220, linux base 219
assertTrue("length should be longer or even 219", length >= 219);
assertTrue(os.toString("UTF-8").startsWith("a linkCompleted"));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册