--- a/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java Wed Feb 25 17:24:13 2015 +0000
+++ b/jdk/test/java/lang/invoke/lambda/LogGeneratedClassesTest.java Wed Feb 25 18:41:07 2015 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Predicate;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -235,8 +236,23 @@
.filter(s -> s.startsWith("WARNING: Exception"))
.count(),
2, "show error each capture");
- // dumpLong/com/example/nosense/nosense
- assertEquals(Files.walk(Paths.get("dumpLong")).count(), 5, "Two lambda captured failed to log");
+ // dumpLong/com/example/nonsense/nonsense
+ Path dumpPath = Paths.get("dumpLong/com/example/nonsense");
+ Predicate<Path> filter = p -> p.getParent() == null || dumpPath.startsWith(p) || p.startsWith(dumpPath);
+ boolean debug = true;
+ if (debug) {
+ Files.walk(Paths.get("dumpLong"))
+ .forEachOrdered(p -> {
+ if (filter.test(p)) {
+ System.out.println("accepted: " + p.toString());
+ } else {
+ System.out.println("filetered out: " + p.toString());
+ }
+ });
+ }
+ assertEquals(Files.walk(Paths.get("dumpLong"))
+ .filter(filter)
+ .count(), 5, "Two lambda captured failed to log");
tr.assertZero("Should still return 0");
}
}