Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ private ManageThreadsActions() {}
currentThread().getThreadGroup().setDaemon(currentThread().getThreadGroup().isDaemon());
}

@EntitlementTest(expectedAccess = PLUGINS)
static void java_util_concurrent_ForkJoinPool$setParallelism() {
ForkJoinPool.commonPool().setParallelism(ForkJoinPool.commonPool().getParallelism());
}

@EntitlementTest(expectedAccess = PLUGINS)
static void java_lang_Thread$setName() {
currentThread().setName(currentThread().getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ static CheckAction alwaysDenied(CheckedRunnable<Exception> action) {
getTestEntries(NioFileSystemActions.class),
getTestEntries(SpiActions.class),
getTestEntries(SystemActions.class),
getTestEntries(VersionSpecificManageThreadsActions.class),
getTestEntries(VersionSpecificNioFileSystemActions.class)
)
.flatMap(Function.identity())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

package org.elasticsearch.entitlement.qa.test;

import org.elasticsearch.core.SuppressForbidden;

@SuppressForbidden(reason = "testing entitlements")
@SuppressWarnings("unused") // used via reflection
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose we don't really need these two lines.

class VersionSpecificManageThreadsActions {
private VersionSpecificManageThreadsActions() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

package org.elasticsearch.entitlement.qa.test;

import org.elasticsearch.core.SuppressForbidden;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.atomic.AtomicBoolean;

import static java.lang.Thread.currentThread;
import static org.elasticsearch.entitlement.qa.test.EntitlementTest.ExpectedAccess.PLUGINS;

@SuppressForbidden(reason = "testing entitlements")
@SuppressWarnings("unused") // used via reflection
class VersionSpecificManageThreadsActions {
private VersionSpecificManageThreadsActions() {}

@EntitlementTest(expectedAccess = PLUGINS)
static void java_util_concurrent_ForkJoinPool$setParallelism() {
ForkJoinPool.commonPool().setParallelism(ForkJoinPool.commonPool().getParallelism());
}
}