提交 354a0549 编写于 作者: J Jeff Thompson

Don't use public static boolean property.

上级 b848f853
......@@ -39,7 +39,7 @@ THE SOFTWARE.
<properties>
<staplerFork>true</staplerFork>
<stapler.version>1.259-rc1393.7b6d39453a92</stapler.version>
<stapler.version>1.259-rc1394.3f695d5ed2a7</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>2.4.12</groovy.version>
</properties>
......
......@@ -5133,10 +5133,10 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
}
}
@Restricted(Beta.class)
@Restricted(NoExternalUse.class)
public boolean shouldShowStackTrace() {
// Used by oops.jelly
return SHOW_STACK_TRACE;
return Boolean.getBoolean(Jenkins.class.getName() + ".SHOW_STACK_TRACE");
}
/**
......@@ -5226,9 +5226,6 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
static final String WORKSPACES_DIR_PROP = Jenkins.class.getName() + ".workspacesDir";
@Restricted(Beta.class)
public static boolean SHOW_STACK_TRACE = Boolean.getBoolean(Jenkins.class.getName() + ".SHOW_STACK_TRACE");
/**
* Automatically try to launch an agent when Jenkins is initialized or a new agent computer is created.
*/
......
......@@ -50,8 +50,8 @@ public class StackTraceSuppressionTest {
@Before
public void setup() {
Jenkins.SHOW_STACK_TRACE = false;
HttpResponses.SHOW_STACK_TRACE = false;
System.setProperty("jenkins.model.Jenkins.SHOW_STACK_TRACE", "false");
System.setProperty("org.kohsuke.stapler.HttpResponses.SHOW_STACK_TRACE", "false");
}
@Test
......@@ -107,7 +107,7 @@ public class StackTraceSuppressionTest {
This test is based upon Stapler throwing an exception for this broken request.
If Stapler is improved to better handle this error, this test may erroneously fail. */
JenkinsRule.WebClient wc = j.createWebClient();
HttpResponses.SHOW_STACK_TRACE = true;
System.setProperty("org.kohsuke.stapler.HttpResponses.SHOW_STACK_TRACE", "true");
wc.setThrowExceptionOnFailingStatusCode(false);
Page page = wc.goTo("adjuncts/40331c1bldu3i%3b//'%3b//\"%3b//%25>%3f>uezm3<script>alert(1)</script>foo/org/kohsuke/stapler/jquery/jquery.full.js", "text/plain");
......@@ -142,7 +142,7 @@ public class StackTraceSuppressionTest {
If Jenkins is improved to better handle this error, this test may erroneously fail. */
FreeStyleProject projectError = createBrokenProject();
Jenkins.SHOW_STACK_TRACE = true;
System.setProperty("jenkins.model.Jenkins.SHOW_STACK_TRACE", "true");
JenkinsRule.WebClient wc = j.createWebClient();
wc.setThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.goTo("job/" + projectError.getName() + "/configure");
......@@ -174,7 +174,7 @@ public class StackTraceSuppressionTest {
public void exceptionEndpointShowsTrace() throws Exception {
/* This test is based upon a testing endpoint that really shouldn't exist in production code.
If Jenkins is improved to eliminate this endpoint, this test may erroneously fail. */
Jenkins.SHOW_STACK_TRACE = true;
System.setProperty("jenkins.model.Jenkins.SHOW_STACK_TRACE", "true");
JenkinsRule.WebClient wc = j.createWebClient();
wc.setThrowExceptionOnFailingStatusCode(false);
HtmlPage page = wc.goTo("exception");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册