_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q2400
DeploymentOverlayHandler.getName
train
private String getName(CommandContext ctx, boolean failInBatch) throws CommandLineException { final ParsedCommandLine args = ctx.getParsedCommandLine(); final String name = this.name.getValue(args, true); if (name == null) { throw new CommandFormatException(this.name + " is missing v...
java
{ "resource": "" }
q2401
ServiceModuleLoader.moduleSpecServiceName
train
public static ServiceName moduleSpecServiceName(ModuleIdentifier identifier) { if (!isDynamicModule(identifier)) { throw ServerLogger.ROOT_LOGGER.missingModulePrefix(identifier, MODULE_PREFIX); } return MODULE_SPEC_SERVICE_PREFIX.append(identifier.getName()).append(identifier.getSlot...
java
{ "resource": "" }
q2402
ServiceModuleLoader.moduleResolvedServiceName
train
public static ServiceName moduleResolvedServiceName(ModuleIdentifier identifier) { if (!isDynamicModule(identifier)) { throw ServerLogger.ROOT_LOGGER.missingModulePrefix(identifier, MODULE_PREFIX); } return MODULE_RESOLVED_SERVICE_PREFIX.append(identifier.getName()).append(identifier...
java
{ "resource": "" }
q2403
ServiceModuleLoader.moduleServiceName
train
public static ServiceName moduleServiceName(ModuleIdentifier identifier) { if (!identifier.getName().startsWith(MODULE_PREFIX)) { throw ServerLogger.ROOT_LOGGER.missingModulePrefix(identifier, MODULE_PREFIX); } return MODULE_SERVICE_PREFIX.append(identifier.getName()).append(identifi...
java
{ "resource": "" }
q2404
ServiceActivatorProcessor.deploy
train
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES); if (servicesAttachment == n...
java
{ "resource": "" }
q2405
HostControllerConnection.openConnection
train
synchronized void openConnection(final ModelController controller, final ActiveOperation.CompletedCallback<ModelNode> callback) throws Exception { boolean ok = false; final Connection connection = connectionManager.connect(); try { channelHandler.executeRequest(new ServerRegisterRequ...
java
{ "resource": "" }
q2406
HostControllerConnection.asyncReconnect
train
synchronized void asyncReconnect(final URI reconnectUri, String authKey, final ReconnectCallback callback) { if (getState() != State.OPEN) { return; } // Update the configuration with the new credentials final ProtocolConnectionConfiguration config = ProtocolConnectionConfigu...
java
{ "resource": "" }
q2407
HostControllerConnection.doReConnect
train
synchronized boolean doReConnect() throws IOException { // In case we are still connected, test the connection and see if we can reuse it if(connectionManager.isConnected()) { try { final Future<Long> result = channelHandler.executeRequest(ManagementPingRequest.INSTANCE, nul...
java
{ "resource": "" }
q2408
HostControllerConnection.started
train
synchronized void started() { try { if(isConnected()) { channelHandler.executeRequest(new ServerStartedRequest(), null).getResult().await(); } } catch (Exception e) { ServerLogger.AS_ROOT_LOGGER.debugf(e, "failed to send started notification"); ...
java
{ "resource": "" }
q2409
ServerTaskExecutor.executeTask
train
public int executeTask(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, final ServerUpdateTask task) { try { return execute(listener, task.getServerIdentity(), task.getOperation()); } catch (OperationFailedException e) { // Handle failur...
java
{ "resource": "" }
q2410
ServerTaskExecutor.executeOperation
train
protected boolean executeOperation(final TransactionalProtocolClient.TransactionalOperationListener<ServerOperation> listener, TransactionalProtocolClient client, final ServerIdentity identity, final ModelNode operation, final OperationResultTransformer transformer) { if(client == null) { return fal...
java
{ "resource": "" }
q2411
ServerTaskExecutor.recordPreparedOperation
train
void recordPreparedOperation(final TransactionalProtocolClient.PreparedOperation<ServerTaskExecutor.ServerOperation> preparedOperation) { recordPreparedTask(new ServerTaskExecutor.ServerPreparedResponse(preparedOperation)); }
java
{ "resource": "" }
q2412
ServerTaskExecutor.recordOperationPrepareTimeout
train
void recordOperationPrepareTimeout(final BlockingQueueOperationListener.FailedOperation<ServerOperation> failedOperation) { recordPreparedTask(new ServerTaskExecutor.ServerPreparedResponse(failedOperation)); // Swap out the submitted task so we don't wait for the final result. Use a future the returns ...
java
{ "resource": "" }
q2413
InstallationManagerService.installService
train
public static ServiceController<InstallationManager> installService(ServiceTarget serviceTarget) { final InstallationManagerService service = new InstallationManagerService(); return serviceTarget.addService(InstallationManagerService.NAME, service) .addDependency(JBOSS_PRODUCT_CONFIG_SE...
java
{ "resource": "" }
q2414
ClassReflectionIndex.getMethod
train
public Method getMethod(Method method) { return getMethod(method.getReturnType(), method.getName(), method.getParameterTypes()); }
java
{ "resource": "" }
q2415
ClassReflectionIndex.getAllMethods
train
public Collection<Method> getAllMethods(String name) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Collection<Method> methods = new ArrayList<Method>(); for (Map<Class<?>, Metho...
java
{ "resource": "" }
q2416
ClassReflectionIndex.getAllMethods
train
public Collection<Method> getAllMethods(String name, int paramCount) { final Map<ParamList, Map<Class<?>, Method>> nameMap = methods.get(name); if (nameMap == null) { return Collections.emptySet(); } final Collection<Method> methods = new ArrayList<Method>(); for (Map...
java
{ "resource": "" }
q2417
DomainServerCommunicationServices.create
train
public static ServiceActivator create(final ModelNode endpointConfig, final URI managementURI, final String serverName, final String serverProcessName, final String authKey, final boolean managementSubsystemEndpoint, final Supplier<SSLContext> sslContextSupplier) { ret...
java
{ "resource": "" }
q2418
SocketBinding.getMulticastSocketAddress
train
public InetSocketAddress getMulticastSocketAddress() { if (multicastAddress == null) { throw MESSAGES.noMulticastBinding(name); } return new InetSocketAddress(multicastAddress, multicastPort); }
java
{ "resource": "" }
q2419
SocketBinding.createServerSocket
train
public ServerSocket createServerSocket() throws IOException { final ServerSocket socket = getServerSocketFactory().createServerSocket(name); socket.bind(getSocketAddress()); return socket; }
java
{ "resource": "" }
q2420
LoggingDeploymentResources.registerDeploymentResource
train
public static void registerDeploymentResource(final DeploymentResourceSupport deploymentResourceSupport, final LoggingConfigurationService service) { final PathElement base = PathElement.pathElement("configuration", service.getConfiguration()); deploymentResourceSupport.getDeploymentSubModel(LoggingExte...
java
{ "resource": "" }
q2421
DomainUtil.constructUrl
train
public static String constructUrl(final HttpServerExchange exchange, final String path) { final HeaderMap headers = exchange.getRequestHeaders(); String host = headers.getFirst(HOST); String protocol = exchange.getConnection().getSslSessionInfo() != null ? "https" : "http"; return proto...
java
{ "resource": "" }
q2422
PathElement.matches
train
public boolean matches(Property property) { return property.getName().equals(key) && (value == WILDCARD_VALUE || property.getValue().asString().equals(value)); }
java
{ "resource": "" }
q2423
PathElement.matches
train
public boolean matches(PathElement pe) { return pe.key.equals(key) && (isWildcard() || pe.value.equals(value)); }
java
{ "resource": "" }
q2424
Log4jAppenderHandler.setAppender
train
public void setAppender(final Appender appender) { if (this.appender != null) { close(); } checkAccess(this); if (applyLayout && appender != null) { final Formatter formatter = getFormatter(); appender.setLayout(formatter == null ? null : new Formatter...
java
{ "resource": "" }
q2425
AbstractInstallationReporter.createOSNode
train
private ModelNode createOSNode() throws OperationFailedException { String osName = getProperty("os.name"); final ModelNode os = new ModelNode(); if (osName != null && osName.toLowerCase().contains("linux")) { try { os.set(GnuLinuxDistribution.discover()); ...
java
{ "resource": "" }
q2426
AbstractInstallationReporter.createJVMNode
train
private ModelNode createJVMNode() throws OperationFailedException { ModelNode jvm = new ModelNode().setEmptyObject(); jvm.get(NAME).set(getProperty("java.vm.name")); jvm.get(JAVA_VERSION).set(getProperty("java.vm.specification.version")); jvm.get(JVM_VERSION).set(getProperty("java.versio...
java
{ "resource": "" }
q2427
AbstractInstallationReporter.createCPUNode
train
private ModelNode createCPUNode() throws OperationFailedException { ModelNode cpu = new ModelNode().setEmptyObject(); cpu.get(ARCH).set(getProperty("os.arch")); cpu.get(AVAILABLE_PROCESSORS).set(ProcessorInfo.availableProcessors()); return cpu; }
java
{ "resource": "" }
q2428
AbstractInstallationReporter.getProperty
train
private String getProperty(String name) { return System.getSecurityManager() == null ? System.getProperty(name) : doPrivileged(new ReadPropertyAction(name)); }
java
{ "resource": "" }
q2429
ManagementModelNode.explore
train
public void explore() { if (isLeaf) return; if (isGeneric) return; removeAllChildren(); try { String addressPath = addressPath(); ModelNode resourceDesc = executor.doCommand(addressPath + ":read-resource-description"); resourceDesc = resourceDesc.get(...
java
{ "resource": "" }
q2430
ManagementModelNode.addressPath
train
public String addressPath() { if (isLeaf) { ManagementModelNode parent = (ManagementModelNode)getParent(); return parent.addressPath(); } StringBuilder builder = new StringBuilder(); for (Object pathElement : getUserObjectPath()) { UserObject userObj ...
java
{ "resource": "" }
q2431
NetworkUtils.mayBeIPv6Address
train
private static boolean mayBeIPv6Address(String input) { if (input == null) { return false; } boolean result = false; int colonsCounter = 0; int length = input.length(); for (int i = 0; i < length; i++) { char c = input.charAt(i); if (c...
java
{ "resource": "" }
q2432
DomainTransformers.initializeDomainRegistry
train
public static void initializeDomainRegistry(final TransformerRegistry registry) { //The chains for transforming will be as follows //For JBoss EAP: 8.0.0 -> 5.0.0 -> 4.0.0 -> 1.8.0 -> 1.7.0 -> 1.6.0 -> 1.5.0 registerRootTransformers(registry); registerChainedManagementTransformers(regi...
java
{ "resource": "" }
q2433
ProcessUtils.killProcess
train
static boolean killProcess(final String processName, int id) { int pid; try { pid = processUtils.resolveProcessId(processName, id); if(pid > 0) { try { Runtime.getRuntime().exec(processUtils.getKillCommand(pid)); return true...
java
{ "resource": "" }
q2434
Launcher.addEnvironmentVariable
train
public Launcher addEnvironmentVariable(final String key, final String value) { env.put(key, value); return this; }
java
{ "resource": "" }
q2435
RemotingTransformers.buildTransformers_3_0
train
private void buildTransformers_3_0(ResourceTransformationDescriptionBuilder builder) { /* ====== Resource root address: ["subsystem" => "remoting"] - Current version: 4.0.0; legacy version: 3.0.0 ======= --- Problems for relative address to root ["configuration" => "endpoint"]: Different...
java
{ "resource": "" }
q2436
RemotingTransformers.buildTransformers_4_0
train
private void buildTransformers_4_0(ResourceTransformationDescriptionBuilder builder) { // We need to do custom transformation of the attribute in the root resource // related to endpoint configs, as these were moved to the root from a previous child resource EndPointWriteTransformer endPointWri...
java
{ "resource": "" }
q2437
ManagedServer.getState
train
ServerStatus getState() { final InternalState requiredState = this.requiredState; final InternalState state = internalState; if(requiredState == InternalState.FAILED) { return ServerStatus.FAILED; } switch (state) { case STOPPED: return Ser...
java
{ "resource": "" }
q2438
ManagedServer.reload
train
synchronized boolean reload(int permit, boolean suspend) { return internalSetState(new ReloadTask(permit, suspend), InternalState.SERVER_STARTED, InternalState.RELOADING); }
java
{ "resource": "" }
q2439
ManagedServer.start
train
synchronized void start(final ManagedServerBootCmdFactory factory) { final InternalState required = this.requiredState; // Ignore if the server is already started if(required == InternalState.SERVER_STARTED) { return; } // In case the server failed to start, try to st...
java
{ "resource": "" }
q2440
ManagedServer.stop
train
synchronized void stop(Integer timeout) { final InternalState required = this.requiredState; if(required != InternalState.STOPPED) { this.requiredState = InternalState.STOPPED; ROOT_LOGGER.stoppingServer(serverName); // Only send the stop operation if the server is st...
java
{ "resource": "" }
q2441
ManagedServer.reconnectServerProcess
train
synchronized void reconnectServerProcess(final ManagedServerBootCmdFactory factory) { if(this.requiredState != InternalState.SERVER_STARTED) { this.bootConfiguration = factory; this.requiredState = InternalState.SERVER_STARTED; ROOT_LOGGER.reconnectingServer(serverName); ...
java
{ "resource": "" }
q2442
ManagedServer.removeServerProcess
train
synchronized void removeServerProcess() { this.requiredState = InternalState.STOPPED; internalSetState(new ProcessRemoveTask(), InternalState.STOPPED, InternalState.PROCESS_REMOVING); }
java
{ "resource": "" }
q2443
ManagedServer.setServerProcessStopping
train
synchronized void setServerProcessStopping() { this.requiredState = InternalState.STOPPED; internalSetState(null, InternalState.STOPPED, InternalState.PROCESS_STOPPING); }
java
{ "resource": "" }
q2444
ManagedServer.awaitState
train
boolean awaitState(final InternalState expected) { synchronized (this) { final InternalState initialRequired = this.requiredState; for(;;) { final InternalState required = this.requiredState; // Stop in case the server failed to reach the state ...
java
{ "resource": "" }
q2445
ManagedServer.processUnstable
train
boolean processUnstable() { boolean change = !unstable; if (change) { // Only once until the process is removed. A process is unstable until removed. unstable = true; HostControllerLogger.ROOT_LOGGER.managedServerUnstable(serverName); } return change; }
java
{ "resource": "" }
q2446
ManagedServer.callbackUnregistered
train
boolean callbackUnregistered(final TransactionalProtocolClient old, final boolean shuttingDown) { // Disconnect the remote connection. // WFCORE-196 Do this out of the sync block to avoid deadlocks where in-flight requests can't // be informed that the channel has closed protocolClient.d...
java
{ "resource": "" }
q2447
ManagedServer.processFinished
train
synchronized void processFinished() { final InternalState required = this.requiredState; final InternalState state = this.internalState; // If the server was not stopped if(required == InternalState.STOPPED && state == InternalState.PROCESS_STOPPING) { finishTransition(Intern...
java
{ "resource": "" }
q2448
ManagedServer.transitionFailed
train
synchronized void transitionFailed(final InternalState state) { final InternalState current = this.internalState; if(state == current) { // Revert transition and mark as failed switch (current) { case PROCESS_ADDING: this.internalState = Intern...
java
{ "resource": "" }
q2449
ManagedServer.finishTransition
train
private synchronized void finishTransition(final InternalState current, final InternalState next) { internalSetState(getTransitionTask(next), current, next); transition(); }
java
{ "resource": "" }
q2450
SimpleResourceDefinition.registerCapabilities
train
@Override public void registerCapabilities(ManagementResourceRegistration resourceRegistration) { if (capabilities!=null) { for (RuntimeCapability c : capabilities) { resourceRegistration.registerCapability(c); } } if (incorporatingCapabilities != null...
java
{ "resource": "" }
q2451
SimpleResourceDefinition.registerAddOperation
train
@Deprecated @SuppressWarnings("deprecation") protected void registerAddOperation(final ManagementResourceRegistration registration, final OperationStepHandler handler, OperationEntry.Flag... flags) { if (handler instanceof DescriptionProvider) { registration.registerOperationHandler(getOpera...
java
{ "resource": "" }
q2452
ManagementChannelReceiver.handlePing
train
private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException { final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion()); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(resp...
java
{ "resource": "" }
q2453
CLIExpressionResolver.resolveOrOriginal
train
public static String resolveOrOriginal(String input) { try { return resolve(input, true); } catch (UnresolvedExpressionException e) { return input; } }
java
{ "resource": "" }
q2454
AbstractModelControllerClient.executeForResult
train
private OperationResponse executeForResult(final OperationExecutionContext executionContext) throws IOException { try { return execute(executionContext).get(); } catch(Exception e) { throw new IOException(e); } }
java
{ "resource": "" }
q2455
LayersConfig.getLayersConfig
train
public static LayersConfig getLayersConfig(final File repoRoot) throws IOException { final File layersList = new File(repoRoot, LAYERS_CONF); if (!layersList.exists()) { return new LayersConfig(); } final Properties properties = PatchUtils.loadProperties(layersList); ...
java
{ "resource": "" }
q2456
HostXml_Legacy.parseRemoteDomainControllerAttributes_1_5
train
private boolean parseRemoteDomainControllerAttributes_1_5(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, boolean allowDiscoveryOptions) throws XMLStreamException { final ModelNode update = new ModelNode();...
java
{ "resource": "" }
q2457
RemoteProxyController.create
train
public static RemoteProxyController create(final TransactionalProtocolClient client, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator, final ModelVersion targetKernelVersion) { ret...
java
{ "resource": "" }
q2458
RemoteProxyController.create
train
@Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); ...
java
{ "resource": "" }
q2459
RemoteProxyController.translateOperationForProxy
train
public ModelNode translateOperationForProxy(final ModelNode op) { return translateOperationForProxy(op, PathAddress.pathAddress(op.get(OP_ADDR))); }
java
{ "resource": "" }
q2460
BaseNCodecOutputStream.flush
train
private void flush(final boolean propagate) throws IOException { final int avail = baseNCodec.available(context); if (avail > 0) { final byte[] buf = new byte[avail]; final int c = baseNCodec.readResults(buf, 0, avail, context); if (c > 0) { out.write(...
java
{ "resource": "" }
q2461
BaseNCodecOutputStream.close
train
@Override public void close() throws IOException { // Notify encoder of EOF (-1). if (doEncode) { baseNCodec.encode(singleByte, 0, EOF, context); } else { baseNCodec.decode(singleByte, 0, EOF, context); } flush(); out.close(); }
java
{ "resource": "" }
q2462
ExpressionResolverImpl.resolveExpressionsRecursively
train
private ModelNode resolveExpressionsRecursively(final ModelNode node) throws OperationFailedException { if (!node.isDefined()) { return node; } ModelType type = node.getType(); ModelNode resolved; if (type == ModelType.EXPRESSION) { resolved = resolveExpr...
java
{ "resource": "" }
q2463
ExpressionResolverImpl.resolveExpressionStringRecursively
train
private ModelNode resolveExpressionStringRecursively(final String expressionString, final boolean ignoreDMRResolutionFailure, final boolean initial) throws OperationFailedException { ParseAndResolveResult resolved = parseAndResolve(expressionString, ignor...
java
{ "resource": "" }
q2464
ExpressionResolverImpl.resolveExpressionString
train
private String resolveExpressionString(final String unresolvedString) throws OperationFailedException { // parseAndResolve should only be providing expressions with no leading or trailing chars assert unresolvedString.startsWith("${") && unresolvedString.endsWith("}"); // Default result is no ...
java
{ "resource": "" }
q2465
PermissionsParser.unexpectedElement
train
private static XMLStreamException unexpectedElement(final XMLStreamReader reader) { return SecurityManagerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), reader.getLocation()); }
java
{ "resource": "" }
q2466
PermissionsParser.unexpectedAttribute
train
private static XMLStreamException unexpectedAttribute(final XMLStreamReader reader, final int index) { return SecurityManagerLogger.ROOT_LOGGER.unexpectedAttribute(reader.getAttributeName(index), reader.getLocation()); }
java
{ "resource": "" }
q2467
DeploymentUploadUtil.storeContentAndTransformOperation
train
public static byte[] storeContentAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws IOException, OperationFailedException { if (!operation.hasDefined(CONTENT)) { throw createFailureException(DomainControllerLogger.ROOT_LOGGER.invalidConte...
java
{ "resource": "" }
q2468
DeploymentUploadUtil.explodeContentAndTransformOperation
train
public static byte[] explodeContentAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException { final Resource deploymentResource = context.readResource(PathAddress.EMPTY_ADDRESS); ModelNode contentI...
java
{ "resource": "" }
q2469
DeploymentUploadUtil.addContentToExplodedAndTransformOperation
train
public static byte[] addContentToExplodedAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException { final Resource deploymentResource = context.readResource(PathAddress.EMPTY_ADDRESS); ModelNode co...
java
{ "resource": "" }
q2470
DeploymentUploadUtil.removeContentFromExplodedAndTransformOperation
train
public static byte[] removeContentFromExplodedAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException { final Resource deploymentResource = context.readResource(PathAddress.EMPTY_ADDRESS); ModelNo...
java
{ "resource": "" }
q2471
DeploymentUploadUtil.synchronizeSlaveHostController
train
public static byte[] synchronizeSlaveHostController(ModelNode operation, final PathAddress address, HostFileRepository fileRepository, ContentRepository contentRepository, boolean backup, byte[] oldHash) { ModelNode operationContentItem = operation.get(DeploymentAttributes.CONTENT_RESOURCE_ALL.getName()).get(0)...
java
{ "resource": "" }
q2472
AnnotationIndexProcessor.deploy
train
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); for (ResourceRoot resourceRoot : DeploymentUtils.allResourceRoots(deploymentUnit)) { ResourceRootIndexer.indexResourceRoo...
java
{ "resource": "" }
q2473
IoUtils.newFile
train
public static File newFile(File baseDir, String... segments) { File f = baseDir; for (String segment : segments) { f = new File(f, segment); } return f; }
java
{ "resource": "" }
q2474
PasswordCheckUtil.check
train
public PasswordCheckResult check(boolean isAdminitrative, String userName, String password) { // TODO: allow custom restrictions? List<PasswordRestriction> passwordValuesRestrictions = getPasswordRestrictions(); final PasswordStrengthCheckResult strengthResult = this.passwordStrengthChecker.chec...
java
{ "resource": "" }
q2475
ServerGroupChooser.getCmdLineArg
train
public String getCmdLineArg() { StringBuilder builder = new StringBuilder(" --server-groups="); boolean foundSelected = false; for (JCheckBox serverGroup : serverGroups) { if (serverGroup.isSelected()) { foundSelected = true; builder.append(serverGrou...
java
{ "resource": "" }
q2476
ZipCompletionScanner.isCompleteZip
train
public static boolean isCompleteZip(File file) throws IOException, NonScannableZipException { FileChannel channel = null; try { channel = new FileInputStream(file).getChannel(); long size = channel.size(); if (size < ENDLEN) { // Obvious case return ...
java
{ "resource": "" }
q2477
ZipCompletionScanner.scanForEndSig
train
private static boolean scanForEndSig(File file, FileChannel channel) throws IOException, NonScannableZipException { // TODO Consider just reading in MAX_REVERSE_SCAN bytes -- increased peak memory cost but less complex ByteBuffer bb = getByteBuffer(CHUNK_SIZE); long start = channel.size(); ...
java
{ "resource": "" }
q2478
HostControllerRegistrationHandler.sendFailedResponse
train
static void sendFailedResponse(final ManagementRequestContext<RegistrationContext> context, final byte errorCode, final String message) throws IOException { final ManagementResponseHeader header = ManagementResponseHeader.create(context.getRequestHeader()); final FlushableDataOutput output = context.wri...
java
{ "resource": "" }
q2479
InterfaceDefinition.isOperationDefined
train
public static boolean isOperationDefined(final ModelNode operation) { for (final AttributeDefinition def : ROOT_ATTRIBUTES) { if (operation.hasDefined(def.getName())) { return true; } } return false; }
java
{ "resource": "" }
q2480
InterfaceDefinition.wrapAsList
train
@Deprecated private static ListAttributeDefinition wrapAsList(final AttributeDefinition def) { final ListAttributeDefinition list = new ListAttributeDefinition(new SimpleListAttributeDefinition.Builder(def.getName(), def) .setElementValidator(def.getValidator())) { @Override ...
java
{ "resource": "" }
q2481
BlockingTimeoutImpl.resolveDomainTimeoutAdder
train
private static int resolveDomainTimeoutAdder() { String propValue = WildFlySecurityManager.getPropertyPrivileged(DOMAIN_TEST_SYSTEM_PROPERTY, DEFAULT_DOMAIN_TIMEOUT_STRING); if (sysPropDomainValue == null || !sysPropDomainValue.equals(propValue)) { // First call or the system property change...
java
{ "resource": "" }
q2482
TransformerRegistry.getDomainRegistration
train
public TransformersSubRegistration getDomainRegistration(final ModelVersionRange range) { final PathAddress address = PathAddress.EMPTY_ADDRESS; return new TransformersSubRegistrationImpl(range, domain, address); }
java
{ "resource": "" }
q2483
TransformerRegistry.getHostRegistration
train
public TransformersSubRegistration getHostRegistration(final ModelVersionRange range) { final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST); return new TransformersSubRegistrationImpl(range, domain, address); }
java
{ "resource": "" }
q2484
TransformerRegistry.getServerRegistration
train
public TransformersSubRegistration getServerRegistration(final ModelVersionRange range) { final PathAddress address = PathAddress.EMPTY_ADDRESS.append(HOST, SERVER); return new TransformersSubRegistrationImpl(range, domain, address); }
java
{ "resource": "" }
q2485
TransformerRegistry.resolveServer
train
public OperationTransformerRegistry resolveServer(final ModelVersion mgmtVersion, final ModelNode subsystems) { return resolveServer(mgmtVersion, resolveVersions(subsystems)); }
java
{ "resource": "" }
q2486
TransformerRegistry.addSubsystem
train
void addSubsystem(final OperationTransformerRegistry registry, final String name, final ModelVersion version) { final OperationTransformerRegistry profile = registry.getChild(PathAddress.pathAddress(PROFILE)); final OperationTransformerRegistry server = registry.getChild(PathAddress.pathAddress(HOST, SE...
java
{ "resource": "" }
q2487
PropertiesFileLoader.persistProperties
train
public synchronized void persistProperties() throws IOException { beginPersistence(); // Read the properties file into memory // Shouldn't be so bad - it's a small file List<String> content = readFile(propertiesFile); BufferedWriter bw = new BufferedWriter(new OutputStreamWrite...
java
{ "resource": "" }
q2488
PropertiesFileLoader.addLineContent
train
protected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException { content.add(line); }
java
{ "resource": "" }
q2489
PropertiesFileLoader.endPersistence
train
protected void endPersistence(final BufferedWriter writer) throws IOException { // Append any additional users to the end of the file. for (Object currentKey : toSave.keySet()) { String key = (String) currentKey; if (!key.contains(DISABLE_SUFFIX_KEY)) { writePrope...
java
{ "resource": "" }
q2490
ServicesAttachment.getServiceImplementations
train
public List<String> getServiceImplementations(String serviceTypeName) { final List<String> strings = services.get(serviceTypeName); return strings == null ? Collections.<String>emptyList() : Collections.unmodifiableList(strings); }
java
{ "resource": "" }
q2491
EmbeddedLogContext.configureLogContext
train
static synchronized LogContext configureLogContext(final File logDir, final File configDir, final String defaultLogFileName, final CommandContext ctx) { final LogContext embeddedLogContext = Holder.LOG_CONTEXT; final Path bootLog = logDir.toPath().resolve(Paths.get(defaultLogFileName)); final Pa...
java
{ "resource": "" }
q2492
EmbeddedLogContext.clearLogContext
train
static synchronized void clearLogContext() { final LogContext embeddedLogContext = Holder.LOG_CONTEXT; // Remove the configurator and clear the log context final Configurator configurator = embeddedLogContext.getLogger("").detach(Configurator.ATTACHMENT_KEY); // If this was a PropertyCon...
java
{ "resource": "" }
q2493
CorsUtil.matchOrigin
train
public static String matchOrigin(HttpServerExchange exchange, Collection<String> allowedOrigins) throws Exception { HeaderMap headers = exchange.getRequestHeaders(); String[] origins = headers.get(Headers.ORIGIN).toArray(); if (allowedOrigins != null && !allowedOrigins.isEmpty()) { f...
java
{ "resource": "" }
q2494
DeploymentReflectionIndex.create
train
public static DeploymentReflectionIndex create() { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(ServerPermission.CREATE_DEPLOYMENT_REFLECTION_INDEX); } return new DeploymentReflectionIndex(); }
java
{ "resource": "" }
q2495
AbstractResourceRegistration.getOperationDescriptions
train
@Override public final Map<String, OperationEntry> getOperationDescriptions(final PathAddress address, boolean inherited) { if (parent != null) { RootInvocation ri = getRootInvocation(); return ri.root.getOperationDescriptions(ri.pathAddress.append(address), inherited); } ...
java
{ "resource": "" }
q2496
AbstractResourceRegistration.hasNoAlternativeWildcardRegistration
train
boolean hasNoAlternativeWildcardRegistration() { return parent == null || PathElement.WILDCARD_VALUE.equals(valueString) || !parent.getChildNames().contains(PathElement.WILDCARD_VALUE); }
java
{ "resource": "" }
q2497
CLIAccessControl.getAccessControl
train
public static ModelNode getAccessControl(ModelControllerClient client, OperationRequestAddress address, boolean operations) { return getAccessControl(client, null, address, operations); }
java
{ "resource": "" }
q2498
SynopsisGenerator.generateSynopsis
train
String generateSynopsis() { synopsisOptions = buildSynopsisOptions(opts, arg, domain); StringBuilder synopsisBuilder = new StringBuilder(); if (parentName != null) { synopsisBuilder.append(parentName).append(" "); } synopsisBuilder.append(commandName); if (isO...
java
{ "resource": "" }
q2499
InstalledIdentity.load
train
protected static InstallationModificationImpl.InstallationState load(final InstalledIdentity installedIdentity) throws IOException { final InstallationModificationImpl.InstallationState state = new InstallationModificationImpl.InstallationState(); for (final Layer layer : installedIdentity.getLayers()) ...
java
{ "resource": "" }