Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.beam.runners.core.construction.graph.PipelineNode.PCollectionNode; PCollectionNode getPCollection();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestSet.java,v 1.3 2003/07/12 15:11:25 scolebourne Exp $ * $Revision: 1.3 $ * $Date: 2003/07/12 15:11:25 $ * @version $Id: TestSet.java,v 1.3 2003/07/12 15:11:25 scolebourne Exp $ //----------------------------------------------------------------------- * Provides additional verifications for sets. protected void verify() { super.verify(); assertEquals("Sets should be equal", confirmed, collection); assertEquals("Sets should have equal hashCodes", confirmed.hashCode(), collection.hashCode()); HashSet set = new HashSet(); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { assertTrue("Set.iterator should only return unique elements", set.add(iterator.next())); } //----------------------------------------------------------------------- /** * Makes an empty collection by invoking {@link #makeEmptySet()}. * * @return an empty collection */ protected final Collection makeCollection() { return makeEmptySet(); } /** * Makes a full collection by invoking {@link #makeFullSet()}. * * @return a full collection */ protected final Collection makeFullCollection() { return makeFullSet(); } //----------------------------------------------------------------------- /** * Return the {@link TestCollection#collection} fixture, but cast as a * Set. */ protected Set getSet() { return (Set)collection; } /** * Return the {@link TestCollection#confirmed} fixture, but cast as a * Set. **/ protected Set getConfirmedSet() { return (Set)confirmed; } //-----------------------------------------------------------------------
0
public StartCronResponse startCronJob(JobKey jobKey, SessionKey session) throws TException { logUserAction(session, "startCronJob|jobKey: %s", jobKey); return delegate.startCronJob(jobKey, session);
0
* @author <a href="mailto:[email protected]">Gary Gregory</a>
0
LOG.debug(validationResult.get());
0
long stamp = wid.maxTimestamp() - 1;
0
public class TagTransformer extends AbstractXMLProducer implements Transformer, Serviceable, Configurable, Disposable, Recyclable { getLogger().fatal("recycle: internal Error, tagSelectorStack not empty"); ServiceSelector tagSelector; Transformer tagTransformer;
0
import com.google.common.collect.ImmutableSet; import org.apache.aurora.scheduler.base.Tasks; import org.apache.aurora.scheduler.storage.Storage; import org.apache.aurora.scheduler.storage.TaskStore; import org.junit.Test; import static org.junit.Assert.assertEquals; private FakeStatsProvider statsProvider; statsProvider = new FakeStatsProvider(); bind(StatsProvider.class).toInstance(statsProvider); @Test public void testSecondaryIndexConsistency() { // Test for regression of AURORA-1305. storage.write(new Storage.MutateWork.NoResult.Quiet() { @Override protected void execute(Storage.MutableStoreProvider storeProvider) { TaskStore.Mutable taskStore = storeProvider.getUnsafeTaskStore(); taskStore.saveTasks(ImmutableSet.of(TASK_A)); taskStore.deleteTasks(Tasks.ids(TASK_A)); assertEquals(0L, statsProvider.getLongValue(MemTaskStore.getIndexSizeStatName("job"))); } }); }
0
/** * @since 2.0.0 */ public IsolationException(Exception cause) { super(cause); } public IsolationException() { super(); }
0
* @version $Id: TestConfigurationFactory.java,v 1.11 2004/06/02 16:42:25 ebourg Exp $ configuration = compositeConfiguration; configuration = compositeConfiguration;
0
"org.apache.hadoop.*", "com.sun.org.apache.xerces.*"})
0
import org.apache.batik.util.DoublyIndexedTable;
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.configurator.impl.model; import java.io.Serializable; import java.util.List; /** * This object holds all configurations provided by a single bundle * when the configurations are read. * Later on it just holds the last modified information. The configurations * are merged into the {@code State} object. */ public class BundleState extends AbstractState implements Serializable { private static final long serialVersionUID = 1L; public void addFiles(final List<ConfigurationFile> allFiles) { for(final ConfigurationFile f : allFiles) { for(final Config c : f.getConfigurations()) { // set index final ConfigList list = this.getConfigurations(c.getPid()); if ( list != null ) { c.setIndex(list.size()); } this.add(c); } } } }
0
@Nullable @org.apache.avro.reflect.Nullable public final Person newPerson; @Nullable @org.apache.avro.reflect.Nullable public final Auction newAuction; @Nullable @org.apache.avro.reflect.Nullable public final Bid bid;
1
import com.fasterxml.jackson.annotation.JsonAutoDetect; 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
* @version CVS $Id: WidgetReplacingPipe.java,v 1.20 2003/12/26 18:12:18 vgritsenko Exp $ if (inWidgetElement) { if (inWidgetElement) {
0
* Copyright 1999-2006 The Apache Software Foundation
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/util/TypeUtils.java,v 1.12 2003/10/09 21:31:42 rdonkin Exp $ * $Revision: 1.12 $ * $Date: 2003/10/09 21:31:42 $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation. * @version $Revision: 1.12 $ $Date: 2003/10/09 21:31:42 $
0
import org.apache.felix.sigil.common.model.IModelElement; import org.apache.felix.sigil.common.model.ModelElementFactory; import org.apache.felix.sigil.common.model.eclipse.ISigilBundle; import org.apache.felix.sigil.common.model.osgi.IPackageImport; import org.apache.felix.sigil.common.model.osgi.IPackageModelElement;
0
try (AccumuloClient c = createClient()) { try (AccumuloClient c = createClient()) {
0
return new InMemoryValue<>(); return new InMemoryBag<>();
0
* @version $Id$
0
final Map<byte[], BigInteger> map
0
import static org.junit.Assert.assertTrue; assertTrue("Had more tasks to run", queued.isEmpty()); assertFalse("Had more tasks that needed to be submitted", itr.hasNext());
0
int maxLineLen, int maxHeaderCount, super(buffer, maxLineLen, maxHeaderCount); public HttpRequestParser( final SessionInputBuffer buffer, final HttpRequestFactory requestFactory) { this(buffer, -1, -1, requestFactory); }
0
package org.apache.felix.gogo.command;
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
/** * DBCP-412 * Verify that omitting factory.setPool(pool) when setting up PDS does not * result in NPE. */ public void testFixFactoryConfig() throws Exception { Properties props = new Properties(); props.setProperty("user", "username"); props.setProperty("password", "password"); PoolableConnectionFactory f = new PoolableConnectionFactory( new DriverConnectionFactory(new TesterDriver(), "jdbc:apache:commons:testdriver", props), null); f.setValidationQuery("SELECT DUMMY FROM DUAL"); f.setDefaultReadOnly(Boolean.TRUE); f.setDefaultAutoCommit(Boolean.TRUE); GenericObjectPool<PoolableConnection> p = new GenericObjectPool<>(f); p.setMaxTotal(getMaxTotal()); p.setMaxWaitMillis(getMaxWaitMillis()); ds = new PoolingDataSource<>(p); assertTrue(f.getPool().equals(p)); ds.getConnection(); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.sshd.common.util.io.resource; import java.io.IOException; import java.io.InputStream; import java.net.URI; import java.net.URL; /** * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class URIResource extends AbstractIoResource<URI> { public URIResource(URI uri) { super(URI.class, uri); } public URI getURI() { return getResourceValue(); } @Override public InputStream openInputStream() throws IOException { URI uri = getURI(); URL url = uri.toURL(); return url.openStream(); } }
0
public static final public static final public static final public static final public static final public static final GVTAttributedCharacterIterator.TextAttribute TEXTPATH = public static final GVTAttributedCharacterIterator.TextAttribute ANCHOR_TYPE = public static final GVTAttributedCharacterIterator.TextAttribute LETTER_SPACING = public static final GVTAttributedCharacterIterator.TextAttribute WORD_SPACING = public static final GVTAttributedCharacterIterator.TextAttribute KERNING = flowRegionNodes = null; protected void computeLaidoutText(BridgeContext ctx, for (char ch = aci.current(); else if (ln.equals(SVG12Constants.SVG_FLOW_DIV_TAG)) divTPI.visible = true; if (ret == null) ret.addAttribute(FLOW_LINE_BREAK, ret.addAttribute(FLOW_PARAGRAPH, makeBlockInfo(ctx, elem), if (!SVG12Constants.SVG_NAMESPACE_URI.equals(n.getNamespaceURI())) if (len == startLen) fillAttributedStringBuffer(ctx, nodeElement, false, subBidiLevel, // System.out.println("Line: " + asb.length() + false, subBidiLevel, SVG_EVENT_CLICK, Map m = getAttributeMap(ctx, nodeElement, null, v = CSSUtilities.getComputedStyle(element, if (v == ValueConstants.LTR_VALUE) return new BlockInfo(top, right, bottom, left, indent, textAlign, protected float getLineHeight(BridgeContext ctx, Element element,
0
public boolean tryClaim(Void position) { public void processElement( ProcessContext context, RestrictionTracker<SomeRestriction, Void> tracker) {} ProcessContext context, RestrictionTracker<SomeRestriction, Void> tracker) {
0
public PutResult put(InputStream stream, PutOptions options) throws Exception {
0
INSTANCE_GUID_NOT_FOUND(404, "ATLAS4045E", "Given instance guid {0} is invalid/not found"),
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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * 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.view.huetoambarimigration.datasource.queryset.huequeryset.pig.jobqueryset; public class SqliteQuerySetHueDb extends QuerySetHueDb { }
0
import org.apache.http.HttpResponse; public void process(final HttpResponse response, final HttpContext context)
0
metatypeLocation = NEW_LOCATION.replace(File.separatorChar, '/') + "/" + baseName;
0
pool.setBlockWhenExhausted(false);
1
char newbuffer[] = new char[Math.max(this.buffer.length << 1, newlen)]; expand(newlen); if (str == null) { str = "null"; } int strlen = str.length(); int newlen = this.len + strlen; if (newlen > this.buffer.length) { expand(newlen); } str.getChars(0, strlen, this.buffer, this.len); this.len = newlen; int newlen = this.len + 1; if (newlen > this.buffer.length) { expand(newlen); } this.buffer[this.len] = ch; this.len = newlen; append(String.valueOf(obj)); this.len = 0; char[] b = new char[this.len]; if (this.len > 0) { } return new String(this.buffer, 0, this.len);
0
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(context); AuthConfigurationBuilder authConfigurationBuilder = new AuthConfigurationBuilder(context); Map<String, String> authParams = authConfigurationBuilder.build(); configurationBuilder.setAuthParams(authParams); try { api = new HdfsApi(configurationBuilder, getHdfsUsername(context)); LOG.info("HdfsApi connected OK"); } catch (IOException e) { String message = "HDFS040 Couldn't open connection to HDFS"; LOG.error(message); throw new HdfsApiException(message, e); } catch (InterruptedException e) { String message = "HDFS041 Couldn't open connection to HDFS"; LOG.error(message); throw new HdfsApiException(message, e); } return api; } finally { Thread.currentThread().setContextClassLoader(currentClassLoader);
0
@SuppressWarnings("serial")
0
addRequestHandler(new PuttyRequestHandler());
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
package examples.unix;
0
import java.util.Map; import org.apache.avalon.framework.parameters.Parameters; * @version CVS $Id: TestCronJob.java,v 1.2 2003/09/05 10:22:39 giacomo Exp $ extends AbstractLogEnabled implements CronJob, Configurable, Component, ConfigurableCronJob { /** Parameter key for the message */ public static final String PARAMETER_MESSAGE = "TestCronJob.Parameter.Message"; /** Parameter key for the sleep value */ public static final String PARAMETER_SLEEP = "TestCronJob.Parameter.Sleep"; throws ConfigurationException { getLogger().info("CronJob " + name + " launched at " + new Date() + " with message '" + m_msg + "' and sleep timeout of " + m_sleep + "ms"); getLogger().info("CronJob " + name + " finished at " + new Date() + " with message '" + m_msg + "' and sleep timeout of " + m_sleep + "ms"); } /* (non-Javadoc) * @see org.apache.cocoon.components.cron.ConfigurableCronJob#setup(org.apache.avalon.framework.parameters.Parameters, java.util.Map) */ public void setup(Parameters params, Map objects) { if (null != params) { m_msg = params.getParameter(PARAMETER_MESSAGE, m_msg); m_sleep = params.getParameterAsInteger(PARAMETER_SLEEP, m_sleep); }
0
final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort()); final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort()); final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort()); final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort()); final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort()); final InetSocketAddress remoteAddress = new InetSocketAddress("localhost", this.server.getLocalPort());
0
Text tablet = new KeyExtent("0", new Text("m"), null).getMetadataEntry(); KeyExtent ke1 = new KeyExtent("0", new Text("m"), null); KeyExtent ke2 = new KeyExtent("0", null, null);
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.logfeeder.docker.command; import java.util.Map; /** * Responsible of execute container commands. (like listing or inspecting containers) * @param <RESPONSE_TYPE> */ public interface ContainerCommand<RESPONSE_TYPE> { /** * Execute a container command * @param params extra parameters for the command * @return return type of the execution - can be anything */ RESPONSE_TYPE execute(Map<String, String> params); }
0
private List<DependencyConditionInfo> dependencyConditions = new ArrayList<>();
0
// This is implemented by the ServletContext wrapper created in the Dispatcher
0
import org.apache.hc.client5.http.sync.methods.HttpGet;
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
expect(permissionEntity.getSortOrder()).andReturn(1); Assert.assertEquals(1, resource.getPropertyValue(PermissionResourceProvider.SORT_ORDER_PROPERTY_ID));
0
System.out.println(repos[i].getURI()); System.out.println("No repository URLs are set.");
0
* Get database schema name * @return @dbSchema */ String getDbSchema(); /**
0
import java.util.Map; import java.util.Optional; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; public Map<String, String> toMap(Optional<ObjectMapper> mapper) { Map<String, String> map = mapper.orElseGet(ObjectMapper::new).convertValue(this, new TypeReference<Map<String, String>>(){}); if ( !Boolean.parseBoolean(map.get("keyStore")) ) { // keyStore is declared as a primitive value instead of Boolean -> treat false as unset map.remove("keyStore"); } return map; } public static ValueAttributesInfo fromMap(Map<String, String> attributes, Optional<ObjectMapper> mapper) { return mapper.orElseGet(ObjectMapper::new).convertValue(attributes, ValueAttributesInfo.class); }
0
Set<RepositoryVersionEntity> changedRepositoryVersions = new HashSet<>(); new HashMap<>();
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.beam.sdk.io.hbase.coders; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import org.apache.hadoop.conf.Configuration; /** * This is just a wrapper class to serialize Hadoop/HBase {@link Configuration}. */ public class SerializableConfiguration implements Serializable { private transient Configuration conf; public SerializableConfiguration(Configuration conf) { this.conf = conf; } private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); conf.write(out); } private void readObject(ObjectInputStream in) throws IOException { conf = new Configuration(false); conf.readFields(in); } public Configuration getConfiguration() { return conf; } }
0
import java.util.*; public void removeTypes(Collection<String> typeNames) { for(String typeName : typeNames) { IDataType dataType = types.get(typeName); types.remove(typeName); step1(); step2();
0
@Test public void testContentEncodingHeaderIsNotUpdatedByMerge() throws IOException { final Header[] headers = { new BasicHeader("Date", DateUtils.formatDate(requestDate)), new BasicHeader("ETag", "\"etag\""), new BasicHeader("Content-Encoding", "identity")}; entry = HttpTestUtils.makeCacheEntry(headers); response.setHeaders(new BasicHeader("Last-Modified", DateUtils.formatDate(responseDate)), new BasicHeader("Cache-Control", "public"), new BasicHeader("Content-Encoding", "gzip")); final HttpCacheEntry updatedEntry = impl.updateCacheEntry(null, entry, new Date(), new Date(), response); final Header[] updatedHeaders = updatedEntry.getAllHeaders(); headersContain(updatedHeaders, "Content-Encoding", "identity"); } private void headersContain(final Header[] headers, final String name, final String value) { for (final Header header : headers) { if (header.getName().equals(name)) { if (header.getValue().equals(value)) { return; } } } fail("Header [" + name + ": " + value + "] not found in headers."); }
0
import java.util.Iterator; import org.apache.commons.jexl3.introspection.JexlUberspect; import org.apache.commons.jexl3.introspection.JexlSandbox; public final class SandboxUberspect implements JexlUberspect { /** The base uberspect. */ protected final JexlUberspect uberspect; protected final JexlSandbox sandbox; * A constructor for JexlSandbox uberspect. * @param theUberspect the JexlUberspect to sandbox * @param theSandbox the sandbox which is copied to avoid changes at runtime public SandboxUberspect(JexlUberspect theUberspect, JexlSandbox theSandbox) { if (theUberspect == null) { throw new NullPointerException("uberspect can not be null"); } this.uberspect = theUberspect; this.sandbox = theSandbox.copy(); return uberspect.getConstructor(className, args, info); return uberspect.getMethod(obj, actual, args, info); return uberspect.getPropertyGet(obj, actual, info); return uberspect.getPropertySet(obj, actual, arg, info); @Override public void setClassLoader(ClassLoader loader) { uberspect.setClassLoader(loader); } @Override public Iterator<?> getIterator(Object obj, JexlInfoHandle info) { return uberspect.getIterator(obj, info); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
import org.apache.hc.core5.net.NamedEndpoint; NamedEndpoint endpoint,
0
import org.apache.accumulo.server.ServerContext; this(ServerContext.getInstance().getZooKeeperRoot());
0
* @deprecated Class now available as MultiValueMap in map subpackage. * This version is due to be removed in collections v4.0. *
0
import static com.google.common.base.Preconditions.checkState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; private static final Logger LOG = LoggerFactory.getLogger(TransformEvaluatorRegistry.class); private final AtomicBoolean finished = new AtomicBoolean(false); checkState( !finished.get(), "Tried to get an evaluator for a finished TransformEvaluatorRegistry"); @Override public void cleanup() throws Exception { Collection<Exception> thrownInCleanup = new ArrayList<>(); for (TransformEvaluatorFactory factory : factories.values()) { try { factory.cleanup(); } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); } thrownInCleanup.add(e); } } finished.set(true); if (!thrownInCleanup.isEmpty()) { LOG.error("Exceptions {} thrown while cleaning up evaluators", thrownInCleanup); Exception toThrow = null; for (Exception e : thrownInCleanup) { if (toThrow == null) { toThrow = e; } else { toThrow.addSuppressed(e); } } throw toThrow; } }
0
/* * Copyright 2000-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.bcel.generic;
0
* Copyright 2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
/** * WTP 1.5 changes in wtpmodules. * @throws Exception any exception thrown during test */ public void testProject20() throws Exception { testProject( "project-20" ); }
0
private static final Pattern FILE_SCHEME_PATTERN = Pattern.compile("(?<scheme>[a-zA-Z][-a-zA-Z0-9+.]*):.*"); Matcher matcher = FILE_SCHEME_PATTERN.matcher(spec);
0
* * * /** * A Script <b>must</b> be thread safe so care should be taken on the * @version $Revision: 1.12 $
1
Document doc = XMLUtils.newDocument();
0
* Represents a callback(ServiceReference, Service, ServiceReference, Service) that is invoked on a Component implementation class. * The type of the class on which the callback is invoked on is represented by the T generic parameter. public interface CbRefServiceRefService<T, S> extends SerializableLambda { * Handles the given arguments. * @param instance the Component implementation instance on which the callback is invoked on. * @param oldRef first callback param * @param old second callback param * @param replaceRef third callback param * @param replace fourth callback param void accept(T instance, ServiceReference<S> oldRef, S old, ServiceReference<S> replaceRef, S replace); default CbRefServiceRefService<T, S> andThen(CbRefServiceRefService<? super T, S> after) { return (T instance, ServiceReference<S> oldRef, S old, ServiceReference<S> replaceRef, S replace) -> { accept(instance, oldRef, old, replaceRef, replace); after.accept(instance, oldRef, old, replaceRef, replace);
0
/** The Log to which logging calls will be made. */ private static Log log = LogFactory.getLog(JellyContext.class);
0
import cz.seznam.euphoria.guava.shaded.com.google.common.collect.Sets; return new TimeSliding<>(duration.toMillis(), step.toMillis()); long slide) { public Set<TimeInterval> assignWindowsToElement(WindowedElement<?, T> el) { Set<TimeInterval> ret = Sets.newHashSetWithExpectedSize((int) (this.duration / this.slide)); for (long start = el.timestamp - el.timestamp % this.slide; start > el.timestamp - this.duration;
0
* @since 3.0 * @version $Id$
0
this.open = false; Socket sock = this.socket; doFlush(); try { sock.shutdownOutput(); } catch (IOException ignore) { } try { sock.shutdownInput(); } catch (IOException ignore) { } } catch (UnsupportedOperationException ignore) { // if one isn't supported, the other one isn't either } finally { sock.close();
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
* @version $Revision$
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
public boolean isRepeatable() { return false; } @Override
0
import com.google.cloud.dataflow.sdk.options.PipelineOptions; PipelineOptions options = PipelineOptionsFactory.create(); options, cloudSource, BatchModeExecutionContext.fromOptions(options), null, null); TextReader<?> textReader = (TextReader<?>) reader;
0
* @version $Revision$ $Date$
0
formattedResults.apply(TextIO.write().to(options.getOutput()));
0
context.windowingInternals().setTimer(timer, timestamp, domain); context.windowingInternals().deleteTimer(timer, domain); return Instant.now();
0
Class classForName( String className, Map<String, Object> context )
0
import org.apache.cocoon.objectmodel.ObjectModel; protected static void characters(ObjectModel objectModel, ExecutionContext executionContext, TextEvent event, CharHandler handler) Object val = expr.getValue(objectModel);
0
* Return length data stored in the buffer * * @return data length */ int length(); /** * Returns total capacity of the buffer * * @return total capacity */ int capacity(); /** * Returns available space in the buffer. * * @return available space. */ int available(); /**
0
Copyright 1999-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.
0
* A {@link Coder} for {@link CountSum}. /** An accumulator that observes its merges and outputs. */
0
import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
0
public FileSystem getImplementation() { return impl; }
0
import com.google.gson.Gson; import java.net.URLEncoder; import java.util.HashMap; import java.util.Map; String ajaxRequestHeader = request.getHeader("X-Requested-With"); if (isWebUserAgent(request.getHeader("User-Agent")) && !"XMLHttpRequest".equals(ajaxRequestHeader)) { response.sendRedirect(request.getRequestURL().toString() + getOriginalQueryString(request)); } // chain.doFilter(request, response); TODO: check String ajaxRequestHeader = request.getHeader("X-Requested-With"); if (!isWebUserAgent(request.getHeader("User-Agent")) || "XMLHttpRequest".equals(ajaxRequestHeader)) { Map<String, String> mapObj = new HashMap<>(); mapObj.put("knoxssoredirectURL", URLEncoder.encode(loginUrl, "UTF-8")); response.setContentType("application/json"); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.sendError(HttpServletResponse.SC_UNAUTHORIZED, new Gson().toJson(mapObj)); } else { response.sendRedirect(loginUrl); } private boolean isWebUserAgent(String userAgent) { boolean isWeb = false; List<String> userAgentList = getUserAgentList(); if (userAgentList != null && userAgentList.size() > 0) { for (String ua : userAgentList) { if (StringUtils.startsWithIgnoreCase(userAgent, ua)) { isWeb = true; break; } } } return isWeb; } protected abstract List<String> getUserAgentList();
0
import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.annotations.Experimental.Kind; @Experimental(Kind.FILESYSTEM) @Experimental(Kind.FILESYSTEM)
0
public static final String NAME = "publickey"; return NAME; buf.putString(UserAuthPublicKeyFactory.NAME);
0
package org.apache.accumulo.cloudtrace.instrument.impl; import org.apache.accumulo.cloudtrace.instrument.Span; import org.apache.accumulo.cloudtrace.instrument.Tracer; }
0
package org.apache.beam.sdk.transforms; import org.apache.beam.sdk.values.PInput; import org.apache.beam.sdk.values.POutput;
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets;
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.accumulo.core.client.mapred.impl; import java.io.IOException; import java.util.Collection; import org.apache.accumulo.core.data.Range; import org.apache.hadoop.mapred.InputSplit; /** * The Class BatchInputSplit. Encapsulates Accumulo ranges for use in Map Reduce jobs. * Can contain several Ranges per InputSplit. */ public class BatchInputSplit extends org.apache.accumulo.core.client.mapreduce.impl.BatchInputSplit implements InputSplit { public BatchInputSplit() { super(); } public BatchInputSplit(BatchInputSplit split) throws IOException { super(split); } public BatchInputSplit(String table, String tableId, Collection<Range> ranges, String[] location) { super(table, tableId, ranges, location); } }
0
public void testResponseBasics() { final BasicHttpResponse response = new BasicHttpResponse(200, "OK"); Assert.assertEquals(200, response.getCode()); Assert.assertEquals("OK", response.getReasonPhrase()); } @Test public void testResponseStatusLineMutation() { final BasicHttpResponse response = new BasicHttpResponse(200, "OK"); Assert.assertEquals(200, response.getCode()); Assert.assertEquals("OK", response.getReasonPhrase()); response.setReasonPhrase("Kind of OK"); Assert.assertEquals(200, response.getCode()); Assert.assertEquals("Kind of OK", response.getReasonPhrase()); response.setCode(299); Assert.assertEquals(299, response.getCode()); Assert.assertEquals(null, response.getReasonPhrase()); } @Test public void testResponseInvalidStatusCode() { try { new BasicHttpResponse(-200, "OK"); Assert.fail("IllegalArgumentException expected"); } catch (final IllegalArgumentException expected) { } final BasicHttpResponse response = new BasicHttpResponse(200, "OK"); try { response.setCode(-1); Assert.fail("IllegalArgumentException expected"); } catch (final IllegalArgumentException expected) { } } @Test
0
Process ingest = cluster.exec(TestIngest.class, "-u", "root", "-p", ROOT_PASSWORD, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "--rows", "" + OPTS.rows); Process ingest = cluster.exec(TestIngest.class, "-u", "root", "-p", ROOT_PASSWORD, "-i", cluster.getInstanceName(), "-z", cluster.getZooKeepers(), "--rows", "" + VOPTS.rows); @Test(timeout = 10 * 60 * 1000)
0