In German, abbreviations can be part of compound words that need to be hyphenated, like "Java-API".
My problem is that when I write Java-\gls{api}, I never get a line break after the hyphen. I managed to find out that the problem is not the abbreviation, but the hyperlink, and that it occurs with all kinds of links and is reproducable without glossaries.
MWE:
\documentclass[a4paper]{article}
\usepackage{showframe}
\overfullrule=1mm
\usepackage{hyperref}
\usepackage[nogroupskip,toc=true]{glossaries}
\usepackage[abbreviations]{glossaries-extra}
\newabbreviation{api}{API}{Application Programming Interface}
\begin{document}
\gls{api}
xxxxxx xxxxxxx xxxxxxx xxxxx xxxxxx xxxxxxxx xxxxx xxxxxxxxxx Java-\gls{api} xxxxxx
xxxxxx xxxxxxx xxxxxxx xxxxx xxxxxx xxxxxxxx xxxxx xxxxxxxxxx Java-API xxxxxx
xxxxxx xxxxxxx xxxxxxx xxxxx xxxxxx xxxxxxxx xxxxx xxxxxxxxxx Java-\url{xxx} xxxxxx
\end{document}
How can I allow a line break between Java- and the hyperlink?
I'm using hyperref 2019/09/28 v7.00a with LuaLaTeX 1.10.0 from TexLive 2019.52579 on Arch Linux.

\usepackage[ngerman]{babel}, in which caseJava"=\gls{api}apparently works."=instead of-may be a good idea anyway, in case you have longer compounds likeDampfschifffahrts"=API. (Cf. https://tex.stackexchange.com/q/2706/35864, https://tex.stackexchange.com/q/63232/35864) – moewe May 20 '20 at 15:53\hypfrom thehyphenatpackage, but it's not really satisfactory. – corvus_192 May 20 '20 at 20:57