Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout cast exception #685

Merged
merged 5 commits into from
Jan 13, 2022
Merged

Conversation

mattbsox
Copy link
Member

@mattbsox mattbsox commented Jan 6, 2022

Fixes #684

Copy link
Member

@cherylking cherylking left a comment

Choose a reason for hiding this comment

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

Should we check that it is a long before calling Long.valueOf()? We have code in DevTask that checks isInteger() before calling toInteger() on the server.timeout.

Updated: Now that I look at the String documentation, I don't even see an isInteger() or toInteger() method and I think DevTask would get a failure at line 927:

if (server.timeout != null && server.timeout.isInteger()) {

@mattbsox
Copy link
Member Author

mattbsox commented Jan 6, 2022

Still want me to add a check for that? Or should we just let it fail on bad plugin config?

@@ -925,7 +925,12 @@ class DevTask extends AbstractFeatureTask {

if (serverStartTimeout == null) {
if (server.timeout != null && server.timeout.isInteger()) {
serverStartTimeout = server.timeout.toInteger();
try {
Copy link
Member

Choose a reason for hiding this comment

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

I don't believe isInteger() is valid on the line before this either. Probably should just check that the string is notEmpty().

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, missed that. Fixed it.

@mattbsox mattbsox merged commit ef0ed7a into OpenLiberty:main Jan 13, 2022
jjiwooLim pushed a commit to jjiwooLim/ci.gradle that referenced this pull request Jan 24, 2022
* Fix timeout cast exception

* Catch NumberFormatException for bad long value

* Update error message

* Update server parameter casts in DevTask

* Check for empty server.timeout value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Property timeout causes a class cast exception if is set
2 participants