mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8240555: Using env of JAVA_TOOL_OPTIONS and _JAVA_OPTIONS breaks QuietOption.java test
Reviewed-by: shurailine, prappo
This commit is contained in:
parent
5bc78c438b
commit
2eaeb20697
1 changed files with 14 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -32,6 +32,7 @@ import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,6 +66,18 @@ public class QuietOption {
|
||||||
"-quiet",
|
"-quiet",
|
||||||
new File(testSrc, thisClassName + ".java").getPath());
|
new File(testSrc, thisClassName + ".java").getPath());
|
||||||
|
|
||||||
|
if (!output.isEmpty()) {
|
||||||
|
// Remove any lines that might have been generated by the runtime
|
||||||
|
Iterator<String> iter = output.iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
String line = iter.next();
|
||||||
|
if (line.matches("^Picked up .*JAVA.*OPTIONS:.*")) {
|
||||||
|
System.out.println("IGNORING: " + line);
|
||||||
|
iter.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!output.isEmpty()) {
|
if (!output.isEmpty()) {
|
||||||
System.out.println(output);
|
System.out.println(output);
|
||||||
throw new Exception("run1: Shhh!, very chatty javadoc!.");
|
throw new Exception("run1: Shhh!, very chatty javadoc!.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue