File tree Expand file tree Collapse file tree 1 file changed +2
-22
lines changed
src/main/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -75,32 +75,12 @@ public final String getDisplayUrl() {
7575
7676 StaplerRequest req = Stapler .getCurrentRequest ();
7777 if (req == null ) {
78- return u ;
78+ throw new IllegalStateException ( "Can't get display URL without Stapler context." ) ;
7979 }
8080
8181 Item i = req .findAncestorObject (Item .class );
8282
83- StringBuilder toAppend = new StringBuilder ();
84-
85- toAppend .append (req .getContextPath ());
86-
87- if (!req .getContextPath ().endsWith ("/" )) {
88- toAppend .append ("/" );
89- }
90-
91- if (i == null ) {
92- toAppend .append (u );
93- } else {
94- toAppend .append (i .getUrl ());
95-
96- if (!i .getUrl ().endsWith ("/" )) {
97- toAppend .append ("/" );
98- }
99-
100- toAppend .append (u );
101- }
102-
103- return toAppend .toString ();
83+ return req .getContextPath () + '/' + (i == null ? "" : i .getUrl ()) + u ;
10484 }
10585
10686 /**
You can’t perform that action at this time.
0 commit comments