Remove cli variant of SuppressForbidden (#86274)

The cli lib has the SuppressForbidden annotation, but so does core,
which cli depends on. This commit removes the SuppressForbidden from
cli, in favor of the one from core.

relates #85758
This commit is contained in:
Ryan Ernst 2022-04-28 18:21:33 -07:00 committed by GitHub
parent 51dc7746a1
commit f66ece6a24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 10 additions and 29 deletions

View file

@ -9,9 +9,9 @@
package org.elasticsearch.plugins.cli;
import org.elasticsearch.cli.ExitCodes;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.cli.UserException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.core.SuppressForbidden;
import java.net.InetSocketAddress;
import java.net.Proxy;

View file

@ -8,7 +8,7 @@
package org.elasticsearch.plugins.cli;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.core.SuppressForbidden;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

View file

@ -13,6 +13,8 @@ import joptsimple.OptionParser;
import joptsimple.OptionSet;
import joptsimple.OptionSpec;
import org.elasticsearch.core.SuppressForbidden;
import java.io.Closeable;
import java.io.IOException;
import java.io.PrintWriter;

View file

@ -1,22 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.cli;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Annotation to suppress forbidden-apis errors inside a whole class, a method, or a field.
*/
@Retention(RetentionPolicy.CLASS)
@Target({ ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE })
public @interface SuppressForbidden {
String reason();
}

View file

@ -9,6 +9,7 @@
package org.elasticsearch.cli;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.core.SuppressForbidden;
import java.io.Console;
import java.io.IOException;

View file

@ -6,7 +6,7 @@
*/
package org.elasticsearch.xpack.core.ml.utils.time;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.core.SuppressForbidden;
import java.time.DateTimeException;
import java.time.Instant;

View file

@ -22,7 +22,6 @@ import org.bouncycastle.util.io.pem.PemObjectGenerator;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.cli.ExitCodes;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.cli.Terminal;
import org.elasticsearch.cli.UserException;
import org.elasticsearch.common.Strings;
@ -33,6 +32,7 @@ import org.elasticsearch.common.ssl.PemUtils;
import org.elasticsearch.common.util.Maps;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.core.PathUtils;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.env.Environment;
import org.elasticsearch.xpack.core.ssl.CertParsingUtils;

View file

@ -7,8 +7,8 @@
package org.elasticsearch.xpack.security.cli;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.common.ssl.PemUtils;
import org.elasticsearch.core.SuppressForbidden;
import java.io.IOException;
import java.io.OutputStream;

View file

@ -14,7 +14,6 @@ import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.cli.ExitCodes;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.cli.Terminal;
import org.elasticsearch.cli.UserException;
import org.elasticsearch.common.Strings;
@ -27,6 +26,7 @@ import org.elasticsearch.common.util.LocaleUtils;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.core.CheckedFunction;
import org.elasticsearch.core.PathUtils;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.env.Environment;
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
import org.elasticsearch.xpack.core.security.authc.RealmSettings;

View file

@ -7,8 +7,8 @@
package org.elasticsearch.xpack.sql.cli;
import org.elasticsearch.cli.ExitCodes;
import org.elasticsearch.cli.SuppressForbidden;
import org.elasticsearch.cli.UserException;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.xpack.sql.client.ConnectionConfiguration;
import java.net.URI;