Skip to content

Commit

Permalink
Tolerate missing DEBUG_YUI field (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Nov 14, 2024
1 parent a92ad18 commit e3f890c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,15 @@ public boolean isLoggable(LogRecord record) {
public static int SLAVE_DEBUG_PORT = Integer.getInteger(HudsonTestCase.class.getName()+".slaveDebugPort",-1);

static {
Functions.DEBUG_YUI = true;
try {
Functions.class.getDeclaredField("DEBUG_YUI").setBoolean(null, true);
} catch (IllegalAccessException e) {
IllegalAccessError x = new IllegalAccessError();
x.initCause(e);
throw x;
} catch (NoSuchFieldException e) {
// No YUI, no problem
}

if (Functions.isGlibcSupported()) {
try {
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/jvnet/hudson/test/JenkinsRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -3022,7 +3022,15 @@ public boolean isLoggable(LogRecord record) {

static {
jettyLevel(Level.INFO);
Functions.DEBUG_YUI = true;
try {
Functions.class.getDeclaredField("DEBUG_YUI").setBoolean(null, true);
} catch (IllegalAccessException e) {
IllegalAccessError x = new IllegalAccessError();
x.initCause(e);
throw x;
} catch (NoSuchFieldException e) {
// No YUI, no problem
}

if (Functions.isGlibcSupported()) {
try {
Expand Down

0 comments on commit e3f890c

Please sign in to comment.