8170228: register closed @requires property setter
Reviewed-by: vlivanov, dfazunen
--- a/test/jtreg-ext/requires/VMProps.java Thu Nov 24 15:27:33 2016 +0100
+++ b/test/jtreg-ext/requires/VMProps.java Wed Nov 23 12:25:21 2016 +0300
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -62,7 +63,7 @@
map.put("vm.debug", vmDebug());
vmGC(map); // vm.gc.X = true/false
- dump(map);
+ VMProps.dump(map);
return map;
}
@@ -180,7 +181,7 @@
*
* @param map
*/
- protected void dump(Map<String, String> map) {
+ protected static void dump(Map<String, String> map) {
String dumpFileName = System.getProperty("vmprops.dump");
if (dumpFileName == null) {
return;
@@ -188,7 +189,7 @@
List<String> lines = new ArrayList<>();
map.forEach((k, v) -> lines.add(k + ":" + v));
try {
- Files.write(Paths.get(dumpFileName), lines);
+ Files.write(Paths.get(dumpFileName), lines, StandardOpenOption.APPEND);
} catch (IOException e) {
throw new RuntimeException("Failed to dump properties into '"
+ dumpFileName + "'", e);