Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
* @author <a href="mailto:[email protected]">Vincent Hardy</a> | 0 |
private final transient PCollection<?> pCollection;
PCollection<?> pCollection,
this.pCollection = pCollection;
return pCollection; | 0 |
import com.google.cloud.dataflow.sdk.coders.CoderException;
import java.io.EOFException;
return true;
try {
inputWrapper.setInputView(dataInputView);
return coder.decode(inputWrapper, Coder.Context.NESTED);
} catch (CoderException e) {
Throwable cause = e.getCause();
if (cause instanceof EOFException) {
throw (EOFException) cause;
} else {
throw e;
}
} | 0 |
/* ====================================================================
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.3 $ $Date: 2004/01/14 21:43:16 $ | 0 |
public static void dropInstanceCache(String instanceName){ | 0 |
* @author <A HREF="mailto:[email protected]">M. Dahm</A> | 0 |
SignatureFactoriesManager.resolveSignatureFactories(this, session), | 0 |
import org.apache.accumulo.core.security.Authorizations;
BatchDeleter ibd = state.getConnector().createBatchDeleter(indexTableName, Authorizations.EMPTY, 8, bwc);
BatchDeleter dbd = state.getConnector().createBatchDeleter(dataTableName, Authorizations.EMPTY, 8, bwc); | 0 |
* @return number of bytes read
* @return number of bytes read
* @return number of bytes read
* @return number of bytes read
* @param input the input stream containing the data to be sent
* @param input the input stream containing the data to be sent
* @param input the input stream containing the data to be sent
* @param input the input stream containing the data to be sent | 0 |
this(tabletServer, new Text(info.getDir()), extent, trm, info.getDatafiles(), info.getTime(), info.getInitFlushID(), info.getInitCompactID(), info.getLastLocation());
public void minorCompactionStarted() { | 1 |
*
*
*
*
*
*
| 0 |
AccumuloInputFormat.setClientInfo(job, getClientInfo()); | 0 |
} catch (final IOException | RuntimeException ex) {
} catch (final IOException | RuntimeException ex) {
} catch (final IOException | RuntimeException ex) { | 0 |
import java.util.Map;
import org.apache.accumulo.core.client.ScannerBase;
/**
* @return Hints set by a scanner using {@link ScannerBase#setExecutionHints(Map)}
*/
Map<String,String> getExecutionHints(); | 0 |
public class NIOProtocolSocketFactory implements ProtocolSocketFactory {
private static final NIOProtocolSocketFactory factory = new NIOProtocolSocketFactory();
public static NIOProtocolSocketFactory getSocketFactory() {
private NIOProtocolSocketFactory() {
return ((obj != null) && obj.getClass().equals(NIOProtocolSocketFactory.class));
return NIOProtocolSocketFactory.class.hashCode(); | 0 |
conn.setAutoCommit(true);
conn.setAutoCommit(false); | 0 |
/*
* Copyright 2000-2009 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.bcel.verifier.statics;
import org.apache.bcel.Constants;
import org.apache.bcel.generic.Type;
/**
* This class represents the upper half of a DOUBLE variable.
* @version $Id$
* @author Enver Haase
*/
public final class DOUBLE_Upper extends Type{
/** The one and only instance of this class. */
private static DOUBLE_Upper singleInstance = new DOUBLE_Upper();
/** The constructor; this class must not be instantiated from the outside. */
private DOUBLE_Upper(){
super(Constants.T_UNKNOWN, "Long_Upper");
}
/** Use this method to get the single instance of this class. */
public static DOUBLE_Upper theInstance(){
return singleInstance;
}
} | 0 |
import org.apache.beam.sdk.coders.StringUtf8Coder;
.put(StringUtf8Coder.class, ModelCoders.STRING_UTF8_CODER_URN)
.put(StringUtf8Coder.class, CoderTranslators.atomic(StringUtf8Coder.class)) | 0 |
*
*
*
*
*
*
*
* | 0 |
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.beam.sdk.coders.Coder;
Map<TupleTag<?>, Coder<?>> outputCoders = context.getOutputs().entrySet().stream()
.filter(e -> e.getValue() instanceof PCollection)
.collect(Collectors.toMap(
t -> (TupleTag<?>) t,
v -> ((PCollection<?>) v).getCoder()));
outputCoders,
Map<TupleTag<?>, Coder<?>> outputCoders = context.getOutputs().entrySet().stream()
.filter(e -> e.getValue() instanceof PCollection)
.collect(Collectors.toMap(
t -> (TupleTag<?>) t,
v -> ((PCollection<?>) v).getCoder()));
outputCoders, | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists; | 0 |
/** */ | 0 |
package org.apache.http.auth; | 0 |
public abstract InputStream getBody() 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 SF 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.hc.core.impl.servlet;
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
@ObjectClassDefinition(name = "Apache Felix Health Check Executor Servlet", description = "Serializes health check results into html, json or txt format")
@interface HealthCheckExecutorServletConfiguration {
String SERVLET_PATH_DEFAULT = "/system/health";
@AttributeDefinition(name = "Disabled", description = "Allows to disable the servlet if required for security reasons")
boolean disabled() default false;
@AttributeDefinition(name = "Path", description = "Servlet path (defaults to " + SERVLET_PATH_DEFAULT
+ " in order to not be accessible via Apache/Internet)")
String servletPath() default SERVLET_PATH_DEFAULT;
@AttributeDefinition(name = "CORS Access-Control-Allow-Origin", description = "Sets the Access-Control-Allow-Origin CORS header. If blank no header is sent.")
String cors_accessControlAllowOrigin() default "*";
} | 0 |
public AccumuloClient getClient() throws AccumuloException, AccumuloSecurityException { | 0 |
import org.apache.sshd.common.future.CloseFuture;
import org.apache.sshd.common.util.CloseableUtils;
public CloseFuture close(boolean immediately) {
IoAcceptor a;
synchronized (this) {
a = acceptor;
acceptor = null;
}
if (a != null) {
return a.close(immediately);
} else {
return CloseableUtils.closed();
}
}
| 0 |
* @param context the rendering context.
public void paint(TextNode node, Graphics2D g2d,
GraphicsNodeRenderContext context) {
AttributedCharacterIterator aci = node.getAttributedCharacterIterator();
Point2D location = node.getLocation();
TextNode.Anchor anchor = node.getAnchor();
paintUnderline(textRun, location, x, g2d);
paintOverline(textRun, location, x, g2d);
paintStrikethrough(textRun, location, x, g2d);
double xoffset, Graphics2D g2d) {
getOverlineShape(runaci, layout,
new Point2D.Double(location.getX()+xoffset, location.getY()));
double xoffset, Graphics2D g2d) {
getUnderlineShape(runaci, layout,
new Point2D.Double(location.getX()+xoffset, location.getY()));
double xoffset, Graphics2D g2d) {
getStrikethroughShape(runaci, layout,
new Point2D.Double(location.getX()+xoffset, location.getY()));
| 0 |
verifyUsingDOM(document, cert, secureParts, resourceResolverSpi, true, "Id");
boolean keyInfoRequired,
String idAttributeNS
signedElement.setIdAttributeNS(null, idAttributeNS, true); | 0 |
import junit.framework.TestCase;
import org.apache.felix.ipojo.manipulator.util.Streams;
import org.objectweb.asm.*;
import org.osgi.framework.BundleContext;
when(mv.visitAnnotation(desc, true)).thenReturn(new AnnotationVisitor(Opcodes.ASM5) {}); | 0 |
private RefPair getBoundService( ServiceReference serviceReference )
return ( RefPair ) (( Map ) dependencyMap.get( this )).get(serviceReference);
RefPair refPair = getBoundService( serviceReference );
refPair = new RefPair( serviceReference, serviceObject );
RefPair refPair = ( RefPair ) ((Map ) dependencyMap.get( this )).get( serviceReference );
RefPair refPair = m_bindMethods.getBind().getServiceObject( refs[index], m_componentManager.getActivator().getBundleContext() );
RefPair refPair = m_bindMethods.getBind().getServiceObject( ref, m_componentManager.getActivator().getBundleContext() );
if ( invokeBindMethod( componentInstance, ( RefPair ) entry.getValue() ) )
RefPair refPair = m_bindMethods.getBind().getServiceObject( ref, bundleContext );
private boolean invokeBindMethod( Object componentInstance, RefPair refPair )
RefPair refPair = ( RefPair ) ((Map )m_componentManager.getDependencyMap().get( this )).get( ref );
RefPair refPair = ( RefPair ) ((Map )m_componentManager.getDependencyMap().get( this )).get( ref ); | 0 |
import java.io.IOException;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
runTest(getConnector(), getTableNames(1)[0]);
}
static void runTest(Connector c, String tableName) throws AccumuloException, AccumuloSecurityException, TableExistsException, IOException, TableNotFoundException,
MutationsRejectedException { | 0 |
* The {@link BoundedFifoBuffer} is a very efficient implementation of a
* {@link Buffer} with a fixed size.
* The removal order of a {@link BoundedFifoBuffer} is based on the
* @version $Id$ | 0 |
buffer.append(this.protocol.getScheme());
buffer.append("://");
return toURI();
hash = LangUtils.hashCode(hash, this.hostname.toUpperCase()); | 0 |
import org.apache.http.annotation.ThreadSafe;
@ThreadSafe | 0 |
Iterator<WeightedValue<T>> sorted =
Iterators.mergeSorted(iterators, (a, b) -> compareFn.compare(a.getValue(), b.getValue())); | 0 |
org.apache.commons.logging.LogFactory.getLog(RSAKeyValueResolver.class); | 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.
*/
public interface Authenticator {
public void initializeSecurity(AuthInfo credentials, String rootuser, byte[] rootpass) throws AccumuloSecurityException;
public String getRootUsername();
public boolean authenticateUser(AuthInfo credentials, String user, ByteBuffer pass) throws AccumuloSecurityException;
public Set<String> listUsers(AuthInfo credentials) throws AccumuloSecurityException;
public void createUser(AuthInfo credentials, String user, byte[] pass, Authorizations authorizations) throws AccumuloSecurityException;
public void dropUser(AuthInfo credentials, String user) throws AccumuloSecurityException;
public void changePassword(AuthInfo credentials, String user, byte[] pass) throws AccumuloSecurityException;
public void changeAuthorizations(AuthInfo credentials, String user, Authorizations authorizations) throws AccumuloSecurityException;
public void deleteTable(AuthInfo credentials, String table) throws AccumuloSecurityException; | 0 |
* @author William Farner | 0 |
return new WindowMappingFn<BoundedWindow>(Duration.millis(Long.MAX_VALUE)) { | 0 |
public static ITaskConfig getConfig(IScheduledTask scheduledTask) {
return scheduledTask.getAssignedTask().getTask();
}
public static int getInstanceId(IScheduledTask scheduledTask) {
return scheduledTask.getAssignedTask().getInstanceId();
}
public static IJobKey getJob(IAssignedTask assignedTask) {
return assignedTask.getTask().getJob();
}
public static IJobKey getJob(IScheduledTask scheduledTask) {
return getJob(scheduledTask.getAssignedTask());
}
public static String scheduledToSlaveHost(IScheduledTask scheduledTask) {
return scheduledTask.getAssignedTask().getSlaveHost();
}
return Multimaps.index(tasks, Tasks::getJob);
return ImmutableSet.copyOf(Iterables.transform(tasks, Tasks::id));
return Maps.uniqueIndex(tasks, Tasks::id);
.onResultOf(IScheduledTask::getStatus) | 0 |
return new CreateHandler();
case PUT: | 1 |
import static org.junit.Assert.assertEquals;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;
import org.apache.ambari.server.api.resources.ResourceInstance;
import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
import org.apache.ambari.server.api.services.serializers.ResultSerializer; | 0 |
* Copyright 2002-2005 The Apache Software Foundation. | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/DoubleOrderedMap.java,v 1.9 2003/12/06 13:03:15 scolebourne Exp $
* @version $Revision: 1.9 $ $Date: 2003/12/06 13:03:15 $
private static final class Node implements Map.Entry, KeyValue { | 0 |
private final List<Collection<Bundle>> m_requests = new ArrayList();
private final List<FrameworkListener[]> m_requestListeners
= new ArrayList<FrameworkListener[]>();
void stop()
synchronized (m_requests)
if (m_thread != null)
{
// Null thread variable to signal to the thread that
// we want it to exit.
m_thread = null;
// Wake up the thread, if it is currently in the wait() state
// for more work.
m_requests.notifyAll();
}
synchronized (m_requests)
// Queue request and notify thread.
m_requests.add(bundles);
m_requestListeners.add(listeners);
m_requests.notifyAll();
synchronized (m_requests)
while (m_requests.isEmpty())
m_requests.wait();
synchronized (m_requests) | 0 |
Copyright 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.
*/ | 0 |
import org.apache.beam.model.fnexecution.v1.BeamFnApi; | 0 |
import org.apache.commons.vfs.FileName;
import org.apache.commons.vfs.FileType;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileNotFoundException;
import org.apache.commons.vfs.RandomAccessContent;
import org.apache.commons.vfs.FileContentInfoFactory; | 0 |
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
/**
* Socket reuse address.
* See {@link java.net.StandardSocketOptions#SO_REUSEADDR}
*/
boolean DEFAULT_REUSE_ADDRESS = true; | 1 |
public int compare(final E obj1, final E obj2) {
public boolean equals(final Object object) { | 0 |
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
/**
* This method creates {@link org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv} using empty
* Pipeline Options. It should only be used in tests.
*/
/**
* This method creates {@link org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv} using empty
* Pipeline Options. It should only be used in tests.
*/
return builder(tableProvider).setPipelineOptions(PipelineOptionsFactory.create()).build();
/**
* This method creates {@link org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv} using empty *
* Pipeline Options. It should only be used in tests.
*/
private PipelineOptions pipelineOptions;
pipelineOptions = null;
public BeamSqlEnvBuilder setPipelineOptions(PipelineOptions pipelineOptions) {
this.pipelineOptions = pipelineOptions;
return this;
}
checkNotNull(pipelineOptions);
JdbcConnection jdbcConnection = JdbcDriver.connect(defaultTableProvider, pipelineOptions); | 0 |
* @param columnInfo
* the column object to get name and type of column (not {@code null}).
public void setNullable(String tableName, DBAccessor.DBColumnInfo columnInfo, boolean nullable) | 0 |
final boolean methodRequired,
final Class<?> componentClass,
final DSVersion dsVersion,
final boolean configurableServiceProperties )
rawParameter.getComponentContext().getLogger().log( LogService.LOG_DEBUG, "invoking {0}: {1}: parameters {2}", null,
rawParameter.getComponentContext().getLogger().log( LogService.LOG_DEBUG, "invoked {0}: {1}", null,
rawParameter.getComponentContext().getLogger().log( LogService.LOG_WARNING, "Method {0}: {1} cannot be called on null object",
rawParameter.getComponentContext().getLogger().log( LogService.LOG_DEBUG, ise.getMessage(), null );
rawParameter.getComponentContext().getLogger().log( LogService.LOG_DEBUG, "Method {0} cannot be called", ex,
rawParameter.getComponentContext().getLogger().log( LogService.LOG_ERROR, "The {0} method has thrown an exception", ite.getCause(),
resolve( baseMethod, rawParameter.getComponentContext().getLogger() );
rawParameter.getComponentContext().getLogger().log( LogService.LOG_ERROR, "{0} method [{1}] not found", null, | 0 |
import org.apache.aurora.scheduler.events.EventSink;
EventSink eventSink) {
this.storage = new SideEffectStorage(storage, finalizer, eventSink);
PubsubEvent.TaskStateChange.transition( | 0 |
* @param alwaysEncodeCharsArray
private void insertAlwaysEncodeChars(final byte[] alwaysEncodeCharsArray) {
if (alwaysEncodeCharsArray != null) {
for (byte b : alwaysEncodeCharsArray) { | 0 |
import cz.seznam.euphoria.flink.FlinkElement;
DataSet<FlinkElement> wAssigned =
FlinkElement wel = (FlinkElement) i;
c.collect(new FlinkElement<>(
.returns(FlinkElement.class)
DataSet<FlinkElement<?, Pair>> reduced =
(FlinkElement<?, Pair> we) -> (Comparable) we.getElement().getFirst(),
(KeySelector<FlinkElement<?, ?>, Long>)
FlinkElement::getTimestamp, Long.class),
(KeySelector<FlinkElement<?, Pair>, Comparable>)
(FlinkElement<?, Pair> we) -> (Comparable) we.getElement().getKey(),
implements GroupReduceFunction<FlinkElement<?, Pair>, FlinkElement<?, Pair>>,
ResultTypeQueryable<FlinkElement<?, Pair>>
public void reduce(Iterable<FlinkElement<?, Pair>> values,
org.apache.flink.util.Collector<FlinkElement<?, Pair>> out)
stateFactory,
(WindowedElement.WindowedElementFactory<Window, Object>) FlinkElement::new,
stateCombiner,
stateStorageProvider,
windowing,
trigger,
elem -> out.collect((FlinkElement) elem));
for (FlinkElement value : values) {
public TypeInformation<FlinkElement<?, Pair>> getProducedType() {
return TypeInformation.of((Class) FlinkElement.class); | 0 |
public class OpTimer { | 0 |
* @throws IOException If storing fails
* @return The property value of the default value
* <p>Example:</p>
* | 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 |
* 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.
* @version $Revision: 1.11 $ $Date: 2004/02/29 14:17:39 $ | 0 |
private AtlasEntity getDB(String dbName) throws AtlasServiceException {
public void testTablesAreAdded() throws AtlasServiceException {
private void verifyColumnsAreAddedToTable(AtlasEntity table) {
private void verifyDBIsLinkedToTable(AtlasEntity table) throws AtlasServiceException {
private void verifySimpleTableAttributes(AtlasEntity table) {
public void testProcessIsAdded() throws AtlasServiceException {
public void testLineageIsMaintained() throws AtlasServiceException {
public void testViewIsAdded() throws AtlasServiceException { | 0 |
import org.apache.beam.runners.core.metrics.ExecutionStateTracker;
import org.apache.beam.runners.core.metrics.SimpleExecutionState;
import org.apache.beam.runners.core.metrics.SimpleMonitoringInfoBuilder;
private ExecutionStateTracker stateTracker;
public PCollectionConsumerRegistry(
MetricsContainerStepMap metricsContainerRegistry, ExecutionStateTracker stateTracker) {
this.stateTracker = stateTracker;
* This will cause both Element Count and Process Bundle Execution time metrics to be collected.
*
HashMap<String, String> labelsMetadata = new HashMap<String, String>();
labelsMetadata.put(SimpleMonitoringInfoBuilder.PTRANSFORM_LABEL, pTransformId);
SimpleExecutionState state = new SimpleExecutionState(
SimpleMonitoringInfoBuilder.PROCESS_BUNDLE_MSECS_URN, labelsMetadata);
// created. Also use the ExecutionStateTracker and enter an appropriate state to track the
// Process Bundle Execution time metric.
try (Closeable trackerCloseable = this.stateTracker.enterState(state)) {
consumer.accept(input);
} | 0 |
* Returns the area covered by this shape painter (even if nothing
* is painted there).
*/
Shape getSensitiveArea();
/**
* Returns the bounds of the area covered by this shape painter
* (even if nothing is painted there).
*/
Rectangle2D getSensitiveBounds2D();
/** | 0 |
Schema.builder()
.addInt32Field("f_int")
.addDoubleField("f_double")
.addInt32Field("f_int2") | 0 |
import org.apache.felix.gogo.commands.Command;
@Command(scope = "features", name = "uninstall", description = "Uninstall a feature.") | 0 |
public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement,
final boolean toInclusive) { | 0 |
@Test
public void testCaseInsensitiveKeysAnnotation() {
Map<String, Object> m = new HashMap<>();
m.put("FOO", "Bleh");
m.put("baR", 21);
m.put("za.za", true);
TestInterface ti = converter.convert(m).keysIgnoreCase().to(TestInterface.class);
assertEquals("Bleh", ti.foo());
assertEquals(21, ti.bar("42"));
assertTrue(ti.za_za());
}
@Test
public void testCaseSensitiveKeysAnnotation() {
Map<String, Object> m = new HashMap<>();
m.put("FOO", "Bleh");
m.put("baR", 21);
m.put("za.za", true);
TestInterface ti = converter.convert(m).to(TestInterface.class);
try {
ti.foo();
fail("Should have thrown a conversion exception as 'foo' was not set");
} catch (ConversionException ce) {
// good
}
assertEquals(42, ti.bar("42"));
assertTrue(ti.za_za());
}
| 0 |
* Converts an array of bytes into an array of characters representing the
* hexidecimal values of each byte in order. The returned array will be
* double the length of the passed array, as it takes two characters to
* represent any given byte.
*
* @param data array of byte to convert to Hex characters
* @return A char[] containing hexidecimal characters
*/
* Converts an array of characters representing hexidecimal values into an
* array of bytes of those same values. The returned array will be half the
* length of the passed array, as it takes two characters to represent any
* given byte. An exception is thrown if the passed char array has an odd
* number of elements.
*
* @param data An array of characters containing hexidecimal digits
* @return A byte array array containing binary data decoded from
* the supplied char array.
* @throws Exception Thrown if an odd number of characters is supplied
* to this function
*/ | 0 |
return builder.append("DROP CONSTRAINT ").append(constraintName).append(cascade ? " CASCADE" : ""); | 0 |
package org.apache.beam.learning.katas.commontransforms.aggregation.count;
| 0 |
@Description("[Experimental] Used to configure the Cloud Debugger")
* running debugged processes. Version should be different if users have
@Description("User defined application version. Cloud Debugger uses it to group all "
+ "running debugged processes. cdbgVersion should be different if users have "
+ "multiple parallel runs of the same application with different inputs.") | 0 |
package org.apache.commons.dbcp2; | 1 |
import cz.seznam.euphoria.flink.streaming.windowing.EmissionWindow;
import org.apache.flink.streaming.api.functions.windowing.WindowFunction;
import org.apache.flink.util.Collector;
// @SuppressWarnings("unchecked")
if (windowing == null) {
throw new UnsupportedOperationException("Attached windowing not supported yet!");
}
// apply windowing first
WindowedStream<StreamingWindowedElement<?, ?, WindowedPair>, Object, EmissionWindow<Window>>
windowedPairs = context.windowStream((DataStream) input, keyExtractor, valueExtractor, windowing);
DataStream<StreamingWindowedElement<?, ?, WindowedPair>> reduced = windowedPairs
.apply(new TypedReducer(reducer), new ForwardEmissionWatermark())
/**
* Windowing function to extract the emission watermark from the window being
* emitted and forward it along the emitted element(s).
*/
private static class ForwardEmissionWatermark
implements WindowFunction<
StreamingWindowedElement<?, ?, WindowedPair>,
StreamingWindowedElement<?, ?, WindowedPair>,
Object,
EmissionWindow<Window>> {
@Override
public void apply(Object o,
EmissionWindow<Window> window,
Iterable<StreamingWindowedElement<?, ?, WindowedPair>> input,
Collector<StreamingWindowedElement<?, ?, WindowedPair>> out)
throws Exception
{
for (StreamingWindowedElement<?, ?, WindowedPair> i : input) {
out.collect(i.withEmissionWatermark(window.getEmissionWatermark()));
}
}
} // ~ end of ForwardEmissionWatermark
} // ~ end of TypedReducer | 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.mesos.Protos.OfferID;
* <p>
* A task launcher may choose to retain an offer for later use. Any retained offers must be
* cleaned up with {@link #cancelOffer(OfferID)}.
/**
* Informs the launcher that a previously-advertised offer is canceled and may not be used.
*
* @param offer The canceled offer.
*/
void cancelOffer(OfferID offer); | 0 |
private BeanMapHandler<Long, TestBean> bmh;
private Map<Long, TestBean> res;
@Mock private ResultSet rs;
@Mock private ResultSetMetaData rsmd;
@Mock private RowProcessor rp;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(Boolean.valueOf(rs.next())).thenReturn(Boolean.TRUE, Boolean.FALSE);
when(rs.getObject(1)).thenReturn(Long.valueOf(23L));
when(rs.getObject(2)).thenReturn(Long.valueOf(23L));
when(rs.getObject("id")).thenReturn(Long.valueOf(23L));
when(rs.getMetaData()).thenReturn(rsmd);
when(rp.toBean(rs, TestBean.class)).thenReturn(new TestBean());
}
private void handle() throws Exception {
res = bmh.handle(rs);
assertNotNull(res.get(Long.valueOf(23L)));
}
@Test
public void testBeanMapHandlerClassOfV() throws Exception {
bmh = new BeanMapHandler<Long, TestBean>(TestBean.class);
handle();
}
@Test
public void testBeanMapHandlerClassOfVRowProcessor() throws Exception {
bmh = new BeanMapHandler<Long, TestBean>(TestBean.class, rp);
handle();
}
@Test
public void testBeanMapHandlerClassOfVInt() throws Exception {
bmh = new BeanMapHandler<Long, TestBean>(TestBean.class, 2);
handle();
}
@Test
public void testBeanMapHandlerClassOfVString() throws Exception {
bmh = new BeanMapHandler<Long, TestBean>(TestBean.class, "id");
handle();
}
@Test
public void testEmptyResultSet() throws Exception {
when(Boolean.valueOf(rs.next())).thenReturn(Boolean.FALSE);
bmh = new BeanMapHandler<Long, TestBean>(TestBean.class);
res = bmh.handle(rs);
assertNull(res.get(Long.valueOf(23L)));
} | 0 |
case OpCode.sync: | 0 |
package org.apache.felix.framework;
import org.apache.felix.moduleloader.*; | 1 |
prevComponentSize = getSize();
AffineTransform at = calculateViewingTransform
(fragmentIdentifier, elt);
protected AffineTransform calculateViewingTransform
(String fragIdent, SVGSVGElement svgElt) {
Dimension d = getSize();
if (d.width < 1) d.width = 1;
if (d.height < 1) d.height = 1;
return ViewBox.getViewTransform
(fragIdent, svgElt, d.width, d.height);
}
AffineTransform at = calculateViewingTransform
(fragmentIdentifier, elt);
protected class JSVGComponentListener extends ComponentAdapter | 0 |
import static org.mockito.Matchers.any;
import org.joda.time.Duration;
when(mockJob.waitUntilFinish(any(Duration.class))) | 0 |
import java.util.Objects;
* Gets the equality to another historical alert entry based on the following criteria:
* <ul>
* <li>{@link #definitionId}
* <li>{@link #clusterId}
* <li>{@link #definitionName}
* </ul>
* <p/>
* However, since we're guaranteed that {@link #definitionId} is unique among persisted entities, we
* can return the hashCode based on this value if it is set.
* <p/>
* {@inheritDoc}
// use the unique ID if it exists
if( null != definitionId ){
return Objects.equals(definitionId, that.definitionId);
return Objects.equals(definitionId, that.definitionId) &&
Objects.equals(clusterId, that.clusterId) &&
Objects.equals(definitionName, that.definitionName);
* Gets a hash to uniquely identify this alert definition. Since we're
* guaranteed that {@link #definitionId} is unique among persisted entities,
* we can return the hashCode based on this value if it is set.
* <p/>
* {@inheritDoc}
// use the unique ID if it exists
if( null != definitionId ){
return definitionId.hashCode();
}
return Objects.hash(definitionId, clusterId, definitionName); | 0 |
import org.apache.beam.model.pipeline.v1.Endpoints;
import org.apache.beam.model.pipeline.v1.Endpoints.ApiServiceDescriptor; | 0 |
import java.net.URL;
import java.net.MalformedURLException;
try {
URL context = new URL(baseURL.toString());
URL url = new URL(context, urlStr);
return constructParsedURLData(url);
} catch (MalformedURLException mue) {
return super.parseURL(baseURL, urlStr);
} | 0 |
import java.util.Collection;
import java.util.Set;
import java.util.HashSet;
import java.util.Iterator;
import org.apache.cocoon.portal.pluto.om.common.PreferenceSetImpl;
import org.apache.cocoon.portal.profile.ProfileManager;
import org.apache.cocoon.portal.util.AttributedMapItem;
import org.apache.pluto.om.common.PreferenceSet;
/** Portlet preferences */
protected PreferenceSetImpl preferences = new PreferenceSetImpl();
protected ProfileManager profileManager;
public final Collection getCastorAttributes() {
Set set = new HashSet(this.attributes.size());
Iterator iterator = this.attributes.entrySet().iterator();
Map.Entry entry;
while (iterator.hasNext()) {
entry = (Map.Entry) iterator.next();
AttributedMapItem item = new AttributedMapItem();
item.setKey((String) entry.getKey());
item.setValue((String) entry.getValue());
set.add(item);
}
return set;
}
public void addAttribute(AttributedMapItem item) {
this.attributes.put(item.getKey(), item.getValue());
}
public void setPreferences(PreferenceSetImpl preferences) {
this.preferences = preferences;
}
public PreferenceSet getPreferences() {
return this.preferences;
}
public PreferenceSet getCastorPreferences() {
return getPreferences();
}
public void setCastorPreferences(PreferenceSet castorPreferences) {
setPreferences((PreferenceSetImpl)castorPreferences);
}
public void setProfileManager(ProfileManager manager) {
this.profileManager = manager;
}
public ProfileManager getProfileManager() {
return this.profileManager;
}
clone.preferences = new PreferenceSetImpl();
clone.preferences.addAll(this.preferences.getPreferences());
| 0 |
* attribute value is 'application/java-archive' and when the
| 0 |
* Returns {@code true} if an HTTP request has been submitted to the
* @return {@code true} if an HTTP request has been submitted,
* {@code false} otherwise. | 0 |
@SuppressWarnings("unchecked")
Iterator<Reference> i = signature.getSignedInfo().getReferences().iterator();
Reference reference = i.next(); | 0 |
/*
* The control sequence sent by the telnet program when it closes a
* connection. Include simply to keep the logs cleaner (the server would
* close the connection anyway because it would parse this as a negative
* length).
*/
protected final static int telnetCloseCmd = 0xfff4fffd;
cmd2String.put(telnetCloseCmd, "telnet close"); | 0 |
/*
* Copyright 1999-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.forms.binding.library;
import org.apache.avalon.framework.CascadingException;
/**
* This exception is thrown when something specific to the library system goes wrong.
*
* @version $Id$
*
*/
public class LibraryException extends CascadingException {
public LibraryException(String message) {
super(message);
}
public LibraryException(String message, Exception e) {
super(message, e);
}
} | 0 |
if(null == serviceInfo.getSupportDeleteViaUIField()){
serviceInfo.setSupportDeleteViaUI(parent.isSupportDeleteViaUI());
}
| 0 |
import static org.apache.atlas.AtlasClient.PROCESS_ATTRIBUTE_INPUTS;
import static org.apache.atlas.AtlasClient.PROCESS_ATTRIBUTE_OUTPUTS;
HierarchicalTypeDefinition<ClassType> assetType = TypesUtil
.createClassTypeDef(AtlasClient.ASSET_TYPE, ImmutableSet.<String>of(),
TypesUtil.createRequiredAttrDef(AtlasClient.NAME, DataTypes.STRING_TYPE),
TypesUtil.createOptionalAttrDef(AtlasClient.DESCRIPTION, DataTypes.STRING_TYPE),
TypesUtil.createOptionalAttrDef(AtlasClient.OWNER, DataTypes.STRING_TYPE));
createType(assetType);
.createClassTypeDef(AtlasClient.INFRASTRUCTURE_SUPER_TYPE,
ImmutableSet.of(AtlasClient.REFERENCEABLE_SUPER_TYPE, AtlasClient.ASSET_TYPE));
.createClassTypeDef(AtlasClient.DATA_SET_SUPER_TYPE,
ImmutableSet.of(AtlasClient.REFERENCEABLE_SUPER_TYPE, AtlasClient.ASSET_TYPE));
.createClassTypeDef(AtlasClient.PROCESS_SUPER_TYPE,
ImmutableSet.of(AtlasClient.REFERENCEABLE_SUPER_TYPE, AtlasClient.ASSET_TYPE),
new AttributeDefinition(PROCESS_ATTRIBUTE_INPUTS, DataTypes.arrayTypeName(AtlasClient.DATA_SET_SUPER_TYPE),
new AttributeDefinition(PROCESS_ATTRIBUTE_OUTPUTS, DataTypes.arrayTypeName(AtlasClient.DATA_SET_SUPER_TYPE), | 0 |
* @version CVS $Id: XPathTraversableGenerator.java,v 1.1 2003/10/23 07:55:49 gcasper Exp $ | 0 |
@Override
@Override | 0 |
import junit.framework.Test;
| 0 |
// @formatter:off
// @formatter:on | 0 |
public final class SftpConstants {
// (Some) names of known extensions
public static final String EXT_VERSIONS = "versions";
public static final String EXT_NEWLINE = "newline";
public static final String EXT_VENDORID = "vendor-id";
public static final String EXT_SUPPORTED = "supported";
public static final String EXT_SUPPORTED2 = "supported2";
public static final String EXT_VERSELECT = "version-select";
private SftpConstants() {
throw new UnsupportedOperationException("No instance");
} | 0 |
import org.apache.atlas.AtlasConfiguration;
private final String ATLAS_HOOK_TOPIC = AtlasConfiguration.NOTIFICATION_HOOK_TOPIC_NAME.getString();
private final String ATLAS_ENTITIES_TOPIC = AtlasConfiguration.NOTIFICATION_ENTITIES_TOPIC_NAME.getString();
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC);
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC);
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC);
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC);
createdTopics.put(ATLAS_HOOK_TOPIC, false);
createdTopics.put(ATLAS_ENTITIES_TOPIC, false);
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC, ATLAS_ENTITIES_TOPIC);
assertTrue(createdTopics.get(ATLAS_HOOK_TOPIC));
assertTrue(createdTopics.get(ATLAS_ENTITIES_TOPIC));
createdTopics.put(ATLAS_ENTITIES_TOPIC, false);
if (topicName.equals(ATLAS_HOOK_TOPIC)) {
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC, ATLAS_ENTITIES_TOPIC);
assertTrue(createdTopics.get(ATLAS_ENTITIES_TOPIC));
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC, ATLAS_ENTITIES_TOPIC);
createdTopics.put(ATLAS_HOOK_TOPIC, false);
createdTopics.put(ATLAS_ENTITIES_TOPIC, false);
atlasTopicCreator.createAtlasTopic(configuration, ATLAS_HOOK_TOPIC, ATLAS_ENTITIES_TOPIC);
assertFalse(createdTopics.get(ATLAS_HOOK_TOPIC));
assertFalse(createdTopics.get(ATLAS_ENTITIES_TOPIC)); | 0 |
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; | 0 |
import org.apache.felix.dependencymanager.management.ServiceComponent;
import org.apache.felix.dependencymanager.management.ServiceComponentDependency; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.