You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2003/07/25 17:19:03 UTC
Coding Style in Torque tasks
Hi,
personally I think that null pointer exceptions as error messages are
a sign of bad code style. Stuff like this
http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-torque/src/java/org/apache/torque/engine/database/model/Attic/Database.java.diff?r1=1.15&r2=1.16&search=None&hideattic=0
[...]
+ if ( local == null )
+ {
[...]
+ }
+ //check for foreign pk's
+ if (local.isPrimaryKey())
[...]
+ if ( foreign == null )
+ {
+ System.out.println("ERROR!! Attempt to set foreign"
+ + " key to nonexistent column, " +
+ foreign.getName() + ", in table, "
+ + foreignTable.getName() + "!" );
+ }
+ foreign.addReferrer(currFK);
isn't only offensive to my eyes but makes me wanna puke.
Then seeing patches like the if (con == null) plaster checked in
without any thought makes me wonder in which direction we're heading
with Torque or any other Apache project.
Style and taste is IMHO not optional.
Regards
Henning
--
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH
hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/
Java, perl, Solaris, Linux, xSP Consulting, Web Services
freelance consultant -- Jakarta Turbine Development -- hero for hire
"You are being far too rational for this discussion."
--- Scott Robert Ladd in <3F...@coyotegulch.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org