Skip to content
Snippets Groups Projects

Iss #62 - Code smell fixes, testing harness update, minor derecations

Merged Martin Lowe requested to merge malowe/eclipsefdn-api-common:malowe/main/62 into main
23 files
+ 907
170
Compare changes
  • Side-by-side
  • Inline
Files
23
@@ -36,7 +36,7 @@ public class OptionalPathFilter implements ContainerRequestFilter {
@@ -36,7 +36,7 @@ public class OptionalPathFilter implements ContainerRequestFilter {
Method m = ((PostMatchContainerRequestContext) requestContext).getResourceMethod().getMethod();
Method m = ((PostMatchContainerRequestContext) requestContext).getResourceMethod().getMethod();
OptionalPath opt = m.getAnnotation(OptionalPath.class);
OptionalPath opt = m.getAnnotation(OptionalPath.class);
if (opt != null) {
if (opt != null) {
if (!optionalResourcesEnabled.get()) {
if (Boolean.FALSE.equals(optionalResourcesEnabled.get())) {
LOGGER.trace("Request to '{}' rejected as optional resources are not enabled",
LOGGER.trace("Request to '{}' rejected as optional resources are not enabled",
requestContext.getUriInfo().getAbsolutePath());
requestContext.getUriInfo().getAbsolutePath());
// abort with 404 as we should hide that this exists
// abort with 404 as we should hide that this exists
@@ -44,7 +44,7 @@ public class OptionalPathFilter implements ContainerRequestFilter {
@@ -44,7 +44,7 @@ public class OptionalPathFilter implements ContainerRequestFilter {
}
}
// get the specified config value fresh and check that it is enabled, or enabled by default if missing
// get the specified config value fresh and check that it is enabled, or enabled by default if missing
Optional<Boolean> configValue = ConfigProvider.getConfig().getOptionalValue(opt.value(), Boolean.class);
Optional<Boolean> configValue = ConfigProvider.getConfig().getOptionalValue(opt.value(), Boolean.class);
if (configValue.isPresent() && configValue.get()) {
if (configValue.isPresent() && Boolean.TRUE.equals(configValue.get())) {
LOGGER.trace("Request to '{}' enabled by config, allowing call",
LOGGER.trace("Request to '{}' enabled by config, allowing call",
requestContext.getUriInfo().getAbsolutePath());
requestContext.getUriInfo().getAbsolutePath());
} else if (configValue.isEmpty() && opt.enabledByDefault()) {
} else if (configValue.isEmpty() && opt.enabledByDefault()) {
Loading