提交 0da7863b 编写于 作者: C Christoph Kutzinski

- avoid filesystem access if file is already fingerprinted

- remove usage of JVM-internal InternalError
上级 dcc10a42
......@@ -126,23 +126,25 @@ public class MavenFingerprinter extends MavenReporter {
/**
* Records the fingerprint of the given {@link Artifact}.
*
* <p>
* This method contains the logic to avoid doubly recording the fingerprint
* of the same file.
*/
private void record(Artifact a, Map<String,String> record) throws IOException, InterruptedException {
File f = a.getFile();
if(files==null)
throw new InternalError();
record(a.getGroupId(), f, record);
}
/**
* Records the fingerprint of the given file.
*
* <p>
* This method contains the logic to avoid doubly recording the fingerprint
* of the same file.
*/
private void record(String groupId, File f, Map<String, String> record) throws IOException, InterruptedException {
if(f==null || !f.exists() || f.isDirectory() || !files.add(f))
if(f==null || files.contains(f) || !f.isFile())
return;
// new file
files.add(f);
String digest = new FilePath(f).digest();
record.put(groupId+':'+f.getName(),digest);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册