-
Bug
-
Resolution: Done
-
Major
-
16.0.0.Beta5
-
None
The following code points hide exceptions. A good description of the issue can be found here https://wiki.sei.cmu.edu/confluence/display/java/ERR04-J.+Do+not+complete+abruptly+from+a+finally+block
- https://github.com/wildfly/wildfly-core/blob/master/cli/src/main/java/org/jboss/as/cli/impl/CommandContextImpl.java#L1800
- https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/AbstractControllerService.java#L1001
- https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/TemporaryModuleLayer.java#L291
- https://github.com/wildfly/wildfly-core/blob/master/domain-management/src/main/java/org/jboss/as/domain/management/security/LdapCacheService.java#L335
The approach is to add a catch clause, keep the original exception and add finally block exceptions as suppressed ones to the original one. The logic shall follow a "either exception XOR return value" principle. The interface of the methods shall remain compatible.