Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
* controllers. For all of them the {@code checkForReloading()} * method is called, giving them the chance to trigger a reload if * necessary. If one of these calls returns <b>true</b>, the result of * this method is <b>true</b>, otherwise <b>false</b>. boolean result = false; result = true; return result;
0
import org.apache.sshd.server.channel.ChannelSession; public void start(ChannelSession channel, Environment env) throws IOException { public void destroy(ChannelSession channel) { public Command createCommand(ChannelSession channel, String command) {
0
stubPasswords(); private void stubPasswords(){ if(propertiesTypes != null && propertiesTypes.containsKey(PropertyInfo.PropertyType.PASSWORD)) { for(String pwdPropertyName: propertiesTypes.get(PropertyInfo.PropertyType.PASSWORD)) { if(configs.containsKey(pwdPropertyName)){ String stub = SecretReference.generateStub(clusterName, type, version); configs.put(pwdPropertyName, stub); } } } }
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
// TODO: The id should be associated with the OutgoingMessage so that it is stable // across retried bundles @Override public boolean isEOF() { return false; }
0
* @version $Id$
1
super(org.apache.commons.bcel6.Const.NEW, index);
0
if ( current != desc ) { iLog.addWarning(" Component " + componentDesc.getName() + " is using the " + "deprecated inheritance feature and inherits from " + current.getDescribedClass().getName() + ". This feature will be removed in future versions.", desc.getSource()); } // services, properties, references this.processServices(current, container); this.processProperties(current, container, ocd); this.processReferences(current, container);
0
newInstance = this.getClass().getDeclaredConstructor().newInstance();
0
/** The result of a {@link Gauge} metric. */ /** Empty {@link GaugeResult}, representing no values reported. */ private EmptyGaugeResult() {}
1
import java.util.TreeSet; import org.apache.accumulo.core.client.BatchWriterConfig; BatchWriter bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
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.ambari.server; @SuppressWarnings("serial") public class StackNotFoundException extends AmbariException { public StackNotFoundException (String stackName, String stackVersion) { super("Stack Information not found" + ", stackName=" + stackName + ", stackVersion=" + stackVersion); } }
1
import org.apache.cocoon.portal.layout.LayoutException; import org.apache.cocoon.portal.om.CopletDefinitionFeatures; import org.apache.cocoon.portal.om.CopletInstance; import org.apache.cocoon.portal.om.CopletLayout; import org.apache.cocoon.portal.om.Layout; * <li>{@link org.apache.cocoon.portal.om.Layout}</li> * @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext, org.apache.cocoon.portal.om.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler) throws SAXException, LayoutException {
0
* This is a glue object, to convert short file references to long references. The metadata may contain old relative file references. This class keeps track of * the short file reference, so it can be removed properly from the metadata tables. return compareTo((FileRef) obj) == 0;
0
import org.apache.sshd.util.test.JUnitTestSupport; public class SelectorUtilsTest extends JUnitTestSupport {
0
* </p> * </p>
0
* Returns an iterator over an accumulo table. This iterator uses the options that are currently set on the scanner for its lifetime. So setting options on a
0
import org.apache.aurora.gen.MaintenanceMode; Entry entry3 = createMock(Entry.class); Entry entry4 = createMock(Entry.class); // This entry lacks a slave ID, and should therefore be discarded. LogEntry recoveredEntry3 = createTransaction(Op.saveHostAttributes(new SaveHostAttributes(new HostAttributes() .setHost("host1") .setMode(MaintenanceMode.DRAINED)))); IHostAttributes attributes = IHostAttributes.build(new HostAttributes() .setHost("host2") .setSlaveId("slave2") .setMode(MaintenanceMode.DRAINED)); LogEntry recoveredEntry4 = createTransaction(Op.saveHostAttributes(new SaveHostAttributes(attributes.newBuilder()))); expect(entry3.contents()).andReturn(ThriftBinaryCodec.encodeNonNull(recoveredEntry3)); expect(entry4.contents()).andReturn(ThriftBinaryCodec.encodeNonNull(recoveredEntry4)); expect(stream.readAll()).andReturn(Iterators.forArray(entry1, entry2, entry3, entry4)); storageUtil.attributeStore.saveHostAttributes(attributes); }).times(4);
0
protected static final AttributeInitializer attributeInitializer;
1
import org.apache.commons.vfs.CacheStrategy; import org.apache.commons.vfs.cache.OnCallRefreshFileObject; file = decorateFileObject(file); /** * resync the file information if requested */ if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_RESOLVE)) { file.refresh(); } protected FileObject decorateFileObject(FileObject file) { if (getFileSystemManager().getCacheStrategy().equals(CacheStrategy.ON_CALL)) { return new OnCallRefreshFileObject(file); } return file; } /**
0
public class AgentConfigsUpdateEvent extends STOMPHostEvent implements Hashable {
1
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetricMetadata; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataKey; import java.util.Arrays; import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRIC_AGGREGATION_SQL_FILTERS; private TimelineMetricMetadataManager metadataManagerInstance; private String skipAggrPatternStrings; this.metadataManagerInstance = metadataManager; this.skipAggrPatternStrings = metricsConf.get(TIMELINE_METRIC_AGGREGATION_SQL_FILTERS); List<String> metricNames = new ArrayList<>(); boolean metricNamesNotCondition = false; if (!StringUtils.isEmpty(skipAggrPatternStrings)) { LOG.info("Skipping aggregation for metric patterns : " + skipAggrPatternStrings); metricNames.addAll(Arrays.asList(skipAggrPatternStrings.split(","))); metricNamesNotCondition = true; } Condition condition = new DefaultCondition(metricNames, null, null, null, startTime - serverTimeShiftAdjustment, condition.setMetricNamesNotCondition(metricNamesNotCondition); TimelineMetricMetadataKey appKey = new TimelineMetricMetadataKey(metric.getMetricName(), metric.getAppId()); TimelineMetricMetadata metricMetadata = metadataManagerInstance.getMetadataCacheValue(appKey); if (metricMetadata != null && !metricMetadata.isSupportsAggregates()) { LOG.debug("Skipping cluster aggregation for " + metric.getMetricName()); return 0; }
0
import org.apache.ambari.server.orm.entities.UserEntity; UserEntity userEntity; // Create the admin user userEntity = users.createUser("admin", "admin", "admin"); users.addLocalAuthentication(userEntity, "admin"); users.grantAdminPrivilege(userEntity); // Create a normal user userEntity = users.createUser("user", "user", "user"); users.addLocalAuthentication(userEntity, "user");
0
import java.awt.Cursor; public class CursorMouseOverListener implements EventListener { Element currentTarget = (Element)evt.getCurrentTarget(); if (!CSSUtilities.isAutoCursor(currentTarget)) { Cursor cursor = CSSUtilities.convertCursor(currentTarget, ctx); if (cursor != null) { userAgent.setSVGCursor(cursor); }
0
import org.apache.beam.sdk.extensions.sql.schema.BeamSqlRecordType; import org.apache.beam.sdk.values.BeamRecord; extends PTransform<PCollection<String>, PCollection<BeamRecord>> protected BeamSqlRecordType beamSqlRowType; public BeamTextCSVTableIOReader(BeamSqlRecordType beamSqlRowType, String filePattern, public PCollection<BeamRecord> expand(PCollection<String> input) { return input.apply(ParDo.of(new DoFn<String, BeamRecord>() {
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
suite.addTest(TestByteArrayBuffer.suite()); suite.addTest(TestCharArrayBuffer.suite());
0
Collections.unmodifiableList(new ArrayList<>(references)); List<Reference> refs = new ArrayList<>();
0
* @since 2.0 * @since 1.3 * @since 1.3
1
namespaceId = ClientServiceHandler.checkNamespaceId(master.getInstance(), namespace, op); ClientServiceHandler.checkNamespaceId(master.getInstance(), namespaceId, op);
0
import org.apache.beam.runners.dataflow.worker.fn.data.BeamFnDataGrpcService.DataService; import org.apache.beam.runners.fnexecution.GrpcFnServer; import org.apache.beam.runners.fnexecution.state.GrpcStateService; GrpcFnServer<DataService> grpcDataFnServer, GrpcFnServer<GrpcStateService> grpcStateFnServer,
0
* @throws IOException if an error occurred when encoding sending the packet * @throws IOException if an error occurred when encoding sending the packet * Send a global request and wait for the response. This must only be used when sending * a {@code SSH_MSG_GLOBAL_REQUEST} with a result expected, else it will time out * @param timeout The number of time units to wait - must be <U>positive</U> * @param unit The {@link TimeUnit} to wait for the response * @throws IOException if an error occurred when encoding sending the packet Buffer request(Buffer buffer, long timeout, TimeUnit unit) throws IOException;
0
* nearly-equal responsiveness when scheduling across jobs. In other words, a 1000 instance job * cannot starve a 1 instance job.
0
* @since 3.3
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.MoreObjects;
0
.setName(ResourceType.CPUS.getMesosName())
0
package org.apache.hadoop.metadata.storage.memory; import org.apache.hadoop.metadata.storage.RepositoryException; import org.apache.hadoop.metadata.storage.StructInstance; import org.apache.hadoop.metadata.types.IConstructableType; import org.apache.hadoop.metadata.types.StructType; import org.apache.hadoop.metadata.storage.RepositoryException; import org.apache.hadoop.metadata.storage.StructInstance; import org.apache.hadoop.metadata.types.AttributeInfo; import org.apache.hadoop.metadata.types.HierarchicalType; import org.apache.hadoop.metadata.types.IConstructableType; import org.apache.hadoop.metadata.types.StructType;
0
* @return
0
import org.apache.beam.runners.core.StateTag.StateBinder;
0
import org.apache.http.client.utils.DateUtils; final Date entryDate = DateUtils.parseDate(entry.getFirstHeader(HTTP.DATE_HEADER) .getValue()); final Date responseDate = DateUtils.parseDate(response.getFirstHeader(HTTP.DATE_HEADER) .getValue()); if (entryDate == null || responseDate == null) { return false; } if (!entryDate.after(responseDate)) {
0
return token instanceof KerberosToken || token instanceof DelegationTokenImpl;
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
* * @version $Id$
0
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; * exception on the returned {@link CompletionStage}. public CompletionStage<MutateRowResponse> writeRecord( CompletableFuture<MutateRowResponse> result = new CompletableFuture<>(); result.completeExceptionally(new IOException("cell value missing")); return result; return CompletableFuture.completedFuture(MutateRowResponse.getDefaultInstance());
0
extends RuntimeException
0
import javax.annotation.Nullable; @Nullable private final T identity; @Nullable T identity, ComparatorT comparator) {
0
for (Request logicalRequest : topologyManager.getRequests(Collections.emptySet())) {
0
package org.apache.beam.sdk.io.gcp.bigquery;
0
JexlMethod ctor = uberspect.getConstructorMethod(clazz, args, info); ctor = uberspect.getConstructorMethod(clazz, args, info);
0
* http://www.apache.org/licenses/LICENSE-2.0
0
import com.google.common.collect.ImmutableSet; private static final Set<String> EXPECTED_COUNT_SET = ImmutableSet.of("hi: 5", "there: 1", "sue: 2", "bob: 2");
0
Collections.unmodifiableSet(EnumSet.allOf(BuiltinCompressions.class)); new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IntListList.java,v 1.5 2003/02/28 21:21:51 rwaldhoff Exp $ * @version $Revision: 1.5 $ $Date: 2003/02/28 21:21:51 $ final public class IntListList extends AbstractIntListList implements Serializable { if(null == list) { return null; } else if(list instanceof Serializable) { return new IntListList(list); } else { return new NonSerializableIntListList(list); } protected IntList getIntList() { return _list; }
0
cm = GraphicsUtil.Linear_sRGB_Unpre; cm = GraphicsUtil.sRGB_Unpre; double norm = 0; int pixel = 0, tmp; double mult; mult = (lightColor[0]>lightColor[1])?lightColor[0]:lightColor[1]; mult = (mult>lightColor[2])?mult:lightColor[2]; double scale = 255/mult; pixel = (int)(lightColor[0]*scale+0.5); tmp = (int)(lightColor[1]*scale+0.5); pixel = pixel<<8 | tmp; tmp = (int)(lightColor[2]*scale+0.5); pixel = pixel<<8 | tmp; mult*=255*ks; // System.out.println("Pixel: 0x" + Integer.toHexString(pixel)); norm = L[0]*L[0] + L[1]*L[1] + L[2]*L[2]; if(norm == 0) a = (int)(mult+0.5); else { norm = Math.sqrt(norm); a = (int)(mult*Math.pow((N[0]*L[0] + N[1]*L[1] + N[2]*L[2])/norm, specularExponent) + 0.5); if ((a & 0xFFFFFF00) != 0) a = ((a & 0x80000000) != 0)?0:255; pixels[p++] = (a << 24 | pixel); a = (int)(mult*Math.pow(N[0]*L[0] + N[1]*L[1] + N[2]*L[2], specularExponent) + 0.5); pixels[p++] = (a << 24 | pixel);
0
import org.apache.accumulo.core.client.lexicoder.impl.AbstractLexicoderTest; import org.apache.accumulo.core.util.TextUtil; import org.apache.hadoop.io.Text; public class ListLexicoderTest extends AbstractLexicoderTest { private List<Long> data1 = new ArrayList<Long>(); private List<Long> data2 = new ArrayList<Long>(); private List<Long> data3 = new ArrayList<Long>(); private List<Long> data4 = new ArrayList<Long>(); private List<Long> data5 = new ArrayList<Long>(); public void setUp() { } public void testSortOrder() { public void testDecodes() { assertDecodes(new ListLexicoder<Long>(new LongLexicoder()), data1); assertDecodes(new ListLexicoder<Long>(new LongLexicoder()), data2); assertDecodes(new ListLexicoder<Long>(new LongLexicoder()), data3); assertDecodes(new ListLexicoder<Long>(new LongLexicoder()), data4); assertDecodes(new ListLexicoder<Long>(new LongLexicoder()), data5); }
0
// Adds dependencies (except named dependencies, which are managed by the lifecycle handler). addUnamedDependencies(b, dm, service, srvMeta, depsMeta);
0
package org.apache.beam.sdk.extensions.joinlibrary;
0
import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.server.ServerContext; public class SimpleGarbageCollector implements Iface { private ServerContext context; private Opts opts; public static void main(String[] args) { ServerContext context = ServerContext.getInstance(); context.setupServer(app, SimpleGarbageCollector.class.getName(), opts.getAddress()); SimpleGarbageCollector gc = new SimpleGarbageCollector(opts, context); context.teardownServer(); public SimpleGarbageCollector(Opts opts, ServerContext context) { this.context = context; this.fs = context.getVolumeManager(); ServerContext getContext() { return context; } AccumuloConfiguration getConfiguration() { return context.getConfiguration(); } Connector getConnector() throws AccumuloSecurityException, AccumuloException { return context.getConnector(); } return Tables.getIdToNameMap(context).keySet(); CloseWriteAheadLogReferences closeWals = new CloseWriteAheadLogReferences(context); GarbageCollectWriteAheadLogs walogCollector = new GarbageCollectWriteAheadLogs(context, fs, String path = ZooUtil.getRoot(context.getInstanceID()) + Constants.ZGC_LOCK; if (ThriftServerType.SASL == context.getThriftServerType()) { ServerAddress server = TServerUtils.startTServer(getConfiguration(), context.getThriftServerType(), processor, this.getClass().getSimpleName(), "GC Monitor Service", 2, maxMessageSize, context.getServerSslParams(), context.getSaslParams(), 0, addresses);
0
public static final String SERVER_TMP_DIR_KEY = "server.tmp.dir"; public static final String SERVER_TMP_DIR_DEFAULT = "/var/lib/ambari-server/tmp"; configsMap.put(SERVER_TMP_DIR_KEY, properties.getProperty( SERVER_TMP_DIR_KEY, SERVER_TMP_DIR_DEFAULT));
0
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState); final Authorizations auths = getAuths(cl, shellState); final BatchWriter writer = shellState.getConnector().createBatchWriter(tableName, 1024 * 1024, 1000L, 4); final Options opts = super.getOptions();
0
public interface FieldValueGetterFactory extends Factory<List<FieldValueGetter>> { @Override List<FieldValueGetter> create(Class<?> targetClass, Schema schema);
0
* * @since 4.0
0
* @version $Id: TestHierarchicalXMLConfiguration.java,v 1.5 2004/12/18 16:33:03 oheger Exp $ private static final String TEST_SAVE = "target" + File.separator + TEST_SAVENAME; config.addProperty("[@topattr]", "available"); config.addProperty("[@topattr]", "successfull"); assertEquals("available", config.getString("[@topattr](0)")); assertEquals("successfull", config.getString("[@topattr](1)"));
0
import org.apache.hc.core5.http.ContentType;
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.checkNotNull; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Verify.verify; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
return new JsonDeserializingImpl<T>(converter, ref.getType()); @Override @SuppressWarnings("rawtypes") return new JsonDeserializingImpl(converter, type);
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.checkNotNull; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
0
@Override
0
import static org.junit.Assert.fail; import org.apache.beam.sdk.transforms.SerializableFunction; /** Test reading metadata by reading back the id of a document after writing it. */ void testReadWithMetadata() throws Exception { if (!useAsITests) { ElasticSearchIOTestUtils.insertTestDocuments(connectionConfiguration, 1, restClient); } PCollection<String> output = pipeline.apply( ElasticsearchIO.read() .withConnectionConfiguration(connectionConfiguration) .withMetadata()); PAssert.that(output).satisfies(new ContainsStringCheckerFn("\"_id\":\"0\"")); pipeline.run(); } /** * Function for checking if any string in iterable contains expected substring. Fails if no match * is found. */ private static class ContainsStringCheckerFn implements SerializableFunction<Iterable<String>, Void> { private String expectedSubString; ContainsStringCheckerFn(String expectedSubString) { this.expectedSubString = expectedSubString; } @Override public Void apply(Iterable<String> input) { for (String s : input) { if (s.contains(expectedSubString)) { return null; } } fail("No string found containing " + expectedSubString); return null; } }
0
final String exchangeId = scope.exchangeId; this.log.debug(exchangeId + ": wait for " + ((double) nextInterval / 1000) + " seconds" );
0
package com.twitter.common.args.parsers; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.Range; import com.twitter.common.args.ArgParser; /** * A parser that handles closed ranges. For the input "4-6", it will capture [4, 5, 6]. */ @ArgParser public class RangeParser extends NonParameterizedTypeParser<Range<Integer>> { @Override public Range<Integer> doParse(String raw) throws IllegalArgumentException { ImmutableList<String> numbers = ImmutableList.copyOf(Splitter.on('-').omitEmptyStrings().split(raw)); try { int from = Integer.parseInt(numbers.get(0)); int to = Integer.parseInt(numbers.get(1)); if (numbers.size() != 2) { throw new IllegalArgumentException("Failed to parse the range:" + raw); } if (to < from) { return Range.closed(to, from); } else { return Range.closed(from, to); } } catch (NumberFormatException e) { throw new IllegalArgumentException("Failed to parse the range:" + raw, e); } } }
0
System.out.printf("%20s : %6.2f\n", entry.getKey(), entry.getValue().mean());
0
private static final byte[] CRLF = new byte[] {HTTP.CR, HTTP.LF}; write(CRLF); write(CRLF);
0
private Long numFiles; private Long numRows; private Long rawDataSize; private Long totalSize; public Long getNumFiles() { public void setNumFiles(Long numFiles) { public Long getRawDataSize() { public void setRawDataSize(Long rawDataSize) { public Long getTotalSize() { public void setTotalSize(Long totalSize) { public Long getNumRows() { public void setNumRows(Long numRows) {
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
* Tests for {@link Regex}. public class RegexTest implements Serializable { .apply(Regex.find("[xyz]")); .apply(Regex.find("([xyz])", 1)); .apply(Regex.find("[xyz]")); .apply(Regex.findKV("a (b) (c)", 1, 2)); .apply(Regex.findKV("a (b) (c)", 1, 2)); .apply(Regex.matches("[xyz]")); .apply(Regex.matches("[xyz]")); .apply(Regex.matches("x ([xyz]*)", 1)); .apply(Regex.matchesKV("a (b) (c)", 1, 2)); .apply(Regex.matchesKV("a (b) (c)", 1, 2)); .apply(Regex.replaceAll("[xyz]", "new")); .apply(Regex.replaceAll("[xyz]", "new")); .apply(Regex.replaceFirst("[xyz]", "new")); .apply(Regex.replaceFirst("[xyz]", "new")); .apply(Regex.split("\\W+")); .apply(Regex.split("\\s", true)); .apply(Regex.split("\\s", false));
0
return new StateAccessorImpl<>( new MergingStateAccessorImpl<>(activeWindows, return new OnPremergeContextImpl(new PremergingStateAccessorImpl<>(
0
import org.apache.sshd.server.command.Command;
0
import org.apache.commons.cli.Parser; * @version $Revision: 1.9 $
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestFilterListIterator.java,v 1.3 2002/05/13 16:10:37 rwaldhoff Exp $ * $Revision: 1.3 $ * $Date: 2002/05/13 16:10:37 $ * @version $Revision: 1.3 $ $Date: 2002/05/13 16:10:37 $ public void testFailingHasNextBug() { FilterListIterator filtered = new FilterListIterator(list.listIterator(),fourPred); ListIterator expected = fours.listIterator(); while(expected.hasNext()) { expected.next(); filtered.next(); } assertTrue(filtered.hasPrevious()); assertTrue(!filtered.hasNext()); assertEquals(expected.previous(),filtered.previous()); }
0
* @version $Revision$
0
* Autogenerated by Thrift Compiler (0.11.0) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)")
0
package org.apache.felix.ipojo.runtime.core.test.components.proxy; import org.apache.felix.ipojo.runtime.core.test.services.CheckService; import org.apache.felix.ipojo.runtime.core.test.services.FooService; import org.osgi.framework.BundleContext; import java.util.Properties; public class CheckServiceDelegator implements CheckService { private FooService fs; private Helper helper; public CheckServiceDelegator(BundleContext bc) { helper = new Helper(bc, fs); } public boolean check() { // Don't access the service // Just delegate return helper.check(); } public Properties getProps() { // Don't access the service // Just delegate return helper.getProps(); } }
0
/* Copyright 2003 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.batik.dom; import org.apache.batik.test.AbstractTest; import org.apache.batik.test.TestReport; import org.apache.batik.util.SVGConstants; import org.apache.batik.dom.svg.SVGDOMImplementation; import org.w3c.dom.*; /** * Tests Attr.isId. * * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a> * @version $Id$ */ public class AttrIsIdTest extends DOM3Test { public boolean runImplBase() throws Exception { Document doc = newSVGDoc(); Element g = doc.createElementNS(SVG_NAMESPACE_URI, "g"); g.setAttributeNS(null, "id", "n1"); doc.getDocumentElement().appendChild(g); Attr a = g.getAttributeNodeNS(null, "id"); return ((org.apache.batik.dom.dom3.Attr) a).isId(); } }
0
element = elt; properties = props;
0
import org.apache.sshd.server.auth.hostbased.HostBasedAuthenticator; private HostBasedAuthenticator hostBasedAuthenticator; public HostBasedAuthenticator getHostBasedAuthenticator() { return resolveEffectiveProvider(HostBasedAuthenticator.class, hostBasedAuthenticator, getFactoryManager().getHostBasedAuthenticator()); } @Override public void setHostBasedAuthenticator(HostBasedAuthenticator hostBasedAuthenticator) { this.hostBasedAuthenticator = hostBasedAuthenticator; } @Override
0
import org.apache.http.impl.client.CloseableHttpClient; protected CloseableHttpClient httpclient; this.httpclient.close();
0
@Override public int hashCode() { return 31 + servletInfo.hashCode(); } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass() ) { return false; } final ServletHandler other = (ServletHandler) obj; return servletInfo.equals(other.servletInfo); }
0
import org.w3c.dom.Node; /** * Returns a new uninitialized instance of this object's class. */ protected Node newNode() { return new SVGOMFEMergeElement(); }
0
* This class can be used to resolve an instance of * {@link HttpRequestHandler} matching a particular request URI. Usually the * resolved request handler will be used to process the request with the * *
0
Document doc = XMLUtils.newDocument(false); importDoc = XMLUtils.parse(is, false); importDoc = XMLUtils.parse(is, false); importDoc = XMLUtils.parse(is, false); importDoc = XMLUtils.parse(is, false); importDoc = XMLUtils.parse(is, false); importDoc = XMLUtils.parse(is, false);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java,v 1.11 2002/04/24 04:05:40 dmitri Exp $ * $Revision: 1.11 $ * $Date: 2002/04/24 04:05:40 $ import org.apache.commons.jxpath.*; * @version $Revision: 1.11 $ $Date: 2002/04/24 04:05:40 $ while (context.nextSet()){ while (context.next()){ while (context.nextSet()){ while (context.next()){
0
import java.util.concurrent.ConcurrentSkipListSet; private final CompactionWaitInfo compactionWaitInfo = new CompactionWaitInfo(); log.debug("Writing updated status to metadata table for " + logEntry.filename + " " + ProtobufUtil.toString(status)); ReplicationTableUtil.updateFiles(tabletServer, extent, logEntry.filename, status); currentLogs = new ConcurrentSkipListSet<DfsLogger>(); currentLogs.add(new DfsLogger(tabletServer.getServerConfig(), logEntry.filename, logEntry.getColumnQualifier().toString())); String oldName = Thread.currentThread().getName(); Thread.currentThread().setName("Minor compacting " + this.extent); Thread.currentThread().setName(oldName); currentLogs = new ConcurrentSkipListSet<DfsLogger>(); private ConcurrentSkipListSet<DfsLogger> currentLogs = new ConcurrentSkipListSet<DfsLogger>(); // currentLogs may be updated while a tablet is otherwise locked public Set<DfsLogger> getCurrentLogFiles() { return new HashSet<DfsLogger>(currentLogs); public int getLogCount() { public boolean beginUpdatingLogsUsed(InMemoryMap memTable, DfsLogger more, boolean mincFinish) { if (addToOther) { if (otherLogs.add(more)) numAdded++; if (currentLogs.contains(more)) numContained++; } else { if (currentLogs.add(more)) numAdded++; if (otherLogs.contains(more)) numContained++; if (numAdded > 0 && numAdded != 1) { if (numContained > 0 && numContained != 1) {
1
*/ */ protected List vec = new ArrayList(); public void addElement( JavaClass clazz ) { vec.add(clazz); } public JavaClass elementAt( int index ) { return (JavaClass) vec.get(index); } public void removeElementAt( int index ) { vec.remove(index); } public JavaClass[] toArray() { JavaClass[] classes = new JavaClass[vec.size()]; vec.toArray(classes); return classes; }
0
package org.apache.xml.security.stax.test; import org.apache.xml.security.stax.ext.InputProcessor; import org.apache.xml.security.stax.ext.InputProcessorChain; import org.apache.xml.security.stax.ext.XMLSecurityConstants; import org.apache.xml.security.stax.ext.XMLSecurityException; import org.apache.xml.security.stax.ext.stax.XMLSecEvent; import org.apache.xml.security.stax.impl.InputProcessorChainImpl; import org.apache.xml.security.stax.impl.SecurityContextImpl;
0
package org.apache.aurora.scheduler.http;
0
* http://www.apache.org/licenses/LICENSE-2.0
0
import static org.junit.Assert.assertNull; import org.apache.ambari.server.Role; boolean foundOne = false; for (HostRoleCommand hrc : commands) { if (hrc.getRole().equals(Role.AMBARI_SERVER_ACTION)) { assertEquals(-1L, hrc.getHostId()); assertNull(hrc.getHostName()); foundOne = true; } } assertTrue("Expected at least one server-side action", foundOne);
1
put("oozie.authentication.kerberos.name.rules", "\n "); "oozie-site", new HashMap<String, String>(), Collections.singleton("oozie.authentication.kerberos.name.rules"),
0
* Copyright 2001-2006 The Apache Software Foundation import java.util.Iterator; * Return an Iterator of the action names contained in this Result. * @return The set of action names. */ public Iterator getActions() { return Collections.unmodifiableMap(hAction).keySet().iterator(); } /** * @deprecated Use getActions() to return the set of actions * the isValid(name) and getResult(name) methods * to determine the contents of ResultStatus. *
0