title: two instance of custom classloader load the same class, but the class not equal
body: <p>i used two instance of custom classloader to load the class, but their hashCode not equal.</p>
  
  <pre><code>public class MyClassLoader extends ClassLoader{
  
      private String mLibPath;
  
      public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
          MyClassLoader classLoader1 = new MyClassLoader("/Users/kk/Downloads");
          MyClassLoader classLoader2 = new MyClassLoader("/Users/kk/Downloads");
          Class&lt;?&gt; c1 = classLoader1.loadClass("loader.DemoObj");
          Class&lt;?&gt; c2 = classLoader2.loadClass("loader.DemoObj");
          System.out.println(c1.hashCode());
          System.out.println(c2.hashCode());
  
      }
  
      public MyClassLoader(String path){
          mLibPath = path;
      }
  
      @Override
      protected Class&lt;?&gt; findClass(String name) throws ClassNotFoundException {
          String fileName = getFileName(name);
          File file = new File(mLibPath,fileName);
          try {
              FileInputStream is = new FileInputStream(file);
  
              ByteArrayOutputStream bos = new ByteArrayOutputStream();
              int len=0;
              try{
                  while((len = is.read()) != -1){
                      bos.write(len);
                  }
              }catch (IOException e){
                  e.printStackTrace();
              }
              byte[] data = bos.toByteArray();
              is.close();
              bos.close();
  
              return defineClass(name, data, 0, data.length);
          } catch (IOException e) {
              e.printStackTrace();
          }
          return super.findClass(name);
  
  
  
      }
  
      private String getFileName(String name){
          name = name.replace(".","/");
          return name+".class";
      }
  
  
  }
  </code></pre>
  
  <p>classLoader1 and classLoader2 are both invoke loadClass("loader.DemoObj")，they should invoke findLoadedClass() to check whether the cache have the Class of loader.DemoObj. The Code above should return two same number，but my code returns different.</p>
  
  <pre><code>1846274136
  1639705018
  </code></pre>