Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
value.mutations = Arrays.asList(new ServerMutation(new Text("badrow")));
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
Long.MAX_VALUE, new HashSet<>());
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
value.mutations = Arrays.asList(new ServerMutation(new Text("badrow")));
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
Long.MAX_VALUE, new HashSet<>());
Long.MAX_VALUE, new HashSet<>());
Long.MAX_VALUE, new HashSet<>());
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
value.mutations = Arrays.asList(new ServerMutation(new Text("row")));
WalEdits edits = new WalEdits(Collections.emptyList());
WalEdits edits = new WalEdits(Collections.emptyList()); | 0 |
* @param root Root object returned by <code>digester.parse()</code> | 0 |
* See also {@link javax.xml.stream.XMLStreamWriter#writeStartElement(String, String, String)}
* See also {@link javax.xml.stream.XMLStreamWriter#writeEndElement()}
* @return the local name of the current element. | 0 |
* Copyright 1999-2005 The Apache Software Foundation.
* The <code>Constants</code> used throughout the core of the Cocoon engine. | 0 |
import org.apache.sshd.common.NamedResource;
* @param name The factory name - ignored if {@code null}/empty
public static BuiltinDigests fromFactoryName(String name) {
return NamedResource.Utils.findByName(name, String.CASE_INSENSITIVE_ORDER, VALUES); | 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.
*/
/**
* SINH(X)
*
* <p>Computes the hyperbolic sine of X. Generates an error if an overflow occurs.
*/ | 0 |
import org.apache.http.ReasonPhraseCatalog;
import org.apache.http.annotation.Immutable;
import org.apache.http.util.Args;
this.reasonCatalog = Args.notNull(catalog, "Reason phrase catalog");
Args.notNull(ver, "HTTP version");
Locale loc = determineLocale(context);
String reason = reasonCatalog.getReason(status, loc);
Args.notNull(statusline, "Status line"); | 0 |
* Handle assignment ( left = right ). | 0 |
final Map<String, Object> ret = new HashMap<>();
ret.put(QUERY, new HashMap<>(TestingFramework.DEFAULT_REQUEST_QUERY));
ret.put(HEADERS, new HashMap<>(TestingFramework.DEFAULT_REQUEST_HEADERS));
final Map<String, Object> responseExpectations = new HashMap<>();
responseExpectations.put(HEADERS, new HashMap<>(TestingFramework.DEFAULT_RESPONSE_HEADERS)); | 0 |
import org.apache.atlas.type.AtlasEntityType;
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(ENTITY_TYPE);
// Replace list of entities with new values
// add a new element to list of entities
e0Array = entityStore.getByUniqueAttributes(entityType, new HashMap<String, Object>() {{ put(NAME, "entityArray00"); put("isReplicated", true); }}).getEntity();
e1Array = entityStore.getByUniqueAttributes(entityType, new HashMap<String, Object>() {{ put(NAME, "entityArray11"); put("isReplicated", false); }}).getEntity();
e2Array = entityStore.getByUniqueAttributes(entityType, new HashMap<String, Object>() {{ put(NAME, "entityArray22"); put("isReplicated", true); }}).getEntity();
entityList = new ArrayList<>(Arrays.asList(getAtlasObjectId(e0Array), getAtlasObjectId(e1Array), getAtlasObjectId(e2Array), getAtlasObjectId(e3Array)));
complexEntitiesInfo.getReferredEntities().clear();
e3Array = entityStore.getByUniqueAttributes(entityType, new HashMap<String, Object>() {{ put(NAME, "entityArray33"); put("isReplicated", true); }}).getEntity();
entityList = new ArrayList<>(Arrays.asList(getAtlasObjectId(e1Array), getAtlasObjectId(e2Array), getAtlasObjectId(e3Array)));
complexEntitiesInfo.getReferredEntities().clear();
complexEntitiesInfo.getReferredEntities().clear();
complexEntitiesInfo.getReferredEntities().clear(); | 0 |
package org.apache.felix.sigil.ui.eclipse.refactor;
import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel;
import org.apache.felix.sigil.model.osgi.IPackageImport;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
public class ImportPackageChange extends Change
{
private final ISigilProjectModel sigil;
private final IPackageImport oldImport;
private final IPackageImport newImport;
public ImportPackageChange(ISigilProjectModel sigil, IPackageImport oldImport, IPackageImport newImport)
{
this.sigil = sigil;
this.oldImport = oldImport;
this.newImport = newImport;
}
@Override
public Object getModifiedElement()
{
// TODO Auto-generated method stub
return null;
}
@Override
public String getName()
{
return "Import package update";
}
@Override
public void initializeValidationData(IProgressMonitor arg0)
{
// TODO Auto-generated method stub
}
@Override
public RefactoringStatus isValid(IProgressMonitor progress) throws CoreException,
OperationCanceledException
{
// TODO check project is synchronized
return new RefactoringStatus();
}
@Override
public Change perform(IProgressMonitor progress) throws CoreException
{
sigil.getBundle().getBundleInfo().removeImport(oldImport);
sigil.getBundle().getBundleInfo().addImport(newImport);
sigil.save(progress);
return new ImportPackageChange(sigil, newImport, oldImport);
}
} | 0 |
<T> Schema schemaFor(TypeDescriptor<T> typeDescriptor);
<T> SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor);
<T> SerializableFunction<Row, T> fromRowFunction(TypeDescriptor<T> typeDescriptor); | 0 |
*
* If there is no way to estimate the size of the source
* implementations MAY return 0L | 0 |
import org.apache.atlas.ApplicationProperties;
import org.apache.atlas.web.security.BaseSecurityTest;
import org.eclipse.jetty.webapp.WebAppContext;
configuration.setProperty("atlas.services.enabled", false);
String persistDir = BaseSecurityTest.writeConfiguration(configuration);
String originalConf = System.getProperty("atlas.conf");
System.setProperty("atlas.conf", persistDir);
ApplicationProperties.forceReload();
@Override
protected WebAppContext getWebAppContext(String path) {
WebAppContext application = new WebAppContext(path, "/");
application.setDescriptor(
System.getProperty("projectBaseDir") + "/webapp/src/test/webapp/WEB-INF/web.xml");
application.setClassLoader(Thread.currentThread().getContextClassLoader());
return application;
}
if (originalConf == null) {
System.clearProperty("atlas.conf");
} else {
System.setProperty("atlas.conf", originalConf);
} | 0 |
public final class HttpSessionIdListenerTracker extends WhiteboardServiceTracker<HttpSessionIdListener>
super(manager, context, createListenerFilterExpression(HttpSessionIdListener.class)); | 0 |
// ACCUMULO-542: A large root tablet will fail to load if it does't fit in the tserver scan
// buffers
c.tableOperations().addSplits(MetadataTable.NAME,
FunctionalTestUtils.splits("0 1 2 3 4 5 6 7 8 9 a".split(" ")));
assertTrue(
Iterators.size(c.createScanner(RootTable.NAME, Authorizations.EMPTY).iterator()) > 0); | 0 |
import org.apache.cocoon.util.NetUtils;
+ NetUtils.encode(triggerName.toLowerCase(), "utf-8")
+ NetUtils.encode(tableName.toLowerCase(), "utf-8")).openConnection(); | 0 |
public class HalfDeadTServerIT extends ConfigurableMacIT {
Process ingest = cluster.exec(TestIngest.class, "-u", "root", "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "-p", ROOT_PASSWORD, "--rows", rows + ""); | 0 |
expect(resourceProviderFactory.getMemberResourceProvider(EasyMock.anyObject(), EasyMock.anyObject(), eq(managementController)))
expect(resourceProviderFactory.getMemberResourceProvider(EasyMock.anyObject(), EasyMock.anyObject(), eq(managementController)))
.andReturn(Collections.emptySet())
expect(resourceProviderFactory.getMemberResourceProvider(EasyMock.anyObject(), EasyMock.anyObject(), eq(managementController)))
expect(resourceProviderFactory.getMemberResourceProvider(EasyMock.anyObject(), EasyMock.anyObject(), eq(managementController))) | 0 |
@SuppressWarnings("serial") | 0 |
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class GCMonitorService {
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
* @version $Id: Soundex.java,v 1.26 2004/07/07 23:15:24 ggregory Exp $
* @deprecated This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
* @deprecated This feature is not needed since the encoding size must be constant. Will be removed in 2.0.
* @deprecated This feature is not needed since the encoding size must be constant. Will be removed in 2.0. | 0 |
private final double bytes; | 0 |
new BigtableSource(getBigtableConfig(), getRowFilter(), getKeyRanges(), null); | 0 |
import org.apache.ambari.logsearch.solr.SolrConstants;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.client.solrj.SolrQuery;
addInFiltersIfNotNullAndEnabled(
query, request.getUserList(),
SolrConstants.AuditLogConstants.AUDIT_REQUEST_USER,
StringUtils.isNotBlank(request.getUserList())); | 0 |
import static com.google.common.base.Preconditions.checkArgument;
checkArgument(config != null, "config is null");
checkArgument(zooCache != null, "zooCache is null");
checkArgument(instanceId != null, "instanceId is null"); | 0 |
import org.apache.felix.utils.resource.RequirementImpl; | 0 |
JSONObject json = new JSONObject();
catch ( Exception e )
{
logger.log( "Failed to parse filter '" + filter + "'", e );
try
{
String reason = "filter=" + filter;
if ( e.getMessage() != null )
{
reason = e.getMessage() + "(" + reason + ")";
}
json.put( "error", reason );
}
catch ( JSONException je )
{
// ignore
}
}
return json.toString(); | 0 |
// TODO If we have a lot of tservers, this might start to take a fair amount of time
// Consider adding a threadpool to parallelize the requests.
// Alternatively, we might have to move to a solution that doesn't involve tserver RPC
// Could do this through InstanceOperations, but that would set a bunch of new Watchers via ZK on every tserver
// node. The master is already tracking all of this info, so hopefully this is less overall work. | 0 |
public synchronized OffsetRange currentRestriction() {
public synchronized OffsetRange checkpoint() {
protected synchronized boolean tryClaimImpl(Long i) {
public synchronized void checkDone() throws IllegalStateException {
public synchronized Backlog getBacklog() { | 0 |
* <p>This class is immutable and thread-safe.</p> | 0 |
private static final long serialVersionUID = 0;
| 0 |
* @version CVS $Id: JPEGSourceInspector.java,v 1.1 2003/10/22 18:53:06 gcasper Exp $ | 0 |
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
bind(HostRoleCommandDAO.class).toInstance(createNiceMock(HostRoleCommandDAO.class)); | 0 |
* 0: A E I O U Y H W | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/FastHashMap.java,v 1.4 2001/05/20 21:03:30 craigmcc Exp $
* $Revision: 1.4 $
* $Date: 2001/05/20 21:03:30 $
* @version $Revision: 1.4 $ $Date: 2001/05/20 21:03:30 $
java.util.Iterator i = map.entrySet().iterator();
java.util.Iterator i = map.entrySet().iterator();
java.util.Iterator i = map.entrySet().iterator();
java.util.Iterator i = map.entrySet().iterator(); | 0 |
final ConfigurationDeclaration decl, final Collection<BuilderParameters> params)
protected void initializeParameterObjects(final ConfigurationDeclaration decl,
final Collection<BuilderParameters> params) throws Exception
final BasicBuilderParameters basicParams =
private static void setUpBasicParameters(final CombinedConfiguration config,
final BasicBuilderParameters params) | 0 |
import java.util.BitSet;
* @version $Id: JexlTest.java,v 1.38 2004/08/15 16:01:12 dion Exp $
// 30652 - support for set
// support generic int size() method
BitSet bitset = new BitSet(5);
jc.getVars().put("bitset", bitset);
assertExpression(jc, "size(bitset)", new Integer(64));
assertExpression(jc, "bitset.size()", new Integer(64)); | 0 |
import java.net.InetAddress;
String hostname = InetAddress.getLocalHost().getHostName().replaceAll("[-.]", "_");
String pid = state.getPid();
tableName = String.format("bulk_%s_%s_%d", hostname, pid, System.currentTimeMillis()); | 0 |
if ( ComponentRegistry.isBundleActive( bundle ) ) | 0 |
import org.apache.sshd.common.util.closeable.AbstractCloseable;
public class ServerUserAuthService extends AbstractCloseable implements Service { | 0 |
return super.getLinkURI(event); | 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.felix.ipojo.runtime.core.test.services;
/**
* A listener to reproduce the listener leak (FELIX-4247 Memory leak with ServiceUsage and inner class (Listener
* style))
*/
public interface Listener {
String doSomething();
} | 0 |
* <code>QueryLoader</code> is a registry for sets of queries so
* that multiple copies of the same queries aren't loaded into memory.
* This implementation loads properties files filled with query name to
* SQL mappings. This class is thread safe.
* Loads a set of named queries into a Map object. This implementation
* reads a properties file at the given path.
* @throws IllegalArgumentException if the ClassLoader can't find a file at
* the given path.
* @since DbUtils 1.1
protected Map loadQueries(String path) throws IOException { | 0 |
public static final String DOUBLE_CODER_URN = getUrn(StandardCoders.Enum.DOUBLE);
WINDOWED_VALUE_CODER_URN,
DOUBLE_CODER_URN); | 0 |
* @param configMap configMap for BundleArchive
location = decode(location);
//method from Harmony java.net.URIEncoderDecoder (luni subproject) used by URI to decode uri components.
static final String encoding = "UTF8"; //$NON-NLS-1$
private static String decode(String s) throws UnsupportedEncodingException
{
StringBuffer result = new StringBuffer();
ByteArrayOutputStream out = new ByteArrayOutputStream();
for (int i = 0; i < s.length();)
{
char c = s.charAt(i);
if (c == '%')
{
out.reset();
do
{
if (i + 2 >= s.length())
{
throw new IllegalArgumentException("Incomplete % sequence at: " + i);
}
int d1 = Character.digit(s.charAt(i + 1), 16);
int d2 = Character.digit(s.charAt(i + 2), 16);
if (d1 == -1 || d2 == -1)
{
throw new IllegalArgumentException("Invalid % sequence (" + s.substring(i, i + 3) + ") at: " + String.valueOf(i));
}
out.write((byte) ((d1 << 4) + d2));
i += 3;
} while (i < s.length() && s.charAt(i) == '%');
result.append(out.toString(encoding));
continue;
}
result.append(c);
i++;
}
return result.toString();
}
| 0 |
doFnRunner.processElement(
WindowedValue.valueInGlobalWindow(
KeyedWorkItems.timersWorkItem(
(String) keyedStateInternals.getKey(),
Collections.singletonList(timer.getNamespace())))); | 0 |
public SVGAnimatedEnumeration getPatternContentUnits( ); | 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 |
/**
* Basic, yet fully functional and spec compliant, HTTP/1.1 file server based on the non-blocking
* I/O model.
* <p>
* Please note the purpose of this application is demonstrate the usage of HttpCore APIs.
* It is NOT intended to demonstrate the most efficient way of building an HTTP file server.
*
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*/ | 0 |
void clear();
int getSize(); | 0 |
return ((ModuleDefinition) getCurrentModule().getDefinition()).getHeaders(); | 0 |
* <p>Checks if the value's adjusted length is greater than or equal to the min.</p>
* @param lineEndLength The length to use for line endings. | 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
| 0 |
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
public static BatchWriter getBatchWriter(Connector conn) throws TableNotFoundException {
return getBatchWriter(conn, new BatchWriterConfig());
}
public static BatchWriter getBatchWriter(Connector conn, BatchWriterConfig config) throws TableNotFoundException {
return conn.createBatchWriter(NAME, config);
} | 0 |
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length()));
System.out.println(Util.getUnderlineString(title.length())); | 0 |
import org.apache.beam.sdk.coders.StringUtf8Coder;
// we know that it is keyed on String
keyCoder = StringUtf8Coder.of(); | 0 |
String.class, 32, "NONE", false));
String.class, null, null, true));
long clusterID = cluster.getClusterId();
final AlertDefinitionEntity journalNodeProcessAlertDefinitionEntity = alertDefinitionDAO.findByName(
clusterID, "journalnode_process");
final AlertDefinitionEntity hostDiskUsageAlertDefinitionEntity = alertDefinitionDAO.findByName(
clusterID, "ambari_agent_disk_usage");
if (journalNodeProcessAlertDefinitionEntity != null) {
String source = journalNodeProcessAlertDefinitionEntity.getSource();
journalNodeProcessAlertDefinitionEntity.setSource(modifyJournalnodeProcessAlertSource(source));
journalNodeProcessAlertDefinitionEntity.setSourceType(SourceType.WEB);
journalNodeProcessAlertDefinitionEntity.setHash(UUID.randomUUID().toString());
alertDefinitionDAO.merge(journalNodeProcessAlertDefinitionEntity);
if (hostDiskUsageAlertDefinitionEntity != null) {
hostDiskUsageAlertDefinitionEntity.setDescription("This host-level alert is triggered if the amount of disk space " +
"used goes above specific thresholds. The default threshold values are 50% for WARNING and 80% for CRITICAL.");
hostDiskUsageAlertDefinitionEntity.setLabel("Host Disk Usage");
alertDefinitionDAO.merge(hostDiskUsageAlertDefinitionEntity);
LOG.info("ambari_agent_disk_usage alert definition was updated.");
}
| 0 |
import org.apache.http.params.HttpProtocolParams;
int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
Charset charset = CharsetUtils.lookup(HttpProtocolParams.getHttpElementCharset(params));
CodingErrorAction malformedCharAction = HttpProtocolParams.getMalformedInputAction(params);
CodingErrorAction unmappableCharAction = HttpProtocolParams.getUnmappableInputAction(params); | 0 |
public interface ListeningIOReactor extends IOReactorService, ConnectionAcceptor { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v 1.7 2004/01/02 02:13:07 scolebourne Exp $
* @version $Revision: 1.7 $ $Date: 2004/01/02 02:13:07 $
private Node[] buckets;
private Lock[] locks;
buckets = new Node[size];
locks = new Lock[size];
locks[i] = new Lock();
hash %= buckets.length;
for (int i = 0; i < buckets.length; i++) {
cnt += locks[i].size;
synchronized (locks[hash]) {
Node n = buckets[hash];
synchronized (locks[hash]) {
Node n = buckets[hash];
for (int i = 0; i < buckets.length; i++) {
synchronized (locks[i]) {
Node n = buckets[i];
synchronized (locks[hash]) {
Node n = buckets[hash];
buckets[hash] = n;
locks[hash].size++;
locks[hash].size++;
synchronized (locks[hash]) {
Node n = buckets[hash];
buckets[hash] = n.next;
locks[hash].size--;
for (int i = 0; i < buckets.length; i++) {
Lock lock = locks[i];
buckets[i] = null;
for (int i = 0; i < buckets.length; i++) {
synchronized (locks[i]) {
Node n = buckets[i];
while (bucket < buckets.length) {
synchronized (locks[bucket]) {
Node n = buckets[bucket];
synchronized (locks[hash]) {
for (Node n = buckets[hash]; n != null; n = n.next) {
synchronized (locks[hash]) {
for (Node n = buckets[hash]; n != null; n = n.next) {
synchronized (locks[hash]) {
for (Node n = buckets[hash]; n != null; n = n.next) {
if (bucket >= buckets.length) {
synchronized (locks[bucket]) { | 0 |
/** Constant for a namespace prefix. */
private static final String NAMESPACE = "commons";
/** Constant for an attribute with a namespace prefix. */
private static final String NS_ATTR = NAMESPACE + ":attr";
ImmutableNode testNode =
orgNode.setAttribute(TEST_ATTR, "yes").setAttribute(NS_ATTR,
"configuration");
assertEquals("Wrong number of attributes", 3, iteratorSize(it));
assertTrue("Namespace attribute not found", attrNames.contains(NS_ATTR));
* Tests iteration if an unknown namespace is specified.
public void testIterateNamespaceUnknown()
/**
* Tests whether a specific attribute with a namespace can be selected.
*/
@Test
public void testIterateNamespaceAttribute()
{
ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
new QName(NAMESPACE, "attr"));
assertEquals("Wrong number of attributes", 1, iteratorSize(it));
assertEquals("Wrong attribute", NS_ATTR, iterationElements(it).get(0)
.getName().getName());
}
/**
* Tests whether a wildcard can be used together with a namespace.
*/
@Test
public void testIterateNamespaceWildcard()
{
ConfigurationNodeIteratorAttribute<ImmutableNode> it =
new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
new QName(NAMESPACE, "*"));
assertEquals("Wrong number of attributes", 1, iteratorSize(it));
assertEquals("Wrong attribute", NS_ATTR, iterationElements(it).get(0)
.getName().getName());
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/TagLibrary.java,v 1.18 2003/01/17 06:59:03 jstrachan Exp $
* $Revision: 1.18 $
* $Date: 2003/01/17 06:59:03 $
* $Id: TagLibrary.java,v 1.18 2003/01/17 06:59:03 jstrachan Exp $
* @version $Revision: 1.18 $
return (Tag) type.newInstance(); | 0 |
public interface MetricCell<UserT extends Metric, DataT> { | 0 |
private final static String PROP_ROLLBACK_ON_RETURN = "rollbackOnReturn";
private final static String PROP_ENABLE_AUTOCOMMIT_ON_RETURN = "enableAutoCommitOnReturn";
PROP_MAXCONNLIFETIMEMILLIS,
PROP_ROLLBACK_ON_RETURN,
PROP_ENABLE_AUTOCOMMIT_ON_RETURN
value = properties.getProperty(PROP_ENABLE_AUTOCOMMIT_ON_RETURN);
if (value != null) {
dataSource.setEnableAutoCommitOnReturn(Boolean.valueOf(value).booleanValue());
}
value = properties.getProperty(PROP_ROLLBACK_ON_RETURN);
if (value != null) {
dataSource.setRollbackOnReturn(Boolean.valueOf(value).booleanValue());
}
| 0 |
return storage.readOp(new Work.Quiet<GetJobUpdatesResponse>() { | 0 |
StateSampler stateSampler,
StateSampler.StateKind stateKind) {
super(operationName, receivers,
counterPrefix, addCounterMutator, stateSampler, stateKind);
}
public ReceivingOperation(String operationName,
OutputReceiver[] receivers,
String counterPrefix,
CounterSet.AddCounterMutator addCounterMutator,
counterPrefix, addCounterMutator, stateSampler); | 0 |
import com.google.common.base.Charsets;
static class StartsWith implements Predicate<String> {
String line = new String(encodedElem, Charsets.UTF_8);
try (BufferedReader reader = Files.newBufferedReader(f.toPath(), Charsets.UTF_8)) { | 0 |
import aQute.bnd.osgi.Analyzer; | 0 |
FutureTask<TabletLocations> tlsFuture = new FutureTask<>(() -> {
TabletLocations answer = new TabletLocations();
answer.scan(ctx, tableName);
return answer; | 0 |
LOG.debug("Found {} service repos: {}", serviceRepoIds.size(),Iterables.toString(serviceRepoIds)); | 0 |
try (
final InputStream instr = file.getContent().getInputStream();
final BufferedReader reader = new BufferedReader(new InputStreamReader(instr)); )
{ | 0 |
/**
* @since 2.5.0
*/
/**
* @since 2.5.0
*/
/**
* @since 2.5.0
*/ | 0 |
import org.apache.commons.bcel6.Const;
c = (ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8);
c = (ConstantUtf8) constant_pool.getConstant(signature_index, Const.CONSTANT_Utf8); | 0 |
import org.apache.sshd.common.future.CloseFuture;
import org.apache.sshd.common.future.SshFutureListener;
import org.apache.sshd.common.future.SshFuture;
public CloseFuture close(boolean immediately) {
return super.close(immediately).addListener(new SshFutureListener() {
public void operationComplete(SshFuture sshFuture) {
if (shell != null) {
shell.destroy();
shell = null;
}
IoUtils.closeQuietly(in, out, err, shellIn, shellOut, shellErr);
executor.shutdown();
}
});
close(false);
session.close(false);
close(false); | 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 |
import org.apache.cocoon.configuration.MutableSettings;
import org.apache.cocoon.configuration.PropertyHelper; | 0 |
TServerInstance someTServer =
new TServerInstance(HostAndPort.fromParts("127.0.0.1", 1234), 0x123456);
MockCurrentState state =
new MockCurrentState(new MergeInfo(new KeyExtent(tableId, new Text("p"), new Text("e")),
MergeInfo.Operation.MERGE)); | 0 |
* @version CVS $Id: MountNode.java,v 1.3 2003/05/04 20:24:47 cziegeler Exp $ | 0 |
@Override
@Override | 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 |
/**
* Close the cnxn and remove it from the factory cnxns list.
*/
public void close(DisconnectReason reason) {
disconnectReason = reason;
close();
}
close(DisconnectReason.CLIENT_CLOSED_CONNECTION);
close(DisconnectReason.IO_EXCEPTION);
close(DisconnectReason.CLIENT_RATE_LIMIT); | 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.cocoon.forms.samples;
import org.apache.commons.lang.enums.Enum;
/**
* Test apache enum class.
*
* @version $Id$
*/
public class PreferredContact extends Enum {
public static final PreferredContact EMAIL = new PreferredContact("EMAIL");
public static final PreferredContact FAX = new PreferredContact("FAX");
public static final PreferredContact PHONE = new PreferredContact("PHONE");
public static final PreferredContact PAGER = new PreferredContact("PAGER");
public static final PreferredContact POSTAL_MAIL = new PreferredContact("POSTAL_MAIL");
protected PreferredContact(String name) {
super(name);
}
public String toString() {
return PreferredContact.class.getName() + "." + getName();
}
} | 0 |
import java.io.UnsupportedEncodingException;
public static final String ENCODING = "encoding";
public static final String ENCODING_DEFAULT = "UTF-8";
private String encoding = ENCODING_DEFAULT;
private Matcher copyMatcher(Matcher m) {
if (m == null)
return m;
else
return m.pattern().matcher("");
try {
matcher.reset(new String(bs.getBackingArray(), bs.offset(), bs.length(), encoding));
return matcher.matches();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
matcher.reset(new String(data, offset, len, encoding));
return matcher.matches();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if (options.containsKey(ENCODING)) {
encoding = options.get(ENCODING);
}
io.addNamedOption(RegExFilter.ENCODING, "character encoding of byte array value (default is " + ENCODING_DEFAULT + ")");
if (options.containsKey(ENCODING)) {
try {
this.encoding = options.get(ENCODING);
@SuppressWarnings("unused")
String test = new String("test".getBytes(), encoding);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return false;
}
}
/**
* Set the encoding string to use when interpreting characters
*
* @param si
* ScanIterator config to be updated
* @param encoding
* the encoding string to use for character interpretation.
*
*/
public static void setEncoding(IteratorSetting si, String encoding) {
if (!encoding.isEmpty()) {
si.addOption(RegExFilter.ENCODING, encoding);
}
} | 0 |
try (BatchWriter bw = c.createBatchWriter(tableName)) {
for (int i = 0; i < 50000; i++) {
Mutation m = new Mutation(randomHex(8));
m.put("", "", "");
bw.addMutation(m);
} | 0 |
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CoderResult; | 0 |
* "License"); you may not use this file except in compliance
* distributed under the License is distributed on an "AS IS" BASIS, | 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 |
/**
* Create the node given an id.
*
* @param id node id.
*/
/**
* Create a node with the given parser and id.
*
* @param p a parser.
* @param id node id.
*/
/** {@inheritDoc} */
/** {@inheritDoc} */ | 0 |
private String note;
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
} | 0 |
Optional<Protos.Credential> credentials) { | 0 |
import org.apache.ambari.server.events.JpaInitializedEvent;
import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
public GuiceJpaInitializer(PersistService service, AmbariEventPublisher publisher) {
publisher.publish(new JpaInitializedEvent()); | 0 |
* @version $Revision: 1.14 $ $Date: 2004/04/01 22:18:12 $
* Compares two keys, in internal converted form, to see if they are equal.
* This implementation uses the equals method and assumes neither key is null.
* @param key1 the first key to compare passed in from outside
* @param key2 the second key extracted from the entry via <code>entry.key</code>
* Compares two values, in external form, to see if they are equal.
* This implementation uses the equals method and assumes neither key is null.
* @param value1 the first value to compare passed in from outside
* @param value2 the second value extracted from the entry via <code>getValue()</code>
Map.Entry e = (Map.Entry) entry;
Entry match = parent.getEntry(e.getKey());
return (match != null && match.equals(e));
if (contains(obj) == false) {
return false;
}
return true; | 0 |
import org.apache.beam.model.pipeline.v1.RunnerApi.Environment;
sdkComponents.registerEnvironment(Environment.newBuilder().setUrl("java").build()); | 0 |
package aQute.lib.spring;
import java.util.ArrayList;
import java.util.List;
import aQute.lib.osgi.Analyzer;
/**
* This component is called when we find a resource in the META-INF/*.xml
* pattern. We parse the resource and and the imports to the builder.
*
* Parsing is done with XSLT (first time I see the use of having XML for the
* Spring configuration files!).
*
* @author aqute
*
*/
public class JPAComponent extends XMLTypeProcessor {
protected List<XMLType> getTypes(Analyzer analyzer) throws Exception {
List<XMLType> types = new ArrayList<XMLType>();
process(types,"jpa.xsl", "META-INF", "persistence.xml");
return types;
}
} | 0 |
import org.apache.felix.dm.annotation.api.ServiceDependency; | 0 |
/** Matches a glob containing a wildcard, capturing the portion before the first wildcard. */
private S3ResourceId(String bucket, String key, @Nullable Long size) {
checkArgument(
!other.endsWith("/"), "Cannot resolve a file with a directory path: [%s]", other); | 1 |
* "License"); you may not use this file except in compliance
* distributed under the License is distributed on an "AS IS" BASIS, | 0 |
@Override
protected int defaultTimeoutSeconds() {
return 60;
}
@Test | 0 |
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DIGEST [complete=").append(complete)
.append(", nonce=").append(lastNonce)
.append(", nc=").append(nounceCount)
.append("]");
return builder.toString();
}
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.