Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.commons.dbcp.SQLNestedException; catch (SQLNestedException e) Throwable t = e.getCause(); if (!t.getMessage().startsWith("x is not the correct password"))
0
import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import com.amazonaws.services.kinesis.model.ExpiredIteratorException; import java.io.IOException; import java.util.Collections;
0
* @see #startTServer(ThriftServerType, TimedProcessor, TProtocolFactory, String, String, int, int, long, long, SslConnectionParams, * SaslServerConnectionParams, long, HostAndPort...)
0
import org.apache.accumulo.core.client.AccumuloClient; final AccumuloClient c = getClient();
0
package org.apache.beam.sdk.extensions.sql.meta.provider.kafka; import static org.apache.beam.sdk.extensions.sql.impl.schema.BeamTableUtils.beamRecord2CsvLine; import static org.apache.beam.sdk.extensions.sql.impl.schema.BeamTableUtils.csvLine2BeamRecord; return new CsvRecorderDecoder(beamRecordSqlType, csvFormat); return new CsvRecorderEncoder(beamRecordSqlType, csvFormat); c.output(csvLine2BeamRecord(format, rowInString, rowType)); c.output(KV.of(new byte[] {}, beamRecord2CsvLine(in, format).getBytes()));
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.webconsole.plugins.ds.internal; import org.osgi.framework.Bundle; import org.osgi.service.metatype.MetaTypeInformation; import org.osgi.service.metatype.MetaTypeService; public class MetatypeSupport { public boolean check(final Object obj, final Bundle providingBundle, final String pid) { final MetaTypeService mts = (MetaTypeService)obj; final MetaTypeInformation mti = mts.getMetaTypeInformation(providingBundle); if (mti != null) { try { return mti.getObjectClassDefinition(pid, null) != null; } catch (final IllegalArgumentException e) { return false; } } return false; } }
0
Storage.Util.weaklyConsistentFetchTasks(storage, Query.slaveScoped(offer.getHostname()));
0
import cz.seznam.euphoria.core.client.dataset.Partitioning; import cz.seznam.euphoria.core.client.functional.UnaryFunction; import cz.seznam.euphoria.core.client.util.Pair; import cz.seznam.euphoria.core.client.util.Sums; keyExtractor, valueExtractor, windowing, Sums.ofLongs());
0
public Core(Context c) {
0
FileTxnSnapLog ftxn = new FileTxnSnapLog(config.dataLogDir, config.dataDir);
0
Sum.ofLongs()); Sum.ofLongs());
0
import static com.google.common.base.Charsets.UTF_8; return authString == null ? Constants.NO_AUTHS : new Authorizations(authString.getBytes(UTF_8)); rangeStrings.add(new String(Base64.encodeBase64(baos.toByteArray()), UTF_8)); ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(rangeString.getBytes(UTF_8))); String col = new String(Base64.encodeBase64(TextUtil.getBytes(column.getFirst())), UTF_8); col += ":" + new String(Base64.encodeBase64(TextUtil.getBytes(column.getSecond())), UTF_8); Text cf = new Text(idx < 0 ? Base64.decodeBase64(col.getBytes(UTF_8)) : Base64.decodeBase64(col.substring(0, idx).getBytes(UTF_8))); Text cq = idx < 0 ? null : new Text(Base64.decodeBase64(col.substring(idx + 1).getBytes(UTF_8))); newIter = new String(Base64.encodeBase64(baos.toByteArray()), UTF_8); ByteArrayInputStream bais = new ByteArrayInputStream(Base64.decodeBase64(itstring.getBytes(UTF_8)));
0
super("char *", " ::std::string", "string", "String", "String", "String", "string");
0
* @param port The port on which to listen, or 0 to use any free port. * @param port The port on which to listen, or 0 to use any free port. * @param port The port on which to listen, or 0 to use any free port.
0
* 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.4 $ $Date: 2004/02/28 13:18:36 $
0
public URL getResourceFromContent(String name);
0
* @version $Id: AbstractTestSuite.java,v 1.3 2004/06/23 18:17:44 imario Exp $ manager.setFilesCache(providerConfig.getFilesCache());
0
import java.net.ConnectException; public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeLayeredSocketFactory, final Socket sock = socket != null ? socket : createSocket(context); if (localAddress != null) { sock.bind(localAddress); } try { sock.connect(remoteAddress, connectTimeout); } catch (final IOException ex) { try { sock.close(); } catch (final IOException ignore) { } throw ex; }
0
try // export SCR metadata files from OSGI-INF/ Map<String, Resource> scrDir = jar.getDirectories().get("OSGI-INF"); if (scrDir != null) { for (Map.Entry<String, Resource> entry : scrDir.entrySet()) { String path = entry.getKey(); Resource resource = entry.getValue(); writeSCR(resource, new File(scrLocation, path), buildContext, log); exportScr(analyzer, jar, scrLocation, buildContext, log);
0
* @author <a href="mailto:[email protected]">Vincent Hardy</a>
0
* @version CVS $Id: JavaLanguage.java,v 1.3 2003/10/07 15:13:20 tcurdt Exp $ return XSLTExtension.escapeJavaString(constant);
0
import org.apache.http.annotation.NotThreadSafe;
0
public boolean consistentWithEquals() { return keyCoder.consistentWithEquals() && valueCoder.consistentWithEquals(); } @Override public Object structuralValue(KV<K, V> kv) throws Exception { if (consistentWithEquals()) { return kv; } else { return KV.of(getKeyCoder().structuralValue(kv.getKey()), getValueCoder().structuralValue(kv.getValue())); } } @Override
0
assertFalse( file.isHidden() ); assertTrue( file.isReadable() ); assertTrue( file.isWriteable() ); assertFalse( file.getParent().isHidden() ); assertFalse( file.getParent().getParent().isHidden() ); assertTrue( file.exists() ); assertTrue( file.isReadable() ); assertTrue( file.isWriteable() ); }
0
import javax.xml.parsers.DocumentBuilder; /** Field db */ DocumentBuilder db; public Canonicalizer20010315ExclusiveTest() throws ParserConfigurationException { this.db = XMLUtils.createDocumentBuilder(false); } Document doc = this.db.parse(fileIn); this.db.parse( getAbsolutePath("src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml") this.db.parse(getAbsolutePath( "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml") this.db.parse(getAbsolutePath( "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_1.xml")); this.db.parse(getAbsolutePath( "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_2.xml")); this.db.parse(getAbsolutePath( "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_2_3.xml")); Document doc = this.db.parse(new InputSource(new StringReader(XML))); this.db.parse( getAbsolutePath( "src/test/resources/org/apache/xml/security/c14n/inExcl/example2_4.xml")); Document doc = XMLUtils.createDocumentBuilder(false).newDocument(); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML))); Document doc = this.db.parse(new InputSource(new StringReader(XML)));
0
public void encode(Mutation mutation, OutputStream outStream) throws IOException { public Mutation decode(InputStream inStream) throws IOException {
0
this.staticallyBound = bundleLocation != null;
0
/** The property solving jexl engine. */ /** The object serving as context provider. */ * @param engine the jexl engine to use to solve properties * @param wrapped the object to wrap in this context public ObjectContext(JexlEngine engine, T wrapped) { this.jexl = engine; this.object = wrapped;
0
* * * "x-mac-roman", "csMacintosh", "mac", "macintosh",
0
import cz.seznam.euphoria.core.annotation.audience.Audience; @Audience(Audience.Type.INTERNAL)
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
/* Used by XmlIOIT */ @Description("Xml file charset name") @Default.String("UTF-8") String getCharset(); void setCharset(String charset);
0
if (verbose) System.out.println(msg); if (zapMaster) ZooReaderWriter.getInstance().recursiveDelete(tserversPath + "/" + child, NodeMissingPolicy.SKIP);
1
import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command;
0
* @version $Revision$ $Date$
0
import java.net.UnknownHostException; log.error("problem getting default file system.", e); } catch (IllegalArgumentException exception) { /* Hadoop throws a wrapped UHE in some edge cases of DNS trouble */ if (exception.getCause() instanceof UnknownHostException) { log.error("problem getting default file system.", exception); } else { throw exception; }
0
* * @since 0.1 /** * Set the verbosity of the logging message of the bundle * * @since 0.1 */ /** * If equal to "true" enables the CyberDomo UPnP SDK debugging messages * * @since 0.1 */ /** * If equal to "true" enables Exporter facility of the UPnP Base Driver * * @since 0.3 */ /** * If equal to "true" enables Importer facility of the UPnP Base Driver * * @since 0.3 */ /** * If equal to "true" enables the use of NICs with IPv4 configured and only IPv4 addresses will be used * * @since 0.3 */ /** * If equal to "true" enables the use of NICs with IPv6 configured and only IPv6 addresses will be used<br> * <b>NOTE:</b>This property is used only on JDK 1.4 or greater * @since 0.3 */ /** * If equal to "true" enables the use of Loopback addresses, either IPv6 and IPv4 * * @since 0.3 */
0
* @version CVS $Id: AbstractAspectalizableDescription.java,v 1.3 2003/05/22 12:32:47 cziegeler Exp $ public void addAspectDescription(AspectDescription aspect) {
0
import static javax.servlet.http.HttpServletResponse.*; if (getContext().handleSecurity(req, res)) this.filter.doFilter(req, res, chain); // FELIX-3988: If the response is not yet committed and still has the default // status, we're going to override this and send an error instead. if (!res.isCommitted() && res.getStatus() == SC_OK) { res.sendError(SC_FORBIDDEN); }
0
private final String filePattern; * @param filePattern path or glob of files to include public NumberedShardedFile(String filePattern) { this(filePattern, DEFAULT_SHARD_TEMPLATE); * @param filePattern path or glob of files to include public NumberedShardedFile(String filePattern, Pattern shardTemplate) { !Strings.isNullOrEmpty(filePattern), "Expected valid file path, but received %s", filePattern); this.filePattern = filePattern; public String getFilePattern() { return filePattern; IOChannelFactory factory = IOChannelUtils.getFactory(filePattern); Collection<String> files = factory.match(filePattern); LOG.debug("Found {} file(s) by matching the path: {}", files.size(), filePattern); return String.format("%s with shard template '%s'", filePattern, shardTemplate);
0
import org.apache.aurora.gen.JobUpdateKey; import org.apache.aurora.scheduler.storage.entities.IJobKey; import org.apache.aurora.scheduler.storage.entities.IJobUpdateKey; private static final IJobKey JOB = JobKeys.from("role", "env", "job"); IInstanceKey.build(new InstanceKey(JOB.newBuilder(), 0)); private static final IJobUpdateKey UPDATE_ID = IJobUpdateKey.build(new JobUpdateKey(JOB.newBuilder(), "update_id")); Optional.of("Killed for job update " + UPDATE_ID.getId()))) .andReturn(StateChangeResult.SUCCESS); JobUpdateStatus.ROLLING_BACK, UPDATE_ID); JobUpdateStatus.ROLLING_BACK, UPDATE_ID);
0
expect(mockStatement.executeQuery("select c.cluster_name,type_name from clusterconfigmapping ccm " + "join clusters c on ccm.cluster_id=c.cluster_id " + "group by c.cluster_name,type_name " + "having sum(selected) > 1")).andReturn(mockResultSet);
0
public class DefaultThreadPoolTestCase extends AbstractTestCase // We cannot mock the DefaultThreadFactory as the underlying // PooledExecutor of the DefaultThreadPool will again wrapp it into a // Using a easymocked DefaultThreadFactory will prevent the // We cannot mock the DefaultThreadFactory as the underlying // PooledExecutor of the DefaultThreadPool will again wrapp it into a // Using a easymocked DefaultThreadFactory will prevent the throws InterruptedException
0
/* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.sitemap; /** * @version $Id:$ * @since 2.2 */ public interface EnterSitemapEventListener extends SitemapListener { void enteredSitemap(EnterSitemapEvent event); }
0
/* * $Id$ * 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
* 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
saveNoLoad(obj); return this.load(obj); } public <T extends AtlasBaseModelObject> void saveNoLoad(T obj) throws AtlasBaseException {
0
private boolean noDelay; @Override @Override throw new SshException("write(len=" + l + ") channel already closed"); throw new SshException("flush(length=" + bufferLength + ") - stream is already closed"); buf.wpos((cmd == SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA) ? 14 : 10); if (log.isDebugEnabled()) { log.debug("Send {} on channel {}", (cmd == SshConstants.SSH_MSG_CHANNEL_DATA) ? "SSH_MSG_CHANNEL_DATA" : "SSH_MSG_CHANNEL_EXTENDED_DATA", Integer.valueOf(channel.getId())); } } catch(WindowClosedException e) { } catch(Exception e) { if (e instanceof IOException) { throw (IOException) e; } else { throw new SshException(e); } if (!closed) { try { flush(); } finally { closed = true; } }
0
opts.setClientProperties(getClientProperties()); vopts.setClientProperties(getClientProperties());
0
* @version $Id: BaseConfiguration.java,v 1.10 2004/12/02 22:05:52 ebourg Exp $ Object o = getProperty(key); public Object getProperty(String key)
0
protected void deployMonolithicCocoonApp(final String blocksdir) throws MojoExecutionException { String id = artifact.getArtifactId(); if(files.containsKey(id)) { throw new MojoExecutionException("There are at least two artifacts with the ID '" + id + "'."); } MonolithicCocoonDeployer.deploy(files, webappDirectory_, blocksdir, new MavenLoggingWrapper(this.getLog()));
0
public SingleClientConnManager(final HttpParams params, final SchemeRegistry schreg) { createConnectionOperator(final SchemeRegistry schreg) { final long timeout, final TimeUnit tunit) { public ManagedClientConnection getConnection(final HttpRoute route, final Object state) { final ManagedClientConnection conn, final long validDuration, final TimeUnit timeUnit) { public void closeIdleConnections(final long idletime, final TimeUnit tunit) { protected ConnAdapter(final PoolEntry entry, final HttpRoute route) {
0
import org.apache.accumulo.core.util.LocalityGroupUtil; for (String lgName : localityGroupCF.keySet()) { LocalityGroupUtil.seek(iter, new Range(), lgName, localityGroupCF);
0
* 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.9 $ $Date: 2004/02/28 13:18:36 $
0
* feComponentTransfer filter, as defined in chapter 15, section 11 of the SVG * specification. * @version $Id$
0
public enum TypeCategory { PRIMITIVE, ARRAY, MAP, ENTITY, STRUCT, CLASSIFICATION, OBJECT_ID_TYPE } private final TypeCategory typeCategory; protected AtlasType(String typeName, TypeCategory category) { this.typeCategory = category; public TypeCategory getTypeCategory() { return typeCategory; }
0
* <p>An {@link ActiveWindowSet} considers a window to be in one of the following states: * * <li><b>NEW</b>: The initial state for a window on an incoming element; we do not yet know * if it should be merged into an ACTIVE window, or whether it is already present as an * ACTIVE window, since we have not yet called * {@link WindowFn#mergeWindows}.</li> * <li><b>ACTIVE</b>: A window that has state associated with it and has not itself been merged * away. The window may have one or more <i>state address</i> windows under which its * non-empty state is stored. A state value for an ACTIVE window must be derived by reading * the state in all of its state address windows.</li> * <li><b>EPHEMERAL</b>: A NEW window that has been merged into an ACTIVE window before any state * has been associated with that window. Thus the window is neither ACTIVE nor MERGED. These * windows are not persistently represented since if they reappear the merge function should * again redirect them to an ACTIVE window. EPHEMERAL windows are an optimization for * the common case of in-order events and {@link Sessions session window} by never associating * state with windows that are created and immediately merged away.</li> * <li><b>MERGED</b>: An ACTIVE window has been merged into another ACTIVE window after it had * state associated with it. The window will thus appear as a state address window for exactly * one ACTIVE window.</li> * <li><b>EXPIRED</b>: The window has expired and may have been garbage collected. No new elements * (even late elements) will ever be assigned to that window. These windows are not explicitly * represented anywhere; it is expected that the user of {@link ActiveWindowSet} will store * no state associated with the window.</li> * <p> * * <p>If no windows will ever be merged we can use the trivial implementation {@link
0
if ( null == param ) { if (param.getClass().isArray()) { return (String[]) param; } return new String[] {(String) param}; if (scheme==null) { return scheme.equalsIgnoreCase("HTTPS"); if (cookies.isEmpty()) { Cookie[] cookieArray = new Cookie[cookies.size()]; return (Cookie []) cookies.values().toArray(cookieArray); if (this.environment == null) { } return this.environment.getURI(); if (this.environment == null) { } return this.environment.getURI(); if (this.environment == null) { } return this.environment.getURIPrefix(); return null; } return false; return this.globalAttributes.get(name); return this.globalAttributes.keys(); /* (non-Javadoc) * @see org.apache.cocoon.environment.Request#getInputStream() */ public InputStream getInputStream() throws IOException, UnsupportedOperationException { return this.inputStream; } this.inputStream = is; /** * @see org.apache.cocoon.environment.Request#searchAttribute(java.lang.String) */ public Object searchAttribute(String name) { Object result = this.getAttribute(name, REQUEST_SCOPE); if ( result == null ) { result = this.getAttribute(name, GLOBAL_SCOPE); } return result; }
0
String truststorePassword = primarySiteConfig.get(Property.RPC_SSL_TRUSTSTORE_PASSWORD.getKey()); String credProvider = primarySiteConfig.get(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS.getKey()); final Set<String> filesNeedingReplication = connMaster.replicationOperations().referencedFiles(masterTable);
0
private static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(BobKeyResolver.class);
1
* {@link org.apache.commons.dbcp2.PoolableConnection PoolableConnection}s.
0
import org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder; import org.osgi.service.http.runtime.dto.ServletContextDTO; /** * Create all DTOs for servlets, filters, resources and error pages * @param dto The servlet context DTO * @param failedDTOHolder The container for all failed DTOs */ public void getRuntime(final ServletContextDTO dto, final FailedDTOHolder failedDTOHolder) this.filterRegistry.getRuntimeInfo(dto, failedDTOHolder.failedFilterDTOs); this.errorPageRegistry.getRuntimeInfo(dto, failedDTOHolder.failedErrorPageDTOs); this.servletRegistry.getRuntimeInfo(dto, failedDTOHolder.failedServletDTOs, failedDTOHolder.failedResourceDTOs);
0
import org.apache.hc.core5.annotation.NotThreadSafe;
1
storageUtil.expectOperations();
0
package org.apache.xml.security.stax.test; import org.apache.xml.security.stax.impl.XMLSecurityEventWriter;
0
import com.google.gson.Gson; * serializer used to convert json to map */ private static final Gson jsonSerializer = new Gson(); /** createResources(getCreateCommand(properties, request.getRequestInfoProperties())); * @param properties request properties * @param requestInfoProps request info properties private Command<Void> getCreateCommand(final Map<String, Object> properties, final Map<String, String> requestInfoProps) { artifactDAO.create(toEntity(properties, requestInfoProps.get(Request.REQUEST_INFO_BODY_PROPERTY))); @SuppressWarnings("unchecked") private ArtifactEntity toEntity(Map<String, Object> properties, String rawRequestBody) Map<String, Object> rawBodyMap = jsonSerializer.<Map<String, Object>>fromJson( rawRequestBody, Map.class); Object artifactData = rawBodyMap.get(ARTIFACT_DATA_PROPERTY); if (! (artifactData instanceof Map)) { throw new IllegalArgumentException("artifact_data property must be a map"); } artifact.setArtifactData((Map<String, Object>) artifactData);
0
import org.apache.http.util.Args; Args.notNull(dst, "Byte buffer");
0
PCollection<String> inputWords = p.apply(Create.timestamped(WORDS, TIMESTAMPS) .withCoder(StringUtf8Coder.of())); PCollection<String> inputWords = p.apply(Create.timestamped(WORDS, TIMESTAMPS) .withCoder(StringUtf8Coder.of()));
0
import java.math.BigInteger; eid = new BigInteger(sa[1], 16).longValue();
1
import org.apache.accumulo.core.client.AccumuloClient; AccumuloClient conn = EasyMock.createMock(AccumuloClient.class); EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn); AccumuloClient conn = EasyMock.createMock(AccumuloClient.class); EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn); AccumuloClient conn = EasyMock.createMock(AccumuloClient.class); EasyMock.expect(shellState.getAccumuloClient()).andReturn(conn);
0
import org.apache.hc.core5.http.io.entity.HttpEntityWithTrailers; import org.apache.hc.core5.http.io.entity.StringEntity;
1
encryptionPartDef.setSymmetricKey(securityTokenProvider.getSecurityToken().getSecretKey(getSecurityProperties().getEncryptionSymAlgorithm(), null, null)); getSecurityProperties().getEncryptionKeyTransportAlgorithm(), null, null); getSecurityProperties().getEncryptionKeyTransportAlgorithm(), null, null); securityTokenProvider.getSecurityToken().getSecretKey(getSecurityProperties().getEncryptionSymAlgorithm(), null, null);
0
* @author <a href="mailto:[email protected]">Felix Project Team</a>
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.cli2.option;import org.apache.commons.cli2.OptionException;/** * @author Rob Oxspring */public abstract class ParentTestCase extends OptionTestCase { public abstract void testProcessParent() throws OptionException;}
0
private static final String PREFIX = AccumuloFileOutputFormatTest.class.getSimpleName(); private static final String INSTANCE_NAME = PREFIX + "_mapreduce_instance"; private static final String BAD_TABLE = PREFIX + "_mapreduce_bad_table"; private static final String TEST_TABLE = PREFIX + "_mapreduce_test_table"; private static final String EMPTY_TABLE = PREFIX + "_mapreduce_empty_table"; MockInstance mockInstance = new MockInstance(INSTANCE_NAME); c.tableOperations().create(EMPTY_TABLE); c.tableOperations().create(TEST_TABLE); c.tableOperations().create(BAD_TABLE); BatchWriter bw = c.createBatchWriter(TEST_TABLE, new BatchWriterConfig()); bw = c.createBatchWriter(BAD_TABLE, new BatchWriterConfig()); AccumuloInputFormat.setMockInstance(job, INSTANCE_NAME); job.setMapperClass(BAD_TABLE.equals(table) ? BadKeyMapper.class : Mapper.class); MRTester.main(new String[] {"root", "", content ? TEST_TABLE : EMPTY_TABLE, f.getAbsolutePath()}); MRTester.main(new String[] {"root", "", BAD_TABLE, f.getAbsolutePath()});
0
private ConnectionThread(final DataSource ds) {
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
return CalciteUtils.toCalciteRowType(this.beamTable.getSchema(), typeFactory);
0
Lists.newArrayList(outputReceiverNodes).stream()
0
public void testTransformingSourceUnsplittable() throws Exception { int numElements = 10000; @SuppressWarnings("deprecation") BoundedSource<Long> longSource = SourceTestUtils.toUnsplittableSource(CountingSource.upTo(numElements)); SerializableFunction<Long, String> toStringFn = new SerializableFunction<Long, String>() { @Override public String apply(Long input) { return input.toString(); } }; BoundedSource<String> stringSource = new TransformingSource<>(longSource, toStringFn, StringUtf8Coder.of()); List<String> expected = Lists.newArrayList(); for (int i = 0; i < numElements; i++) { expected.add(String.valueOf(i)); } PipelineOptions options = PipelineOptionsFactory.create(); Assert.assertThat( SourceTestUtils.readFromSource(stringSource, options), CoreMatchers.is(expected)); SourceTestUtils.assertSplitAtFractionBehavior( stringSource, 100, 0.3, ExpectedSplitOutcome.MUST_BE_CONSISTENT_IF_SUCCEEDS, options); SourceTestUtils.assertSourcesEqualReferenceSource( stringSource, stringSource.splitIntoBundles(100, options), options); } @Test
0
private static final int DEFAULT_BUFSIZE = 8 * 1024; final HttpMessageWriterFactory<HttpRequest> requestWriterFactory, this(DEFAULT_BUFSIZE, requestWriterFactory, responseParserFactory); final HttpMessageParserFactory<HttpResponse> responseParserFactory) { this(null, responseParserFactory); } public DefaultClientConnectionFactory(int bufferSize) { this(DEFAULT_BUFSIZE, null, null);
0
* @since 6.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
0
* @throws NullPointerException if either argument is null * @throws NullPointerException if either argument is null * @throws NullPointerException if the method name is null * @throws NullPointerException if the method name is null * @throws NullPointerException if the closures array is null * @throws NullPointerException if any closure in the array is null * @throws NullPointerException if the closures collection is null * @throws NullPointerException if any closure in the collection is null * @throws NullPointerException if the predicate or closure is null * @throws NullPointerException if the predicate or either closure is null * @throws NullPointerException if the either array is null * @throws NullPointerException if any element in the arrays is null * @throws IllegalArgumentException if the arrays have different sizes * @throws NullPointerException if the either array is null * @throws NullPointerException if any element in the arrays is null * @throws NullPointerException if the map is null * @throws NullPointerException if any closure in the map is null * @throws NullPointerException if the map is null * @throws NullPointerException if any closure in the map is null throw new NullPointerException("The object and closure map must not be null");
0
package org.apache.commons.configuration; * @version $Id: TestNonStringProperties.java,v 1.4 2005/01/03 16:35:04 ebourg Exp $ public void setUp() throws Exception { conf = new PropertiesConfiguration(testProperties); nonStringTestHolder.setConfiguration(conf);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/impl/Attic/DynaTagScript.java,v 1.2 2002/05/15 06:25:48 jstrachan Exp $ * $Revision: 1.2 $ * $Date: 2002/05/15 06:25:48 $ * $Id: DynaTagScript.java,v 1.2 2002/05/15 06:25:48 jstrachan Exp $ import org.apache.commons.jelly.JellyContext; * @version $Revision: 1.2 $ public void run(JellyContext context, XMLOutput output) throws Exception {
0
* http://www.apache.org/licenses/LICENSE-2.0
0
if (this.execRuntime.isEndpointConnected()) { this.execRuntime.disconnectEndpoint(); this.execRuntime.discardEndpoint(); this.execRuntime.discardEndpoint(); this.execRuntime.releaseEndpoint(); final boolean open = execRuntime != null && execRuntime.isEndpointAcquired();
0
import org.apache.http.annotation.NotThreadSafe; @NotThreadSafe
0
/** * Check the validity of a public key. * * @param username the username * @param key the key * @param session the server session * @return a non null identity object or <code>null</code if authentication fail */ Object hasKey(String username, PublicKey key, ServerSession session);
0
final List<Object> testList = new ArrayList<>(size); final TreeMap<String, Object> map = new TreeMap<>(); final List<Object> collection = new ArrayList<>(); final HashMap<String, Object> elem = new HashMap<>();
0
public static Set<String> getPropertyIds(Predicate predicate) {
1
private static final List<Set<Integer>> TEST_VALUES = Arrays.asList( Collections.emptySet(), Collections.singleton(13), new HashSet<>(Arrays.asList(31, -5, 83)));
0
import java.util.Set; Map<PropertyInfo.PropertyType, Set<String>> getPropertiesTypes(); void setPropertiesTypes(Map<PropertyInfo.PropertyType, Set<String>> propertiesTypes);
0
import java.sql.SQLException; import org.apache.ambari.server.H2DatabaseCleaner; H2DatabaseCleaner.resetSequences(injector); public void teardown() throws AmbariException, SQLException { H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector); }
0
* <p> * </p> * <p> * </p> * <p> * </p>
0
existingMetric.setMetricValues(new TreeMap<>());
0
* @version $Id$
0
Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_OPEN, 0); out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
0
package aQute.bnd.build; import java.io.*; import java.util.*; import aQute.lib.osgi.*; public class ProjectBuilder extends Builder { Project project; boolean initialized; public ProjectBuilder(Project project) { super(project); this.project = project; } public ProjectBuilder(ProjectBuilder builder) { super(builder); this.project = builder.project; } @Override public long lastModified() { return Math.max(project.lastModified(), super.lastModified()); } /** * We put our project and our workspace on the macro path. */ protected Object[] getMacroDomains() { return new Object[] { project, project.getWorkspace() }; } public Builder getSubBuilder() throws Exception { return project.getBuilder(this); } public Project getProject() { return project; } public void init() { try { if (!initialized) { initialized = true; for (Container file : project.getClasspath()) { addClasspath(file.getFile()); } for (Container file : project.getBuildpath()) { addClasspath(file.getFile()); } for (Container file : project.getBootclasspath()) { addClasspath(file.getFile()); } for (File file : project.getAllsourcepath()) { addSourcepath(file); } } } catch (Exception e) { error("init project builder fails", e); } } public List<Jar> getClasspath() { init(); return super.getClasspath(); } @Override protected void changedFile(File f) { project.getWorkspace().changedFile(f); } }
0