title: Object is not an 'instanceof' it's own class
body: <p>I'm trying to hunt down some issues with spring not expending a factoryBean.  I've plugged into a debugger and proven that the failure is in this line of AbstraceBeanFactory:</p>
  
  <pre><code>if(!(beanInstance instanceof FactoryBean) || BeanFactoryUtils.isFactoryDereference(name)) {
     return beanInstance;
  }
  </code></pre>
  
  <p>specifically the "beanInstance instanceof FactoryBean" part is returning false when it should be true, resulting in my returning a factorybean back rather then the bean that the factory is suppose to construct.</p>
  
  <p>My debugger clearly tells me that the the beanInstance is a org.springframework.beans.factory.config.PropertiesFactoryBean.  When I tell eclipse to expand the class of bean I see it clearly implements FactoryBean</p>
  
  <p>For further testing I went to expressions.  Supposedly the expression:</p>
  
  <pre><code>beanInstance instanceof org.springframework.beans.factory.config.PropertiesFactoryBean
  </code></pre>
  
  <p>returns false.  However beanInstance.getClass() returns</p>
  
  <pre><code>(org.springframework.beans.factory.config.PropertiesFactoryBean) (id=112)
  </code></pre>
  
  <p>It seems my VM is very confused about this class.  I'm trying to figure out what would cause this confusion, and how I can fix it?</p>
  
  <p>The most likely case seems to be confusion across multiple class loaders, but I haven't found any obvious examples.  There should only be one implementation of PropertiesFactoryBean in my classpath.</p>
  
  <p>What would cause instanceof to fail in this manner?  How can I hunt down my root cause?</p>
  
  <p>Incidentally, this is ultimately a tomcat instance I'm debugging, if it's relevant.  Also, beanInstance <em>is</em> an instanceof Object, so intanceof does work properly sometimes.</p>
  
  <p>ps. I had to type this by hand rather then copy/paste.  Please assume any obvious naming mistakes are typos on my part.</p>
  
  <p>edit: fixed the paren typo mentioned in comments.  I figured I would do that.  This code comes from Spring unmodified by me, so it's safe to assume the code itself is well written and functional, even if I did make a typo</p>