jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1549201 - /jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java
Date Sun, 08 Dec 2013 20:10:53 GMT
Author: pmouawad
Date: Sun Dec  8 20:10:53 2013
New Revision: 1549201

URL: http://svn.apache.org/r1549201
Log:
Bug 55858 - Startup Performance : On Startup, BeanInfoSupport should test for key availability
instead of throwing 
Avoid duplicate string creation
Bugzilla Id: 55858

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java?rev=1549201&r1=1549200&r2=1549201&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/BeanInfoSupport.java Sun Dec  8 20:10:53
2013
@@ -122,9 +122,10 @@ public abstract class BeanInfoSupport ex
 
             // Store the resource bundle as an attribute of the BeanDescriptor:
             getBeanDescriptor().setValue(RESOURCE_BUNDLE, resourceBundle);
+            final String dnKey = "displayName";
             // Localize the bean name
-            if (resourceBundle.containsKey("displayName")) { // $NON-NLS-1$
-                getBeanDescriptor().setDisplayName(resourceBundle.getString("displayName"));
// $NON-NLS-1$
+            if (resourceBundle.containsKey(dnKey)) { // $NON-NLS-1$
+                getBeanDescriptor().setDisplayName(resourceBundle.getString(dnKey)); // $NON-NLS-1$
             } else {
                 log.debug("Localized display name not available for bean " + beanClass);
                   
             }
@@ -132,14 +133,15 @@ public abstract class BeanInfoSupport ex
             PropertyDescriptor[] properties = getPropertyDescriptors();
             for (PropertyDescriptor property : properties) {
                 String name = property.getName();
-                if(resourceBundle.containsKey(name + ".displayName")) {
-                    property.setDisplayName(resourceBundle.getString(name + ".displayName"));
// $NON-NLS-1$
+                final String propDnKey = name + ".displayName";
+                if(resourceBundle.containsKey(propDnKey)) {
+                    property.setDisplayName(resourceBundle.getString(propDnKey)); // $NON-NLS-1$
                 } else {
                     log.debug("Localized display name not available for property " + name
+ " in " + beanClass);
                 }
-                
-                if(resourceBundle.containsKey(name + ".shortDescription")) {
-                    property.setShortDescription(resourceBundle.getString(name + ".shortDescription"));
+                final String propSdKey = name + ".shortDescription";
+                if(resourceBundle.containsKey(propSdKey)) {
+                    property.setShortDescription(resourceBundle.getString(propSdKey));
                 } else {
                     log.debug("Localized short description not available for property " +
name + " in " + beanClass);
                 }



Mime
View raw message