Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/ValidatorAction.java,v 1.5 2002/03/30 04:33:17 dwinterfeldt Exp $ * $Revision: 1.5 $ * $Date: 2002/03/30 04:33:17 $ * * ==================================================================== * @version $Revision: 1.5 $ $Date: 2002/03/30 04:33:17 $
0
public FileContentInfo create(final FileContent fileContent) final String name = fileContent.getFile().getName().getBaseName(); final FileNameMap fileNameMap = URLConnection.getFileNameMap();
1
/* * 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.accumulo.core.client.summary.summarizers; import java.util.function.UnaryOperator; import org.apache.accumulo.core.client.admin.TableOperations; import org.apache.accumulo.core.client.summary.CountingSummarizer; import org.apache.accumulo.core.data.ArrayByteSequence; import org.apache.accumulo.core.data.ByteSequence; /** * Counts column visibility labels. Leverages super class to defend against too many. This class is useful for discovering what column visibilities are present * when the expected number of visibilities is small. * * @since 2.0.0 * * @see TableOperations#addSummarizers(String, org.apache.accumulo.core.client.summary.SummarizerConfiguration...) * @see TableOperations#summaries(String) */ public class VisibilitySummarizer extends CountingSummarizer<ByteSequence> { @Override protected UnaryOperator<ByteSequence> copier() { return ArrayByteSequence::new; } @Override protected Converter<ByteSequence> converter() { return (k, v, c) -> c.accept(k.getColumnVisibilityData()); } }
1
private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<>();
1
/* * 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.direct; import org.apache.beam.sdk.util.SerializableUtils; import com.google.common.cache.CacheLoader; import java.io.Serializable; /** * A {@link CacheLoader} that loads {@link ThreadLocal ThreadLocals} with initial values equal to * the clone of the key. */ class SerializableCloningThreadLocalCacheLoader<T extends Serializable> extends CacheLoader<T, ThreadLocal<T>> { public static <T extends Serializable> CacheLoader<T, ThreadLocal<T>> create() { return new SerializableCloningThreadLocalCacheLoader<T>(); } @Override public ThreadLocal<T> load(T key) throws Exception { return new CloningThreadLocal<>(key); } private static class CloningThreadLocal<T extends Serializable> extends ThreadLocal<T> { private final T original; public CloningThreadLocal(T value) { this.original = value; } @Override public T initialValue() { return SerializableUtils.clone(original); } } }
0
import org.apache.batik.dom.svg.ExtensibleSVGDOMImplementation; ExtensibleSVGDOMImplementation.getDOMImplementation());
0
BigQueryQuerySourceDef queryDef, SerializableFunction<SchemaAndRecord, T> parseFn) { return new BigQueryQuerySource<>(stepUuid, queryDef, bqServices, coder, parseFn); private final BigQueryQuerySourceDef queryDef; BigQueryQuerySourceDef queryDef, SerializableFunction<SchemaAndRecord, T> parseFn) { this.queryDef = queryDef; return queryDef.getEstimatedSizeBytes(options.as(BigQueryOptions.class)); return queryDef.getTableReference(bqOptions, stepUuid); queryDef.cleanupTempResource(bqOptions, stepUuid); builder.add(DisplayData.item("query", queryDef.getQuery()));
0
public ClientConnectionRequest requestConnection(final HttpRoute route) { public ManagedClientConnection getConnection( public ClientConnectionRequest requestConnection(final HttpRoute route) { public ManagedClientConnection getConnection(
0
import org.apache.cocoon.portal.impl.AbstractLogEnabled;
0
import org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils; import org.apache.beam.sdk.schemas.Schema; Schema.builder() .addInt64Field("id") .addStringField("name") .addStringField("emailAddress") .addStringField("creditCard") .addStringField("city") .addStringField("state") .addField("dateTime", CalciteUtils.TIME) .addStringField("extra") Schema.builder() .addInt64Field("auction") .addInt64Field("bidder") .addInt64Field("price") .addField("dateTime", CalciteUtils.TIME) .addStringField("extra") Schema.builder() .addInt64Field("id") .addStringField("itemName") .addStringField("description") .addInt64Field("initialBid") .addInt64Field("reserve") .addField("dateTime", CalciteUtils.TIMESTAMP) .addField("expires", CalciteUtils.TIMESTAMP) .addInt64Field("seller") .addInt64Field("category") .addStringField("extra") Schema.builder() .addInt64Field("auction") .addInt64Field("num") Schema.builder() .addInt64Field("auction") .addInt64Field("price") Schema.builder() .addStringField("name") .addStringField("city") .addStringField("state") .addInt64Field("id")
0
private final Map<Resource.Type, ViewSubResourceDefinition> resourceDefinitions = new HashMap<Resource.Type, ViewSubResourceDefinition>(); /** * The external resource type for the view. */ private final Resource.Type externalResourceType; this.externalResourceType = new Resource.Type(getQualifiedResourceTypeName(ResourceConfig.EXTERNAL_RESOURCE_PLURAL_NAME)); public void addResourceDefinition(ViewSubResourceDefinition definition) { * Get the resource definition for the given type. public ViewSubResourceDefinition getResourceDefinition(Resource.Type type) { * Get the mapping of resource type to resource definitions. * * @return the mapping of resource type to resource definitions */ public Map<Resource.Type, ViewSubResourceDefinition> getResourceDefinitions() { return resourceDefinitions; } /** * Get the mapping of resource type to resource configurations. return resourceProviders.keySet(); /** * Get the external resource type for the view. * * @return the external resource type */ public Resource.Type getExternalResourceType() { return externalResourceType; } /** * Get a resource name qualified by the associated view name. * * @param resourceTypeName the resource type name * * @return the qualified resource name */ public String getQualifiedResourceTypeName(String resourceTypeName) { return configuration.getName() + "/" + resourceTypeName; }
0
import org.apache.hc.core5.http.config.Http1Config; private final Http1Config http1Config; final Http1Config http1Config, this.http1Config = http1Config != null ? http1Config : Http1Config.DEFAULT; http1Config,
0
executorClock.advance(Amount.of(1L, Time.MILLISECONDS));
0
createForIterable(WindowFn<?, W> windowFn, Coder<V> inputCoder) { return new GABWViaWindowSetDoFn<>(windowFn, BufferingWindowSet.<K, V, W>factory(inputCoder)); public static <K, VI, VA, VO, W extends BoundedWindow> GroupAlsoByWindowsDoFn<K, VI, VO, W> final KeyedCombineFn<K, VI, VA, VO> combineFn, return new GABWViaWindowSetDoFn<>( windowFn, CombiningWindowSet.<K, VI, VA, VO, W>factory(combineFn, keyCoder, inputCoder)); private static class GABWViaWindowSetDoFn<K, VI, VO, W extends BoundedWindow> private AbstractWindowSet.Factory<K, VI, VO, W> windowSetFactory; public GABWViaWindowSetDoFn(WindowFn<?, W> windowFn, AbstractWindowSet.Factory<K, VI, VO, W> factory) { this.windowSetFactory = factory; AbstractWindowSet<K, VI, VO, W> windowSet = windowSetFactory.create( key, windowFn.windowCoder(), c.keyedState(), c.windowingInternals()); triggerExecutor.onElement(e); timerManager.advanceWatermark(triggerExecutor, e.getTimestamp()); timerManager.advanceWatermark(triggerExecutor, new Instant(Long.MAX_VALUE));
0
package org.apache.atlas; import org.apache.atlas.repository.graph.GraphProvider;
0
* Set out printStream (usable for testing) * Set err printStream (usable for testing) * set the zookeeper instance
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. */ @Version("2.0.0") package org.apache.felix.hc.generalchecks.util; import org.osgi.annotation.versioning.Version;
0
.synchronizedList(new ArrayList<>());
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/SingletonListIterator.java,v 1.2 2002/08/19 21:56:18 pjack Exp $ * $Revision: 1.2 $ * $Date: 2002/08/19 21:56:18 $ * @version $Id: SingletonListIterator.java,v 1.2 2002/08/19 21:56:18 pjack Exp $ * call to <tt>previous</tt>. A return value of -1 indicates that the iterator is currently at
0
import java.util.List; import org.apache.beam.sdk.io.FileBasedSink; List<PCollectionView<?>> sideInputs = WriteFilesTranslation.getDynamicDestinationSideInputs(transform); FileBasedSink sink = WriteFilesTranslation.getSink(transform); WriteFiles<InputT, ?, ?> replacement = WriteFiles.to(sink).withSideInputs(sideInputs);
0
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0
Copyright 2001,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
public static final String INTERNAL_HOSTNAME = "_internal_ambari";
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ObjectArrayIterator.java,v 1.8 2003/10/10 21:06:18 scolebourne Exp $ import java.util.Iterator; * @version $Revision: 1.8 $ $Date: 2003/10/10 21:06:18 $ * @author James Strachan * @author Michael A. Smith * @author Neil O'Toole public class ObjectArrayIterator implements Iterator, ResetableIterator {
0
return DefaultUserPrincipalLookupService.INSTANCE; public static final DefaultUserPrincipalLookupService INSTANCE = new DefaultUserPrincipalLookupService();
0
import java.util.Collection; import java.util.List; import org.apache.sshd.common.NamedResource; import org.apache.sshd.common.signature.SignatureFactoriesManager; public class UserAuthPublicKey extends AbstractUserAuth implements SignatureFactoriesManager { private List<NamedFactory<Signature>> factories; this(null); } public UserAuthPublicKey(List<NamedFactory<Signature>> factories) { this.factories = factories; // OK if null/empty } @Override public List<NamedFactory<Signature>> getSignatureFactories() { return factories; } @Override public void setSignatureFactories(List<NamedFactory<Signature>> factories) { this.factories = factories; Collection<NamedFactory<Signature>> factories = ValidateUtils.checkNotNullAndNotEmpty( SignatureFactoriesManager.Utils.resolveSignatureFactories(this, session), "No signature factories for session=%s", session); log.debug("doAuth({}@{}) verify key type={}, factories={}, fingerprint={}", username, session, alg, NamedResource.Utils.getNames(factories), KeyUtils.getFingerPrint(key)); NamedFactory.Utils.create(factories, alg),
0
* $Revision: 1.10 $ * $Date: 2003/10/09 21:05:29 $ * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
0
import org.apache.sshd.common.session.helpers.TimeoutIndicator; import org.apache.sshd.common.session.helpers.TimeoutIndicator.TimeoutStatus; AtomicReference<TimeoutIndicator> timeoutHolder = new AtomicReference<>(TimeoutIndicator.NONE); public boolean handleTimeoutDisconnectReason(Session session, TimeoutIndicator timeoutStatus) TimeoutIndicator prev = timeoutHolder.getAndSet(timeoutStatus); if (prev != TimeoutIndicator.NONE) { TimeoutIndicator status = timeoutHolder.getAndSet(null); assertSame("Mismatched timeout status reported", TimeoutIndicator.TimeoutStatus.AuthTimeout, status.getStatus()); AtomicReference<TimeoutIndicator> timeoutHolder = new AtomicReference<>(TimeoutIndicator.NONE); public boolean handleTimeoutDisconnectReason(Session session, TimeoutIndicator timeoutStatus) TimeoutIndicator prev = timeoutHolder.getAndSet(timeoutStatus); if (prev != TimeoutIndicator.NONE) { TimeoutIndicator status = timeoutHolder.getAndSet(null); assertSame("Mismatched timeout status", TimeoutStatus.IdleTimeout, status.getStatus());
0
import java.io.Serializable; import java.util.Set;
0
public void init(InitParameters params) { Map<String,String> options = params.getOptions(); public String dispatch(DispatchParmaters params) { ScanInfo scanInfo = params.getScanInfo(); if (params.getScanExecutors().containsKey(executor)) {
0
DoFn<InputT, OutputT> doFn = transform.getFn(); transform.getFn(), transform.getFn(), DoFn<InputT, OutputT> doFn = transform.getFn(); transform.getFn(), transform.getFn(),
0
import java.util.Arrays; import java.util.Collections; import java.util.List;
0
HiveMetaStoreBridge dgiBridge = new HiveMetaStoreBridge(atlasProperties, hiveConf);
0
import static org.junit.Assert.assertFalse; int maxTries = 10; while (maxTries-- > 0 && commitsReceived.size() < commitsRequested + numCommits) { assertFalse("Should have received commits after 10s, but only got " + commitsReceived, commitsReceived.size() < commitsRequested + numCommits); " timestamp: 9223372036854775000" + " timestamp: 9223372036854775000" + server.addDataToOffer(buildData( "data {" + " computation_id: \"computation\"" + " data {" + " key: \"key\"" + " values {" + " tag: \"12:MergeWindowsearliest-element-gAAAAAAAAAAAAAAA\"" + " }" + " }" + "}")); "value_updates {" + " tag: \"12:MergeWindowsearliest-element-gAAAAAAAAAAAAAAA\"" + " value {" + " timestamp: 0" + " data: \"\\200\\000\\000\\000\\000\\000\\000\\000\"" + " }" + "}" + " timestamp: 9223372036854775000" + server.addDataToOffer(buildData( "data {" + " computation_id: \"computation\"" + " data {" + " key: \"key\"" + " values {" + " tag: \"12:MergeWindowsearliest-element-gAAAAAAAAAAAAAAA\"" + " value {" + " timestamp: 0" + " data: \"\\200\\000\\000\\000\\000\\000\\000\\000\"" + " }" + " }" + " }" + "}")); " data: \"\\000\\000\\000\\001\\005data0\"" + "value_updates {" + " tag: \"12:MergeWindowsearliest-element-gAAAAAAAAAAAAAAA\"" + " value {" + " timestamp: 9223372036854775807" + " data: \"\"" + " }" + "}" +
0
private final String prefix; String prefix = null; if ( !isEmpty(this.path) ) { if ( !this.path.equals("/") && this.path.length() > 1 ) { prefix = this.path.substring(0, this.path.length() - 1); } } this.prefix = prefix; public String getPrefix() { return this.prefix; } public String getFullPath(final String path) { if ( this.prefix == null ) { return path; } return this.prefix.concat(path); }
0
import static org.hamcrest.Matchers.containsInAnyOrder; import java.util.ArrayList; import java.util.List; import org.apache.beam.model.fnexecution.v1.BeamFnApi.MonitoringInfo; import org.apache.beam.sdk.metrics.MetricName; public void testUpdateAllUpdatesUnboundedAndBoundedContainers() { MetricsContainerStepMap baseMetricContainerRegistry = new MetricsContainerStepMap(); CounterCell c1 = baseMetricContainerRegistry.getContainer(STEP1).getCounter(MetricName.named("ns", "name1")); CounterCell c2 = baseMetricContainerRegistry .getUnboundContainer() .getCounter(MetricName.named("ns", "name2")); c1.inc(7); c2.inc(14); MetricsContainerStepMap testObject = new MetricsContainerStepMap(); testObject.updateAll(baseMetricContainerRegistry); List<MonitoringInfo> expected = new ArrayList<MonitoringInfo>(); SimpleMonitoringInfoBuilder builder = new SimpleMonitoringInfoBuilder(); builder.setUrnForUserMetric("ns", "name1"); builder.setPTransformLabel(STEP1); builder.setInt64Value(7); expected.add(builder.build()); builder = new SimpleMonitoringInfoBuilder(); builder.setUrnForUserMetric("ns", "name2"); builder.setPTransformLabel(""); builder.setInt64Value(14); expected.add(builder.build()); ArrayList<MonitoringInfo> actual = new ArrayList<MonitoringInfo>(); for (MonitoringInfo mi : testObject.getMonitoringInfos()) { actual.add(SimpleMonitoringInfoBuilder.clearTimestamp(mi)); } assertThat(actual, containsInAnyOrder(expected.toArray())); } @Test
0
public void testOnePreemptibleTask() {
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
/** TestWidenings for {@link SchemaZipFold} with examples. */
0
import org.apache.accumulo.cloudtrace.instrument.Tracer; client.update(Tracer.traceInfo(), rootCredentials, new KeyExtent(new Text("test_ingest"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
1
EntityUtils.consume(backendResponse.getEntity()); EntityUtils.consume(backendResponse.getEntity());
0
// expect configuration reassigned TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() ); // config has to be reassigned TestCase.assertEquals( bundle2.getLocation(), config.getBundleLocation() ); // config has to be reassigned TestCase.assertEquals( bundle.getLocation(), config.getBundleLocation() );
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
implements DoFnInvoker.ArgumentProvider<InputT, OutputT> { implements DoFnInvoker.ArgumentProvider<InputT, OutputT> {
0
* Creates a new CSSOMReadOnlyStyleDeclaration object. */ public CSSOMReadOnlyStyleDeclaration(CSSOMReadOnlyStyleDeclaration sd) { properties = new PropertyMap(sd.properties); viewCSS = sd.viewCSS; parentElement = sd.parentElement; } /** * Creates a copy of the given PropertyMap object. * @param t The table to copy. */ public PropertyMap(PropertyMap t) { count = t.count; table = new ValueEntry[t.table.length]; for (int i = 0; i < table.length; i++) { ValueEntry e = t.table[i]; ValueEntry n = null; if (e != null) { n = createValueEntry(e.value, e.getPriority(), e.getOrigin()); n.initialize(e.hash, e.key, null); table[i] = n; e = e.next; while (e != null) { n.next = createValueEntry(e.value, e.getPriority(), e.getOrigin()); n = n.next; n.initialize(e.hash, e.key, null); e = e.next; } } } } /** table = new ValueEntry[oldTable.length * 2 + 1];
0
Mockito.<HttpRequest>any(), final ArgumentCaptor<HttpRequest> reqCaptor = ArgumentCaptor.forClass(HttpRequest.class); Mockito.verify(requestExecutor).execute( reqCaptor.capture(), Mockito.same(managedConn), Mockito.same(context));
0
import org.apache.aurora.common.args.Arg; import org.apache.aurora.common.args.CmdLine; import org.apache.aurora.common.base.ExceptionalSupplier; import org.apache.aurora.common.base.MoreSuppliers; import org.apache.aurora.common.net.http.handlers.AbortHandler; import org.apache.aurora.common.net.http.handlers.ContentionPrinter; import org.apache.aurora.common.net.http.handlers.HealthHandler; import org.apache.aurora.common.net.http.handlers.LogConfig; import org.apache.aurora.common.net.http.handlers.QuitHandler; import org.apache.aurora.common.net.http.handlers.StringTemplateServlet; import org.apache.aurora.common.net.http.handlers.ThreadStackPrinter; import org.apache.aurora.common.net.http.handlers.TimeSeriesDataSource; import org.apache.aurora.common.net.http.handlers.VarsHandler; import org.apache.aurora.common.net.http.handlers.VarsJsonHandler; import org.apache.aurora.common.net.pool.DynamicHostSet.MonitorException;
0
* @return <code>true</code> if the key/value pair is accepted by the filter.
0
Copyright 2001,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
/* * $HeadURL$ * $Revision$ * $Date$ * ==================================================================== * 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.http.impl.auth; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; public class TestAllAuthImpl extends TestCase { public TestAllAuthImpl(String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(TestRFC2617Scheme.suite()); return suite; } public static void main(String args[]) { String[] testCaseName = { TestAllAuthImpl.class.getName() }; junit.textui.TestRunner.main(testCaseName); } }
0
import org.osgi.service.obr.RepositoryAdmin; private ServiceTracker repositoryAdmin; protected RepositoryAdmin getRepositoryAdmin() if ( repositoryAdmin == null ) { try { repositoryAdmin = new ServiceTracker( getBundleContext(), RepositoryAdmin.class.getName(), null ); repositoryAdmin.open(); } catch ( Throwable t ) { // missing InstallerService class ?? return null; return ( RepositoryAdmin ) repositoryAdmin.getService(); }
0
package org.apache.felix.obrplugin;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyOwnerPointer.java,v 1.2 2002/04/24 04:05:40 dmitri Exp $ * $Revision: 1.2 $ * $Date: 2002/04/24 04:05:40 $ import java.util.Locale; import org.apache.commons.jxpath.JXPathContext; import org.apache.commons.jxpath.ri.QName; import org.apache.commons.jxpath.ri.compiler.NodeNameTest; import org.apache.commons.jxpath.ri.compiler.NodeTest; import org.apache.commons.jxpath.ri.compiler.NodeTypeTest; import org.apache.commons.jxpath.util.ValueUtils; * @version $Revision: 1.2 $ $Date: 2002/04/24 04:05:40 $
0
import org.apache.atlas.GraphTransaction; @Test(dependsOnMethods = "testStore")
0
org.apache.felix.dm.ConfigurationDependency m_delegate; public org.apache.felix.dm.ConfigurationDependency getDelegate()
0
public interface MergingWindowing<T, W extends Window<W>>
0
try { switch (operator) { case SELF_ADD: return arithmetic.add(args[0], args[1]); case SELF_SUBTRACT: return arithmetic.subtract(args[0], args[1]); case SELF_MULTIPLY: return arithmetic.multiply(args[0], args[1]); case SELF_DIVIDE: return arithmetic.divide(args[0], args[1]); case SELF_MOD: return arithmetic.mod(args[0], args[1]); case SELF_AND: return arithmetic.and(args[0], args[1]); case SELF_OR: return arithmetic.or(args[0], args[1]); case SELF_XOR: return arithmetic.xor(args[0], args[1]); default: // unexpected, new operator added? throw new UnsupportedOperationException(operator.getOperatorSymbol()); } } catch (Exception xany) { interpreter.operatorError(node, base, xany); return JexlEngine.TRY_FAILED;
0
import org.apache.cocoon.el.objectmodel.ObjectModel;
0
* @version $Id$
0
import java.util.Map; import java.util.Optional; private final Map<String, ExecutorConfig> config; public ExecutorSettings( Map<String, ExecutorConfig> config, boolean populateDiscoveryInfo) { public Optional<ExecutorConfig> getExecutorConfig(String name) { return Optional.ofNullable(config.get(name)); public Optional<ResourceBag> getExecutorOverhead(String name) { if (config.containsKey(name)) { return Optional.of( ResourceManager.bagFromMesosResources(config.get(name).getExecutor().getResourcesList())); } else { return Optional.empty(); }
0
import java.sql.SQLException; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.H2DatabaseCleaner; public void teardown() throws AmbariException, SQLException { H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);
0
package org.apache.accumulo.monitor.rest.tables;
0
request.setEntity(createIncomingEntity(request, this.inBuffer, socketHolder.getInputStream(), len));
0
Mockito.verify(connectionEndpoint).setSocketTimeout(123);
0
package org.apache.commons.beanutils2; import org.apache.commons.beanutils2.BasicDynaClass; import org.apache.commons.beanutils2.BeanUtilsBean; import org.apache.commons.beanutils2.DynaBean; import org.apache.commons.beanutils2.DynaClass; import org.apache.commons.beanutils2.DynaProperty;
1
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 static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkNotNull; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ArrayListMultimap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Maps; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Multimap;
0
import org.apache.sshd.util.BaseTestSupport; public class BuiltinMacsTest extends BaseTestSupport { assertSame(name, expected, actual); assertNotNull("No match found for " + name, value); assertTrue(name + " re-specified", avail.add(value)); assertEquals("Incomplete coverage", BuiltinMacs.VALUES, avail); assertSame(name, expected, actual); fail("Unexpected sucess for " + expected.getName()); assertEquals("Unexpected success at attempt #" + index, 1, index); assertNull("Extension already registered", BuiltinMacs.resolveFactory(name)); assertSame("Mismatched resolved instance", expected, actual); assertSame("Mismatched unregistered instance", expected, actual); assertNull("Extension not un-registered", BuiltinMacs.resolveFactory(name)); assertNull("Invalid null transformation", MacFactory.FAC2NAMED.transform(null)); assertSame("Mismatched transformed instance for " + expected.getName(), expected, actual); assertSame("Mismatched transformed mocked instance", mock, MacFactory.FAC2NAMED.transform(mock));
0
import org.apache.sshd.common.SshdSocketAddress; SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws Exception; SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws Exception;
0
import java.util.List; import javax.inject.Inject; import org.apache.atlas.RequestContext; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; String guid = classVertex.getProperty(Constants.GUID_PROPERTY_KEY, String.class); // Check if the instance we need was previously loaded. ITypedReferenceableInstance classInstance = RequestContext.get().getInstance(guid); if (classInstance == null) { classInstance = metadataRepository.getGraphToInstanceMapper().mapGraphToTypedInstance(guid, classVertex); }
0
package org.apache.hc.client5.testing;
0
/* $Id: ExtendedBaseRules.java,v 1.16 2005/01/17 10:56:50 skitching Exp $ * <p>By default, a Digester instance uses a {@link RulesBase} instance as * its pattern matching engine. To use an ExtendedBaseRules instance, call * the Digester.setRules method before adding any Rule objects to the digester * instance: * <pre> * Digester digester = new Digester(); * digester.setRules( new ExtendedBaseRules() ); * </pre></p> * * <p>The most important thing to remember when using the extended rules is * that universal and non-universal patterns are completely independent. * Universal patterns are never affected by the addition of new patterns * or the removal of existing ones. Non-universal patterns are never affected * by the addition of new <em>universal</em> patterns or the removal of * existing <em>universal</em> patterns. As in the basic matching rules, * non-universal (basic) patterns <strong>can</strong> be affected by the * addition of new <em>non-universal</em> patterns or the removal of existing * <em>non-universal</em> patterns, because only rules associated with the * "best matching" pattern for each xml element are executed. * * <p> This means that you can use universal patterns to build up the simple * parts of your structure - for example defining universal creation and * property setting rules. More sophisticated and complex mapping will require * non-universal patterns and this might mean that some of the universal rules * will need to be replaced by a series of special cases using non-universal * rules. But by using universal rules as your backbone, these additions * should not break your existing rules.</p>
0
* @param t * @param s
0
import java.io.File; import java.nio.charset.StandardCharsets; import com.google.common.base.Strings; import com.google.common.io.Files; import static org.apache.aurora.scheduler.TierModule.TIER_CONFIG_PATH; import static org.apache.aurora.scheduler.TierModule.readTierFile; import static org.junit.Assert.assertFalse; public class TierModuleTest { public void testTierConfigArgumentNotSpecified() throws Exception { String tierFileContents = readTierFile(); assertFalse(Strings.isNullOrEmpty(tierFileContents)); assertEquals( tierFileContents, Files.toString( new File(TierModule.class.getClassLoader().getResource(TIER_CONFIG_PATH).getFile()), StandardCharsets.UTF_8)); } @Test(expected = IllegalArgumentException.class) public void testEmptyTierConfigFile() { parseTierConfig(""); parseTierConfig("{\"tiers\":{\"revocable\": {\"revocable\": true}}}").getTiers()); parseTierConfig("{\"tiers\":{\"revocable\": {\"revocable\": true, \"foo\": false}}}");
0
import org.apache.commons.jexl.JexlContext; * @since 1.1 public Object value(JexlContext jc) throws Exception { SimpleNode child = (SimpleNode)jjtGetChild(0); return child.value(jc); }
0
/* ==================================================================== * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * @version $Revision: 1.2 $ $Date: 2004/01/14 21:34:35 $
0
System.out.println("Connect request cancelled: " + request.getRemoteAddress()); System.out.println("Connect request failed: " + request.getRemoteAddress()); System.out.println("Connect request timed out: " + request.getRemoteAddress());
0
/** * Sets the field name where to inject the original service. By default, the original service is injected * in any attributes in the aspect implementation that are of the same type as the aspect interface. */ String field() default ""; /** * The callback method to be invoked when the original service is available. This attribute can't be mixed with * the field attribute. */ String added() default ""; /** * The callback method to be invoked when the original service properties have changed. When this attribute is used, * then the added attribute must also be used. */ String changed() default ""; /** * The callback method to invoke when the service is lost. When this attribute is used, then the added attribute * must also be used. */ String removed() default "";
0
import java.util.List; protected List<FilterOp> subOps; protected List<Arg> args;
0
CreateStreamingFlinkView<ElemT, ViewT> createFlinkView = new CreateStreamingFlinkView<>(view);
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
v.visitNameSignatureInstruction(this);
0
super.setUp(); super.tearDown();
0
/** * If this session tracker supports local sessions, return how many. * otherwise returns 0; */ public long getLocalSessionCount();
0
import java.text.DateFormat; import java.util.Date;
0
private static String getSystemTestUriOverride() { return System.getProperty(TEST_URI); } if (getSystemTestUriOverride() == null) { setUpClass(); } String uri = getSystemTestUriOverride();
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 com.sun.tools.javac; import java.io.PrintWriter; /** * Mock class providing the declarations required to compile the Cocoon code when * the actual library is not present. * * @version CVS $Id: Main.java 30932 2004-07-29 17:35:38Z vgritsenko $ */ public class Main { public Main() { throw new UnsupportedOperationException("This is a mock object"); } public static int compile(String[] strings, PrintWriter p) { throw new UnsupportedOperationException("This is a mock object"); } }
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
/* * 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.accumulo.core.client.security.tokens.PasswordToken; Connector connector = inst.getConnector("user", new PasswordToken("pass"));
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.test.xml; import org.apache.batik.test.DefaultTestSuite; /** * Dummy TestSuite which always passes. Needed for the test infrastructure * validation. * * @author <a href="mailto:[email protected]">Vincent Hardy</a> * @version $Id$ */ public class DummyValidTestSuite extends DefaultTestSuite{ public DummyValidTestSuite(){ addTest(new DummyValidTest() {{setId("1");}}); addTest(new DummyValidTest() {{setId("2");}}); } }
0
/** * @deprecated will be made private; do not access directly, use getter/setter */ @Deprecated /** * @deprecated will be made private; do not access directly, use getter/setter */ @Deprecated /** * @deprecated will be made private; do not access directly, use getter/setter */ @Deprecated
0
import org.apache.cocoon.portal.coplet.CopletInstance; void init(CopletInstance coplet); void destroy(CopletInstance coplet); void toSAX(CopletInstance coplet, ContentHandler contentHandler) void login(CopletInstance coplet); void logout(CopletInstance coplet);
0
package org.apache.hc.core5.http.integration; import org.apache.hc.core5.http.impl.nio.BasicAsyncRequestProducer; import org.apache.hc.core5.http.impl.nio.BasicAsyncResponseConsumer; import org.apache.hc.core5.http.testserver.nio.HttpCoreNIOTestBase;
1
warning("Unable to get size for table {}!", tableName);
0
public static int decode(byte[] data, OutputStream out) throws IOException { int off = 0; int length = data.length;
0
import java.io.File; import java.io.FileOutputStream; import org.apache.xml.security.keys.content.KeyName; import org.apache.xml.security.signature.SignedInfo; import org.apache.xml.security.signature.XMLSignature; import org.apache.xml.security.transforms.Transforms; import org.apache.xml.security.utils.Constants; import org.apache.xml.security.utils.XMLUtils; import org.w3c.dom.Element;
0
package org.apache.zookeeper.server; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.proto.WatcherEvent;
0
ServerFactoryManager manager = ((ServerSession) getSession()).getFactoryManager(); ServerFactoryManager manager = ((ServerSession) getSession()).getFactoryManager(); ServerFactoryManager manager = ((ServerSession) getSession()).getFactoryManager(); ((SessionAware) command).setSession((ServerSession) getSession()); ServerFactoryManager manager = ((ServerSession) getSession()).getFactoryManager(); FileSystemFactory factory = manager.getFileSystemFactory();
0
import org.apache.hc.core5.http2.nio.AsyncServerExchangeHandler; private final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory; final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory,
0