jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1722754 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/GuiPackage.java xdocs/changes.xml
Date Sun, 03 Jan 2016 20:54:30 GMT
Author: pmouawad
Date: Sun Jan  3 20:54:29 2016
New Revision: 1722754

URL: http://svn.apache.org/viewvc?rev=1722754&view=rev
Log:
Bug 58795 - NPE may occur in GuiPackage#getTestElementCheckSum with some 3rd party plugins
Fix NPE
Avoid computing checksum when undoHistory is disabled
Bugzilla Id: 58795

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java?rev=1722754&r1=1722753&r2=1722754&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java Sun Jan  3 20:54:29 2016
@@ -421,15 +421,23 @@ public final class GuiPackage implements
      * choosing the new node.
      */
     public void updateCurrentNode() {
+        
         try {
             if (currentNode != null && !currentNodeUpdated) {
                 log.debug("Updating current node " + currentNode.getName());
                 JMeterGUIComponent comp = getGui(currentNode.getTestElement());
                 TestElement el = currentNode.getTestElement();
-                int before = getTestElementCheckSum(el);
+                int before = 0;
+                int after = 0;
+                final boolean historyEnabled = undoHistory.isEnabled();
+                if(historyEnabled) {
+                    before = getTestElementCheckSum(el);
+                }
                 comp.modifyTestElement(el);
-                int after = getTestElementCheckSum(el);
-                if (before != after) {
+                if(historyEnabled) {
+                    after = getTestElementCheckSum(el);
+                }
+                if (!historyEnabled || (before != after)) {
                     currentNode.nameChanged(); // Bug 50221 - ensure label is updated
                 }
             }
@@ -844,7 +852,15 @@ public final class GuiPackage implements
                         .getElement());
             } else {
                 ret ^= obj.getName().hashCode();
-                ret ^= obj.getStringValue().hashCode();
+                String stringValue = obj.getStringValue();
+                if(stringValue != null) {
+                    ret ^= stringValue.hashCode();
+                } else {
+                    if(log.isDebugEnabled()) {
+                        log.debug("obj.getStringValue() returned null for test element:"
+                                +el.getName()+" at property:"+obj.getName());
+                    }
+                }
             }
         }
         return ret;

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1722754&r1=1722753&r2=1722754&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Jan  3 20:54:29 2016
@@ -249,6 +249,7 @@ Summary
     <li><bug>58685</bug>JDatefield : Make the modification of the date
with up/down arrow work.Contributed by Benoit Wiart (benoit dot wiart at gmail.com)</li>
     <li><bug>58693</bug>Fix "Cannot nest output folder 'jmeter/build/components'
inside output folder 'jmeter/build' when setting up eclipse</li>
     <li><bug>58781</bug>Command line option "-?" shows Unknown option</li>
+    <li><bug>58795</bug>NPE may occur in GuiPackage#getTestElementCheckSum
with some 3rd party plugins</li>
 </ul>
 
  <!--  =================== Thanks =================== -->



Mime
View raw message