Skip to content

Commit

Permalink
8240555: Using env of JAVA_TOOL_OPTIONS and _JAVA_OPTIONS breaks Quie…
Browse files Browse the repository at this point in the history
…tOption.java test

Backport-of: 2eaeb20
  • Loading branch information
shipilev committed Jul 11, 2021
1 parent 3ce8c72 commit 2c49cca
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/langtools/jdk/javadoc/tool/QuietOption.java
Original file line number Diff line number Diff line change
@@ -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.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -32,6 +32,7 @@
import java.io.File;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
Expand Down Expand Up @@ -65,6 +66,18 @@ void run1() throws Exception {
"-quiet",
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()) {
System.out.println(output);
throw new Exception("run1: Shhh!, very chatty javadoc!.");
Expand Down

1 comment on commit 2c49cca

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.