You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/04/12 01:20:19 UTC

svn commit: r647350 - /jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java

Author: sebb
Date: Fri Apr 11 16:20:17 2008
New Revision: 647350

URL: http://svn.apache.org/viewvc?rev=647350&view=rev
Log:
Fix bug in JVMs that return true/false rather than True/False
from the type editor getAsText() method

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java?rev=647350&r1=647349&r2=647350&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/WrapperEditor.java Fri Apr 11 16:20:17 2008
@@ -318,7 +318,7 @@
 		} else {
 			// Not an expression (isn't or can't be), not null.
 			typeEditor.setValue(value); // may throw IllegalArgumentExc.
-			text = typeEditor.getAsText();
+			text = fixGetAsTextBug(typeEditor.getAsText());
 
 			if (!acceptsOther && !isATag(text)) {
 				throw new IllegalArgumentException("Value not allowed: "+text);
@@ -328,7 +328,23 @@
 		guiEditor.setValue(text);
 	}
 
-	public String getAsText() {
+	/*
+	 * Fix bug in JVMs that return true/false rather than True/False
+	 * from the type editor getAsText() method
+	 */
+	private String fixGetAsTextBug(String asText) {
+        if (asText.equals("true")){
+            log.debug("true=>True");// so we can detect it
+            return "True";
+        }
+        if (asText.equals("false")){
+            log.debug("false=>False");// so we can detect it
+            return "False";
+        }
+        return asText;
+    }
+
+    public String getAsText() {
 		String text = guiEditor.getAsText();
 
 		if (text == null) {
@@ -342,7 +358,7 @@
 			} catch (IllegalArgumentException e) {
 				shouldNeverHappen(e);
 			}
-			text = typeEditor.getAsText();
+			text = fixGetAsTextBug(typeEditor.getAsText());
 
 			// a check, just in case:
 			if (!acceptsOther && !isATag(text)) {



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org