Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java

Author dlr
Full name Daniel Rall
Date 2000-09-27 01:06:48 PDT
Message Okay guys, I ran the numbers (bytes):

    Before After
    ------ -----
javac: 8776 8728
jikes: 8533 8504

Java compilers are not on par with gcc, unfortunately. I'm with you in
spirit. At the same time, it could be argued that you should know what
executeUpdate() returns. Shame on you! ;) j/k!

Anyhow, it's a minor nit. Know that I understand trading resources for
maintainability, and appreciate everyone's vigilance. :)

Ed Korthof wrote:
>
> is this really an improvement? i understand the value in shortening the
> code where appropriate, but the old version seems far more intuitive than
> the new one (to me, anyway -- i'd have to look at the javadocs for
> PreparedStatement to be sure of what's going on).
>
> maybe that doesn't matter, but there are times when i'd prefer code to be
> clear rather concise -- maybe i've just read too many obfuscated c code
> contest entries. fwiw -- in terms of the actual byte code generated --
> i'd guess these two are equivalent.
>
> thanks --
>
> ed
> --
> +=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=
> | Ed Korthof | edk at collab dot net | 415-247-1690 |
> +=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=+=-=​+=-=+=-=+=-=+=-=
>
> On 26 Sep 2000 dlr at tigris dot org wrote:
>
> > User: dlr
> > Date: 00/09/25 23:33:28
> >
> > Modified: java/org/joist/database UserManager.java
> > Log:
> > One more less line.
> >
> > Revision Changes Path
> > 1.15 +2 -3 joist/java/org/joist​/database/UserManage​r.java
> >
> > Index: UserManager.java
> > ====================​====================​====================​=======
> > RCS file: /cvs/joist/java/org/​joist/database/UserM​anager.java,v
> > retrieving revision 1.14
> > retrieving revision 1.15
> > diff -u -r1.14 -r1.15
> > --- UserManager.java 2000/09/26 06:31:44 1.14
> > +++ UserManager.java 2000/09/26 06:33:28 1.15
> > @@ -61,7 +61,7 @@
> > * Manages users, including adding, retrieving, updating, and deleting.
> > *
> > * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
> > - * @version $Revision: 1.14 $
> > + * @version $Revision: 1.15 $
> > *
> > * Copyright (c) 1999 dataweb systems, inc.
> > * Copyright (c) 1999, 2000 Collab.Net, Inc.
> > @@ -253,8 +253,7 @@
> >
> > sqlStmt.append("null)");
> >
> > - int numRows = stmt.executeUpdate(s​qlStmt.toString());
> > - if (numRows != 1)
> > + if (stmt.executeUpdate(​sqlStmt.toString()) != 1)
> > {
> > throw new JoistDatabaseException("Failed to insert new user");
> > }
> >
> >
> >
> >

--

Daniel Rall <dlr at finemaltcoding dot com>

« Previous message in topic | 4 of 6 | Next message in topic »

Messages

Show all messages in topic

Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java edk Ed Korthof 2000-09-26 08:55:29 PDT
     Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java brian Brian Behlendorf 2000-09-26 10:01:53 PDT
     Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java David Pellegrini <davidp at collab dot net> David Pellegrini <davidp at collab dot net> 2000-09-27 00:39:31 PDT
     Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java dlr Daniel Rall 2000-09-27 01:06:48 PDT
         Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/database UserManager.java edk Ed Korthof 2000-09-27 21:58:02 PDT
             Re: [joist-dev] Re: [joist-cvs] CVS update: joist/java/org/joist/databaseUserManager.java dlr Daniel Rall 2000-09-27 22:02:31 PDT
Messages per page: