Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* Default implementation of {@link IOEventDispatch} interface for plain
* The following parameters can be used to customize the behavior of this
* class:
* Creates a new instance of this class to be used for dispatching I/O event
*
final NHttpClientHandler handler,
* Creates an instance of {@link HeapByteBufferAllocator} to be used
* This method can be overridden in a super class in order to provide
* a different implementation of the {@link ByteBufferAllocator} interface.
*
return new HeapByteBufferAllocator();
* Creates an instance of {@link DefaultHttpResponseFactory} to be used
* This method can be overridden in a super class in order to provide
* a different implementation of the {@link HttpResponseFactory} interface.
*
* This method can be overridden in a super class in order to provide
* a different implementation of the {@link NHttpClientIOTarget} interface.
*
* @param session the underlying I/O session.
*
session,
this.params);
NHttpClientIOTarget conn =
NHttpClientIOTarget conn =
NHttpClientIOTarget conn =
NHttpClientIOTarget conn = | 0 |
import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly; | 0 |
* Constructor needed for subclass serialisation.
protected AbstractListValuedMap() {
super();
* @throws NullPointerException if the map is null
protected AbstractListValuedMap(final Map<K, ? extends List<V>> map) {
super(map);
}
// -----------------------------------------------------------------------
@Override
@SuppressWarnings("unchecked")
protected Map<K, List<V>> getMap() {
return (Map<K, List<V>>) super.getMap();
protected abstract List<V> createCollection();
// -----------------------------------------------------------------------
return ListUtils.emptyIfNull(getMap().remove(key));
// -----------------------------------------------------------------------
return getMap().get(key);
this.values = ListUtils.emptyIfNull(getMap().get(key));
this.values = ListUtils.emptyIfNull(getMap().get(key)); | 0 |
* @throws Exception if ServiceManager enterEnvironment fails
* @throws Exception if enterEnvironment fails
* @throws Exception if enterEnvironment fails | 0 |
* @version CVS $Id: LuceneCocoonPager.java,v 1.3 2003/10/26 00:56:05 vgritsenko Exp $
* Default count of hits per page.
* Default starting index
* Current index of hit to return by next()
* Maximum count of hits to return by next(), and previous()
* Hits to iterate upon
* Constructor for the LuceneCocoonPager object
public LuceneCocoonPager() {
}
* Sets the hits attribute of the LuceneCocoonPager object
if (this.countOfHitsPerPage <= 0) {
this.countOfHitsPerPage = 1;
}
return hitsIndex < hits.length();
return hitsIndex > countOfHitsPerPage;
HitWrapper hit = new HitWrapper(hits.score(hitsIndex),
hits.doc(hitsIndex));
hitsPerPageList.add(hit);
return Math.min(hitsIndex, hits.length());
HitWrapper hit = new HitWrapper(hits.score(startIndex),
hits.doc(startIndex));
hitsPerPageList.add(hit);
return Math.max(0, hitsIndex - 2 * countOfHitsPerPage);
* @version CVS $Id: LuceneCocoonPager.java,v 1.3 2003/10/26 00:56:05 vgritsenko Exp $
public static class HitWrapper { | 0 |
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-0e-34-e1.compute-1.internal:50070"), streamProvider.getLastSpec());
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-14-ee-b3.compute-1.internal:50075"), streamProvider.getLastSpec());
Assert.assertEquals(propertyProvider.getSpec("domu-12-31-39-14-ee-b3.compute-1.internal:50030"), streamProvider.getLastSpec()); | 0 |
package org.apache.atlas.web.security;
import org.apache.atlas.web.TestUtils;
public class SSLAndKerberosIT extends BaseSSLAndKerberosTest {
String persistDir = TestUtils.getTempDirectory();
final PropertiesConfiguration configuration = getSSLConfiguration(providerUrl);
TestUtils.writeConfiguration(configuration, persistDir + File.separator + "client.properties");
url = SSLAndKerberosIT.class.getResource("/application.properties");
TestUtils.writeConfiguration(configuration, persistDir + File.separator + "application.properties");
// save original setting
originalConf = System.getProperty("atlas.conf");
System.setProperty("atlas.conf", persistDir);
secureEmbeddedServer = new TestSecureEmbeddedServer(21443, getWarPath()) {
public void testService() throws Exception {
dgiCLient.listTypes(); | 0 |
import java.util.Set;
import org.apache.ambari.server.state.PropertyInfo;
import org.apache.ambari.server.utils.SecretReference;
private Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes;
public ConfigurationResponse(String clusterName, StackId stackId,
String type, String versionTag, Long version,
Map<String, String> configs,
Map<String, Map<String, String>> configAttributes,
Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes) {
this.clusterName = clusterName;
this.stackId = stackId;
this.configs = configs;
this.type = type;
this.versionTag = versionTag;
this.version = version;
this.configs = configs;
this.configAttributes = configAttributes;
this.propertiesTypes = propertiesTypes;
stubPasswords();
}
config.getPropertiesAttributes(), config.getPropertiesTypes());
public Map<PropertyInfo.PropertyType, Set<String>> getPropertiesTypes() {
return propertiesTypes;
}
public void setPropertiesTypes(Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes) {
this.propertiesTypes = propertiesTypes;
}
private void stubPasswords(){
if(propertiesTypes != null && propertiesTypes.containsKey(PropertyInfo.PropertyType.PASSWORD)) {
for(String pwdPropertyName: propertiesTypes.get(PropertyInfo.PropertyType.PASSWORD)) {
if(configs.containsKey(pwdPropertyName)){
String stub = SecretReference.generateStub(clusterName, type, version);
configs.put(pwdPropertyName, stub);
}
}
}
} | 0 |
import static org.hamcrest.Matchers.is;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.beam.sdk.io.TextIO.Read;
import org.apache.beam.sdk.runners.TransformHierarchy.Node;
/**
* Tests that all reads are consumed by at least one {@link PTransform}.
*/
@Test
public void testUnconsumedReads() throws IOException {
DataflowPipelineOptions dataflowOptions = buildPipelineOptions();
RuntimeTestOptions options = dataflowOptions.as(RuntimeTestOptions.class);
Pipeline p = buildDataflowPipeline(dataflowOptions);
PCollection<String> unconsumed = p.apply(Read.from(options.getInput()).withoutValidation());
DataflowRunner.fromOptions(dataflowOptions).replaceTransforms(p);
final AtomicBoolean unconsumedSeenAsInput = new AtomicBoolean();
p.traverseTopologically(new PipelineVisitor.Defaults() {
@Override
public void visitPrimitiveTransform(Node node) {
unconsumedSeenAsInput.set(true);
}
});
assertThat(unconsumedSeenAsInput.get(), is(true));
}
| 0 |
import org.apache.felix.dm.annotation.api.ResourceDependency;
import org.apache.felix.dm.annotation.api.ServiceDependency; | 0 |
Copyright 2002-2003 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 |
package org.apache.sshd.client.subsystem.sftp.fs; | 0 |
public EncryptedKeyResolver(String algorithm) {
public EncryptedKeyResolver(String algorithm, Key kek) { | 0 |
final ArrayList<Object> actual = new ArrayList<>(IteratorUtils.toList(map.iterator("one")));
final ArrayList<Object> expected = new ArrayList<>(Arrays.asList("uno", "un")); | 0 |
private static final Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
private static final Set<String> propertyIds = Sets.newHashSet( | 0 |
* @version CVS $Id: SimpleSessionContext.java,v 1.9 2004/03/19 14:16:55 cziegeler Exp $
/** The source resolver */
private SourceResolver resolver;
public SimpleSessionContext(XPathProcessor xPathProcessor, SourceResolver resolver)
this.data = DOMUtil.createDocument();
this.data.appendChild(data.createElementNS(null, "context"));
this.resolver = resolver;
SourceParameters parameters)
source = SourceUtil.getSource(this.loadResource, null, parameters, this.resolver);
SourceParameters parameters)
this.resolver, | 0 |
import java.net.URL;
import java.util.HashMap;
import org.apache.commons.io.FilenameUtils;
import org.osgi.framework.Bundle;
request.setAttribute( WebConsoleConstants.ATTR_LANG_MAP, getLangMap() );
private Map langMap;
private final Map getLangMap()
{
if (null != langMap) return langMap;
final Map map = new HashMap();
final Bundle bundle = bundleContext.getBundle();
final Enumeration e = bundle.findEntries("res/flags", null, false);
while (e != null && e.hasMoreElements())
{
final URL img = (URL) e.nextElement();
final String name = FilenameUtils.getBaseName(img.getFile());
try
{
final String locale = new Locale(name).getDisplayLanguage();
map.put(name, null != locale ? locale : name);
}
catch (Throwable t)
{
t.printStackTrace();
/* ignore invalid locale? */
}
}
return langMap = map;
} | 0 |
package org.apache.commons.digester3.annotations.rules;
import org.apache.commons.digester3.CallParamRule;
import org.apache.commons.digester3.annotations.DigesterRule;
import org.apache.commons.digester3.annotations.DigesterRuleList;
import org.apache.commons.digester3.annotations.providers.StackCallParamRuleProvider;
* @see org.apache.commons.digester3.Digester#addCallParam(String,int,int) | 1 |
* @since 1.0 | 0 |
* This class maintains a map of HTTP routes to maximum number of connections allowed
* for those routes. This class can be used by pooling
* {@link org.apache.http.conn.ClientConnectionManager connection managers} for
* a fine-grained control of connections on a per route basis.
*
| 0 |
GuiceUtils.bindJNIContextClassLoader(binder(), Scheduler.class);
GuiceUtils.bindExceptionTrap(binder(), Scheduler.class); | 0 |
public synchronized DatagramPacket getDatagramPacket()
{
if (dp == null) {
dp = new DatagramPacket(buf, buf.length);
dp.setPort(NTP_PORT);
} | 0 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/util/AbstractList.java,v 1.6 2006/03/14 01:20:25 hargrave Exp $
*
* (C) Copyright 2001 Sun Microsystems, Inc.
* Copyright (c) OSGi Alliance (2001, 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 java.util;
public abstract class AbstractList extends java.util.AbstractCollection implements java.util.List {
protected AbstractList() { }
public void add(int var0, java.lang.Object var1) { }
public boolean add(java.lang.Object var0) { return false; }
public boolean addAll(int var0, java.util.Collection var1) { return false; }
public void clear() { }
public boolean equals(java.lang.Object var0) { return false; }
public abstract java.lang.Object get(int var0);
public int hashCode() { return 0; }
public int indexOf(java.lang.Object var0) { return 0; }
public java.util.Iterator iterator() { return null; }
public int lastIndexOf(java.lang.Object var0) { return 0; }
public java.util.ListIterator listIterator() { return null; }
public java.util.ListIterator listIterator(int var0) { return null; }
public java.lang.Object remove(int var0) { return null; }
protected void removeRange(int var0, int var1) { }
public java.lang.Object set(int var0, java.lang.Object var1) { return null; }
public java.util.List subList(int var0, int var1) { return null; }
protected int modCount;
}
| 0 |
import java.nio.charset.StandardCharsets;
Buffer buf = new ByteArrayBuffer("SSH-2.0-software\r\n".getBytes(StandardCharsets.UTF_8));
Buffer buf = new ByteArrayBuffer("SSH-2.0-software\n".getBytes(StandardCharsets.UTF_8));
Buffer buf = new ByteArrayBuffer(("a header line\r\nSSH-2.0-software\r\n").getBytes(StandardCharsets.UTF_8));
Buffer buf = new ByteArrayBuffer("header line\r\nSSH".getBytes(StandardCharsets.UTF_8));
buf.putRawBytes("-2.0-software\r\n".getBytes(StandardCharsets.UTF_8));
Buffer buf = new ByteArrayBuffer(("SSH-2.0-software\ra").getBytes(StandardCharsets.UTF_8));
"01234567890123456789012345678901234567890123456789").getBytes(StandardCharsets.UTF_8));
Buffer buf = new ByteArrayBuffer(sb.toString().getBytes(StandardCharsets.UTF_8)); | 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.recipes.lock;
/**
* This class has two methods which are call
* back methods when a lock is acquired and
* when the lock is released.
*
*/
public interface LockListener {
/**
* call back called when the lock
* is acquired
*/
public void lockAcquired();
/**
* call back called when the lock is
* released.
*/
public void lockReleased();
} | 0 |
import javax.servlet.http.HttpServletRequest;
public void testWithInvalidRequest()
{
HttpServletRequest hsr = HttpServletRequestFactory.createInvalidHttpServletRequest();
FileUpload fu = null;
fu = new FileUpload();
HttpServletRequest req = HttpServletRequestFactory.createInvalidHttpServletRequest();
try
{
fu.parseRequest(req);
fail("expected exception was not thrown");
}
catch (FileUploadException expected)
{
// this exception is expected
}
}
public void testWithNullContentType()
{
HttpServletRequest hsr = HttpServletRequestFactory.createInvalidHttpServletRequest();
FileUpload fu = null;
fu = new FileUpload();
HttpServletRequest req = HttpServletRequestFactory.createHttpServletRequestWithNullContentType();
try
{
fu.parseRequest(req);
fail("expected exception was not thrown");
}
catch (FileUploadException expected)
{
// this exception is expected
}
}
| 0 |
package org.apache.beam.sdk.extensions.euphoria.core.util; | 0 |
public class RowSetDynaClass extends JDBCDynaClass { | 0 |
dbAccessor.executeQuery("ALTER TABLE ambari_sequences RENAME COLUMN value to sequence_value DECIMAL(38) NOT NULL"); | 0 |
public class ArrayListHandler extends AbstractListHandler {
* @see org.apache.commons.dbutils.handlers.AbstractListHandler#handle(ResultSet) | 0 |
@SuppressWarnings("StringSplitter") | 0 |
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
@Deprecated | 0 |
result = this.executor.invokePreparableMatcher(this,
objectModel,
matcher,
preparedPattern,
resolvedParams); | 0 |
package org.apache.aurora.scheduler.config.converters;
import com.beust.jcommander.converters.BaseConverter;
public class InetSocketAddressConverter extends BaseConverter<InetSocketAddress> {
public InetSocketAddressConverter(String optionName) {
super(optionName);
}
public InetSocketAddress convert(String value) {
return InetSocketAddressHelper.parse(value); | 0 |
* {@link #setSender(String) setSender} and
* {@link #addRecipient(String) addRecipient}, and then sends the
* message using {@link #sendShortMessageData(String) sendShortMessageData}.
* <p>
* Note that the method ignores failures when calling
* {@link #addRecipient(String) addRecipient} so long as
* at least one call succeeds. If no recipients can be successfully
* added then the method will fail (and does not attempt to
* send the message) | 0 |
* Returns an {@link AsMultimap} that takes a {@link PCollection} as input
* A {@link PTransform} that produces a {@link PCollectionView} of a singleton
* {@link PCollection} yielding the single element it contains.
* A {@link PTransform} that produces a {@link PCollectionView} of a singleton
* {@link PCollection} yielding the single element it contains.
* A {@link PTransform} that produces a {@link PCollectionView} of a keyed {@link PCollection}
* A {@link PTransform} that produces a {@link PCollectionView} of a keyed {@link PCollection} | 0 |
public String getTargetServerName() {
public String getSourceServerName() {
public void setSourceServerName(String sourceClusterName) {
public void setTargetServerName(String targetClusterName) { | 0 |
import org.apache.aurora.common.application.Lifecycle;
import org.apache.aurora.common.base.Command;
private Command shutdownCommand;
shutdownCommand = createMock(Command.class);
storageUtil.storage,
new Lifecycle(shutdownCommand));
shutdownCommand.execute();
| 0 |
try (SshServer sshd = setupTestServer()) {
try (SshClient client = setupTestClient()) {
try (ClientSession session = client.connect(getCurrentTestName(), SshdSocketAddress.LOCALHOST_IP, port).verify(7L, TimeUnit.SECONDS).getSession()) {
try (ChannelExec channel = session.createExecChannel(command)) { | 0 |
public static <T> Predicate<T> andPredicate(final Predicate<? super T> predicate1,
final Predicate<? super T> predicate2) { | 0 |
* Gets the user privilege service
*/
@Path("{userName}/privileges")
public PrivilegeService getPrivilegeService(@Context javax.ws.rs.core.Request request,
@PathParam ("userName") String userName) {
return new UserPrivilegeService(userName);
}
/** | 0 |
XMLUtils.repoolDocumentBuilder(db); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/CommandLineParser.java,v 1.3 2002/08/26 20:15:02 jkeyes Exp $
* $Revision: 1.3 $
* $Date: 2002/08/26 20:15:02 $
* A class that implements the <code>CommandLineParser</code> interface
* can parse a String array according to the {@link Options} specified
* and return a {@link CommandLine}.
* | 0 |
import static org.junit.jupiter.api.Assertions.assertTrue;
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.hc.client5.http.client.cache;
import java.io.IOException;
/**
* Thrown if serialization or deserialization of an {@link HttpCacheEntry}
* fails.
*/
public class HttpCacheEntrySerializationException extends IOException {
private static final long serialVersionUID = 9219188365878433519L;
public HttpCacheEntrySerializationException(final String message) {
super();
}
public HttpCacheEntrySerializationException(final String message, final Throwable cause) {
super(message);
initCause(cause);
}
} | 0 |
* TODO Add javadoc
*
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
* @param factory The {@link CloseableExecutorService} factory to use for spawning threads.
* If {@code null} then an internal service is allocated. | 0 |
private static final String IS_TENTATIVE_KEY = "tentative";
// Prefer the tentative (fresher) value if it exists.
if (Boolean.parseBoolean(context.get(IS_TENTATIVE_KEY)) || !results.containsKey(fullName)) {
results.put(fullName, toValue(aggregator, metricUpdate));
} | 0 |
protected void setupDefaults(Connection con, String username) throws SQLException {
boolean defaultAutoCommit = isDefaultAutoCommit();
if (con.getAutoCommit() != defaultAutoCommit) {
con.setAutoCommit(defaultAutoCommit);
}
boolean defaultReadOnly = isDefaultReadOnly();
if (con.isReadOnly() != defaultReadOnly) {
con.setReadOnly(defaultReadOnly);
} | 0 |
protected int port1;
protected int port2;
protected int port3;
protected int port4;
protected int port5;
protected int portLE1;
protected int portLE2;
protected int portLE3;
protected int portLE4;
protected int portLE5; | 0 |
package org.apache.ambari.server.controller.ganglia;
import org.apache.ambari.server.controller.internal.PropertyIdImpl;
import org.apache.ambari.server.controller.utilities.PredicateHelper; | 0 |
import org.apache.beam.sdk.metrics.MetricResults;
@Override
public MetricResults metrics() {
throw new UnsupportedOperationException("The FlinkRunner does not currently support metrics.");
} | 0 |
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.tempuri.javac.JavaClassWriter;
import org.tempuri.javac.JavaClassWriterFactory;
import org.tempuri.javac.JavaCompiler;
import org.tempuri.javac.JavaCompilerErrorHandler; | 0 |
import org.apache.avalon.framework.configuration.ConfigurationException;
// Create and store all blocks
for (int i = 0; i < blockConfs.length; i++) {
Configuration blockConf = blockConfs[i];
String id = null;
String location = null;
try {
id = blockConf.getAttribute("id");
location = blockConf.getAttribute("location");
} catch (ConfigurationException e) {
throw new ServletException("Couldn't get id or location from the wiring file");
}
this.getLogger().debug("Creating " + blockConf.getName() +
" id=" + id +
" location=" + location);
BlockManager blockManager = new BlockManager();
blockManager.init(blocksConfig);
blockManager.setBlocks(this);
try {
this.getLogger(),
this.context,
null,
blockConf);
} catch (Exception e) {
throw new ServletException(e);
}
this.blocks.put(id, blockManager);
String mountPath = blockConf.getChild("mount").getAttribute("path", null);
if (mountPath != null) {
this.mountedBlocks.put(fixPath(mountPath), blockManager);
this.getLogger().debug("Mounted block " + id + " at " + mountPath); | 0 |
public static final BogusPasswordAuthenticator INSTANCE = new BogusPasswordAuthenticator();
public BogusPasswordAuthenticator() {
super();
}
@Override | 0 |
/**
* Generated data to check that the wire format has not changed. To regenerate, see
* {@link com.google.cloud.dataflow.sdk.coders.PrintBase64Encodings}.
*/
private static final List<String> TEST_ENCODINGS = Arrays.asList(
"__________U",
"__________0",
"__________8",
"AAAAAAAAAAA",
"AAAAAAAAAAE",
"AAAAAAAAAAU",
"AAAAAAAAAA0",
"AAAAAAAAAB0",
"AAAAAIAAAII",
"_____3___-M",
"f_________8",
"gAAAAAAAAAA");
@Test
public void testWireFormatEncode() throws Exception {
CoderProperties.coderEncodesBase64(TEST_CODER, TEST_VALUES, TEST_ENCODINGS);
} | 0 |
import org.apache.accumulo.core.security.tokens.UserPassToken;
import org.junit.Assert;
return instance.getConnector(new UserPassToken("user", "pass")).tableOperations();
Connector c = instance.getConnector(new UserPassToken("user", "pass".getBytes())); | 0 |
Collections.singletonMap(Resource.Type.User, userName)); | 0 |
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl; | 0 |
import static java.util.Objects.requireNonNull;
this.delegate = requireNonNull(delegate); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/core/IfTag.java,v 1.12 2003/10/09 21:21:29 rdonkin Exp $
* $Revision: 1.12 $
* $Date: 2003/10/09 21:21:29 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* $Id: IfTag.java,v 1.12 2003/10/09 21:21:29 rdonkin Exp $
* @version $Revision: 1.12 $ | 0 |
import org.apache.aurora.scheduler.async.HistoryPruner.HistoryPrunnerSettings;
@CmdLine(name = "history_max_per_job_threshold",
help = "Maximum number of terminated tasks to retain in a job history.")
private static final Arg<Integer> HISTORY_MAX_PER_JOB_THRESHOLD = Arg.create(100);
@CmdLine(name = "history_min_retention_threshold",
help = "Minimum guaranteed time for task history retention before any pruning is attempted.")
private static final Arg<Amount<Long, Time>> HISTORY_MIN_RETENTION_THRESHOLD =
Arg.create(Amount.of(1L, Time.HOURS));
bind(HistoryPrunnerSettings.class).toInstance(new HistoryPrunnerSettings(
HISTORY_PRUNE_THRESHOLD.get(),
HISTORY_MIN_RETENTION_THRESHOLD.get(),
HISTORY_MAX_PER_JOB_THRESHOLD.get()
)); | 0 |
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Test;
public class Base32OutputStreamTest {
// @Test
@Test
@Test
@Test
@Test
@Test
@Test | 1 |
import org.apache.hc.core5.util.Timeout;
final Timeout timeout, | 0 |
return new HttpServiceServletHandler(this.context, info, this.servlet); | 0 |
this.manager.addServlet(service, ref); | 0 |
*
* @version $Id$ | 0 |
public final class ContextHandler implements Comparable<ContextHandler> | 0 |
@Override
public String toString() {
return "BatchRequest {" +
"orderId=" + orderId +
", type=" + type +
", uri='" + uri + '\'' +
'}';
} | 0 |
import com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain; | 0 |
import java.lang.ref.WeakReference;
elementMap.put(idValue, new WeakReference(element));
WeakReference weakReference = (WeakReference) elementMap.get(id);
if (weakReference != null)
{
return (Element) weakReference.get();
} | 0 |
int blocksCount = (len + 4) / outCipher.getCipherBlockSize();
int blocksCount = inCipherSize / inCipher.getCipherBlockSize();
int blocksCount = updateLen / inCipher.getCipherBlockSize();
int inBlockSize = inCipher.getCipherBlockSize();
int outBlockSize = outCipher.getCipherBlockSize(); | 0 |
this.buf = new SimpleInputBuffer((int) len, HeapByteBufferAllocator.INSTANCE); | 0 |
public static <E> List<E> unmodifiableList(final List<E> list) {
public UnmodifiableList(final List<E> list) {
public boolean add(final Object object) {
public boolean addAll(final Collection<? extends E> coll) {
public boolean remove(final Object object) {
public boolean removeAll(final Collection<?> coll) {
public boolean retainAll(final Collection<?> coll) {
public ListIterator<E> listIterator(final int index) {
public void add(final int index, final E object) {
public boolean addAll(final int index, final Collection<? extends E> coll) {
public E remove(final int index) {
public E set(final int index, final E object) {
public List<E> subList(final int fromIndex, final int toIndex) {
final List<E> sub = decorated().subList(fromIndex, toIndex); | 0 |
Float rotation = null;
// calculate the total rotation for this glyph
// set the new glyph position
// calculte the position of the next glyph
// need to translate so that the spacing
gv.setGlyphTransform(i, AffineTransform.getTranslateInstance(0, advanceY));
// rotate the glyph
if (rotation.floatValue() != 0f) {
AffineTransform glyphTransform = gv.getGlyphTransform(i);
if (glyphTransform == null) {
glyphTransform = new AffineTransform();
}
glyphTransform.rotate((double)rotation.floatValue());
gv.setGlyphTransform(i, glyphTransform);
}
| 0 |
environmentVersion.put(PropertyNames.ENVIRONMENT_VERSION_MAJOR_KEY, ENVIRONMENT_MAJOR_VERSION); | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
import org.apache.cocoon.SitemapTestCase; | 0 |
import org.apache.felix.webconsole.WebConsoleUtil;
String actionName = WebConsoleUtil.getParameter( req, Util.PARAM_ACTION );
if ( PARAM_NO_REDIRECT_AFTER_ACTION.equals( WebConsoleUtil.getParameter( req, | 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. | 0 |
* be used, if applicable.
void to(OutputStream out);
void to(OutputStream out, Charset charset); | 0 |
import org.apache.beam.sdk.options.Validation.Required;
import org.apache.beam.sdk.util.common.ReflectHelpers; | 0 |
public static void main(final String[] args) throws Exception {
final IOReactorConfig config = IOReactorConfig.custom()
final Future<ListenerEndpoint> future = server.listen(new InetSocketAddress(port));
final ListenerEndpoint listenerEndpoint = future.get(); | 0 |
public Response getTargetCluster(String body, @Context HttpHeaders headers, @Context UriInfo ui,
return handleRequest(headers, body, ui, Request.Type.GET, createTargetClusterResource(targetName));
public Response getTargetClusters(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
return handleRequest(headers, body, ui, Request.Type.GET, createTargetClusterResource(null)); | 0 |
import cz.seznam.euphoria.core.client.util.Pair; | 0 |
* @param wildcards the list of wildcards to match, not null
* @param caseSensitivity how to handle case sensitivity, null means
* case-sensitive
* @param wildcards the list of wildcards to match, not null
* The array is not cloned, so could be changed after constructing the instance.
* This would be inadvisable however.
* @param wildcards the array of wildcards to match
* @param caseSensitivity how to handle case sensitivity, null means
* case-sensitive
* @param wildcards the array of wildcards to match, not null
* @param fileInfo the file to check
* Splits a string into a number of tokens. The text is split by '?' and '*'.
* Where multiple '*' occur consecutively they are collapsed into a single '*'.
* @param text the text to split
* The wildcard matcher uses the characters '?' and '*' to represent a single or
* multiple (zero or more) wildcard characters. N.B. the sequence "*?" does not
* work properly at present in match strings.
* @param filename the filename to match on
* @param wildcardMatcher the wildcard string to match against
* @param caseSensitivity what case sensitivity rule to use, null means
* case-sensitive
static boolean wildcardMatch(final String filename, final String wildcardMatcher, IOCase caseSensitivity) {
final int repeat = caseSensitivity.checkIndexOf(filename, textIdx + 1, wcs[wcsIdx]); | 0 |
import java.util.WeakHashMap;
import org.apache.batik.dom.util.SoftDoublyIndexedTable;
* The ElementsByTagName lists.
*/
protected transient WeakHashMap elementsByTagNames;
/**
/**
* Returns an ElementsByTagName object from the cache, if any.
*/
public ElementsByTagName getElementsByTagName(Node n, String ns, String ln) {
if (elementsByTagNames == null) {
return null;
}
SoftDoublyIndexedTable t;
t = (SoftDoublyIndexedTable)elementsByTagNames.get(n);
if (t == null) {
return null;
}
return (ElementsByTagName)t.get(ns, ln);
}
/**
* Puts an ElementsByTagName object in the cache.
*/
public void putElementsByTagName(Node n, String ns, String ln,
ElementsByTagName l) {
if (elementsByTagNames == null) {
elementsByTagNames = new WeakHashMap(11);
}
SoftDoublyIndexedTable t;
t = (SoftDoublyIndexedTable)elementsByTagNames.get(n);
if (t == null) {
elementsByTagNames.put(n, t = new SoftDoublyIndexedTable());
}
t.put(ns, ln, l);
}
| 1 |
public PCollection.IsBounded isBounded() {
return null;
}
@Override | 0 |
* INSTALLING -> INSTALLED | INSTALL_FAILED | OUT_OF_SYNC
* INSTALLED -> INSTALLED | INSTALLING | OUT_OF_SYNC
* OUT_OF_SYNC -> INSTALLING
INSTALLING(2),
INSTALLED(3),
INSTALL_FAILED(0),
/**
* Repository version that is installed for some components but not for all.
*/
OUT_OF_SYNC(1),
CURRENT(7),
UPGRADING(5),
UPGRADE_FAILED(4),
UPGRADED(6);
/**
* Is used to determine cluster version state.
* @see org.apache.ambari.server.state.Cluster#recalculateClusterVersionState(String)
*/
private int priority;
RepositoryVersionState(int priority) {
this.priority = priority;
}
public int getPriority() {
return priority;
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/xml/XMLParser.java,v 1.2 2003/03/11 00:59:35 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2003/03/11 00:59:35 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.2 $ $Date: 2003/03/11 00:59:35 $ | 0 |
config.put(Server.CONFIG_PROPERTY_HTTP_HOST,
context.getProperty(Server.CONFIG_PROPERTY_HTTP_HOST)); | 0 |
import javax.mail.Header;
private Map<String, Object> attributeMap;
List<MimeFileObject> vfs = new ArrayList<MimeFileObject>();
return vfs.toArray(new MimeFileObject[vfs.size()]);
protected Map<String, Object> doGetAttributes() throws Exception
attributeMap = Collections.emptyMap();
@SuppressWarnings("unchecked") // Javadoc says Part returns Header
protected Enumeration<Header> getAllHeaders() throws MessagingException | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/Attic/ResettableListIterator.java,v 1.1 2003/11/14 22:58:27 scolebourne Exp $
* @version $Revision: 1.1 $ $Date: 2003/11/14 22:58:27 $
public interface ResettableListIterator extends ListIterator, ResettableIterator { | 0 |
package org.apache.accumulo.server.test.randomwalk;
import org.apache.log4j.Logger;
public abstract class Fixture {
protected final Logger log = Logger.getLogger(this.getClass());
public abstract void setUp(State state) throws Exception;
public abstract void tearDown(State state) throws Exception;
} | 1 |
NoFlushOutputStream nfos = new NoFlushOutputStream(logFile);
params.setPlaintextOutputStream(nfos);
if (encipheringOutputStream == nfos) {
log.debug("No enciphering, using raw output stream");
encryptingLogFile = nfos;
log.debug("Enciphering found, wrapping in DataOutputStream"); | 0 |
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.xml.XMLConsumer;
* @version CVS $Id: JXTemplateGenerator.java,v 1.52 2004/07/06 10:34:36 unico Exp $
final Serializable templateKey = (Serializable) getValue(cacheKeyExpr, globalJexlContext, jxpathContext);
if (templateKey != null) {
return new JXCacheKey(this.inputSource.getURI(), templateKey);
}
return null;
static final class JXCacheKey implements Serializable {
private final String templateUri;
private final Serializable templateKey;
private JXCacheKey(String templateUri, Serializable templateKey) {
this.templateUri = templateUri;
this.templateKey = templateKey;
}
public int hashCode() {
return templateUri.hashCode() + templateKey.hashCode();
}
public String toString() {
return "TK:" + templateUri + "_" + templateKey;
}
public boolean equals(Object o) {
if (o instanceof JXCacheKey) {
JXCacheKey jxck = (JXCacheKey)o;
return this.templateUri.equals(jxck.templateUri)
&& this.templateKey.equals(jxck.templateKey);
}
return false;
}
} | 0 |
* @version CVS $Id: DelayRefresher.java,v 1.6 2004/04/25 20:01:36 haul Exp $
// TODO when an error occurs during write, we wouldn't try again although the
// list is still dirty. In addition, the access through the Iterator is not
// synchronized -- Collections.synchronizedMap() doesn't suffice here. Thus,
// modifications to the collection of sources while writing them to a file
// ay result in undeterministic behaviour (quoting the javadocs) | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Splitter; | 0 |
@Parameter(names={ "-s", "--setlevel" }, description="set the bundle's start level",
@Parameter(names={ "-i", "--setinitial" }, description="set the initial bundle start level",
options.put(p.names()[0], p);
flags.put(p.names()[0], p);
// Print all aliases.
String[] names = entry.getValue().names();
System.out.print(" " + names[0]);
for (int aliasIdx = 1; aliasIdx < names.length; aliasIdx++)
{
System.out.print(", " + names[aliasIdx]);
}
System.out.println(" " + entry.getValue().description());
// Print all aliases.
String[] names = entry.getValue().names();
System.out.print(" " + names[0]);
for (int aliasIdx = 1; aliasIdx < names.length; aliasIdx++)
{
System.out.print(", " + names[aliasIdx]);
}
System.out.println(" "
@Parameter(names={ "-l", "--location" }, description="show location",
@Parameter(names={ "-s", "--symbolicname" }, description="show symbolic name",
@Parameter(names={ "-u", "--updatelocation" }, description="show update location",
@Parameter(names={ "-l", "--location" }, description="show location",
@Parameter(names={ "-s", "--symbolicname" }, description="show symbolic name",
@Parameter(names={ "-u", "--updatelocation" }, description="show update location",
@Parameter(names={ "-t", "--transient" }, description="start bundle transiently",
@Parameter(names={ "-p", "--policy" }, description="use declared activation policy",
@Parameter(names={ "-t", "--transient" }, description="stop bundle transiently", | 0 |
* Copyright 2016-2017 Seznam.cz, a.s. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.