Mercurial Hosting > luan
comparison src/goodjava/io/FileClassLoader.java @ 1860:bcb015265c21 default tip
better uniqueClassLoader
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 18 Mar 2025 17:44:35 -0600 |
parents | d4f857a37961 |
children |
comparison
equal
deleted
inserted
replaced
1859:d4f857a37961 | 1860:bcb015265c21 |
---|---|
22 public FileInfo(File file) throws IOException { | 22 public FileInfo(File file) throws IOException { |
23 this.file = file; | 23 this.file = file; |
24 this.checksum = IoUtils.checksum( new BufferedInputStream( new FileInputStream(file) ) ); | 24 this.checksum = IoUtils.checksum( new BufferedInputStream( new FileInputStream(file) ) ); |
25 } | 25 } |
26 | 26 |
27 public boolean equals(Object obj) { | 27 @Override public boolean equals(Object obj) { |
28 if( !(obj instanceof FileInfo) ) | 28 if( !(obj instanceof FileInfo) ) |
29 return false; | 29 return false; |
30 FileInfo fi = (FileInfo)obj; | 30 FileInfo fi = (FileInfo)obj; |
31 return this.checksum==fi.checksum && this.file.getName().equals(fi.file.getName()); | 31 return this.checksum==fi.checksum && this.file.getName().equals(fi.file.getName()); |
32 } | 32 } |
33 | 33 |
34 public int hashCode() { | 34 @Override public int hashCode() { |
35 return (int)checksum; | 35 return (int)checksum; |
36 } | 36 } |
37 } | 37 } |
38 | 38 |
39 private static URL[] toURLs(List<FileInfo> files) { | 39 private static URL[] toURLs(List<FileInfo> files) { |