buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); for (String attribute : PlatformMBeanConstants.THREADING_READ_ATTRIBUTES) { final ModelNode store = result.get(attribute); try ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); for (String attribute : PlatformMBeanConstants.THREADING_READ_ATTRIBUTES) { final ModelNode store = result.get(attribute); try ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { try { ManagementFactory.getThreadMXBean().resetPeakThreadCount(); } catch (SecurityException e) { throw new OperationFailedException(new ModelNode().set(e.toString())); ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { try { ManagementFactory.getThreadMXBean().resetPeakThreadCount(); } catch (SecurityException e) { throw new OperationFailedException(new ModelNode().set(e.toString())); ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { validator.validate(operation); ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); try { long id = operation.require(PlatformMBeanConstants.ID).asLong(); Thread...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { validator.validate(operation); ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); try { long id = operation.require(PlatformMBeanConstants.ID).asLong(); Thread...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { try { final long[] ids = getIds(operation); ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); ThreadInfo[] infos; if (operation.hasDefined(PlatformMBe...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { try { final long[] ids = getIds(operation); ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); ThreadInfo[] infos; if (operation.hasDefined(PlatformMBe...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { validator.validate(operation); try { long id = operation.require(PlatformMBeanConstants.ID).asLong(); context.getResult().set(ManagementFactory.getThreadMXBean().getThreadUs...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { validator.validate(operation); try { long id = operation.require(PlatformMBeanConstants.ID).asLong(); context.getResult().set(ManagementFactory.getThreadMXBean().getThreadUs...
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { // Add the log store resource final ModelNode model = resource.getModel(); for (final SimpleAttributeDefinition attribute : LogStoreDefinition.LOG_STORE_ATTRIBUTE) { ...
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { // Add the log store resource final ModelNode model = resource.getModel(); for (final SimpleAttributeDefinition attribute : LogStoreDefinition.LOG_STORE_ATTRIBUTE) { ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { MBeanServer mbs = TransactionExtension.getMBeanServer(context); final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); try { // Get the internal object name ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { MBeanServer mbs = TransactionExtension.getMBeanServer(context); final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); try { // Get the internal object name ...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { MBeanServer mbs = TransactionExtension.getMBeanServer(context); final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); try { final ObjectName on = LogStoreRes...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { MBeanServer mbs = TransactionExtension.getMBeanServer(context); final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); try { final ObjectName on = LogStoreRes...
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { TxStat stat = TxStat.getStat(operation.require(ModelDescriptionConstants.NAME).asString()); if (stat == null) { context.getFailureDescription().set(MESSAGES.unknownMetric(o...
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { TxStat stat = TxStat.getStat(operation.require(ModelDescriptionConstants.NAME).asString()); if (stat == null) { context.getFailureDescription().set(MESSAGES.unknownMetric(o...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String name = address.getLastElement().getValue(); final...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String name = address.getLastElement().getValue(); final...
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)); final Resource web = context.readResourceFromRoot(address.subAddress...
protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { final PathAddress address = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)); final Resource web = context.readResourceFromRoot(address.subAddress...
public void testGetLine() throws IOException { CSVParser parser = new CSVParser(new StringReader(code)); for (String[] re : res) { assertTrue(Arrays.equals(re, parser.getRecord().values())); } assertTrue(parser.getRecord() == null); }
public void testGetLine() throws IOException { CSVParser parser = new CSVParser(new StringReader(code)); for (String[] re : res) { assertTrue(Arrays.equals(re, parser.getRecord().values())); } assertNull(parser.getRecord()); }
public String colognePhonetic(String text) { if (text == null) { return null; } text = preprocess(text); CologneLeftBuffer left = new CologneLeftBuffer(text.length() * 2); CologneRightBuffer right = new CologneRightBuffer(text.toCharArray()); char nextC...
public String colognePhonetic(String text) { if (text == null) { return null; } text = preprocess(text); CologneLeftBuffer left = new CologneLeftBuffer(text.length() * 2); CologneRightBuffer right = new CologneRightBuffer(text.toCharArray()); char nextC...
package org.apache.commons.math.analysis.integration; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the A...
package org.apache.commons.math.analysis.integration; /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the A...
public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext context) { Principal user = new RealmUser(ANONYMOUS_USER); Subject subject = new Subject(); subject.getPrincipals().add(user); SocketAddress address = exchange.getConnection().getPeerAddre...
public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, SecurityContext context) { Principal user = new RealmUser(ANONYMOUS_USER); Subject subject = new Subject(); subject.getPrincipals().add(user); SocketAddress address = exchange.getConnection().getPeerAddre...
public boolean isConnectEagerly() { return false; }
public boolean isConnectEagerly() { return true; }
public void testSFSBAccessFailureWithoutSession() throws Exception { // create a locator without a session final StatefulEJBLocator<Counter> locator = new StatefulEJBLocator<Counter>(Counter.class, APP_NAME, MODULE_NAME, CounterBean.class.getSimpleName(), "", null, Affinity.NONE); final Coun...
public void testSFSBAccessFailureWithoutSession() throws Exception { // create a locator without a session final StatefulEJBLocator<Counter> locator = new StatefulEJBLocator<Counter>(Counter.class, APP_NAME, MODULE_NAME, CounterBean.class.getSimpleName(), "", null, Affinity.NONE, null); fina...
public AuthenticationMechanismOutcome authenticate(final HttpServerExchange exchange, final SecurityContext securityContext) { final ServletRequestContext requestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); final JASPIServerAuthenticationManager sam = createJASPIAuthentica...
public AuthenticationMechanismOutcome authenticate(final HttpServerExchange exchange, final SecurityContext securityContext) { final ServletRequestContext requestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); final JASPIServerAuthenticationManager sam = createJASPIAuthentica...
import backtype.storm.drpc.CoordinatedBolt; package backtype.storm; import backtype.storm.coordination.CoordinatedBolt; public class Constants { public static final String COORDINATED_STREAM_ID = CoordinatedBolt.class.getName() + "/coord-stream"; }
import backtype.storm.drpc.CoordinatedBolt; package backtype.storm; import backtype.storm.drpc.CoordinatedBolt; public class Constants { public static final String COORDINATED_STREAM_ID = CoordinatedBolt.class.getName() + "/coord-stream"; }
public void testLoad() throws Exception { // Load from a URL empiricalDistribution.load(url); checkDistribution(); // Load again from a file (also verifies idempotency of load) File file = new File(url.getFile()); empiricalDistribution.load(file); che...
public void testLoad() throws Exception { // Load from a URL empiricalDistribution.load(url); checkDistribution(); // Load again from a file (also verifies idempotency of load) File file = new File(url.toURI()); empiricalDistribution.load(file); check...
protected String getSubsystemXml() throws IOException { return readResource("identity-management-subsystem-example-2.0.xml"); }
protected String getSubsystemXml() throws IOException { return readResource("identity-management-subsystem-example-1.0.xml"); }
public void start(StartContext context) throws StartException { callbackHandle = pathManagerInjector.getValue().registerCallback(pathRef, PathManager.ReloadServerCallback.create(), PathManager.Event.UPDATED, PathManager.Event.REMOVED); String objectStoreDir = pathManagerInjector.getValue().resolveRe...
public void start(StartContext context) throws StartException { callbackHandle = pathManagerInjector.getValue().registerCallback(pathRef, PathManager.ReloadServerCallback.create(), PathManager.Event.UPDATED, PathManager.Event.REMOVED); String objectStoreDir = pathManagerInjector.getValue().resolveRe...
private Object getObjectInstance(final Object object, final Name name, final Hashtable<?, ?> environment) throws NamingException { try { final ObjectFactoryBuilder factoryBuilder = ObjectFactoryBuilder.INSTANCE; final ObjectFactory objectFactory = factoryBuilder.createObjectFactory(o...
private Object getObjectInstance(final Object object, final Name name, final Hashtable<?, ?> environment) throws NamingException { try { final ObjectFactoryBuilder factoryBuilder = ObjectFactoryBuilder.INSTANCE; final ObjectFactory objectFactory = factoryBuilder.createObjectFactory(o...
protected void deployComponent(final DeploymentPhaseContext phaseContext, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(...
protected void deployComponent(final DeploymentPhaseContext phaseContext, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(...
protected void addComponentInstanceSystemInterceptorFactory(InterceptorFactory interceptorFactory) { getComponentSystemInterceptorFactories().add(interceptorFactory); }
protected void addComponentInstanceSystemInterceptorFactory(InterceptorFactory interceptorFactory) { getComponentInstanceSystemInterceptorFactories().add(interceptorFactory); }
package org.springframework.messaging.simp.broker; /* * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
package org.springframework.messaging.simp.broker; /* * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
public CacheEntryMutator(Cache<K, V> cache, CacheInvoker invoker, K id, V value, Flag... flags) { this.cache = cache; this.invoker = invoker; this.id = id; this.value = value; this.flags = EnumSet.of(Flag.IGNORE_RETURN_VALUES, flags); this.mutated = cache.getCacheConf...
public CacheEntryMutator(Cache<K, V> cache, CacheInvoker invoker, K id, V value, Flag... flags) { this.cache = cache; this.invoker = invoker; this.id = id; this.value = value; this.flags = EnumSet.of(Flag.IGNORE_RETURN_VALUES, flags); this.mutated = cache.getCacheConf...
package org.jboss.as.host.controller; /* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can r...
package org.jboss.as.host.controller; /* * JBoss, Home of Professional Open Source. * Copyright 2010, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can r...
NewHostModel getController(); /* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistrib...
NewHostModel getController(); /* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistrib...
private CacheContainerReadAttributeHandler() { this(CacheContainerResourceDefinition.ATTRIBUTES); }
private CacheContainerReadAttributeHandler() { this(CacheContainerResourceDefinition.CACHE_CONTAINER_ATTRIBUTES); }
public CacheContainerWriteAttributeHandler() { this(CacheContainerResourceDefinition.ATTRIBUTES); }
public CacheContainerWriteAttributeHandler() { this(CacheContainerResourceDefinition.CACHE_CONTAINER_ATTRIBUTES); }
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_STORE,...
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_STORE,...
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the file store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_S...
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the file store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_S...
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the file store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_S...
private void parseFileStore(XMLExtendedStreamReader reader, ModelNode cache, List<ModelNode> operations) throws XMLStreamException { // ModelNode for the file store add operation ModelNode storeAddress = cache.get(ModelDescriptionConstants.OP_ADDR).clone() ; storeAddress.add(ModelKeys.FILE_S...
public void testCacheContainerRemoveRemoveSequence() throws Exception { // Parse and install the XML into the controller String subsystemXml = getSubsystemXml() ; KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build(); ModelNode addContai...
public void testCacheContainerRemoveRemoveSequence() throws Exception { // Parse and install the XML into the controller String subsystemXml = getSubsystemXml() ; KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build(); ModelNode addContai...
protected static PathAddress getCacheContainerAddress(String containerName) { return PathAddress.pathAddress(InfinispanSubsystemResourceDefinition.PATH).append(ModelKeys.CACHE_CONTAINER, containerName); }
protected static PathAddress getCacheContainerAddress(String containerName) { return PathAddress.pathAddress(InfinispanExtension.SUBSYSTEM_PATH).append(ModelKeys.CACHE_CONTAINER, containerName); }
private void checkLegacyParserStatisticsTrue(ModelNode subsystem) { if (xmlFile.endsWith("1_0.xml") || xmlFile.endsWith("1_1.xml") || xmlFile.endsWith("1_2.xml") || xmlFile.endsWith("1_3.xml") || xmlFile.endsWith("1_4.xml")) { for (Property containerProp : subsystem.get(CacheContainerResourceDef...
private void checkLegacyParserStatisticsTrue(ModelNode subsystem) { if (xmlFile.endsWith("1_0.xml") || xmlFile.endsWith("1_1.xml") || xmlFile.endsWith("1_2.xml") || xmlFile.endsWith("1_3.xml") || xmlFile.endsWith("1_4.xml")) { for (Property containerProp : subsystem.get(CacheContainerResourceDef...
public void testProtocolStackAddRemoveSequenceWithParameters() throws Exception { // Parse and install the XML into the controller String subsystemXml = getSubsystemXml() ; KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build(); // add a p...
public void testProtocolStackAddRemoveSequenceWithParameters() throws Exception { // Parse and install the XML into the controller String subsystemXml = getSubsystemXml() ; KernelServices servicesA = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build(); // add a p...
public AuditLogHandlerBootDisabledTestCase() { super(false, true); }
public AuditLogHandlerBootDisabledTestCase() { super(false); }
public AuditLogHandlerBootEnabledTestCase() { super(true, true); }
public AuditLogHandlerBootEnabledTestCase() { super(true); }
public ManagementRequestHandler<?, ?> resolveHandler(RequestHandlerChain handlers, ManagementRequestHeader header) { final byte operationId = header.getOperationId(); switch (operationId) { case DomainControllerProtocol.UNREGISTER_HOST_CONTROLLER_REQUEST: { handlers.regis...
public ManagementRequestHandler<?, ?> resolveHandler(RequestHandlerChain handlers, ManagementRequestHeader header) { final byte operationId = header.getOperationId(); switch (operationId) { case DomainControllerProtocol.UNREGISTER_HOST_CONTROLLER_REQUEST: { handlers.regis...
public TransformedOperation transformOperation(final TransformationContext ctx, final PathAddress address, final ModelNode operation) throws OperationFailedException { if(discardPolicy.discard(operation, address, ctx)) { return OperationTransformer.DISCARD.transformOperat...
public TransformedOperation transformOperation(final TransformationContext ctx, final PathAddress address, final ModelNode operation) throws OperationFailedException { if(discardPolicy.discard(operation, address, ctx)) { return OperationTransformer.DISCARD.transformOperat...
public boolean needsScheduling(TopologyDetails topology) { int desiredNumWorkers = ((Number) topology.getConf().get(Config.TOPOLOGY_WORKERS)).intValue(); int assignedNumWorkers = this.getAssignedNumWorkers(topology); if (desiredNumWorkers > assignedNumWorkers) { return true; ...
public boolean needsScheduling(TopologyDetails topology) { int desiredNumWorkers = topology.getNumWorkers(); int assignedNumWorkers = this.getAssignedNumWorkers(topology); if (desiredNumWorkers > assignedNumWorkers) { return true; } return this.getUnassignedExec...
TypedValue getRootObject(); /* * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2....
TypedValue getRootObject(); /* * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2....
TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException; /* * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain...
TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException; /* * Copyright 2002-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain...
protected synchronized Channel getChannel() throws IOException { if (closed) { throw MESSAGES.objectIsClosed( ModelControllerClient.class.getSimpleName()); } if (strategy == null) { try { final ProtocolChannelClient.Configuration configuration = Protoc...
protected synchronized Channel getChannel() throws IOException { if (closed) { throw MESSAGES.objectIsClosed( ModelControllerClient.class.getSimpleName()); } if (strategy == null) { try { final ProtocolChannelClient.Configuration configuration = Protoc...
public SSLContext getSSLContext() { SSLIdentityService service = sslIdentity.getOptionalValue(); if (sslIdentity != null) { return service.getSSLContext(); } return null; }
public SSLContext getSSLContext() { SSLIdentityService service = sslIdentity.getOptionalValue(); if (service != null) { return service.getSSLContext(); } return null; }
public void operationCompleted(ModelNode response) { finalResultRef.set(response); } }; proxyController.execute(operation, messageHandler, proxyControl, new DelegatingOperationAttachments(context)); NewModelController.OperationTransaction remoteTransacti...
public void operationCompleted(ModelNode response) { finalResultRef.set(response); } }; proxyController.execute(operation, messageHandler, proxyControl, new DelegatingOperationAttachments(context)); NewModelController.OperationTransaction remoteTransacti...
private void sendCommand(ServerManagerProtocolCommand command, Object o) throws IOException { byte[] cmd = ServerManagerProtocolUtils.createCommandBytes(command, o); communicationHandler.sendMessage(cmd, StreamUtils.calculateChecksum(cmd)); }
private void sendCommand(ServerManagerProtocolCommand command, Object o) throws IOException { byte[] cmd = ServerManagerProtocolUtils.createCommandBytes(command, o); communicationHandler.sendMessage(cmd); }
void sendMessage(byte[] msg) throws IOException; /** * */ package org.jboss.as.server.manager; import java.io.IOException; import java.util.List; /** * Abstraction for objects that handle communication between a ServerManager * and a Server. * * @author Brian Stansberry */ public interface ServerCommunicati...
void sendMessage(byte[] msg) throws IOException; /** * */ package org.jboss.as.server.manager; import java.io.IOException; import java.util.List; /** * Abstraction for objects that handle communication between a ServerManager * and a Server. * * @author Brian Stansberry */ public interface ServerCommunicati...
private void sendMessage(ServerManagerProtocolCommand command) { try { byte[] bytes = command.createCommandBytes(null); serverCommunicationHandler.sendMessage(bytes, StreamUtils.calculateChecksum(bytes)); } catch (IOException e) { log.error("Failed to send message...
private void sendMessage(ServerManagerProtocolCommand command) { try { byte[] bytes = command.createCommandBytes(null); serverCommunicationHandler.sendMessage(bytes); } catch (IOException e) { log.error("Failed to send message to Server Manager [" + command + "]",...
public ActivationSpec createActivationSpecs(final String resourceAdapterName, final Class<?> messageListenerInterface, final Properties activationConfigProperties, final ClassLoader classLoader) { try { ActivationSpec activationSpec = null; ...
public ActivationSpec createActivationSpecs(final String resourceAdapterName, final Class<?> messageListenerInterface, final Properties activationConfigProperties, final ClassLoader classLoader) { try { ActivationSpec activationSpec = null; ...
public ModelNode getModelDescription(final Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode subsystem = new ModelNode(); subsystem.get(DESCRIPTION).set(bundle.getString("ejb3")); subsystem.get(HEAD_COMMENT_ALLOWED).set(tru...
public ModelNode getModelDescription(final Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode subsystem = new ModelNode(); subsystem.get(DESCRIPTION).set(bundle.getString("ejb3")); subsystem.get(HEAD_COMMENT_ALLOWED).set(tru...
public void testComparatorWithDoubleMetaphoneAndInvalidInput() throws Exception { StringEncoderComparator sCompare = new StringEncoderComparator( new DoubleMetaphone() ); int compare = sCompare.compare(new Double(3.0), new Long(3)); assertEquals( "Trying to compare ob...
public void testComparatorWithDoubleMetaphoneAndInvalidInput() throws Exception { StringEncoderComparator sCompare = new StringEncoderComparator( new DoubleMetaphone() ); int compare = sCompare.compare(new Double(3.0), Long.valueOf(3)); assertEquals( "Trying to compar...
public void testObjectDecodeWithInvalidParameter() throws Exception { Base64 b64 = new Base64(); try { b64.decode(new Integer(5)); fail("decode(Object) didn't throw an exception when passed an Integer object"); } catch (DecoderException e) { // ignored ...
public void testObjectDecodeWithInvalidParameter() throws Exception { Base64 b64 = new Base64(); try { b64.decode(Integer.valueOf(5)); fail("decode(Object) didn't throw an exception when passed an Integer object"); } catch (DecoderException e) { // ignore...
public void installJodaTimeFormatting(FormatterRegistry formatterRegistry) { JodaTimeConverters.registerConverters(formatterRegistry); DateTimeFormatter jodaDateFormatter = getJodaDateFormatter(); formatterRegistry.addFormatterForFieldType(LocalDate.class, new ReadablePartialPrinter(jodaDateFormatter), new ...
public void installJodaTimeFormatting(FormatterRegistry formatterRegistry) { JodaTimeConverters.registerConverters(formatterRegistry); DateTimeFormatter jodaDateFormatter = getJodaDateFormatter(); formatterRegistry.addFormatterForFieldType(LocalDate.class, new ReadablePartialPrinter(jodaDateFormatter), new ...
public static Locale parseLocaleString(String localeString) { String[] parts = tokenizeToStringArray(localeString, "_ ", false, false); String language = (parts.length > 0 ? parts[0] : ""); String country = (parts.length > 1 ? parts[1] : ""); validateLocalePart(language); validateLocalePart(country); Strin...
public static Locale parseLocaleString(String localeString) { String[] parts = tokenizeToStringArray(localeString, "_ ", false, false); String language = (parts.length > 0 ? parts[0] : ""); String country = (parts.length > 1 ? parts[1] : ""); validateLocalePart(language); validateLocalePart(country); Strin...
public String getCanonicalComparatorName(Object object) { StringBuilder retval = new StringBuilder(); retval.append("data/test/"); String colName = object.getClass().getName(); colName = colName.substring(colName.lastIndexOf(".")+1,colName.length()); retval.append(colName); ...
public String getCanonicalComparatorName(Object object) { StringBuilder retval = new StringBuilder(); retval.append(TEST_DATA_PATH); String colName = object.getClass().getName(); colName = colName.substring(colName.lastIndexOf(".")+1,colName.length()); retval.append(colName);...
private void generateMTFValues() { final int lastShadow = this.last; final Data dataShadow = this.data; final boolean[] inUse = dataShadow.inUse; final byte[] block = dataShadow.block; final int[] fmap = dataShadow.fmap; final char[] sfmap = dataShadow.sfmap; ...
private void generateMTFValues() { final int lastShadow = this.last; final Data dataShadow = this.data; final boolean[] inUse = dataShadow.inUse; final byte[] block = dataShadow.block; final int[] fmap = dataShadow.fmap; final char[] sfmap = dataShadow.sfmap; ...
private static Version.AsVersion version; static Version.AsVersion getVersion(Class<?> testClass) { Version version = testClass.getAnnotation(Version.class); if (version == null) { throw new IllegalArgumentException("No @Version"); } if (MixedDomainTestSuite.version...
private static Version.AsVersion version; static Version.AsVersion getVersion(Class<?> testClass) { Version version = testClass.getAnnotation(Version.class); if (version == null) { throw new IllegalArgumentException("No @Version"); } if (MixedDomainTestSuite.version...
private InputStream buildDecoderStack(final Folder folder, final long folderOffset, final int firstPackStreamIndex, SevenZArchiveEntry entry) throws IOException { file.seek(folderOffset); InputStream inputStreamStack = new BoundedRandomAccessFileInputStream(file, arch...
private InputStream buildDecoderStack(final Folder folder, final long folderOffset, final int firstPackStreamIndex, SevenZArchiveEntry entry) throws IOException { file.seek(folderOffset); InputStream inputStreamStack = new BoundedRandomAccessFileInputStream(file, arch...
public Object create(Kryo kryo, Input input, Class c) { int len = input.readInt(); byte[] ser = new byte[len]; input.readBytes(ser); ByteArrayInputStream bis = new ByteArrayInputStream(ser); try { ObjectInputStream ois = new ObjectInputStream(bis); ret...
public Object read(Kryo kryo, Input input, Class c) { int len = input.readInt(); byte[] ser = new byte[len]; input.readBytes(ser); ByteArrayInputStream bis = new ByteArrayInputStream(ser); try { ObjectInputStream ois = new ObjectInputStream(bis); retur...
protected static int toDigit(char ch, int index) throws DecoderException { int digit = Character.digit(ch, 16); if (digit == -1) { throw new DecoderException("Illegal hexadecimal charcter " + ch + " at index " + index); } return digit; }
protected static int toDigit(char ch, int index) throws DecoderException { int digit = Character.digit(ch, 16); if (digit == -1) { throw new DecoderException("Illegal hexadecimal character " + ch + " at index " + index); } return digit; }
private static final CommandRegistry cmdRegistry = new CommandRegistry(); static { cmdRegistry.registerHandler(new HelpHandler(), "help", "h"); cmdRegistry.registerHandler(new QuitHandler(), "quit", "q", "exit"); cmdRegistry.registerHandler(new ConnectHandler(), "connect"); cmdRe...
private static final CommandRegistry cmdRegistry = new CommandRegistry(); static { cmdRegistry.registerHandler(new HelpHandler(), "help", "h"); cmdRegistry.registerHandler(new QuitHandler(), "quit", "q", "exit"); cmdRegistry.registerHandler(new ConnectHandler(), "connect"); cmdRe...
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { PicketLinkLogger.ROOT_LOGGER.activatingSubsystem(); }
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { PicketLinkLogger.ROOT_LOGGER.activatingSubsystem("Identity Management"); }
public void transition(ServiceController<? extends Object> serviceController, ServiceController.Transition transition) { switch (serviceController.getState()) { case UP: { ServiceName serviceName = serviceController.getName(); ...
public void transition(ServiceController<? extends Object> serviceController, ServiceController.Transition transition) { switch (transition.getAfter()) { case UP: { ServiceName serviceName = serviceController.getName(); Stri...
public synchronized void start(final StartContext context) throws StartException { // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes. final ClassLoader loader = TxBridgeInboundRecoveryService.class.getClassLoader(); SecurityActions.setCon...
public synchronized void start(final StartContext context) throws StartException { // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes. final ClassLoader loader = TxBridgeInboundRecoveryService.class.getClassLoader(); SecurityActions.setCon...
public synchronized void start(final StartContext context) throws StartException { // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes. final ClassLoader loader = TxBridgeOutboundRecoveryService.class.getClassLoader(); SecurityActions.setCo...
public synchronized void start(final StartContext context) throws StartException { // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes. final ClassLoader loader = TxBridgeOutboundRecoveryService.class.getClassLoader(); SecurityActions.setCo...
public static <T> T notNull(T value) { if (value == null) throw new IllegalStateException("Service not started"); return value; }
public static <T> T notNull(T value) { if (value == null) throw XtsAsMessages.MESSAGES.xtsServiceIsNotStarted(); return value; }
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; Object array = Array.newInstance(targetType.getElementType(), sourceCollection.size()); int i = 0; for (Object source...
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; Object array = Array.newInstance(targetType.getElementType(), sourceCollection.size()); int i = 0; for (Object source...
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; if (sourceCollection.isEmpty()) { return sourceCollection; } Collection target = CollectionFactory.createCollectio...
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; if (sourceCollection.isEmpty()) { return sourceCollection; } Collection target = CollectionFactory.createCollectio...
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; if (sourceCollection.size() == 0) { return null; } Object firstElement = sourceCollection.iterator().next(); ret...
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; } Collection<?> sourceCollection = (Collection<?>) source; if (sourceCollection.size() == 0) { return null; } Object firstElement = sourceCollection.iterator().next(); ret...
public void testMessageNumber() { Assert.assertEquals(310, LocalizedFormats.values().length); }
public void testMessageNumber() { Assert.assertEquals(311, LocalizedFormats.values().length); }
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { _collector = collector; if(_local_drpc_id==null) { int numTasks = context.getComponentTasks(context.getThisComponentId()).size(); int index = context.getThisTaskIndex(); int por...
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { _collector = collector; if(_local_drpc_id==null) { int numTasks = context.getComponentTasks(context.getThisComponentId()).size(); int index = context.getThisTaskIndex(); int por...
public void execute(Tuple tuple) { byte[] rowKey = this.mapper.rowKey(tuple); Get get = hBaseClient.constructGetRequests(rowKey, projectionCriteria); try { Result result = hBaseClient.batchGet(Lists.newArrayList(get))[0]; for(Values values : rowToTupleMapper.toValues...
public void execute(Tuple tuple) { byte[] rowKey = this.mapper.rowKey(tuple); Get get = hBaseClient.constructGetRequests(rowKey, projectionCriteria); try { Result result = hBaseClient.batchGet(Lists.newArrayList(get))[0]; for(Values values : rowToTupleMapper.toValues...
protected void finishModelStage(OperationContext context, ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, Resource model) throws OperationFailedException { Provider provider = Provider.valueOf(newValue.asString()); if (provider == Provider.RBAC) { ...
protected void finishModelStage(OperationContext context, ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, Resource model) throws OperationFailedException { Provider provider = Provider.valueOf(newValue.asString().toUpperCase(Locale.ENGLISH)); if (prov...
public void writeRecord(Map map) { CSVField[] fields = config.getFields(); try { StringBuffer sb = new StringBuffer(); for (int i = 0; i < fields.length; i++) { Object o = map.get(fields[i].getName()); if (o != null) { Strin...
public void writeRecord(Map map) { CSVField[] fields = config.getFields(); try { StringBuffer sb = new StringBuffer(); for (int i = 0; i < fields.length; i++) { Object o = map.get(fields[i].getName()); if (o != null) { Strin...
public void testRequestDataValueProcessorHooks() throws Exception { String action = "/my/form?foo=bar"; RequestDataValueProcessor processor = getMockRequestDataValueProcessor(); given(processor.processAction(this.request, action, "post")).willReturn(action); given(processor.getExtraHiddenFields(this.request))....
public void testRequestDataValueProcessorHooks() throws Exception { String action = "/my/form?foo=bar"; RequestDataValueProcessor processor = getMockRequestDataValueProcessor(); given(processor.processAction(this.request, action)).willReturn(action); given(processor.getExtraHiddenFields(this.request)).willRetu...
private Annotation[] filterAnnotations(Annotation[] annotations) { if (annotations == null) { return new Annotation[0]; } List<Annotation> filtered = new ArrayList<Annotation>(); for (Annotation annotation : annotations) { if (annotation.annotationType() != Co...
private Annotation[] filterAnnotations(Annotation[] annotations) { if (annotations == null) { return new Annotation[0]; } List<Annotation> filtered = new ArrayList<Annotation>(); for (Annotation annotation : annotations) { if (annotation.annotationType() != Co...
public void modified(CacheEntryModifiedEvent<String, Map<ClusterNode, Void>> event) { // Only respond to remote post-modify events if (event.isPre() || event.isOriginLocal()) return; this.notifyListeners(Collections.singletonMap(event.getKey(), event.getValue().keySet()), false); } ...
public void modified(CacheEntryModifiedEvent<String, Map<ClusterNode, Void>> event) { // Only respond to remote post-modify events if (event.isPre() || event.isOriginLocal()) return; this.notifyListeners(Collections.singletonMap(event.getKey(), event.getValue().keySet()), false); } ...
public Injector<TransactionManager> getTransactionManagerInjector() { return transactionManager; } /** * An instance can be in one of the three states: * <ul> * <li>not associated with the tx and, hence, does not need to be synchronized</li> * <li>associated with the tx and need...
public Injector<TransactionManager> getTransactionManagerInjector() { return transactionManager; } /** * An instance can be in one of the three states: * <ul> * <li>not associated with the tx and, hence, does not need to be synchronized</li> * <li>associated with the tx and need...
public void afterCompletion(int status) { } } public static interface RelationDataManager { void addRelation(JDBCCMRFieldBridge field, Object id, JDBCCMRFieldBridge relatedField, Object relatedId); void removeRelation(JDBCCMRFieldBridge field, Object id, JDBCCMRFieldBridge rela...
public void afterCompletion(int status) { } } public interface RelationDataManager { void addRelation(JDBCCMRFieldBridge field, Object id, JDBCCMRFieldBridge relatedField, Object relatedId); void removeRelation(JDBCCMRFieldBridge field, Object id, JDBCCMRFieldBridge relatedFiel...
public void reset() { } }; public static interface FieldIterator { /** * @return true if there are more fields to iterate through. */ boolean hasNext(); /** * @return the next field. */ JDBCCMPFieldBridge next(); /** ...
public void reset() { } }; public interface FieldIterator { /** * @return true if there are more fields to iterate through. */ boolean hasNext(); /** * @return the next field. */ JDBCCMPFieldBridge next(); /** ...
private Object loadField(int i) { JDBCCMPFieldBridge2 field = (JDBCCMPFieldBridge2) entity.getFields().get(i); StringBuffer query = new StringBuffer(); query.append("select ") .append(field.getColumnName()) .append(" from ") ...
private Object loadField(int i) { JDBCCMPFieldBridge2 field = (JDBCCMPFieldBridge2) entity.getFields().get(i); StringBuffer query = new StringBuffer(); query.append("select ") .append(field.getColumnName()) .append(" from ") ...
protected ModelNode invokeCommandOn(Pool pool) throws Exception { boolean returnedValue = pool.testConnection(); if (!returnedValue) throw MESSAGES.invalidConnection(); ModelNode result = new ModelNode(); result.add(returnedValue); retu...
protected ModelNode invokeCommandOn(Pool pool) throws Exception { boolean returnedValue = pool.testConnection(); if (!returnedValue) throw MESSAGES.invalidConnection(); ModelNode result = new ModelNode(); result.add(returnedValue); retu...
public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) { // Transform the model recursively final ModelNode recursive = Resource.Tools.readModel(resource); final ModelNode result = transformModel(context, recursive); ...
public void transformResource(final ResourceTransformationContext context, final PathAddress address, final Resource resource) { // Transform the model recursively final ModelNode recursive = Resource.Tools.readModel(resource); final ModelNode result = transformModel(context, recursive); ...
public ModelControllerClient createClient(Executor executor) { throw new IllegalStateException(); } } private static interface TestOperationHandler { void execute(ModelNode operation, OperationMessageHandler handler, OperationAttachments attachments) throws Exception; ...
public ModelControllerClient createClient(Executor executor) { throw new IllegalStateException(); } } private interface TestOperationHandler { void execute(ModelNode operation, OperationMessageHandler handler, OperationAttachments attachments) throws Exception; }
interface Factory { package org.jboss.as.server.deployment.scanner; import java.io.Closeable; import java.util.Map; import java.util.Set; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import org.jboss.dmr.ModelNode; /** * * @author Stuart Douglas */ public interface De...
interface Factory { package org.jboss.as.server.deployment.scanner; import java.io.Closeable; import java.util.Map; import java.util.Set; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; import org.jboss.dmr.ModelNode; /** * * @author Stuart Douglas */ public interface De...
public void undeploy(DeploymentUnit context) { // do nothing } private static interface SimpleSet<E> { boolean contains(Object o); }
public void undeploy(DeploymentUnit context) { // do nothing } private interface SimpleSet<E> { boolean contains(Object o); }
private void schedule(PingTask task) { scheduledExecutorService.schedule(task, INTERVAL, TimeUnit.MILLISECONDS); } static interface HostRegistrationCallback { /** * Get the versions for all registered subsystems. * * @param extensions the extension list ...
private void schedule(PingTask task) { scheduledExecutorService.schedule(task, INTERVAL, TimeUnit.MILLISECONDS); } interface HostRegistrationCallback { /** * Get the versions for all registered subsystems. * * @param extensions the extension list * @retu...
public void deleteDeployment(byte[] deploymentHash) { localFileRepository.deleteDeployment(deploymentHash); } } static interface RemoteFileRepositoryExecutor { File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository); }
public void deleteDeployment(byte[] deploymentHash) { localFileRepository.deleteDeployment(deploymentHash); } } interface RemoteFileRepositoryExecutor { File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository); }
protected void revertUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode valueToRestore, final ModelNode valueToRevert, final RevertHandback handback) throws OperationFailedException { if(handback != ...
protected void revertUpdateToRuntime(final OperationContext context, final ModelNode operation, final String attributeName, final ModelNode valueToRestore, final ModelNode valueToRevert, final RevertHandback handback) throws OperationFailedException { if(handback != ...
public void writeContent(XMLExtendedStreamWriter streamWriter, SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(namespace, false); streamWriter.writeEndElement(); } } static interface RegistrationResult { SubsystemRe...
public void writeContent(XMLExtendedStreamWriter streamWriter, SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(namespace, false); streamWriter.writeEndElement(); } } interface RegistrationResult { SubsystemRegistrat...
public <T> T invokeWithTransaction(final Task<T> task) { try { ejbContext.getUserTransaction().begin(); try { return task.execute(); } catch (Exception e) { throw new EJBException(e); } finally { if (ejbContext.g...
public <T> T invokeWithTransaction(final Task<T> task) { try { ejbContext.getUserTransaction().begin(); try { return task.execute(); } catch (Exception e) { throw new EJBException(e); } finally { if (ejbContext.g...
public void installDeploymentUnitDependencies(ServiceTarget target, ServiceName deploymentUnitServiceName) { target.addService(deploymentUnitServiceName.append(this.name, "expiration"), new RemoveOnCancelScheduledExecutorService(THREAD_FACTORY)) .setInitialMode(ServiceController.Mode.ON_DEMA...
public void installDeploymentUnitDependencies(ServiceTarget target, ServiceName deploymentUnitServiceName) { RemoveOnCancelScheduledExecutorService.build(target, deploymentUnitServiceName.append(this.name, "expiration"), THREAD_FACTORY) .setInitialMode(ServiceController.Mode.ON_DEMAND) ...
public static PersistenceUnitMetadataHolder parse(final XMLStreamReader reader) throws XMLStreamException { reader.require(START_DOCUMENT, null, null); // check for a bogus document and throw error // Read until the first start element Version version = null; while (reader.hasNext...
public static PersistenceUnitMetadataHolder parse(final XMLStreamReader reader) throws XMLStreamException { reader.require(START_DOCUMENT, null, null); // check for a bogus document and throw error // Read until the first start element Version version = null; while (reader.hasNext...
public ClientHttpResponse execute() throws IOException { if (this.requestMatchers.isEmpty()) { throw new AssertionError("No request expectations to execute"); } if (this.responseCreator == null) { throw new AssertionError("No ResponseCreator was set up. Add it after request expectations, " + "e.g. M...
public ClientHttpResponse executeInternal() throws IOException { if (this.requestMatchers.isEmpty()) { throw new AssertionError("No request expectations to execute"); } if (this.responseCreator == null) { throw new AssertionError("No ResponseCreator was set up. Add it after request expectations, " +...
protected void processClusterConnection(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> updates) throws XMLStreamException { requireSingleAttribute(reader, CommonAttributes.NAME); String name = reader.getAttributeValue(0); ModelNode clusterConnectionAdd = getEmptyOperati...
protected void processClusterConnection(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> updates) throws XMLStreamException { requireSingleAttribute(reader, CommonAttributes.NAME); String name = reader.getAttributeValue(0); ModelNode clusterConnectionAdd = getEmptyOperati...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode config = new ModelNode(); for(final AttributeDefinition definition : ATTRIBUTES) { validateAndSet(definition, operation, config); } ParsedInterfaceCrite...
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { final ModelNode config = new ModelNode(); for(final AttributeDefinition definition : ATTRIBUTES) { validateAndSet(definition, operation, config); } ParsedInterfaceCrite...
private static String translate(String s, Locale locale) { try { if ((cachedResources == null) || (! cachedResources.getLocale().equals(locale))) { // caching the resource bundle cachedResources = ResourceBundle.getBundle("org.apache.commons.ma...
private static String translate(String s, Locale locale) { try { if ((cachedResources == null) || (! cachedResources.getLocale().equals(locale))) { // caching the resource bundle cachedResources = ResourceBundle.getBundle("org.apache.commons.ma...