Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
requiresExecCmdDetails.put(host, new HashMap<>()); | 0 |
ClientContext context = new AccumuloServerContext(confFactory); | 0 |
* Test case for CForms's DynamicSelectionList datatype.
* @version CVS $Id: DynamicSelectionListTestCase.java,v 1.4 2004/03/11 02:56:32 joerg Exp $ | 0 |
public class ExerciseKafkaSource {
KafkaSource.Factory.class); | 0 |
setParameters(ps); | 0 |
/*
* Copyright 2005 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.
*
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
*/
/*
* $Id$
*/
package org.jcp.xml.dsig.internal.dom;
import javax.xml.crypto.Data;
import org.apache.xml.security.signature.XMLSignatureInput;
/**
* XMLSignatureInput Data wrapper.
*
* @author Sean Mullan
*/
public interface ApacheData extends Data {
/**
* Returns the XMLSignatureInput.
*/
public XMLSignatureInput getXMLSignatureInput();
} | 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.metadata;
import com.google.common.collect.ImmutableList;
import org.apache.metadata.storage.Id;
/**
* Represents and instance of a ClassType. These have identity.
* Transient instances will have a UNASSIGNED identity.
*/
public interface IReferencableInstance extends IStruct {
ImmutableList<String> getTraits();
Id getId();
IStruct getTrait(String typeName);
} | 0 |
extends AbstractConnectionService
@Override
public AbstractServerSession getSession() {
return (AbstractServerSession) super.getSession();
} | 1 |
.withFetchSize(12) | 0 |
* <p> This is a convenient wrapper for
*
* <p> This uses reflection to invoke the method obtained from a call to
*
*
}
* <p>This uses reflection to invoke the method obtained from a call to
*
*
{
throw new NoSuchMethodException("No such accessible method: " +
methodName + "() on object: " + object.getClass().getName());
* can be found, return <code>null</code>.
* @param parameterType taking this type of parameter
Class clazz,
String methodName,
Class parameterType)
}
* can be found, return <code>null</code>.
Class clazz,
String methodName,
Class[] parameterTypes) | 0 |
private final long gracePeriod;
private final Object shutdownMutex;
this.gracePeriod = 500;
this.shutdownMutex = new Object();
for (int i = 0; i < this.dispatchers.length; i++) {
BaseIOReactor dispatcher = new BaseIOReactor(this.selectTimeout);
dispatcher.setExceptionHandler(exceptionHandler);
this.dispatchers[i] = dispatcher;
}
doShutdown();
protected void doShutdown() throws IOException {
if (this.status.compareTo(IOReactorStatus.SHUTTING_DOWN) >= 0) {
dispatcher.awaitShutdown(this.gracePeriod);
t.join(this.gracePeriod);
synchronized (this.shutdownMutex) {
this.status = IOReactorStatus.SHUT_DOWN;
this.shutdownMutex.notifyAll();
}
protected void awaitShutdown(long timeout) throws InterruptedException {
synchronized (this.shutdownMutex) {
long deadline = System.currentTimeMillis() + timeout;
long remaining = timeout;
while (this.status != IOReactorStatus.SHUT_DOWN) {
this.shutdownMutex.wait(remaining);
if (timeout > 0) {
remaining = deadline - System.currentTimeMillis();
if (remaining <= 0) {
break;
}
}
}
}
}
public void shutdown() throws IOException {
shutdown(2000);
}
public void shutdown(long waitMs) throws IOException {
if (this.status != IOReactorStatus.ACTIVE) {
return;
}
this.status = IOReactorStatus.SHUTDOWN_REQUEST;
this.selector.wakeup();
try {
awaitShutdown(waitMs);
} catch (InterruptedException ignore) {
}
}
| 0 |
import org.apache.ambari.server.controller.internal.RequestResourceFilter;
Assert.assertEquals(null, ear.getCommandName());
Assert.assertEquals(1, ear.getResourceFilters().size());
RequestResourceFilter resourceFilter = ear.getResourceFilters().get(0);
Assert.assertEquals("NAGIOS", resourceFilter.getServiceName());
Assert.assertEquals("NAGIOS_SERVER", resourceFilter.getComponentName());
Assert.assertEquals(null, ear.getCommandName());
Assert.assertEquals(1, ear.getResourceFilters().size());
RequestResourceFilter resourceFilter = ear.getResourceFilters().get(0);
Assert.assertEquals("NAGIOS", resourceFilter.getServiceName());
Assert.assertEquals("NAGIOS_SERVER", resourceFilter.getComponentName());
Assert.assertEquals(null, ear.getCommandName());
Assert.assertEquals(1, ear.getResourceFilters().size());
RequestResourceFilter resourceFilter = ear.getResourceFilters().get(0);
Assert.assertEquals("NAGIOS", resourceFilter.getServiceName());
Assert.assertEquals("NAGIOS_SERVER", resourceFilter.getComponentName()); | 0 |
Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1"); | 0 |
newInstance = this.getClass().getDeclaredConstructor().newInstance(); | 0 |
return CurrentWindowsCredentials.INSTANCE; | 0 |
public BaseRC4Cipher(int ivsize, int kdfSize, int keySize, int blkSize) {
super(ivsize, kdfSize, "ARCFOUR", keySize, "RC4", blkSize);
}
@Override
protected byte[] initializeIVData(Mode mode, byte[] iv, int reqLen) {
return iv; // not used in any way
protected javax.crypto.Cipher createCipherInstance(Mode mode, byte[] key, byte[] iv) throws Exception {
javax.crypto.Cipher instance = SecurityUtils.getCipher(getTransformation());
instance.init(
Mode.Encrypt.equals(mode)
? javax.crypto.Cipher.ENCRYPT_MODE
: javax.crypto.Cipher.DECRYPT_MODE,
new SecretKeySpec(key, getAlgorithm()));
byte[] foo = new byte[1];
for (int i = 0; i < SKIP_SIZE; i++) {
instance.update(foo, 0, 1, foo, 0);
return instance; | 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 |
* Copyright 2003-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
public void accept( final Visitor v ) { | 0 |
* @version CVS $Id$
public interface ElementProcessor { | 0 |
* Copyright 2003-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
@Deprecated
@Override | 0 |
package org.apache.hc.core5.http.pool.io;
import org.apache.hc.core5.http.io.HttpClientConnection; | 1 |
package org.apache.commons.ognl.internal.entry;
import org.apache.commons.ognl.internal.CacheException; | 0 |
typeCategoriesToTypeNamesMap.put(DataTypes.TypeCategory.STRUCT, structDef.typeName); | 0 |
package org.apache.felix.bundlerepository.impl; | 0 |
import org.apache.ambari.server.state.ComponentInfo;
public class BlueprintValidatorImplTest {
@Mock(type = MockType.NICE)
private ComponentInfo dependencyComponentInfo;
expect(dependencyComponentInfo.isClient()).andReturn(true).anyTimes();
expect(stack.getComponentInfo("component3")).andReturn(dependencyComponentInfo).anyTimes();
replay(blueprint, stack, group1, group2, dependency1, dependencyComponentInfo);
expect(dependencyComponentInfo.isClient()).andReturn(true).anyTimes();
expect(stack.getComponentInfo("component-d")).andReturn(dependencyComponentInfo).anyTimes();
replay(blueprint, stack, group1, group2, dependency1, dependencyComponentInfo); | 0 |
this.getLogger().debug("Unable to load the configuraton", e); | 0 |
private Option mergeOptStartRow, mergeOptEndRow, verboseOpt, forceOpt, sizeOpt;
String tableName = OptUtil.configureTableOpt(cl, shellState);
o.addOption(OptUtil.tableOpt("table to be merged")); | 0 |
/** {@code BeamSqlExpression} for {@code =} operation. */
|| (leftValue != null
&& rightValue != null
&& leftValue.floatValue() == (rightValue).floatValue()); | 0 |
* Bridge class for the <feGaussianBlur> element.
* Constructs a new bridge for the <feGaussianBlur> element. | 0 |
* @see #getPixelUnitToMillimeter() | 0 |
* Cookie specification registry that can be used to obtain the corresponding
* cookie specification implementation for a given type of type or version of
* cookie.
public final class CookieSpecRegistry {
public final static CookieSpecRegistry DEFAULT = new CookieSpecRegistry();
public CookieSpecRegistry() { | 0 |
super.populateDisplayData(builder); | 0 |
import org.apache.accumulo.server.metrics.Metrics;
abstract class TServerMetrics extends Metrics {
protected static final String TSERVER_NAME = "TabletServer";
protected TServerMetrics(String record) {
// this capitalization thing is just to preserve the capitalization difference between the
// "general" record and the "TabletServer,sub=General" metrics name that existed in 1.9 without
// duplicating too much code; the description, however, did change between 1.9 and 2.0
super("TabletServer,sub=" + capitalize(record),
"TabletServer " + capitalize(record) + " Metrics", "tserver", record);
}
private static final String capitalize(String word) {
return word.substring(0, 1).toUpperCase() + word.substring(1);
} | 0 |
write(new MutateWork.NoResult.Quiet() {
write(initializationLogic);
super.write(new MutateWork.NoResult<CodingException>() {
public synchronized <T, E extends Exception> T write(final MutateWork<T, E> work)
return super.write(work);
return super.write(new MutateWork<T, E>() {
return super.write(new MutateWork<T, E>() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
return write(new MutateWork.Quiet<ImmutableSet<ScheduledTask>>() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() {
write(new MutateWork.NoResult.Quiet() { | 0 |
import org.apache.http.params.CoreConnectionPNames;
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 0);
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 15);
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 0);
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 15);
params.setIntParameter(CoreConnectionPNames.MAX_HEADER_COUNT, 2);
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 15);
params.setIntParameter(CoreConnectionPNames.MAX_HEADER_COUNT, 2);
params.setIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, 2); | 0 |
/*
* Copyright 2005 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.spring.samples;
import java.util.Date;
import org.apache.cocoon.core.Core;
/** Simple Bean for testing the use of a Spring container
*
* @version $Id$
*/
public class SpringTest {
protected String message;
protected Core core;
protected String version;
public SpringTest() {
this.message = "Hello World from Spring! Bean created "
+ new Date() + " (should be recreated if sitemap is touched).";
}
public String getMessage() {
return this.message;
}
public void setCore(Core core) {
this.core = core;
}
public Core getCore() {
return this.core;
}
public void setJavaVersion(String version) {
this.version = version;
}
public String getJavaVersion() {
return this.version;
}
} | 0 |
public ZooLock(String zookeepers, int timeInMillis, String scheme, byte[] auth, String path) {
this(new ZooCache(zookeepers, timeInMillis), ZooReaderWriter.getInstance(zookeepers, timeInMillis, scheme, auth), path); | 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.serializer.impl.json;
import org.osgi.dto.DTO;
public class MyDTO extends DTO {
public enum Count { ONE, TWO, THREE }
public Count count;
public String ping;
public long pong;
public MyEmbeddedDTO embedded;
}
| 0 |
private Mutator<T> writer;
writer = new Mutator<>(spec, Mapper::saveAsync, "writes");
writer.mutate(c.element());
private Mutator<T> deleter;
deleter = new Mutator<>(spec, Mapper::deleteAsync, "deletes");
deleter.mutate(c.element());
private static class Mutator<T> { | 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.hadoop.metadata.repository.EntityNotFoundException;
} catch (EntityNotFoundException e) {
LOG.error("table entity not found for {}", tableName, e);
throw new WebApplicationException(
Servlets.getErrorResponse(e, Response.Status.NOT_FOUND));
} catch (EntityNotFoundException e) {
LOG.error("table entity not found for {}", tableName, e);
throw new WebApplicationException(
Servlets.getErrorResponse(e, Response.Status.NOT_FOUND));
} catch (EntityNotFoundException e) {
LOG.error("table entity not found for {}", tableName, e);
throw new WebApplicationException(
Servlets.getErrorResponse(e, Response.Status.NOT_FOUND)); | 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 |
private boolean secureValidation;
transformSpi.secureValidation = secureValidation;
public boolean isSecureValidation() {
return secureValidation;
}
public void setSecureValidation(boolean secureValidation) {
this.secureValidation = secureValidation;
}
| 0 |
import java.util.Map;
NamedResource resourceKey, PuttyKeyReader pubReader, PuttyKeyReader prvReader, Map<String, String> headers) | 0 |
* Copyright 2004,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 CVS $Id: CleanBasketEvent.java,v 1.2 2004/03/05 13:02:11 bdelacretaz Exp $ | 1 |
if (ranges.size() > 1) {
Collections.sort(ranges);
} | 0 |
import java.util.Properties;
public void setAccumuloConfigs(Job job) throws AccumuloException, AccumuloSecurityException {
final Properties clientProps = getClientProperties();
AccumuloInputFormat.configure().clientProperties(clientProps).table(tableName).auths(auths)
.store(job);
AccumuloOutputFormat.configure().clientProperties(clientProps).defaultTable(tableName) | 0 |
import java.nio.charset.StandardCharsets;
byte correct[] = s.getBytes(StandardCharsets.UTF_8);
boolean equals = Arrays.equals(correct, a);
assertTrue(equals);
// 16bit chars against String.getBytes(StandardCharsets.UTF_8);
byte correct[] = str.getBytes(StandardCharsets.UTF_8); | 0 |
hops = 1;
} else {
hops = proxyChain.length + 1;
}
result = this.proxyChain[hop];
} else {
result = this.targetHost;
}
return true;
}
return false;
}
cab.append('c');
}
cab.append('t');
}
cab.append('l');
}
cab.append('s');
} | 0 |
List<Object[]> list = new ArrayList<>();
addTests(list, KeyPairProvider.SSH_DSS, BuiltinSignatures.dsa, DSS_SIZES, DSSPublicKeyEntryDecoder.INSTANCE);
addTests(list, KeyPairProvider.SSH_RSA, BuiltinSignatures.rsa, RSA_SIZES, RSAPublicKeyDecoder.INSTANCE);
if (SecurityUtils.hasEcc()) {
for (ECCurves curve : ECCurves.VALUES) {
BuiltinSignatures factory = BuiltinSignatures.fromFactoryName(curve.getKeyType());
addTests(list, curve.getName(), factory, Collections.singletonList(curve.getKeySize()), ECDSAPublicKeyEntryDecoder.INSTANCE);
}
return Collections.unmodifiableList(list);
}
private static void addTests(List<Object[]> list, String keyType, NamedFactory<Signature> factory, Collection<Integer> sizes, PublicKeyEntryDecoder<?, ?> decoder) {
for (Integer keySize : sizes) {
list.add(new Object[]{keyType, factory, keySize, decoder});
}
testKeyPairProvider(keyName, () -> {
try {
KeyPair kp = decoder.generateKeyPair(keySize);
outputDebugMessage("Generated key pair for %s - key size=%d", keyName, keySize);
return Collections.singletonList(kp);
} catch (Exception e) {
throw new RuntimeSshException(e); | 0 |
import org.apache.xml.security.samples.SampleUtils;
Element nscontext = SampleUtils.createDSctx(doc, "ds", | 0 |
import cz.seznam.euphoria.core.client.dataset.windowing.Windowing;
import cz.seznam.euphoria.core.client.dataset.windowing.WindowContext; | 0 |
default:
break; | 0 |
* @since 3.2
* @version $Id$ | 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
* 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 |
private Function<ClientBuilderImpl,T> builderFunction;
public ClientBuilderImpl(Function<ClientBuilderImpl,T> builderFunction) { | 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 |
* return <code>null</code> from a subsequent <code>get(Object)</code>, however
* This cannot be mandated due to backwards compatibility of this interface.
* This cannot be mandated due to backwards compatibility of this interface.
* Implementations typically return <code>null</code> from a subsequent
* Implementations typically return a collection containing the combination
* This cannot be mandated due to backwards compatibility of this interface. | 0 |
import org.apache.beam.sdk.values.RowType;
protected RowType rowType;
public BaseBeamTable(RowType rowType) {
this.rowType = rowType;
@Override public RowType getRowType() {
return rowType; | 0 |
package org.apache.beam.sdk.function; | 0 |
assertEquals("ParallelRead", createStep.getKind());
assertEquals("ParallelRead", createStep.getKind()); | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting; | 0 |
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
return obj instanceof TestHint;
}
@Override
public int hashCode() {
return 0;
}
@Override
public boolean equals(Object obj) {
return obj instanceof TestHint2;
} | 0 |
import java.util.Map;
private URL contextURL;
private Map properties;
private Map connections;
/*
* TODO It would probably be usefull to inherit context attribute from the
* surounding servlet context and also to be able to inject context
* attributes in the container
*/
path = path.substring(1);
return new URL(this.contextURL, path);
// FIXME implement NPE handling
(BlockServlet) this.connections.get(name);
/**
* @param contextURL The contextURL to set.
*/
public void setContextURL(URL contextURL) {
this.contextURL = contextURL;
}
public void setProperties(Map properties) {
/**
* @param connections the connections to set
*/
public void setConnections(Map connections) {
this.connections = connections; | 0 |
public class FormattingDecimalConvertorBuilder implements DecimalConvertorBuilder { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/locale/converters/LongLocaleConverter.java,v 1.5 2003/10/09 20:41:41 rdonkin Exp $
* $Revision: 1.5 $
* $Date: 2003/10/09 20:41:41 $
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear. | 0 |
public class OffsetRange
implements Serializable, HasDefaultTracker<OffsetRange, OffsetRangeTracker> {
public OffsetRangeTracker newTracker() {
return new OffsetRangeTracker(this);
}
@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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.collections4.iterators;
import java.util.Iterator;
/**
* Provides basic behaviour for decorating an iterator with extra functionality.
* <p>
* All methods are forwarded to the decorated iterator.
*
* @since 3.0
* @version $Id$
*/
public abstract class AbstractIteratorDecorator<E> extends AbstractUntypedIteratorDecorator<E, E> {
//-----------------------------------------------------------------------
/**
* Constructor that decorates the specified iterator.
*
* @param iterator the iterator to decorate, must not be null
* @throws IllegalArgumentException if the collection is null
*/
protected AbstractIteratorDecorator(final Iterator<E> iterator) {
super(iterator);
}
/** {@inheritDoc} */
public E next() {
return getIterator().next();
}
} | 1 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(FlaggedZooKeeperConfig.class);
help = "DEPRECATED: Uses Apache Curator as the zookeeper client; otherwise a copy of Twitter "
private static final Arg<Boolean> USE_CURATOR = Arg.create(true);
if (USE_CURATOR.hasAppliedValue()) {
LOG.warn("The -zk_use_curator flag is deprecated and will be removed in a future release.");
} | 0 |
// Ignored | 0 |
package org.apache.cocoon.spring.configurator.impl; | 0 |
import java.util.logging.Level;
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Instructing executor " + host + " to retain only tasks " + message);
} | 0 |
return this.attribHandlerMap.values().iterator(); | 0 |
* $HeadURL:https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/mockup/TestHttpClient.java $
* $Revision:575207 $
* $Date:2007-09-13 09:57:05 +0200 (Thu, 13 Sep 2007) $
if (this.thread != null) {
this.thread.join(500);
} | 0 |
this.args = (String[])aa.toArray(new String[aa.size()]); | 0 |
protected final NHttpMessageParser requestParser;
protected final NHttpMessageWriter responseWriter; | 0 |
* @version CVS $Id$
public interface LuceneXMLIndexer {
String ROLE = LuceneXMLIndexer.class.getName(); | 0 |
/**
* Safe object publishing is not required since we only care if the thread that set
* this field is equal to the thread also attempting to add a log entry.
*/
private Thread logEntryHandlerThread;
// only insert log records best effort.
if (Thread.currentThread() != logEntryHandlerThread) {
// Blocks caller till enough space exists to publish this log entry.
try {
bufferedLogEntries.put(builder.build());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
} else {
// Never blocks caller, will drop log message if buffer is full.
bufferedLogEntries.offer(builder.build());
logEntryHandlerThread = Thread.currentThread();
| 0 |
* Copyright 1999-2002,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* @version CVS $Id: EventAspect.java,v 1.2 2004/03/05 13:02:12 bdelacretaz Exp $ | 1 |
@Override | 0 |
* Parses and creates a new style-sheet.
* @param is The input source used to read the document.
* @param uri The base URI.
* @param media The target media of the style-sheet.
*/
public StyleSheet parseStyleSheet(InputSource is, URL uri, String media)
throws DOMException {
StyleSheet ss = new StyleSheet();
try {
ss.setMedia(parser.parseMedia(media));
parseStyleSheet(ss, is, uri);
} catch (Exception e) {
String m = e.getMessage();
String s =
Messages.formatMessage("syntax.error.at",
new Object[] { documentURI.toString(),
(m == null) ? "" : m });
throw new DOMException(DOMException.SYNTAX_ERR, s);
}
return ss;
}
/** | 0 |
package org.apache.accumulo.core.client.impl; | 1 |
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
private final transient PipelineOptions options = PipelineOptionsFactory.create();
private final transient StateInternals stateInternals =
new StatefulParDoEvaluatorFactory<>(mockEvaluationContext, options);
new StatefulParDoEvaluatorFactory<>(mockEvaluationContext, options); | 0 |
package org.apache.ambari.server.agent; | 0 |
import com.twitter.aurora.scheduler.base.JobKeys;
private final Map<JobKey, JobUpdateConfiguration> configs = Maps.newConcurrentMap();
private JobKey key(JobKey jobKey) {
return JobKeys.assertValid(jobKey).deepCopy();
private JobKey key(JobUpdateConfiguration config) {
return key(config.getJobKey());
configs.remove(jobKey);
return Optional.fromNullable(configs.get(key(jobKey)))
.transform(DEEP_COPY);
return config.getJobKey().getRole(); | 0 |
import java.nio.charset.StandardCharsets;
return new String(v, StandardCharsets.UTF_8); | 0 |
return CredentialHelper.createSquelchError(getSysUserName(), getSysToken(), state.getInstance().getInstanceID());
return CredentialHelper.createSquelchError(getTabUserName(), getTabToken(), state.getInstance().getInstanceID());
}
public AuthenticationToken getSysToken() {
return new PasswordToken(getSysPassword());
}
public AuthenticationToken getTabToken() {
return new PasswordToken(getTabPassword()); | 0 |
thread.setDaemon( true ); | 0 |
import org.apache.http.HttpMessage;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
* Message parser base class.
private final SessionInputBuffer sessionBuffer;
private final int maxHeaderCount;
private final int maxLineLen;
public AbstractMessageParser(
final SessionInputBuffer buffer,
final HttpParams params) {
if (buffer == null) {
throw new IllegalArgumentException("Session input buffer may not be null");
}
if (buffer == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
this.sessionBuffer = buffer;
this.maxHeaderCount = params.getIntParameter(
HttpConnectionParams.MAX_HEADER_COUNT, -1);
this.maxLineLen = params.getIntParameter(
HttpConnectionParams.MAX_LINE_LENGTH, -1);
protected abstract HttpMessage parseHead(SessionInputBuffer sessionBuffer)
throws IOException, HttpException;
public HttpMessage parse() throws IOException, HttpException {
HttpMessage message = parseHead(this.sessionBuffer);
Header[] headers = AbstractMessageParser.parseHeaders(
this.sessionBuffer,
this.maxHeaderCount,
this.maxLineLen);
message.setHeaders(headers);
return message;
} | 0 |
import static org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.LOCATION;
import org.apache.accumulo.core.metadata.schema.Ample;
import org.apache.accumulo.core.metadata.schema.AmpleImpl;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.Location;
import org.apache.accumulo.core.metadata.schema.TabletMetadata.LocationType;
public Ample getAmple() {
ensureOpen();
return new AmpleImpl(this);
}
Location loc = getAmple().readTablet(RootTable.EXTENT, LOCATION).getLocation();
log.trace("tid={} Found root tablet at {} in {}", Thread.currentThread().getId(), loc,
if (loc == null || loc.getType() != LocationType.CURRENT) {
return loc.getHostAndPort().toString(); | 0 |
assertTrue(time == 15_000L - 1 || time == 25_000L - 1); | 0 |
return prefix + mangleMethodName(key);
}
static String mangleMethodName(String id) {
char[] array = id.toCharArray();
int out = 0;
boolean changed = false;
for (int i = 0; i < array.length; i++) {
if (match("$$", array, i) || match("__", array, i)) {
array[out++] = array[i++];
changed = true;
} else if (match("$_$", array, i)) {
array[out++] = '-';
i += 2;
} else {
char c = array[i];
if (c == '_') {
array[out++] = '.';
changed = true;
} else if (c == '$') {
changed = true;
} else {
array[out++] = c;
}
}
}
if (id.length() != out || changed)
return new String(array, 0, out);
return id;
}
private static boolean match(String pattern, char[] array, int i) {
for (int j = 0; j < pattern.length(); j++, i++) {
if (i >= array.length)
return false;
if (pattern.charAt(j) != array[i])
return false;
}
return true; | 0 |
import static java.util.Objects.requireNonNull;
return new Flow(
org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow.create(name, settings)); | 0 |
* @version $Revision: 1.16 $ $Date: 2004/04/12 12:01:38 $ | 0 |
* @param handler : handler.
public ProvidedServiceHandlerDescription(Handler handler) {
super(handler);
Element service = new Element("provides", null);
StringBuffer spec = new StringBuffer("[");
spec.append(m_providedServices[i].getServiceSpecification()[j]);
spec.append(',');
spec.append(m_providedServices[i].getServiceSpecification()[j]);
spec.append(']');
service.addAttribute(new Attribute("specifications", spec.toString()));
Iterator iterator = m_providedServices[i].getProperties().keySet().iterator();
while (iterator.hasNext()) {
Element prop = new Element("property", null);
String name = (String) iterator.next();
prop.addAttribute(new Attribute("name", name));
prop.addAttribute(new Attribute("value", m_providedServices[i].getProperties().getProperty(name).toString())); | 0 |
import org.apache.commons.lang.BooleanUtils;
* @version CVS $Id: DatabaseCookieAuthenticatorAction.java,v 1.4 2004/03/28 20:51:23 antonio Exp $
if (create_session != null && BooleanUtils.toBoolean(create_session.trim())) {
if (append_session != null && BooleanUtils.toBoolean(append_session.trim())) {
if (BooleanUtils.toBoolean(nullstr)) { | 0 |
if (outputProducers.contains(this)) {
if (!parts.isEmpty() || outputProducers.size() > 1) {
Set<String> otherProducerNames = new HashSet<>();
for (Node outputProducer : outputProducers) {
if (outputProducer != this) {
otherProducerNames.add(outputProducer.getFullName());
}
throw new IllegalArgumentException(
String.format(
"Output of composite transform [%s] contains a primitive %s produced by it. "
+ "Only primitive transforms are permitted to produce primitive outputs."
+ "%n Outputs: %s"
+ "%n Other Producers: %s"
+ "%n Components: %s",
getFullName(),
POutput.class.getSimpleName(),
output.expand(),
otherProducerNames,
parts)); | 0 |
import org.apache.cocoon.components.source.SourceUtil;
* @version CVS $Id: SessionPostTransformer.java,v 1.3 2003/05/16 07:19:43 cziegeler Exp $
SourceUtil.parse(this.manager, resource, saxBuilder); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.