Skip to content

Commit

Permalink
Fix display issue with JVMVersion node monitor (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy authored Oct 26, 2023
1 parent 74859c9 commit 4fe4f71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.Util;
import hudson.model.Computer;
import hudson.node_monitors.AbstractAsyncNodeMonitorDescriptor;
import hudson.node_monitors.NodeMonitor;
Expand Down Expand Up @@ -59,6 +60,14 @@ public boolean isDisconnect() {
return disconnect;
}

@SuppressWarnings("unused") // jelly
public String toHtml(String version) {
if (!version.equals("N/A") && !version.equals(CONTROLLER_VERSION.toString())) {
return Util.wrapToErrorSpan(version);
}
return version;

Check warning on line 68 in src/main/java/hudson/plugin/versioncolumn/JVMVersionMonitor.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 65-68 are not covered by tests
}

@Override
public Object data(Computer c) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:s="/lib/form">
<td align="right" data="${data}">${data}</td>
<td align="right" data="${data}"><j:out value="${from.toHtml(data)}"/></td>
</j:jelly>

0 comments on commit 4fe4f71

Please sign in to comment.