dbalek commented on a change in pull request #2955:
URL: https://github.com/apache/netbeans/pull/2955#discussion_r632382897
##########
File path:
java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
##########
@@ -371,26 +371,29 @@ private ElementJavadoc(CompilationInfo compilationInfo,
Element element, final U
computeDocURL(Collections.emptyList(), true, cancel);
doc = header.append(noJavadocFound());
}
- this.content = new Now(doc.toString());
+ this.content = CompletableFuture.completedFuture(doc.toString());
} catch (JavadocHelper.RemoteJavadocException re) {
if (fileObject == null || JavaSource.forFileObject(fileObject) ==
null) {
header.append(noJavadocFound());
- this.content = new Now(header.toString());
+ this.content =
CompletableFuture.completedFuture(header.toString());
return;
}
- this.content = new FutureTask<>(() -> {
- final JavaSourceUtil.Handle ch =
JavaSourceUtil.createControllerHandle(fileObject, null);
- final CompilationController c = (CompilationController)
ch.getCompilationController();
- c.toPhase(Phase.RESOLVED);
- final Element el = handle.resolve(c);
- CharSequence doc = getElementDoc(el, c, header, url, false);
- if (doc == null) {
- computeDocURL(Collections.emptyList(), false, cancel);
- doc = header.append(noJavadocFound());
+ this.content = CompletableFuture.supplyAsync(() -> {
+ try {
+ final JavaSourceUtil.Handle ch =
JavaSourceUtil.createControllerHandle(fileObject, null);
+ final CompilationController c = (CompilationController)
ch.getCompilationController();
+ c.toPhase(Phase.RESOLVED);
+ final Element el = handle.resolve(c);
+ CharSequence doc = getElementDoc(el, c, header, url,
false);
+ if (doc == null) {
+ computeDocURL(Collections.emptyList(), false, cancel);
+ doc = header.append(noJavadocFound());
+ }
+ return doc.toString();
+ } catch (Exception ex) {
+ return null;
Review comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists