Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import org.apache.xml.security.stax.impl.util.UnsynchronizedByteArrayInputStream;
InputStream in = new UnsynchronizedByteArrayInputStream(data); | 0 |
if (outputMap.size() == 1) { | 0 |
@Element KV<String, Integer> element, | 0 |
javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger log = LoggerFactory.getLogger(ReplicationDriver.class);
long sleepMillis = conf.getTimeInMillis(Property.MASTER_REPLICATION_SCAN_INTERVAL);
log.debug("Sleeping for {}ms before re-running", sleepMillis);
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
log.error("Interrupted while sleeping", e);
} | 0 |
} catch (Throwable t) {
filt = ImageTagRegistry.getBrokenLinkImage
(errCode, errParam); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/xml/Attic/ParseTag.java,v 1.13 2002/10/30 19:16:23 jstrachan Exp $
* $Revision: 1.13 $
* $Date: 2002/10/30 19:16:23 $
* Copyright (c) 2002 The Apache Software Foundation. All rights
* $Id: ParseTag.java,v 1.13 2002/10/30 19:16:23 jstrachan Exp $
* @version $Revision: 1.13 $ | 0 |
if (table == null) { table = "KARAF_LOCK"; }
if ( clusterName == null) { clusterName = "karaf"; } | 0 |
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 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 | 0 |
return status >= HttpStatus.SC_SUCCESS
if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS && this.incoming != null) { | 0 |
import org.apache.accumulo.core.client.IteratorSetting;
compact(tableName, start, end, new ArrayList<IteratorSetting>(), flush, wait);
}
public void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators, boolean flush, boolean wait) throws AccumuloSecurityException,
TableNotFoundException, AccumuloException {
: TextUtil.getByteBuffer(end), ByteBuffer.wrap(IteratorUtil.encodeIteratorSettings(iterators)));
| 0 |
private final KeyedObjectPool<K, PoolablePreparedStatement<K,S>> _pool;
private final K _key; | 0 |
/*
* 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 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
*
*
*
*
*
*
*
*
* | 0 |
import org.apache.batik.constants.XMLConstants; | 0 |
this.hasBufferedInput = this.inbuf.hasData();
this.hasBufferedOutput = this.outbuf.hasData(); | 0 |
import org.apache.beam.sdk.PipelineRunner;
* this transform and each {@link PipelineRunner} to implement | 0 |
currentScope.exchangeId, | 0 |
public void testAppendCharSequence() throws Exception {
proxy.close();
public void testWriteString() throws Exception {
proxy.close();
public void testWriteStringPartial() throws Exception {
proxy.close();
public void testWriteCharArray() throws Exception {
proxy.close();
public void testWriteCharArrayPartial() throws Exception {
proxy.close();
public void testNullString() throws Exception {
proxy.close();
public void testNullCharArray() throws Exception {
proxy.close();
public void testNullCharSequencec() throws Exception {
proxy.close(); | 0 |
import org.apache.accumulo.core.client.BatchWriterConfig;
BatchWriter dirBW = conn.createBatchWriter(nameTable, new BatchWriterConfig());
BatchWriter indexBW = conn.createBatchWriter(indexTable, new BatchWriterConfig());
BatchWriter dataBW = conn.createBatchWriter(dataTable, new BatchWriterConfig()); | 0 |
public static final String actionVerb = "Executing";
@Override
public StageWrapper.Type getStageWrapperType() {
return StageWrapper.Type.RU_TASKS;
}
@Override
public String getActionVerb() {
return actionVerb;
} | 0 |
import org.apache.sshd.util.test.CommonTestSupportUtils;
KeyPair identity = CommonTestSupportUtils.getFirstKeyPair(sshd);
CommonTestSupportUtils.createTestHostKeyProvider(clientIdFile.resolve(getCurrentTestName() + ".pem"));
KeyPair specificIdentity = CommonTestSupportUtils.getFirstKeyPair(sshd);
KeyPair defaultIdentity = CommonTestSupportUtils.getFirstKeyPair(clientIdProvider); | 0 |
private final Set<String> propertyIds = new HashSet<String>();
/**
* Factory method.
*
* @param predicates the predicate array
*
* @return a new ArrayPredicate
*/
public abstract BasePredicate create(BasePredicate... predicates);
public Set<String> getPropertyIds() { | 1 |
if (lines.isEmpty()) { | 0 |
EventSourceSupport.BUILDER); | 0 |
synchronized public void setLastCompactionID(Long compactionId) { | 0 |
final long len) { | 0 |
import org.apache.hc.core5.http.nio.support.BasicRequestProducer;
import org.apache.hc.core5.http.nio.support.BasicResponseConsumer; | 0 |
import java.awt.Container;
* the second argument of {@link Container#add(Component,Object)}. | 0 |
import java.io.IOException;
import java.net.SocketAddress;
import java.util.concurrent.Future;
import org.apache.hc.core5.concurrent.FutureCallback;
import org.apache.hc.core5.io.ShutdownType;
import org.apache.hc.core5.net.NamedEndpoint;
import org.apache.hc.core5.reactor.IOReactorService;
import org.apache.hc.core5.reactor.IOReactorStatus;
public class AsyncRequester implements IOReactorService, ConnectionInitiator {
private final DefaultConnectingIOReactor ioReactor;
this.ioReactor = new DefaultConnectingIOReactor(
eventHandlerFactory,
ioReactorConfig,
new DefaultThreadFactory("requester-dispatch", true),
sessionShutdownCallback);
@Override
public Future<IOSession> connect(
final NamedEndpoint remoteEndpoint,
final SocketAddress remoteAddress,
final SocketAddress localAddress,
final TimeValue timeout,
final Object attachment,
final FutureCallback<IOSession> callback) {
return ioReactor.connect(remoteEndpoint, remoteAddress, localAddress, timeout, attachment, callback);
}
public Future<IOSession> requestSession(
final FutureCallback<IOSession> callback) {
return connect(host, toSocketAddress(host), null, timeout, attachment, callback);
}
@Override
public void start() {
ioReactor.start();
}
@Override
public IOReactorStatus getStatus() {
return ioReactor.getStatus();
}
@Override
public void initiateShutdown() {
ioReactor.initiateShutdown();
}
@Override
public void awaitShutdown(final TimeValue waitTime) throws InterruptedException {
ioReactor.awaitShutdown(waitTime);
}
@Override
public void shutdown(final ShutdownType shutdownType) {
ioReactor.shutdown(shutdownType);
}
@Override
public void close() throws IOException {
ioReactor.close(); | 0 |
public WidgetDefinition buildWidgetDefinition(Element element, WidgetDefinitionBuilderContext context)
throws Exception {
setupDefinition(element, definition, context);
setDisplayData(element, definition);
setupContainer(element, "widgets", definition, context); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/RuleTestCase.java,v 1.25 2003/10/05 15:35:36 rdonkin Exp $
* $Revision: 1.25 $
* $Date: 2003/10/05 15:35:36 $
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* notice, this list of conditions and the following disclaimer.
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgement:
* "This product includes software developed by the
* 4. The names "Apache", "The Jakarta Project", "Commons", and "Apache Software
* from this software without prior written permission. For written
* 5. Products derived from this software may not be called "Apache",
* "Apache" nor may "Apache" appear in their names without prior
* written permission of the Apache Software Foundation.
*/
* @version $Revision: 1.25 $ $Date: 2003/10/05 15:35:36 $ | 0 |
import java.util.Set;
/**
* Validate the state of the instance.
*
* @param viewEntity the view entity to which this instance will be bound
*
* @throws IllegalStateException if the instance is not in a valid state
*/
public void validate(ViewEntity viewEntity) throws IllegalStateException {
// make sure that there is an instance property value defined
// for each required view parameter
Set<String> requiredParamterNames = new HashSet<String>();
for (ViewParameterEntity parameter : viewEntity.getParameters()) {
if (parameter.isRequired()) {
requiredParamterNames.add(parameter.getName());
}
}
for (ViewInstancePropertyEntity property : getProperties()) {
requiredParamterNames.remove(property.getName());
}
if (!requiredParamterNames.isEmpty()) {
throw new IllegalStateException("No property values exist for the required parameters " +
requiredParamterNames);
}
}
| 0 |
package org.apache.commons.ognl.test.objects; | 0 |
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@Override
public Map<Long, Set<Long>> getSessionExpiryMap() {
return new HashMap<Long, Set<Long>>();
} | 1 |
@Parameter(names="--search", description="find a file or directory with the given name") | 0 |
* @version $Id$ | 0 |
* When coupled with a {@link org.apache.http.ConnectionReuseStrategy}, if
* {@link org.apache.http.ConnectionReuseStrategy#keepAlive(
* HttpResponse, HttpContext)} returns true, this allows you to control
* how long the reuse will last. If keepAlive returns false, this should
* have no meaningful impact | 0 |
import org.apache.cocoon.el.Expression; | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
* Copyright 2001-2004 The Apache Software Foundation
* 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.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @version $Id: FileUpload.java,v 1.26 2004/02/25 21:07:12 scolebourne Exp $ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/VariableReference.java,v 1.6 2003/01/19 23:59:24 dmitri Exp $
* $Revision: 1.6 $
* $Date: 2003/01/19 23:59:24 $
* @version $Revision: 1.6 $ $Date: 2003/01/19 23:59:24 $
return "$" + varName; | 0 |
public void service(ServiceManager serviceManager) {
this.manager = serviceManager;
public void contextualize(Context avalonContext) {
this.context = avalonContext; | 0 |
String DATA_FILE_NAME = "identity.dat";
String HOSTNAME = "hostname";
String SERVICE = "service";
String COMPONENT = "component";
String PRINCIPAL = "principal";
String PRINCIPAL_TYPE = "principal_type";
String KEYTAB_FILE_PATH = "keytab_file_path";
String KEYTAB_FILE_OWNER_NAME = "keytab_file_owner_name";
String KEYTAB_FILE_OWNER_ACCESS = "keytab_file_owner_access";
String KEYTAB_FILE_GROUP_NAME = "keytab_file_group_name";
String KEYTAB_FILE_GROUP_ACCESS = "keytab_file_group_access";
String KEYTAB_FILE_IS_CACHABLE = "keytab_file_is_cachable"; | 0 |
import org.apache.accumulo.core.util.HostAndPort; | 1 |
public ClusterDefinition getCluster(String clusterName) {
}*/return null;
public List<String> getAssociatedRoleNames(Node n) { | 0 |
import org.apache.hc.core5.io.CloseMode;
client.shutdown(CloseMode.GRACEFUL); | 0 |
import java.util.concurrent.ConcurrentLinkedQueue;
private final ConcurrentLinkedQueue<Inbound> clients;
this.clients = new ConcurrentLinkedQueue<>();
public void close() throws Exception {
Exception thrown = null;
for (Inbound inbound : clients) {
try {
inbound.outboundObserver.onCompleted();
} catch (Exception t) {
if (thrown == null) {
thrown = t;
} else {
thrown.addSuppressed(t);
}
}
}
if (thrown != null) {
throw thrown;
} | 0 |
import java.io.IOException;
import java.util.ArrayList;
import org.apache.cocoon.xml.dom.DOMStreamer;
import org.apache.xerces.dom.NodeImpl;
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.NamespaceContext;
import org.apache.xerces.xni.QName;
import org.apache.xerces.xni.XMLAttributes;
import org.apache.xerces.xni.XMLLocator;
import org.apache.xerces.xni.XNIException;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.SAXNotSupportedException;
if (element instanceof NodeImpl) {
}
if (location != null) {
}
return "(location unknown)";
* Returns the first child element with the given namespace and localName,
* or null if there is no such element.
Element node = null;
try {
node = getChildElement(element, namespace, localName, false);
} catch (Exception e) {
node = null;
return node;
if (attrValue.equals("")) {
}
return attrValue;
if (attrValue.equals("")) {
} else if (attrValue.equalsIgnoreCase("true") || attrValue.equalsIgnoreCase("yes")) {
} else if (attrValue.equalsIgnoreCase("false") || attrValue.equalsIgnoreCase("no")) {
} else {
} | 0 |
import org.apache.xml.security.stax.impl.DocumentContextImpl;
import org.apache.xml.security.stax.impl.OutboundSecurityContextImpl;
import org.apache.xml.security.stax.impl.OutputProcessorChainImpl;
import org.apache.xml.security.stax.impl.XMLSecurityStreamWriter;
import org.apache.xml.security.stax.securityEvent.SecurityEventListener;
import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
import org.apache.xml.security.stax.securityToken.SecurityTokenConstants;
import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
return processOutMessage((Object)outputStream, encoding, null);
return processOutMessage((Object)xmlStreamWriter, encoding, null);
public XMLStreamWriter processOutMessage(OutputStream outputStream, String encoding,
SecurityEventListener eventListener) throws XMLSecurityException {
return processOutMessage((Object)outputStream, encoding, eventListener);
}
public XMLStreamWriter processOutMessage(XMLStreamWriter xmlStreamWriter, String encoding,
SecurityEventListener eventListener) throws XMLSecurityException {
return processOutMessage((Object) xmlStreamWriter, encoding, eventListener);
}
private XMLStreamWriter processOutMessage(
Object output, String encoding, SecurityEventListener eventListener) throws XMLSecurityException {
if (eventListener != null) {
outboundSecurityContext.addSecurityEventListener(eventListener);
}
| 0 |
/*
* Copyright 2002, 2003,2004 The Apache Software Foundation.
*
* 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @version $Revision: 1.16 $ $Date: 2004/02/28 03:35:52 $ | 0 |
if (resolverTmp.canResolve(context)) { | 0 |
* @see org.apache.commons.digester.Digester#addSetProperties(String,String[],String[]) | 0 |
* Copyright 2002,2004 The Apache Software Foundation.
*
* 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
/**
* Saves a job update configuration.
*
* @param updateConfiguration Configuration to store.
*/
/**
* Fetches the update configuration (if present) for the given role/job.
*
* @param role Role the job is under.
* @param job Job to fetch update configuration for.
* @return Optional job update configuration.
*/ | 0 |
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
@Mojo( name = "deploy-file", requiresProject = false )
@Execute( phase = LifecyclePhase.DEPLOY )
@Parameter( property = "ignoreLock" )
@Parameter( property = "remoteOBR" )
@Parameter( property = "obrRepository" )
@Parameter
@Parameter( property = "repositoryId", defaultValue = "remote-repository", required = true )
@Parameter( property = "url", required = true )
@Parameter( property = "bundleUrl" )
@Parameter( defaultValue = "${localRepository}", readonly = true, required = true )
@Parameter( defaultValue = "${settings}", readonly = true, required = true )
@Component | 0 |
private Class type = String.class;
public void setType(Class type) | 0 |
import org.apache.accumulo.core.client.impl.ClientContext;
ClientContext context = new ClientContext(instance, new Credentials(principal, token), ClientConfiguration.loadDefault());
scanner = new ScannerImpl(context, split.getTableId(), authorizations);
ClientContext clientContext = new ClientContext(getInstance(context), new Credentials(getPrincipal(context), getAuthenticationToken(context)),
ClientConfiguration.loadDefault());
while (!tl.binRanges(clientContext, ranges, binnedRanges).isEmpty()) { | 1 |
@Override
public String toString() {
return "DescriptionContainer [options=" + options + ", components=" + components + "]";
} | 0 |
public ClusterImpl(Cluster cluster, int revision,
ClusterState clusterState) throws IOException { | 0 |
package org.apache.hc.core5.http2.impl.nio.entity; | 0 |
// constant for reluctant policy option
public static final String POLICY_OPTION_RELUCTANT = "reluctant";
// constant for greedy policy option
public static final String POLICY_OPTION_GREEDY = "greedy";
// set of valid policy option settings
private static final Set POLICY_OPTION_VALID;
// Policy option attribute (optional, default = reluctant)
private String m_policy_option = null;
private boolean m_isReluctant = true;
POLICY_OPTION_VALID = new TreeSet();
POLICY_OPTION_VALID.add( POLICY_OPTION_RELUCTANT );
POLICY_OPTION_VALID.add( POLICY_OPTION_GREEDY );
* Setter for the policy option attribute
*
* @param policyOption
*/
public void setPolicyOption( String policyOption )
{
if ( m_validated )
{
return;
}
m_policy_option = policyOption;
// secondary property
m_isReluctant = POLICY_OPTION_RELUCTANT.equals( policyOption );
}
/**
* Get the policy option as a string
*
* @return A string with the policy option
**/
public String getPolicyOption()
{
return m_policy_option;
}
/**
* Test if policy option is reluctant
*
* @return true if policy option is reluctant
*/
public boolean isReluctant()
{
return m_isReluctant;
}
/**
if ( m_policy_option == null )
{
setPolicyOption( POLICY_OPTION_RELUCTANT );
}
else if ( !POLICY_OPTION_VALID.contains( m_policy_option ) )
{
throw componentMetadata.validationFailure( "Policy option must be one of " + POLICY_OPTION_VALID );
}
else if ( !componentMetadata.isDS12() && !POLICY_OPTION_RELUCTANT.equals( m_policy_option ) )
{
throw componentMetadata.validationFailure( "Policy option must be reluctant for DS < 1.2" );
}
| 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Charsets; | 0 |
public FTPFile[] listFiles(String relPath) throws IOException
return getFtpClient().listFiles(relPath);
return getFtpClient().listFiles(relPath); | 0 |
import java.io.File;
import java.io.OutputStream;
import java.io.Serializable;
import java.net.MalformedURLException;
import org.apache.avalon.framework.CascadingRuntimeException;
import org.apache.avalon.framework.activity.Disposable;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.cocoon.components.url.SourceProtocolHandler;
import org.apache.fop.configuration.ConfigurationParser;
* @version CVS $Id: FOPSerializer.java,v 1.7 2004/02/04 14:39:58 sylvain Exp $
public class FOPSerializer extends AbstractSerializer implements
Configurable, CacheableProcessingComponent, Serviceable, Disposable {
protected SourceResolver resolver;
protected ServiceManager manager;
public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
}
public void dispose() {
this.manager.release(this.resolver);
// Give the source resolver to Batik which is used by FOP
SourceProtocolHandler.setup(this.resolver);
| 0 |
/*
* $Header: /cvshome/build/org.osgi.service.url/src/org/osgi/service/url/URLConstants.java,v 1.7 2006/03/14 01:21:36 hargrave Exp $
*
* Copyright (c) OSGi Alliance (2002, 2005). All Rights Reserved.
*
* 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.osgi.service.url;
/**
* Defines standard names for property keys associated with
* {@link URLStreamHandlerService}and <code>java.net.ContentHandler</code>
* services.
*
* <p>
* The values associated with these keys are of type <code>java.lang.String[]</code>,
* unless otherwise indicated.
*
* @version $Revision: 1.7 $
*/
public interface URLConstants {
/**
* Service property naming the protocols serviced by a
* URLStreamHandlerService. The property's value is an array of protocol
* names.
*/
public static final String URL_HANDLER_PROTOCOL = "url.handler.protocol";
/**
* Service property naming the MIME types serviced by a
* java.net.ContentHandler. The property's value is an array of MIME types.
*/
public static final String URL_CONTENT_MIMETYPE = "url.content.mimetype"; | 0 |
* @version $Revision$ $Date$ | 0 |
* Extension of {@link AbstractTestList} for exercising the | 0 |
import org.apache.felix.scr.ScrService;
m_runtime_reg = m_context.registerService(new String[] {ScrService.class.getName(),
ServiceComponentRuntime.class.getName()}, | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastArrayList.java,v 1.8 2003/10/05 21:11:06 scolebourne Exp $
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* permission of the Apache Software Foundation.
* Test FastArrayList.
*
* @version $Revision: 1.8 $ $Date: 2003/10/05 21:11:06 $
*
* @author Jason van Zyl
public class TestFastArrayList extends TestArrayList {
public TestFastArrayList(String testName) {
public static Test suite() {
public static void main(String args[]) {
String[] testCaseName = { TestFastArrayList.class.getName()};
public void setUp() {
public List makeEmptyList() { | 0 |
* $HeadURL$
* $Revision$
* $Date$
@Override
protected void setUp() throws Exception {
@Override
protected void tearDown() throws Exception { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestFixedSizeMap.java,v 1.3 2003/08/31 17:28:42 scolebourne Exp $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* @version $Revision: 1.3 $ $Date: 2003/08/31 17:28:42 $ | 0 |
+ "It should be changed prior to the initialization of Accumulo. To change it after Accumulo has been initialized, use the ChangeSecret tool "
+ "and then update conf/accumulo-site.xml everywhere. Before using the ChangeSecret tool, make sure Accumulo is not running and you are logged "
+ "in as the user that controls Accumulo files in HDFS. To use the ChangeSecret tool, run the command: "
+ "./bin/accumulo org.apache.accumulo.server.util.ChangeSecret"), | 0 |
import org.junit.Test;
public final class BaseResultSetHandlerTest extends BaseTestCase { | 1 |
package org.apache.metadata;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import junit.framework.TestCase;
import org.apache.metadata.storage.TypedStruct;
import org.apache.metadata.types.*;
import org.junit.Before;
import org.junit.Test;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.Map;
public class StructTest extends BaseTest {
StructType structType;
StructType recursiveStructType;
@Before
public void setup() throws MetadataException {
super.setup();
structType = (StructType) ms.getTypeSystem().getDataType(STRUCT_TYPE_1);
recursiveStructType = (StructType) ms.getTypeSystem().getDataType(STRUCT_TYPE_2);
}
@Test
public void test1() throws MetadataException {
Struct s = createStruct(ms);
TypedStruct ts = structType.convert(s, Multiplicity.REQUIRED);
System.out.println(ts);
}
@Test
public void testRecursive() throws MetadataException {
Struct s1 = new Struct(recursiveStructType.getName());
s1.set("a", 1);
Struct s2 = new Struct(recursiveStructType.getName());
s2.set("a", 1);
s2.set("s", s1);
TypedStruct ts = recursiveStructType.convert(s2, Multiplicity.REQUIRED);
System.out.println(ts);
}
} | 0 |
import cz.seznam.euphoria.core.annotation.audience.Audience;
@Audience(Audience.Type.CLIENT) | 0 |
private boolean secureValidation;
/**
* Set whether secure validation is enabled or not. The default is false.
*/
public void setSecureValidation(boolean secureValidation) {
this.secureValidation = secureValidation;
}
ki.setSecureValidation(secureValidation);
cipherInput.setSecureValidation(secureValidation);
EncryptedKeyResolver resolver =
);
// Add a EncryptedKey resolver
ki.registerInternalKeyResolver(resolver);
ki.setSecureValidation(secureValidation);
cipherInput.setSecureValidation(secureValidation);
KeyInfo ki = new KeyInfo(keyInfoElement, null);
ki.setSecureValidation(secureValidation);
result.setKeyInfo(ki);
KeyInfo ki = new KeyInfo(keyInfoElement, null);
ki.setSecureValidation(secureValidation);
result.setKeyInfo(ki); | 0 |
objectsCF = new HashSet<>();
objectsCol = new HashSet<>();
return new Pair<>(decode(cols[0]), null);
return new Pair<>(decode(cols[0]), decode(cols[1])); | 0 |
import org.eclipse.jetty.server.session.SessionCache;
private final SessionCache sessionCache = createNiceMock(SessionCache.class);
expect(handler.getSessionHandler()).andReturn(createNiceMock(SessionHandler.class));
expect(sessionHandler.getSessionCache()).andReturn(sessionCache);
replay(handler, server, sessionHandler);
verify(handler, server, sessionHandler);
expect(handler.getSessionHandler()).andReturn(createNiceMock(SessionHandler.class));
expect(sessionHandler.getSessionCache()).andReturn(sessionCache);
replay(handler, server, sessionHandler);
verify(handler, server, sessionHandler); | 0 |
/*
* 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 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.collections;
import org.apache.commons.collections.trie.SynchronizedTrie;
import org.apache.commons.collections.trie.UnmodifiableTrie;
/**
* A collection of {@link Trie} utilities.
*
* @since 4.0
* @version $Id$
*/
public class TrieUtils {
/**
* {@link TrieUtils} should not normally be instantiated.
*/
private TrieUtils() {}
/**
* Returns a synchronized instance of a {@link Trie}
*
* @see Collections#synchronizedMap(Map)
*/
public static <K, V> Trie<K, V> synchronizedTrie(Trie<K, V> trie) {
return SynchronizedTrie.synchronizedTrie(trie);
}
/**
* Returns an unmodifiable instance of a {@link Trie}
*
* @see Collections#unmodifiableMap(Map)
*/
public static <K, V> Trie<K, V> unmodifiableTrie(Trie<K, V> trie) {
return UnmodifiableTrie.unmodifiableTrie(trie);
}
} | 0 |
import javax.ws.rs.*;
import org.apache.ambari.view.filebrowser.utils.ServiceFormattedException;
throws IOException, InterruptedException {
@FormDataParam("path") String path) {
try {
if (!path.endsWith("/"))
path = path + "/";
String filePath = path + contentDisposition.getFileName();
uploadFile(filePath, uploadedInputStream);
return Response.ok(
HdfsApi.fileStatusToJSON(getApi(context).getFileStatus(filePath)))
.build();
} catch (WebApplicationException ex) {
throw ex;
} catch (Exception ex) {
throw new ServiceFormattedException(ex.getMessage(), ex);
}
@FormDataParam("path") String path) {
try {
if (!path.endsWith("/"))
path = path + "/";
ZipInputStream zip = new ZipInputStream(uploadedInputStream);
ZipEntry ze = zip.getNextEntry();
HdfsApi api = getApi(context);
while (ze != null) {
String filePath = path + ze.getName();
if (ze.isDirectory()) {
api.mkdir(filePath);
} else {
uploadFile(filePath, zip);
}
ze = zip.getNextEntry();
return Response.ok(HdfsApi.fileStatusToJSON(api.listdir(path))).build();
} catch (WebApplicationException ex) {
throw ex;
} catch (Exception ex) {
throw new ServiceFormattedException(ex.getMessage(), ex); | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ComparisonChain; | 0 |
import org.apache.aurora.scheduler.HostOffer;
public MachineResource apply(HostOffer offer) {
Resources resources = Resources.from(offer.getOffer());
return new MachineResource(quota, Conversions.isDedicated(offer.getOffer())); | 0 |
import org.apache.commons.vfs.FileSystemOptions;
* @version $Revision: 1.4 $ $Date: 2004/05/01 18:14:29 $
*
protected FileName parseUri(final String uri)
return ZipFileName.parseUri(uri);
*
* @param file The file to create the file system on top of.
protected FileSystem doCreateFileSystem(final String scheme,
final FileObject file,
final FileSystemOptions fileSystemOptions)
new ZipFileName(scheme, file.getName().getURI(), FileName.ROOT_PATH);
return new ZipFileSystem(rootName, file, fileSystemOptions); | 0 |
entry.getValue().storage.putAllSubstituted(dynamic.get(entry.getKey())); | 0 |
/**
* File bean
*/
private String filePath;
private String fileContent;
private boolean hasNext;
private long page;
private long pageCount;
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public String getFileContent() {
return fileContent;
}
public void setFileContent(String fileContent) {
this.fileContent = fileContent;
}
public boolean isHasNext() {
return hasNext;
}
public void setHasNext(boolean hasNext) {
this.hasNext = hasNext;
}
public long getPage() {
return page;
}
public void setPage(long page) {
this.page = page;
}
public long getPageCount() {
return pageCount;
}
public void setPageCount(long pageCount) {
this.pageCount = pageCount;
} | 0 |
import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleListener;
public class DirectoryWatcher extends Thread implements BundleListener
this.context.addBundleListener(this);
public void bundleChanged(BundleEvent bundleEvent)
{
if (bundleEvent.getType() == BundleEvent.UNINSTALLED)
{
for (Iterator it = currentManagedArtifacts.entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
Artifact artifact = (Artifact) entry.getValue();
if (artifact.getBundleId() == bundleEvent.getBundle().getBundleId())
{
log("Bundle " + bundleEvent.getBundle().getBundleId() + " has been uninstalled", null);
currentManagedArtifacts.remove(entry.getKey());
break;
}
}
}
}
this.context.removeBundleListener(this); | 0 |
for (int i=0; i<s.getLength(); i++) {
Reference r = s.item(i);
String fn = "merlin16_"+i+".html";
System.out.println("Wrote Reference " + i + " to file " + fn);
JavaUtils.writeBytesToFilename(fn, r.getHTMLRepresentation().getBytes());
}
/*
*/ | 0 |
ConfigurationCopy confCopy = new ConfigurationCopy(Iterables.filter(siteConf, input -> !input.getKey().startsWith(Property.TABLE_SAMPLER.getKey()))); | 0 |
import java.util.NoSuchElementException;
throw new NoSuchElementException(); | 0 |
p.apply(
Create.of(ungroupedPairs)
.withCoder(KvCoder.of(StringUtf8Coder.of(), BigEndianIntegerCoder.of())))
.apply(Window.into(Sessions.withGapDuration(Duration.standardMinutes(1))));
input.apply("GroupByKey", GroupByKey.create()).apply("GroupByKeyAgain", GroupByKey.create()); | 0 |
// Do nothing. | 0 |
import org.apache.ambari.server.controller.internal.ResourceImpl;
import org.apache.ambari.server.controller.spi.PropertyId;
import org.apache.ambari.server.controller.spi.Request;
import org.apache.ambari.server.controller.spi.Resource;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
import org.junit.Assert;
import java.util.Collections;
import java.util.Set;
* Test the Ganglia property provider.
private static final PropertyId PROPERTY_ID = PropertyHelper.getPropertyId("bytes_out", "network", true);
public void testGetResources() throws Exception {
Set< PropertyId > propertyIds = PropertyHelper.getPropertyIds(Resource.Type.HostComponent, "GANGLIA");
TestStreamProvider streamProvider = new TestStreamProvider();
GangliaPropertyProvider propertyProvider = new GangliaPropertyProvider(propertyIds,
streamProvider,
"ec2-23-23-71-42.compute-1.amazonaws.com");
// namenode
Resource resource = new ResourceImpl(Resource.Type.HostComponent);
resource.setProperty(GangliaPropertyProvider.HOST_COMPONENT_HOST_NAME_PROPERTY_ID, "domU-12-31-39-0E-34-E1.compute-1.internal");
resource.setProperty(GangliaPropertyProvider.HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID, "NAMENODE");
// only ask for one property
Request request = PropertyHelper.getReadRequest(Collections.singleton(PROPERTY_ID));
Assert.assertEquals(1, propertyProvider.populateResources(Collections.singleton(resource), request, null).size());
Assert.assertEquals("http://ec2-23-23-71-42.compute-1.amazonaws.com/ganglia/graph.php?c=HDPNameNode&h=domU-12-31-39-0E-34-E1.compute-1.internal&m=bytes_out&json=1",
streamProvider.getLastSpec());
Assert.assertEquals(3, PropertyHelper.getProperties(resource).size());
Assert.assertNotNull(resource.getPropertyValue(PROPERTY_ID));
} | 0 |
import static org.easymock.EasyMock.replay;
import org.easymock.EasyMock;
context = EasyMock.createMock(ClientContext.class);
EasyMock.expect(context.getRootTabletLocation()).andReturn("tserver1").anyTimes();
EasyMock.expect(context.getInstanceID()).andReturn("instance1").anyTimes();
replay(context);
parent.invalidateCache(context, src.tablet_location);
parent.invalidateCache(context, tserver);
public void invalidateCache(ClientContext context, String server) {}
tab1TabletCache.invalidateCache(context, "tserver8");
tab1TabletCache.invalidateCache(context, "tserver4");
tab1TabletCache.invalidateCache(context, "tserver6");
tab1TabletCache.invalidateCache(context, "tserver9");
EasyMock.verify(context);
context = EasyMock.createMock(ClientContext.class);
EasyMock.expect(context.getInstanceID()).andReturn("instance1").anyTimes();
EasyMock.expect(context.getRootTabletLocation()).andReturn("tserver4").anyTimes();
replay(context);
tab1TabletCache.invalidateCache(context, "tserver7");
tab1TabletCache.invalidateCache(context, "tserver7"); | 0 |
import org.apache.commons.configuration.DefaultListDelimiterHandler;
.setListDelimiterHandler(
new DefaultListDelimiterHandler(';'));
params.setInterpolator(ci).setListDelimiterHandler(
new DefaultListDelimiterHandler('#'));
DefaultListDelimiterHandler listHandler =
(DefaultListDelimiterHandler) config.getListDelimiterHandler();
assertEquals("Wrong list delimiter", ';', listHandler.getDelimiter()); | 0 |
*
* @version CVS $Id: RepeaterJXPathBindingBuilder.java,v 1.9 2004/01/11 20:51:16 vgritsenko Exp $
CommonAttributes commonAtts = JXpathBindingBuilderBase.getCommonAttributes(bindingElm);
convertor, convertorLocale, | 0 |
private final int bufferSize;
H1Config(final int bufferSize, final int chunkSizeHint, final int waitForContinueTimeout,
final int maxLineLength, final int maxHeaderCount, final int maxEmptyLineCount) {
this.bufferSize = bufferSize;
public int getBufferSize() {
return bufferSize;
}
builder.append("[bufferSize=").append(bufferSize)
.append(", chunkSizeHint=").append(chunkSizeHint)
Args.notNull(config, "Config");
.setBufferSize(config.getBufferSize())
private int bufferSize;
this.bufferSize = -1;
public Builder setBufferSize(final int bufferSize) {
this.bufferSize = bufferSize;
return this;
}
return new H1Config(bufferSize > 0 ? bufferSize : 8192, chunkSizeHint, waitForContinueTimeout, maxLineLength, maxHeaderCount, maxEmptyLineCount); | 0 |
private final FileName rootName;
* Retrieves the attribute with the specified name. The default | 0 |
/**
* 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 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.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zookeeper.server;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.io.IOException;
import org.apache.zookeeper.server.NIOServerCnxnFactory.SelectorThread;
public class MockNIOServerCnxn extends NIOServerCnxn {
public MockNIOServerCnxn(ZooKeeperServer zk, SocketChannel sock,
SelectionKey sk, NIOServerCnxnFactory factory,
SelectorThread selectorThread) throws IOException {
super(zk, sock, sk, factory, selectorThread);
}
/**
* Handles read/write IO on connection.
*/
public void doIO(SelectionKey k) throws InterruptedException {
super.doIO(k);
}
@Override
protected boolean isSocketOpen() {
return true;
}
} | 0 |
import org.apache.beam.sdk.coders.ByteArrayCoder;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.coders.VarIntCoder;
import org.apache.beam.sdk.coders.VoidCoder;
public void createRootBundleShouldCreateWithEmptyKey() {
assertThat(bundle.getKey(),
Matchers.<StructuralKey<?>>equalTo(StructuralKey.of(null, VoidCoder.of())));
private <T> void createKeyedBundle(Coder<T> coder, T key) throws Exception {
StructuralKey skey = StructuralKey.of(key, coder);
bundleFactory.createKeyedBundle(null, skey, pcollection);
assertThat(bundle.getKey(), equalTo(skey));
public void keyedWithNullKeyShouldCreateKeyedBundle() throws Exception {
createKeyedBundle(VoidCoder.of(), null);
public void keyedWithKeyShouldCreateKeyedBundle() throws Exception {
createKeyedBundle(StringUtf8Coder.of(), "foo");
createKeyedBundle(VarIntCoder.of(), 1234);
createKeyedBundle(ByteArrayCoder.of(), new byte[] {0, 2, 4, 99});
assertThat(withed.getKey(), Matchers.<StructuralKey<?>>equalTo(committed.getKey()));
bundleFactory.createBundle(
bundleFactory.createKeyedBundle(
null,
StructuralKey.of("foo", StringUtf8Coder.of()),
created).commit(Instant.now()),
downstream).commit(Instant.now());
assertThat(newBundle.getKey().getKey(), Matchers.<Object>equalTo("foo"));
CommittedBundle<KV<String, Integer>> keyedBundle = bundleFactory.createKeyedBundle(
bundleFactory.createRootBundle(created).commit(Instant.now()),
StructuralKey.of("foo", StringUtf8Coder.of()),
downstream).commit(Instant.now());
assertThat(keyedBundle.getKey().getKey(), Matchers.<Object>equalTo("foo")); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.