hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 2264 55d0115a54fe
parent 2131 98f9cef66a34
child 2343 6113864ecd70
equal deleted inserted replaced
2263:f73ef83db2ab 2264:55d0115a54fe
  1857       return UTF8::equal(name1, length1, name2, length2);
  1857       return UTF8::equal(name1, length1, name2, length2);
  1858     }
  1858     }
  1859   }
  1859   }
  1860 }
  1860 }
  1861 
  1861 
       
  1862 // Returns true iff super_method can be overridden by a method in targetclassname
       
  1863 // See JSL 3rd edition 8.4.6.1
       
  1864 // Assumes name-signature match
       
  1865 // "this" is instanceKlass of super_method which must exist
       
  1866 // note that the instanceKlass of the method in the targetclassname has not always been created yet
       
  1867 bool instanceKlass::is_override(methodHandle super_method, Handle targetclassloader, symbolHandle targetclassname, TRAPS) {
       
  1868    // Private methods can not be overridden
       
  1869    if (super_method->is_private()) {
       
  1870      return false;
       
  1871    }
       
  1872    // If super method is accessible, then override
       
  1873    if ((super_method->is_protected()) ||
       
  1874        (super_method->is_public())) {
       
  1875      return true;
       
  1876    }
       
  1877    // Package-private methods are not inherited outside of package
       
  1878    assert(super_method->is_package_private(), "must be package private");
       
  1879    return(is_same_class_package(targetclassloader(), targetclassname()));
       
  1880 }
  1862 
  1881 
  1863 jint instanceKlass::compute_modifier_flags(TRAPS) const {
  1882 jint instanceKlass::compute_modifier_flags(TRAPS) const {
  1864   klassOop k = as_klassOop();
  1883   klassOop k = as_klassOop();
  1865   jint access = access_flags().as_int();
  1884   jint access = access_flags().as_int();
  1866 
  1885