Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
for (Map.Entry<String, String> entry : m.entrySet()) {
JaxbMapKeyVal jaxbMap = new JaxbMapKeyVal(entry.getKey(), entry.getValue()); | 0 |
import org.apache.aurora.scheduler.storage.db.EnumBackfill;
final EnumBackfill enumBackfill = createMock(EnumBackfill.class);
TemporaryStorageFactory factory =
new TemporaryStorageFactory(TaskTestUtil.THRIFT_BACKFILL, enumBackfill); | 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 |
this.writer = writer;
@Override
| 0 |
package org.apache.felix.karaf.gshell.admin.internal.commands;
import org.apache.felix.karaf.gshell.admin.Instance; | 0 |
* @since 1.5
/** VPay (Visa) Card Validator
* @since 1.5
*/ | 0 |
import cz.seznam.euphoria.beam.common.InputToKvDoFn;
/**
* {@link OperatorTranslator Translator } for Euphoria {@link Join} operator.
*/
private <K, LeftT, RightT, OutputT, W extends Window<W>> JoinFn<LeftT, RightT, K, OutputT>
chooseJoinFn(
| 0 |
import org.apache.http.impl.io.ChunkedOutputStream;
import org.apache.http.impl.io.ContentLengthOutputStream;
import org.apache.http.impl.io.IdentityOutputStream; | 0 |
this(objectStrings, c, null);
ClassNotFoundException, IOException {
this();
| 0 |
protected Map createProcEnvironment() throws IOException { | 0 |
LOG.debug("Changed working set for update to " + filterByStatus(instances, WORKING)); | 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 |
import org.apache.sshd.util.test.BaseTestSupport; | 0 |
package aQute.bnd.annotation.component;
public enum ConfigurationPolicy {
optional, require, ignore;
} | 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 com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
/**
* The key property ids for a HostComponentProcess resource.
*/
private static Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder()
.put(Resource.Type.Cluster, HC_PROCESS_CLUSTER_NAME_ID)
.put(Resource.Type.Host, HC_PROCESS_HOST_NAME_ID)
.put(Resource.Type.Component, HC_PROCESS_COMPONENT_NAME_ID)
.put(Resource.Type.HostComponent, HC_PROCESS_COMPONENT_NAME_ID)
.put(Resource.Type.HostComponentProcess, HC_PROCESS_NAME_ID)
.build();
/**
* The property ids for a HostComponentProcess resource.
*/
private static Set<String> propertyIds = Sets.newHashSet(
HC_PROCESS_NAME_ID,
HC_PROCESS_STATUS_ID,
HC_PROCESS_CLUSTER_NAME_ID,
HC_PROCESS_HOST_NAME_ID,
HC_PROCESS_COMPONENT_NAME_ID);
* @param amc the management controller
HostComponentProcessResourceProvider(AmbariManagementController amc) {
super(Resource.Type.HostComponentProcess, propertyIds, keyPropertyIds, amc);
return new HashSet<>(keyPropertyIds.values()); | 0 |
Set<PropertyDependencyInfo> setOfDependencyInfo = new HashSet<>();
andReturn(new HashSet<>(Arrays.asList(
stackConfigurationResponse, stackConfigurationResponse2))).anyTimes();
expect(stackServiceResponse.getExcludedConfigTypes()).andReturn(Collections.singleton(testSiteConfigType)); | 1 |
buf.putInt(SshConstants.SSH_EXTENDED_DATA_STDERR); | 0 |
@QueryParam("excludeDeletedEntities") boolean excludeDeletedEntities,
return atlasDiscoveryService.searchUsingFullTextQuery(query, excludeDeletedEntities, limit, offset);
public AtlasSearchResult searchUsingBasic(@QueryParam("query") String query,
@QueryParam("typeName") String typeName,
@QueryParam("classification") String classification,
@QueryParam("excludeDeletedEntities") boolean excludeDeletedEntities,
@QueryParam("limit") int limit,
@QueryParam("offset") int offset) throws AtlasBaseException {
return atlasDiscoveryService.searchUsingBasicQuery(query, typeName, classification, null, null,
excludeDeletedEntities, limit, offset);
public AtlasSearchResult searchUsingAttribute(@QueryParam("attrName") String attrName,
@QueryParam("typeName") String typeName,
@QueryParam("limit") int limit,
@QueryParam("offset") int offset) throws AtlasBaseException {
return atlasDiscoveryService.searchUsingBasicQuery(null, typeName, null, attrName, attrValuePrefix, true, limit, offset); | 0 |
import org.apache.http.impl.nio.DefaultHttpServerIODispatch;
IOEventDispatch ioEventDispatch = new DefaultHttpServerIODispatch(protocolHandler, connFactory); | 0 |
baos.write(header.getBytes("US-ASCII"));
baos.write("\r\n".getBytes("US-ASCII"));
baos.write("-----1234--\r\n".getBytes("US-ASCII")); | 0 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
import org.apache.batik.util.SVGConstants;
if (getType().equals(SVGConstants.CSS_MIME_TYPE)) {
if (hasAttributeNS(null, SVG_TYPE_ATTRIBUTE))
return getAttributeNS(null, SVG_TYPE_ATTRIBUTE);
else
return SVGConstants.CSS_MIME_TYPE; | 0 |
throw new IllegalStateException("union tag " + unionTag
+ " has no corresponding tuple tag in the result schema");
throw new IllegalArgumentException("TupleTag " + tag
+ " is not in the schema"); | 0 |
return HttpVersion.get(major, minor); | 0 |
if (cd != null) {
cd = cd.toLowerCase();
if (cd.startsWith(FORM_DATA) || cd.startsWith(ATTACHMENT)) {
ParameterParser parser = new ParameterParser();
parser.setLowerCaseNames(true);
// Parameter parser can handle null input
Map params = parser.parse(cd, ';');
if (params.containsKey("filename")) {
fileName = (String) params.get("filename");
if (fileName != null) {
fileName = fileName.trim();
} else {
// Even if there is no value, the parameter is present, so
// we return an empty file name rather than no file name.
fileName = "";
}
if (cd != null && cd.toLowerCase().startsWith(FORM_DATA)) { | 0 |
private String mpackUri;
public String getMpackUri() {
return mpackUri;
public void setMpackUri(String mpackUri) {
this.mpackUri = mpackUri;
equalsBuilder.append(mpackName, that.mpackName);
equalsBuilder.append(mpackVersion, that.mpackVersion);
return Objects.hash(mpackId, mpackName, mpackVersion);
buffer.append(", mpackUri=").append(mpackUri); | 0 |
private final long time;
if (timestamp != null) {
this.time = timestamp.getTime();
} else {
this.time = 0;
}
return new Date(this.time);
buffer.append(new Date(this.time)); | 0 |
/*
* Copyright 2015 Data Artisans GmbH
* 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 | 0 |
package org.apache.beam.runners.core;
import org.apache.beam.runners.core.LateDataDroppingDoFnRunner.LateDataFilter;
import org.apache.beam.sdk.util.TimerInternals;
import org.apache.beam.sdk.util.WindowedValue;
import org.apache.beam.sdk.util.WindowingStrategy; | 0 |
/**
* @return Some identifier useful as {@link #toString()} value
*/
Object getId(); | 0 |
this.conf = master.getConfiguration(); | 1 |
/**
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Creates a command line.
* Query to see if an option has been set.
* Query to see if an option has been set.
* Return the <code>Object</code> type of this <code>Option</code>.
* Return the <code>Object</code> type of this <code>Option</code>.
* Retrieve the argument, if any, of this option.
* Retrieve the argument, if any, of this option.
* Retrieves the array of values, if any, of an option.
* Retrieves the array of values, if any, of an option.
* Retrieve the argument, if any, of an option.
* Retrieve the argument, if any, of an option.
* Retrieve any left-over non-recognized options and arguments
* Retrieve any left-over non-recognized options and arguments
* Add left-over unrecognized option/argument.
* Add an option to the command line. The values of
* the option are stored.
* Returns an iterator over the Option members of CommandLine.
* Returns an array of the processed {@link Option}s. | 0 |
/** Test usage of hints in different operators. */
/** Test every node in DAG which was unfolded from original operator, if preserves hints. */ | 0 |
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern; | 0 |
/**
* TODO Add javadoc
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/ | 0 |
import java.io.IOException;
import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.impl.io.bootstrap.HttpRequester;
import org.apache.hc.core5.http.impl.io.bootstrap.RequesterBootstrap;
import org.apache.hc.core5.http.io.ResponseHandler;
* Example of POST request with trailers execution using classic I/O.
public class ClassicPostWithTrailersExecutionExample {
HttpRequester httpRequester = RequesterBootstrap.bootstrap().create();
try (DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 1024)) {
HttpCoreContext coreContext = HttpCoreContext.create();
ClassicHttpRequest request = new BasicClassicHttpRequest("POST", host, "/");
HttpEntity requestBody = new HttpEntityWithTrailers(
new StringEntity("Chunked message with trailers", ContentType.TEXT_PLAIN),
new BasicHeader("t1","Hello world"));
request.setEntity(requestBody);
System.out.println(">> Request URI: " + request.getUri());
httpRequester.execute(conn, request, coreContext, new ResponseHandler<Void>() {
@Override
public Void handleResponse(final ClassicHttpResponse response) throws HttpException, IOException {
System.out.println("<< Response: " + response.getCode());
System.out.println(EntityUtils.toString(response.getEntity()));
System.out.println("==============");
return null;
}
});
} | 0 |
import org.apache.http.ConnectionClosedException;
doExecute(handler, conn);
return handler.getFuture();
}
private <T> void doExecute(
final HttpAsyncRequestExecutionHandler<T> handler, final NHttpClientConnection conn) {
if (!conn.isOpen()) {
handler.failed(new ConnectionClosedException("Connection closed"));
try {
handler.close();
} catch (IOException ex) {
log(ex);
}
}
doExecute(handler, conn); | 0 |
static public InetSocketAddress parseAddress(String address, int defaultPort) throws NumberFormatException {
final String[] parts = address.split(":", 2);
if (parts.length == 2) {
if (parts[1].isEmpty()) return new InetSocketAddress(parts[0], defaultPort);
return new InetSocketAddress(parts[0], Integer.parseInt(parts[1]));
return new InetSocketAddress(address, defaultPort);
}
static public InetSocketAddress parseAddress(Text address, int defaultPort) {
return parseAddress(address.toString(), defaultPort);
}
static public TSocket createTSocket(String address, int defaultPort) {
InetSocketAddress addr = parseAddress(address, defaultPort);
return new TSocket(addr.getHostName(), addr.getPort());
}
static public String toString(InetSocketAddress addr) {
return addr.getAddress().getHostAddress() + ":" + addr.getPort();
}
| 1 |
* Java 5, Sun Java 6. It's also pretty close to IE6. This implementation
* appears to be compliant with RFC 2818 for dealing with wildcards. | 0 |
TableConfiguration acuTableConf = ServerConfiguration.getTableConfiguration(instance, session.threadPoolExtent.getTableId().toString());
long maxResultsSize = acuTableConf.getMemoryInBytes(Property.TABLE_SCAN_MAXMEM); | 0 |
package org.apache.felix.sigil.ui.eclipse.ui.editors.project;
import org.apache.felix.sigil.eclipse.SigilCore;
import org.apache.felix.sigil.model.common.VersionRange;
import org.apache.felix.sigil.model.common.VersionRangeBoundingRule;
import org.apache.felix.sigil.model.osgi.IVersionedModelElement;
import org.apache.felix.sigil.ui.eclipse.ui.util.BackgroundLoadingSelectionDialog;
import org.apache.felix.sigil.ui.eclipse.ui.util.IValidationListener; | 0 |
private static final ImmutableMap<SqlTypeName, FieldType> CALCITE_TO_BEAM_TYPE_MAPPING =
ImmutableMap.<SqlTypeName, FieldType>builder()
.put(SqlTypeName.TINYINT, TINY_INT)
.put(SqlTypeName.SMALLINT, SMALL_INT)
.put(SqlTypeName.INTEGER, INTEGER)
.put(SqlTypeName.BIGINT, BIG_INT)
.put(SqlTypeName.FLOAT, FLOAT)
.put(SqlTypeName.DOUBLE, DOUBLE)
.put(SqlTypeName.DECIMAL, DECIMAL)
.put(SqlTypeName.BOOLEAN, BOOLEAN)
.put(SqlTypeName.VARBINARY, VARBINARY)
.put(SqlTypeName.BINARY, VARBINARY)
.put(SqlTypeName.VARCHAR, VARCHAR)
.put(SqlTypeName.CHAR, CHAR)
.put(SqlTypeName.DATE, DATE)
.put(SqlTypeName.TIME, TIME)
.put(SqlTypeName.TIME_WITH_LOCAL_TIME_ZONE, TIME_WITH_LOCAL_TZ)
.put(SqlTypeName.TIMESTAMP, TIMESTAMP)
.put(SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE, TIMESTAMP_WITH_LOCAL_TZ)
.build(); | 0 |
if (EphemeralTypeEmulate353.get(ephemeralOwner) == EphemeralTypeEmulate353.TTL) { | 0 |
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
import org.apache.commons.beanutils.converters.DateConverter;
public void testConvertToString() throws Exception {
ConvertUtilsBean utils = new ConvertUtilsBean();
// Register a DateConverter using Locale.US
DateConverter dateConverter = new DateConverter();
dateConverter.setLocale(Locale.US);
utils.register(dateConverter, java.util.Date.class);
java.util.Date today = new java.util.Date();
DateFormat fmt = new SimpleDateFormat("M/d/yy"); /* US Short Format */
String expected = fmt.format(today);
assertEquals("date M/d/yy", expected, utils.convert(today, String.class));
// Remove the registered DateConverter
utils.deregister(java.util.Date.class);
assertEquals("Date.toString()", today.toString(), utils.convert(today, String.class));
}
| 0 |
import org.apache.felix.service.command.CommandProcessor;
import org.apache.felix.service.command.CommandSession;
import org.apache.felix.service.command.Converter; | 0 |
int v = c.charValue(); | 0 |
private static final long serialVersionUID = -2242528405240201000L; | 0 |
public interface AsyncClientExchangeHandler extends AsyncDataExchangeHandler { | 0 |
super(org.apache.commons.bcel6.Const.L2D); | 0 |
/*
* Copyright 2013 Twitter, Inc.
*
* 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 |
this.directives = computeDirectives();
return requirement.getAttributes();
Map<String, String> result;
if (requirement.getDirectives() == null)
result = new HashMap<String, String>();
else
result = new HashMap<String, String>(requirement.getDirectives());
* of the filter.
* (2) service references removed
* (3) objectClass capitalised
* (4) The namespaces must be translated.
String filter = requirement.getFilter().replaceAll("\\(mandatory\\:\\<\\*[^\\)]*\\)", "")
.replaceAll("\\(service\\=[^\\)]*\\)", "").replaceAll("objectclass", "objectClass");
for (String ns : NamespaceTranslator.getTranslatedFelixNamespaces())
{
filter = filter.replaceAll("[(][ ]*" + ns + "[ ]*=",
"(" + NamespaceTranslator.getOSGiNamespace(ns) + "=");
}
result.put(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter);
if (requirement.isOptional())
result.put(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE, Namespace.RESOLUTION_OPTIONAL);
if (requirement.isMultiple())
result.put(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE, Namespace.CARDINALITY_MULTIPLE);
| 0 |
@SerializedName("clusterLevelParams")
private Map<String, String> clusterLevelParams = new HashMap<>();
private boolean overrideConfigs = false;
public Map<String, String> getClusterLevelParams() {
return clusterLevelParams;
}
public void setClusterLevelParams(Map<String, String> clusterLevelParams) {
this.clusterLevelParams = clusterLevelParams;
}
public boolean isOverrideConfigs() {
return overrideConfigs;
public void setOverrideConfigs(boolean overrideConfigs) {
this.overrideConfigs = overrideConfigs;
* A boolean indicating whether configurations should be added to execution command
* before sending.
String OVERRIDE_CONFIGS = "overrideConfigs";
String OVERRIDE_STACK_NAME = "overrideStackName"; | 0 |
@Override | 0 |
public void addError(String error) {
public Collection<String> getErrors() {
public void addErrors(Collection<String> errors) {
this.errorSet.addAll(errors); | 0 |
package org.apache.beam.runners.core;
import org.apache.beam.sdk.util.KeyedWorkItem;
import org.apache.beam.sdk.util.WindowedValue; | 0 |
Property minThreadProperty,
Property timeBetweenThreadChecksProperty,
Property maxMessageSizeProperty) throws UnknownHostException {
long maxMessageSize = 10 * 1000 * 1000;
if (maxMessageSizeProperty != null)
maxMessageSize = conf.getMemoryInBytes(maxMessageSizeProperty);
return TServerUtils.startTServer(port, processor, serverName, threadName, minThreads, timeBetweenThreadChecks, maxMessageSize);
long timeBetweenThreadChecks, long maxMessageSize) throws TTransportException {
public static ServerPort startTServer(int port, TProcessor processor, String serverName, String threadName, int numThreads, long timeBetweenThreadChecks, long maxMessageSize)
ServerPort result = startHsHaServer(port, processor, serverName, threadName, numThreads, timeBetweenThreadChecks, maxMessageSize); | 0 |
/*
* Copyright 2002, 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @version $Id: ProviderTestSuite.java,v 1.15 2004/02/28 03:35:53 bayard Exp $ | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css.engine.sac;
import org.w3c.css.sac.Condition;
import org.w3c.dom.Element;
/**
* This class provides an implementation of the
* {@link org.w3c.css.sac.CombinatorCondition} interface.
*
* @author <a href="mailto:[email protected]">Stephane Hillion</a>
* @version $Id$
*/
public class CSSAndCondition extends AbstractCombinatorCondition {
/**
* Creates a new CombinatorCondition object.
*/
public CSSAndCondition(Condition c1, Condition c2) {
super(c1, c2);
}
/**
* <b>SAC</b>: Implements {@link
* org.w3c.css.sac.Condition#getConditionType()}.
*/
public short getConditionType() {
return SAC_AND_CONDITION;
}
/**
* Tests whether this condition matches the given element.
*/
public boolean match(Element e, String pseudoE) {
return ((ExtendedCondition)getFirstCondition()).match(e, pseudoE) &&
((ExtendedCondition)getSecondCondition()).match(e, pseudoE);
}
/**
* Returns a text representation of this object.
*/
public String toString() {
return "" + getFirstCondition() + getSecondCondition();
}
} | 0 |
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.Lists; | 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 |
void setJobName(String jobName); | 0 |
import org.apache.ambari.server.AmbariException;
public Map<String, String> getDesiredConfigVersionsRecursive();
public Map<String, Config> getConfigs() throws AmbariException; | 1 |
* @version $Id$ | 0 |
public static <T> Predicate<T> onePredicate(final Collection<? extends Predicate<? super T>> predicates) { | 0 |
import java.util.concurrent.ConcurrentHashMap;
protected final Map<SocketAddress, Channel> boundAddresses = new ConcurrentHashMap<>();
.channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 100) // TODO make this configurable
.handler(new LoggingHandler(LogLevel.INFO)) // TODO make this configurable
.childHandler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
@SuppressWarnings("resource")
NettyIoSession nettyIoSession = new NettyIoSession(NettyIoAcceptor.this, handler);
p.addLast(nettyIoSession.adapter);
}
});
Channel channel = boundAddresses.remove(address);
Channel channel = boundAddresses.remove(address); | 1 |
/*
* 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.commons.jxpath.servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* Just a structure to hold a ServletRequest and ServletContext together.
*
* @author Dmitri Plotnikov
* @version $Revision: 1.1 $ $Date: 2004/05/08 15:10:49 $
*/
public class ServletRequestAndContext extends
HttpSessionAndServletContext
{
private ServletRequest request;
public ServletRequestAndContext(ServletRequest request,
ServletContext context)
{
super(null, context);
this.request = request;
}
public HttpSession getSession() {
if (request instanceof HttpServletRequest) {
return ((HttpServletRequest)request).getSession(false);
}
return null;
}
public ServletRequest getServletRequest() {
return request;
}
} | 0 |
import org.apache.xml.security.samples.SampleUtils;
Element nscontext = SampleUtils.createDSctx(doc, "ds", | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v 1.5 2003/12/29 15:08:15 scolebourne Exp $
* @version $Revision: 1.5 $ $Date: 2003/12/29 15:08:15 $
public boolean equals(Object obj) {
if (obj == this) {
if (obj instanceof Map.Entry == false) {
Map.Entry e2 = (Map.Entry) obj;
public Object setValue(Object obj) {
value = obj;
public boolean contains(Object obj) {
Map.Entry entry = (Map.Entry) obj;
Map.Entry entry = (Map.Entry) obj;
public boolean contains(Object obj) {
return StaticBucketMap.this.containsKey(obj);
public boolean remove(Object obj) {
int hash = getHash(obj);
if ((k == obj) || ((k != null) && k.equals(obj))) { | 0 |
ByteBuffer _elem2; // required
ByteBuffer _elem7; // required | 0 |
import org.apache.ambari.logfeeder.conf.LogFeederSecurityConfig;
import org.apache.ambari.logfeeder.conf.MetricsCollectorConfig;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
private HashMap<String, TimelineMetric> metricsMap = new HashMap<>();
@Inject
private MetricsCollectorConfig metricsCollectorConfig;
@Inject
private LogFeederSecurityConfig logFeederSecurityConfig;
@PostConstruct
amsClient = new LogFeederAMSClient(metricsCollectorConfig, logFeederSecurityConfig); | 0 |
import java.nio.charset.Charset;
private static final Charset utf8 = Charset.forName("UTF8");
store.put(Constants.ZROOT_TABLET_FUTURE_LOCATION, value.getBytes(utf8));
store.put(Constants.ZROOT_TABLET_LOCATION, value.getBytes(utf8));
store.put(Constants.ZROOT_TABLET_LAST_LOCATION, value.getBytes(utf8)); | 0 |
package com.twitter.aurora.scheduler.stats;
import com.twitter.aurora.gen.Quota;
import com.twitter.aurora.gen.TwitterTaskInfo;
import com.twitter.aurora.scheduler.base.Query;
import com.twitter.aurora.scheduler.base.Tasks;
import com.twitter.aurora.scheduler.configuration.ConfigurationManager;
import com.twitter.aurora.scheduler.storage.Storage;
import com.twitter.aurora.scheduler.storage.Storage.StorageException;
import com.twitter.aurora.scheduler.storage.Storage.StoreProvider;
import com.twitter.aurora.scheduler.storage.Storage.Work; | 1 |
* @version $Revision$ | 0 |
import java.io.*;
Result result;
StringWriter buffer = null;
if (isSchemaValidation())
{
buffer = new StringWriter();
result = new StreamResult(buffer);
}
else
{
result = new StreamResult(writer);
}
if (isSchemaValidation())
{
DocumentBuilder builder = createDocumentBuilder();
Reader reader = new StringReader(buffer.getBuffer().toString());
builder.parse(new InputSource(reader));
writer.write(buffer.getBuffer().toString());
writer.close();
}
}
catch (SAXException e)
{
throw new ConfigurationException("Unable to save the configuration", e);
}
catch (ParserConfigurationException e)
{
throw new ConfigurationException("Unable to save the configuration", e);
}
catch (IOException e)
{
throw new ConfigurationException("Unable to save the configuration", e); | 0 |
Map<String,Variant> variants = null;
variants = responseCache.getVariantCacheEntriesWithEtags(target, request);
if (variants != null && variants.size() > 0) {
return negotiateResponseFromVariants(target, request, context, variants);
Map<String, Variant> variants) throws IOException, ProtocolException {
HttpRequest conditionalRequest = conditionalRequestBuilder.buildConditionalRequestFromVariants(request, variants);
Variant matchingVariant = variants.get(resultEtag);
if (matchingVariant == null) {
HttpCacheEntry matchedEntry = matchingVariant.getEntry();
| 0 |
decryptInputStream = applyTransforms(referenceType, decryptInputStream);
protected InputStream applyTransforms(ReferenceType referenceType, InputStream inputStream) throws XMLSecurityException {
return inputStream;
}
| 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.scrplugin;
import java.util.List;
/**
* The result of the generation.
*/
public class Result {
/** The list of metatype files. */
private List<String> metatypeFiles;
/** The list of scr files. */
private List<String> scrFiles;
/**
* Set the list of metatype files
*/
public void setMetatypeFiles(List<String> metatypeFiles) {
this.metatypeFiles = metatypeFiles;
}
/**
* Set the list of scr files
*/
public void setScrFiles(List<String> scrFiles) {
this.scrFiles = scrFiles;
}
/**
* Return a list of generated metatype files
* @return A list of relative paths or <code>null</code>
*/
public List<String> getMetatypeFiles() {
return metatypeFiles;
}
/**
* Return a list of generated scr files
* @return A list of relative paths or <code>null</code>
*/
public List<String> getScrFiles() {
return scrFiles;
}
} | 0 |
List<String> policies = new ArrayList<>();
Map<String, List<AtlasActionTypes>> groupMap = new HashMap<>();
List<AtlasActionTypes> accessList1 = new ArrayList<>();
List<AtlasActionTypes> accessList2 = new ArrayList<>();
Map<String, List<AtlasActionTypes>> usersMap = new HashMap<>();
List<AtlasActionTypes> usr1AccessList = new ArrayList<>();
List<AtlasActionTypes> usr2AccessList = new ArrayList<>();
Map<AtlasResourceTypes, List<String>> resourceMap = new HashMap<>();
List<String> resource1List = new ArrayList<>();
List<String> resource2List = new ArrayList<>();
List<String> resource3List = new ArrayList<>();
List<String> policies = new ArrayList<>();
Map<String, List<AtlasActionTypes>> groupMap = new HashMap<>();
List<AtlasActionTypes> accessList1 = new ArrayList<>();
List<AtlasActionTypes> accessList2 = new ArrayList<>();
Map<String, List<AtlasActionTypes>> usersMap = new HashMap<>();
Map<AtlasResourceTypes, List<String>> resourceMap = new HashMap<>();
List<String> resource1List = new ArrayList<>();
List<String> resource2List = new ArrayList<>();
List<String> resource3List = new ArrayList<>();
List<String> policies = new ArrayList<>();
Map<String, List<AtlasActionTypes>> groupMap = new HashMap<>();
Map<String, List<AtlasActionTypes>> usersMap = new HashMap<>();
List<AtlasActionTypes> usr1AccessList = new ArrayList<>();
List<AtlasActionTypes> usr2AccessList = new ArrayList<>();
Map<AtlasResourceTypes, List<String>> resourceMap = new HashMap<>();
List<String> resource1List = new ArrayList<>();
List<String> resource2List = new ArrayList<>();
List<String> resource3List = new ArrayList<>(); | 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
assertNotNull(new DigestUtils()); | 0 |
public static void unreserveTable(Master env, Table.ID tableId, long tid, boolean writeLock) {
boolean writeLock) {
private static Lock getLock(ServerContext context, AbstractId id, long tid, boolean writeLock) {
public static Lock getReadLock(Master env, AbstractId tableId, long tid) { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/jmx/src/java/org/apache/commons/jelly/tags/jmx/ServerTag.java,v 1.2 2003/10/09 21:21:21 rdonkin Exp $
* $Revision: 1.2 $
* $Date: 2003/10/09 21:21:21 $
* 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.
* $Id: ServerTag.java,v 1.2 2003/10/09 21:21:21 rdonkin Exp $
* @version $Revision: 1.2 $ | 0 |
package org.apache.beam.sdk.extensions.euphoria.core.client.operator;
import org.apache.beam.sdk.extensions.euphoria.core.annotation.audience.Audience;
import org.apache.beam.sdk.extensions.euphoria.core.annotation.operator.Derived;
import org.apache.beam.sdk.extensions.euphoria.core.annotation.operator.StateComplexity;
import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.Dataset;
import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.Window;
import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.Windowing;
import org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.BinaryFunction;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.CombinableReduceFunction;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.ReduceFunction;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.ReduceFunctor;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.UnaryFunction;
import org.apache.beam.sdk.extensions.euphoria.core.client.io.Collector;
import org.apache.beam.sdk.extensions.euphoria.core.client.util.Pair;
import org.apache.beam.sdk.extensions.euphoria.core.executor.graph.DAG;
import javax.annotation.Nullable; | 0 |
float PixSzMM = userAgent.getPixelUnitToMillimeter();
// num Pixs in 100 Meters
int numPix = (int)(((1000*100)/PixSzMM)+0.5); | 0 |
public Set<String> getPropertyIds(); | 1 |
import org.testng.annotations.BeforeClass;
import org.testng.asserts.SoftAssert;
public SoftAssert SOFT_ASSERT;
@BeforeClass
public void beforeClass() {
SOFT_ASSERT = new SoftAssert();
} | 0 |
@Override | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedShortList.java,v 1.6 2003/04/13 22:30:57 rwaldhoff Exp $
* @version $Revision: 1.6 $ $Date: 2003/04/13 22:30:57 $
public class ArrayUnsignedShortList extends RandomAccessIntList implements IntList, Serializable { | 0 |
/**
* Quote an input string if necessary.
* If the string is enclosed in double-quotes it is assumed
* to be quoted already and is returned unchanged.
* If it is the empty string, "" is returned.
* If it contains a space
* then it is enclosed in double quotes, escaping the
* characters backslash and double-quote.
*
* @param input the value to be quoted, may be null
* @return the quoted value
*/
static String quoteString(String input) {
if (input == null) { // Don't throw NPE here
return null;
}
if (input.isEmpty()) {
return "\"\""; // return the string ""
}
// Length check is necessary to ensure a lone double-quote is quoted
if (input.length() > 1 && input.startsWith("\"") && input.endsWith("\"")) {
return input; // Assume already quoted
}
if (input.contains(" ")) {
// quoted strings must escape \ and "
return "\"" + input.replaceAll("([\\\\\"])", "\\\\$1") + "\"";
}
return input;
} | 0 |
package org.apache.felix.dm.test.integration.api;
import org.apache.felix.dm.test.components.Ensure;
import org.apache.felix.dm.test.integration.common.TestBase; | 0 |
final Builder<T, ?, ?, ?> cast = (Builder) this;
cast.input = input;
return cast;
final Builder<InputT, T, InputT, ?> cast = (Builder) this;
cast.keyExtractor = requireNonNull(keyExtractor);
cast.keyType = keyType;
return cast;
final Builder<InputT, KeyT, T, ?> cast = (Builder) this;
cast.valueExtractor = requireNonNull(valueExtractor);
cast.valueType = valueType;
return cast;
final Builder<InputT, KeyT, ValueT, T> cast = (Builder) this;
cast.reducer = requireNonNull(reducer);
cast.outputType = outputType;
return cast; | 0 |
import java.util.Collection;
import org.apache.beam.sdk.transforms.display.DisplayData.Item; | 0 |
throw new BindingException("Error creating binding from " + source.getURI(), e);
throw new BindingException("Error resolving binding source: " + bindingURI);
binding = getBuilderAssistant().getBindingForConfigurationElement(bindingElement);
throw new BindingException("Cannot handle binding element '" + bindingType + "'.", e);
Library lib = new Library(libraryManager, getBuilderAssistant());
} catch (LibraryException e) {
if (existingBindings == null) {
}
if (context.getLocalLibrary() != null && childElements[i].getAttribute("extends") != null) {
if (context.getSuperBinding() == null) {
// not found in library
context.setSuperBinding(getBindingByIdOrPath(id, path, existingBindings));
}
} catch (LibraryException e) { | 0 |
*
serviceHandler,
}
| 0 |
* @param message the exception detail message, or {@code null} | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
public void addErrorServlet(String errorPage, ServletHandler handler) throws ServletException
{
// TODO
}
| 0 |
import cz.seznam.euphoria.core.client.io.MockStreamDataSource;
private Flow flow;
flow = Flow.create("TestFlow");
Dataset<Object> input = flow.createInput(new MockStreamDataSource<>()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractLongCollection.java,v 1.2 2003/08/31 17:21:14 scolebourne Exp $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* @version $Revision: 1.2 $ $Date: 2003/08/31 17:21:14 $ | 0 |
return ExceptionConstants.createExceptions(ExceptionConstants.EXCS.EXCS_FIELD_AND_METHOD_RESOLUTION,
ExceptionConstants.NULL_POINTER_EXCEPTION,
ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR,
ExceptionConstants.ABSTRACT_METHOD_ERROR,
ExceptionConstants.UNSATISFIED_LINK_ERROR); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.