< prev index next >

src/java.base/share/classes/jdk/internal/module/ModuleReferenceImpl.java

Print this page




 146     }
 147 
 148     private int hash;
 149 
 150     @Override
 151     public boolean equals(Object ob) {
 152         if (!(ob instanceof ModuleReferenceImpl))
 153             return false;
 154         ModuleReferenceImpl that = (ModuleReferenceImpl)ob;
 155 
 156         // assume module content, recorded hashes, etc. are the same
 157         // when the modules have equal module descriptors, are at the
 158         // same location, and are patched by the same patcher.
 159         return Objects.equals(this.descriptor(), that.descriptor())
 160                 && Objects.equals(this.location(), that.location())
 161                 && Objects.equals(this.patcher, that.patcher);
 162     }
 163 
 164     @Override
 165     public String toString() {
 166         return super.toString();







 167     }
 168 
 169 }


 146     }
 147 
 148     private int hash;
 149 
 150     @Override
 151     public boolean equals(Object ob) {
 152         if (!(ob instanceof ModuleReferenceImpl))
 153             return false;
 154         ModuleReferenceImpl that = (ModuleReferenceImpl)ob;
 155 
 156         // assume module content, recorded hashes, etc. are the same
 157         // when the modules have equal module descriptors, are at the
 158         // same location, and are patched by the same patcher.
 159         return Objects.equals(this.descriptor(), that.descriptor())
 160                 && Objects.equals(this.location(), that.location())
 161                 && Objects.equals(this.patcher, that.patcher);
 162     }
 163 
 164     @Override
 165     public String toString() {
 166         StringBuilder sb = new StringBuilder();
 167         sb.append("[module ");
 168         sb.append(descriptor().name());
 169         sb.append(", location=");
 170         sb.append(location().orElseThrow(() -> new InternalError()));
 171         if (isPatched()) sb.append(" (patched)");
 172         sb.append("]");
 173         return sb.toString();
 174     }
 175 
 176 }
< prev index next >