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 2007/03/07 02:47:41 UTC

svn commit: r515417 - /jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java

Author: sebb
Date: Tue Mar  6 17:47:41 2007
New Revision: 515417

URL: http://svn.apache.org/viewvc?view=rev&rev=515417
Log:
Unmarshall is needed after all

Modified:
    jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java

Modified: jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java?view=diff&rev=515417&r1=515416&r2=515417
==============================================================================
--- jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java (original)
+++ jakarta/jmeter/branches/rel-2-2/src/core/org/apache/jmeter/save/converters/SampleSaveConfigurationConverter.java Tue Mar  6 17:47:41 2007
@@ -21,9 +21,11 @@
 import org.apache.jmeter.samplers.SampleSaveConfiguration;
 
 import com.thoughtworks.xstream.converters.MarshallingContext;
+import com.thoughtworks.xstream.converters.UnmarshallingContext;
 import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
 import com.thoughtworks.xstream.converters.reflection.ReflectionProvider;
 import com.thoughtworks.xstream.core.JVM;
+import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
 import com.thoughtworks.xstream.mapper.Mapper;
 import com.thoughtworks.xstream.mapper.MapperWrapper;
@@ -119,10 +121,22 @@
 
 	/*
 	 * (non-Javadoc)
+	 * This is basically a copy of the super unmarshall code, however the result is created using
+	 * the constructor instead of reflection (the Sun14 version does not call the constructor).
+	 * 
+	 * We need to do this so that any optional values from the JMX file are applied after the
+	 * default object has been created.
 	 * 
 	 * @see com.thoughtworks.xstream.converters.Converter#unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader,
 	 *      com.thoughtworks.xstream.converters.UnmarshallingContext)
 	 */
+    public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
+        Object result = new SampleSaveConfiguration();
+        result = doUnmarshal(result, reader, context);
+        return serializationMethodInvoker.callReadResolve(result);
+    }
+
+
 //	public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
 //		final Class thisClass = SampleSaveConfiguration.class;
 //		final Class requiredType = context.getRequiredType();



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