Skip to content
Permalink
Browse files
8240555: Using env of JAVA_TOOL_OPTIONS and _JAVA_OPTIONS breaks Quie…
…tOption.java test

Reviewed-by: shurailine, prappo
  • Loading branch information
jonathan-gibbons committed Mar 12, 2020
1 parent 5bc78c4 commit 2eaeb20697147aaacca2f8b51b6815aa6214f25b
Showing with 14 additions and 1 deletion.
  1. +14 −1 test/langtools/jdk/javadoc/tool/QuietOption.java
@@ -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
@@ -32,6 +32,7 @@
import java.io.File;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
@@ -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!.");

0 comments on commit 2eaeb20

Please sign in to comment.