Diff stringlengths 5 2k | FaultInducingLabel int64 0 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.cocoon.components.elementprocessor.impl.poi.hssf.elements;
/**
* No-op implementation of ElementProcessor to handle the "Attribute" tag
*
* This element is not used in HSSFSerializer 1.0
*
* Attribute has no attributes
*
* @author Marc Johnson (marc_johnson27591@hotmail.com)
* @version $Id$
*/
public class EPAttribute extends BaseElementProcessor {
/**
* constructor
*/
public EPAttribute() {
super(null);
}
} // end public class EPAttribute | 0 |
final Users users = createMockBuilder(Users.class)
.addMockedMethod("getUserEntity", String.class)
.addMockedMethod("getUserAuthorities", UserEntity.class)
.createMock();
bind(Users.class).toInstance(users); | 0 |
import org.apache.ambari.server.events.UpdateEventType;
import org.apache.ambari.server.events.UpgradeUpdateEvent;
import org.apache.ambari.server.events.publishers.StateUpdateEventPublisher;
@Inject
private StateUpdateEventPublisher stateUpdateEventPublisher;
@Inject
private HostRoleCommandDAO hostRoleCommandDAO;
@Inject
private RequestDAO requestDAO;
public static double calculateAbortedProgress(Map<Long, HostRoleCommandStatusSummaryDTO> summary) {
stateUpdateEventPublisher.publish(UpgradeUpdateEvent
.formFullEvent(s_hostRoleCommandDAO, s_requestDAO, upgradeEntity, UpdateEventType.CREATE));
upgradeEntity = s_upgradeDAO.merge(upgradeEntity);
stateUpdateEventPublisher.publish(UpgradeUpdateEvent.formUpdateEvent(hostRoleCommandDAO,requestDAO, upgradeEntity));
lastUpgradeItemForCluster = s_upgradeDAO.merge(lastUpgradeItemForCluster);
stateUpdateEventPublisher.publish(UpgradeUpdateEvent.formUpdateEvent(hostRoleCommandDAO, requestDAO, lastUpgradeItemForCluster)); | 0 |
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; | 0 |
import org.apache.accumulo.server.conf.ConfigSanityCheck;
expectSet.put("check-server-config", ConfigSanityCheck.class); | 0 |
import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo;
public AtlasEntitiesWithExtInfo toAtlasEntitiesWithExtInfo(List<String> guids) throws AtlasBaseException {
AtlasEntitiesWithExtInfo ret = new AtlasEntitiesWithExtInfo();
for (String guid : guids) {
AtlasVertex vertex = getEntityVertex(guid);
AtlasEntity entity = mapVertexToAtlasEntity(vertex, ret);
ret.addEntity(entity);
}
ret.compact();
return ret;
}
ret = new AtlasObjectId(GraphHelper.getGuid(referenceVertex), GraphHelper.getTypeName(referenceVertex)); | 1 |
protected GraphicContext gc;
protected DOMTreeManager domTreeManager;
protected SVGGraphicContext groupGC;
protected Element currentGroup;
SVGGraphicContext deltaGC;
deltaGC = processDeltaGC(groupGC,
domTreeManager.defaultGC);
protected int countOverrides(SVGGraphicContext deltaGC) {
protected void trimContextForElement(SVGGraphicContext svgGC, Element element) {
protected void setTransform(Element element,
protected SVGGraphicContext processDeltaGC(SVGGraphicContext gc,
protected Map processDeltaMap(Map map, Map referenceMap) { | 0 |
private boolean rangesContainsKey(List<ByteKeyRange> ranges, ByteKey key) { | 0 |
/**
* Get the fields of this class
* @return All fields or an empty array
*/
JavaField getFieldByName(String name) throws MojoExecutionException;
| 0 |
import org.apache.accumulo.core.client.admin.TimeType;
@Deprecated
public void create(String tableName, boolean limitVersion) throws AccumuloException, AccumuloSecurityException, TableExistsException {
create(tableName, limitVersion, TimeType.MILLIS);
}
@Override
@Deprecated
public void create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException {}
@Override
@Deprecated
@Override
public Collection<Text> getSplits(String tableName) throws TableNotFoundException {
return null;
}
@Deprecated
@Override
public Collection<Text> getSplits(String tableName, int maxSplits) throws TableNotFoundException {
return null;
}
@Deprecated
@Override
public void flush(String tableName) throws AccumuloException, AccumuloSecurityException {}
| 0 |
import org.osgi.framework.ServiceReference; | 0 |
public void testHandle() throws SQLException {
ResultSetHandler<TestBean> h = new BeanHandler<TestBean>(TestBean.class);
assertNotNull(results);
assertEquals("1", results.getOne());
assertEquals("2", results.getTwo());
assertEquals("3", results.getThree());
}
| 0 |
package org.apache.commons.jexl2.internal; | 0 |
@Override | 0 |
info("Arrays cannot be used for proxied dependencies - Disable the proxy mode"); | 0 |
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.scheme.SocketFactory; | 0 |
public void testRegenerateKeytabsValidateRequestStageContainer() throws Exception {
testRegenerateKeytabs(new KerberosCredential("principal", "password", "keytab"), false);
}
@Test
testRegenerateKeytabs(new KerberosCredential("principal", "password", "keytab"), false);
private void testRegenerateKeytabs(final KerberosCredential kerberosCredential, boolean mockRequestStageContainer) throws Exception {
final RequestStageContainer requestStageContainer;
if (mockRequestStageContainer) {
// This is a STRICT mock to help ensure that the end result is what we want.
requestStageContainer = createStrictMock(RequestStageContainer.class);
// Create Principals Stage
expect(requestStageContainer.getLastStageId()).andReturn(-1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Create Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(0L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Distribute Keytabs Stage
expect(requestStageContainer.getLastStageId()).andReturn(1L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
// Clean-up/Finalize Stage
expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
expect(requestStageContainer.getId()).andReturn(1L).once();
requestStageContainer.addStages(anyObject(List.class));
expectLastCall().once();
} else {
requestStageContainer = null;
}
Assert.assertNotNull(kerberosHelper.executeCustomOperations(cluster, Collections.singletonMap("regenerate_keytabs", "true"), requestStageContainer)); | 0 |
assertEquals(1,
cluster
.exec(RandomizeVolumes.class, "-c", cluster.getClientPropsPath(), "-t", tableName)
.getProcess().waitFor()); | 0 |
* @author <a href="mailto:scohen@apache.org">Steve Cohen</a>
* @version $Id: OS2FTPEntryParserTest.java,v 1.3 2003/03/02 19:47:00 scohen Exp $ | 0 |
allMessages.sort(new TimeStampComparator()); | 0 |
package com.google.cloud.dataflow.examples.cookbook; | 0 |
@Test
public void extractPropertyNameFromAttribute() throws Exception
{
Employee expected = new Employee( "John", "Doe" );
Employee actual = newLoader( new AbstractRulesModule()
{
@Override
protected void configure()
{
forPattern( "employee" ).createObject().ofType( Employee.class );
forPattern( "employee/property" ).setBeanProperty().extractPropertyNameFromAttribute( "name" );
}
} )
.newDigester()
.parse( getClass().getResource( "extractPropertyNameFromAttribute.xml" ) );
assertEquals( expected.getFirstName(), actual.getFirstName() );
assertEquals( expected.getLastName(), actual.getLastName() );
}
| 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.http.lightweight.servlet;
import java.io.CharConversionException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.nio.charset.Charset;
/**
* ServletPrintWriter encodes characters with supplied encoding specification.
*
*/
public class ServletPrintWriter extends PrintWriter
{
private final Charset charset;
/**
* @param outputStream OutputStream
* @param characterEncoding character encoding
* @throws UnknownCharacterException if the character encoding is not supported.
*/
public ServletPrintWriter(OutputStream outputStream, String characterEncoding) throws CharConversionException
{
super(outputStream);
if (!Charset.isSupported(characterEncoding))
{
throw new CharConversionException("Unsupported character encoding: "
+ characterEncoding);
}
this.charset = Charset.forName(characterEncoding);
}
/* (non-Javadoc)
* @see java.io.PrintWriter#print(java.lang.String)
*/
public void print(String s)
{
super.print(charset.encode(s).toString());
}
} | 0 |
windowFn, value, timestamp, GlobalWindow.INSTANCE));
private BoundedWindow window;
public TestAssignContext(
WindowFn<Object, W> windowFn, Object element, Instant timestamp, BoundedWindow window) {
this.window = window;
public BoundedWindow window() {
return window; | 0 |
String expectedMetric1App1 = "{\"timelineMetric\":{\"metadata\":{},\"metricname\":\"metricName1\",\"appid\":\"app1\",\"starttime\":0,\"metrics\":{}},\"metricAggregate\":{\"sum\":6.0,\"deviation\":0.0,\"max\":3.0,\"min\":1.0,\"numberOfSamples\":3}}";
String expectedMetric2App2 = "{\"timelineMetric\":{\"metadata\":{},\"metricname\":\"metricName2\",\"appid\":\"app2\",\"starttime\":0,\"metrics\":{}},\"metricAggregate\":{\"sum\":15.0,\"deviation\":0.0,\"max\":6.0,\"min\":4.0,\"numberOfSamples\":3}}";
String expectedMetric3App3 = "{\"timelineMetric\":{\"metadata\":{},\"metricname\":\"metricName3\",\"appid\":\"app3\",\"starttime\":0,\"metrics\":{}},\"metricAggregate\":{\"sum\":24.0,\"deviation\":0.0,\"max\":9.0,\"min\":7.0,\"numberOfSamples\":3}}"; | 0 |
* Translates a GroupByKey while ignoring window assignments. Current ignores windows. | 0 |
@Lob
@Basic
@Column(name = "description", nullable = true, length = 32672)
private String description;
* Gets the optional description for this alert definition.
*
* @return the description, or {@code null} if none.
*/
public String getDescription() {
return description;
}
/**
* Gets the optional description for this alert definition.
*
* @param description
* the description to set or {@code null} for none.
*/
public void setDescription(String description) {
this.description = description;
}
/** | 0 |
/**
String [] splited=StringSplitter.split(location, '/');
String value=splited[0]+"/"+"/"+splited[2];
return value; | 0 |
* @version $Revision: 1.5 $ $Date: 2003/12/30 06:55:58 $
public static IOFileFilter INSTANCE = new FalseFileFilter(); | 0 |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at | 0 |
import org.apache.accumulo.trace.thrift.TInfo; | 0 |
protected boolean isHostInMemoryAggregationEnabled() {
return false;
}
@Override
protected int getHostInMemoryAggregationPort() {
return 61888;
}
@Override | 0 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/lang/UnsupportedClassVersionError.java,v 1.6 2006/03/14 01:20:25 hargrave Exp $
*
* (C) Copyright 2001 Sun Microsystems, Inc.
* Copyright (c) OSGi Alliance (2001, 2005). 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 java.lang;
public class UnsupportedClassVersionError extends java.lang.ClassFormatError {
public UnsupportedClassVersionError() { }
public UnsupportedClassVersionError(java.lang.String var0) { }
}
| 0 |
import com.google.cloud.dataflow.sdk.options.GcpOptions;
static final GcpOptions testPipelineOptions() {
GcpOptions options = PipelineOptionsFactory.as(GcpOptions.class);
sink.validate(testPipelineOptions());
sink.validate(testPipelineOptions());
List<DatastoreIO.Source> bundles = io.splitIntoBundles(1024, testPipelineOptions());
io.splitIntoBundles(1024, testPipelineOptions());
List<DatastoreIO.Source> bundles = io.splitIntoBundles(1024, testPipelineOptions());
.splitIntoBundles(1024, testPipelineOptions());
.splitIntoBundles(1024, testPipelineOptions());
List<DatastoreIO.Source> bundles = spiedIo.splitIntoBundles(1024, testPipelineOptions()); | 0 |
import org.apache.commons.configuration.Initializable;
* If the newly created {@code Configuration} object implements the
* {@code Initializable} interface, its {@code initialize()} method is called
* after all initialization properties have been set. This way a concrete
* implementation class can perform arbitrary initialization steps.
* </p>
* <p>
handleInitializable(obj);
/**
* Performs special initialization of the result object. This method is
* called after parameters have been set on a newly created result instance.
* If supported by the result class, the {@code initialize()} method is now
* called.
*
* @param obj the newly created result object
*/
private void handleInitializable(T obj)
{
if (obj instanceof Initializable)
{
((Initializable) obj).initialize();
}
} | 0 |
protected ApplicationHistoryClientService createApplicationHistoryClientService(
return new ApplicationHistoryClientService(historyManager, metricConfiguration); | 0 |
* Copyright 2006-2009 The Apache Software Foundation. | 0 |
/* (non-Javadoc)
* @see org.apache.cocoon.portal.LinkService#encodeURL(String url).
*/
public String encodeURL(String url) {
return ContextHelper.getResponse(this.context).encodeURL(url);
} | 0 |
UnboundedFifoBuffer<String> buffer = new UnboundedFifoBuffer<String>();
buffer = (UnboundedFifoBuffer<String>) serializeDeserialize(buffer); | 0 |
public void testExpected() throws Exception {
public void testLong() throws Exception {
public void testPrimitiveLong() throws Exception {
public void testResolveProxyClass() throws Exception { | 0 |
@Override
public void visit(State state, Properties props) throws Exception {
state.getMultiTableBatchWriter().flush();
log.debug("Committed " + state.getInteger("numWrites") + " writes. Total writes: " + state.getInteger("totalWrites"));
state.set("numWrites", new Integer(0));
}
| 1 |
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.cocoon.xml.XMLPipe;
extends CachingProcessingPipeline implements Configurable {
private boolean saxstream = false;
public void configure(Configuration conf) throws ConfigurationException {
this.saxstream = conf.getAttributeAsBoolean("sax-stream", false);
}
XMLPipe pipe = null;
if (saxstream) {
ProfilingSAXPipe connector = new ProfilingSAXPipe();
connector.setup(this.index, this.data);
pipe = connector;
} else {
ProfilingXMLPipe connector = new ProfilingXMLPipe();
connector.setup(this.index, this.data);
pipe = connector;
}
super.connect(environment, producer, pipe);
super.connect(environment, pipe, consumer); | 0 |
@SuppressWarnings("unchecked")
public static final Comparator NATURAL_COMPARATOR = ComparableComparator.<Comparable>getInstance();
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> Comparator<E> naturalComparator() {
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(Comparator<E> comparator1, Comparator<E> comparator2) {
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(Comparator<E>[] comparators) {
ComparatorChain<E> chain = new ComparatorChain<E>();
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(Collection<Comparator<E>> comparators) {
(Comparator<E>[]) comparators.toArray(new Comparator[comparators.size()])
public static <E> Comparator<E> reversedComparator(Comparator<E> comparator) {
return new ReverseComparator<E>(comparator);
public static Comparator<Boolean> booleanComparator(boolean trueFirst) {
@SuppressWarnings("unchecked")
public static <E> Comparator<E> nullLowComparator(Comparator<E> comparator) {
return new NullComparator<E>(comparator, false);
@SuppressWarnings("unchecked")
public static <E> Comparator<E> nullHighComparator(Comparator<E> comparator) {
return new NullComparator<E>(comparator, true);
@SuppressWarnings("unchecked")
public static <E> Comparator<E> transformedComparator(Comparator<E> comparator, Transformer<? super E, ? extends E> transformer) {
return new TransformingComparator<E>(transformer, comparator);
@SuppressWarnings("unchecked")
public static <E> E min(E o1, E o2, Comparator<E> comparator) {
@SuppressWarnings("unchecked")
public static <E> E max(E o1, E o2, Comparator<E> comparator) { | 0 |
extensionInfo.setActive(emx.getVersion().isActive());
extensionInfo.setAutoLink(emx.isAutoLink()); | 0 |
import org.apache.zookeeper.client.ZKClientConfig;
ClientCnxnSocketNIO(ZKClientConfig clientConfig) throws IOException {
this.clientConfig = clientConfig;
initProperties(); | 0 |
import org.apache.aurora.gen.storage.RemoveLock;
import org.apache.aurora.gen.storage.SaveLock;
builder.add(Op.saveLock(new SaveLock()));
// TODO(jly): Deprecated, this is a no-op to be removed in 0.21. See AURORA-1959.
builder.add(Op.removeLock(new RemoveLock()));
// TODO(jly): Deprecated, this is a no-op to be removed in 0.21. See AURORA-1959.
| 0 |
return (String[]) tokens.toArray(new String[tokens.size()]);
} | 0 |
MethodVariableAccess.REFERENCE.loadFrom(0),
StackManipulation pushExtraContextFactory = MethodVariableAccess.REFERENCE.loadFrom(1);
MethodVariableAccess.REFERENCE.loadFrom(0),
MethodVariableAccess.REFERENCE.loadFrom(0),
MethodVariableAccess.REFERENCE.loadFrom(1), | 0 |
config.addPropertyDirect("key3", "value4");
config.addPropertyDirect("key3", "value5");
List list = config.getList("key3");
assertNotNull("no list found for the 'key3' property", list);
List expected = new ArrayList();
expected.add("value3");
expected.add("value4");
expected.add("value5");
ListAssert.assertEquals("values for the 'key3' property", expected, list); | 0 |
org.w3c.dom.Document doc = XMLUtils.newDocument(false);
org.w3c.dom.Document doc = XMLUtils.parse(is, false); | 0 |
import static org.junit.Assert.assertArrayEquals;
assertArrayEquals(new byte[] {1}, zrw.mutate(path, value, acls, mutator));
assertArrayEquals(new byte[] {1}, zrw.mutate(path, value, acls, mutator)); | 0 |
import java.util.NoSuchElementException;
import java.util.Optional;
@Test(expected = NoSuchElementException.class)
expect(attributeStore.getHostAttributes("a")).andReturn(Optional.empty()); | 0 |
LOG.info("Disabling and unmapping configuration {}", serviceConfigEntity);
// unmapping all service configs
for (ClusterConfigEntity clusterConfigEntity : serviceConfigEntity.getClusterConfigEntities()) {
if (!clusterConfigEntity.isUnmapped()) {
LOG.info("Unmapping configuration {}", clusterConfigEntity);
clusterConfigEntity.setUnmapped(true);
clusterDAO.merge(clusterConfigEntity);
}
}
void deleteAllServiceConfigGroups() throws AmbariException {
for (Long configGroupId : cluster.getConfigGroupsByServiceName(serviceName).keySet()) {
cluster.deleteConfigGroup(configGroupId);
}
}
deleteAllServiceConfigGroups(); | 0 |
public static final String USE_LOCALURLS_PROP = "felix.jarurls"; | 0 |
// Check in the cache for the file system
final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH);
FileSystem fs;
synchronized (this)
{
fs = findFileSystem(rootName, fileSystemOptions);
if (fs == null)
{
// Need to create the file system, and cache it
fs = doCreateFileSystem(rootName, fileSystemOptions);
addFileSystem(rootName, fs);
}
}
// Locate the file | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservedList.java,v 1.2 2003/09/21 16:00:56 scolebourne Exp $
* @version $Revision: 1.2 $ $Date: 2003/09/21 16:00:56 $
return ObservableList.decorate(new ArrayList(), ObservedTestHelper.LISTENER);
return ObservableList.decorate(set, ObservedTestHelper.LISTENER);
public ObservableCollection createObservedCollection() {
return ObservableList.decorate(new ArrayList());
public ObservableCollection createObservedCollection(Object listener) {
return ObservableList.decorate(new ArrayList(), listener); | 0 |
*
* @deprecated use {@link org.apache.http.nio.reactor.ssl.SSLSetupHandler}
@Deprecated | 0 |
* Copyright 1999-2006 The Apache Software Foundation | 0 |
@Deprecated | 0 |
* @version $Revision: 1.6 $
public int getSize()
{
return 22;
} | 0 |
StringBuilder buf = new StringBuilder( pid.substring( 0, first ) );
final StringBuilder pidBuffer = new StringBuilder( pid.length() );
private void appendEncoded( StringBuilder buf, final char c )
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
public NEWARRAY(final byte type) {
public NEWARRAY(final BasicType type) {
public void dump( final DataOutputStream out ) throws IOException {
public String toString( final boolean verbose ) {
protected void initFromFile( final ByteSequence bytes, final boolean wide ) throws IOException {
public void accept( final Visitor v ) { | 0 |
import java.awt.geom.Point2D;
/**
* Returns true if pt is in the area painted by this shape painter
*/
public boolean inPaintedArea(Point2D pt){
if (painters == null)
return false;
for (int i=0; i < count; ++i) {
if (painters[i].inPaintedArea(pt))
return true;
}
return false;
}
* Returns true if pt is in the area painted by this shape painter
*/
public boolean inSensitiveArea(Point2D pt){
if (painters == null)
return false;
for (int i=0; i < count; ++i) {
if (painters[i].inSensitiveArea(pt))
return true;
}
return false;
}
/** | 0 |
import java.util.ArrayList;
import java.util.List;
import org.apache.ambari.server.state.RepositoryInfo;
@Override
@Test
public void testSerializeOperatingSystems() throws Exception {
final List<RepositoryInfo> repositories = new ArrayList<RepositoryInfo>();
final RepositoryInfo repository = new RepositoryInfo();
repository.setBaseUrl("baseurl");
repository.setOsType("os");
repository.setRepoId("repoId");
repositories.add(repository);
final String serialized = RepositoryVersionResourceProvider.serializeOperatingSystems(repositories);
Assert.assertEquals("[{\"repositories\":[{\"Repositories/base_url\":\"baseurl\",\"Repositories/repo_id\":\"repoId\"}],\"OperatingSystems/os_type\":\"os\"}]", serialized);
}
| 0 |
component(c, comp -> comp.withFuture(futureLinks, future -> future.cbi(this::setLinks))); | 0 |
import org.apache.commons.lang.StringUtils;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
private KafkaConsumer consumer = null;
properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
Boolean.valueOf(properties.getProperty("enable.auto.commit", "true")));
List<NotificationConsumer<T>> consumers = new ArrayList<>();
AtlasKafkaConsumer kafkaConsumer = new AtlasKafkaConsumer(notificationType.getDeserializer(), getKafkaConsumer(consumerProperties,notificationType, autoCommitEnabled), autoCommitEnabled);
consumers.add(kafkaConsumer);
public KafkaConsumer getKafkaConsumer(Properties consumerProperties, NotificationType type, boolean autoCommitEnabled) {
if(this.consumer == null) {
try {
String topic = TOPIC_MAP.get(type);
consumerProperties.put("enable.auto.commit", autoCommitEnabled);
this.consumer = new KafkaConsumer(consumerProperties);
this.consumer.subscribe(Arrays.asList(topic));
}catch (Exception ee) {
LOG.error("Exception in getKafkaConsumer ", ee);
}
}
return this.consumer;
String groupId = properties.getProperty(type.toString().toLowerCase() + "." + CONSUMER_GROUP_ID_PROPERTY);
if (StringUtils.isEmpty(groupId)) {
LOG.info("Consumer property: atlas.kafka.enable.auto.commit: {}", consumerProperties.getProperty("enable.auto.commit")); | 0 |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at | 0 |
import org.apache.cocoon.processing.ProcessInfoProvider;
private ProcessInfoProvider processInfoProvider;
public JavaScriptWidgetListener(Function func, ProcessInfoProvider processInfoProvider) {
this.processInfoProvider = processInfoProvider;
Map objectModel = processInfoProvider.getObjectModel();
throw new RuntimeException("Error invoking JavaScript event handler", e);
public JSActionListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
public JSValueChangedListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
public JSCreateListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
public JSTreeSelectionListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
public JSProcessingPhaseListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
public JSRepeaterListener(Function func, ProcessInfoProvider processInfoProvider) {
super(func, processInfoProvider);
} | 0 |
* This filter primitive lights an image using the alpha channel as a bump map.
* component of the Phong lighting model. The resulting image depends on the light color,
* This filter follows the specification of the feDiffuseLighting filter in
Filter getSource();
void setSource(Filter src);
Light getLight();
void setLight(Light light);
double getSurfaceScale();
void setSurfaceScale(double surfaceScale);
double getKd();
void setKd(double kd);
Rectangle2D getLitRegion();
void setLitRegion(Rectangle2D litRegion);
* Returns the min [dx,dy] distance in user space for evalutation of
double [] getKernelUnitLength();
* Sets the min [dx,dy] distance in user space for evaluation of the
void setKernelUnitLength(double [] kernelUnitLength); | 0 |
javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false, false);
org.w3c.dom.Document doc = db.parse(new java.io.FileInputStream(f));
javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false, false);
org.w3c.dom.Document doc = db.parse(f); | 0 |
import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
RepositoryVersionDAO repositoryVersionDAO = createNiceMock(RepositoryVersionDAO.class);
replay(maintenanceStateHelper, repositoryVersionDAO);
AbstractResourceProvider provider = new ServiceResourceProvider(propertyIds, keyPropertyIds,
managementController, maintenanceStateHelper, repositoryVersionDAO);
RepositoryVersionDAO repositoryVersionDAO = createNiceMock(RepositoryVersionDAO.class);
replay(maintenanceStateHelper, repositoryVersionDAO);
AbstractResourceProvider provider = new ServiceResourceProvider(propertyIds, keyPropertyIds,
managementController, maintenanceStateHelper, repositoryVersionDAO);
RepositoryVersionDAO repositoryVersionDAO = createNiceMock(RepositoryVersionDAO.class);
replay(maintenanceStateHelper, repositoryVersionDAO);
AbstractResourceProvider provider = new ServiceResourceProvider(propertyIds, keyPropertyIds,
managementController, maintenanceStateHelper, repositoryVersionDAO);
| 0 |
} else if (! (m.isStatic())){ // implies it's not abstract, verified in pass 2. | 0 |
package org.apache.bcel.generic;
import org.apache.bcel.Const;
import org.apache.bcel.ExceptionConst;
import org.apache.bcel.classfile.ConstantInvokeDynamic;
import org.apache.bcel.classfile.ConstantNameAndType;
import org.apache.bcel.classfile.ConstantPool;
import org.apache.bcel.util.ByteSequence; | 1 |
import org.apache.ambari.server.security.authorization.ResourceType;
expect(resourceEntity.getId()).andReturn(54L).anyTimes();
expect(resourceTypeEntity.getId()).andReturn(ResourceType.VIEW.getId()).anyTimes();
expect(resourceTypeEntity.getName()).andReturn(ResourceType.VIEW.name()).anyTimes();
SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createViewUser(resourceEntity.getId())); | 0 |
expect(storageUtil.jobStore.fetchJobs())
storageUtil.jobStore.saveAcceptedJob(IJobConfiguration.build(job.getJobConfiguration())); | 0 |
private static Map<Credentials,Writer> writers = new HashMap<>(); | 1 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ArrayListMultimap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.HashMultimap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ListMultimap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Multimap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.SetMultimap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets; | 0 |
public Response getUsers(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
return handleRequest(headers, body, ui, Request.Type.GET, createUserResource(null));
public Response getUser(String body, @Context HttpHeaders headers, @Context UriInfo ui,
return handleRequest(headers, body, ui, Request.Type.GET, createUserResource(userName)); | 0 |
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", "value");
Cookie cookie = new BasicCookie("name", null);
Cookie cookie = new BasicCookie("name", null);
Header[] headers = cookiespec.formatCookies(new Cookie[]{ cookie });
cookiespec.validate(new BasicCookie("name", null), null);
cookiespec.match(new BasicCookie("name", null), null);
cookiespec.formatCookies(new BasicCookie[] {}); | 0 |
/**
* This Set contains the names (Strings like "xmlns" or "xmlns:foo") of
* the inclusive namespaces.
*/
TreeSet _inclusiveNSSet = null;
return super.engineCanonicalizeSubTree(rootNode,excl);
NamedNodeMap attrs=null;
int attrsLength = 0;
if (E.hasAttributes()) {
attrs = E.getAttributes();
attrsLength = attrs.getLength();
}
NamedNodeMap attrs = null;
int attrsLength = 0;
if (E.hasAttributes()) {
attrs = E.getAttributes();
attrsLength = attrs.getLength();
} | 0 |
static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TabletServerMinCMetrics.class); | 0 |
public ClassConverter(final Object defaultValue) {
protected String convertToString(final Object value) {
protected <T> T convertToType(final Class<T> type, final Object value) throws Throwable {
} catch (final ClassNotFoundException ex) { | 0 |
import org.apache.bcel.classfile.BootstrapMethods;
public int bootstrapMethodsCount = 0;
public void visitStackMapTable(StackMapTable obj)
{
public void visitStackMapTableEntry(StackMapTableEntry obj)
{
public void visitBootstrapMethods(BootstrapMethods obj)
{
bootstrapMethodsCount++;
} | 0 |
* "License"); you may not use this file except in compliance
* distributed under the License is distributed on an "AS IS" BASIS, | 0 |
public static final String DGI_URL_PROPERTY = "hive.hook.dgi.url"; | 0 |
package org.apache.commons.beanutils2.locale.converters;
import org.apache.commons.beanutils2.locale.converters.ShortLocaleConverter; | 1 |
svgRoot.getFirstChild()); | 0 |
package org.apache.hc.core5.ssl; | 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.
*/
package org.apache.accumulo.core.compaction;
class StringType implements Type {
@Override
public String convert(String str) {
return str;
}
} | 0 |
/** The Spark context factory. */
* If the property {@code beam.spark.test.reuseSparkContext} is set to {@code true} then the Spark
* context will be reused for beam pipelines. This property should only be enabled for tests.
private SparkContextFactory() {}
if (Boolean.getBoolean(TEST_REUSE_SPARK_CONTEXT) && !usesProvidedSparkContext) {
throw new IllegalArgumentException(
String.format(
"Cannot reuse spark context "
+ "with different spark master URL. Existing: %s, requested: %s.",
if (!Boolean.getBoolean(TEST_REUSE_SPARK_CONTEXT) && !usesProvidedSparkContext) { | 1 |
public boolean authenticate(String username, PublicKey key, ServerSession session) {
return true; | 0 |
EventDispatcher ed = new EventDispatcher(logger, registry); | 0 |
import com.google.common.base.Optional;
/***
* A name that refers to a service has a format like /[<service name>/[<component name>/]]<identity name>
* @return an optional referenced service name
*/
public Optional<String> getReferencedServiceName() {
return parseServiceName(reference).or(parseServiceName(getName()));
}
private Optional<String> parseServiceName(String name) {
if (name != null && name.startsWith("/") && name.split("/").length > 2) {
return Optional.of(name.split("/")[1]);
} else {
return Optional.absent();
}
}
| 0 |
import org.apache.accumulo.core.client.ClientConfiguration;
| 0 |
public boolean isPropertySet(Property prop, boolean cacheAndWatch) { | 0 |
AccumuloConfiguration aconf = master.getConfiguration();
AccumuloConfiguration aconf = master.getConfiguration();
AccumuloConfiguration aconf = master.getConfiguration();
delay = aconf.getTimeInMillis(Property.MASTER_RECOVERY_DELAY); | 1 |
updateTypesWithNoRefResolve(typesDef);
resolveReferences();
}
if (LOG.isDebugEnabled()) {
LOG.debug("<== AtlasTypeRegistry.updateTypes({})", typesDef);
}
}
public void updateTypesWithNoRefResolve(AtlasTypesDef typesDef) throws AtlasBaseException {
if (LOG.isDebugEnabled()) {
LOG.debug("==> AtlasTypeRegistry.updateTypesWithNoRefResolve({})", typesDef);
}
if (typesDef != null) {
LOG.debug("<== AtlasTypeRegistry.updateTypesWithNoRefResolve({})", typesDef); | 0 |
import org.apache.beam.sdk.testing.CoderProperties;
public void testFullWindowedValueCoderIsSerializableWithWellKnownCoderType() {
CoderProperties.coderSerializable(WindowedValue.getFullCoder(
GlobalWindow.Coder.INSTANCE, GlobalWindow.Coder.INSTANCE));
}
@Test
public void testValueOnlyWindowedValueCoderIsSerializableWithWellKnownCoderType() {
CoderProperties.coderSerializable(WindowedValue.getValueOnlyCoder(GlobalWindow.Coder.INSTANCE));
}
@Test | 0 |
public static final List<Bid> RESULTS = ImmutableList.of(
BIDS.get(0),
BIDS.get(1),
BIDS.get(2),
BIDS.get(4)); | 0 |
"http://xml.apache.org/batik/ext/multi-image/1.0" ,
ctx.putBridge(new BatikMultiImageElementBridge()); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.