Hi,
I just noticed some differences in behavior of my code running in
development and production mode.
In my code, there is a class Vec (to do some Vector calculus) which
has an add, diff, and scale method. The first version of these methods
created a clone of the instance, did the calculations on it and
returned the clone, i.e.:
public Vec scale(double factor){
Vec ret = clone();
ret.x *= factor;
ret.y *= factor;
return ret;
}
protected Vec clone(int x, int y) {
return new Vec(x, y);
}
For efficiency reasons, the behavior was changed to modify the actual
object (and return it for convenience, i.e.
public Vec scale(double factor){
x *= factor;
y *= factor;
return this;
}
After adapting all algorithms that make use of these methods (some
relied on a clone being returned and now have to clone the instance
before calling the method) this does not produce any differences in
the results of the algorithms between the two versions.
However, this is valid only for development mode. In production mode,
the change led to differences in the result.
Reintroducing the cloning "corrected" the behavior in production mode.
So I wonder whether there are known differences between both modes
that would explain this.
Thanks
panam
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.