- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
static {
final Logger log = LoggerFactory.getLogger(ModulePeer.class);
if (log.isDebugEnabled()) {
final Map<String, Function<String, String>> source = new LinkedHashMap<>();
source.put("LD_LIBRARY_PATH", System::getenv);
source.put("java.library.path", System::getProperty);
source.put("java.class.path", System::getProperty);
final Map<String, Set<Path>> dump = source.entrySet().stream().collect(Collectors.toMap(e -> e
.getKey(), e -> Optional.ofNullable(e.getValue().apply(e.getKey())).map(i -> Pattern
.compile(Pattern.quote(System.getProperty("path.separator"))).splitAsStream(i)).orElse(
Stream.empty()).map(n -> Paths.get(n).toAbsolutePath()) //
.collect(Collectors.toCollection(TreeSet::new)), (u, v) -> {
throw new IllegalStateException(String.format("Duplicate key %s", u));
}, LinkedHashMap::new));
log.info(dump.toString());
}
...
}