From 0ec9f91118b84641f62b5511e00c874aa8f22d9e Mon Sep 17 00:00:00 2001 From: Kabir Khan Date: Wed, 17 Feb 2021 12:57:12 +0000 Subject: [PATCH] [WFCORE-5288] Rename badly named constant --- jmx/src/main/java/org/jboss/as/jmx/JMXExtension.java | 6 +++--- jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemAdd.java | 4 ++-- .../java/org/jboss/as/jmx/JMXSubsystemRootResource.java | 6 +++--- .../test/java/org/jboss/as/jmx/rbac/JmxRbacTestCase.java | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/jmx/src/main/java/org/jboss/as/jmx/JMXExtension.java b/jmx/src/main/java/org/jboss/as/jmx/JMXExtension.java index 318d6e94515..0166c326cdc 100644 --- a/jmx/src/main/java/org/jboss/as/jmx/JMXExtension.java +++ b/jmx/src/main/java/org/jboss/as/jmx/JMXExtension.java @@ -420,7 +420,7 @@ private void parseSensitivity(ModelNode add, XMLExtendedStreamReader reader) thr final String attribute = reader.getAttributeLocalName(i); switch (attribute) { case CommonAttributes.NON_CORE_MBEANS: - JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.parseAndSetParameter(value, add, reader); + JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY.parseAndSetParameter(value, add, reader); break; default: throw ParseUtils.unexpectedAttribute(reader, i); @@ -565,9 +565,9 @@ public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingCon writer.writeEndElement(); } - if (node.hasDefined(JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.getName())) { + if (node.hasDefined(JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY.getName())) { writer.writeStartElement(CommonAttributes.SENSITIVITY); - JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.marshallAsAttribute(node, writer); + JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY.marshallAsAttribute(node, writer); writer.writeEndElement(); } writer.writeEndElement(); diff --git a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemAdd.java b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemAdd.java index 92bfeb9fb7b..2bafdc065c6 100644 --- a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemAdd.java +++ b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemAdd.java @@ -52,7 +52,7 @@ class JMXSubsystemAdd extends AbstractAddStepHandler { private final RuntimeHostControllerInfoAccessor hostInfoAccessor; JMXSubsystemAdd(ManagedAuditLogger auditLoggerInfo, JmxAuthorizer authorizer, Supplier securityIdentitySupplier, RuntimeHostControllerInfoAccessor hostInfoAccessor) { - super(JMXSubsystemRootResource.JMX_CAPABILITY, JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY); + super(JMXSubsystemRootResource.JMX_CAPABILITY, JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY); this.auditLoggerInfo = auditLoggerInfo; this.authorizer = authorizer; this.securityIdentitySupplier = securityIdentitySupplier; @@ -73,7 +73,7 @@ static void launchServices(OperationContext context, ModelNode model, ManagedAud if (model.hasDefined(CommonAttributes.PROPER_PROPERTY_FORMAT)) { legacyWithProperPropertyFormat = ExposeModelResourceExpression.DOMAIN_NAME.resolveModelAttribute(context, model).asBoolean(); } - boolean coreMBeanSensitivity = JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.resolveModelAttribute(context, model).asBoolean(); + boolean coreMBeanSensitivity = JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY.resolveModelAttribute(context, model).asBoolean(); final boolean isMasterHc; if (context.getProcessType().isHostController()) { isMasterHc = hostInfoAccessor.getHostControllerInfo(context).isMasterHc(); diff --git a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java index 48172404842..75db73bcd41 100644 --- a/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java +++ b/jmx/src/main/java/org/jboss/as/jmx/JMXSubsystemRootResource.java @@ -69,7 +69,7 @@ public class JMXSubsystemRootResource extends SimpleResourceDefinition { .setDeprecated(ModelVersion.create(7,0,0)) .build(); - public static final SimpleAttributeDefinition CORE_MBEAN_SENSITIVITY = new SimpleAttributeDefinitionBuilder(CommonAttributes.NON_CORE_MBEAN_SENSITIVITY, ModelType.BOOLEAN, true) + public static final SimpleAttributeDefinition NON_CORE_MBEAN_SENSITIVITY = new SimpleAttributeDefinitionBuilder(CommonAttributes.NON_CORE_MBEAN_SENSITIVITY, ModelType.BOOLEAN, true) .setAllowExpression(true) .addAccessConstraint(SensitiveTargetAccessConstraintDefinition.ACCESS_CONTROL) .setXmlName(CommonAttributes.NON_CORE_MBEANS) @@ -109,7 +109,7 @@ public void registerOperations(ManagementResourceRegistration resourceRegistrati @Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerReadWriteAttribute(SHOW_MODEL_ALIAS, ShowModelAliasReadHandler.INSTANCE, ShowModelAliasWriteHandler.INSTANCE); - resourceRegistration.registerReadWriteAttribute(CORE_MBEAN_SENSITIVITY, null, CoreMBeansSensitivityWriteHandler.INSTANCE); + resourceRegistration.registerReadWriteAttribute(NON_CORE_MBEAN_SENSITIVITY, null, CoreMBeansSensitivityWriteHandler.INSTANCE); } @Override @@ -162,7 +162,7 @@ private static class CoreMBeansSensitivityWriteHandler extends AbstractWriteAttr static final CoreMBeansSensitivityWriteHandler INSTANCE = new CoreMBeansSensitivityWriteHandler(); private CoreMBeansSensitivityWriteHandler() { - super(CORE_MBEAN_SENSITIVITY); + super(NON_CORE_MBEAN_SENSITIVITY); } @Override diff --git a/jmx/src/test/java/org/jboss/as/jmx/rbac/JmxRbacTestCase.java b/jmx/src/test/java/org/jboss/as/jmx/rbac/JmxRbacTestCase.java index 46d47cbba24..c2616d92c85 100644 --- a/jmx/src/test/java/org/jboss/as/jmx/rbac/JmxRbacTestCase.java +++ b/jmx/src/test/java/org/jboss/as/jmx/rbac/JmxRbacTestCase.java @@ -282,7 +282,7 @@ private void checkMBeanAccess(final StandardRole standardRole, final boolean sen if (sensitiveMBeans) { ModelNode sensitiveMBeansOp = Util.getWriteAttributeOperation( PathAddress.pathAddress(ModelDescriptionConstants.SUBSYSTEM, JMXExtension.SUBSYSTEM_NAME), - JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.getName(), + JMXSubsystemRootResource.NON_CORE_MBEAN_SENSITIVITY.getName(), new ModelNode(sensitiveMBeans)); executeForResult(sensitiveMBeansOp); }