mirror of https://github.com/apache/poi.git
OOXMLLiteAgent: Some smaller adjustments
Print unexpected exceptions to stdout instead of silently ignoring them Don't include classes created via Mockito git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
902d1487f7
commit
a59e17590a
|
@ -126,14 +126,16 @@ public class OOXMLLiteAgent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void write(Path path, String item, Set<Integer> hashes) {
|
static void write(Path path, String item, Set<Integer> hashes) {
|
||||||
if (!hashes.contains(item.hashCode())) {
|
if (!hashes.contains(item.hashCode()) &&
|
||||||
|
// exclude classes created via Mockito mocking
|
||||||
|
!item.contains("$MockitoMock$")) {
|
||||||
try {
|
try {
|
||||||
// TODO: check if this is atomic ... as transform() is probably called synchronized, it doesn't matter anyway
|
// TODO: check if this is atomic ... as transform() is probably called synchronized, it doesn't matter anyway
|
||||||
Files.write(path, (item+"\n").getBytes(StandardCharsets.ISO_8859_1), StandardOpenOption.CREATE, StandardOpenOption.APPEND);
|
Files.write(path, (item+"\n").getBytes(StandardCharsets.ISO_8859_1), StandardOpenOption.CREATE, StandardOpenOption.APPEND);
|
||||||
hashes.add(item.hashCode());
|
hashes.add(item.hashCode());
|
||||||
} catch (IOException ignored) {
|
} catch (IOException ex) {
|
||||||
|
System.out.println("Had unexpected exception: " + ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue