Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
package org.apache.beam.sdk.extensions.euphoria.beam.io; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.extensions.euphoria.core.client.io.UnboundedDataSource; import org.apache.beam.sdk.io.UnboundedSource; import org.apache.beam.sdk.options.PipelineOptions; import org.joda.time.Instant; final org.apache.beam.sdk.extensions.euphoria.core.client.io.UnboundedReader<T, OffsetT> reader;
0
import org.apache.atlas.authorize.AtlasActionTypes; import org.apache.atlas.authorize.AtlasResourceTypes; import org.apache.atlas.authorize.simple.AtlasAuthorizationUtils; private static final String isEntityUpdateAllowed = "atlas.entity.update.allowed"; private static final String isEntityCreateAllowed = "atlas.entity.create.allowed"; boolean isEntityUpdateAccessAllowed = false; boolean isEntityCreateAccessAllowed = false; isEntityUpdateAccessAllowed = AtlasAuthorizationUtils.isAccessAllowed(AtlasResourceTypes.ENTITY, AtlasActionTypes.UPDATE, userName, groups); isEntityCreateAccessAllowed = AtlasAuthorizationUtils.isAccessAllowed(AtlasResourceTypes.ENTITY, AtlasActionTypes.CREATE, userName, groups); responseData.put(isCSRF_ENABLED, AtlasCSRFPreventionFilter.isCSRF_ENABLED); responseData.put(isEntityUpdateAllowed, isEntityUpdateAccessAllowed); responseData.put(isEntityCreateAllowed, isEntityCreateAccessAllowed);
0
cloneStore(copy); copy.cloneInterpolator(this); /** * Clones the internal map with the data of this configuration. * * @param copy the copy created by the {@code clone()} method * @throws CloneNotSupportedException if the map cannot be cloned */ private void cloneStore(BaseConfiguration copy) throws CloneNotSupportedException { // This is safe because the type of the map is known @SuppressWarnings("unchecked") Map<String, Object> clonedStore = (Map<String, Object>) ConfigurationUtils.clone(store); copy.store = clonedStore; // Handle collections in the map; they have to be cloned, too for (Map.Entry<String, Object> e : store.entrySet()) { if (e.getValue() instanceof Collection) { // This is safe because the collections were created by ourselves @SuppressWarnings("unchecked") Collection<String> strList = (Collection<String>) e.getValue(); copy.store.put(e.getKey(), new ArrayList<String>(strList)); } } }
0
if (position == 0 && !setPosition(1)) { return null; if (includeSelf && currentNodePointer.testNode(nodeTest)) { position++; return true; }
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.ambari.server.controller.predicate; import org.apache.ambari.server.controller.spi.PropertyId; import org.apache.ambari.server.controller.spi.Resource; /** * Predicate that checks if a given value is less than a {@link Resource} property. */ public class LessPredicate extends ComparisonPredicate { public LessPredicate(PropertyId propertyId, Comparable<String> value) { super(propertyId, value); } @Override public boolean evaluate(Resource resource) { return getValue().compareTo(resource.getPropertyValue(getPropertyId())) > 0; } @Override public String getOperator() { return "<"; } }
1
import com.google.inject.Binder; import com.google.inject.Singleton; import com.google.inject.matcher.Matchers; import com.google.inject.multibindings.Multibinder; import org.apache.atlas.repository.store.graph.v1.AtlasTypeDefGraphStoreV1; import org.apache.atlas.store.AtlasTypeDefStore; bind(AtlasTypeDefStore.class).to(AtlasTypeDefGraphStoreV1.class).asEagerSingleton();
0
/* * Copyright (c) OSGi Alliance (2016). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.felix.schematizer; import java.util.Map; import java.util.Optional; public interface Schema { String name(); Node rootNode(); Optional<Node> nodeAtPath(String absolutePath); Map<String, Node.DTO> toMap(); /** * Recursively visits all nodes in the {@code Schema} for processing. */ void visit(NodeVisitor visitor); }
0
import java.util.Set; import com.google.common.collect.ImmutableSet; import org.apache.aurora.scheduler.storage.log.SnapshotStoreImpl.HydrateSnapshotFields; bind(new TypeLiteral<Set<String>>() { }).annotatedWith(HydrateSnapshotFields.class) .toInstance(ImmutableSet.of());
0
import org.apache.beam.runners.core.OldDoFn;
0
package org.apache.beam.sdk.extensions.euphoria.core.executor; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.Dataset; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.GlobalWindowing; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.Windowing; import org.apache.beam.sdk.extensions.euphoria.core.client.io.DataSink; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.Join; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.Operator; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.WindowWiseOperator; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.WindowingRequiredException; import org.apache.beam.sdk.extensions.euphoria.core.client.util.Pair; import org.apache.beam.sdk.extensions.euphoria.core.executor.graph.DAG; import org.apache.beam.sdk.extensions.euphoria.core.executor.graph.Node; import static com.google.common.base.Preconditions.checkState;
0
String namespaceId = Tables.getNamespace(instance, tableId); TableNamespaceConfiguration conf = tableNamespaceInstances.get(namespaceId); conf = new TableNamespaceConfiguration(namespaceId, getSystemConfiguration(instance)); tableNamespaceInstances.put(namespaceId, conf); conf = new TableNamespaceConfiguration(namespaceId, getSystemConfiguration(instance)); static void removeNamespaceIdInstance(String namespaceId) { synchronized (tableNamespaceInstances) { tableNamespaceInstances.remove(namespaceId); } }
0
import org.apache.aurora.gen.ScheduleStatus; import org.apache.ibatis.session.ExecutorType; // The ReuseExecutor will cache jdbc Statements with equivalent SQL, improving performance // slightly when redundant queries are made. configuration.setDefaultExecutorType(ExecutorType.REUSE); for (ScheduleStatus status : ScheduleStatus.values()) { enumValueMapper.addEnumValue("task_states", status.getValue(), status.name()); }
0
package org.apache.accumulo.server.test.randomwalk.shard; import java.util.Properties; import java.util.Random; import java.util.SortedSet; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; import org.apache.hadoop.io.Text; public class Split extends Test { @Override public void visit(State state, Properties props) throws Exception { String indexTableName = (String)state.get("indexTableName"); int numPartitions = (Integer)state.get("numPartitions"); Random rand = (Random) state.get("rand"); SortedSet<Text> splitSet = ShardFixture.genSplits(numPartitions, rand.nextInt(numPartitions)+1, "%06x"); log.debug("adding splits " + indexTableName); state.getConnector().tableOperations().addSplits(indexTableName, splitSet); } }
1
if (fs.getParentLayer() != null) { return fs.getParentLayer().getParent(); } else { // Root file has no parent return null; }
0
public abstract class UnitProcessor extends org.apache.batik.util.UnitProcessor { return org.apache.batik.util.UnitProcessor. svgToObjectBoundingBox(s, attr, d, ctx); ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED, return org.apache.batik.util.UnitProcessor. svgToUserSpace(s, attr, d, ctx); ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
0
import static org.junit.Assert.*; public class XMLCipherTest {
0
final List<Branch> nextBranches = branching ? new ArrayList<>() : Collections.EMPTY_LIST;
0
* @return true if the key was added, false otherwise.
0
/** Checkpoint data to make it available in future pipeline runs. */ public static byte[] read(FileSystem fileSystem, Path checkpointFilePath) throws IOException { * <p>{@link SparkPipelineOptions} checkpointDir is used as a root directory under which one * checkpointing needs. Spark's checkpoint relies on Hadoop's {@link * org.apache.hadoop.fs.FileSystem} and is used for Beam as well rather than {@link * org.apache.beam.sdk.io.FileSystem} to be consistent with Spark. LOG.warn( "The specified checkpoint dir {} does not match a reliable filesystem so in case " + "of failures this job may not recover properly or even at all.", rootCheckpointDir);
1
import java.io.Serializable; public class HashTable implements Serializable { protected static class Entry implements Serializable {
1
tokenSecurityEvent.setCorrelationID(signatureType.getId()); signatureValueSecurityEvent.setCorrelationID(signatureType.getId()); algorithmSuiteSecurityEvent.setCorrelationID(signatureType.getId());
0
* Creates and returns a new test pipeline for batch execution. return create(false); } /** * Creates and returns a new test pipeline for streaming execution. * * <p> Use {@link com.google.cloud.dataflow.sdk.testing.DataflowAssert} to add tests, then call * {@link Pipeline#run} to execute the pipeline and check the tests. * * @return The Test Pipeline */ public static FlinkTestPipeline createStreaming() { return create(true); } /** * Creates and returns a new test pipeline for streaming or batch execution. * * <p> Use {@link com.google.cloud.dataflow.sdk.testing.DataflowAssert} to add tests, then call * {@link Pipeline#run} to execute the pipeline and check the tests. * * @param streaming True for streaming mode, False for batch * @return The Test Pipeline */ public static FlinkTestPipeline create(boolean streaming) { FlinkPipelineRunner flinkRunner = FlinkPipelineRunner.createForTest(streaming); FlinkPipelineOptions pipelineOptions = flinkRunner.getPipelineOptions(); pipelineOptions.setStreaming(streaming); return new FlinkTestPipeline(flinkRunner, pipelineOptions);
0
* @version $Revision: 1.8 $
0
execContext.getOrCreateStepContext("merge", "merge", null),
0
String taskId, boolean revocable) { return taskFactory.createFrom(assigned, offer, revocable); boolean revocable, offer.getResourceBag(revocable), taskId, revocable); boolean revocable, revocable, boolean revocable = tierManager.getTier(groupKey.getTask()).isRevocable(); revocable, storeProvider, revocable, resourceRequest, groupKey, task, offer, assignmentResult);
0
public void init(Session s, byte[] v_s, byte[] v_c, byte[] i_s, byte[] i_c) throws Exception {
0
import org.apache.beam.sdk.extensions.gcp.options.GcpOptions; eventsTopic.checkIfAnySubscriptionExists( pipeline.getOptions().as(GcpOptions.class).getProject(), Duration.standardMinutes(1));
0
long lastStageAttemptTime = stage.getLastAttemptTime(hostName, role); return lastStageAttemptTime > 0 && lastStageAttemptTime <= host.getLastRegistrationTime();
0
package org.apache.commons.digester3.annotations.rules; import org.apache.commons.digester3.ObjectCreateRule; import org.apache.commons.digester3.annotations.CreationRule; import org.apache.commons.digester3.annotations.DigesterRule; import org.apache.commons.digester3.annotations.DigesterRuleList; import org.apache.commons.digester3.annotations.providers.ObjectCreateRuleProvider; * @see org.apache.commons.digester3.Digester#addObjectCreate(String,Class)
1
import org.apache.http.util.Asserts; Asserts.notNull(this.buf, "Content buffer");
0
* @version CVS $Id: CopletBaseData.java,v 1.7 2003/09/02 08:34:18 cziegeler Exp $ private String copletAdapterName;
0
/** * 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
* @return A {@link ParseResult} containing the successfully parsed * factories and the unknown ones. <B>Note:</B> it is up to caller to * ensure that the lists do not contain duplicates public static final ParseResult parseMacsList(String macs) { public static final ParseResult parseMacsList(String ... macs) { public static final ParseResult parseMacsList(Collection<String> macs) { return ParseResult.EMPTY; List<NamedFactory<Mac>> factories=new ArrayList<NamedFactory<Mac>>(macs.size()); List<String> unknown=Collections.<String>emptyList(); BuiltinMacs m=fromFactoryName(name); if (m != null) { factories.add(m); } else { // replace the (unmodifiable) empty list with a real one if (unknown.isEmpty()) { unknown = new ArrayList<String>(); } unknown.add(name); } return new ParseResult(factories, unknown); } public static final class ParseResult { public static final ParseResult EMPTY=new ParseResult(Collections.<NamedFactory<Mac>>emptyList(), Collections.<String>emptyList()); private final List<NamedFactory<Mac>> parsed; private final List<String> unsupported; public ParseResult(List<NamedFactory<Mac>> parsed, List<String> unsupported) { this.parsed = parsed; this.unsupported = unsupported; } public List<NamedFactory<Mac>> getParsedFactories() { return parsed; } public List<String> getUnsupportedFactories() { return unsupported; }
0
package org.apache.beam.sdk.extensions.euphoria.core.testkit.accumulators;
0
/** A utility class to interact with synthetic pipeline components. */
1
import com.google.cloud.dataflow.sdk.util.common.ReflectHelpers; for (Method method : ReflectHelpers.getClosureOfMethodsOnInterface(klass)) {
0
prefixes.add("xmlns");
0
import java.util.Optional; return makeTask(id, makeConfig(job), instanceId, Optional.empty()); return makeTask(id, config, instanceId, Optional.empty());
0
getDigester().pushParams(parameters); parameters = (Object[]) getDigester().popParams(); if (getDigester().log.isTraceEnabled()) { getDigester().log.trace("[CallMethodRule](" + i + ")" + parameters[i]) ; target = getDigester().peek(targetOffset); target = getDigester().peek( getDigester().getCount() + targetOffset ); sb.append(getDigester().match); sb.append(getDigester().getCount()); if (getDigester().log.isDebugEnabled()) { sb.append(getDigester().match); getDigester().log.debug(sb.toString());
0
String expected = "g.V().outE('classifiedAs').has('__name', within('PII')).outV().dedup().limit(25).toList()"; String expected = "g.V().has('__typeName', 'Table').outE('classifiedAs').has('__name', within('Dimension')).outV().dedup().limit(25).toList()"; "g.V().has('__typeName', 'Table').as('t').and(__.has('Table.name'),__.outE('classifiedAs').has('__name', within('Dimension')).outV()).dedup().limit(25).toList()"); "g.V().has('__typeName', 'Table').as('t').and(__.outE('classifiedAs').has('__name', within('Dimension')).outV(),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()"); verify("Table isa 'Dimension' and name = 'sales_fact'", "g.V().has('__typeName', 'Table').and(__.outE('classifiedAs').has('__name', within('Dimension')).outV(),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()"); verify("Table is 'Dimension' and Table has owner and name = 'sales_fact'", "g.V().has('__typeName', 'Table').and(__.outE('classifiedAs').has('__name', within('Dimension')).outV(),__.has('Table.owner'),__.has('Table.name', eq('sales_fact'))).dedup().limit(25).toList()");
0
import org.apache.beam.sdk.extensions.sql.meta.provider.ReadOnlyTableProvider; ReadOnlyTableProvider tableProvider = new ReadOnlyTableProvider(
0
private final Stack<Object> stack = new Stack<>();
0
import java.net.DatagramPacket; import java.net.InetAddress; public final class TFTPReadRequestPacket extends TFTPRequestPacket { /*** * Creates a read request packet to be sent to a host at a * given port with a filename and transfer mode request. * <p> * @param destination The host to which the packet is going to be sent. * @param port The port to which the packet is going to be sent. * @param filename The requested filename. * @param mode The requested transfer mode. This should be on of the TFTP * class MODE constants (e.g., TFTP.NETASCII_MODE). ***/ public TFTPReadRequestPacket(InetAddress destination, int port, String filename, int mode) { super(destination, port, TFTPPacket.READ_REQUEST, filename, mode); } /*** * Creates a read request packet of based on a received * datagram and assumes the datagram has already been identified as a * read request. Assumes the datagram is at least length 4, else an * ArrayIndexOutOfBoundsException may be thrown. * <p> * @param datagram The datagram containing the received request. * @throws TFTPPacketException If the datagram isn't a valid TFTP * request packet. ***/ TFTPReadRequestPacket(DatagramPacket datagram) throws TFTPPacketException { super(TFTPPacket.READ_REQUEST, datagram); }
0
stateMach.registerStateModelFactory(DEFAULT_STATE_MODEL, stateModelFactory); }
0
protected SignatureElementProxy() { }; /** * Constructor SignatureElementProxy * * @param doc */ public SignatureElementProxy(Document doc) { if (doc == null) { throw new RuntimeException("Document is null"); } this.doc = doc; this.constructionElement = XMLUtils.createElementInSignatureSpace(this.doc, this.getBaseLocalName()); } /** * Constructor SignatureElementProxy * * @param element * @param BaseURI * @throws XMLSecurityException */ public SignatureElementProxy(Element element, String BaseURI) throws XMLSecurityException { super(element, BaseURI); } /** @inheritDoc */ public String getBaseNamespace() { return Constants.SignatureSpecNS; }
0
package org.apache.batik.ext.awt.image.renderable;
0
StringBuilder results = new StringBuilder();
0
private DataInputView inputView; public DataInputViewWrapper(DataInputView inputView) { this.inputView = inputView; } public void setInputView(DataInputView inputView) { this.inputView = inputView; } @Override public int read() throws IOException { try { return inputView.readUnsignedByte(); } catch (EOFException e) { // translate between DataInput and InputStream, // DataInput signals EOF by exception, InputStream does it by returning -1 return -1; } } @Override public int read(byte[] b, int off, int len) throws IOException { return inputView.read(b, off, len); }
0
import org.apache.htrace.Span;
0
log.debug("Iterator options: " + iterOpts); log.debug("Loading " + iterInfo.className + " " + iterInfo.iterName + " " + iterInfo.priority);
0
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO; import org.apache.ambari.server.orm.dao.HostRoleCommandStatusSummaryDTO; @Inject private static HostRoleCommandDAO s_hostRoleCommandDao; Map<Long, HostRoleCommandStatusSummaryDTO> map = s_hostRoleCommandDao.findAggregateCounts(requestId); for (UpgradeGroupEntity group : groups) { aggregate(map, r, requestId, stageIds, requestPropertyIds); private void aggregate(Map<Long, HostRoleCommandStatusSummaryDTO> smap, Resource upgradeGroup, Long requestId, Set<Long> stageIds, Set<String> requestedIds) { int size = 0; Map<HostRoleStatus, Integer> counts = CalculatedStatus.calculateTaskStatusCounts(smap, stageIds); CalculatedStatus stageStatus = CalculatedStatus.statusFromStageSummary(smap, stageIds); for (Integer i : counts.values()) { size += i.intValue(); setResourceProperty(upgradeGroup, UPGRADE_GROUP_TOTAL_TASKS, size, requestedIds); setResourceProperty(upgradeGroup, UPGRADE_GROUP_STATUS, stageStatus.getStatus(), requestedIds); setResourceProperty(upgradeGroup, UPGRADE_GROUP_PROGRESS_PERCENT, stageStatus.getPercent(), requestedIds);
0
throws SAXException, IOException {
0
log.info("ConditionalUpdate was not rejected by server due to table" + " constraint. Sleeping and retrying");
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
/** Marks a constant pool entry as a Module Reference. * @see <a href="http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html#jigsaw-2.6"> * JPMS: Modules in the Java Language and JVM</a> * Note: Early access Java 9 support- currently subject to change */ public static final byte CONSTANT_Module = 19; /** Marks a constant pool entry as a Package Reference. * @see <a href="http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html#jigsaw-2.6"> * JPMS: Modules in the Java Language and JVM</a> * Note: Early access Java 9 support- currently subject to change */ public static final byte CONSTANT_Package = 20; "CONSTANT_MethodType", "", "CONSTANT_InvokeDynamic", "CONSTANT_Module", "CONSTANT_Package"}; * * the sizes of the indices in the exception_table of the Code attribute (§4.7.3), * Opcode definitions in The Java Virtual Machine Specification</a> */ * * return OPCODE_NAMES[index]; * * @return Number of words consumed on operand stack * * * *
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/ListIteratorCharListIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff Exp $ * * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $
0
import org.apache.hc.core5.http.ssl.TLS;
0
FileItem item = fileIter.next(); @Override @Override @Override @Override FileItem item = fileIter.next(); final FileItem fileItem = fileItems.get(0);
0
StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_0, 200, "OK"); HttpMutableResponse response = new BasicHttpResponse(statusline); StatusLine statusline = new StatusLine(HttpVersion.HTTP_1_1, 200, "OK"); HttpMutableResponse response = new BasicHttpResponse(statusline);
0
// nothing really to do; GC will do the rest
0
// register a PropertyPlaceholderConfigurer this.addComponent(CocoonPropertyOverrideConfigurer.class.getName(), CocoonPropertyOverrideConfigurer.class.getName(), null, true, parserContext.getRegistry()); // add the servelt context as a bean
0
* Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
1
import java.io.ByteArrayInputStream; import org.ops4j.pax.exam.forked.ForkedTestContainer; import org.ops4j.pax.exam.junit.ExamFactory; import org.ops4j.pax.exam.nat.internal.NativeTestContainer; import org.ops4j.pax.exam.nat.internal.NativeTestContainerFactory; /** * The common integration test support class * * The default is always to use the {@link NativeTestContainer} as it is much * faster. Tests that need more isolation should use the {@link ForkedTestContainer}. */ @ExamFactory(NativeTestContainerFactory.class) public Option[] configuration() return OptionUtils.combine(OptionUtils.combine( base, option ), additionalConfiguration()); } protected Option[] additionalConfiguration() { return null;
0
* public class ObjectCreationFactoryTestImpl extends AbstractObjectCreationFactory { public Object createObject( Attributes attributes ) { this.attributes = new AttributesImpl( attributes );
1
package org.apache.commons.digester3.examples.api.catalog;
0
import org.apache.commons.digester3.rule.AbstractObjectCreationFactory; import org.xml.sax.Attributes; Class<? extends ObjectCreationFactory<?>> factoryClass() default DefaultObjectCreationFactory.class; /** * Dummy ObjectCreationFactory type only for annotation value type purposes. */ public static final class DefaultObjectCreationFactory extends AbstractObjectCreationFactory<Object> { /** * {@inheritDoc} */ @Override public Object createObject(Attributes attributes) throws Exception { // do nothing return null; } }
0
String fileName = attributes.getValue( "url" );
0
/** Base class for all string unary operators. */ @Override public boolean accept() {
0
import org.w3c.css.sac.DescendantSelector; import org.w3c.css.sac.SiblingSelector; public DescendantSelector createDescendantSelector public DescendantSelector createChildSelector(Selector parent, public SiblingSelector createDirectAdjacentSelector (short nodeType, Selector child, return new CSSOMDirectAdjacentSelector(nodeType, child, directAdjacent);
0
/** Indicates the strict mode. */ private final boolean strict; /** * Creates an instance of the {@link Nysiis} encoder with strict mode (original form), * i.e. encoded strings have a maximum length of 6. */ /** * Create an instance of the {@link Nysiis} encoder with the specified strict mode: * * <ul> * <li><code>true</code>: encoded strings have a maximum length of 6</li> * <li><code>false</code>: encoded strings may have arbitrary length</li> * </ul> * * @param strict * the strict mode */ public Nysiis(final boolean strict) { this.strict = strict; * * if the parameter supplied is not of a {@link String} * if a character is not mapped * * if a character is not mapped /** * Indicates the strict mode for this {@link Nysiis} encoder. * * @return <code>true</code> if the encoder is configured for strict mode, <code>false</code> otherwise */ public boolean isStrict() { return this.strict; * return this.isStrict() ? string.substring(0, Math.min(TRUE_LENGTH, string.length())) : string;
0
import org.apache.commons.jelly.xpath.XPathTagSupport;
0
if (this.status != ACTIVE) { if (this.status == CLOSING) { this.status = CLOSED; if (this.status == CLOSING) { this.status = CLOSED;
0
public static <T> Transformer<T, Boolean> predicateTransformer(final Predicate<? super T> predicate) { public PredicateTransformer(final Predicate<? super T> predicate) { public Boolean transform(final T input) {
0
import org.apache.accumulo.core.client.impl.Table; private static Map<Table.ID,Map<ProblemType,Integer>> problemSummary = Collections.emptyMap(); public static Map<Table.ID,Map<ProblemType,Integer>> getProblemSummary() {
1
import static com.google.common.base.Preconditions.checkState; int i = rs.getInt(columnName); checkState(!rs.wasNull()); return fromValue(i); int i = rs.getInt(columnIndex); checkState(!rs.wasNull()); return fromValue(i); int i = cs.getInt(columnIndex); checkState(!cs.wasNull()); return fromValue(i);
0
import java.util.Objects; import org.apache.accumulo.core.data.NamespaceId; public static final Namespace DEFAULT = new Namespace("", NamespaceId.of("+default")); public static final Namespace ACCUMULO = new Namespace("accumulo", NamespaceId.of("+accumulo")); private final String name; private final NamespaceId id; public Namespace(String name, NamespaceId id) { this.name = Objects.requireNonNull(name); this.id = Objects.requireNonNull(id); } public String name() { return name; } public NamespaceId id() { return id;
0
List<ACL> listACL = removeDuplicates(createRequest.getAcl()); if (!fixupACL(request.authInfo, listACL)) { listACL, 0, listACL)); listACL = removeDuplicates(setAclRequest.getAcl()); if (!fixupACL(request.authInfo, listACL)) { request.txn = new SetACLTxn(path, listACL, version); private List<ACL> removeDuplicates(List<ACL> acl) { ArrayList<ACL> retval = new ArrayList<ACL>(); Iterator<ACL> it = acl.iterator(); while (it.hasNext()) { ACL a = it.next(); if (retval.contains(a) == false) { retval.add(a); } } return retval; }
0
import org.apache.maven.plugins.annotations.Execute; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; @Mojo( name = "manifest", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true ) @Execute( phase = LifecyclePhase.PROCESS_CLASSES ) @Parameter( property = "rebuildBundle" )
0
import org.apache.ambari.server.state.stack.upgrade.UpgradeType; @UpgradeCheck( group = UpgradeCheckGroup.LIVELINESS, order = 1.0f, required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
0
* @return ThreadFactory
0
requests.add(getRequest(Collections.emptyMap()));
0
/** * 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.aurora.common.args.argfilterstest; import org.apache.aurora.common.args.Arg; import org.apache.aurora.common.args.CmdLine; /** * @author John Sirois */ public final class ArgsRoot { @CmdLine(name = "args_root", help = "") static final Arg<String> ARGS_ROOT = Arg.create(); private ArgsRoot() { // Test class. } }
0
* @version CVS $Id$ public interface Web3Client { String ROLE = Web3Client.class.getName();
0
* Copyright (c) 2002 The Apache Software Foundation. All rights
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
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. */ @SuppressWarnings("all") public enum PartialKey implements org.apache.thrift.TEnum {
0
import org.apache.ambari.logsearch.config.zookeeper.model.inputconfig.impl.InputDescriptorImpl; InputDescriptorImpl inputDescriptor = new InputDescriptorImpl() {}; inputDescriptor.setType("hdfs-namenode"); expect(input.getInputDescriptor()).andReturn(inputDescriptor); InputDescriptorImpl inputDescriptor = new InputDescriptorImpl() {}; inputDescriptor.setType("hdfs-namenode"); expect(input.getInputDescriptor()).andReturn(inputDescriptor); InputDescriptorImpl inputDescriptor = new InputDescriptorImpl() {}; inputDescriptor.setType("hdfs-namenode"); expect(input.getInputDescriptor()).andReturn(inputDescriptor);
0
import org.apache.hc.core5.annotation.Immutable; import org.apache.hc.core5.util.Args; import org.apache.hc.core5.util.LangUtils;
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.test.scenarios.component; import java.util.Properties; import org.apache.felix.ipojo.test.scenarios.service.BarService; import org.apache.felix.ipojo.test.scenarios.service.FooService; public class FooBarProviderType1 implements FooService, BarService { public boolean foo() { return true; } public Properties fooProps() { return new Properties(); } public boolean bar() { return true; } public Properties getProps() { return new Properties(); } public boolean getBoolean() { return true; } public double getDouble() { return 1.0; } public int getInt() { return 1; } public long getLong() { return 1; } public Boolean getObject() { return new Boolean(true); } }
0
import org.apache.accumulo.examples.wikisearch.normalizer.LcNoDiacriticsNormalizer; import org.apache.accumulo.examples.wikisearch.normalizer.Normalizer; import org.apache.accumulo.examples.wikisearch.protobuf.Uid; import org.apache.accumulo.examples.wikisearch.util.TextUtil;
0
import static com.google.common.base.MoreObjects.toStringHelper;
0
/** * TLS/SSL support for asynchronous, event driven communication. */ package org.apache.http.nio.reactor.ssl;
0
return new ProcessKiller(httpSignaler, options.killTreePath,
0
import org.xml.sax.Attributes; this( null ); private String propertyName; /** * Extract the property name from attribute */ private String propertyNameFromAttribute; * Sets the attribute name from which the property name has to be extracted. * * @param propertyNameFromAttribute the attribute name from which the property name has to be extracted. * @since 3.0 */ public void setPropertyNameFromAttribute( String propertyNameFromAttribute ) { this.propertyNameFromAttribute = propertyNameFromAttribute; } /** public void begin( String namespace, String name, Attributes attributes ) throws Exception { if ( propertyNameFromAttribute != null ) { propertyName = attributes.getValue( propertyNameFromAttribute ); getDigester().getLogger().warn( format( "[BeanPropertySetterRule]{%s} Attribute '%s' not found in matching element '%s'", getDigester().getMatch(), propertyNameFromAttribute, name ) ); } } /** * {@inheritDoc} */ @Override
0
import org.testng.Assert; Class cls = ApplicationProperties.getClass("atlas.TypeSystem.impl", ApplicationProperties.class.getName(), TypeSystem.class); cls = ApplicationProperties.getClass("atlas.TypeSystem2.impl", TypeSystem.class.getName(), TypeSystem.class); //incompatible assignTo class, should throw AtlasException try { cls = ApplicationProperties.getClass("atlas.TypeSystem.impl", ApplicationProperties.class.getName(), ApplicationProperties.class); Assert.fail(AtlasException.class.getSimpleName() + " was expected but none thrown."); } catch (AtlasException e) { // good }
0
static class ComponentInstance { private final Ensure m_ensure; public ComponentInstance(Ensure e) { m_ensure = e; m_ensure.step(1); } public void init() { m_ensure.step(2); } public void start() { m_ensure.step(3); } public void stop() { m_ensure.step(4); } public void destroy() { m_ensure.step(5); } static class CustomComponentInstance { private final Ensure m_ensure; public CustomComponentInstance(Ensure e) { m_ensure = e; m_ensure.step(1); } public void a() { m_ensure.step(2); } public void b() { m_ensure.step(3); } public void c() { m_ensure.step(4); } public void d() { m_ensure.step(5); }
0
import javax.servlet.ServletConfig; import javax.servlet.ServletException; import org.apache.felix.http.base.internal.DispatcherServlet; // check for endpoint registration property final Hashtable<String, Object> serviceRegProps = new Hashtable<String, Object>(); if ( getBundleContext().getProperty(FELIX_HTTP_SERVICE_ENDPOINTS) != null ) { serviceRegProps.put(HttpServiceRuntimeConstants.HTTP_SERVICE_ENDPOINT, getBundleContext().getProperty(FELIX_HTTP_SERVICE_ENDPOINTS)); } final Object servlet = new DispatcherServlet(this.getHttpServiceController().getDispatcher()) { @Override public void destroy() { getHttpServiceController().unregister(); super.destroy(); } @Override public void init(final ServletConfig config) throws ServletException { super.init(config); getHttpServiceController().register(config.getServletContext(), serviceRegProps); } };
0
* @version CVS $Id$ public interface XMLSerializer extends XMLConsumer {
0
reconfigFlagClear(); if (shuttingDownLE) { shuttingDownLE = false; startLeaderElection(); } // we need to write the dynamic config file. Either it already exists // or we have the old-style config file and we're in the backward compatibility mode, // so we'll create the dynamic config file for the first time now if (dynamicConfigFilename !=null || (configFilename !=null && configBackwardCompatibility)) { try { QuorumPeerConfig.writeDynamicConfig(dynamicConfigFilename, configFilename, configBackwardCompatibility, qv); if (configBackwardCompatibility) { dynamicConfigFilename = configFilename + ".dynamic"; configBackwardCompatibility = false; } } catch(IOException e){ LOG.error("Error closing file: ", e.getMessage()); } else { LOG.error("writeToDisk == true but dynamicConfigFilename == null, configFilename " + (configFilename == null ? "== null": "!=null") + " and configBackwardCompatibility == " + configBackwardCompatibility); if (prevQV.getVersion() < qv.getVersion() && !prevQV.equals(qv)) { QuorumServer myleaderInCurQV = prevQV.getVotingMembers().get(currentLeaderId); QuorumServer myleaderInNewQV = qv.getVotingMembers().get(currentLeaderId); leaderChange = (myleaderInCurQV == null || myleaderInCurQV.addr == null || myleaderInNewQV == null || !myleaderInCurQV.addr.equals(myleaderInNewQV.addr));
0
@Override
0