Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
package org.apache.felix.dm.test.annotation;
public interface Sequencer
{
void next(int step);
} | 0 |
import org.apache.commons.collections.iterators.IteratorChain;
@SuppressWarnings("unchecked")
IteratorChain chain = new IteratorChain();
for (Range range : ranges) {
SortedKeyValueIterator<Key,Value> i = new SortedMapIterator(table.table);
try {
i = new RangesFilter(createFilter(i), ranges);
i.seek(range, createColumnBSS(fetchedColumns), !fetchedColumns.isEmpty());
chain.addIterator(new IteratorAdapter(i));
} catch (IOException e) {
throw new RuntimeException(e);
}
return chain; | 0 |
package com.twitter.mesos.scheduler.async;
import org.apache.mesos.Protos.FrameworkID;
import org.apache.mesos.Protos.Offer;
import org.apache.mesos.Protos.OfferID;
import org.apache.mesos.Protos.SlaveID;
/**
* Utility class for creating resource offers.
*/
final class Offers {
private Offers() {
// Utility class.
}
static final String DEFAULT_HOST = "hostname";
static Offer makeOffer(String offerId) {
return Offers.makeOffer(offerId, DEFAULT_HOST);
}
static Offer makeOffer(String offerId, String hostName) {
return Offer.newBuilder()
.setId(OfferID.newBuilder().setValue(offerId))
.setFrameworkId(FrameworkID.newBuilder().setValue("framework_id"))
.setSlaveId(SlaveID.newBuilder().setValue("slave_id-" + offerId))
.setHostname(hostName)
.build();
}
} | 0 |
copyFilteredResourceToDir(karafBase, "bin/karaf.bat", props);
copyFilteredResourceToDir(karafBase, "bin/karaf", props);
chmod(new File(karafBase, "bin/karaf"), "a+x"); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.fileupload.utils.mime;
import static org.junit.Assert.assertEquals;
import org.apache.commons.fileupload.util.mime.MimeUtility;
import org.junit.Test;
/**
* @since 1.3
*/
public final class MimeUtilityTestCase {
@Test
public void testEncodeText() throws Exception {
assertEncoded("abc", "abc");
assertEncoded(" h! u !!!", "=?UTF-8?Q?_h=C3=A9!_=C3=A0=C3=A8=C3=B4u_!!!?=");
assertEncoded(" h! u !!!", "=?UTF-8?B?IGjDqSEgw6DDqMO0dSAhISE=?=");
}
private static void assertEncoded(String expected, String encoded) throws Exception {
assertEquals(expected, MimeUtility.decodeText(encoded));
}
} | 0 |
* @version $Revision: 1.4 $ $Date: 2002/10/25 03:59:10 $
destFolder.createFolder(); | 0 |
* @author John D. McNally
* @version $Revision: 1.5 $ $Date: 2004/02/28 12:18:17 $ | 0 |
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class PortletRegistryImpl extends GenericPortletRegistryImpl
implements StateChangedListener {
protected final Log logger = LogFactory.getLog(getClass()); | 0 |
package org.apache.felix.ipojo.test;
public class FooProvider implements FooService {
public String foo;
public void foo() {
if (foo.equals("foo")) {
foo = "bar";
} else {
foo = "foo";
}
}
} | 0 |
* heartbeating and not in maintenance mode.
*
* @see HostMaintenanceModeCheck
/**
* {@inheritDoc}
*/ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/Attic/Context.java,v 1.6 2002/04/24 13:03:03 jstrachan Exp $
* $Revision: 1.6 $
* $Date: 2002/04/24 13:03:03 $
* $Id: Context.java,v 1.6 2002/04/24 13:03:03 jstrachan Exp $
* @version $Revision: 1.6 $
/**
* @return the Map of variables in this scope
*/
public Map getVariables() {
return variables;
}
/**
* Sets the Map of variables to use
*/
public void setVariables(Map variables) {
this.variables = variables;
} | 0 |
package org.apache.batik.gvt.filter; | 0 |
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.beam.sdk.util.common.ReflectHelpers;
private static final ObjectMapper MAPPER =
new ObjectMapper()
.registerModules(ObjectMapper.findModules(ReflectHelpers.findClassLoader()));
this.serializedPipelineOptions = serializeToJson(options);
public SerializablePipelineOptions(String json) {
this.serializedPipelineOptions = json;
this.options = deserializeFromJson(json);
FileSystems.setDefaultPipelineOptions(options);
}
this.options = deserializeFromJson(serializedPipelineOptions);
private static String serializeToJson(PipelineOptions options) {
try {
return MAPPER.writeValueAsString(options);
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Failed to serialize PipelineOptions", e);
}
}
private static PipelineOptions deserializeFromJson(String options) {
try {
return MAPPER.readValue(options, PipelineOptions.class);
} catch (IOException e) {
throw new IllegalArgumentException("Failed to deserialize PipelineOptions", e);
}
}
@Override
public String toString() {
return serializedPipelineOptions;
} | 0 |
package org.apache.beam.sdk.util; | 0 |
private static Set<String> pkPropertyIds = new HashSet<>(
Arrays.asList(new String[]{STACK_NAME_PROPERTY_ID,
STACK_VERSION_PROPERTY_ID, SERVICE_NAME_PROPERTY_ID}));
final Set<StackServiceRequest> requests = new HashSet<>();
Set<Resource> resources = new HashSet<>(); | 1 |
final LinkedHashMap<Integer,Page> cache = new LinkedHashMap<Integer,Index.Page>();
}
catch (IOException e) {
}
catch (IOException e) {
sb.append(String.format("%s %02d:%02d %20s %s %d\n", indent, number, i, hex(k(i), 0, 4), leaf ? "=="
: "->", c(i)));
throw new IllegalStateException("Invalid key size for Index file. The file is " + this.keySize
+ " and was expected to be " + this.keySize); | 0 |
-1, -1,
DefaultHttpRequestFactory.INSTANCE);
-1, -1,
DefaultHttpRequestFactory.INSTANCE);
-1, -1,
DefaultHttpRequestFactory.INSTANCE);
-1, -1,
DefaultHttpRequestFactory.INSTANCE); | 0 |
import static java.nio.charset.StandardCharsets.UTF_8;
import org.apache.accumulo.core.util.DeprecationUtil;
return DeprecationUtil.makeMockInstance(getInstanceName());
/**
* @deprecated since 1.8.0; use MiniAccumuloCluster or a standard mock framework
*/
@Deprecated
/**
* @deprecated since 1.8.0; use MiniAccumuloCluster or a standard mock framework
*/
@Deprecated | 0 |
import org.apache.beam.sdk.values.PCollectionView;
/**
* Returns whether output was produced by the evaluation of this transform. True if
* {@link #getOutputBundles()} is nonempty, or if pipeline-visible state has changed (for example,
* the contents of a {@link PCollectionView} were updated).
*/
boolean producedOutput(); | 0 |
* @author <a href="mailto:bluetkemeier@s-und-n.de">Björn Lütkemeier</a>
* @version CVS $Id: Environment.java,v 1.5 2003/07/10 13:17:03 cziegeler Exp $ | 0 |
package org.apache.accumulo.tserver;
import org.apache.accumulo.tserver.InMemoryMap.MemoryIterator; | 1 |
import java.util.EnumSet;
import org.eclipse.jetty.server.AbstractConnectionFactory;
import org.eclipse.jetty.server.SslConnectionFactory;
private final Server server;
private final ServerConnector connector;
private final ServletContextHandler handler;
connector = new ServerConnector(server, getConnectionFactory(conf));
connector.setHost(host);
connector.setPort(port);
handler = new ServletContextHandler(ServletContextHandler.SESSIONS | ServletContextHandler.SECURITY);
handler.getSessionHandler().getSessionManager().getSessionCookieConfig().setHttpOnly(true);
handler.setContextPath("/");
// constraint security handler gets instantiated as the default when retrieved
((ConstraintSecurityHandler) handler.getSecurityHandler()).addConstraintMapping(disableTraceConstraint("/"));
}
private static AbstractConnectionFactory getConnectionFactory(AccumuloConfiguration conf) {
EnumSet<Property> requireForSecure = EnumSet.of(Property.MONITOR_SSL_KEYSTORE, Property.MONITOR_SSL_KEYSTOREPASS, Property.MONITOR_SSL_TRUSTSTORE,
Property.MONITOR_SSL_TRUSTSTOREPASS);
if (requireForSecure.stream().map(p -> conf.get(p)).anyMatch(s -> s == null || s.isEmpty())) {
return new HttpConnectionFactory();
return new SslConnectionFactory(sslContextFactory, new HttpConnectionFactory().getProtocol());
private static ConstraintMapping disableTraceConstraint(String where) {
return mapping;
private void stop() {
server.join(); | 0 |
return AtlasAttribute.encodePropertyKey(key);
return AtlasAttribute.decodePropertyKey(key); | 0 |
import java.util.HashMap;
private Map<String, List<Method>> methodByNameMap = new HashMap<String, List<Method>>();
public synchronized void add(Method method) {
List<Method> l = methodByNameMap.get(methodName);
l = new ArrayList<Method>();
public synchronized List<Method> get(String key) {
return methodByNameMap.get(key);
return find(new ClassMap.MethodKey(methodName, args));
}
Method find(ClassMap.MethodKey methodKey) throws AmbiguousException {
List<Method> methodList = get(methodKey.method);
return getMostSpecific(methodList, methodKey.params);
private static Method getMostSpecific(List<Method> methods, Class[] classes)
LinkedList<Method> applicables = getApplicables(methods, classes);
return applicables.getFirst();
LinkedList<Method> maximals = new LinkedList<Method>();
for (Iterator<Method> applicable = applicables.iterator();
Method app = applicable.next();
for (Iterator<Method> maximal = maximals.iterator();
Method max = maximal.next();
return maximals.getFirst();
private static LinkedList<Method> getApplicables(List<Method> methods, Class[] classes) {
LinkedList<Method> list = new LinkedList<Method>();
for (Iterator<Method> imethod = methods.iterator(); imethod.hasNext();) {
Method method = imethod.next(); | 0 |
import org.apache.commons.configuration.tree.ExpressionEngine;
import org.easymock.EasyMock;
* Tests whether a parameters object for a hierarchical configuration can be
* created.
*/
@Test
public void testHierarchical()
{
ExpressionEngine engine = EasyMock.createMock(ExpressionEngine.class);
Map<String, Object> map =
Parameters.hierarchical().setThrowExceptionOnMissing(true)
.setExpressionEngine(engine).setFileName("test.xml")
.setListDelimiter('#').getParameters();
checkBasicProperties(map);
FileBasedBuilderParametersImpl fbp =
FileBasedBuilderParametersImpl.fromParameters(map);
assertEquals("Wrong file name", "test.xml", fbp.getFileHandler()
.getFileName());
assertEquals("Wrong expression engine", engine,
map.get("expressionEngine"));
}
/**
ExpressionEngine engine = EasyMock.createMock(ExpressionEngine.class);
.setExpressionEngine(engine).setListDelimiter('#')
.setSchemaValidation(true).getParameters();
assertEquals("Wrong expression engine", engine,
map.get("expressionEngine")); | 0 |
TreeMap<Long, Double> metricValues = new TreeMap<>(); | 1 |
throw RESTErrorUtil.createRESTException(e.getMessage(), MessageEnums.ERROR_SYSTEM);
if (JSONUtil.isJSONValid(hadoopServiceConfig)) {
throw RESTErrorUtil.createRESTException("Improper JSON", MessageEnums.ERROR_SYSTEM);
SolrUtil.setStart(lastPageQuery, 0);
SolrUtil.setRowCount(lastPageQuery, maxRows);
throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
Date date = DateUtil.getTodayFromDate();
from = DateUtil.convertGivenDateFormatToSolrDateFormat(date); | 0 |
/**
* Sets up the target to have the same list of interceptors
* as the current instance.
*
* @param target object to be initialised
*/
target.requestInterceptors.clear();
target.requestInterceptors.addAll(this.requestInterceptors);
target.responseInterceptors.clear();
target.responseInterceptors.addAll(this.responseInterceptors); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v 1.18 2003/03/15 22:34:22 martinc Exp $
* $Revision: 1.18 $
* $Date: 2003/03/15 22:34:22 $
* @version $Id: FileUpload.java,v 1.18 2003/03/15 22:34:22 martinc Exp $
private int sizeMax = -1;
int boundaryIndex = contentType.indexOf("boundary=");
if (boundaryIndex < 0)
{
throw new FileUploadException(
"the request was rejected because "
+ "no multipart boundary was found");
}
boundaryIndex + 9).getBytes(); | 0 |
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.MoreObjects;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; | 0 |
import org.apache.beam.vendor.grpc.v1.io.grpc.ManagedChannel;
import org.apache.beam.vendor.grpc.v1.io.grpc.Server;
import org.apache.beam.vendor.grpc.v1.io.grpc.stub.CallStreamObserver;
import org.apache.beam.vendor.grpc.v1.io.grpc.stub.StreamObserver; | 0 |
@Mock private DoFn.ArgumentProvider<String, String> mockArgumentProvider;
when(mockArgumentProvider.window()).thenReturn(mockWindow);
OnTimerInvokers.forTimer(fn, timerId).invokeOnTimer(mockArgumentProvider); | 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 |
// Make sure we haven't been interrupted
if (Thread.currentThread().isInterrupted()) {
// The Thread has been interrupted. Invalidate
// any cached values and proceed.
invalidateGeometryCache();
} | 0 |
import org.apache.batik.css.engine.CSSEngine;
import org.apache.batik.dom.svg.SVGDOMImplementation;
BridgeContext ctx = new BridgeContext(userAgent);
SVGOMDocument svgDoc = (SVGOMDocument)document;
svgDoc.setSVGContext(svgCtx);
* Returns this user agent's alternate style-sheet title.
*/
public String getAlternateStyleSheet() {
return (String)hints.get(KEY_ALTERNATE_STYLESHEET);
}
/**
* <TD VALIGN="TOP">Specify the alternate style sheet title. | 0 |
if (name == null || name.isEmpty()) { | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.http.impl.auth.win;
import org.apache.http.annotation.Immutable;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthSchemeProvider;
import org.apache.http.client.config.AuthSchemes;
import org.apache.http.protocol.HttpContext;
/**
* {@link AuthSchemeProvider} implementation that creates and initializes
* {@link WindowsNegotiateScheme} using JNA to Negotiate credentials
* <p/>
* EXPERIMENTAL
*
* @since 4.3
*/
@Immutable
public class WindowsNegotiateSchemeFactory implements AuthSchemeProvider {
public AuthScheme create(final HttpContext context) {
return new WindowsNegotiateScheme(AuthSchemes.SPNEGO);
}
}
| 0 |
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import org.apache.xml.security.keys.content.RetrievalMethod;
import org.apache.xml.security.keys.content.X509Data;
import org.apache.xml.security.keys.content.x509.XMLX509Certificate;
import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
import org.apache.xml.security.keys.content.x509.XMLX509SubjectName;
import org.apache.xml.security.signature.Manifest;
import org.apache.xml.security.signature.ObjectContainer;
import org.apache.xml.security.signature.Reference;
import org.apache.xml.security.signature.SignatureProperties;
import org.apache.xml.security.signature.SignatureProperty;
import org.apache.xml.security.signature.SignedInfo;
import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.params.XPathContainer;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.IdResolver;
import org.apache.xml.security.utils.JavaUtils;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node; | 0 |
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
private final String DATE_FORMAT_ISO8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
private final DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_ISO8601_FORMAT);
public GremlinQueryComposer(Lookup registryLookup, final AtlasDSL.QueryMetadata qmd, boolean isNestedQuery) {
this.isNestedQuery = isNestedQuery;
this.lookup = registryLookup;
this.queryMetadata = qmd;
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
public GremlinQueryComposer(AtlasTypeRegistry typeRegistry, final AtlasDSL.QueryMetadata qmd, int limit, int offset) {
this(new RegistryBasedLookup(typeRegistry), qmd, false);
this.context = new Context(errorList, lookup);
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String s = queryMetadata.needTransformation() ?
if(LOG.isDebugEnabled()) {
LOG.debug("Gremlin: {}", s);
}
return s;
return IdentifierHelper.getQuoted(rhs);
return String.format("'%d'", getDateFormat(s));
}
public long getDateFormat(String s) {
try {
return dateFormat.parse(s).getTime();
} catch (ParseException ex) {
errorList.add(ex.getMessage());
}
return -1; | 0 |
final byte[] buffer = new byte[200]; | 1 |
/*
* 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 |
@Test(timeout = 10 * 60 * 1000)
splits.add(new Text(new byte[] {0, 0, i}));
} catch (TableNotFoundException ex) {} catch (Exception ex) { | 0 |
import com.google.inject.Singleton;
@Singleton
recordAudit(httpRequest, requestTimeISO9601); | 0 |
* <p/> | 0 |
import org.apache.ambari.server.api.stomp.NamedTasksSubscriptions;
import org.apache.ambari.server.events.NamedTaskUpdateEvent;
private NamedTasksSubscriptions namedTasksSubscriptions;
STOMPUpdatePublisher STOMPUpdatePublisher, NamedTasksSubscriptions namedTasksSubscriptions) {
this.namedTasksSubscriptions = namedTasksSubscriptions;
Set<NamedTaskUpdateEvent> namedTasksToPublish = new HashSet<>();
NamedTaskUpdateEvent namedTaskUpdateEvent = new NamedTaskUpdateEvent(hostRoleCommand);
if (namedTasksSubscriptions.checkTaskId(reportedTaskId)
&& !namedTaskUpdateEvent.equals(new NamedTaskUpdateEvent(activeTasksMap.get(reportedTaskId)))) {
namedTasksToPublish.add(namedTaskUpdateEvent);
}
// unsubscribe on complete (no any update will be sent anyway)
if (hostRoleCommand.getStatus().equals(HostRoleStatus.COMPLETED)) {
namedTasksSubscriptions.removeTaskId(reportedTaskId);
}
for (NamedTaskUpdateEvent namedTaskUpdateEvent : namedTasksToPublish) {
LOG.info(String.format("NamedTaskUpdateEvent with id %s will be send", namedTaskUpdateEvent.getId()));
STOMPUpdatePublisher.publish(namedTaskUpdateEvent);
} | 0 |
import org.apache.accumulo.core.client.impl.Credentials; | 1 |
import org.apache.http.annotation.ThreadSafe;
@ThreadSafe // since DefaultHttpClient is | 0 |
import org.apache.felix.webconsole.WebConsoleUtil;
WebConsoleUtil.keyVal( jw, "Symbolic Name", bundle.getSymbolicName() );
WebConsoleUtil.keyVal( jw, "Version", headers.get( Constants.BUNDLE_VERSION ) );
WebConsoleUtil.keyVal( jw, "Bundle Location", bundle.getLocation() );
WebConsoleUtil.keyVal( jw, "Last Modification", new Date( bundle.getLastModified() ) );
WebConsoleUtil.keyVal( jw, "Bundle Documentation", docUrl );
WebConsoleUtil.keyVal( jw, "Vendor", headers.get( Constants.BUNDLE_VENDOR ) );
WebConsoleUtil.keyVal( jw, "Copyright", headers.get( Constants.BUNDLE_COPYRIGHT ) );
WebConsoleUtil.keyVal( jw, "Description", headers.get( Constants.BUNDLE_DESCRIPTION ) );
WebConsoleUtil.keyVal( jw, "Start Level", getStartLevel( bundle ) );
WebConsoleUtil.keyVal( jw, "Bundle Classpath", headers.get( Constants.BUNDLE_CLASSPATH ) );
WebConsoleUtil.keyVal( jw, "Exported Packages", val );
WebConsoleUtil.keyVal( jw, "Exported Packages", "None" );
WebConsoleUtil.keyVal( jw, "Imported Packages", val );
WebConsoleUtil.keyVal( jw, "Importing Bundles", val );
WebConsoleUtil.keyVal( jw, "Exported Packages", val );
WebConsoleUtil.keyVal( jw, "Exported Packages", "None" );
WebConsoleUtil.keyVal( jw, "Imported Packages", val );
WebConsoleUtil.keyVal( jw, key, val);
WebConsoleUtil.keyVal( jw, "Manifest Headers", val );
WebConsoleUtil.keyVal( jw, "Host Bundles", val );
WebConsoleUtil.keyVal( jw, "Fragments Attached", val ); | 0 |
* @version $Revision$ $Date$ | 0 |
return (desiredSecurityState == SecurityState.SECURED_KERBEROS) &&
(sch.getSecurityState() != SecurityState.SECURED_KERBEROS) &&
(sch.getSecurityState() != SecurityState.SECURING); | 0 |
Collection<WindowedValue<?>> windowValues =
valuesPerWindow.computeIfAbsent(window, k -> new ArrayList<>());
WindowedValue::getValue); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bag/TreeBag.java,v 1.5 2003/12/28 17:58:53 scolebourne Exp $
* @version $Revision: 1.5 $ $Date: 2003/12/28 17:58:53 $
* Constructs a <code>TreeBag</code> containing all the members of the
* specified collection. | 0 |
expect(cluster.getServiceComponentHosts(anyObject(String.class))).andReturn(serviceComponentHosts).anyTimes();
expect(cluster.getCurrentStackVersion()).andReturn(stackId).atLeastOnce(); | 0 |
throw new BufferOverflowException(
"Exceeded buffer size of " + maxBufferSize + " for row: " + sourceTopKey.getRow()); | 0 |
pid.setType(PropertyType.String); | 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 |
package test.switches;
/**
* A component using switch on integers and enum.
*/
public class Switches {
public int switchOnInteger(int i) {
switch (i) {
case 0 : return 0;
case 1 : return 1;
case 2 : return 2;
default: return 3;
}
}
public int switchOnEnum(Color c) {
switch (c) {
case RED: return 1;
case GREEN: return 2;
default: return 3;
}
}
} | 0 |
import org.apache.cocoon.el.objectmodel.ObjectModel; | 0 |
evaluationContext.createBundle(
(PCollection<InputT>) Iterables.getOnlyElement(transform.getOutputs()).getValue()); | 0 |
descentStr = String.valueOf(unitsPerEm*0.2);
* the returned list may contain Strings and ParsedURLs
ret.add(purl); // here we add a ParsedURL
String s = ffname.getAttribute("name");
ret.add(s); // here we add a String | 0 |
import org.apache.batik.dom.svg.SVGOMElement;
import org.apache.batik.dom.util.XLinkSupport;
ImageNode imageNode = (ImageNode)super.createGraphicsNode(ctx, e);
if (imageNode == null) {
protected void initializeDynamicSupport(BridgeContext ctx,
Element e,
GraphicsNode node) {
this.e = e;
this.node = node;
this.ctx = ctx;
((SVGOMElement)e).setSVGContext(this);
// BridgeUpdateHandler implementation //////////////////////////////////
* Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
public void handleDOMAttrModifiedEvent(MutationEvent evt) {
super.handleDOMAttrModifiedEvent(evt);
// convenient methods ////////////////////////////////////////////////// | 0 |
* Repository version is not required
*/
NOT_REQUIRED,
/**
INSTALLING,
INSTALLED,
INSTALL_FAILED,
OUT_OF_SYNC,
CURRENT,
UPGRADING,
UPGRADE_FAILED,
UPGRADED | 0 |
import org.apache.hadoop.metadata.repository.Constants; | 0 |
@Column(name = "view_instance_id", nullable = false, insertable = false, updatable = false)
private Long viewInstanceId;
@JoinColumn(name = "view_instance_id", referencedColumnName = "view_instance_id", nullable = false),
@JoinColumn(name = "view_name", referencedColumnName = "view_name", nullable = false),
@JoinColumn(name = "view_instance_name", referencedColumnName = "name", nullable = false)
public Long getViewInstanceId() {
return viewInstanceId;
}
public void setViewInstanceId(Long viewInstanceId) {
this.viewInstanceId = viewInstanceId;
}
| 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 |
public void consume(final ByteBuffer byteBuffer) throws IOException { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/TypedSet.java,v 1.4 2003/08/31 17:24:46 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.4 $ $Date: 2003/08/31 17:24:46 $ | 0 |
import org.apache.http.protocol.HttpCoreContext;
import org.apache.http.protocol.HttpProcessorBuilder;
HttpProcessor httpproc = HttpProcessorBuilder.create()
.add(new ResponseDate())
.add(new ResponseServer("Test/1.1"))
.add(new ResponseContent())
.add(new ResponseConnControl()).build();
HttpCoreContext coreContext = HttpCoreContext.adapt(context);
NHttpConnection conn = coreContext.getConnection(NHttpConnection.class); | 0 |
assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("9".getBytes()));
assertEquals(tpc.proxy().getMaxRow(userpass, testtable, null, null, true, null, true), ByteBuffer.wrap("5".getBytes())); | 1 |
protected Class<?> getterClass;
if ( getterClass != null )
return getterClass;
getterClass = value.getClass();
ret = new StringBuilder( "((" ).append(
ExpressionCompiler.getCastString( context.getCurrentObject().getClass() ) ).append( ")" ).append(
ret ).append( ")." ).append(
OgnlRuntime.getNumericValueGetter( context.getCurrentObject().getClass() ) ); | 0 |
/* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.digester3.xmlrules.metaparser;
import org.apache.commons.digester3.RulesBinder;
import org.apache.commons.digester3.rulesbinder.LinkedRuleBuilder;
import org.xml.sax.Attributes;
/**
*
*/
final class BeanPropertySetterRule extends AbstractXmlRule {
public BeanPropertySetterRule(RulesBinder targetRulesBinder, PatternStack patternStack) {
super(targetRulesBinder, patternStack);
}
/**
* {@inheritDoc}
*/
@Override
protected void bindRule(LinkedRuleBuilder linkedRuleBuilder, Attributes attributes) throws Exception {
linkedRuleBuilder.setBeanProperty().withName(attributes.getValue("propertyname"));
}
} | 0 |
import org.apache.felix.scr.impl.BundleComponentActivator;
// component activator may be null if disposed concurrently
BundleComponentActivator bca = m_componentManager.getActivator();
if ( bca == null )
{
return null;
}
// get bundle context, may be null if component deactivated since getting bca
BundleContext bc = bca.getBundleContext();
if ( bc == null )
{
return null;
}
return bc.getServiceReferences(
catch ( IllegalStateException ise )
{
// bundle context is not valid any longer, cannot log
} | 0 |
package org.apache.accumulo.maven.plugin; | 0 |
import org.apache.accumulo.core.client.ClientInfo;
* <li>{@link AccumuloInputFormat#setClientInfo(JobConf, ClientInfo)} | 0 |
static org.slf4j.Logger LOG =
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename);
LOG.error("Verification crashed for " + filename);
LOG.error("Verification failed for " + filename + ", had to be broken but was successful"); | 0 |
groupHolder.skippable = group.skippable;
groupHolder.allowRetry = group.allowRetry;
* Indicate whether retry is allowed for the stages in this group.
*/
public boolean allowRetry = true;
/**
* Indicates whether the stages in this group are skippable on failure. If a
* stage is skippable, a failed result can be skipped without failing the entire upgrade.
*/
public boolean skippable = false;
/** | 0 |
throw exception; | 0 |
private static Map unknown_attributes = new HashMap(); | 0 |
String zkRoot = HAConfiguration.getZookeeperProperties(configuration).getZkRoot();
leaderLatch = curatorFactory.leaderLatchInstance(serverId, zkRoot); | 0 |
public void initialize(ServerContext context) {
zkAuthenticator.initialize(context); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/BeanPropertySetterRuleTestCase.java,v 1.11 2003/10/05 15:35:50 rdonkin Exp $
* $Revision: 1.11 $
* $Date: 2003/10/05 15:35: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.
*/ | 0 |
private CacheEntryFactory mockEntryGenerator;
mockEntryGenerator = EasyMock.createMock(CacheEntryFactory.class); | 0 |
/** Tests the CoGbkResult. */
* This will create a list of RawUnionValues whose tags are as given and values are increasing
* starting at 0 (i.e. the index in the constructor).
/** Returns the highest position iterated to so far, useful for ensuring laziness. */ | 1 |
Constructor cons = c.getConstructor(new Class[0]);
Object o = cons.newInstance(new Object[0]); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.felix.ipojo.runtime.core.test.components.filter;
import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
import org.apache.felix.ipojo.runtime.core.test.services.FooService;
import java.util.Properties;
public class MultipleFilterCheckSubscriber implements CheckService {
private FooService[] m_foo;
private int bound;
public MultipleFilterCheckSubscriber() {
}
public boolean check() {
for (int i = 0; i < m_foo.length; i++) {
m_foo[i].foo();
}
return true;
}
public Properties getProps() {
Properties props = new Properties();
props.put("Bind", new Integer(bound));
props.put("Size", new Integer(m_foo.length));
return props;
}
private void Bind() {
bound++;
}
private void Unbind() {
bound--;
}
} | 0 |
@Override | 0 |
try (final SSLSocket sslSocket = (SSLSocket) socketFactory.connectSocket(
TimeValue.ZERO_MILLISECONDS,
socket,
target,
remoteAddress,
null,
try (final SSLSocket sslSocket = (SSLSocket) socketFactory.connectSocket(
TimeValue.ZERO_MILLISECONDS,
socket,
target,
remoteAddress,
null,
try (final SSLSocket sslSocket = (SSLSocket) socketFactory.connectSocket(
TimeValue.ZERO_MILLISECONDS,
socket, target,
remoteAddress,
null, | 0 |
* messages will only contain a {@link PubsubMessage#getPayload() payload}, but no {@link
* messages will contain both a {@link PubsubMessage#getPayload() payload} and {@link
payload = message.getPayload();
return new String(input.getPayload(), StandardCharsets.UTF_8);
return CoderUtils.decodeFromByteArray(coder, input.getPayload()); | 0 |
if (total == 1 && info.getRange().isMeta()) {
// root tablet watcher trying to merge metadata tablets it won't even scan
log.debug("ignoring merge of " + info.getRange());
return state;
}
if (extent.isMeta())
range = new Range(Constants.METADATA_ROOT_TABLET_KEYSPACE); | 0 |
("resources/svg10.dtd").toString()); | 0 |
public void testConfigOverrides() {
SiteConfiguration conf = SiteConfiguration.create();
SiteConfiguration.clearInstance();
conf = SiteConfiguration.create((URL) null,
ImmutableMap.of(Property.INSTANCE_ZK_HOST.getKey(), "myhost:2181"));
Map<String,String> results = new HashMap<>();
conf.getProperties(results, p -> p.startsWith("instance"));
Assert.assertEquals("myhost:2181", results.get(Property.INSTANCE_ZK_HOST.getKey())); | 0 |
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/PrimitiveBean.java,v 1.2 2003/10/05 13:33:29 rdonkin Exp $
* $Revision: 1.2 $
* $Date: 2003/10/05 13:33:29 $
* ====================================================================
*
* 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.
*/ | 0 |
import org.apache.ambari.server.controller.spi.Resource; | 0 |
ServiceConfigVersion,
public static final Type ServiceConfigVersion = InternalType.ServiceConfigVersion.getType(); | 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.sshd.client.subsystem.sftp.extensions;
import org.apache.sshd.client.subsystem.sftp.SftpClient;
import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.OptionalFeature;
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
public interface SftpClientExtension extends NamedResource, OptionalFeature {
/**
* @return The {@link SftpClient} used to issue the extended command
*/
SftpClient getClient();
} | 0 |
/*
* Copyright 2001-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 |
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(timeType.name().getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(srcTableId.getBytes()), ByteBuffer.wrap(newTableName.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(oldTableName.getBytes()), ByteBuffer.wrap(newTableName.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.getBytes()), start == null ? EMPTY : TextUtil.getByteBuffer(start), end == null ? EMPTY
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(dir.getBytes()), ByteBuffer.wrap(failureDir.getBytes()),
ByteBuffer.wrap((setTime + "").getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(importDir.getBytes()));
List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(exportDir.getBytes())); | 0 |
public void fetch(ScannerBase sb) {
sb.fetchColumn(colf, colq);
public void put(Mutation m, Value v) {
m.put(colf, colq, v);
public void putDelete(Mutation m) {
m.putDelete(colf, colq);
| 0 |
import java.io.*;
import java.util.*;
import java.util.jar.*;
URL[] path = new URL[artifacts.size() + 1];
final String targetDirectory = this.getProject().getBuild().getOutputDirectory();
try {
path[path.length - 1] = new File(targetDirectory).toURI().toURL();
} catch (IOException ioe) {
throw new MojoFailureException("Unable to add target directory to classloader.");
}
public JavaClassDescription[] getSourceDescriptions() throws MojoExecutionException {
final String className = this.sources[i].getClasses()[0].getFullyQualifiedName();
try {
descs[i] = new QDoxJavaClassDescription(this.classloader.loadClass(className), this.sources[i], this);
} catch (ClassNotFoundException e) {
throw new MojoExecutionException("Unable to load class " + className);
}
try {
this.log.debug("Found qdox description for: " + className);
result = new QDoxJavaClassDescription(this.classloader.loadClass(className), this.sources[index], this);
} catch (ClassNotFoundException e) {
throw new MojoExecutionException("Unable to load class " + className);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.