Skip to content

Minor improvements in Connection classes#442

Merged
frankgiordano merged 1 commit intozowe:mainfrom
shabaz213:code-improvements-2
Dec 26, 2025
Merged

Minor improvements in Connection classes#442
frankgiordano merged 1 commit intozowe:mainfrom
shabaz213:code-improvements-2

Conversation

@shabaz213
Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Shabaz K <kshabaz1729@gmail.com>
@shabaz213
Copy link
Copy Markdown
Contributor Author

shabaz213 commented Dec 26, 2025

@frankgiordano please review this PR, added comments on reason for change

if (port < 1 || port > 65535) {
throw new IllegalArgumentException("invalid port number: " + port);
}
this.port = port;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validate then assign

"host='" + ((host == null) ? "" : host) + '\'' +
", port='" + (port == 0 ? "" : port) + '\'' +
", port='" + port + '\'' +
", user='" + ((user == null) ? "" : user) + '\'' +
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required as we already validate port to not be zero in constructor

* @param basePath string value
*/
void setBasePath(String basePath) {
if (basePath == null || basePath.isBlank())
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basePath will never be blank as we validate it in ZosConnectionFactory class

@frankgiordano frankgiordano merged commit 4cbb745 into zowe:main Dec 26, 2025
2 checks passed
@frankgiordano frankgiordano added the enhancement New feature or request label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants