Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
.setGoogleClientRequestInitializer(options.getGoogleApiTrace()); .setGoogleClientRequestInitializer(options.getGoogleApiTrace()); .setGoogleClientRequestInitializer(options.getGoogleApiTrace()); .setGoogleClientRequestInitializer(options.getGoogleApiTrace()); .setGoogleClientRequestInitializer(options.getGoogleApiTrace());
0
bws = new HashMap<>();
1
@DefaultAnnotation(NonNull.class) import edu.umd.cs.findbugs.annotations.DefaultAnnotation; import edu.umd.cs.findbugs.annotations.NonNull;
0
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
} else if (blankAsPlus && b == ' ') { buf.append('+'); buf.append("%"); char hex1 = Character.toUpperCase(Character.forDigit((b >> 4) & 0xF, RADIX)); char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF, RADIX)); buf.append(hex1); buf.append(hex2);
0
private static final Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder() private static final Set<String> propertyIds = Sets.newHashSet(
0
if (FileObjectUtils.exists(destFile) && destFile.getType() != srcFile.getType()) {
0
public interface ServiceComponentHost { * Get the Host this object maps to * @return Host's hostname public String getHostName(); * ServiceComponentHost level * Get ServiceComponent-Host State * @return ServiceComponentHostState public ServiceComponentHostState getState(); * Set the State for this ServiceComponent-Host * @param state ServiceComponentHostState to set to public void setState(ServiceComponentHostState state); * Send a ServiceComponentHostState event to the StateMachine public void handleEvent(ServiceComponentHostEvent event)
0
import org.apache.beam.sdk.values.PBegin; public static class Unbound<K, V> extends PTransform<PBegin, PCollection<KV<K, V>>> { public PCollection<KV<K, V>> apply(PBegin input) {
0
SimpleTimer.getInstance(serverConfig.getConfiguration()).schedule(new Runnable() { SimpleTimer.getInstance(serverConfig.getConfiguration()).schedule(new Runnable() {
1
@Property(name = "adapter", value = "true") @AdapterService(adapteeService = S1.class) @AdapterService(adapteeService = S1.class, field = "m_s1") @Property(name = "adapter", value = "true") @AdapterService(adapteeService = S1.class, added = "bind", removed = "removed") @Property(name = "adapter", value = "true") @Component @Property(name = "param1", value = "value1")
0
"the protected property 'service.id'.", current.getSource() );
0
new Thread(() -> { try { client.set(zkClient.get()); } catch (ZooKeeperConnectionException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { blockingGetComplete.countDown(); Thread getThread = new Thread(() -> { try { client.set(zkClient.get()); } catch (ZooKeeperConnectionException e) { throw new RuntimeException(e); } catch (InterruptedException e) { interrupted.set(true); throw new RuntimeException(e); } finally { blockingGetComplete.countDown();
0
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Collections; import java.util.List; import org.apache.beam.sdk.coders.ByteArrayCoder; import org.apache.beam.sdk.coders.StructuredCoder; /** The Coder for the Runner's encoded representation of a key. */ static class ByteBufferCoder extends StructuredCoder<ByteBuffer> { public static ByteBufferCoder of() { return INSTANCE; } private static final ByteBufferCoder INSTANCE = new ByteBufferCoder(); private ByteBufferCoder() {} @Override public void encode(ByteBuffer value, OutputStream outStream) throws IOException { @SuppressWarnings("ByteBufferBackingArray") byte[] array = value.array(); ByteArrayCoder.of().encode(array, outStream); } @Override public ByteBuffer decode(InputStream inStream) throws IOException { byte[] decode = ByteArrayCoder.of().decode(inStream); return ByteBuffer.wrap(decode); } @Override public List<? extends Coder<?>> getCoderArguments() { return Collections.emptyList(); } @Override public void verifyDeterministic() {} }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/parser/XMLParser.java,v 1.47 2003/10/09 21:21:29 rdonkin Exp $ * $Revision: 1.47 $ * $Date: 2003/10/09 21:21:29 $ * 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. * $Id: XMLParser.java,v 1.47 2003/10/09 21:21:29 rdonkin Exp $ * @version $Revision: 1.47 $
0
private UpgradeCheckStatus status = UpgradeCheckStatus.PASS;
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. */ public static String join(Collection<String> strings, String sep) { for (String s : strings) {
0
m.put(p.getFirst(), p.getSecond());
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.logsearch.config.api.model.inputconfig; public interface FilterJsonDescriptor extends FilterDescriptor { }
0
* Copyright 2005-2011 The Apache Software Foundation. public ApacheOctetStreamData(XMLSignatureInput xi) throws CanonicalizationException, IOException {
0
* * * * @version CVS $Id$ public abstract class AbstractXMLPipe extends AbstractXMLProducer implements XMLPipe {
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
* * * * * * * * * * * * * * *
0
import org.apache.felix.webconsole.json.JSONWriter; if ( null != bipReg ) { bipReg.unregister(); bipReg = null; } throws IOException private void keyVal( JSONWriter jw, String key, Object val) throws IOException { if ( val != null ) { jw.object(); jw.key("key").value(key); jw.key("value").value(val); jw.endObject(); } } private void serviceDetails( JSONWriter jw, ServiceReference service ) throws IOException keyVal(jw, "Service PID", service.getProperty( key )); keyVal(jw, "Service Description", service.getProperty( key )); keyVal(jw, "Service Vendor", service.getProperty( key )); keyVal(jw, key, service.getProperty( key )); private void usingBundles( JSONWriter jw, ServiceReference service, Locale locale ) throws IOException private void serviceInfo( JSONWriter jw, ServiceReference service, boolean details, final Locale locale ) throws IOException private void bundleInfo( final JSONWriter jw, final Bundle bundle, final Locale locale ) throws IOException throws IOException { service } : allServices; final JSONWriter jw = new JSONWriter( pw ); jw.object(); jw.key( "status" ); jw.value( statusLine ); jw.key( "serviceCount" ); jw.value( allServices.length ); jw.key( "data" ); jw.array(); for ( int i = 0; i < services.length; i++ ) { serviceInfo( jw, services[i], fullDetails || service != null, locale ); } jw.endArray(); jw.endObject(); IOException
0
import org.apache.batik.gvt.renderer.RendererFactory; RendererFactory rendererFactory = new StaticRendererFactory(); ctx.setGraphicsNodeRenderContext(rendererFactory.getRenderContext()); Renderer renderer = rendererFactory.createRenderer(img);
0
/* * $Header: /cvshome/build/ee.foundation/src/java/io/CharConversionException.java,v 1.6 2006/03/14 01:20:23 hargrave Exp $ * * (C) Copyright 2001 Sun Microsystems, Inc. * Copyright (c) OSGi Alliance (2001, 2005). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package java.io; public class CharConversionException extends java.io.IOException { public CharConversionException() { } public CharConversionException(java.lang.String var0) { } }
0
* 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.5 $ $Date: 2003/10/13 08:42:27 $
0
@Parameter(names = "--old", description = "old zookeeper password", password = true, hidden = true) @Parameter(names = "--new", description = "new zookeeper password", password = true, hidden = true)
0
protected List<GlobalRequestHandler> globalRequestHandlers; public List<GlobalRequestHandler> getGlobalRequestHandlers() { return globalRequestHandlers; } public void setGlobalRequestHandlers(List<GlobalRequestHandler> globalRequestHandlers) { this.globalRequestHandlers = globalRequestHandlers; }
0
/** * Do not do anything in the follower. */ @Override public void addCommittedProposal(Request r) { //do nothing }
0
import org.apache.hc.client5.http.entity.EntityBuilder; final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("GZip").build(); final HttpEntity original = EntityBuilder.create().setText("").setContentEncoding("GZip").build(); final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("x-gzip").build(); final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("deFlaTe").build(); final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("identity").build(); final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("whatever").build(); final HttpEntity original = EntityBuilder.create().setText("encoded stuff").setContentEncoding("GZip").build();
0
import org.apache.felix.gogo.commands.Command; @Command(scope = "obr", name = "info", description = "Print informations about OBR bundles")
0
* Copyright 1999-2005 The Apache Software Foundation. import org.apache.cocoon.sitemap.ComponentLocator; /** Optional application container */ protected ComponentLocator applicationContainer; /** Optional event listeners for the enter sitemap event */ protected List enterSitemapEventListeners = new ArrayList(); /** Optional event listeners for the leave sitemap event */ protected List leaveSitemapEventListeners = new ArrayList(); * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getComponentLocator() */ public ComponentLocator getComponentLocator() { // Useless method as it's redefined in SitemapLanguage return this.applicationContainer; } /** * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getEnterSitemapEventListeners() */ public List getEnterSitemapEventListeners() { // we make a copy here, so we can clear(recylce) the list after the // sitemap is build return (List)((ArrayList)this.enterSitemapEventListeners).clone(); } /** * @see org.apache.cocoon.components.treeprocessor.TreeBuilder#getLeaveSitemapEventListeners() */ public List getLeaveSitemapEventListeners() { // we make a copy here, so we can clear(recylce) the list after the // sitemap is build return (List)((ArrayList)this.leaveSitemapEventListeners).clone(); } /** this.applicationContainer = null; this.enterSitemapEventListeners.clear(); this.leaveSitemapEventListeners.clear();
0
private static final String CONN_KEEPALIVE = "Keep-Alive"; request.addHeader(new Header(CONN_DIRECTIVE, CONN_KEEPALIVE, true));
0
: (month + (12 - monthOfFirstQuarter)); // CHECKSTYLE IGNORE MagicNumber int quarter = ((relativeMonth / 3) + 1); // CHECKSTYLE IGNORE MagicNumber return (year * 10) + quarter; // CHECKSTYLE IGNORE MagicNumber
0
import org.apache.commons.lang3.StringUtils; final String userName = getUserName(propertyMap); final String userName = getUserName(propertyMap); private String getUserName(Map<String, Object> propertyMap) { String userName = propertyMap.get(WIDGETLAYOUT_USERNAME_PROPERTY_ID) == null ? "" : propertyMap.get(WIDGETLAYOUT_USERNAME_PROPERTY_ID).toString(); if (StringUtils.isBlank(userName)) { userName = AuthorizationHelper.getAuthenticatedName(); } return userName; }
0
// interoperability tests using test vectors from other implementations suite.addTest(org.apache.xml.security.test.interop.IBMTest.suite());
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
import java.util.concurrent.TimeUnit; import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly; sleepUninterruptibly(1, TimeUnit.SECONDS);
1
package org.apache.felix.karaf.shell.console.completer; import org.apache.felix.karaf.shell.console.Completer;
0
* * * * *
0
private static final Logger LOG = LoggerFactory.getLogger(RetryHelper.class);
0
* @version $Revision$
0
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
0
log.error("Problem getting real goal state from zookeeper: " + e); break; break; break; }catch(Throwable t) { log.error("Error occurred reading / switching master goal state. Will continue with attempt to update status", t); } try { log.error("Error balancing tablets, will wait for " + WAIT_BETWEEN_ERRORS / ONE_SECOND + " (seconds) and then retry", t);
0
/** Test operator Distinct. */ Dataset<String> uniq = Distinct.named("Distinct1") .of(dataset) .windowBy(windowing) .triggeredBy(trigger) .accumulationMode(AccumulationMode.DISCARDING_FIRED_PANES) .output(); Dataset<String> uniq = Distinct.of(dataset) .windowBy(FixedWindows.of(org.joda.time.Duration.standardHours(1))) .triggeredBy(DefaultTrigger.of()) .accumulationMode(AccumulationMode.DISCARDING_FIRED_PANES) .output(); assertEquals( FixedWindows.of(org.joda.time.Duration.standardHours(1)), windowingDesc.getWindowFn()); Distinct.of(dataset) .applyIf( true, b -> b.windowBy(FixedWindows.of(Duration.standardHours(1))) .triggeredBy(DefaultTrigger.of()) .discardingFiredPanes()) assertEquals( FixedWindows.of(org.joda.time.Duration.standardHours(1)), windowingDesc.getWindowFn());
0
* @version $Revision$ $Date$
0
try (AccumuloClient client = getAccumuloClient()) { // Eliminate whole tablets for (int test = 0; test < 10; test++) { // create a table log.info("Test {}", test); client.tableOperations().create(tableName); // put some data in it fillTable(client, tableName); // generate a random delete range final Text start = new Text(); final Text end = new Text(); generateRandomRange(start, end); // initiate the delete range final boolean fail[] = {false}; Thread t = new Thread() { @Override public void run() { try { // split the table final SortedSet<Text> afterEnd = SPLITS.tailSet(new Text(end + "\0")); client.tableOperations().addSplits(tableName, afterEnd); } catch (Exception ex) { log.error("Exception", ex); synchronized (fail) { fail[0] = true; } }; t.start(); sleepUninterruptibly(test * 2, TimeUnit.MILLISECONDS); client.tableOperations().deleteRows(tableName, start, end); t.join(); synchronized (fail) { assertTrue(!fail[0]); // scan the table try (Scanner scanner = client.createScanner(tableName, Authorizations.EMPTY)) { for (Entry<Key,Value> entry : scanner) { Text row = entry.getKey().getRow(); assertTrue(row.compareTo(start) <= 0 || row.compareTo(end) > 0); } // delete the table client.tableOperations().delete(tableName); }
0
client = MasterClient.getConnectionWithRetry(HdfsZooInstance.getInstance());
0
public final HttpClientBuilder setMaxConnTotal(final int maxConnTotal) { public final HttpClientBuilder setMaxConnPerRoute(final int maxConnPerRoute) {
0
@Deprecated
0
public class TransformedBuffer<E> extends TransformedCollection<E> implements Buffer<E> { public static <E> Buffer<E> decorate(Buffer<E> buffer, Transformer<? super E, ? extends E> transformer) { return new TransformedBuffer<E>(buffer, transformer); // TODO: Generics decorated.decorated().add(transformer.transform(values[i])); protected TransformedBuffer(Buffer<E> buffer, Transformer<? super E, ? extends E> transformer) { protected Buffer<E> getBuffer() { return (Buffer<E>) collection; public E get() { public E remove() {
0
public static final String PROPERTY_VALUE_ATTRIBUTES_PROPERTY_ID = PropertyHelper .getPropertyId("StackConfigurations", "property_value_attributes"); public static final String PROPERTY_DEPENDS_ON_PROPERTY_ID = PropertyHelper .getPropertyId("StackConfigurations", "property_depends_on"); public static final String PROPERTY_DEPENDED_BY_PROPERTY_ID = PropertyHelper .getPropertyId("StackConfigurations", "property_depended_by"); setResourceProperty(resource, PROPERTY_VALUE_ATTRIBUTES_PROPERTY_ID, response.getPropertyValueAttributes(), requestedIds); setResourceProperty(resource, PROPERTY_DEPENDS_ON_PROPERTY_ID, response.getDependsOnProperties(), requestedIds); setResourceProperty(resource, PROPERTY_DEPENDED_BY_PROPERTY_ID, response.getDependedByProperties(), requestedIds);
0
import org.apache.excalibur.source.impl.validity.AbstractAggregatedValidity; * @version $Id: EventAwareCacheImpl.java,v 1.7 2003/10/28 13:39:36 unico Exp $ if (val instanceof AbstractAggregatedValidity) { handleAggregatedValidity((AbstractAggregatedValidity)val, key); AbstractAggregatedValidity val,
0
import org.apache.accumulo.core.rpc.SaslConnectionParams.SaslMechanism; public static final ThreadLocal<SaslMechanism> rpcMechanism = new ThreadLocal<SaslMechanism>(); public static ThreadLocal<String> getRpcPrincipalThreadLocal() { return rpcPrincipal; } public static SaslMechanism rpcMechanism() { return rpcMechanism.get(); } SaslMechanism mechanism; try { mechanism = SaslMechanism.get(saslServer.getMechanismName()); } catch (Exception e) { log.error("Failed to process RPC with SASL mechanism {}", saslServer.getMechanismName()); throw e; } switch (mechanism) { case GSSAPI: UserGroupInformation clientUgi = UserGroupInformation.createProxyUser(endUser, loginUser); final String remoteUser = clientUgi.getUserName(); try { // Set the principal in the ThreadLocal for access to get authorizations rpcPrincipal.set(remoteUser); return wrapped.process(inProt, outProt); } finally { // Unset the principal after we're done using it just to be sure that it's not incorrectly // used in the same thread down the line. rpcPrincipal.set(null); } case DIGEST_MD5: // The CallbackHandler, after deserializing the TokenIdentifier in the name, has already updated // the rpcPrincipal for us. We don't need to do it again here. try { rpcMechanism.set(mechanism); return wrapped.process(inProt, outProt); } finally { // Unset the mechanism after we're done using it just to be sure that it's not incorrectly // used in the same thread down the line. rpcMechanism.set(null); } default: throw new IllegalArgumentException("Cannot process SASL mechanism " + mechanism);
1
/** Optional output type descriptor. */ @Nullable protected final transient TypeDescriptor<OutputT> outputType;
0
import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.getCurrentArguments; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.context.SecurityContextHolder; Authentication auth = new UsernamePasswordAuthenticationToken("admin",null); SecurityContextHolder.getContext().setAuthentication(auth); response.setHeader("User", "admin"); expectLastCall().andAnswer(new IAnswer() { public Object answer() { String arg1 = (String) getCurrentArguments()[0]; String arg2 = (String) getCurrentArguments()[1]; Assert.assertEquals("User", arg1); Assert.assertEquals("admin", arg2); return null; } }); privilegeEntity, permission, filterConfig);
0
* limitations under the License.
0
import org.apache.felix.scr.impl.manager.AbstractComponentManager; import org.osgi.framework.BundleContext; private BundleContext m_context; m_context = ( BundleContext ) EasyMock.createNiceMock( BundleContext.class ); EasyMock.expect( m_context.getService( m_serviceReference ) ).andReturn( m_serviceInstance ) .anyTimes(); { m_serviceReference, m_context } ); AbstractComponentManager.RefPair refPair = bm.getServiceObject( m_serviceReference, m_context ); bm.invoke( component, refPair, null );
0
MethodUtils.invokeMethod(parent, "getName", null); MethodUtils.invokeMethod(parent, "getName", null, null); MethodUtils.invokeExactMethod(parent, "getName", null); MethodUtils.invokeExactMethod(parent, "getName", null, null);
0
* * * public void doTag(XMLOutput output) throws JellyTagException { Document actualDocument = parseBody(); AssertDocumentsEqualTag assertTag = (AssertDocumentsEqualTag) findAncestorWithClass(AssertDocumentsEqualTag .class); assertTag.setActual(actualDocument); } protected SAXReader createSAXReader() { return new SAXReader(); }
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
protected long getEncodedElementByteSize(ByteString value) throws Exception { public boolean isRegisterByteSizeObserverCheap(ByteString value) {
0
import java.util.Objects; static final class Result<DestinationT> implements Serializable { @Override public boolean equals(Object other) { if (other instanceof Result) { Result<DestinationT> o = (Result<DestinationT>) other; return Objects.equals(this.filename, o.filename) && Objects.equals(this.fileByteSize, o.fileByteSize) && Objects.equals(this.destination, o.destination); } return false; } @Override public int hashCode() { return Objects.hash(filename, fileByteSize, destination); } @Override public String toString() { return "Result{" + "filename='" + filename + '\'' + ", fileByteSize=" + fileByteSize + ", destination=" + destination + '}'; }
0
import org.apache.beam.sdk.transforms.windowing.BoundedWindow; import org.apache.beam.sdk.util.TimeDomain; import org.joda.time.Instant; * Calls a {@link DoFn DoFn's} {@link DoFn.OnTimer @OnTimer} method for the given timer * in the given window. */ void onTimer(String timerId, BoundedWindow window, Instant timestamp, TimeDomain timeDomain); /**
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/plugins/TestInline.java,v 1.2 2003/10/05 15:30:03 rdonkin Exp $ * $Revision: 1.2 $ * $Date: 2003/10/05 15:30:03 $ * ==================================================================== * * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * notice, this list of conditions and the following disclaimer. * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgement: * "This product includes software developed by the * 4. The names "Apache", "The Jakarta Project", "Commons", and "Apache Software * from this software without prior written permission. For written * 5. Products derived from this software may not be called "Apache", * "Apache" nor may "Apache" appear in their names without prior * written permission of the Apache Software Foundation. */
0
import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentMap;
0
securityContext, encryptedKeyType.getId(), null) {
0
@Override @Override @Override @Override @Override
0
private static final ViewRegistry singleton = createMock(ViewRegistry.class); ViewRegistry.initInstance(singleton); reset(singleton); expect(singleton.checkAdmin()).andReturn(true); expect(singleton.checkAdmin()).andReturn(false); replay(singleton, viewEntity, viewInstanceEntity); verify(singleton, viewEntity, viewInstanceEntity); expect(singleton.instanceExists(viewInstanceEntity)).andReturn(false); expect(singleton.instanceExists(viewInstanceEntity2)).andReturn(false); expect(singleton.getDefinition("V1", "1.0.0")).andReturn(viewEntity).anyTimes(); expect(singleton.getDefinition("V1", null)).andReturn(viewEntity).anyTimes(); singleton.setViewInstanceProperties(eq(viewInstanceEntity), capture(captureProperties), singleton.installViewInstance(capture(instanceEntityCapture)); expect(singleton.checkAdmin()).andReturn(true); expect(singleton.checkAdmin()).andReturn(false); replay(singleton); verify(singleton); expect(singleton.instanceExists(viewInstanceEntity)).andReturn(true); expect(singleton.getDefinition("V1", "1.0.0")).andReturn(viewEntity).anyTimes(); expect(singleton.getDefinition("V1", null)).andReturn(viewEntity); expect(singleton.checkAdmin()).andReturn(true); replay(singleton); verify(singleton); expect(singleton.getDefinition("V1", "1.0.0")).andReturn(viewEntity).anyTimes(); expect(singleton.getDefinition("V1", null)).andReturn(viewEntity); expect(singleton.checkAdmin()).andReturn(true); replay(singleton); verify(singleton); expect(singleton.getDefinitions()).andReturn(Collections.singleton(viewEntity)); replay(singleton); verify(singleton); expect(singleton.getDefinitions()).andReturn(Collections.singleton(viewEntity)); replay(singleton); verify(singleton);
0
boolean expectContinue();
0
* Tests a {@link FileSystemException} containing info with a URL containing a complete basic authentication. final FileSystemException fse = new FileSystemException("vfs.provider/rename.error", "file://test.bin", "http://foo:bar@junit.org/test.bin"); * Tests a {@link FileSystemException} containing info with a URL containing only the user information. final FileSystemException fse = new FileSystemException("vfs.provider/delete.error", "http://foo@junit.org/test.bin"); * Tests a {@link FileSystemException} containing info with a nested URL containing a complete basic authentication. final FileSystemException fse = new FileSystemException("vfs.provider/delete.error", "zip:http://foo:bar@junit.org/test.bin");
1
base64 = new Base64(-1, new byte[]{'A'}); // TODO do we need to check sep if len = -1?
0
* ZLib delayed compression. * * @see Compression#isDelayed() /** * Named factory for the ZLib Delayed Compression. */ /** * Create a new instance of a delayed ZLib compression */ public CompressionDelayedZlib() { }
0
import org.apache.beam.sdk.coders.StringUtf8Coder; // we know that it is keyed on String Coder<?> keyCoder = StringUtf8Coder.of(); StateInternalsFactory<String> stateInternalsFactory = (StateInternalsFactory<String>) this.currentKeyStateInternals.getFactory(); TimerInternalsFactory<String> timerInternalsFactory = key -> currentKeyTimerInternals;
0
return bo.getBytes() != 0;
0
package org.apache.beam.runners.direct.portable; import org.apache.beam.runners.direct.DirectGraphs; import org.apache.beam.runners.direct.ExecutableGraph; /** Tests for {@link WatermarkCallbackExecutor}. */ @Rule public TestPipeline p = TestPipeline.create().enableAbandonedNodeEnforcement(false); ExecutableGraph<AppliedPTransform<?, ?, ?>, ? super PCollection<?>> graph = DirectGraphs.getGraph(p);
0
JwtAuthenticationProperties jwtProperties = propertiesProvider.get(); JwtAuthenticationProperties jwtProperties = propertiesProvider.get(); JwtAuthenticationProperties jwtProperties = propertiesProvider.get(); JwtAuthenticationProperties jwtProperties = propertiesProvider.get(); JwtAuthenticationProperties jwtProperties = propertiesProvider.get();
0
/* Later - when we allow search limitation by "type". ArrayList<String> typesList = new ArrayList<String>(); for (String s: types.split(",")) { // Types validity check. if (typesList.contains(s)) { LOG.error("Specifyed type is not a member of the Type System= {}", s); throw new WebApplicationException( Servlets.getErrorResponse("Invalid type specified in query.", Response.Status.INTERNAL_SERVER_ERROR)); } typesList.add(s); }*/
0
/* * Copyright 2013 Twitter, Inc. * * 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
* 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. */ * An interface for anything that returns the time in the same format as System.currentTimeMillis(). *
0
try (AccumuloClient client = createAccumuloClient()) { try (AccumuloClient client = createAccumuloClient()) { try (AccumuloClient client = createAccumuloClient()) {
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
* @since 3.0
0
public AbstractFileName(final String scheme, final String absPath, FileType type) * @param buffer A StringBuilder to use to construct the URI. protected abstract void appendRootUri(StringBuilder buffer, boolean addPassword); final StringBuilder buffer = new StringBuilder(); final StringBuilder buffer = new StringBuilder(); final StringBuilder buffer = new StringBuilder();
0
for (HttpHost element : this.proxyChain) { hash = LangUtils.hashCode(hash, element);
0
@Override
0
protected Request createControllerRequest(Set<Map<String, Object>> setProperties) {
1
@Value("${logsearch.solr.config_set.folder:/usr/lib/ambari-logsearch-portal/conf/solr_configsets}") examples = {"/usr/lib/ambari-logsearch-portal/conf/solr_configsets"}, defaultValue = "/usr/lib/ambari-logsearch-portal/conf/solr_configsets",
0
import org.apache.accumulo.core.iterators.user.SummingCombiner; t.append(SummingCombiner.FIXED_LEN_ENCODER.encode(s), 0, 8);
0
static org.slf4j.Logger log = (ResourceResolverTest.class);
1
import com.fasterxml.jackson.core.type.TypeReference; Map<String, Object> probingOptionsMap = MAPPER.readValue(optionsJson, new TypeReference<Map<String, Object>>() {}); if (probingOptionsMap.containsKey("options")) { //Legacy options. return MAPPER.readValue(optionsJson, PipelineOptions.class); } else { // Fn Options with namespace and version. Struct.Builder builder = Struct.newBuilder(); JsonFormat.parser().merge(optionsJson, builder); return fromProto(builder.build()); }
0
boolean bb = ve.evaluate(new ColumnVisibility(testVis.toArray()));
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 category; /** * Category of unit tests that can be annotated. E.g., * {@code @Category({ category.StackUpgradeTest.class}) } * * A Profile can have csv of categories, in order to run the unit tests like, * mvn clean test -P StackUpgradeTests */ public interface StackUpgradeTest {}
0
suite.addTest(new TestSuite(FileWriterWithEncodingTest.class));
0
super(org.apache.commons.bcel6.Const.JSR, target); if (super.getOpcode() == org.apache.commons.bcel6.Const.JSR) { super.setOpcode(org.apache.commons.bcel6.Const.JSR_W);
0
@Test(dependsOnMethods = "testSubmitEntity", expectedExceptions = IllegalArgumentException.class) public void testAddNullProperty() throws Exception { final String guid = tableId._getId(); //add property addProperty(guid, null, "foo bar"); Assert.fail(); } @Test(dependsOnMethods = "testSubmitEntity", expectedExceptions = IllegalArgumentException.class) public void testAddNullPropertyValue() throws Exception { final String guid = tableId._getId(); //add property addProperty(guid, "description", null); Assert.fail(); } @Test(dependsOnMethods = "testAddTrait") public void testAddExistingTrait() throws Exception { final String traitName = "PII_Trait"; Struct traitInstance = new Struct(traitName); String traitInstanceAsJSON = InstanceSerialization.toJson(traitInstance, true); LOG.debug("traitInstanceAsJSON = " + traitInstanceAsJSON); final String guid = tableId._getId(); ClientResponse clientResponse = service .path("api/metadata/entities") .path(guid) .path(TRAITS) .accept(MediaType.APPLICATION_JSON) .type(MediaType.APPLICATION_JSON) .method(HttpMethod.POST, ClientResponse.class, traitInstanceAsJSON); Assert.assertEquals(clientResponse.getStatus(), Response.Status.BAD_REQUEST.getStatusCode()); }
0
import org.apache.http.nio.reactor.SessionRequest; public SessionRequest openConnection(final InetSocketAddress address, final Object attachment) { return this.ioReactor.connect(address, null, attachment, null);
0
import static org.junit.Assert.assertTrue; import java.io.UnsupportedEncodingException; import java.util.Arrays; import org.junit.Test; public class Base64Codec13Test { @Test @Test @Test @Test @Test @Test @Test @Test
1
/* * Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Revision: 1.17 $ $Date: 2004/02/18 01:15:42 $
0