On Wednesday 06 May 2009 01:39:54 Daniel Cheng wrote:
> On Wed, May 6, 2009 at 6:21 AM, Matthew Toseland
> <toad at amphibian.dyndns.org> wrote:
> > sdiz commit 006d85dbcd31ffce94279667f5e9ab62d054c9cf
> >
> > diff --git a/src/freenet/client/ArchiveHandlerImpl.java
> > b/src/freenet/client/ArchiveHandlerImpl.java
> > index 56a9b81..e8046ca 100644
> > --- a/src/freenet/client/ArchiveHandlerImpl.java
> > +++ b/src/freenet/client/ArchiveHandlerImpl.java
> > @@ -24,13 +24,7 @@ class ArchiveHandlerImpl implements ArchiveHandler {
> > ? ? ? ?private static volatile boolean logMINOR;
> >
> > ? ? ? ?static {
> > - ? ? ? ? ? ? ? Logger.registerLogThresholdCallback(new
LogThresholdCallback()
> > {
> > -
> > - ? ? ? ? ? ? ? ? ? ? ? @Override
> > - ? ? ? ? ? ? ? ? ? ? ? public void shouldUpdate() {
> > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? logMINOR = Logger.shouldLog(Logger.MINOR,
> > this);
> > - ? ? ? ? ? ? ? ? ? ? ? }
> > - ? ? ? ? ? ? ? });
> > + ? ? ? ? ? ? ? Logger.registerClass(ArchiveHandlerImpl.class);
> > ? ? ? ?}
> >
> > ? ? ? ?private final FreenetURI key;
> >
> > Etc.
> >
> > Logger.registerClass uses JNI and weak references, it is a great thing. It
>
> That's not JNI, ... JNI is native C code.
> This is Reflection (
> http://java.sun.com/docs/books/tutorial/reflect/index.html )
Yes, I meant reflection. :)
>
> > could simplify much code as above, but shouldUpdate() is slow because of
JNI.
> > Given we very rarely change logging settings, is that a problem? How long
> > would it take to run the JNI hooks on every class? If it's less than 100ms
or
> > so, we should use this everywhere.
Do you have an opinion on this part?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20090512/118e19df/attachment.pgp>