Nothing to do with optimization. Just noticed some wrongness
that has the possibility to be pathological wrongness. Classes
should preclude the possibility of erroneous use. The subject
was making a URL resolver thread-safe. The class in question is
a source of state information needed later by the resolver.
[Lucky thing we didn't mention the dirty knife!]
On Fri, 2003-12-19 at 11:50, Ben Galbraith wrote:
> Jeremias Maerki wrote:
> > Hmm, again, we could probably cache the value. Not very elegant, of
> > course, but how else do we get that value which is used in several
> > places?
>
> Just an outsider's point-of-view: it probably doesn't make sense to
> waste time optimizing code like this unless a profiler indicates that
> it's a bottleneck.
>
> Randomly searching through code for potential inefficiencies has widely
> been disproven as an effective optimization technique. ;-)
>
> Ben
>
> >
> > On 19.12.2003 13:57:26 John Austin wrote:
> >
> >>And of course, I missed the fact that the last method in the class
> >>contains a pathological use. To get the name of this class, we create a
> >>parser ?
> >>
> >> /**
> >> * Returns the fully qualified classname of the standard XML parser
> >>for FOP
> >> * to use.
> >> * @return the XML parser classname
> >> */
> >> public static final String getParserClassName() {
> >> try {
> >> return createParser().getClass().getName();
> >> } catch (FOPException e) {
> >> return null;
> >> }
> >> }
> >
> >
> >
> > Jeremias Maerki
> >
--
John Austin <[EMAIL PROTECTED]>