Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
* @version $Revision: 1.19 $ $Date: 2004/05/10 20:09:53 $
public UrlFileProvider()
super();
fs = new UrlFileSystem(rootName, fileSystemOptions); | 0 |
* @version $Revision$ $Date$ | 0 |
* @version $Id$
* Constructs a new {@code ConversionException} without specified
* Constructs a new {@code ConversionException} with specified
* Constructs a new {@code ConversionException} with specified
* nested {@code Throwable}.
* Constructs a new {@code ConversionException} with specified
* detail message and nested {@code Throwable}. | 0 |
import com.google.common.base.Charsets;
import java.io.Writer;
String line = new String(encodedElem, Charsets.UTF_8);
try (Writer writer = Files.newBufferedWriter(tmpFile.toPath(), UTF_8)) {
prepareSource(file.getBytes(Charsets.UTF_8))
.createReader(PipelineOptionsFactory.create())) {
BoundedSource<String> source = prepareSource(file.getBytes(Charsets.UTF_8)); | 0 |
import org.apache.sshd.server.ServerFactoryManager;
URL moduli;
String moduliStr = session.getFactoryManager().getProperties().get(ServerFactoryManager.MODULI_URL);
if (moduliStr != null) {
moduli = new URL(moduliStr);
} else {
moduli = getClass().getResource("/org/apache/sshd/moduli");
} | 0 |
/**
* @since 2.0
**/
* @since 2.0
* @since 2.0 | 0 |
*/
package org.apache.batik.dom.events; | 1 |
StringBuilder tmp = new StringBuilder(uname.length() + realm.length() + pwd.length() + 2);
StringBuilder tmp3 = new StringBuilder(tmp2.length() + nonce.length() + cnonce.length() + 2);
StringBuilder tmp2 = new StringBuilder(md5a1.length() + nonce.length() + md5a2.length());
StringBuilder tmp2 = new StringBuilder(md5a1.length() + nonce.length() | 0 |
final Header transferEncodingHeader = message.getFirstHeader(HTTP.TRANSFER_ENCODING);
} catch (final ParseException px) {
final int len = encodings.length;
final Header contentLengthHeader = message.getFirstHeader(HTTP.CONTENT_LEN);
final Header[] headers = message.getHeaders(HTTP.CONTENT_LEN);
final Header header = headers[i];
} catch (final NumberFormatException e) { | 0 |
@Override
@Override
@Override
@Override | 0 |
void execute(DBAccessor dbAccessor) throws SQLException;
void verify(DBAccessor dbAccessor) throws SQLException; | 0 |
* this script</a>, which publishes traffic sensor data to a PubSub topic.
* After you've started this pipeline, start | 0 |
package org.apache.felix.fileinstall.internal; | 0 |
// Set the module's wires. If the module is a resolved
// fragment, then we must actually append any new host
// wires to the existing ones.
if (Util.isFragment(module) && module.isResolved())
{
wires.addAll(module.getWires());
} | 1 |
import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly; | 0 |
.apply(View.asList());
p.apply("singletonCreate", Create.<Object>of(1, 2, 3)).apply(View.asSingleton());
Matchers.containsInAnyOrder(listView, singletonView));
Matchers.containsInAnyOrder(
Matchers.containsInAnyOrder(graph.getProducer(empty)));
assertThat(onlyRoot.getTransform(), Matchers.equalTo(flatten));
PCollectionList.of(created).and(transformed).apply(Flatten.pCollections());
Matchers.containsInAnyOrder(
Matchers.containsInAnyOrder(flattenedProducer));
PCollectionList.of(created).and(created).apply(Flatten.pCollections());
Matchers.containsInAnyOrder(flattenedProducer, | 0 |
TriggerContext c, OnElementEvent<IntervalWindow> e) throws Exception {
TriggerContext c, OnMergeEvent<IntervalWindow> e) throws Exception {
TriggerContext c, OnTimerEvent<IntervalWindow> e) throws Exception { | 0 |
import org.apache.beam.runners.dataflow.worker.DataflowOperationContext.DataflowExecutionState;
import org.apache.beam.runners.dataflow.worker.TestOperationContext.TestDataflowExecutionState;
private final ExecutionStateTracker tracker = new ExecutionStateTracker(sampler);
DataflowExecutionState state =
new TestDataflowExecutionState(
NameContext.create(MOCK_STAGE_NAME, mockOriginalName, MOCK_SYSTEM_NAME, MOCK_USER_NAME),
"activity"); | 0 |
TreeMap<Key,Value> tm = new TreeMap<>();
ArrayList<Pair<Key,Value>> testData = new ArrayList<>();
testData.add(new Pair<>(k, v)); | 1 |
/*
* Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
*
* 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.osgi.service.http.runtime.dto;
import org.osgi.dto.DTO;
/**
* Represents a listener currently being used by a servlet context.
*
* @NotThreadSafe
* @author $Id$
*/
public class ListenerDTO extends DTO {
/**
* The fully qualified type names the listener. This array is never empty.
*/
public String[] types;
/**
* Service property identifying the listener. In the case of a Listener
* registered in the service registry and picked up by a Http Whiteboard
* Implementation, this value is not negative and corresponds to the service
* id in the registry. If the listener has not been registered in the
* service registry, the value is negative and a unique negative value is
* generated by the Http Service Runtime in this case.
*/
public long serviceId;
/**
* The service id of the servlet context for the listener represented by
* this DTO.
*/
public long servletContextId;
} | 0 |
final String scheme = UriParser.extractScheme(name.getURI(), buf);
return new URL(scheme, "", -1, | 0 |
import org.apache.accumulo.server.ServerConstants;
public static enum FileType {
TABLE(ServerConstants.TABLE_DIR), WAL(ServerConstants.WAL_DIR), RECOVERY(ServerConstants.RECOVERY_DIR);
private String dir;
FileType(String dir) {
this.dir = dir;
}
public String getDirectory() {
return dir;
}
}
Path getFullPath(String tableId, String path);
Path getFullPath(FileType fileType, String fileName) throws IOException;
| 1 |
@Test
public void testCalculateSummaryStatus() {
Collection<HostRoleStatus> hostRoleStatuses = new LinkedList<HostRoleStatus>();
hostRoleStatuses.add(HostRoleStatus.PENDING);
hostRoleStatuses.add(HostRoleStatus.PENDING);
hostRoleStatuses.add(HostRoleStatus.PENDING);
hostRoleStatuses.add(HostRoleStatus.PENDING);
hostRoleStatuses.add(HostRoleStatus.PENDING);
hostRoleStatuses.add(HostRoleStatus.PENDING);
Map<HostRoleStatus, Integer> counts = StageResourceProvider.calculateTaskStatusCounts(hostRoleStatuses);
assertEquals(HostRoleStatus.PENDING, StageResourceProvider.calculateSummaryStatus(counts, hostRoleStatuses.size(), true));
hostRoleStatuses = new LinkedList<HostRoleStatus>();
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
hostRoleStatuses.add(HostRoleStatus.FAILED);
hostRoleStatuses.add(HostRoleStatus.ABORTED);
hostRoleStatuses.add(HostRoleStatus.ABORTED);
hostRoleStatuses.add(HostRoleStatus.ABORTED);
hostRoleStatuses.add(HostRoleStatus.ABORTED);
counts = StageResourceProvider.calculateTaskStatusCounts(hostRoleStatuses);
assertEquals(HostRoleStatus.FAILED, StageResourceProvider.calculateSummaryStatus(counts, hostRoleStatuses.size(), true));
hostRoleStatuses = new LinkedList<HostRoleStatus>();
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
hostRoleStatuses.add(HostRoleStatus.FAILED);
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
hostRoleStatuses.add(HostRoleStatus.COMPLETED);
counts = StageResourceProvider.calculateTaskStatusCounts(hostRoleStatuses);
assertEquals(HostRoleStatus.COMPLETED, StageResourceProvider.calculateSummaryStatus(counts, hostRoleStatuses.size(), false));
}
| 0 |
/**
* @author <a href="mailto:[email protected]">Julien Viet</a>
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
public static Readable asReadable(ByteBuf buffer) { | 1 |
final HttpCoreContext corecontext = HttpCoreContext.adapt(context);
final int status = response.getStatusLine().getStatusCode();
final Header explicit = response.getFirstHeader(HTTP.CONN_DIRECTIVE);
final HttpEntity entity = response.getEntity();
final ProtocolVersion ver = response.getStatusLine().getProtocolVersion();
final HttpRequest request = corecontext.getRequest();
final Header header = request.getFirstHeader(HTTP.CONN_DIRECTIVE); | 0 |
public static synchronized void clearCache() { | 0 |
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* | 0 |
import org.apache.accumulo.core.client.mock.MockInstance;
private static MockInstance inst;
inst = new MockInstance();
* This is a test to ensure the string literal in {@link ConnectorImpl#ConnectorImpl(org.apache.accumulo.core.client.impl.ClientContext)} is kept up-to-date
* if we move the {@link SystemToken}<br/>
assertEquals(SystemCredentials.get(inst).getToken().getClass(), SystemToken.class);
Credentials a = SystemCredentials.get(inst);
Credentials b = SystemCredentials.get(inst);
assertTrue(a.equals(b)); | 1 |
* @version $Revision: 1.3 $, $Date: 2004/06/24 14:01:03 $
public ConversionException()
{
super();
} | 0 |
// Digest algorithms
// Signature algorithms
// Encryption algorithms | 0 |
* Key used to retrieve the value of the server identification string. If not set then
* a default is sent - consists of "SSH-2.0-" plus the current SSHD core
* artifact name and version in uppercase - e.g., "SSH-2.0-SSHD-CORE-1.0.0"
* @return A valid {@link CommandFactory} object or {@code null} if commands | 0 |
import org.apache.atlas.typesystem.types.utils.TypesUtil;
return TypesUtil.getTypesDef(getEnumTypeDefinitions(), getStructTypeDefinitions(), getTraitTypeDefinitions(), | 0 |
public static byte[] convertASN1toXMLDSIG(byte[] asn1Bytes) throws IOException {
public static byte[] convertXMLDSIGtoASN1(byte[] xmldsigBytes) throws IOException { | 0 |
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* @version $Id: ASTExpression.java,v 1.2 2003/10/09 21:28:55 rdonkin Exp $ | 0 |
* Attempts to discover a ListGetExecutor.
*
* @param clazz the class to find the get method from
* @param identifier the key to use as an argument to the get method
* @return the executor if found, null otherwise
public static ListGetExecutor discover(Introspector is, Class<?> clazz, Object identifier) {
java.lang.reflect.Method method = null;
Integer index = toInteger(identifier);
if (index != null) {
if (clazz.isArray()) {
method = ARRAY_GET;
} else if (List.class.isAssignableFrom(clazz)) {
method = LIST_GET;
}
}
return method == null ? null : new ListGetExecutor(clazz, method, index);
}
/**
* Creates an instance.
* @param clazz he class the get method applies to
* @param method the method held by this executor
* @param identifier the property to get
*/
private ListGetExecutor(Class<?> clazz, java.lang.reflect.Method method, Integer identifier) {
super(clazz, method);
property = identifier;
public Object invoke(final Object obj) {
public Object tryInvoke(final Object obj, Object key) {
Integer index = toInteger(key);
&& index != null) {
return java.lang.reflect.Array.get(obj, index.intValue());
return ((List<?>) obj).get(index.intValue()); | 0 |
@Override
public void update( Dictionary<String, ?> properties ) throws IOException
@Override
public Dictionary<String, Object> getProperties() | 0 |
import java.io.InputStream;
import org.apache.felix.ipojo.test.helpers.IPOJOHelper;
import org.apache.felix.ipojo.test.helpers.OSGiHelper;
import org.ops4j.pax.exam.Customizer;
InputStream service = TinyBundles.newBundle()
.add(CheckService.class)
.add(Foo.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"Service")
.set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
.build();
InputStream fooimpl = TinyBundles.newBundle()
.add(FooImpl.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
.set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
.build( BundleAsiPOJO.asiPOJOBundle(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml")) );
InputStream test = TinyBundles.newBundle()
.add(FooDelegator.class)
.set(Constants.BUNDLE_SYMBOLICNAME,"MandatoryTransactionPropagation")
.set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction")
.build( BundleAsiPOJO.asiPOJOBundle(new File(ROOT, "mandatory.jar"), new File(TEST, "mandatory.xml")) );
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.test.helpers").version(asInProject())
),
provision(
service,
fooimpl,
test
,
new Customizer() {
@Override
public InputStream customizeTestProbe( InputStream testProbe )
{
return TinyBundles.modifyBundle(testProbe)
.set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
.build();
}
});
| 0 |
import javax.net.ssl.SSLContext;
import org.apache.http.conn.ssl.SSLContexts;
SSLContext sslcontext = SSLContexts.custom()
.loadTrustMaterial(trustStore)
.build();
SSLSocketFactory sslsf = new SSLSocketFactory(sslcontext,
SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
.setSSLSocketFactory(sslsf)
.build(); | 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 | 1 |
* is extensively used and tested in AbstractSortedBagTest.
| 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.portal.wsrp.consumer;
import org.apache.wsrp4j.consumer.PortletWindowSession;
/**
* Defines a portlet window session used by the cocoon portal
* In additional to <code>SimplePortletWindowSession</code>
* it contains information about the current window state and mode of a portlet window.<br/>
*
* @version $Id$
*/
public interface SimplePortletWindowSession extends PortletWindowSession {
/**
* Get the window state of the portlet window
* this session belongs to.<br/>
*
* @return the window state
**/
String getWindowState();
/**
* Set the window state of the portlet window
* this session belongs to.<br/>
*
* @param windowState The window state
**/
void setWindowState(String windowState);
/**
* Get the portlet mode of the portlet window.<br/>
*
* @return The portlet mode
**/
String getMode();
/**
* Set the portlet mode of the portlet window.<br/>
*
* @param mode The portlet mode
**/
void setMode(String mode);
/**
* Get the navigational state for the portlet window the session belongs to<br/>
*
* @return the navigational state
**/
String getNavigationalState();
/**
* Set the navigational state for the portlet window the session belongs to<br/>
*
* @param navState the navigational state
**/
void setNavigationalState(String navState);
} | 0 |
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.forms.validation.impl;
import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.cocoon.forms.datatype.validationruleimpl.Mod10ValidationRuleBuilder;
import org.apache.cocoon.forms.formmodel.WidgetDefinition;
import org.apache.cocoon.forms.validation.WidgetValidator;
import org.apache.cocoon.forms.validation.WidgetValidatorBuilder;
import org.w3c.dom.Element;
/**
* Adapter for {@link org.apache.cocoon.forms.datatype.validationruleimpl.Mod10ValidationRuleBuilder}
*
* @version $Id$
*/
public class Mod10ValidatorBuilder
extends Mod10ValidationRuleBuilder
implements WidgetValidatorBuilder, ThreadSafe {
/**
* @see org.apache.cocoon.forms.validation.WidgetValidatorBuilder#build(org.w3c.dom.Element, org.apache.cocoon.forms.formmodel.WidgetDefinition)
*/
public WidgetValidator build(Element validationRuleElement, WidgetDefinition definition) throws Exception {
return new ValidationRuleValidator(super.build(validationRuleElement));
}
} | 0 |
* If {@code null} {@link org.apache.http.nio.util.HeapByteBufferAllocator#INSTANCE}
* If {@code null} simple type cast will be used for byte to char conversion.
* If {@code null} simple type cast will be used for char to byte conversion.
* @param constraints Message constraints. If {@code null}
* @param incomingContentStrategy incoming content length strategy. If {@code null}
* @param outgoingContentStrategy outgoing content length strategy. If {@code null}
* If {@code null} {@link org.apache.http.nio.util.HeapByteBufferAllocator#INSTANCE}
* If {@code null} simple type cast will be used for byte to char conversion.
* If {@code null} simple type cast will be used for char to byte conversion.
* @param incomingContentStrategy incoming content length strategy. If {@code null}
* @param outgoingContentStrategy outgoing content length strategy. If {@code null} | 0 |
* Returns the size of a px CSS unit in millimeters.
public float getPixelUnitToMillimeter() {
return ctx.getUserAgent().getPixelUnitToMillimeter();
* Returns the size of a px CSS unit in millimeters.
* This will be removed after next release.
* @see #getPixelUnitToMillimeter();
*/
public float getPixelToMM() {
return getPixelUnitToMillimeter();
}
/** | 0 |
Set<String> propertyIds = new HashSet<>(); | 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SimpleRegexMatcher.java,v 1.3 2003/10/05 15:06:50 rdonkin Exp $
* $Revision: 1.3 $
* $Date: 2003/10/05 15:06:50 $
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* notice, this list of conditions and the following disclaimer.
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgement:
* "This product includes software developed by the
* 4. The names "Apache", "The Jakarta Project", "Commons", and "Apache Software
* from this software without prior written permission. For written
* 5. Products derived from this software may not be called "Apache",
* "Apache" nor may "Apache" appear in their names without prior
* written permission of the Apache Software Foundation.
*/
* @version $Revision: 1.3 $ $Date: 2003/10/05 15:06:50 $ | 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.ClassRule;
import org.junit.rules.TemporaryFolder;
public class RegexFileFilterTestCase {
@ClassRule
public static TemporaryFolder temporaryFolder = new TemporaryFolder();
private static File getTestDirectory() {
return temporaryFolder.getRoot();
} | 0 |
.addTransition(State.INSTALLED,
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
.addTransition(State.INSTALLED,
State.STARTED,
ServiceComponentHostEventType.HOST_SVCCOMP_STARTED,
new ServiceComponentHostOpCompletedTransition())
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED,
new ServiceComponentHostOpCompletedTransition())
ServiceComponentHostEventType.HOST_SVCCOMP_STARTED,
State.STARTED,
ServiceComponentHostEventType.HOST_SVCCOMP_STARTED,
new ServiceComponentHostOpCompletedTransition())
.addTransition(State.STARTED,
.addTransition(State.STARTED,
State.STARTED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_IN_PROGRESS,
new ServiceComponentHostOpInProgressTransition())
.addTransition(State.STARTED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED,
new ServiceComponentHostOpCompletedTransition())
ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED,
case HOST_SVCCOMP_STOPPED:
case HOST_SVCCOMP_STARTED: | 0 |
import org.apache.accumulo.core.client.ClientInfo;
* @deprecated since 2.0.0, replaced by {{@link #getClientInfo()}}
public ClientInfo getClientInfo() {
return impl.getClientInfo(); | 0 |
* @author <a href="mailto:[email protected]">Vincent Hardy</a> | 1 |
/**
* Return an {@code Object} to use as a key in a cache.
*
* <p>Different namespaces may use the same key in order to be treated as a unit in the cache.
* The {@code Object}'s {@code hashCode} and {@code equals} methods will be used to determine
* equality.
*/
Object getCacheKey(); | 0 |
public Base32(final boolean useHex) {
public Base32(final int lineLength) {
public Base32(final int lineLength, final byte[] lineSeparator) {
public Base32(final int lineLength, final byte[] lineSeparator, final boolean useHex) {
final String sep = StringUtils.newStringUtf8(lineSeparator);
void decode(final byte[] in, int inPos, final int inAvail, final Context context) { // package protected for access from I/O streams
void encode(final byte[] in, int inPos, final int inAvail, final Context context) { // package protected for access from I/O streams
public boolean isInAlphabet(final byte octet) { | 1 |
* Copyright (C) 2015 Google Inc. | 0 |
* Implementation of the {@link org.apache.beam.runners.dataflow.DataflowRunner}. | 0 |
import org.apache.http.TokenIterator; | 0 |
package org.apache.beam.sdk.util;
import org.apache.beam.sdk.coders.AvroCoder;
import org.apache.beam.sdk.coders.DefaultCoder;
import org.apache.beam.sdk.util.AvroUtils.AvroMetadata;
| 0 |
package org.apache.hc.core5.benchmark; | 0 |
public long isReady(long tid, Master environment) {
public Repo<Master> call(long id, Master env) {
public void undo(long tid, Master env) {} | 0 |
import org.apache.accumulo.core.client.sample.SamplerConfiguration; | 0 |
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.woody.binding;
import org.apache.cocoon.woody.formmodel.Widget;
/**
* Binding declares the methods to 'bind' (i.e. 'load' and 'save')
* information elements from some back-end model (2nd argument) to and from
* a existing Woody Widget.
*
* @version CVS $Id: Binding.java,v 1.10 2004/03/09 13:54:06 reinhard Exp $
*/
public interface Binding {
/**
* Sets parent binding.
* @param binding Parent of this binding.
*/
void setParent(Binding binding);
/**
* Gets binding definition id.
*/
String getId();
/**
* Gets a binding class.
* @param id Id of binding class to get.
*/
Binding getClass(String id);
/**
* Loads the information-elements from the objModel to the frmModel.
*
* @param frmModel
* @param objModel
*/
void loadFormFromModel(Widget frmModel, Object objModel)
throws BindingException;
/**
* Saves the infortmation-elements to the objModel from the frmModel.
* @param frmModel
* @param objModel
*/
void saveFormToModel(Widget frmModel, Object objModel)
throws BindingException;
} | 0 |
import java.util.Collections;
@SuppressWarnings({ "rawtypes" })
private static final ImmutableMap EMPTY_MAP = new ImmutableMap();
@SuppressWarnings("unchecked")
return entries.length == 0 ? EMPTY_MAP : new ImmutableMap<K, V>(entries);
@SuppressWarnings("unchecked")
return entries.isEmpty() ? EMPTY_MAP : new ImmutableMap<K, V>(entries);
@SuppressWarnings("unchecked")
private ImmutableMap()
{
this.entries = new Entry[0];
}
@SuppressWarnings("unchecked") | 0 |
import java.util.HashSet;
import org.apache.aurora.gen.Constraint;
.setJobName(job)
.setEnvironment(env)
.setConstraints(new HashSet<Constraint>())); | 0 |
* </p> | 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
public class TransformCanonicalizerTest {
fail("unexpected call to transform(XMLSecEvent");
assertEquals(554, byteArrayOutputStream.size());
fail("unexpected call to transform(XMLSecEvent");
assertEquals(554, byteArrayOutputStream.size());
assertEquals(554, byteArrayOutputStream.size());
assertEquals(554, byteArrayOutputStream.size());
fail("unexpected call to transform(XMLSecEvent");
assertEquals(554, byteArrayOutputStream.size());
fail("unexpected call to transform(XMLSecEvent");
assertEquals(554, byteArrayOutputStream.size()); | 0 |
import org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy;
.setTlsStrategy(new DefaultClientTlsStrategy(SSLTestContexts.createClientSSLContext())) | 0 |
broadcast() - network() > 1 ? network() + 1 : 0);
private int high() {
broadcast() - network() > 1 ? broadcast() -1 : 0);
*
*
public int getAddressCount() { | 0 |
boolean ignoreNS =
parent.getNamespaceResolver().isDefaultNamespaceIgnored();
return DOMNodePointer.testNode(child, nodeTest, ignoreNS); | 0 |
package org.apache.commons.ognl;
import org.apache.commons.ognl.enhance.ExpressionCompiler;
import org.apache.commons.ognl.enhance.UnsupportedCompilationException; | 0 |
* @since 1.0 | 0 |
// evaluate body as it may contain a <destination> or message tag
getBody().run(context, output);
| 0 |
import org.apache.sshd.util.test.CommonTestSupportUtils;
CommonTestSupportUtils.detectTargetFolder(RootedFileSystemProviderTest.class), "Failed to detect target folder").toPath(); | 0 |
final Instant inputDataWatermark, | 0 |
* Autogenerated by Thrift Compiler (0.11.0)
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)") | 0 |
package com.twitter.aurora.scheduler.http;
import com.twitter.aurora.gen.Quota;
import com.twitter.aurora.scheduler.storage.Storage;
import com.twitter.aurora.scheduler.storage.Storage.StoreProvider;
import com.twitter.aurora.scheduler.storage.Storage.Work; | 1 |
/**
* @deprecated since 1.4
* @use org.apache.accumulo.core.iterators.user.SummingCombiner with SummingCombiner.Type.STRING
*/ | 0 |
if (actual != null && formal.isAssignableFrom(actual) && actual.isArray() == formal.isArray()) { | 0 |
import org.apache.http.util.Asserts;
Asserts.notNull(state, "HTTP exchange state");
Asserts.notNull(requestConsumer, "Request consumer");
Asserts.check(!this.completed, "Response already submitted");
Asserts.check(!this.completed, "Response already submitted"); | 0 |
DataSet<BatchElement> wAssigned =
BatchElement wel = (BatchElement) i;
c.collect(new BatchElement<>(
.returns(BatchElement.class)
DataSet<BatchElement<?, Pair>> reduced =
(BatchElement<?, Pair> we) -> (Comparable) we.getElement().getFirst(),
(KeySelector<BatchElement<?, ?>, Long>)
BatchElement::getTimestamp, Long.class),
(KeySelector<BatchElement<?, Pair>, Comparable>)
(BatchElement<?, Pair> we) -> (Comparable) we.getElement().getKey(),
implements GroupReduceFunction<BatchElement<?, Pair>, BatchElement<?, Pair>>,
ResultTypeQueryable<BatchElement<?, Pair>>
public void reduce(Iterable<BatchElement<?, Pair>> values,
org.apache.flink.util.Collector<BatchElement<?, Pair>> out)
BatchElement::new,
elem -> out.collect((BatchElement) elem));
for (BatchElement value : values) {
public TypeInformation<BatchElement<?, Pair>> getProducedType() {
return TypeInformation.of((Class) BatchElement.class); | 0 |
if (Files.exists(folder, options)) {
assertTrue("Target is an existing file instead of a folder: " + folder, Files.isDirectory(folder, options));
} else {
if (folder.exists()) {
assertTrue("Target is an existing file instead of a folder: " + folder.getAbsolutePath(), folder.isDirectory());
} else { | 0 |
package org.apache.beam.sdk.extensions.kryo;
import static org.junit.Assert.assertSame;
/** A set of unit {@link KryoState} tests. */
public class KryoStateTest {
public void testSameKryoAfterDeserialization() throws IOException, ClassNotFoundException {
final KryoCoder<?> coder = KryoCoder.of(k -> k.register(TestClass.class));
final KryoState firstKryo = KryoState.get(coder);
final ByteArrayOutputStream outStr = new ByteArrayOutputStream();
final ObjectOutputStream oss = new ObjectOutputStream(outStr);
oss.writeObject(coder);
final ObjectInputStream ois =
new ObjectInputStream(new ByteArrayInputStream(outStr.toByteArray()));
final KryoCoder<?> deserializedCoder = (KryoCoder) ois.readObject();
final KryoState secondKryo = KryoState.get(deserializedCoder);
assertSame(firstKryo, secondKryo); | 0 |
List<String> columns = new ArrayList<>(numColumns);
iterators = new ArrayList<>(numIterators);
this.fetchedColumns = new HashSet<>(); | 1 |
import java.util.Set;
private volatile Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes;
propertiesTypes = cluster.getConfigPropertiesTypes(type);
propertiesTypes = cluster.getConfigPropertiesTypes(type);
public Map<PropertyInfo.PropertyType, Set<String>> getPropertiesTypes() {
readWriteLock.readLock().lock();
try {
return propertiesTypes;
} finally {
readWriteLock.readLock().unlock();
}
}
@Override
public void setPropertiesTypes(Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes) {
readWriteLock.writeLock().lock();
try {
this.propertiesTypes = propertiesTypes;
} finally {
readWriteLock.writeLock().unlock();
}
}
@Override | 0 |
protected static String getPrefix(final NodePointer pointer, String namespaceURI) {
currentPointer = currentPointer.getParent(); | 0 |
/** A {@link CoderProviderRegistrar} for standard types used with {@link BigQueryIO}. */ | 1 |
private static final Logger LOG = LoggerFactory.getLogger(TranslationContext.class);
return getCoder(
((TypeAwareUnaryFunction<InputT, OutputT>) unaryFunction).getTypeDescriptor());
return getCoder(((TypeAwareUnaryFunctor<InputT, OutputT>) unaryFunctor).getTypeDescriptor());
((TypeAwareBinaryFunctor<LeftT, RightT, OutputT>) binaryFunctor).getTypeDescriptor());
return getCoder(
((TypeAwareReduceFunctor<InputT, OutputT>) reduceFunctor).getTypeDescriptor());
private <T> Coder<T> getCoder(TypeDescriptor<T> typeHint) {
return pipeline.getCoderRegistry().getCoder(typeHint);
private <T> Coder<T> getCoder(Type type) {
return getCoder((TypeDescriptor<T>) TypeDescriptor.of(type)); | 0 |
import org.apache.sshd.common.session.Session;
log.debug("Send SSH_MSG_CHANNEL_REQUEST shell on {}", this);
Session session = getSession(); | 0 |
private String servicePrincipalName;
public WindowsNegotiateSchemeFactory(final String servicePrincipalName) {
super();
this.servicePrincipalName = servicePrincipalName;
}
return new WindowsNegotiateScheme(AuthSchemes.SPNEGO, servicePrincipalName); | 0 |
if (isClosed()) {
return false;
} | 0 |
/*
public void testMultipleThreads1() throws Exception {
ds.setMaxWaitMillis(-1);
ds.setMaxTotal(5);
ds.setMaxOpenPreparedStatements(-1);
multipleThreads(5, false, false, -1, 3, 100, 10000);
}
*/ | 0 |
* Please note access to the internal structures of this class is not
* synchronized and therefore this class may be thread-unsafe. | 0 |
import com.google.common.util.concurrent.AbstractIdleService;
class JobUpdateEventSubscriber extends AbstractIdleService implements PubsubEvent.EventSubscriber {
// TODO(ksweeney): Investigate letting this exception propagate up.
@Override
protected void startUp() {
@Override
protected void shutDown() {
// Ignored. VM shutdown is required to stop processing updates.
} | 0 |
import java.util.concurrent.ConcurrentSkipListSet;
private final CompactionWaitInfo compactionWaitInfo = new CompactionWaitInfo();
log.debug("Writing updated status to metadata table for " + logEntry.filename + " " + ProtobufUtil.toString(status));
ReplicationTableUtil.updateFiles(tabletServer, extent, logEntry.filename, status);
currentLogs = new ConcurrentSkipListSet<DfsLogger>();
currentLogs.add(new DfsLogger(tabletServer.getServerConfig(), logEntry.filename, logEntry.getColumnQualifier().toString()));
String oldName = Thread.currentThread().getName();
Thread.currentThread().setName("Minor compacting " + this.extent);
Thread.currentThread().setName(oldName);
currentLogs = new ConcurrentSkipListSet<DfsLogger>();
private ConcurrentSkipListSet<DfsLogger> currentLogs = new ConcurrentSkipListSet<DfsLogger>();
public Set<DfsLogger> getCurrentLogFiles() {
return new HashSet<DfsLogger>(currentLogs);
public int getLogCount() {
public boolean beginUpdatingLogsUsed(InMemoryMap memTable, DfsLogger more, boolean mincFinish) {
if (addToOther) {
if (otherLogs.add(more))
numAdded++;
if (currentLogs.contains(more))
numContained++;
} else {
if (currentLogs.add(more))
numAdded++;
if (otherLogs.contains(more))
numContained++;
if (numAdded > 0 && numAdded != 1) {
if (numContained > 0 && numContained != 1) { | 0 |
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a> | 0 |
// Check if the boot package is wildcarded.
if (m_bootPkgWildcards[i])
// A wildcarded boot package will be in the form "foo.",
// so a matching subpackage will start with "foo.", e.g.,
// "foo.bar".
if (pkgName.startsWith(m_bootPkgs[i]))
{
return true;
}
// If we have "foo." as our wildcarded boot package, then
// the package "foo" should be delegated too, but we don't
// want to delegate "foobar", so we check to make sure the
// package names are the same length and then perform a
// region match to ignore the "." on "foo.".
else if ((pkgName.length() == m_bootPkgs[i].length() - 1)
&& pkgName.regionMatches(0, m_bootPkgs[i], 0, m_bootPkgs[i].length() - 1))
{
return true;
}
}
// If not wildcarded, then check for an exact match.
else if (m_bootPkgs[i].equals(pkgName))
{
return true; | 0 |
/**
* Delay the Observer's participation in a leader election upon disconnect
* so as to prevent unexpected additional load on the voting peers during
* the process. Default value is 200.
*/
public static final String OBSERVER_ELECTION_DELAY_MS =
"zookeeper.observer.election.DelayMs";
private static volatile long observerElectionDelayMs;
observerElectionDelayMs = Long.getLong(OBSERVER_ELECTION_DELAY_MS, 200);
LOG.info(OBSERVER_ELECTION_DELAY_MS + " = " + observerElectionDelayMs);
waitForReconnectDelayHelper(reconnectDelayMs);
}
static void waitForObserverElectionDelay(){
waitForReconnectDelayHelper(observerElectionDelayMs);
}
private static void waitForReconnectDelayHelper(long delayValueMs){
if (delayValueMs > 0) {
long randomDelay = (long) (delayValueMs * Math.random());
public static long getObserverElectionDelayMs(){
return observerElectionDelayMs;
}
public static void setObserverElectionDelayMs(long electionDelayMs) {
observerElectionDelayMs = electionDelayMs;
LOG.info(OBSERVER_ELECTION_DELAY_MS + " = " + observerElectionDelayMs);
} | 0 |
final int start = entryPath.lastIndexOf( '/' ) + 1 + fileName.length(); // path, slash and base name | 0 |
import org.apache.aurora.scheduler.mesos.Driver; | 0 |
* @author <a href="mailto:[email protected]">Felix Project Team</a> | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetNextRule.java,v 1.19 2004/01/10 17:38:19 rdonkin Exp $
* $Revision: 1.19 $
* $Date: 2004/01/10 17:38:19 $
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* nor may "Apache" appear in their names without prior
* @version $Revision: 1.19 $ $Date: 2004/01/10 17:38:19 $ | 0 |
* Output stream that cuts off after a defined number of bytes. This class
* is used to send content of HTTP messages where the end of the content entity
* is determined by the value of the <code>Content-Length header</code>.
* Entities transferred using this stream can be maximum {@link Long#MAX_VALUE}
* long. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.