Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
super(org.apache.commons.bcel6.Const.BALOAD);
0
import java.io.IOException; import java.io.OutputStream; import java.security.Key; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import javax.xml.stream.XMLStreamException; import org.apache.xml.security.stax.ext.AbstractBufferingOutputProcessor; import org.apache.xml.security.stax.ext.AbstractOutputProcessor; import org.apache.xml.security.stax.ext.OutputProcessorChain; import org.apache.xml.security.stax.ext.Transformer; import org.apache.xml.security.stax.ext.XMLSecurityConstants; import org.apache.xml.security.stax.ext.XMLSecurityUtils; import org.apache.xml.security.stax.securityToken.OutboundSecurityToken; import org.apache.xml.security.stax.securityToken.SecurityTokenProvider; String sigAlgorithm = getSecurityProperties().getSignatureAlgorithm(); Key key = wrappingSecurityToken.getSecretKey(sigAlgorithm); if (XMLSecurityConstants.NS_XMLDSIG_HMACSHA1.equals(sigAlgorithm)) { key = XMLSecurityUtils.prepareSecretKey(sigAlgorithm, key.getEncoded()); } signatureAlgorithm.engineInitSign(key);
0
import org.apache.atlas.model.TypeCategory;
0
try (java.util.Scanner it = new java.util.Scanner(file, UTF_8)) { try (java.util.Scanner it = new java.util.Scanner(distCpTxt, UTF_8)) {
0
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient; public abstract class AbstractHttpAsyncRedirectsTest <T extends CloseableHttpAsyncClient> extends AbstractIntegrationTestBase<T> { public AbstractHttpAsyncRedirectsTest(final URIScheme scheme) { public BasicRedirectService(final int statuscode) { return new BasicRedirectService(HttpStatus.SC_MULTIPLE_CHOICES); public void testBasicRedirect301() throws Exception { return new BasicRedirectService(HttpStatus.SC_MOVED_PERMANENTLY);
0
import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; private final String enabled; this.enabled = this.getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER); } @Override public boolean isValid() { return super.isValid() && "true".equalsIgnoreCase(this.enabled);
0
Trigger<W> trigger, return new TriggerTester<VI, VO, W>(objectWindowFn, trigger, windowSetFactory); Trigger<W> trigger, this.windowFn = windowFn; this.stubContexts = new StubContexts();
0
import java.util.Collections; import org.apache.avalon.framework.logger.AbstractLogEnabled; * @version CVS $Id: XMLResourceBundleFactory.java,v 1.15 2004/07/13 16:00:12 sylvain Exp $ public class XMLResourceBundleFactory implements BundleFactory, Serviceable, Configurable, Disposable, ThreadSafe, LogEnabled { protected Map cache = Collections.synchronizedMap(new HashMap()); Iterator i = this.cache.values().iterator(); public void release(Bundle bundle) { bundle = (XMLResourceBundle)cache.get(fileName); if (bundle != null) { } else { this.cache.put(fileName, bundle);
0
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository; mavenBundle().groupId("org.ow2.chameleon").artifactId("transaction-geronimo").version(asInProject()), ), repository("http://maven.ow2.org/maven2-snapshot/"), osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000); osgi.waitForService(TransactionManager.class.getName(), null, 5000);
0
import org.apache.beam.sdk.extensions.sql.impl.udf.BeamBuiltinFunctionProvider; private void registerBuiltinUdf(Map<String, List<Method>> methods) { public void loadBeamBuiltinFunctions() { for (BeamBuiltinFunctionProvider provider : ServiceLoader.load(BeamBuiltinFunctionProvider.class)) { registerBuiltinUdf(provider.getBuiltinMethods()); } }
0
public class Window extends AbstractLoggingBean implements java.nio.channels.Channel, ChannelHolder { init(resolver.getLongProperty(FactoryManager.WINDOW_SIZE, FactoryManager.DEFAULT_WINDOW_SIZE), resolver.getLongProperty(FactoryManager.MAX_PACKET_SIZE, FactoryManager.DEFAULT_MAX_PACKET_SIZE), resolver); public void init(long size, long packetSize, PropertyResolver resolver) { long limitPacketSize = resolver.getLongProperty(FactoryManager.LIMIT_PACKET_SIZE, FactoryManager.DEFAULT_LIMIT_PACKET_SIZE);
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
// Skip INSTALL task in case SysPrepped hosts and in case of server components. In case of server component // START task should run configuration script. if (Boolean.parseBoolean(configs.areHostsSysPrepped()) && "INITIAL_INSTALL".equals(requestProperties.get("phase")) && newState == State.INSTALLED && !isClientComponent(cluster, scHost)) { LOG.info("Skipping create of INSTALL task for {} on {} because host is sysprepped.", scHost .getServiceComponentName(), scHost.getHostName()); scHost.setState(State.INSTALLED); } else { createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags, roleCommand, requestParameters, event); } private boolean isClientComponent(Cluster cluster, ServiceComponentHost sch) throws AmbariException { Service service = cluster.getService(sch.getServiceName()); if (service != null) { ServiceComponent serviceComponent = service.getServiceComponent(sch.getServiceComponentName()); if (serviceComponent != null) { return serviceComponent.isClientComponent(); } } return false; }
0
* @version CVS $Id: EP_Grid.java,v 1.4 2004/01/31 08:50:39 antonio Exp $ public class EP_Grid extends BaseElementProcessor { public EP_Grid() { public boolean getValue() throws IOException { if (_value == 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */
0
BufferedImage.TYPE_INT_ARGB);
0
private final boolean isActive; public UserResponse(String name, boolean isLdapUser, boolean isActive) { this.isActive = isActive; public boolean isActive() { return isActive; }
0
if (ipSegment == null || ipSegment.length() == 0) { if (octet.length() == 0) {
0
import org.apache.commons.codec.CharEncoding;
0
BigQuerySourceBase.ExtractResult res = source.extractFiles(c.getPipelineOptions()); for (ResourceId file : res.extractedFiles) { c.output(tableSchemaTag, BigQueryHelpers.toJsonString(res.schema));
0
writeOp(new MutateWork.NoResult.Quiet() { writeOp(initializationLogic); super.writeOp(new MutateWork.NoResult<CodingException>() { public synchronized <T, E extends Exception> T writeOp(final MutateWork<T, E> work) return super.writeOp(work); return super.writeOp(new MutateWork<T, E>() { return super.writeOp(new MutateWork<T, E>() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { return writeOp(new MutateWork.Quiet<ImmutableSet<ScheduledTask>>() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() { writeOp(new MutateWork.NoResult.Quiet() {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/RequiredNameTest.java,v 1.5 2002/12/15 21:46:41 martinc Exp $ * $Revision: 1.5 $ * $Date: 2002/12/15 21:46:41 $ import org.apache.commons.logging.LogFactory; * @version $Revision: 1.5 $ $Date: 2002/12/15 21:46:41 $ private Log log = LogFactory.getLog(this.getClass());
0
/* * Servlet Specification 2.2, 6.5 Closure of Response Object: * * A number of events can indicate that the servlet has provided all of the * content to satisfy the request and that the response object can be * considered to be closed. The events are: * o The termination of the service method of the servlet. * o When the amount of content specified in the setContentLength method * of the response has been written to the response. * o The sendError method is called. * o The sendRedirect method is called. * When a response is closed, all content in the response buffer, if any remains, * must be immediately flushed to the client. * * Due to the above, out.flush() and out.close() are not necessary, and sometimes * (if sendError or sendRedirect were used) request may be already closed. */
0
/** @inheritDoc */ /** @inheritDoc */
0
super(); super(defaultValue); } /** * Return the default type this <code>Converter</code> handles. * * @return The default type this <code>Converter</code> handles. */ protected Class getDefaultType() { return Date.class;
0
import org.apache.felix.gogo.runtime.CommandProcessorImpl; import org.apache.felix.gogo.runtime.CommandSessionImpl;
0
// XXX see FELIX-1395 // The following code has been commented out as it causes // problems with require bundle dependencies // VersionRange version = versions.get( name ); // String rev = version != null ? version.toString() : info.getVersion().toString(); String rev = info.getVersion().toString();
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
private final ITaskConfig canonicalTask; this.canonicalTask = task; return Objects.hashCode(canonicalTask); return Objects.equal(canonicalTask, other.canonicalTask); return JobKeys.toPath(Tasks.INFO_TO_JOB_KEY.apply(canonicalTask));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestLinkedList.java,v 1.7 2003/11/18 22:37:15 scolebourne Exp $ * @version $Revision: 1.7 $ $Date: 2003/11/18 22:37:15 $ public List makeEmptyList() { public List makeFullList() { public Collection makeConfirmedCollection() { public Collection makeConfirmedFullCollection() {
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
if (firstPrevRowValue == null) { log.debug("tablet already merged"); return; }
0
public class TestRFC6265CookieSpec { final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1); final RFC6265CookieSpec cookiespec = new RFC6265CookieSpec(h1, h2);
0
System.out.println("Scanning with sampler configuration. Data was written" + " before sampler was set on table, scan should fail."); System.out.println("Scanning sample after updating content for docId 2317" + " (should see content change in sample data) : "); System.out.println("Scanning with old sampler configuration. Sample data" + " was created using new configuration with a compaction. Scan should fail.");
0
* Implementation for any url based file system.
0
* Method used to set the property value of an object. * @param obj Object on which the property setter will be called with the value Object invoke(Object obj, Object arg) throws Exception; * Attempts to reuse this JexlPropertySet, checking that it is compatible with * the actual set of arguments. * @param obj the object to invoke the the get upon * @param key the property key to get * @param value the property value to set * @return the result of the method invocation that should be checked by tryFailed to determine if it succeeded * or failed. */ Object tryInvoke(Object obj, Object key, Object value); /** * Checks wether a tryInvoke failed or not. * @param rval the value returned by tryInvoke * @return true if tryExecute failed, false otherwise */ boolean tryFailed(Object rval); /** * Specifies if this JexlPropertySet is cacheable and able to be reused for
0
IteratorSetting cfg; Stopwatch sw; Iterator<Entry<Key,Value>> iterator; try (Scanner s = c.createScanner(table, new Authorizations())) { cfg = new IteratorSetting(100, SlowIterator.class); // A batch size of one will end up calling seek() for each element with no calls to next() SlowIterator.setSeekSleepTime(cfg, 100l); s.addScanIterator(cfg); // Never start readahead s.setReadaheadThreshold(Long.MAX_VALUE); s.setBatchSize(1); s.setRange(new Range()); sw = new Stopwatch(); iterator = s.iterator(); while (iterator.hasNext()) { sw.stop(); // While we "do work" in the client, we should be fetching the next result UtilWaitThread.sleep(100l); iterator.next(); sw.start(); } sw.stop(); try (Scanner s = c.createScanner(table, new Authorizations())) { s.addScanIterator(cfg); s.setRange(new Range()); s.setBatchSize(1); s.setReadaheadThreshold(0l); sw = new Stopwatch(); iterator = s.iterator(); while (iterator.hasNext()) { sw.stop(); // While we "do work" in the client, we should be fetching the next result UtilWaitThread.sleep(100l); iterator.next(); sw.start(); } sw.stop(); long millisWithNoWait = sw.elapsed(TimeUnit.MILLISECONDS); // The "no-wait" time should be much less than the "wait-time" Assert.assertTrue("Expected less time to be taken with immediate readahead (" + millisWithNoWait + ") than without immediate readahead (" + millisWithWait + ")", millisWithNoWait < millisWithWait); }
0
* @param cause the javacc cause * @param cause the javacc cause protected static class Return extends JexlException { /** The returned value. */ /** * Creates a new instance of Return. * @param node the return node * @param msg the message * @param value the returned value */ protected Return(JexlNode node, String msg, Object value) { this.result = value; /** * @return the returned value */ /** * Creates a new instance of Cancel. * @param node the node where the interruption was detected */
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
1
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableMap; import java.util.Collections;
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
// Don't do any caching of content for dynamic case // Since we don't cache we don't need to flush return; } /** * Flush a list of rectangles of cached image data. */ public void flush(List areas) { // Since we don't cache we don't need to flush
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
} catch (IOException | SQLException e) { } catch (SQLException | IOException e) {
0
settings.setInitClassloader(true);
0
import org.apache.http.entity.AbstractHttpEntity;
0
configuration.getRequestConnectTimeout(), configuration.getRequestReadTimeout(),
0
Rectangle2D bounds = null, nodeBounds = null; AffineTransform txf = null; txf = children[0].getTransform(); nodeBounds = children[0].getBounds(); bounds = txf.createTransformedShape(nodeBounds).getBounds2D(); // With the following empty groups may have bad side effects. nodeBounds = node.getBounds(); txf = children[i].getTransform(); nodeBounds = txf.createTransformedShape(nodeBounds).getBounds2D(); bounds.add(nodeBounds);
0
* Autogenerated by Thrift Compiler (0.11.0)
0
package org.w3c.dom.svg; import org.w3c.dom.events.EventTarget; public interface SVGImageElement extends SVGElement, SVGURIReference, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGStylable, SVGTransformable, EventTarget { public SVGAnimatedLength getX( ); public SVGAnimatedLength getY( ); public SVGAnimatedLength getWidth( ); public SVGAnimatedLength getHeight( ); }
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.
0
import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.testing.TestPipeline; AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, TestPipeline.create()); AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, TestPipeline.create()); AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, TestPipeline.create()); Pipeline p = TestPipeline.create(); AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, p); appliedPTransform(otherFullName, otherTransform, p); AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, TestPipeline.create()); AppliedPTransform<?, ?, ?> appliedTransform = appliedPTransform(fullName, pTransform, TestPipeline.create()); String fullName, PTransform<PInput, POutput> transform, Pipeline p) { PInput input = mock(PInput.class); when(input.getPipeline()).thenReturn(p); return AppliedPTransform.of(fullName, input, mock(POutput.class), transform);
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 final HashSet<Column> columnSet = new HashSet<>();
1
SortedMap<Key,Value> map = new TreeMap<>();
0
this.tokens = new ArrayList<>();
0
return !ver.lessEquals(HttpVersion.HTTP_1_0);
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. */ Random rand = (Random) state.get("rand"); state.getConnector().tableOperations().addSplits(Setup.getTableName(), splits);
0
import java.io.InputStream; import org.apache.hadoop.io.serializer.Deserializer; import org.apache.hadoop.io.serializer.SerializationFactory; import org.apache.hadoop.io.serializer.Serializer; public HadoopSplit( HadoopSource<K, V> source, InputSplit inputSplit) { this.inputSplitBytes = serializeSplit(inputSplit, source.getConf()); } catch (InterruptedException e) { @Override public String toString() { return getClass().getName() + "<" + getInputSplit() + ">"; } @SuppressWarnings("unchecked") Deserializer<InputSplit> deserializer; deserializer = (Deserializer) new SerializationFactory(source.getConf()) .getDeserializer(inputSplitClass); try (InputStream in = new ByteArrayInputStream(inputSplitBytes)) { deserializer.open(in); InputSplit ret = deserializer.deserialize(inputSplitClass.newInstance()); deserializer.close(); return ret; } private static byte[] serializeSplit(InputSplit inputSplit, Configuration conf) { @SuppressWarnings("unchecked") Serializer<InputSplit> serializer = (Serializer) new SerializationFactory(conf) .getSerializer(inputSplit.getClass()); try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) { serializer.open(baos); serializer.serialize(inputSplit); serializer.close(); return baos.toByteArray(); }
0
* @param parameters function arguments * @return Object result
0
public static SdkFunctionSpec toProto(WindowFn<?, ?> windowFn, SdkComponents components) { .setEnvironmentId( components.registerEnvironment(Environments.JAVA_SDK_HARNESS_ENVIRONMENT)) .setEnvironmentId( components.registerEnvironment(Environments.JAVA_SDK_HARNESS_ENVIRONMENT)) .setEnvironmentId( components.registerEnvironment(Environments.JAVA_SDK_HARNESS_ENVIRONMENT)) .setEnvironmentId( components.registerEnvironment(Environments.JAVA_SDK_HARNESS_ENVIRONMENT))
0
import java.io.IOException; public ConnectFuture connect(String host, int port) throws IOException { public ConnectFuture connect(SocketAddress address) throws IOException { client.setTcpipForwarderFactory(tcpipForwarderFactory);
0
import net.bytebuddy.description.type.TypeDescription; static <T> FieldValueGetter<T> createGetter(Field field) { DynamicType.Builder<FieldValueGetter> builder = ByteBuddyUtils.subclassGetterInterface(BYTE_BUDDY, field.getDeclaringClass()); DynamicType.Builder<FieldValueSetter> builder = ByteBuddyUtils.subclassSetterInterface(BYTE_BUDDY, field.getDeclaringClass());
0
import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.apache.cocoon.forms.Constants; import org.apache.cocoon.xml.AttributesImpl; * @version CVS $Id: FormattingDateConvertor.java,v 1.2 2004/04/10 13:40:27 bruno Exp $ private static final String CONVERTOR_EL = "convertor"; public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { String pattern = (String)localizedPatterns.get(locale); if (pattern == null) pattern = nonLocalizedPattern; if (pattern != null) { AttributesImpl attrs = new AttributesImpl(); attrs.addCDATAAttribute("pattern", pattern); contentHandler.startElement(Constants.INSTANCE_NS, CONVERTOR_EL, Constants.INSTANCE_PREFIX_COLON + CONVERTOR_EL, attrs); contentHandler.endElement(Constants.INSTANCE_NS, CONVERTOR_EL, Constants.INSTANCE_PREFIX_COLON + CONVERTOR_EL); } }
0
import java.io.IOException; try { so.close(); } catch (IOException e) { //Imposible } BufferedOutputStream bos=new BufferedOutputStream(so); this._signedInfo.signInOctectStream(bos); try { bos.close(); } catch (IOException e) { //Imposible }
0
/* Create indexes first so that if index creation fails then we rollback the typesystem and also do not persist the graph */ typeStore.store(typeSystem, ImmutableList.copyOf(typesAdded.keySet())); typeSystem.removeTypes(typesAdded.keySet());
0
private PriorityQueue<TermSource> sorted = new PriorityQueue<>(5); this.sources = new ArrayList<>(); this.sources = new ArrayList<>();
1
String tableName = getUniqueNames(1)[0];
0
BeamRecordSqlType beamSQLRowType = CalciteUtils.toBeamRowType(
0
modifiedNamespaces.add(b.isEmpty() ? "\"\"" : b);
0
long getCurrentPos() { long getCompressedSize() { public long getRawSize() {
0
import com.twitter.common.base.Supplier; /** * Fetch tasks matching the query returned by {@code querySupplier} from {@code storage} in a * read transaction. Intended for use with {@link com.twitter.mesos.scheduler.Query.Builder} * instances. * * @see #fetchTasks(Storage, com.twitter.mesos.gen.TaskQuery) * @param storage Storage instance to query from. * @param querySupplier Supplier of the query to perform. * @return Tasks returned from the query. */ public static ImmutableSet<ScheduledTask> fetchTasks( Storage storage, Supplier<TaskQuery> querySupplier) { return fetchTasks(storage, querySupplier.get()); }
0
import cz.seznam.euphoria.core.client.dataset.WindowContext; public class SumByKey<IN, KEY, WLABEL, W extends WindowContext<?, WLABEL>, public <WLABEL, W extends WindowContext<?, WLABEL>> OutputBuilder<IN, KEY, WLABEL, W> public static class OutputBuilder<IN, KEY, WLABEL, W extends WindowContext<?, WLABEL>>
0
import com.google.common.collect.ImmutableMap; assertEquals( "aaa", arrayExpression.evaluate(NULL_ROW, NULL_WINDOW, ImmutableMap.of()).getValue()); new BeamSqlDotExpression(elements, SqlTypeName.VARCHAR) .evaluate(NULL_ROW, NULL_WINDOW, ImmutableMap.of());
0
import org.apache.beam.sdk.schemas.annotations.DefaultSchema;
0
private final OfferQueue offerQueue; OfferQueue offerQueue) { this.offerQueue = checkNotNull(offerQueue); OfferQueue offerQueue, offerQueue); if (!offerQueue.launchFirst(assignment)) { } catch (OfferQueue.LaunchException e) {
0
pipeCloseOnExit = executor != pipeService || shutdownOnExit;
0
import java.util.Properties; import javax.xml.transform.OutputKeys; * @version CVS $Id: SourceUtil.java,v 1.14 2004/03/17 12:09:51 cziegeler Exp $ Properties props = XMLUtils.createPropertiesForXML(false); props.put(OutputKeys.ENCODING, "ISO-8859-1"); final String content = XMLUtils.serializeNode(frag, props); Properties props = XMLUtils.createPropertiesForXML(false); props.put(OutputKeys.ENCODING, "ISO-8859-1"); content = XMLUtils.serializeNode(frag, props);
0
package org.apache.commons.ognl.test; import org.apache.commons.ognl.test.objects.Root; import org.apache.commons.ognl.test.objects.SimpleNumeric; import org.apache.commons.ognl.test.objects.TestModel;
0
Function<IResourceAggregate, Integer> counter = machineSlack -> ResourceAggregates.divide(machineSlack, slotSize);
0
public void setTimeout(final int timeout) {
0
implements StringCallback, VoidCallback, DataCallback private static class CountdownWatcher implements Watcher { volatile CountDownLatch clientConnected = new CountDownLatch(1); public void process(WatcherEvent event) { if (event.getState() == Event.KeeperStateSyncConnected) { clientConnected.countDown(); } } } CountdownWatcher watcher = new CountdownWatcher(); ZooKeeper zk = new ZooKeeper(hp, 30000, watcher); if(!watcher.clientConnected.await(CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS)) {
0
if (dataSource.initialSize > 0) { dataSource.getLogWriter(); }
0
import static org.junit.Assert.*; @Test public void testDeleteServiceComponent() throws Exception { Service hdfs = cluster.addService("HDFS"); Service mapReduce = cluster.addService("MAPREDUCE"); hdfs.persist(); ServiceComponent nameNode = hdfs.addServiceComponent("NAMENODE"); nameNode.persist(); ServiceComponent jobTracker = mapReduce.addServiceComponent("JOBTRACKER"); assertEquals(2, cluster.getServices().size()); assertEquals(1, hdfs.getServiceComponents().size()); assertEquals(1, mapReduce.getServiceComponents().size()); assertTrue(hdfs.isPersisted()); assertFalse(mapReduce.isPersisted()); hdfs.deleteServiceComponent("NAMENODE"); assertEquals(0, hdfs.getServiceComponents().size()); assertEquals(1, mapReduce.getServiceComponents().size()); mapReduce.deleteServiceComponent("JOBTRACKER"); assertEquals(0, hdfs.getServiceComponents().size()); assertEquals(0, mapReduce.getServiceComponents().size()); }
0
public class NOPClosure<E> implements Closure<E>, Serializable { public static final Closure<Object> INSTANCE = new NOPClosure<Object>(); @SuppressWarnings("unchecked") public static <E> Closure<E> getInstance() { return (Closure<E>) INSTANCE; public void execute(E input) { /** * {@inheritDoc} */ @Override public boolean equals(Object arg0) { return arg0.hashCode() == this.hashCode(); } /** * {@inheritDoc} */ @Override public int hashCode() { return System.identityHashCode(INSTANCE); }
0
argList.addAll(Arrays.asList(javaBin, "-Dproc=" + clazz.getSimpleName(), "-cp", classpath));
0
* Creates a <code>Filter</code> primitive according to the specified * @param inputFilter the <code>Filter</code> that represents the current * <code>Filter</code> it creates. Other <code>FilterBridge</code>s
0
import java.util.concurrent.atomic.AtomicReference; import org.apache.accumulo.monitor.Monitor.MonitorFactory; import org.junit.AfterClass; import org.junit.BeforeClass; config.register(new MonitorFactory(monitor.get())); private static AtomicReference<Monitor> monitor = new AtomicReference<>(null); @BeforeClass public static void createMocks() { ServerContext contextMock = EasyMock.createMock(ServerContext.class); expect(contextMock.getConfiguration()).andReturn(DefaultConfiguration.getInstance()).anyTimes(); expect(contextMock.getInstanceID()).andReturn("foo").atLeastOnce(); expect(contextMock.getInstanceName()).andReturn("foo").anyTimes(); Monitor monitorMock = EasyMock.createMock(Monitor.class); expect(monitorMock.getContext()).andReturn(contextMock).anyTimes(); EasyMock.replay(contextMock, monitorMock); monitor.set(monitorMock); } @AfterClass public static void finishMocks() { Monitor m = monitor.get(); verify(m.getContext(), m); } expect(Tables.getTableName(monitor.get().getContext(), TableId.of("foo"))).andReturn("bar");
0
* given {@link ConnPoolControl}.
0
* @param paramType Java class name of the parent method's argument (if you wish to use a primitive type, * specify the corresonding Java wrapper class instead, such as <code>java.lang.Boolean</code> * for a <code>boolean</code> parameter) * corresonding Java wrapper class instead, such as <code>java.lang.Boolean</code> for a * <code>boolean</code> parameter)
0
* @version CVS $Id: XMLResourceBundleFactory.java,v 1.6 2003/11/27 18:40:03 joerg Exp $
0
.withCollectionElementType(TypeName.STRING.type()); .withCollectionElementType(TypeName.ROW.type() .withCollectionElementType(TypeName.ARRAY.type() .withCollectionElementType(TypeName.STRING.type()));
0
import org.apache.accumulo.trace.instrument.Trace;
0
package org.apache.sshd.common.forward; private final Logger log; log = LoggerFactory.getLogger(getClass()); log.info("setUp() echo address = {}", acceptor.getLocalAddress()); final RuntimeException lenOK[] = new RuntimeException[NUM_ITERATIONS]; final RuntimeException dataOK[] = new RuntimeException[NUM_ITERATIONS]; InputStream sockIn = s.getInputStream()) { String part1 = new String(b1, 0, read1, StandardCharsets.UTF_8); String part2 = new String(b2, 0, read2, StandardCharsets.UTF_8); lenOK[ii] = (PAYLOAD.length() == totalRead) ? null : new IndexOutOfBoundsException("Mismatched length: expected=" + PAYLOAD.length() + ", actual=" + totalRead); dataOK[ii] = PAYLOAD.equals(readData) ? null : new IllegalStateException("Mismatched content"); if (lenOK[ii] != null) { throw lenOK[ii]; if (dataOK[ii] != null) { throw dataOK[ii]; if (e instanceof IOException) { log.warn("I/O exception in iteration #" + i, e); } else { log.error("Failed to complete iteration #" + i, e); } ok += (lenOK[i] == null) ? 1 : 0; log.info("Successful iteration: " + ok + " out of " + NUM_ITERATIONS); Thread.sleep(55L); assertNull("Bad length at iteration " + i, lenOK[i]); assertNull("Bad data at iteration " + i, dataOK[i]);
0
public Node setNamedItem(String ns, String name, Node arg) throws DOMException { Attr result = (Attr)super.setNamedItem(ns, name, arg); HashMap hm = (HashMap)liveAttributeValues.get(ns); setNamedItemNS(attr); /** * <b>DOM</b>: Implements {@link * org.w3c.dom.NamedNodeMap#removeNamedItemNS(String,String)}. */ public Node removeNamedItemNS(String namespaceURI, String localName) throws DOMException { if (isReadonly()) { } if (localName == null) { new Object[] { "" }); } AbstractAttr n = (AbstractAttr)remove(namespaceURI, localName); if (n == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { localName }); } n.setOwnerElement(null); if (!resetAttribute(namespaceURI, localName)) { fireDOMAttrModifiedEvent(n.getNodeName(), n.getNodeValue(), ""); return n;
0
Set<Bundle> oldBundles = new HashSet<Bundle>(state.bundles); oldBundles.removeAll(state.installed); if (!oldBundles.isEmpty()) { for (Bundle b : state.installed) { String hostHeader = (String) b.getHeaders().get(Constants.FRAGMENT_HOST); if (hostHeader != null) { Clause[] clauses = Parser.parseHeader(hostHeader); if (clauses != null && clauses.length > 0) { Clause path = clauses[0]; for (Bundle hostBundle : oldBundles) { if (hostBundle.getSymbolicName().equals(path.getName())) { String ver = path.getAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE); if (ver != null) { VersionRange v = VersionRange.parseVersionRange(ver); if (v.contains(hostBundle.getVersion())) { bundles.add(hostBundle); } } else {
0
* See Main.java.
0
* @deprecated since 1.3, the two-pass parsing with the flatten method is not enough flexible to handle complex cases
0
import java.util.Iterator; import java.util.Locale; import org.apache.commons.exec.OS; * java-gjc. /** * On Windows platforms test that accessing environment variables * can be done in a case-insensitive way, e.g. "PATH", "Path" and * "path" would reference the same environment variable. */ public void testGetProcEnvironmentCaseInsensitiveLookup() throws IOException { // run tests only on windows platforms if (!OS.isFamilyWindows()) { return; } // ensure that we have the same value for upper and lowercase keys Map procEnvironment = EnvironmentUtil.getProcEnvironment(); for (Iterator it = procEnvironment.keySet().iterator(); it.hasNext();) { String variable = (String) it.next(); String value = (String) procEnvironment.get(variable); assertEquals(value, procEnvironment.get(variable.toLowerCase(Locale.ENGLISH))); assertEquals(value, procEnvironment.get(variable.toUpperCase(Locale.ENGLISH))); } // add an environment variable and check access EnvironmentUtil.addVariableToEnvironment( procEnvironment, "foo=bar" ); assertEquals("bar", procEnvironment.get("FOO")); assertEquals("bar", procEnvironment.get("Foo")); assertEquals("bar", procEnvironment.get("foo")); }
0
return new FixedSizeMap<>(map);
1