Skip to content

Commit

Permalink
Initialize SocketDataPort directly when dataPortType is not overridde…
Browse files Browse the repository at this point in the history
…n. Better for GraalVM
  • Loading branch information
scottf committed Oct 23, 2023
1 parent 07d6b9d commit 2885ffa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/io/nats/client/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,9 @@ public String getDataPortType() {
* @return the data port described by these options
*/
public DataPort buildDataPort() {
if (dataPortType.equals(DEFAULT_DATA_PORT_TYPE)) {
return new SocketDataPort();
}
return (DataPort) Options.createInstanceOf(dataPortType);
}

Expand Down

0 comments on commit 2885ffa

Please sign in to comment.