You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2023/01/04 08:58:12 UTC
[GitHub] [netbeans] sdedic opened a new pull request, #5191: Do not inherit "throws Exception" from Callable to compile on JDK8
sdedic opened a new pull request, #5191:
URL: https://github.com/apache/netbeans/pull/5191
In #5118, I have created a generic method that rethrows callable's (checked) exception using `sneaky throws` approach - but the code is not compilable on JDK8 because the JDK8 javac fails to infer types properly:
```
[nb-javac] /space/src/vscode/netbeans/java/java.lsp.server/nbcode/integration/src/org/netbeans/modules/nbcode/integration/commands/ProjectAuditCommand.java:149: error: call() in <anonymous org.netbeans.modules.nbcode.integration.commands.ProjectAuditCommand$> cannot implement call() in OCIOperation
[nb-javac] return OCIManager.usingSession(auditWithProfile, () -> v.findKnowledgeBase(knowledgeBase).
[nb-javac] ^
[nb-javac] overridden method does not throw Exception
```
One way is to typecast the lambda or augment the mehod call using explicit type parameters `<Object, Exception>`, but it seems that removing `extends Callable` from the `OCIOperation` interface does the same - and leaves caller code clean - and compiles on both JDK8 and JDK11 (JDK17)
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on pull request #5191: Do not inherit "throws Exception" from Callable to compile on JDK8
Posted by GitBox <gi...@apache.org>.
mbien commented on PR #5191:
URL: https://github.com/apache/netbeans/pull/5191#issuecomment-1371419447
merging since this fixes master
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien merged pull request #5191: Do not inherit "throws Exception" from Callable to compile on JDK8
Posted by GitBox <gi...@apache.org>.
mbien merged PR #5191:
URL: https://github.com/apache/netbeans/pull/5191
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jlahoda commented on pull request #5191: Do not inherit "throws Exception" from Callable to compile on JDK8
Posted by GitBox <gi...@apache.org>.
jlahoda commented on PR #5191:
URL: https://github.com/apache/netbeans/pull/5191#issuecomment-1371485587
Looks good to me, ftr.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists