Skip to content

Commit 7eb2098

Browse files
committedFeb 27, 2022
Fix for javadoc on Java14+
1 parent 1e1564f commit 7eb2098

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎native/java/org/jpype/javadoc/JavadocExtractor.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ public static Javadoc extractDocument(Class cls, Document doc)
115115
{
116116
Javadoc documentation = new Javadoc();
117117
XPath xPath = XPathFactory.newInstance().newXPath();
118-
Node description = toFragment((Node) xPath.compile("//div[@class='description']/ul/li").evaluate(doc, XPathConstants.NODE));
118+
// Javadoc 8-13
119+
Node n = (Node) xPath.compile("//div[@class='description']/ul/li").evaluate(doc, XPathConstants.NODE);
120+
if (n == null) // Javadoc 14+
121+
n = (Node) xPath.compile("//section[@class='description']").evaluate(doc, XPathConstants.NODE);
122+
Node description = toFragment(n);
119123
if (description != null)
120124
{
121125
documentation.descriptionNode = description;

0 commit comments

Comments
 (0)
Please sign in to comment.