Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Nov 19, 2022
1 parent 3aa95fe commit 01d2a39
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 64 deletions.
2 changes: 2 additions & 0 deletions core/src/main/java/org/kohsuke/stapler/HttpResponses.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package org.kohsuke.stapler;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
Expand Down Expand Up @@ -106,6 +107,7 @@ public static HttpResponseException error(final int code, final Throwable cause)
if (responseException == null) {
responseException = new HttpResponseException(cause) {
@Override
@SuppressFBWarnings(value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE", justification = "Jenkins handles this issue differently or doesn't care about it")
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
rsp.setStatus(code);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void reportException(Throwable e, ServletContext context, HttpServletRequest req

UncaughtExceptionHandler DEFAULT = new UncaughtExceptionHandler() {
@Override
@SuppressFBWarnings(value = "XSS_SERVLET", justification = "Covered by the escape() method.")
@SuppressFBWarnings(value = {"INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE", "XSS_SERVLET"}, justification = "Covered by the escape() method.")
public void reportException(Throwable e, ServletContext context, HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.kohsuke.stapler.StaplerResponse;

import edu.umd.cs.findbugs.annotations.Nullable;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PrintWriter;
Expand All @@ -30,6 +31,7 @@ public JsonHttpResponse(JSONObject o, int status) {
this.status = status;
}

@SuppressFBWarnings(value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE", justification = "Jenkins handles this issue differently or doesn't care about it")
public JsonHttpResponse(Throwable t, int status) {
StringWriter sw = new StringWriter();
t.printStackTrace(new PrintWriter(sw));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
package org.kohsuke.stapler.jsr269;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import javax.annotation.processing.AbstractProcessor;
import javax.lang.model.element.Element;
import javax.tools.FileObject;
Expand All @@ -38,6 +39,7 @@
* @author Kohsuke Kawaguchi
*/
abstract class AbstractProcessorImpl extends AbstractProcessor {
@SuppressFBWarnings(value = "INFORMATION_EXPOSURE_THROUGH_AN_ERROR_MESSAGE", justification = "Jenkins handles this issue differently or doesn't care about it")
protected String toString(Throwable t) {
StringWriter w = new StringWriter();
t.printStackTrace(new PrintWriter(w));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.91</version>
<version>1.92</version>
<relativePath />
</parent>
<groupId>org.kohsuke.stapler</groupId>
Expand Down
62 changes: 0 additions & 62 deletions src/spotbugs/excludesFilter.xml

This file was deleted.

0 comments on commit 01d2a39

Please sign in to comment.