Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
package org.apache.accumulo.wikisearch.iterator; import org.apache.accumulo.wikisearch.parser.EventFields; import org.apache.accumulo.wikisearch.parser.QueryEvaluator;
0
package cz.seznam.euphoria.kafka; import cz.seznam.euphoria.core.client.io.DataSink; import cz.seznam.euphoria.core.client.io.Writer; import java.io.IOException; import java.io.PrintStream; import java.util.Objects; public class PrintStreamSink<T> extends DataSink<T> { static abstract class AbstractWriter<T> extends Writer<T> { final PrintStream out; AbstractWriter(PrintStream out) { this.out = Objects.requireNonNull(out); } @Override public void commit() throws IOException { out.flush(); } } static final class PlainWriter<T> extends AbstractWriter<T> { PlainWriter(PrintStream out) { super(out); } @Override public void write(T elem) throws IOException { out.println(elem); } } static final class PartitionIdWriter<T> extends AbstractWriter<T> { final int partitionId; final StringBuilder buf = new StringBuilder(); PartitionIdWriter(PrintStream out, int partitionId) { super(out); this.partitionId = partitionId; } @Override public void write(T elem) throws IOException { buf.setLength(0); buf.append('[').append(partitionId).append("]: ").append(elem); out.println(buf); } } private final PrintStream out; private final boolean dumpPartitionId; public PrintStreamSink(PrintStream out) { this(out, false); } public PrintStreamSink(PrintStream out, boolean dumpPartitionId) { this.out = out; this.dumpPartitionId = dumpPartitionId; } @Override public Writer<T> openWriter(int partId) { return dumpPartitionId ? new PartitionIdWriter<>(out, partId) : new PlainWriter<>(out); } @Override public void commit() throws IOException { } @Override public void rollback() { } }
0
/** The scheme registry for looking up socket factories. */ * as the scheme registry. * Creates a new client connection operator for the given scheme registry. * @param schemes the scheme registry, or <code>null</code> to use } // class DefaultClientConnectionOperator
0
import org.apache.aurora.common.quantity.Amount; import org.apache.aurora.common.quantity.Time; import org.apache.aurora.common.stats.StatsProvider; import org.apache.aurora.common.testing.easymock.EasyMockTest; import org.apache.aurora.common.util.testing.FakeClock;
0
Triple.of(Instant.parse("2016-12-19T12:00:00.000Z"), Type.VEGETABLE, 1L)); } execute(new AbstractTestCase<Pair<Instant, String>, Triple<Instant, Instant, Integer>>(3) {
0
* @version CVS $Id: FormsPipelineConfig.java,v 1.3 2004/03/18 21:04:39 joerg Exp $ public class FormsPipelineConfig { * Default key under which the Cocoon Forms form instance is stored in the JXPath context. public static final String CFORMSKEY = "CocoonFormsInstance"; private FormsPipelineConfig(JXPathContext jxpc, Request req, Locale localeParam, public static FormsPipelineConfig createConfig(Map objectModel, Parameters parameters) { return new FormsPipelineConfig(jxpc, request, localeParameter, jxpathExpression = "/" + FormsPipelineConfig.CFORMSKEY;
0
package org.apache.felix.shell.impl; import org.apache.felix.shell.Command; org.apache.felix.shell.Command.class.getName())) org.apache.felix.shell.Command.class.getName()))
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 * <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 SqliteQuerySet extends QuerySet { }
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.commons.vfs2.example.filter; import java.io.File; import org.apache.commons.vfs2.FileFilterSelector; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.VFS; import org.apache.commons.vfs2.filter.PrefixFileFilter; /** * Example for using {@link PrefixFileFilter}. */ // CHECKSTYLE:OFF Example code public class PrefixFileFilterExample { public static void main(String[] args) throws Exception { // Example, to print all files and directories in the current directory // whose name starts with a <code>.</code> FileSystemManager fsManager = VFS.getManager(); FileObject dir = fsManager.toFileObject(new File(".")); FileObject[] files = dir.findFiles(new FileFilterSelector(new PrefixFileFilter("."))); for (int i = 0; i < files.length; i++) { System.out.println(files[i]); } } } // CHECKSTYLE:ON
0
import java.sql.SQLException; public void testClosePool() throws Exception { new TesterDriver(); ConnectionFactory connFactory = new DriverManagerConnectionFactory( "jdbc:apache:commons:testdriver","u1","p1"); ObjectPool connPool = new GenericObjectPool(); KeyedObjectPoolFactory stmtPoolFactory = new GenericKeyedObjectPoolFactory(null); PoolableConnectionFactory x = new PoolableConnectionFactory( connFactory, connPool, stmtPoolFactory, null, false, true); DataSource ds = new PoolingDataSource(connPool); ((PoolingDataSource) ds).setAccessToUnderlyingConnectionAllowed(true); Connection conn = ds.getConnection(); Statement stmt = conn.prepareStatement("select 1 from dual"); Connection poolableConnection = ((DelegatingConnection) conn).getDelegate(); Connection poolingConnection = ((DelegatingConnection) poolableConnection).getDelegate(); poolingConnection.close(); try { stmt = conn.prepareStatement("select 1 from dual"); fail("Expecting SQLException"); } catch (SQLException ex) { assertTrue(ex.getMessage().endsWith("invalid PoolingConnection.")); } }
0
import org.apache.accumulo.core.Constants; import org.apache.accumulo.core.security.tokens.UserPassToken; @Override @Override AccumuloInputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1])); AccumuloInputFormat.setInputTableName(job, args[2]); AccumuloInputFormat.setScanAuthorizations(job, Constants.NO_AUTHS); AccumuloInputFormat.setZooKeeperInstance(job, args[3], args[4]); AccumuloOutputFormat.setConnectorInfo(job, new UserPassToken(args[0], args[1])); AccumuloOutputFormat.setCreateTables(job, true); AccumuloOutputFormat.setDefaultTableName(job, args[5]); AccumuloOutputFormat.setZooKeeperInstance(job, args[3], args[4]);
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/UnmodifiableList.java,v 1.3 2003/05/07 11:20:21 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/05/07 11:20:21 $ /** * Gets the list being decorated. * * @return the decorated list */ protected List getList() { return (List) getCollection(); } //-----------------------------------------------------------------------
0
* @cocoon.sitemap.component.documentation * The filter transformer can be used to let only an amount of elements through in * a given block. * @cocoon.sitemap.component.name filter * @cocoon.sitemap.component.documentation.caching Yes * public class FilterTransformer extends AbstractTransformer implements CacheableProcessingComponent { Map objectModel, String source, Parameters parameters)
0
// Note: The Working Group (in conjunction with XHTML working // group) has decided that multiple line elements collapse. int prevLN = 0; Iterator lnIter = lnLocs.iterator(); if (nextLN == prevLN) continue; ret.addAttribute(FLOW_LINE_BREAK, new Object(), prevLN, nextLN); // System.out.println("Attr: [" + prevLN + "," + nextLN + "]"); prevLN = nextLN; int start=0; List emptyPara = null; // System.out.println("Para: [" + start + ", " + end + "]"); UnitProcessor.Context uctx; uctx = UnitProcessor.createContext(ctx, e); // System.out.println("Line: " + asb.length() + // " - '" + asb + "'"); float flLeft = left; float flRight = right; s = e.getAttributeNS(null, BATIK_EXT_FIRST_LINE_LEFT_MARGIN_ATTRIBUTE); try { if (s.length() != 0) { float f = Float.parseFloat(s); flLeft = f; } } catch(NumberFormatException nfe) { /* nothing */ } s = e.getAttributeNS(null,BATIK_EXT_FIRST_LINE_RIGHT_MARGIN_ATTRIBUTE); try { if (s.length() != 0) { float f = Float.parseFloat(s); flRight = f; } } catch(NumberFormatException nfe) { /* nothing */ } return new MarginInfo(top, right, bottom, left, flLeft, flRight, justification, rgnBr);
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.ipojo.runtime.core.components; import org.apache.felix.ipojo.runtime.core.services.CheckService; import org.osgi.framework.BundleContext; import java.util.HashMap; import java.util.Map; /** * A component using method injection to retrieve the bundle context. */ public class ComponentUsingMethod implements CheckService { private BundleContext context; public void setContext(BundleContext context) { this.context = context; } @Override public boolean check() { return context != null; } @Override public Map map() { Map<String, BundleContext> map = new HashMap<String, BundleContext>(); if (context != null) { map.put("context", context); } return map; } }
0
@Override
0
import org.osgi.framework.wiring.BundleCapability; import org.osgi.framework.wiring.BundleRevision; private final BundleRevision m_host; public HostedCapability(BundleRevision host, BundleCapabilityImpl cap) super(host, cap.getNamespace(), cap.getDirectives(), cap.getAttributes()); m_host = host; public BundleRevision getRevision()
0
import org.apache.felix.dm.lambda.FluentProperty; public ComponentBuilderImpl provides(Class<?> iface, FluentProperty ... properties) { public ComponentBuilderImpl provides(Class<?>[] ifaces, FluentProperty ... properties) { public ComponentBuilderImpl provides(String iface, FluentProperty ... properties) { public ComponentBuilderImpl provides(String[] ifaces, FluentProperty ... properties) { public ComponentBuilderImpl properties(FluentProperty ... properties) {
0
* The system property ({@value}) which can be used to override the system type.<br/> * If defined, the value will be used to create any automatically created parsers. * * The name of an optional systemType properties file ({@value}), which is loaded * using {@link Class#getResourceAsStream(String)}.<br/> * The entries are the systemType (as determined by {@link FTPClient#getSystemType}) * and the values are the replacement type or parserClass, which is passed to * {@link FTPFileEntryParserFactory#createFileEntryParser(String)}.<br/> * For example: * <pre> * Plan 9=Unix * OS410=org.apache.commons.net.ftp.parser.OS400FTPEntryParser * </pre> * * @since 3.0 public static final String SYSTEM_TYPE_PROPERTIES = "/systemType.properties";
0
* @see org.apache.batik.ext.awt.g2d.GraphicContext
0
* @since 1.0
0
* @version $Revision: 1.11 $ $Date: 2004/05/07 23:11:04 $ /** * Validates a key value pair. * * @param key the key to validate * @param value the value to validate * @throws IllegalArgumentException if invalid */ protected void validate(Object key, Object value) { if (keyPredicate != null && keyPredicate.evaluate(key) == false) { throw new IllegalArgumentException("Cannot add key - Predicate rejected it"); } if (valuePredicate != null && valuePredicate.evaluate(value) == false) { throw new IllegalArgumentException("Cannot add value - Predicate rejected it"); } }
0
import com.google.common.base.Optional; import org.apache.ambari.server.topology.ConfigRecommendationStrategy; * configuration recommendation strategy property name */ public static final String CONFIG_RECOMMENDATION_STRATEGY = "config_recommendation_strategy"; /** /** * configuration recommendation strategy */ private final ConfigRecommendationStrategy configRecommendationStrategy; ClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID))); this.configRecommendationStrategy = parseConfigRecommendationStrategy(properties); public ConfigRecommendationStrategy getConfigRecommendationStrategy() { return configRecommendationStrategy; } /** * Parse config recommendation strategy. Throws exception in case of the value is not correct. * The default value is {@link ConfigRecommendationStrategy#NEVER_APPLY} * @param properties request properties * @throws InvalidTopologyTemplateException specified config recommendation strategy property fail validation */ private ConfigRecommendationStrategy parseConfigRecommendationStrategy(Map<String, Object> properties) throws InvalidTopologyTemplateException { if (properties.containsKey(CONFIG_RECOMMENDATION_STRATEGY)) { String configRecommendationStrategy = String.valueOf(properties.get(CONFIG_RECOMMENDATION_STRATEGY)); Optional<ConfigRecommendationStrategy> configRecommendationStrategyOpt = Enums.getIfPresent(ConfigRecommendationStrategy.class, configRecommendationStrategy); if (!configRecommendationStrategyOpt.isPresent()) { throw new InvalidTopologyTemplateException(String.format( "Config recommendation stratagy is not supported: %s", configRecommendationStrategy)); } return configRecommendationStrategyOpt.get(); } else { // default return ConfigRecommendationStrategy.NEVER_APPLY; } }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.security.authorization; import org.springframework.security.core.AuthenticationException; public class InvalidUsernamePasswordCombinationException extends AuthenticationException { public static final String MESSAGE = "Unable to sign in. Invalid username/password combination."; public InvalidUsernamePasswordCombinationException() { super(MESSAGE); } public InvalidUsernamePasswordCombinationException(Throwable t) { super(MESSAGE, t); } }
0
public class DefaultBHttpServerConnection extends BHttpConnectionBase implements HttpServerConnection {
0
import com.google.cloud.dataflow.sdk.util.state.StateContext; static final StateTag<Object, ValueState<PaneInfo>> PANE_INFO_TAG = public void clear(StateContext<?> state) {
0
* <p>This class is immutable and thread-safe.</p>
0
@Override
0
* A {@link Combine.CombineFn} that computes the latest element from a set of inputs.
0
import org.apache.felix.bundlerepository.Resource; public Resource getResource()
0
case Code.IncorrectParameterException: return new BKIncorrectParameterException(); int IncorrectParameterException = -14; case Code.IncorrectParameterException: return "Incorrect parameter input"; public static class BKIncorrectParameterException extends BKException { public BKIncorrectParameterException() { super(Code.IncorrectParameterException); } }
0
Element group = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG); Element testGroup = domFactory.createElementNS(SVG_NAMESPACE_URI, SVG_G_TAG); testGroup.setAttributeNS(null, ATTR_ID, testName); Element testRect = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_RECT); testRect.setAttributeNS(null, attrName, (String)attrMap.get(attrName));
0
if (name.equals(REQUEST_BLOB_TITLE)) { propertySet.getProperties().put(PropertyHelper.getPropertyId(path, name), child.toString()); } else { processNode(child, path.isEmpty() ? name : path + '/' + name, propertySet, requestInfoProps); }
0
import org.apache.felix.scr.integration.components.Felix4350Component; import org.osgi.service.component.runtime.dto.ComponentDescriptionDTO; final ComponentDescriptionDTO main = findComponentDescriptorByName(componentName); TestCase.assertNotNull(main); asyncEnable(main); //needs to be async delay(300); //dep2 getService has not yet returned delay(2000); //dep2 getService has returned // ComponentInstance mainCompInst = main.getComponentInstance(); // TestCase.assertNull(mainCompInst); Felix4350Component.check(0, 0, false); // mainCompInst = main.getComponentInstance(); // TestCase.assertNotNull(mainCompInst); Felix4350Component.check(1, 0, true); disableAndCheck(main); //does not need to be asyncv?? Felix4350Component.check(1, 1, false); Felix4350Component.check(1, 1, false); asyncEnable(main); //needs to be async // mainCompInst = main.getComponentInstance(); // TestCase.assertNotNull(mainCompInst); Felix4350Component.check(2, 1, true); //n.b. counts are cumulative } protected void asyncEnable( final ComponentDescriptionDTO cd ) { new Thread( new Runnable() { public void run() { enableAndCheck( cd ); }}).start();
0
import org.apache.batik.anim.dom.AnimationTarget;
0
private static final long serialVersionUID = 0; private static final long serialVersionUID = 0; private static final long serialVersionUID = 0; private static final long serialVersionUID = 0;
0
* @param mimeType the mime type, not {@code null}
0
// First remove the registered service. // Fire the service event which gives all client bundles the // opportunity to unget their service object. // Now forcibly unget the service object for all stubborn clients. synchronized (this) { Bundle[] clients = getUsingBundles(reg.getReference()); for (int i = 0; (clients != null) && (i < clients.length); i++) { while (ungetService(clients[i], reg.getReference())) ; // Keep removing until it is no longer possible } }
0
import org.apache.atlas.type.AtlasRelationshipType; import java.util.List; } else if (type instanceof AtlasRelationshipType) { addRelationshipType((AtlasRelationshipType)type, context); addRelationshipTypes(entityType, context); private void addRelationshipType(AtlasRelationshipType relationshipType, ExportService.ExportContext context) { if (!context.relationshipTypes.contains(relationshipType.getTypeName())) { context.relationshipTypes.add(relationshipType.getTypeName()); addAttributeTypes(relationshipType, context); addEntityType(relationshipType.getEnd1Type(), context); addEntityType(relationshipType.getEnd2Type(), context); } } private void addRelationshipTypes(AtlasEntityType entityType, ExportService.ExportContext context) { for (List<AtlasRelationshipType> relationshipTypes : entityType.getRelationshipAttributesType().values()) { for (AtlasRelationshipType relationshipType : relationshipTypes) { addRelationshipType(relationshipType, context); } } }
0
private int timeStyle = -1; int timeStyle = this.timeStyle != -1 ? this.timeStyle : style; dateFormat = (SimpleDateFormat)DateFormat.getTimeInstance(timeStyle, locale); dateFormat = (SimpleDateFormat)DateFormat.getDateTimeInstance(style, timeStyle, locale); /** * Sets the style for times, if not specified it defaults to the same style as for dates. * * @param style one of the constants FULL, LONG, MEDIUM or SHORT defined in the {@link Date} class. */ public void setTimeStyle(int style) { this.timeStyle = style; }
0
null);
0
private final CacheEntryFactory cacheEntryFactory; this(new CacheEntryFactory(new HeapResourceFactory())); CacheEntryUpdater(final CacheEntryFactory cacheEntryFactory) {
0
* Copyright 2004,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 CVS $Id: PortletApplicationEntityImpl.java,v 1.2 2004/03/05 13:02:15 bdelacretaz Exp $
1
import java.util.Map; import org.apache.cocoon.environment.ObjectModelHelper; return checkPatterns(expression, host, false);
0
boolean resume = true;
0
* @version CVS $Id: NetUtils.java,v 1.11 2004/04/18 23:17:39 ugo Exp $ // Added this check to satisfy NetUtilsTestCase. I cannot ascertain whether // this is correct or not, since the description of this method is not very // clear. [Ugo Cei <ugo@apache.org> 2004-04-19] if (uri.charAt(0) == '/') { b.append('/'); }
0
public Parameters getPipelineParameters() { return this.processingPipelineParameters; } public String getPipelineType() { return this.processingPipelineName; }
0
task,
0
* @version CVS $Id: AbstractProcessingPipeline.java,v 1.7 2003/08/06 10:07:30 cziegeler Exp $ this.parameters = params;
0
import static com.google.cloud.dataflow.sdk.runners.worker.ReaderTestUtils.positionFromSplitResult; import static com.google.cloud.dataflow.sdk.runners.worker.ReaderTestUtils.splitRequestAtByteOffset; import static com.google.cloud.dataflow.sdk.runners.worker.ReaderTestUtils.splitRequestAtPosition; assertNull(iterator.requestDynamicSplit(splitRequestAtPosition(new Position()))); positionFromSplitResult(iterator.requestDynamicSplit(splitRequestAtByteOffset(stop))) assertNull(iterator.requestDynamicSplit(splitRequestAtByteOffset(stop))); assertNull(iterator.requestDynamicSplit(splitRequestAtByteOffset(stop)));
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
/* * Copyright 2003-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.3 $ $Date: 2004/02/18 00:58:18 $
0
@Override @Override @Override
0
import org.junit.Rule; import org.junit.rules.ExpectedException; @Rule public ExpectedException exception = ExpectedException.none(); @Test public void testTypes() { Properties props = new Properties(); props.setProperty(ClientProperty.BATCH_WRITER_LATENCY_MAX.getKey(), "10s"); Long value = ClientProperty.BATCH_WRITER_LATENCY_MAX.getTimeInMillis(props); assertEquals(10000L, value.longValue()); props.setProperty(ClientProperty.BATCH_WRITER_MEMORY_MAX.getKey(), "555M"); value = ClientProperty.BATCH_WRITER_MEMORY_MAX.getBytes(props); assertEquals(581959680L, value.longValue()); ClientProperty.BATCH_WRITER_MEMORY_MAX.setBytes(props, 5819L); value = ClientProperty.BATCH_WRITER_MEMORY_MAX.getBytes(props); assertEquals(5819L, value.longValue()); ClientProperty.BATCH_WRITER_LATENCY_MAX.setTimeInMillis(props, 1234L); value = ClientProperty.BATCH_WRITER_LATENCY_MAX.getTimeInMillis(props); assertEquals(1234L, value.longValue()); exception.expect(IllegalStateException.class); ClientProperty.BATCH_WRITER_LATENCY_MAX.getBytes(props); }
0
FileHandlerReloadingDetector fileHandlerReloadingDetector = (refreshDelay != null) ? new FileHandlerReloadingDetector( fileHandlerReloadingDetector.refresh(); return fileHandlerReloadingDetector;
0
qcm.queueResult(new Result(toe, qcm, (server == null ? null : server.toString())));
0
* Copyright 2004,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 CVS $Id: Support.java,v 1.2 2004/03/05 13:02:15 bdelacretaz Exp $
1
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(coreValidity, "Signature failed core validation"); @org.junit.jupiter.api.Test assertTrue(cv, "Signature failed core validation");
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/>. * */ /** * Scheduling strategies used by HTTP cache implementations. */ package org.apache.hc.client5.http.schedule;
0
/** Transform - XPath Filter */ /** Transform - XPath Filter CHGP private*/ Element []transforms; if (log.isDebugEnabled()) { log.debug("Preform the (" + i + ")th " + t.getURI() + " transform"); } public int getLength() if (transforms==null) { transforms=XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(), "Transform"); } return transforms.length; if (transforms==null) { transforms=XMLUtils.selectDsNodes(this._constructionElement.getFirstChild(), "Transform"); return new Transform(transforms[i], this._baseURI); /** @inheritDoc */
0
import org.apache.atlas.ApplicationProperties; org.apache.commons.configuration.Configuration configuration = getApplicationConfiguration(); protected void doServiceLogin(Configuration hadoopConfig, org.apache.commons.configuration.Configuration configuration) { private String getHostname(org.apache.commons.configuration.Configuration configuration) { protected void setupHadoopConfiguration(Configuration hadoopConfig, org.apache.commons.configuration.Configuration configuration) { protected org.apache.commons.configuration.Configuration getApplicationConfiguration() { return ApplicationProperties.get(); LOG.warn("Error reading application configuration", e); return null;
0
* @since 2.4
0
private final boolean masterComponent; String hostName, boolean recoveryEnabled, boolean masterComponent) { this.masterComponent = masterComponent; public boolean isMasterComponent() { return masterComponent; } buffer.append("clusterId=").append(m_clusterId);
0
package org.apache.felix.scr.annotations;
0
implements Windowing<T, TimeInterval> { public Set<TimeInterval> assignWindowsToElement( Set<TimeInterval> ret = new HashSet<>(); ret.add(new TimeInterval(start, start + this.duration)); public Trigger<T, TimeInterval> getTrigger() { return new TimeTrigger<>();
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
Map<String, ScheduledTask> coalesced = Maps.newHashMap(); for (ScheduledTask task : prior.getTasks()) { coalesced.put(task.getAssignedTask().getTaskId(), task); } for (ScheduledTask task : next.getTasks()) { coalesced.put(task.getAssignedTask().getTaskId(), task); }
0
import org.osgi.framework.Constants; out.println(m_context.getBundle(0).getHeaders(Constants.BUNDLE_VERSION)); }
0
/** TODO add package comment. */
0
* Copyright (c) 2002 The Apache Software Foundation. All rights
0
this.zk = master.getContext().getZooReaderWriter();
0
package org.apache.felix.sigil.ui.eclipse.ui; import org.apache.felix.sigil.eclipse.SigilCore;
0
* $HeadURL$ * $Revision$ * $Date$ public void setConnectionsPerRoute(final ConnPerRouteBean connPerRoute) { params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, connPerRoute); }
0
final byte[] bytes = "Message content".getBytes(Consts.ASCII.name()); final InputStreamEntity httpentity = new InputStreamEntity(new ByteArrayInputStream(bytes), -1); final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity); final byte[] bytes = "Message content".getBytes(Consts.ASCII.name()); final ByteArrayEntity httpentity = new ByteArrayEntity(bytes); final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity); } catch (final IllegalArgumentException ex) { final byte[] bytes = "Message content".getBytes(Consts.ASCII.name()); final InputStreamEntity httpentity = new InputStreamEntity(new ByteArrayInputStream(bytes), -1); final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity); } catch (final IllegalArgumentException ex) { final byte[] bytes = "Message content".getBytes(Consts.ASCII.name()); final ByteArrayEntity httpentity = new ByteArrayEntity(bytes); final BufferedHttpEntity bufentity = new BufferedHttpEntity(httpentity); } catch (final IllegalArgumentException ex) {
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
* @version $Id$ public interface ThreadPool { String ROLE = ThreadPool.class.getName(); String getBlockPolicy(); long getKeepAliveTime(); int getMaximumPoolSize(); int getMaximumQueueSize(); int getMinimumPoolSize(); String getName(); int getPoolSize(); int getPriority(); int getQueueSize(); boolean isQueued(); boolean isTerminatedAfterShutdown()); throws InterruptedException; void shutdown();
0
{ Filter filter = null; if (filterString != null) { try { filter = m_context.createFilter(filterString); } catch (InvalidSyntaxException e) { Assert.fail("Could not create filter for resource handler: " + e); return; } if (filter == null || filter.match(m_resources[i].getProperties())) if (filter == null || filter.match(m_resources[i].getProperties()))
0
import org.apache.sshd.server.auth.hostbased.HostBasedAuthenticator; private HostBasedAuthenticator hostBasedAuthenticator; public HostBasedAuthenticator getHostBasedAuthenticator() { return hostBasedAuthenticator; } @Override public void setHostBasedAuthenticator(HostBasedAuthenticator hostBasedAuthenticator) { this.hostBasedAuthenticator = hostBasedAuthenticator; } @Override
0
* Copyright 2002-2005 The Apache Software Foundation.
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/>. * */ /** * HTTP message entity APIs based on the asynchronous (non-blocking) I/O model. */ package org.apache.hc.core5.http.nio.entity;
0
import java.util.Iterator; asserter.assertExpression("5L", new Long(5)); public static class IterableContainer implements Iterable<Integer> { private final Set<Integer> values; public IterableContainer(int[] is) { values = new HashSet<Integer>(); for (int value : is) { values.add(value); } } @Override public Iterator<Integer> iterator() { return values.iterator(); } } for (int i : ai) { IterableContainer ic = new IterableContainer(ai); Object[] vars = {ai, al, am, ad, as, ic}; for (Object var : vars) { for (int x : ai) {
0
* public static final String ACCUMULO_CLASSPATH_VALUE = "$ACCUMULO_CONF_DIR,\n" + "$ACCUMULO_HOME/lib/[^.].*.jar,\n" + "$ZOOKEEPER_HOME/zookeeper[^.].*.jar,\n" + "$HADOOP_CONF_DIR,\n" + "$HADOOP_PREFIX/[^.].*.jar,\n" + "$HADOOP_PREFIX/lib/[^.].*.jar,\n" + "$HADOOP_PREFIX/share/hadoop/common/.*.jar,\n" + "$HADOOP_PREFIX/share/hadoop/common/lib/.*.jar,\n" + "$HADOOP_PREFIX/share/hadoop/hdfs/.*.jar,\n" + "$HADOOP_PREFIX/share/hadoop/mapreduce/.*.jar,\n" + "/usr/lib/hadoop/[^.].*.jar,\n" + "/usr/lib/hadoop/lib/[^.].*.jar,\n" + "/usr/lib/hadoop-hdfs/[^.].*.jar,\n" + "/usr/lib/hadoop-mapreduce/[^.].*.jar,\n" + "/usr/lib/hadoop-yarn/[^.].*.jar,\n"; * *
0
import org.apache.ambari.server.state.RepositoryType; Mockito.when(m_repositoryVersion.getType()).thenReturn(RepositoryType.STANDARD);
0
this(false, null, null, false, false, 0, false, null, null,
0
public EchoShell() { super(); } thread.setDaemon(true);
0
package org.apache.beam.sdk.extensions.euphoria.fluent; import org.apache.beam.sdk.extensions.euphoria.core.client.io.DataSource; import org.apache.beam.sdk.extensions.euphoria.core.util.Settings; import static java.util.Objects.requireNonNull; private final org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow wrap; Flow(org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow wrap) { return new Flow(org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow.create(name)); return new Flow(org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow.create(name, settings));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/Digester.java,v 1.78 2003/05/22 17:00:55 rdonkin Exp $ * $Revision: 1.78 $ * $Date: 2003/05/22 17:00:55 $ * @version $Revision: 1.78 $ $Date: 2003/05/22 17:00:55 $ * <p> * </p> * * <p> * <strong>Note</strong> This method may be called more than once. * Once only initialization code should be placed in {@link #initialize} * or the code should take responsibility by checking and setting the * {@link #configured} flag. * </p> initialize(); // call hook method for subclasses that want to be initialized once only // Nothing else required by default /** * <p> * Provides a hook for lazy initialization of this <code>Digester</code> * instance. * The default implementation does nothing, but subclasses * can override as needed. * Digester (by default) only calls this method once. * </p> * * <p> * <strong>Note</strong> This method will be called by {@link #configure} * only when the {@link #configured} flag is false. * Subclasses that override <code>configure</code> or who set <code>configured</code> * may find that this method may be called more than once. * </p> */ protected void initialize() { // Perform lazy initialization as needed ; // Nothing required by default }
0
* @param <InputT> the type of the (main) input elements of the DoFn * @param <OutputT> the type of the (main) output elements of the DoFn public class DoFnInfo<InputT, OutputT> implements Serializable { private final DoFn<InputT, OutputT> doFn; private final Coder<InputT> inputCoder; public DoFnInfo(DoFn<InputT, OutputT> doFn, WindowingStrategy<?, ?> windowingStrategy) { public DoFnInfo(DoFn<InputT, OutputT> doFn, WindowingStrategy<?, ?> windowingStrategy, Iterable<PCollectionView<?>> sideInputViews, Coder<InputT> inputCoder) { public DoFn<InputT, OutputT> getDoFn() { public Coder<InputT> getInputCoder() {
0
import org.apache.hc.core5.http.HeaderElements; import org.apache.hc.core5.http.HttpHeaders; if (new BasicHeader(HttpHeaders.EXPECT, HeaderElements.CONTINUE).equals(request.getHeader(HttpHeaders.EXPECT))) {
0
final List<MatchResult> expected = ImmutableList.of( MatchResult.create( Status.OK, ImmutableList.of( Metadata.builder() .setResourceId(testPath("testFileAA")) .setIsReadSeekEfficient(true) .setSizeBytes("testDataAA".getBytes().length) .build())), MatchResult.create(Status.NOT_FOUND, ImmutableList.of()), MatchResult.create( Status.OK, ImmutableList.of( Metadata.builder() .setResourceId(testPath("testFileBB")) .setIsReadSeekEfficient(true) .setSizeBytes("testDataBB".getBytes().length) .build())));
0
* <p> * Large streams (over 2GB) will return an inaccurate result count as the * type is an int. The copy will complete correctly however. * <p> * Large streams (over 2GB) will return an inaccurate result count as the * type is an int. The copy will complete correctly however.
0
return new ConfigurationNodePointer<>(getParent(), subNodes List<T> result = new ArrayList<>(); List<T> prefixChildren = new ArrayList<>(children.size());
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
0
import javax.servlet.http.HttpSession; HttpSession session = request.getSession(true);
0
return SecurityUtils.isDHOakelyGroupSupported(1024) && BuiltinDigests.sha1.isSupported(); return SecurityUtils.isDHOakelyGroupSupported(2048) && BuiltinDigests.sha1.isSupported(); return SecurityUtils.isDHGroupExchangeSupported() && BuiltinDigests.sha1.isSupported(); return SecurityUtils.isDHGroupExchangeSupported() && BuiltinDigests.sha256.isSupported(); return ECCurves.nistp256.isSupported(); return ECCurves.nistp384.isSupported(); return ECCurves.nistp521.isSupported();
0
return m_bundle.getInfo().getCurrentModule() .getContentLoader().getResourceFromContent(entryName);
0
|| oldSchState == State.STOP_FAILED || oldSchState == State.STOPPING) { || oldState == State.UPGRADING || oldState == State.STOPPING) { || oldState == State.STARTED || oldState == State.STOPPING) {
0
* @version $Revision$ $Date$
0
* Copyright 2000-2009 The Apache Software Foundation
0
final boolean release = m_componentManager.obtainReadLock( "DependencyManager.serviceChanged.1" ); m_componentManager.releaseReadLock( "DependencyManager.serviceChanged.1" );
0