reta commented on a change in pull request #632: avoid checked exception in
@PostConstruct method
URL: https://github.com/apache/cxf/pull/632#discussion_r371015899
##########
File path:
rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
##########
@@ -994,27 +993,19 @@ protected void retrieveListenerFactory() {
* This method is called after configure on this object.
*/
@PostConstruct
- public void finalizeConfig()
- throws GeneralSecurityException,
- IOException {
+ public void finalizeConfig() {
retrieveListenerFactory();
checkConnectorPort();
this.configFinalized = true;
}
- private void checkConnectorPort() throws IOException {
- try {
- if (null != connector) {
- int cp = ((ServerConnector)connector).getPort();
- if (port != cp) {
- throw new IOException("Error: Connector port " + cp + "
does not match"
- + " with the server engine port " + port);
- }
+ private void checkConnectorPort() {
+ if (null != connector) {
+ int cp = ((ServerConnector)connector).getPort();
+ if (port != cp) {
+ throw new IllegalStateException("Error: Connector port " + cp
+ " does not match"
Review comment:
May be `UncheckedIOException` would be better replacement for `IOException`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services