提交 844b1b1f 编写于 作者: D darcy

8022190: Fix varargs lint warnings in the JDK

Reviewed-by: alanb, lancea, alexsch
上级 78cc45b9
......@@ -827,6 +827,7 @@ public interface Stream<T> extends BaseStream<T, Stream<T>> {
* @return the new stream
*/
@SafeVarargs
@SuppressWarnings("varargs") // Creating a stream from an array is safe
public static<T> Stream<T> of(T... values) {
return Arrays.stream(values);
}
......
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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
......@@ -405,6 +405,7 @@ public abstract class SwingWorker<T, V> implements RunnableFuture<T> {
*
*/
@SafeVarargs
@SuppressWarnings("varargs") // Passing chunks to add is safe
protected final void publish(V... chunks) {
synchronized (this) {
if (doProcess == null) {
......
......@@ -88,6 +88,7 @@ public class AnnotationParser {
* @param selectAnnotationClasses an array of annotation types to select when parsing
*/
@SafeVarargs
@SuppressWarnings("varargs") // selectAnnotationClasses is used safely
static Map<Class<? extends Annotation>, Annotation> parseSelectAnnotations(
byte[] rawAnnotations,
ConstantPool constPool,
......
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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
......@@ -121,6 +121,7 @@ public abstract class AccumulativeRunnable<T> implements Runnable {
* @param args the arguments to accumulate
*/
@SafeVarargs
@SuppressWarnings("varargs") // Copying args is safe
public final synchronized void add(T... args) {
boolean isSubmitted = true;
if (arguments == null) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册