Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b860d389
Commit
b860d389
authored
Mar 15, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify JettyWebServer.getLocalPort
Closes gh-24656
parent
4fcbfd3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
JettyWebServer.java
...ringframework/boot/web/embedded/jetty/JettyWebServer.java
+2
-15
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyWebServer.java
View file @
b860d389
...
@@ -39,7 +39,6 @@ import org.springframework.boot.web.server.PortInUseException;
...
@@ -39,7 +39,6 @@ import org.springframework.boot.web.server.PortInUseException;
import
org.springframework.boot.web.server.WebServer
;
import
org.springframework.boot.web.server.WebServer
;
import
org.springframework.boot.web.server.WebServerException
;
import
org.springframework.boot.web.server.WebServerException
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
/**
/**
...
@@ -261,20 +260,8 @@ public class JettyWebServer implements WebServer {
...
@@ -261,20 +260,8 @@ public class JettyWebServer implements WebServer {
}
}
private
Integer
getLocalPort
(
Connector
connector
)
{
private
Integer
getLocalPort
(
Connector
connector
)
{
try
{
if
(
connector
instanceof
NetworkConnector
)
{
if
(
connector
instanceof
NetworkConnector
)
{
return
((
NetworkConnector
)
connector
).
getLocalPort
();
return
((
NetworkConnector
)
connector
).
getLocalPort
();
}
}
catch
(
Exception
ex
)
{
}
try
{
// Jetty 9 internals are different, but the method name is the same
return
(
Integer
)
ReflectionUtils
.
invokeMethod
(
ReflectionUtils
.
findMethod
(
connector
.
getClass
(),
"getLocalPort"
),
connector
);
}
catch
(
Exception
ex
)
{
logger
.
info
(
"could not determine port ("
+
ex
.
getMessage
()
+
")"
);
}
}
return
0
;
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment