diff options
author | gjoranv <gv@verizonmedia.com> | 2022-03-31 23:56:58 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-04-01 00:05:37 +0200 |
commit | df2fa80f10ee2f9516330a58de2abe2f206b5387 (patch) | |
tree | 3ceca61730853ec2400708c8fb0e54e7941d1f57 | |
parent | ffade9acb7b44f15104367aa69301bea05b6f252 (diff) |
Suppress "removal" warnings for java.lang.SecurityManager
3 files changed, 8 insertions, 1 deletions
diff --git a/searchlib/src/test/java/com/yahoo/searchlib/gbdt/GbdtConverterTestCase.java b/searchlib/src/test/java/com/yahoo/searchlib/gbdt/GbdtConverterTestCase.java index fa54af25481..d846d322720 100644 --- a/searchlib/src/test/java/com/yahoo/searchlib/gbdt/GbdtConverterTestCase.java +++ b/searchlib/src/test/java/com/yahoo/searchlib/gbdt/GbdtConverterTestCase.java @@ -22,11 +22,13 @@ import static org.junit.Assert.fail; public class GbdtConverterTestCase { @Before + @SuppressWarnings("removal") public void enableSecurityManager() { System.setSecurityManager(new NoExitSecurityManager()); } @After + @SuppressWarnings("removal") public void disableSecurityManager() { System.setSecurityManager(null); } @@ -140,6 +142,7 @@ public class GbdtConverterTestCase { } } + @SuppressWarnings("removal") private static class NoExitSecurityManager extends SecurityManager { @Override diff --git a/vespajlib/src/main/java/com/yahoo/concurrent/ThreadFactoryFactory.java b/vespajlib/src/main/java/com/yahoo/concurrent/ThreadFactoryFactory.java index 1779179efcd..a2478046a9e 100644 --- a/vespajlib/src/main/java/com/yahoo/concurrent/ThreadFactoryFactory.java +++ b/vespajlib/src/main/java/com/yahoo/concurrent/ThreadFactoryFactory.java @@ -36,6 +36,7 @@ public class ThreadFactoryFactory { final String namePrefix; final boolean isDaemon; + @SuppressWarnings("removal") Factory(final String name, boolean isDaemon) { this.isDaemon = isDaemon; final SecurityManager s = System.getSecurityManager(); diff --git a/vespajlib/src/test/java/com/yahoo/io/FatalErrorHandlerTestCase.java b/vespajlib/src/test/java/com/yahoo/io/FatalErrorHandlerTestCase.java index 1999323af6b..dab91b6a995 100644 --- a/vespajlib/src/test/java/com/yahoo/io/FatalErrorHandlerTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/io/FatalErrorHandlerTestCase.java @@ -12,9 +12,10 @@ import org.junit.Test; /** * Just to remove noise from the coverage report. * - * @author <a href="mailto:steinar@yahoo-inc.com">Steinar Knutsen</a> + * @author Steinar Knutsen */ public class FatalErrorHandlerTestCase { + @SuppressWarnings("removal") private static final class AvoidExiting extends SecurityManager { @Override @@ -31,12 +32,14 @@ public class FatalErrorHandlerTestCase { private FatalErrorHandler h; @Before + @SuppressWarnings("removal") public void setUp() throws Exception { h = new FatalErrorHandler(); System.setSecurityManager(new AvoidExiting()); } @After + @SuppressWarnings("removal") public void tearDown() throws Exception { System.setSecurityManager(null); } |