]
Lin Gao updated WFCORE-3531:
----------------------------
Labels: downstream_dependency performace (was: downstream_dependency)
EnumValidator.validateParameter should check toStringMap first to
reduce the times of IllegalArgumentException creation
-----------------------------------------------------------------------------------------------------------------------
Key: WFCORE-3531
URL:
https://issues.jboss.org/browse/WFCORE-3531
Project: WildFly Core
Issue Type: Bug
Components: Domain Management, JMX
Environment: JBoss EAP 6.4.16,6.4.18
Reporter: Lin Gao
Assignee: Lin Gao
Labels: downstream_dependency, performace
Original Estimate: 2 days
Remaining Estimate: 2 days
{panel:title=Description of downstream issue}
1. Proposed title of this feature request
Enum is misspelled causing java.lang.IllegalArgumentException
2. Who is the customer behind the request?
Account: Hamburg Südamerikanische Dampfschifffahrts-Ge, 5651756
3. What is the nature and description of the request?
Enum is misspelled causing java.lang.IllegalArgumentException
5. How would the customer like to achieve this? (List the functional requirements here)
In such way, it should not throw Exception and spelled correctly.
ENUM : "ReadResourceDescriptionHandler.AccessControl.TRIM_DESCRIPTONS"
Location Where Enum is Used :
jboss-as-jmx module:
./jmx/src/main/java/org/jboss/as/jmx/model/ResourceAccessControlUtil.java
Code :
op.get(ACCESS_CONTROL).set(ReadResourceDescriptionHandler.AccessControl.TRIM_DESCRIPTONS.toModelNode());
it's a general internal jboss issue for all queries that somehow involve the JMX
related ResourceAccessControlUtil.
Stacktrace Attached.
{panel}
----
{panel:title=Description}
+EnumValidator.validateParameter+ is now trying to call +Enum.valueOf()+ first and fall
back to +toStringMap.get(tuString)+ on +IllegalArgumentException+.
However, +toStringMap+ contains necessary Enum values in most cases, so switch the way to
get the +enumValue+ can reduce the times of IllegalArgumentException creation. And
Exception creation may affect performance.
{panel}