Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #6745

Re: Detecting if a class is already known

From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Detecting if a class is already known
Date 2011-08-02 07:51 -0700
Organization http://groups.google.com
Message-ID <09ab50c8-adfc-4f90-b943-dc810b0225af@glegroupsg2000goo.googlegroups.com> (permalink)
References <c58b6bca-daa4-4942-b466-768344bf26b1@l7g2000vbz.googlegroups.com> <j0uril$3sm$1@dont-email.me>

Show all headers | View raw


markspace wrote:
> Ross wrote:
>> However, I don't want to load classes that already exist
> 
> This is already covered by the ClassLoader docs.  You can also search 

And by the default classloader behavior.

> for a tutorial how it all works, but basically you overload findClass 
> and don't touch the other methods and it all works out.  loadClass 
> automatically searches for existing classes first, then only calls 
> findClass if it needs too.  IIRC.
> 
> 
>>    private boolean known( String className )
> 
> 
> <http://download.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#findLoadedClass%28java.lang.String%29>

I'm not even sure he needs to do anything new to the classloader.  The default classloader action is to not load a class it already has.  So what new is needed?

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Detecting if a class is already known Ross <rossclement@gmail.com> - 2011-07-29 09:47 -0700
  Re: Detecting if a class is already known markspace <-@.> - 2011-07-29 10:44 -0700
    Re: Detecting if a class is already known Lew <lewbloch@gmail.com> - 2011-08-02 07:51 -0700
  Re: Detecting if a class is already known Arne Vajhøj <arne@vajhoej.dk> - 2011-08-05 22:21 -0400

csiph-web