Skip to content

Catch StringIndexOutOfBoundsException first#71

Merged
arvindkrishnakumar-okta merged 3 commits intomasterfrom
fix_index_out_of_bound_exception
Feb 13, 2024
Merged

Catch StringIndexOutOfBoundsException first#71
arvindkrishnakumar-okta merged 3 commits intomasterfrom
fix_index_out_of_bound_exception

Conversation

@sergiishamrai-okta
Copy link
Copy Markdown
Contributor

Fix for #70

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #71 (b7a484e) into master (67da074) will decrease coverage by 2.98%.
The diff coverage is 0.00%.

❗ Current head b7a484e differs from pull request most recent head 643ae9d. Consider uploading reports for the commit 643ae9d to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #71      +/-   ##
============================================
- Coverage     63.73%   60.74%   -2.99%     
+ Complexity      768      740      -28     
============================================
  Files            39       39              
  Lines          2741     2708      -33     
  Branches        510      504       -6     
============================================
- Hits           1747     1645     -102     
- Misses          810      888      +78     
+ Partials        184      175       -9     
Impacted Files Coverage Δ
...in/java/com/okta/commons/lang/ApplicationInfo.java 48.85% <0.00%> (-0.76%) ⬇️
...s/http/httpclient/RepeatableInputStreamEntity.java 0.00% <0.00%> (-84.22%) ⬇️
...mons/http/httpclient/HttpClientRequestFactory.java 7.27% <0.00%> (-73.89%) ⬇️
.../main/java/com/okta/commons/http/RequestUtils.java 33.33% <0.00%> (-32.06%) ⬇️
...kta/commons/http/okhttp/OkHttpRequestExecutor.java 78.37% <0.00%> (-12.74%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67da074...643ae9d. Read the comment docs.

Copy link
Copy Markdown
Contributor

@arvindkrishnakumar-okta arvindkrishnakumar-okta left a comment

Choose a reason for hiding this comment

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

I think we should be fixing the root cause of this exception (see how the version string looks and fix the string parsing logic) instead of swallowing it and returning UNKNOWN_VERSION.

@ricgil
Copy link
Copy Markdown

ricgil commented Feb 13, 2024

Hi there, any chance fixing this? We are having this issue in a WAS v8.5 running in a container and our systems team says there's a difference in the output so the logic would be "correct" for a WAS directly on bare metal but not in our case. Anyway, understanding your view @arvindkrishnakumar-okta , this is causing a runtime exception and blocking completely the use of the verifier lib and this is only used to set up an user agent on the HTTP calls. It might be interesting to really use the UNKNOWN_VERSION fallback when you can't guess the version from a string. That kind of output from a server doesn't seems like the most reliable source of truth. It's not working on one of our projects but it can also break easily on a software update imho. What do you think? It would be possible to use that fallback in this case as @sergiishamrai-okta proposed?

@arvindkrishnakumar-okta arvindkrishnakumar-okta merged commit cc4f482 into master Feb 13, 2024
@arvindkrishnakumar-okta arvindkrishnakumar-okta deleted the fix_index_out_of_bound_exception branch February 13, 2024 16:02
@ricgil
Copy link
Copy Markdown

ricgil commented Feb 14, 2024

Awesome, many thanks :). Sorry, my fault for sure, I can't find how's the release cycle. We are having the issue from the verifier lib. It would be great to know when will be released a new library version and integrated from the verifier lib.

@ricgil
Copy link
Copy Markdown

ricgil commented Feb 15, 2024

Oh, also let you know @arvindkrishnakumar-okta and @sergiishamrai-okta ... it wasn't working for us because that message from Websphere is internationalized and our server shows an output in spanish. So no "Installed product" string, it was "Producto instalado". Apart from thinking on a regex that could ignore i18n issues, it seems this info is only available this way or using the Server MBean, but I guess that's overkill for the purpose.

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.

5 participants