fireing property changes
Michael Koch
konqueror@gmx.de
Sat Jul 10 20:58:00 GMT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Am Samstag, 10. Juli 2004 22:41 schrieb Cedric Berger:
> Hi Michael,
>
> I'm just browsing the java-patches list archive, and I just found
> the following patch:
>
> http://gcc.gnu.org/ml/java-patches/2004-q3/msg00148.html
>
> I've just one remark on the change, and on the code just before
> too:
>
> + public void setTabSize(int newSize)
> + {
> + firePropertyChange("tabSize", tabSize, newSize);
> + tabSize = newSize;
> + }
>
> I think the "firePropertyChange" should occur after the "tabSize =
> newSize" statement, so code executing in the handlers have access
> to up-to-date information. something like:
>
> public void setTabSize(int newSize)
> {
> if (newSize == tabSize)
> return;
> int oldSize = tabSize;
> tabSize = newSize;
> firePropertyChange("tabSize", oldSize, newSize);
> }
>
> This is at least what I'm doing in my code, and I'm pretty sure
> that's what the JDK does too. The firePropertyChange("lineWrap",
> wrapping, flag) call above the patch seem to have the same issue...
Thanks for the review.
You are right. I will fix this. There is too much stuff in my head ...
I just need to get it into code in the correct order ... ;-)
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA8FjtWSOgCCdjSDsRAoaAAJ0RCXG1ljyPk4AHAn1MFLyHxkC4NwCfQkxx
iyAawN/vPNJjyaRRI0E4Q6g=
=lco6
-----END PGP SIGNATURE-----
More information about the Java-patches
mailing list