Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import java.net.URL; import org.apache.commons.jci.stores.ResourceStore; if (!src.exists()) { throw new ConfigurationException(src.getURI() + " doesn't exist"); } configureStore(configBean,src.getURI(),child.getChild("store",false)); /** * If a store node is configured in the class-dir/src-dir configuration, * let's configure the store; the default one is the JCI MemoryStore */ private static void configureStore(ClassLoaderConfiguration configBean, String dirUri, Configuration storeConfig) throws Exception { if (storeConfig != null) { final String storeClassName = storeConfig.getAttribute("class","org.apache.commons.jci.stores.MemoryResourceStore"); final ResourceStore store = (ResourceStore)Class.forName(storeClassName).newInstance(); final URL url = new URL(dirUri); configBean.addStore(url.getFile(),store); } }
0
@Inject DaoUtils daoUtils; final TypedQuery<HostComponentStateEntity> query = entityManagerProvider.get().createNamedQuery("HostComponentStateEntity.findAll", HostComponentStateEntity.class); /** * Retrieve all of the Host Component States for the given host. * * @param hostName HOst name * @return Return all of the Host Component States that match the criteria. */ @RequiresSession public List<HostComponentStateEntity> findByHost(String hostName) { final TypedQuery<HostComponentStateEntity> query = entityManagerProvider.get().createNamedQuery("HostComponentStateEntity.findByHost", HostComponentStateEntity.class); query.setParameter("hostName", hostName); return daoUtils.selectList(query); }
0
import org.apache.beam.sdk.io.Source; new BoundedReadEvaluatorFactory.InputProvider(context).getInitialInputs(transform, 1); TransformEvaluator<?> evaluator = factory.forApplication(transform, null); private final int firstSplitIndex; public TestSource(Coder<T> coder, int firstSplitIndex, T... elems) { this.firstSplitIndex = firstSplitIndex; return new TestReader<>(this, firstSplitIndex, subrangesCompleted); private final Source<T> initialSource; this.initialSource = source; // Sleep before the sleep/split index is claimed so long as it will be claimed if (index + 1 == sleepIndex && sleepIndex < getCurrentSource().elems.length) { while (initialSource.equals(getCurrentSource())) { // Spin until the current source is updated }
0
* @version $Revision$
0
import java.sql.Connection; import java.sql.DriverManager; private static final String[] rcaTableNames = {"workflow", "job", "task", "taskAttempt", "hdfsEvent", "mapreduceEvent", "clusterEvent"}; public void cleanUpRCATables() { LOG.info("Cleaning up RCA tables."); for (String tableName : rcaTableNames) { try { if (dbAccessor.tableExists(tableName)) { dbAccessor.truncateTable(tableName); } } catch (Exception e) { LOG.warn("Error cleaning rca table " + tableName, e); } } try { cleanUpTablesFromRCADatabase(); } catch (Exception e) { LOG.warn("Error cleaning rca tables from ambarirca db", e); } } private void cleanUpTablesFromRCADatabase() throws ClassNotFoundException, SQLException { String driverName = configuration.getRcaDatabaseDriver(); String connectionURL = configuration.getRcaDatabaseUrl(); if (connectionURL.contains(Configuration.HOSTNAME_MACRO)) { connectionURL = connectionURL.replace(Configuration.HOSTNAME_MACRO, "localhost"); } String username = configuration.getRcaDatabaseUser(); String password = configuration.getRcaDatabasePassword(); Class.forName(driverName); try (Connection connection = DriverManager.getConnection(connectionURL, username, password)) { connection.setAutoCommit(true); for (String tableName : rcaTableNames) { String query = "DELETE FROM " + tableName; try (Statement statement = connection.createStatement()) { statement.execute(query); } catch (Exception e) { LOG.warn("Error while executing query: " + query, e); } } } } schemaUpgradeHelper.cleanUpRCATables();
0
private static final ThreadLocal<DateFormat> DSL_DATE_FORMAT = ThreadLocal.withInitial(() -> { DateFormat ret = new SimpleDateFormat(ISO8601_FORMAT); ret.setTimeZone(TimeZone.getTimeZone("UTC")); return ret; }); if(!isNestedQuery) { addFrom(typeName); } if (!isNestedQuery) { addFrom(typeName); } public List<String> getErrorList() { combineErrorLists(); return errorList; } private void combineErrorLists() { errorList.addAll(context.getErrorList()); } int index = queryClauses.contains(clause); public boolean hasFromClause() { return queryClauses.contains(GremlinClause.HAS_TYPE) != -1 || queryClauses.contains(GremlinClause.HAS_TYPE_WITHIN) != -1; } public int contains(GremlinClause clause) { public List<String> getErrorList() { errorList.addAll(lookup.getErrorList()); return errorList; }
0
import org.apache.commons.jelly.JellyTagException; public void doTag(XMLOutput output) throws TimeoutException, RequirementException, JellyTagException { throw new JellyTagException("This tag requires that you set the thread or group attribute");
0
public static String reconfig(ZooKeeper zk, List<String> joiningServers,
0
List<ElementValuePairGen> elements = new ArrayList<>(); List<ElementValuePairGen> elements = new ArrayList<>(); List<AnnotationEntryGen> v = new ArrayList<>(); List<AnnotationEntryGen> v2 = new ArrayList<>();
0
components.registerEnvironment(Environments.createDockerEnvironment("java")); components.registerEnvironment(Environments.createDockerEnvironment("java"));
0
channel.getInvertedIn().write(buffer.array(), buffer.rpos(), buffer.available()); channel.getInvertedIn().flush();
0
HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry(); registry.register("*", new BufferingAsyncRequestHandler(new SimpleRequestHandler())); registry,
0
HttpClientConnection conn = new DefaultHttpClientConnection(host); conn.open(connparams);
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
0
import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import com.google.inject.Inject; import com.google.inject.Injector; // add viewparameter columns dbAccessor.addColumn("viewparameter", new DBColumnInfo("label", String.class, 255, null, true)); dbAccessor.addColumn("viewparameter", new DBColumnInfo("placeholder", String.class, 255, null, true)); dbAccessor.addColumn("viewparameter", new DBColumnInfo("default_value", String.class, 2000, null, true)); dbAccessor.createTable(ALERT_TARGET_STATES_TABLE, columns);
0
import org.junit.Before; @Before @Override
0
for (final byte b : alwaysEncodeCharsArray) { final int expectedEncodingBytes = expectedEncodingBytes(bytes); final boolean willEncode = expectedEncodingBytes != bytes.length; private byte[] doEncode(final byte[] bytes, final int expectedLength, final boolean willEncode) { final byte b = bytes[i];
0
import org.apache.hadoop.conf.Configuration; int res = ToolRunner.run(new Configuration(), new UniqueColumns(), args);
0
import javax.annotation.Nullable;
0
import org.apache.avalon.excalibur.i18n.ResourceManager; import org.apache.avalon.excalibur.i18n.Resources; private final FTPClient client; client = new FTPClient(); client.connect( hostname ); int reply = client.getReplyCode(); if ( !FTPReply.isPositiveCompletion( reply ) ) if ( !client.login( username, password ) ) if ( !client.setFileType( FTP.BINARY_FILE_TYPE ) ) catch ( final Exception exc ) if ( client.isConnected() ) client.disconnect(); catch ( final IOException e ) return client;
0
import org.osgi.framework.hooks.resolver.ResolverHookFactory; ResolverHookFactory.class,
0
if (group == null) { //expected if thread died, ignore it continue; } int activeCount = group.activeCount(); Thread[] groupThreads = new Thread[activeCount];
0
* @version CVS $Id$
0
EvaluationResult res = SparkPipelineRunner.create().run(p); res.close();
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
.apply("Read parquet files", ParquetIO.readFiles(SCHEMA))
0
/** * Tests whether all children can be replaced at once. */ @Test public void testReplaceChildren() { final int childCount = 8; Collection<ImmutableNode> newChildren = new ArrayList<ImmutableNode>(childCount); for (int i = 0; i < childCount; i++) { newChildren.add(createChild()); } ImmutableNode node = createDefaultNode(VALUE); ImmutableNode node2 = node.replaceChildren(newChildren); checkUpdatedNode(node, node2); checkChildNodes(node2, newChildren); } /** * Tests whether a node's children can be replaced by a null collection. */ @Test public void testReplaceChildrenNullCollection() { ImmutableNode node = createDefaultNode(VALUE); ImmutableNode node2 = node.replaceChildren(null); checkUpdatedNode(node, node2); checkChildNodes(node2); }
0
import org.apache.zookeeper.server.auth.ServerAuthenticationProvider; * @param zks : the ZooKeeper server * @param cnxn : the server connection * @param acl : set of ACLs for the node * @param perm : the permission that the client is requesting * @param ids : the credentials supplied by the client * @param path : the ZNode path * @param setAcls : for set ACL operations, the list of ACLs being set. Otherwise null. static void checkACL(ZooKeeperServer zks, ServerCnxn cnxn, List<ACL> acl, int perm, List<Id> ids, String path, List<ACL> setAcls) throws KeeperException.NoAuthException { ServerAuthenticationProvider ap = ProviderRegistry.getServerProvider(id && ap.matches(new ServerAuthenticationProvider.ServerObjs(zks, cnxn), new ServerAuthenticationProvider.MatchValues(path, authId.getId(), id.getId(), perm, setAcls))) { checkACL(zks, request.cnxn, parentRecord.acl, ZooDefs.Perms.DELETE, request.authInfo, path, null); checkACL(zks, request.cnxn, nodeRecord.acl, ZooDefs.Perms.WRITE, request.authInfo, path, null); checkACL(zks, request.cnxn, nodeRecord.acl, ZooDefs.Perms.WRITE, request.authInfo, null, null); checkACL(zks, request.cnxn, nodeRecord.acl, ZooDefs.Perms.ADMIN, request.authInfo, path, listACL); checkACL(zks, request.cnxn, nodeRecord.acl, ZooDefs.Perms.READ, request.authInfo, path, null); checkACL(zks, request.cnxn, parentRecord.acl, ZooDefs.Perms.CREATE, request.authInfo, path, listACL); ServerAuthenticationProvider ap = ProviderRegistry.getServerProvider(cid.getScheme()); ServerAuthenticationProvider ap = ProviderRegistry.getServerProvider(id.getScheme());
0
final ClientHttp2StreamMultiplexerFactory http2StreamHandlerFactory = new ClientHttp2StreamMultiplexerFactory( httpProcessor, exchangeHandlerFactory, h2Config, charCodingConfig, null); return new Http2OnlyClientProtocolNegotiator(ioSession, http2StreamHandlerFactory, false);
0
public static final String ATTRIBUTE_NAME = "property"; public static final String ATTRIBUTE_VALUE = "value"; /** * Updates property for the entity corresponding to guid * @param guid * @param property * @param value */ public JSONObject updateEntity(String guid, String property, String value) throws MetadataServiceException { WebResource resource = getResource(API.UPDATE_ENTITY, guid); resource = resource.queryParam(ATTRIBUTE_NAME, property); resource = resource.queryParam(ATTRIBUTE_VALUE, value); return callAPIWithResource(API.UPDATE_ENTITY, resource); }
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 $Revision: 1.5 $ $Date: 2004/02/28 13:18:36 $
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.http.base.internal.runtime.dto; import java.util.Comparator; import javax.servlet.ServletContext; import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo; public interface ServletContextHelperRuntime { static final Comparator<ServletContextHelperRuntime> COMPARATOR = new Comparator<ServletContextHelperRuntime>() { @Override public int compare(ServletContextHelperRuntime o1, ServletContextHelperRuntime o2) { return o1.getContextInfo().compareTo(o2.getContextInfo()); } }; ServletContext getSharedContext(); ServletContextHelperInfo getContextInfo(); }
0
EvaluationResult res = SparkPipelineRunner.create().run(p); res.close();
0
private AccumuloClient client; client = createMock(AccumuloClient.class); assigner = new SequentialWorkAssigner(conf, client); assigner.setClient(client); expect(client.getInstanceID()).andReturn("instance"); replay(workQueue, zooCache, client); verify(workQueue, zooCache, client);
0
// (KV<String, Set<String>> e, Collector<String> c) -> // e.getValue().stream().forEachOrdered(c::collect)) // .mapElements(KV::getValue)
0
import java.io.OutputStream;
0
package org.apache.beam.runners.dataflow; class DataflowUnboundedReadFromBoundedSource<T> extends PTransform<PBegin, PCollection<T>> {
0
import org.apache.atlas.AtlasConfiguration; private static final int INDEXED_STR_SAFE_LEN = AtlasConfiguration.GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH.getInt(); String value = ret.toString(); if (value.length() > INDEXED_STR_SAFE_LEN) { RequestContext requestContext = RequestContext.get(); final int trimmedLength; if (requestContext.getAttemptCount() <= 1) { // if this is the first attempt, try saving as it is; trim on retry trimmedLength = value.length(); } else if (requestContext.getAttemptCount() >= requestContext.getMaxAttempts()) { // if this is the last attempt, set to 'safe_len' trimmedLength = INDEXED_STR_SAFE_LEN; } else if (requestContext.getAttemptCount() == 2) { // based on experimentation, string length of 4 times 'safe_len' succeeds trimmedLength = Math.min(4 * INDEXED_STR_SAFE_LEN, value.length()); } else if (requestContext.getAttemptCount() == 3) { // if length of 4 times 'safe_len' failed, try twice 'safe_len' trimmedLength = Math.min(2 * INDEXED_STR_SAFE_LEN, value.length()); } else { // if twice the 'safe_len' failed, trim to 'safe_len' trimmedLength = INDEXED_STR_SAFE_LEN; } if (trimmedLength < value.length()) { LOG.warn("Indexed-String-Attribute: {} length is {} characters, trimming to {}", ctx.getAttribute().getQualifiedName(), value.length(), trimmedLength); String checksumSuffix = ":" + DigestUtils.shaHex(value); // Storing SHA checksum in case verification is needed after retrieval ret = value.substring(0, trimmedLength - checksumSuffix.length()) + checksumSuffix; }
0
* * * * /** Seeks methods named get{P,p}property and is{P,p}property. */ /** Seeks map methods get/put. */ /** Seeks list methods get/set. */ /** Seeks any get/{set,put} method (quacking like a list or a map). */ /** Seeks public instance members.*/ /** Seeks a getContainer(property) and setContainer(property, value) as in <code>x.container.property</code>. */ * * * <p>If the operator is '[]' or if the object is a map, use the MAP list of resolvers. * Otherwise, use the POJO list of resolvers.</p> * * * <p>This increments the version.</p> * * * * * * <p>returns a JelPropertySet apropos to an expression like <code>bar.woogie</code>.</p> * * * *
0
public String getPassword(String resourceKey, int retryIndex) throws IOException { assertEquals("Mismatched retries count", count, retryIndex + 1); String resourceKey, int retryIndex, String password, Exception err)
0
public final class FilesystemStore extends AbstractFilesystemStore { /** The default logger for this class. */ private Log logger = LogFactory.getLog(getClass()); private Settings settings; enableLogging(new CLLoggerWrapper(this.logger)); if (getLogger().isDebugEnabled()) { } if (getLogger().isDebugEnabled()) { } if (getLogger().isDebugEnabled()) { }
0
systemProperty("dm.runtime.log").value( "true" ),
0
if (raster != null) { }
0
return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.startTime, new ArrayList<String>( compactor.filesToCompact.keySet()), compactor.outputFile, type, reason, localityGroup, entriesRead, entriesWritten, iiList, iterOptions);
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
import org.apache.hc.core5.annotation.Contract; import org.apache.hc.core5.annotation.Internal; import org.apache.hc.core5.annotation.ThreadingBehavior; /** * Internal implementation of HTTP/2 only {@link CloseableHttpAsyncClient}. * <p> * Concurrent message exchanges with the same connection route executed by * this client will get automatically multiplexed over a single physical HTTP/2 * connection. * </p> * * @since 5.0 */ @Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL) @Internal public final class InternalHttp2AsyncClient extends InternalAbstractHttpAsyncClient {
0
import org.apache.cocoon.objectmodel.ObjectModel; public Object evaluate(ObjectModel objectModel) throws ExpressionException { Iterator iter = objectModel.entrySet().iterator(); public Iterator iterate(ObjectModel objectModel) throws ExpressionException { Object result = evaluate(objectModel); public void assign(ObjectModel objectModel, Object value) throws ExpressionException { public Object getNode(ObjectModel objectModel) throws ExpressionException { return evaluate(objectModel);
0
package org.apache.felix.sigil.ui.eclipse.actions; import org.apache.felix.sigil.eclipse.SigilCore; import org.apache.felix.sigil.eclipse.model.project.ISigilProjectModel; import org.apache.felix.sigil.eclipse.model.repository.IRepositoryModel; import org.apache.felix.sigil.repository.IBundleRepository; import org.apache.felix.sigil.ui.eclipse.ui.SigilUI;
0
resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true); resource.setPopulateRequiredFlag(true);
0
import org.apache.ambari.server.events.HostsAddedEvent; import org.apache.ambari.server.events.HostsRemovedEvent; * The {@link AlertHostListener} class handles {@link HostsAddedEvent} and * {@link HostsRemovedEvent} and ensures that {@link AlertCurrentEntity} * Handles the {@link HostsAddedEvent} by performing the following actions: public void onAmbariEvent(HostsAddedEvent event) { for (String hostName : event.getHostNames()) { AlertHashInvalidationEvent invalidationEvent = new AlertHashInvalidationEvent( event.getClusterId(), Collections.singletonList(hostName)); m_eventPublisher.publish(invalidationEvent); } * Handles the {@link HostsRemovedEvent} by performing the following actions: * <li>Removes all {@link AlertCurrentEntity} for the removed hosts</li> public void onAmbariEvent(HostsRemovedEvent event) { // remove any current alerts for the removed hosts for (String hostName : event.getHostNames()) { m_alertsDao.removeCurrentByHost(hostName); }
1
public class StreamingWindowedElement<LABEL, T> extends WindowedElement<LABEL, T> public StreamingWindowedElement(WindowID<LABEL> windowID, T element) { public StreamingWindowedElement<LABEL, T> withEmissionWatermark(long watermark) {
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.beam.runners.dataflow.worker; import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.ByteString; /** * A prefix for a Windmill state or timer tag to separate user state and timers from system state * and timers. */ enum WindmillNamespacePrefix { USER_NAMESPACE_PREFIX { @Override ByteString byteString() { return USER_NAMESPACE_BYTESTRING; } }, SYSTEM_NAMESPACE_PREFIX { @Override ByteString byteString() { return SYSTEM_NAMESPACE_BYTESTRING; } }; abstract ByteString byteString(); private static final ByteString USER_NAMESPACE_BYTESTRING = ByteString.copyFromUtf8("/u"); private static final ByteString SYSTEM_NAMESPACE_BYTESTRING = ByteString.copyFromUtf8("/s"); }
0
result = new StringMap(adapt(BundleRevisionImpl.class).getHeaders()); Map headers = new StringMap(adapt(BundleRevisionImpl.class).getHeaders());
1
suite.addTest(TestDumbHelpers.suite());
0
package com.twitter.nexus.scheduler.persistence;
0
import org.apache.aurora.scheduler.storage.db.DbUtil; storage = DbUtil.createStorage();
0
assertEquals(15, services.size()); expectedServices.add("TEZ");
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override
0
* * 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/>. *
0
import java.util.Vector; /* (non-Javadoc) * @see org.apache.cocoon.environment.Request#get(java.lang.String) */ public Object get(String name) { String[] values = this.getParameterValues(name); if (values == null || values.length == 0) { return null; } else if (values.length == 1) { return values[0]; } else { Vector vect = new Vector(values.length); for (int i = 0; i < values.length; i++) { vect.add(values[i]); } return vect; }
0
import org.apache.aurora.gen.ResourceAggregate; import org.apache.aurora.scheduler.storage.entities.IResourceAggregate; @Test public void testResourceAggregateFieldsToSet() { ResourceAggregate aggregate = new ResourceAggregate() .setNumCpus(1.0) .setRamMb(32) .setDiskMb(64); IResourceAggregate expected = IResourceAggregate.build(aggregate.deepCopy() .setResources(ImmutableSet.of(numCpus(1.0), ramMb(32), diskMb(64)))); assertEquals(expected, ThriftBackfill.backfillResourceAggregate(aggregate)); } @Test public void testResourceAggregateSetToFields() { ResourceAggregate aggregate = new ResourceAggregate() .setResources(ImmutableSet.of(numCpus(1.0), ramMb(32), diskMb(64))); IResourceAggregate expected = IResourceAggregate.build(aggregate.deepCopy() .setNumCpus(1.0) .setRamMb(32) .setDiskMb(64)); assertEquals(expected, ThriftBackfill.backfillResourceAggregate(aggregate)); }
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
0
* to the gradient Paint. The definiton of the
0
* <p> * This class is not thread safe.
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointerFactory.java,v 1.3 2003/01/11 05:41:24 dmitri Exp $ * $Revision: 1.3 $ * $Date: 2003/01/11 05:41:24 $ * @version $Revision: 1.3 $ $Date: 2003/01/11 05:41:24 $ public int getOrder() { public NodePointer createNodePointer( QName name, Object bean, Locale locale) { if (ValueUtils.isCollection(bean)) { public NodePointer createNodePointer( NodePointer parent, QName name, Object bean) { if (ValueUtils.isCollection(bean)) {
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbutils/src/test/org/apache/commons/dbutils/BaseTestCase.java,v 1.3 2003/11/09 04:50:46 dgraham Exp $ * $Revision: 1.3 $ * $Date: 2003/11/09 04:50:46 $ "notDate" };
0
/** */
1
public boolean isLabelProperty(Object element, String property) public void addListener(ILabelProviderListener listener) public void removeListener(ILabelProviderListener listener)
0
import org.apache.accumulo.core.client.mapreduce.lib.impl.InputConfigurator;
0
import org.apache.commons.fileupload.MultipartStream.ItemInputStream; final ItemInputStream itemStream = multi.newInputStream(); InputStream istream = itemStream; itemStream.close(true);
0
assertEquals(14, resp.getUpgradePacks().size());
0
package org.apache.felix.ipojo.runtime.core.components; public class ParentClass { private String name; public ParentClass(final String n) { name = n; } public ParentClass(final StringBuffer n) { name = n.toString(); } }
0
* Basic implementation of {@link AsyncResponseConsumer} that represents response message as * a {@link Message} and relies on a {@link AsyncEntityConsumer} to process response entity * stream. *
0
Copyright 2001 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
import org.apache.hc.core5.annotation.Immutable;
1
import org.osgi.framework.namespace.BundleNamespace; import org.osgi.framework.namespace.PackageNamespace; public void testCapabilities() throws Exception assertEquals(1, res.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE).size()); assertEquals(8, res.getCapabilities(PackageNamespace.PACKAGE_NAMESPACE).size()); assertEquals(1, res.getCapabilities("foo").size()); assertEquals(12, res.getCapabilities(null).size()); Capability bundleCap = res.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE).iterator().next(); assertEquals("2", bundleCap.getAttributes().get("manifestversion")); assertEquals("dummy", bundleCap.getAttributes().get(BundleNamespace.BUNDLE_NAMESPACE)); assertEquals(Version.parseVersion("1.0.0.SNAPSHOT"), bundleCap.getAttributes().get(BundleNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE)); assertEquals("Unnamed - dummy", bundleCap.getAttributes().get("presentationname")); Capability packageCap = res.getCapabilities(PackageNamespace.PACKAGE_NAMESPACE).get(7); assertEquals("org.apache.commons.logging", packageCap.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE)); assertEquals(Version.parseVersion("1.0.4"), packageCap.getAttributes().get(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE)); assertEquals("dummy", packageCap.getAttributes().get(PackageNamespace.CAPABILITY_BUNDLE_SYMBOLICNAME_ATTRIBUTE)); assertEquals(Version.parseVersion("1.0.0.SNAPSHOT"), packageCap.getAttributes().get(PackageNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE)); Capability fooCap = res.getCapabilities("foo").iterator().next(); assertEquals("someVal", fooCap.getAttributes().get("someKey"));
0
* @version $Id$
0
@Override
0
Assert.assertEquals("tserver.cache.config.lru.data.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.DATA)); Assert.assertEquals("tserver.cache.config.lru.index.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.INDEX)); Assert.assertEquals("tserver.cache.config.lru.summary.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.SUMMARY)); Assert.assertEquals("tserver.cache.config.lru.default.", BlockCacheManager.getFullyQualifiedPropertyPrefix("lru"));
0
Collections.<Long,List<String>>emptyMap(), Collections.<Long,List<String>>emptyMap());
0
import java.util.HashMap; HashMap attrs = getPseudoAttributes();
0
if (baseSource != null) { } if (logger.isDebugEnabled()) { logger.debug("XMLBaseSupport: resolved location " + location + " against base URI " + baseURI + " to " + source.getURI()); }
0
import org.apache.ambari.logsearch.common.Marker; @Marker public interface FieldAuditLogRequest extends BaseLogRequest, FieldParamDefinition, UserParamDefinition {
0
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString;
0
private static final Logger LOG = LoggerFactory.getLogger(HIFIOWithElasticTest.class); LOG.info("Elastic in memory server started."); LOG.info("Prepared index " + ELASTIC_INDEX_NAME LOG.info("Deleted index " + ELASTIC_INDEX_NAME + " from elastic in memory server"); LOG.info("Closed elastic in memory server node.");
0
.addDBAccessorBinding(mockDBDbAccessor).addLdapBindings().build()
0
sendStatus(prepareReply(buffer), id, sendStatus(prepareReply(buffer), id, SftpConstants.SSH_FX_OK, ""); sendStatus(prepareReply(buffer), id, SftpConstants.SSH_FX_FAILURE, "Unsupported version " + proposed); sendStatus(prepareReply(buffer), id, SftpConstants.SSH_FX_EOF, "Directory reading is done"); reply = prepareReply(buffer); sendStatus(prepareReply(buffer), id, SftpConstants.SSH_FX_EOF, "Empty directory"); sendStatus(prepareReply(buffer), id, e, SftpConstants.SSH_FXP_READDIR, handle); buffer = prepareReply(buffer); protected Buffer prepareReply(Buffer buffer) { buffer.clear(); return buffer; } @Override
0
* http://www.apache.org/licenses/LICENSE-2.0
0
MetadataTableUtil.deleteTable(tableId, refCount != 0, master, null); ProblemReports.getInstance(master).deleteProblemReports(tableId); AuditedSecurityOperation.getInstance(master).deleteTable(master.rpcCreds(), tableId, namespaceId); private String tableId; String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId); return Utils.reserveNamespace(namespaceId, tid, false, false, TableOperation.DELETE) + Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE); String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId); String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
1
private static void matchIdent( MyByteArrayInputStream in, StringBuffer buf ) { private static void matchGJIdent( MyByteArrayInputStream in, StringBuffer buf ) {
0
import org.apache.batik.util.resources.ResourceManager;
0
/** Descriptor of list storage. */ public static <T> ListStorageDescriptor<T> of(String name, Class<T> elementCls) { return new ListStorageDescriptor<>(name, elementCls); }
0
Map<String,String> siteConfig = new HashMap<String,String>();
0
import org.apache.atlas.exception.AtlasBaseException; public void testClassificationSerDe() throws AtlasBaseException { public void testClassificationSerDeWithSuperType() throws AtlasBaseException { public void testClassificationSerDeWithSuperTypes() throws AtlasBaseException {
0
/* * Copyright 1999-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. */ package org.apache.cocoon.components.transcoder; import org.apache.batik.transcoder.Transcoder; /** * Apache Batik Transcoder factory. * When given a MIME type, find a Transcoder which supports that MIME type. * * @version $Id$ */ public interface TranscoderFactory { /** * Create a transcoder for a specified MIME type. * @param mimeType The MIME type of the destination format * @return A suitable transcoder, or <code>null> if one cannot be found */ Transcoder createTranscoder(String mimeType) ; }
0
import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.io.entity.EntityUtils; final ClassicHttpResponse response = this.httpclient.execute(this.target, this.request); final int status = response.getCode();
0
final int attributes_count = file.readUnsignedShort(); for (final Attribute attribute : attributes) { } catch(final CloneNotSupportedException e) {
1
import org.apache.cocoon.util.AbstractLogEnabled; public class Web3ClientImpl extends AbstractLogEnabled implements Web3Client, Disposable, Recyclable, Poolable {
0
import java.util.Set; processServiceComponentHosts(cluster, kerberosDescriptor, schToProcess, identityFilter, dataDirectory, kerberosConfigurations, null, null, true, "true".equalsIgnoreCase(getCommandParameterValue(commandParameters, KerberosServerAction.INCLUDE_AMBARI_IDENTITY))); processConfigurationChanges(dataDirectory, kerberosConfigurations, null); * @param propertiesToBeRemoved Map<String, Map<String, String>> kerberosConfigurations, Map<String, Set<String>> propertiesToBeRemoved) // add properties to be set // add properties to be removed if (propertiesToBeRemoved != null) { for (Map.Entry<String, Set<String>> entry : propertiesToBeRemoved.entrySet()) { String type = entry.getKey(); Set<String> properties = entry.getValue(); if (properties != null) { for (String property : properties) { kerberosConfDataFileWriter.addRecord(type, property, "", KerberosConfigDataFileWriter.OPERATION_TYPE_REMOVE); } } } }
0
import org.apache.http.nio.ContentDecoder; import org.apache.http.nio.ContentEncoder; import org.apache.http.nio.NHttpClientConnection; import org.apache.http.nio.NHttpClientHandler; import org.apache.http.nio.reactor.IOEventDispatch; import org.apache.http.nio.reactor.IOReactor; import org.apache.http.nio.reactor.SessionRequest;
0