[jboss-jira] [JBoss JIRA] (WFCORE-3531) EnumValidator.validateParameter should check toStringMap first to reduce the times of IllegalArgumentException creation

Brad Maxwell (JIRA) issues at jboss.org
Tue Jan 23 11:54:00 EST 2018


     [ https://issues.jboss.org/browse/WFCORE-3531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brad Maxwell updated WFCORE-3531:
---------------------------------
    Description: 
{panel:title=Description of downstream issue}
Enum is misspelled causing java.lang.IllegalArgumentException 

What is the nature and description of the request?
Enum is misspelled causing java.lang.IllegalArgumentException 

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}


  was:
{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}




> 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: Enhancement
>          Components: Domain Management, JMX
>         Environment: JBoss EAP 6.4.16,6.4.18
>            Reporter: Lin Gao
>            Assignee: Lin Gao
>              Labels: downstream_dependency, performace
>             Fix For: 4.0.0.Alpha7
>
>   Original Estimate: 2 days
>  Remaining Estimate: 2 days
>
> {panel:title=Description of downstream issue}
> Enum is misspelled causing java.lang.IllegalArgumentException 
> What is the nature and description of the request?
> Enum is misspelled causing java.lang.IllegalArgumentException 
> 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}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jboss-jira mailing list