You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2011/11/27 23:09:06 UTC
svn commit: r1206864 -
/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Author: pmouawad
Date: Sun Nov 27 22:09:05 2011
New Revision: 1206864
URL: http://svn.apache.org/viewvc?rev=1206864&view=rev
Log:
Make field volatile to ensure Serializable contract
Modified:
jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java?rev=1206864&r1=1206863&r2=1206864&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java (original)
+++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java Sun Nov 27 22:09:05 2011
@@ -48,7 +48,7 @@ public class BeanShellSampler extends Be
public static final String RESET_INTERPRETER = "BeanShellSampler.resetInterpreter"; //$NON-NLS-1$
- private volatile BeanShellInterpreter savedBsh = null;
+ private transient volatile BeanShellInterpreter savedBsh = null;
@Override
protected String getInitFileProperty() {
Re: svn commit: r1206864 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Posted by sebb <se...@gmail.com>.
On 28 November 2011 07:17, Philippe Mouawad <ph...@gmail.com> wrote:
> I found the issue working on copy - paste patch That was submitted .
> And yes tests are not capturing these issues ( same for synctimer non
> transient barrierwrapper i fixed). This is because non
> transient fields are not initialized in tests runs I think.
Yes, the field is not initialised until run-time, so the serialisation
test does not find it - null is serializable
When I added a dummy ctor to initialise it, the serialization test
fails if the transient marker is absent.
In this case, perhaps the transient marker is not strictly necessary -
we only use serialisation to send the classes across, and the classes
will be in their initial state.
However, there's no point sending fields across that are maintained at
runtime and the transient marker helps to document the use of the
field.
> Regards
> Philippe
> On Monday, November 28, 2011, sebb <se...@gmail.com> wrote:
>> On 27 November 2011 22:09, <pm...@apache.org> wrote:
>>> Author: pmouawad
>>> Date: Sun Nov 27 22:09:05 2011
>>> New Revision: 1206864
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1206864&view=rev
>>> Log:
>>> Make field volatile to ensure Serializable contract
>>
>> [I think you meant transient; it was already volatile.]
>>
>> Just wondering how you found this problem?
>> And I wonder why the serialisation tests did not find it.
>>
>>> Modified:
>>>
> jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
>>>
>>> Modified:
> jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
>>> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java?rev=1206864&r1=1206863&r2=1206864&view=diff
>>>
> ==============================================================================
>>> ---
> jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
> (original)
>>> +++
> jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
> Sun Nov 27 22:09:05 2011
>>> @@ -48,7 +48,7 @@ public class BeanShellSampler extends Be
>>>
>>> public static final String RESET_INTERPRETER =
> "BeanShellSampler.resetInterpreter"; //$NON-NLS-1$
>>>
>>> - private volatile BeanShellInterpreter savedBsh = null;
>>> + private transient volatile BeanShellInterpreter savedBsh = null;
>>>
>>> @Override
>>> protected String getInitFileProperty() {
>>>
>>>
>>>
>>
>
> --
> Cordialement.
> Philippe Mouawad.
>
Re: svn commit: r1206864 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Posted by Philippe Mouawad <ph...@gmail.com>.
I found the issue working on copy - paste patch That was submitted .
And yes tests are not capturing these issues ( same for synctimer non
transient barrierwrapper i fixed). This is because non
transient fields are not initialized in tests runs I think.
Regards
Philippe
On Monday, November 28, 2011, sebb <se...@gmail.com> wrote:
> On 27 November 2011 22:09, <pm...@apache.org> wrote:
>> Author: pmouawad
>> Date: Sun Nov 27 22:09:05 2011
>> New Revision: 1206864
>>
>> URL: http://svn.apache.org/viewvc?rev=1206864&view=rev
>> Log:
>> Make field volatile to ensure Serializable contract
>
> [I think you meant transient; it was already volatile.]
>
> Just wondering how you found this problem?
> And I wonder why the serialisation tests did not find it.
>
>> Modified:
>>
jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
>>
>> Modified:
jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
>> URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java?rev=1206864&r1=1206863&r2=1206864&view=diff
>>
==============================================================================
>> ---
jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
(original)
>> +++
jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Sun Nov 27 22:09:05 2011
>> @@ -48,7 +48,7 @@ public class BeanShellSampler extends Be
>>
>> public static final String RESET_INTERPRETER =
"BeanShellSampler.resetInterpreter"; //$NON-NLS-1$
>>
>> - private volatile BeanShellInterpreter savedBsh = null;
>> + private transient volatile BeanShellInterpreter savedBsh = null;
>>
>> @Override
>> protected String getInitFileProperty() {
>>
>>
>>
>
--
Cordialement.
Philippe Mouawad.
Re: svn commit: r1206864 - /jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
Posted by sebb <se...@gmail.com>.
On 27 November 2011 22:09, <pm...@apache.org> wrote:
> Author: pmouawad
> Date: Sun Nov 27 22:09:05 2011
> New Revision: 1206864
>
> URL: http://svn.apache.org/viewvc?rev=1206864&view=rev
> Log:
> Make field volatile to ensure Serializable contract
[I think you meant transient; it was already volatile.]
Just wondering how you found this problem?
And I wonder why the serialisation tests did not find it.
> Modified:
> jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
>
> Modified: jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java
> URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java?rev=1206864&r1=1206863&r2=1206864&view=diff
> ==============================================================================
> --- jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java (original)
> +++ jmeter/trunk/src/protocol/java/org/apache/jmeter/protocol/java/sampler/BeanShellSampler.java Sun Nov 27 22:09:05 2011
> @@ -48,7 +48,7 @@ public class BeanShellSampler extends Be
>
> public static final String RESET_INTERPRETER = "BeanShellSampler.resetInterpreter"; //$NON-NLS-1$
>
> - private volatile BeanShellInterpreter savedBsh = null;
> + private transient volatile BeanShellInterpreter savedBsh = null;
>
> @Override
> protected String getInitFileProperty() {
>
>
>