Should I be mailing the author directly for this type of question?
I am going through the [TODO] sections in the code. In org.jboss.verifier.Section,
there is the following TODO:
/*
* [TODO] this can be done more efficiently by creating/storing the string
* at construction time. We can do this cause at the moment we're
* still immutable.
*/
My question is, what is the intension of the comment? For example, do you mean that
it would be more efficient to just save a pre-parsed copy of the section and use this
method to just return that instance variable rather than rebuilding the section in
this method? If that is the case, it seems that it would have taken less time to make
that change rather than write the comment, so I think that I am missing something.
On the topic of efficiency, you can make that method (String getSection()) a decent
percentage faster without complicating the code by getting rid of the if() when
placing the delimeter:
Index: Section.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/verifier/Section.java,v
retrieving revision 1.1
diff -r1.1 Section.java
101c101
< for (int i = 0; i < section.length; ++i) {
---
> for (int i = 0; i < (section.length - 1); ++i) {
103,105c103
<
< if (i + 1 < section.length)
< buffer.append(".");
---
> buffer.append(DELIMETER);
106a105
> buffer.append(section[section.length - 1]);
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup