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

Fixes issue #plantuml#1411: hyperlinkUnderline causes NumberFormatException #1775

Merged
merged 1 commit into from
May 11, 2024

Conversation

jimnelson372
Copy link
Contributor

@jimnelson372 jimnelson372 commented May 11, 2024

Issue #1411 was a report that:

skinparam hyperlinkUnderline true

was causing a stackdump, showing NumberFormatException.

skinparam hyperlinkUnderline false

on the other hand worked just fine. I found the solution before I fully understood the full process, but now I realize that the value set on hyperlinkUnderline ultimately is converted to a value for the param hyperlinkUnderlineThickness, and to do so, the value needs to be converted to a number. This is what FromSkinparamToStyle.covertNow(..) does currently, at least partly, for only the "false" condition, converting it to a 0. However, the "true" condition doesn't get converted here, so when a toDouble() is later called on it in Style.getStroke() that causes an exception.

My fix is simple. I just complete FromSkinparamToStyle.covertNow(..) to convert a "true" setting on "hyperlinkunderline" to a "1" -- complementing the conversion of "false" to 0. With this simple fix, the param works as expected and the stack dump is avoided.

During the analysis of this issue, however, there are some new questions/issues related to "hyperlinkunderlineThickness", when at least for PNG it actually can increase the thickness of the underline for some entities, e.g. State, Activity, but not for others, e.g. Class, and then only in PNG, not SVG (for instance). I believe a new issue will be created for that one. For now, I just wanted to get the stackdump problem on hyperlineunderline true taken care of.

As always, let me know if you need me to make any changes to this fix. It's just two lines so hopefully it's good to go. (The analysis tends to be longer than the solution. But that's how it goes.)

Regards,

Jim Nelson

@arnaudroques arnaudroques merged commit b10082c into plantuml:master May 11, 2024
9 checks passed
@jimnelson372 jimnelson372 deleted the hyperlinkUnderline branch May 11, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants