File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/test/java/org/jvnet/hudson/test Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3434
3535import javax .servlet .ServletContext ;
3636
37+ import org .apache .commons .lang3 .StringUtils ;
3738import org .eclipse .jetty .http .HttpCompliance ;
3839import org .eclipse .jetty .http .UriCompliance ;
3940import org .eclipse .jetty .server .HttpConfiguration ;
@@ -95,9 +96,10 @@ public Thread newThread(Runnable r) {
9596 System .err .println ("Listening on host address: " + HOST );
9697 connector .setHost (HOST );
9798
98- if (System .getProperty ("port" )!=null ) {
99- LOGGER .info ("Overriding port using system property: " + System .getProperty ("port" ));
100- connector .setPort (Integer .parseInt (System .getProperty ("port" )));
99+ String customPort = System .getProperty ("port" );
100+ if (StringUtils .isNotBlank (customPort )) {
101+ LOGGER .info ("Overriding port using system property: " + customPort );
102+ connector .setPort (Integer .parseInt (customPort ));
101103 } else {
102104 if (port != null ) {
103105 connector .setPort (port );
You can’t perform that action at this time.
0 commit comments