File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 2020import java .time .temporal .ChronoUnit ;
2121import java .util .ArrayList ;
2222import java .util .List ;
23- import java .util .Optional ;
2423
2524import org .springframework .amqp .core .AcknowledgeMode ;
2625import org .springframework .amqp .rabbit .connection .AbstractConnectionFactory .AddressShuffleMode ;
@@ -194,7 +193,7 @@ public int determinePort() {
194193 if (port != null ) {
195194 return port ;
196195 }
197- return ( Optional . ofNullable (getSsl ().getEnabled ()). orElse ( false )) ? DEFAULT_PORT_SECURE : DEFAULT_PORT ;
196+ return Boolean . TRUE . equals (getSsl ().getEnabled ()) ? DEFAULT_PORT_SECURE : DEFAULT_PORT ;
198197 }
199198 return this .parsedAddresses .get (0 ).port ;
200199 }
@@ -235,7 +234,7 @@ public void setAddresses(List<String> addresses) {
235234 private List <Address > parseAddresses (List <String > addresses ) {
236235 List <Address > parsedAddresses = new ArrayList <>();
237236 for (String address : addresses ) {
238- parsedAddresses .add (new Address (address , Optional . ofNullable (getSsl ().getEnabled ()). orElse ( false )));
237+ parsedAddresses .add (new Address (address , Boolean . TRUE . equals (getSsl ().getEnabled ())));
239238 }
240239 return parsedAddresses ;
241240 }
@@ -475,7 +474,7 @@ public Boolean getEnabled() {
475474 * @see #getEnabled() ()
476475 */
477476 public boolean determineEnabled () {
478- boolean defaultEnabled = Optional . ofNullable (getEnabled ()). orElse ( false ) || this .bundle != null ;
477+ boolean defaultEnabled = Boolean . TRUE . equals (getEnabled ()) || this .bundle != null ;
479478 if (CollectionUtils .isEmpty (RabbitProperties .this .parsedAddresses )) {
480479 return defaultEnabled ;
481480 }
You can’t perform that action at this time.
0 commit comments