Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import org.apache.zookeeper.client.ZKClientConfig;
System.setProperty(ZKClientConfig.DISABLE_AUTO_WATCH_RESET, "false");
/**
* When ZooKeeper is created this property will get used.
*/
System.setProperty(ZKClientConfig.DISABLE_AUTO_WATCH_RESET, "true");
System.setProperty(ZKClientConfig.DISABLE_AUTO_WATCH_RESET, "true");
boolean disableAutoWatchReset = zk.getClientConfig().getBoolean(ZKClientConfig.DISABLE_AUTO_WATCH_RESET);
if (!isGlobal && !disableAutoWatchReset) {
if (!disableAutoWatchReset) {
if (!disableAutoWatchReset) {
if (!disableAutoWatchReset) {
if (!isGlobal && !disableAutoWatchReset) {
if (disableAutoWatchReset) {
if (!isGlobal && !disableAutoWatchReset) {
if (!disableAutoWatchReset) { | 0 |
Map<Resource.Type,String> mapIds = new HashMap<>(); | 1 |
* @version $Revision: 1.5 $ $Date: 2004/03/31 22:06:11 $
/** Singleton predicate instance */
/**
* Factory returning the singleton instance.
*
* @return the singleton instance
*/
public static Transformer getInstance() {
return INSTANCE;
}
| 0 |
//Naïve approach probably wasting lots of memory | 1 |
/* ====================================================================
* @version $Revision: 1.4 $ $Date: 2004/01/14 21:43:09 $ | 0 |
import org.apache.sshd.common.AttributeRepository;
* @see <A HREF="http://www.gsp.com/cgi-bin/man.cgi?topic=ssh_config">ssh_config</A>
* An "empty" implementation that does not resolve any entry - i.e.,
* uses the original entry as-is
public HostConfigEntry resolveEffectiveHost(
String host, int port, String username, AttributeRepository context)
throws IOException {
* @param context An optional "context" provided during the connection
* request (to be attached to the established session if successfully connected)
HostConfigEntry resolveEffectiveHost(
String host, int port, String username, AttributeRepository context)
throws IOException; | 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.beam.fn.harness.data.PTransformFunctionRegistry;
PTransformFunctionRegistry startFunctionRegistry,
PTransformFunctionRegistry finishFunctionRegistry,
// TODO make the receiver aware of its transform context as well.
startFunctionRegistry.register(pTransformId, runner::startBundle);
finishFunctionRegistry.register(pTransformId, runner::finishBundle); | 0 |
* @version CVS $Id: EP_Top.java,v 1.3 2003/09/05 07:31:40 cziegeler Exp $ | 0 |
package org.apache.commons.dbcp2; | 1 |
if (text != null) {
int idx = text.lastIndexOf('/');
text = text.substring(0, idx + 1);
return new URL(text);
} else {
return null;
}
| 0 |
* @cocoon.sitemap.component.documentation
* Matches a sitemap parameter against a wildcard expression.
* | 0 |
* Secure socket factory based on {@link javax.net.ssl JSSE}
*.
// non-javadoc, see interface org.apache.http.conn.SocketFactory
public Socket createSocket()
throws IOException {
// the cast makes sure that the factory is working as expected
return (SSLSocket) this.socketfactory.createSocket();
}
// non-javadoc, see interface org.apache.http.conn.SocketFactory
public Socket connectSocket(
final Socket sock,
int localPort,
) throws IOException {
if (host == null) {
throw new IllegalArgumentException("Target host may not be null.");
}
throw new IllegalArgumentException("Parameters may not be null.");
// resolve the target hostname first
final InetSocketAddress target = new InetSocketAddress(host, port);
SSLSocket sslock = (SSLSocket)
((sock != null) ? sock : createSocket());
if ((localAddress != null) || (localPort > 0)) {
// we need to bind explicitly
if (localPort < 0)
localPort = 0; // indicates "any"
InetSocketAddress isa =
new InetSocketAddress(localAddress, localPort);
sslock.bind(isa);
sslock.connect(target, timeout);
try {
hostnameVerifier.verify(host, sslock);
// verifyHostName() didn't blowup - good!
} catch (IOException iox) {
// close the socket before re-throwing the exception
try { sslock.close(); } catch (Exception x) { /*ignore*/ }
throw iox;
}
return sslock; | 0 |
int m_actionMask = 0;
AdminPermission(String filter, int actionMask)
}
final class AdminPermissionCollection extends PermissionCollection
{
private static final long serialVersionUID = 3747361397420496672L;
private HashMap m_map = new HashMap();
public void add(Permission permission)
{
if (!(permission instanceof AdminPermission))
{
throw new IllegalArgumentException("Invalid permission: " + permission);
}
else if (isReadOnly())
{
throw new SecurityException(
"Cannot add to read-only permission collection.");
}
AdminPermission admin = (AdminPermission) permission;
AdminPermission current = (AdminPermission) m_map.get(admin.getName());
if (current != null)
{
if (admin.m_actionMask != current.m_actionMask)
{
m_map.put(admin.getName(),
new AdminPermission(admin.getName(),
admin.m_actionMask | current.m_actionMask));
}
}
else
{
m_map.put(admin.getName(), admin);
}
}
public boolean implies(Permission permission)
{
if (!(permission instanceof AdminPermission))
{
return false;
}
for (Iterator iter = m_map.values().iterator(); iter.hasNext(); )
{
if (((AdminPermission) iter.next()).implies(permission))
{
return true;
}
}
return false;
}
public Enumeration elements()
{
return Collections.enumeration(m_map.values());
}
} | 0 |
config.getServletContext().log("ShieldingServlet: Loading servlet class " + servletName); | 0 |
public void addRequestInterceptor(
final HttpRequestInterceptor itcp, int index) {
public void addResponseInterceptor(
final HttpResponseInterceptor itcp, int index) {
public final void addInterceptor(final HttpRequestInterceptor interceptor) {
public final void addInterceptor(final HttpRequestInterceptor interceptor, int index) {
public final void addInterceptor(final HttpResponseInterceptor interceptor) {
public final void addInterceptor(final HttpResponseInterceptor interceptor, int index) { | 0 |
ActionListener, ValueChangedListener, ProcessingPhaseListener, RepeaterListener {
// -- RepeaterListener --------------------------------------
public void repeaterModified(RepeaterEvent e) {
((RepeaterListener)a).repeaterModified(e);
((RepeaterListener)b).repeaterModified(e);
}
public static RepeaterListener add(RepeaterListener a, RepeaterListener b) {
return (RepeaterListener)addInternal(a, b);
}
public static RepeaterListener remove(RepeaterListener l, RepeaterListener oldl) {
return (RepeaterListener)removeInternal(l, oldl);
}
| 0 |
static class MyUserAgentAdapter extends UserAgentAdapter implements MyUserAgent { | 0 |
import org.apache.aurora.scheduler.resources.ResourceType;
Set<ResourceType> types = ImmutableSet.<ResourceType>builder()
.addAll(left.streamResourceVectors().map(e -> e.getKey()).iterator())
.addAll(right.streamResourceVectors().map(e -> e.getKey()).iterator())
.build();
boolean allZero = true;
boolean allGreaterOrEqual = true;
boolean allLessOrEqual = true;
for (ResourceType type : types) {
int compare = left.valueOf(type).compareTo(right.valueOf(type));
if (compare != 0) {
allZero = false;
}
if (compare < 0) {
allGreaterOrEqual = false;
}
if (compare > 0) {
allLessOrEqual = false;
}
}
if (allZero) {
if (allGreaterOrEqual) {
if (allLessOrEqual) { | 0 |
import org.apache.ambari.server.controller.spi.TemporalInfo;
private static Number[][] getGangliaLikeDatapoints(TimelineMetric metric, TemporalInfo temporalInfo) {
return rpt.reportMetricData(metric, temporalInfo);
protected static Object getValue(TimelineMetric metric, TemporalInfo temporalInfo) {
Number[][] dataPoints = getGangliaLikeDatapoints(metric, temporalInfo);
if (temporalInfo != null) { | 0 |
Object[] copy = stack.clone();
System.arraycopy(values, 0, copy, 0, Math.min(copy.length, values.length));
return new Frame(copy); | 1 |
return "unsatisfied"; | 0 |
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
Thread.sleep(ConfigurationTypeHelper.getTimeInMillis(majcDelay)); | 0 |
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.MinCombiner} with
* {@link org.apache.accumulo.core.iterators.LongCombiner.Type#STRING} | 0 |
package org.apache.bcel;
import org.apache.bcel.classfile.JavaClass; | 0 |
import org.apache.hc.core5.annotation.Contract;
import org.apache.hc.core5.annotation.ThreadingBehavior;
@Contract(threading = ThreadingBehavior.IMMUTABLE) | 0 |
import org.apache.cocoon.core.CoreUtil;
final List propertyUris = new ArrayList();
propertyUris.add(src);
// sort
Collections.sort(propertyUris, CoreUtil.getSourceComparator());
// now process
final Iterator i = propertyUris.iterator();
while ( i.hasNext() ) {
final Source src = (Source)i.next();
final InputStream propsIS = src.getInputStream();
if ( this.getLogger().isDebugEnabled() ) {
this.getLogger().debug("Reading settings from '" + src.getURI() + "'.");
}
final Properties p = new Properties();
p.load(propsIS);
propsIS.close();
s.fill(p);
} | 0 |
VerifierConstraintViolatedException(final String message){
VerifierConstraintViolatedException(final String message, final Throwable initCause){ | 0 |
private final Object lock = new Object(); | 0 |
package org.apache.http.impl.nio.entity;
import org.apache.http.impl.nio.ContentInputBuffer; | 0 |
import java.nio.charset.StandardCharsets;
byte[] content = contentString.getBytes(StandardCharsets.UTF_8);
byte[] content2 = contentString2.getBytes(StandardCharsets.UTF_8);
String readContentString = new String(content, StandardCharsets.UTF_8);
String readContentString2 = new String(content2, StandardCharsets.UTF_8); | 0 |
@FunctionalInterface | 0 |
protected final ComponentContainer<S> m_container;
protected AbstractComponentManager( ComponentContainer<S> container, ComponentMethods componentMethods )
protected AbstractComponentManager( ComponentContainer<S> container, ComponentMethods componentMethods, boolean factoryInstance )
m_componentMethods = componentMethods;
public abstract void reconfigure(Map<String, Object> configuration, boolean configurationDeleted);
public abstract void getComponentManagers(List<AbstractComponentManager<S>> cms); | 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.osgi.framework.util;
import java.util.EventListener;
import org.osgi.framework.Bundle;
public class ListenerWrapper
{
// The bundle associated with the listener.
private Bundle m_bundle = null;
// Listener class.
private Class m_class = null;
// The original listener.
private EventListener m_listener = null;
public ListenerWrapper(Bundle bundle, Class clazz, EventListener l)
{
m_bundle = bundle;
m_class = clazz;
m_listener = l;
}
public Bundle getBundle()
{
return m_bundle;
}
protected Class getListenerClass()
{
return m_class;
}
protected EventListener getListener()
{
return m_listener;
}
public boolean equals(Object obj)
{
if (obj instanceof ListenerWrapper)
{
return (((ListenerWrapper) obj).m_listener == m_listener);
}
else if (obj instanceof EventListener)
{
return (obj == m_listener);
}
return false;
}
} | 1 |
String[] sa = fileStatus.getPath().getName().split("\\."); | 0 |
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public static class Validation {
public static enum TYPE {
ERROR, WARN
}
public String message;
public String type;
public Validation(String message, String type) {
this.message = message;
this.type = type;
}
public Validation(String message) {
this.message = message;
this.type = TYPE.ERROR.name();
}
}
private Map<String, String> parameters = new HashMap<String, String>();
private List<Validation> validations = new ArrayList<ViewStatus.Validation>();
public Map<String, String> getParameters() {
return parameters;
}
public void setParameters(Map<String, String> parameters) {
this.parameters = parameters;
}
public List<Validation> getValidations() {
return validations;
}
public void setValidations(List<Validation> validations) {
this.validations = validations;
} | 0 |
import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
clazz = AccumuloVFSClassLoader.loadClass(classname, Aggregator.class); | 0 |
@Override
@Override
@Override
@Override | 0 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* 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.xml.security.utils.resolver;
import org.w3c.dom.Attr;
public class ResourceResolverContext {
public ResourceResolverContext(Attr attr, String baseUri, boolean secureValidation) {
this.attr = attr;
this.baseUri = baseUri;
this.secureValidation = secureValidation;
this.uriToResolve = attr != null ? attr.getValue() : null;
}
public final String uriToResolve;
public final boolean secureValidation;
public final String baseUri;
public final Attr attr;
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java,v 1.2 2003/11/16 22:15:11 scolebourne Exp $
* @version $Revision: 1.2 $ $Date: 2003/11/16 22:15:11 $ | 0 |
throws ParseException; | 0 |
public PublicKey engineLookupAndResolvePublicKey(
public X509Certificate engineLookupResolveX509Certificate(
public javax.crypto.SecretKey engineLookupAndResolveSecretKey( | 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 |
//Exposing KMS configuration for Ambari Files View Instance with a "Local" cluster configuration
if(context.getCluster() != null) {
String encryptionKeyProviderUri = getEncryptionKeyProviderUri();
if(encryptionKeyProviderUri != null) {
conf.set("dfs.encryption.key.provider.uri", encryptionKeyProviderUri);
}
}
}
protected String getEncryptionKeyProviderUri() {
//If KMS is configured, this value will not be empty
String encryptionKeyProviderUri = context.getCluster().getConfigurationValue("hdfs-site", "dfs.encryption.key.provider.uri");
return encryptionKeyProviderUri; | 0 |
UUID uuid = null;
try {
uuid = UUID.fromString(scanner);
} catch (IllegalArgumentException e) {
throw new UnknownScanner(e.getMessage());
}
if (scannerCache.asMap().remove(uuid) == null) {
throw new UnknownScanner("Scanner never existed or no longer exists");
}
} catch (UnknownScanner e) {
throw e;
private void addCellsToWriter(Map<ByteBuffer,List<ColumnUpdate>> cells, BatchWriterPlusException bwpe) {
} catch (UnknownWriter e) {
// just drop it, this is a oneway thrift call and throwing a TException seems to make all subsequent thrift calls fail | 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 |
public PriorityBufferTest(final String testName) {
final PriorityBuffer<E> heap = getCollection();
final E[] tree = heap.elements;
final E parent = tree[i];
final ArrayList<E> list = new ArrayList<E>();
final Buffer<E> buffer = getCollection();
} catch (final BufferUnderflowException ex) {}
} catch (final BufferUnderflowException ex) {}
final PriorityBuffer<E> heap = new PriorityBuffer<E>();
} catch (final BufferUnderflowException ex) {}
} catch (final BufferUnderflowException ex) {}
final PriorityBuffer<E> heap = new PriorityBuffer<E>(new ReverseComparator<E>((Comparator<E>) ComparableComparator.INSTANCE));
} catch (final BufferUnderflowException ex) {}
} catch (final BufferUnderflowException ex) {}
} catch (final BufferUnderflowException ex) {}
} catch (final BufferUnderflowException ex) {}
final PriorityBuffer heap = getCollection();
final int iterations = 500;
final int heapSize = 100;
final int operations = 20;
final Random randGenerator = new Random();
protected void checkOrder(final PriorityBuffer<?> h) {
protected String showTree(final PriorityBuffer<?> h) {
final StringBuilder buffer = new StringBuilder();
final int iterations = 500;
final int heapSize = 100;
final Random randGenerator = new Random();
final PriorityBuffer<?> h1 = serializeAndRestore(h);
final Iterator<?> hit = h.iterator();
final Integer n = (Integer) hit.next();
public PriorityBuffer<?> serializeAndRestore(final PriorityBuffer<E> h) {
final byte[] objekt = writeExternalFormToBytes(h);
} catch (final IOException e) {
} catch (final ClassNotFoundException e) { | 0 |
import com.google.cloud.dataflow.sdk.values.TimestampedValue;
tester.injectElements(TimestampedValue.of(element, new Instant(element))); | 0 |
import com.google.cloud.dataflow.sdk.Pipeline;
import com.google.cloud.dataflow.sdk.PipelineResult;
import com.google.cloud.dataflow.sdk.runners.DataflowPipelineRunner;
import com.google.cloud.dataflow.sdk.runners.PipelineRunner;
public void testSettingRunnerFullName() {
String[] args =
new String[] {String.format("--runner=%s", DataflowPipelineRunner.class.getName())};
PipelineOptions opts = PipelineOptionsFactory.fromArgs(args).create();
assertEquals(opts.getRunner(), DataflowPipelineRunner.class);
}
@Test
private static class ExampleTestRunner extends PipelineRunner<PipelineResult> {
@Override
public PipelineResult run(Pipeline pipeline) {
return null;
}
}
@Test
public void testSettingRunnerCanonicalClassNameNotInSupportedExists() {
String[] args = new String[] {String.format("--runner=%s", ExampleTestRunner.class.getName())};
PipelineOptions opts = PipelineOptionsFactory.fromArgs(args).create();
assertEquals(opts.getRunner(), ExampleTestRunner.class);
}
@Test
public void testSettingRunnerCanonicalClassNameNotInSupportedNotPipelineRunner() {
String[] args = new String[] {"--runner=java.lang.String"};
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("does not implement PipelineRunner");
expectedException.expectMessage("java.lang.String");
PipelineOptionsFactory.fromArgs(args).create();
}
| 0 |
* @version CVS $Id: ValueJXPathBinding.java,v 1.13 2004/02/29 06:07:37 vgritsenko Exp $
Object value = jxpc.getValue(this.xpath);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Done loading " + toString() + " -- value= " + value);
} | 0 |
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
installProperties.put(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "INSTALLED");
startProperties.put(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID, "STARTED");
(String) properties.get(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID));
serviceComponentHostRequest.setState((String) properties.get(HOST_COMPONENT_STATE_PROPERTY_ID));
serviceComponentHostRequest.setDesiredStackId((String) properties.get(HOST_COMPONENT_STACK_ID_PROPERTY_ID)); | 0 |
* @version $Id$
* @param <E> the type that the closure acts on
* @param <E> the type that the closure acts on
public static <E> Closure<E> ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure) { | 0 |
new String[] {"http://" + ES_IP + ":" + esHttpPort}, getEsIndex(), ES_TYPE)
.withSocketAndRetryTimeout(90000)
.withConnectTimeout(5000); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.felix.ipojo.runtime.core.services.A123;
public interface CheckService2 {
public boolean check();
} | 0 |
/*
* Copyright 2000-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 |
import org.junit.Ignore;
@Ignore("known as broken after interception inception in service dependencies") | 0 |
* new DoFn<KV<K, CoGbkResult>, T>() }{
* {@code @ProcessElement
* }}));
* </pre> | 0 |
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency, final int resultSetHoldability,
final StatementType statementType) {
protected PStmtKey createKey(final String sql, final int resultSetType, final int resultSetConcurrency,
final StatementType statementType) {
} catch (final SQLException e) {
CallableStatement prepareCall(final String sql) throws SQLException {
CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency) throws SQLException {
CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency,
final int resultSetHoldability) throws SQLException { | 0 |
/*
import java.util.TreeMap;
* Set the properties of the configuration data represented by this KerberosConfigurationDescriptor
*
* @param properties a Map of properties
*/
public void setProperties(Map<String, String> properties) {
if (properties == null) {
this.properties = null;
} else {
this.properties = new TreeMap<String, String>(properties);
}
}
/**
properties = new TreeMap<String, String>();
Map<String, Object> map = new TreeMap<String, Object>();
map.put(getName(), (properties == null) ? null : new TreeMap<String, Object>(properties)); | 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 |
* 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 |
package org.apache.commons.ognl.internal.entry;
import org.apache.commons.ognl.internal.CacheException;
import org.apache.commons.ognl.internal.entry.ClassCacheEntryFactory;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
/**
* User: Maurizio Cucchiara
* Date: 10/15/11
* Time: 9:47 AM
*/
public class FiedlCacheCacheEntryFactory
implements ClassCacheEntryFactory<Map<String, Field>>
{
public Map<String, Field> create( Class<?> key )
throws CacheException
{
Field[] declaredFields = key.getDeclaredFields( );
HashMap<String, Field> result = new HashMap<String, Field>( declaredFields.length );
for ( Field field : declaredFields )
{
result.put( field.getName( ), field );
}
return result;
}
}
| 0 |
import org.apache.beam.sdk.transforms.Sum.SumLongFn;
public void handleResultCommitsAggregators() {
Class<?> fn = getClass();
DirectExecutionContext fooContext =
context.getExecutionContext(created.getProducingTransformInternal(), null);
DirectExecutionContext.StepContext stepContext = fooContext.createStepContext(
"STEP", created.getProducingTransformInternal().getTransform().getName());
AggregatorContainer container = context.getAggregatorContainer();
AggregatorContainer.Mutator mutator = container.createMutator();
mutator.createAggregatorForDoFn(fn, stepContext, "foo", new SumLongFn()).addValue(4L);
.withAggregatorChanges(mutator)
assertThat((Long) context.getAggregatorContainer().getAggregate("STEP", "foo"), equalTo(4L));
AggregatorContainer.Mutator mutatorAgain = container.createMutator();
mutatorAgain.createAggregatorForDoFn(fn, stepContext, "foo", new SumLongFn()).addValue(12L);
.withAggregatorChanges(mutatorAgain)
assertThat((Long) context.getAggregatorContainer().getAggregate("STEP", "foo"), equalTo(16L)); | 0 |
private boolean watch;
private Exception caught;
private boolean killedProcess;
this.killedProcess = false;
this.watch = false;
this.watchdog = new Watchdog(timeout);
this.watchdog.addTimeoutObserver(this);
* Destroys the running process manually.
*/
public synchronized void destroy() {
this.timeoutOccured(new Watchdog(1));
this.stop();
}
/**
public synchronized void timeoutOccured(final Watchdog w) {
if(process != null) {
process.exitValue();
}
// a timeout and not a manual stop then destroy it.
public synchronized void checkException() throws Exception {
public synchronized boolean isWatching() {
* Indicates whether the last process run was killed.
* @return <tt>true</tt> if the process was killed
public synchronized boolean killedProcess() {
/**
* reset the monitor flag and the process.
*/
protected void cleanUp() {
watch = false;
process = null;
} | 0 |
import org.apache.beam.sdk.annotations.Experimental;
import org.joda.time.Instant; | 0 |
import static org.apache.commons.beanutils.MethodUtils.getAccessibleMethod;
import org.apache.commons.logging.Log;
Method rulesMethod = getAccessibleMethod( rulesClass, methodName, paramSpec ); | 0 |
* @version CVS $Id: RepeaterJXPathBinding.java,v 1.17 2004/01/27 20:58:52 vgritsenko Exp $
int initialSize = repeater.getSize();
Repeater.RepeaterRow thisRow;
if (initialSize > 0) {
thisRow = repeater.getRow(--initialSize);
} else {
thisRow = repeater.addRow();
} | 0 |
Property property(); | 0 |
import java.util.Arrays;
@Test
public void testArrays() throws Exception
{
Context c = new Context();
c.addCommand("echo", this);
c.addCommand("tac", this);
c.addCommand("cat", this);
c.execute("a = [ 1 2 3 ]");
c.execute("b = [ a b c ]");
c.execute("c = [ ${a[@]} ${b[@]} ]");
assertEquals(Arrays.asList(1L, 2L, 3L), c.get("a"));
assertEquals(Arrays.asList("a", "b", "c"), c.get("b"));
assertEquals(Arrays.asList(1L, 2L, 3L, "a", "b", "c"), c.get("c"));
c.execute("d = [ \"foo\" ${b[@]} ]");
assertEquals(Arrays.asList("foo", "a", "b", "c"), c.get("d"));
c.execute("d = [ \"foo\" $b ]");
assertEquals(Arrays.asList("foo", Arrays.asList("a", "b", "c")), c.get("d"));
}
| 0 |
REST_API_ENABLE_DELETE_TYPE_OVERRIDE("atlas.rest.enable.delete.type.override", false),
| 0 |
Algorithm algorithm = getAlgorithm(algorithmURI);
Algorithm algorithm = getAlgorithm(algorithmURI);
Algorithm algorithm = getAlgorithm(algorithmURI);
Algorithm algorithm = getAlgorithm(algorithmURI);
if (algorithm != null) {
Algorithm algorithm = getAlgorithm(algorithmURI);
private static Algorithm getAlgorithm(String algorithmURI) {
if (algorithmURI != null) {
return algorithmsMap.get(algorithmURI);
return null;
} | 0 |
public final class C14nHelper { | 0 |
package org.apache.accumulo.examples.simple.combiner; | 0 |
package org.apache.accumulo.server.test.randomwalk.concurrent;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Random;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.server.test.randomwalk.State;
import org.apache.accumulo.server.test.randomwalk.Test;
public class CloneTable extends Test {
@Override
public void visit(State state, Properties props) throws Exception {
Connector conn = state.getConnector();
Random rand = (Random) state.get("rand");
@SuppressWarnings("unchecked")
List<String> tableNames = (List<String>) state.get("tables");
String srcTableName = tableNames.get(rand.nextInt(tableNames.size()));
String newTableName = tableNames.get(rand.nextInt(tableNames.size()));
boolean flush = rand.nextBoolean();
try {
conn.tableOperations().clone(srcTableName, newTableName, flush, new HashMap<String, String>(), new HashSet<String>());
log.debug("Cloned table "+srcTableName+" "+newTableName+" "+flush);
} catch (TableExistsException e) {
log.debug("Clone "+srcTableName+" failed, "+newTableName+" exist");
}catch (TableNotFoundException e) {
log.debug("Clone "+srcTableName+" failed, doesnt exist");
}
}
}
| 1 |
private transient StageBundleFactory<InputT> stageBundleFactory; | 0 |
JSONArray rows = results.getJSONArray(MetadataServiceClient.ROWS);
int numRows = response.getInt(MetadataServiceClient.COUNT);
Assert.assertEquals(numRows, 1);
int numRows = response.getInt(MetadataServiceClient.COUNT);
Assert.assertEquals(numRows, 1); | 0 |
public void setStringProperty(final String stringProperty) {
public FluentIntrospectionTestBean setFluentProperty(final String value) {
final String fluentGetProperty) { | 0 |
LOG.error("Unexpected exception causing exit", e);
LOG.info("FollowerRequestProcessor exited loop!"); | 0 |
*
public RowBufferingIterator(Scanner scanner, ScannerOptions opts, Range range, long timeout, int batchSize, long readaheadThreshold,
RowBufferFactory bufferFactory) {
| 0 |
log.info("Granted namespace permission {} for user {} on the namespace {} at the request of user {}", permission, user, namespace, c.getPrincipal());
log.info("Revoked namespace permission {} for user {} on the namespace {} at the request of user {}", permission, user, namespace, c.getPrincipal()); | 0 |
prerequisiteCheck.setFailReason(formatEntityList(prerequisiteCheck.getFailedOn()) + " must have repository version " + request.getRepositoryVersion() + " installed"); | 0 |
* <fb:javascript id="foo" path="@foo">
* <fb:load-form>
* </fb:load-form>
* <fb:save-form>
* </fb:save-form>
* </fb:javascript>
* This example is rather trivial and could be replaced by a simple <fb:value>, but
* <li>The <fb:save-form> snippet should be ommitted if the "direction" attribute is set to "load".</li>
* <li>The <fb:load-form> snippet should be ommitted if the "direction" attribute is set to "save".</li>
* @version CVS $Id: JavaScriptJXPathBindingBuilder.java,v 1.2 2004/03/24 01:32:45 joerg Exp $ | 0 |
import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
Factory fact = Utils.getFactoryByName(context, "CONFIG-BothConfigurableCheckService"); | 0 |
/* $Id: RulesBaseTestCase.java,v 1.12 2004/05/07 01:29:59 skitching Exp $
*
* @version $Revision: 1.12 $ $Date: 2004/05/07 01:29:59 $ | 0 |
* @throws IllegalArgumentException if the buffer is not large enough to hold a complete character
// Ensure that buffer is long enough to hold a complete character
final float maxBytesPerChar = encoder.maxBytesPerChar();
if (bufferSize < maxBytesPerChar) {
throw new IllegalArgumentException("Buffer size " + bufferSize + " is less than maxBytesPerChar " + maxBytesPerChar);
}
* @throws IllegalArgumentException if the buffer is not large enough to hold a complete character
* @throws IllegalArgumentException if the buffer is not large enough to hold a complete character
* @throws IllegalArgumentException if the buffer is not large enough to hold a complete character | 0 |
throw new ResourceIOException("Resouce already dispoased"); | 0 |
import java.net.URI;
@Test
public void testGetRequestByName() throws Exception {
final HttpHost target = start();
final String baseURL = "http://localhost:" + target.getPort();
final String message = Request.create("GET", baseURL + "/").execute().returnContent().asString();
Assert.assertEquals("All is well", message);
}
@Test
public void testGetRequestByNameWithURI() throws Exception {
final HttpHost target = start();
final String baseURL = "http://localhost:" + target.getPort();
final String message = Request.create("GET", new URI(baseURL + "/")).execute().returnContent().asString();
Assert.assertEquals("All is well", message);
}
| 0 |
import org.apache.beam.runners.core.SideInputReader; | 0 |
HttpContext context = new BasicHttpContext();
HttpContext context = new BasicHttpContext();
HttpContext context = new BasicHttpContext(); | 0 |
throw new IOException(e.getMessage());
throw new IOException(e.getMessage()); | 0 |
* Contrast this with {@link #transformedMap(Map, Transformer, Transformer)}.
public static <K, V> IterableMap<K, V> transformingMap(Map<K, V> map,
* Contrast this with {@link #transformingMap(Map, Transformer, Transformer)}.
public static <K, V> Map<K, V> transformedMap(Map<K, V> map, | 0 |
try (JarFile jar = new JarFile(file)) {
Enumeration<JarEntry> en = jar.entries();
while (en.hasMoreElements()) {
JarEntry e = en.nextElement();
final String name = e.getName();
if (name.endsWith(".class")) {
// System.out.println("- " + name);
try (InputStream in = jar.getInputStream(e)) {
ClassParser parser = new ClassParser(in, name);
JavaClass jc = parser.parse();
for (Method m : jc.getMethods()) {
compare(name, m);
}
} | 0 |
* to the user, or the user will be given the opportunity to download the heap file. | 0 |
import org.apache.hc.core5.annotation.Contract;
import org.apache.hc.core5.annotation.ThreadingBehavior;
@Contract(threading = ThreadingBehavior.SAFE) | 0 |
private static final WeakFastHashMap cache = new WeakFastHashMap();
static {
cache.setFast(true);
}
| 0 |
public void writeTo(final OutputStream outStream) throws IOException {
original.writeTo(outStream); | 0 |
* @see #ExecuteWatchdog(long)
* @deprecated Use constructor with a long type instead. (1.4.x
* compatibility)
*/
public ExecuteWatchdog(final int timeout) {
this((long) timeout);
}
/** | 0 |
parentTransformer = XMLSecurityUtils.getTransformer(parentTransformer, inclusiveNamespaces, algorithm, XMLSecurityConstants.DIRECTION.IN);
XMLSecurityUtils.getTransformer(inclusiveNamespaces, outputStream, algorithm, XMLSecurityConstants.DIRECTION.IN);
getTransformer().doFinal(); | 0 |
import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.BufferUtils;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
Buffer buffer = new ByteArrayBuffer(); | 0 |
public HttpResponse execute(final HttpHost targetHost, final HttpRequest request,
HttpHost target = targetHost;
final String s;
* @param targetHost the target host for the request.
protected HttpRoute determineRoute(final HttpHost targetHost,
return this.routePlanner.determineRoute(
targetHost != null ? targetHost : (HttpHost) request.getParams()
.getParameter(ClientPNames.DEFAULT_HOST),
request, context); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.