Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.beam.sdk.values.BeamRecordType; private static final BeamRecordType RECORD_TYPE = BeamRecordSqlType.builder()
0
public class NamespaceConfiguration extends AccumuloConfiguration { private static final Logger log = Logger.getLogger(NamespaceConfiguration.class); public NamespaceConfiguration(String namespaceId, AccumuloConfiguration parent) { if (!(namespaceId.equals(Constants.SYSTEM_NAMESPACE_ID) && isIteratorOrConstraint(property.getKey()))) { synchronized (NamespaceConfiguration.class) { propCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(inst)); if (this.namespaceId.equals(Constants.SYSTEM_NAMESPACE_ID)) String err = "Attempt to add observer for non-namespace configuration"; String err = "Attempt to remove observer for non-namespace configuration";
0
comparator = ExtensionFileComparator.EXTENSION_COMPARATOR;
0
* An abstract class used for iterators that notify observers about size in bytes of their elements, * as they are being iterated over. The subclasses need to implement the standard Iterator interface * and call method notifyValueReturned() for each element read and/or iterated over. public abstract class ElementByteSizeObservableIterator<V> extends Observable implements Iterator<V> {
1
import java.util.Collections; import org.apache.sshd.common.util.threads.ExecutorService; public ChannelAgentForwarding(ExecutorService executor) { super("", Collections.emptyList(), executor); forwardService = (service == null) ? ThreadUtils.newSingleThreadExecutor("ChannelAgentForwarding[" + authSocket + "]") : ThreadUtils.noClose(service); if (forwardService != null) {
1
@com.fasterxml.jackson.annotation.JsonProperty("id") @com.fasterxml.jackson.annotation.JsonProperty("executionCommands") @com.fasterxml.jackson.annotation.JsonProperty("statusCommands") @com.fasterxml.jackson.annotation.JsonProperty("cancelCommands") @com.fasterxml.jackson.annotation.JsonProperty("alertDefinitionCommands") @com.fasterxml.jackson.annotation.JsonProperty("alertExecutionCommands") @com.fasterxml.jackson.annotation.JsonProperty("registrationCommand") @com.fasterxml.jackson.annotation.JsonProperty("restartAgent") @com.fasterxml.jackson.annotation.JsonProperty("hasMappedComponents") @com.fasterxml.jackson.annotation.JsonProperty("hasPendingTasks") @com.fasterxml.jackson.annotation.JsonProperty("recoveryConfig") @com.fasterxml.jackson.annotation.JsonProperty("clusterSize")
1
/** * {@inheritDoc} */ @Override public String getCopyColumnToAnotherTableStatement(String sourceTable, String sourceColumnName, String sourceIDColumnName1, String sourceIDColumnName2, String sourceIDColumnName3, String targetTable, String targetColumnName, String targetIDColumnName1, String targetIDColumnName2, String targetIDColumnName3, String sourceConditionFieldName, String condition) { return String.format("UPDATE %1$s AS a INNER JOIN %2$s AS b ON a.%5$s = b.%8$s AND a.%6$s = b.%9$s AND a.%7$s = b.%10$s AND b.%11$s = '%12$s' SET a.%3$s = b.%4$s", targetTable, sourceTable, targetColumnName, sourceColumnName, targetIDColumnName1, targetIDColumnName2, targetIDColumnName3, sourceIDColumnName1, sourceIDColumnName2, sourceIDColumnName3, sourceConditionFieldName, condition); }
0
* @version CVS $Id: AbstractProducible.java,v 1.2 2003/05/21 13:06:06 cziegeler Exp $ protected String id; /** * Get the unique id of this object * @return String Unique id */ public String getId() { return this.id; } /** * Get the unique id of this object * @return String Unique id */ public void setId(String id) { this.id = id; } /** * Initialize the object. This should only be called once directly * after the creation */ public void initialize(String name, String id) { this.name = name; this.id = id; }
0
public final class Constants { public static final String GUID_PROPERTY_KEY = "guid"; public static final String GUID_INDEX = "guid_index"; public static final String ENTITY_TYPE_PROPERTY_KEY = "type"; public static final String ENTITY_TYPE_INDEX = "type_index"; public static final String VERSION_PROPERTY_KEY = "version"; public static final String TIMESTAMP_PROPERTY_KEY = "timestamp"; public static final String TRAIT_NAMES_PROPERTY_KEY = "traits"; public static final String BACKING_INDEX = "search"; public static final String INDEX_NAME = "metadata"; public static final String VERTEX_INDEX = "vertex_index"; public static final String EDGE_INDEX = "edge_index";
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorIntIterator.java,v 1.1 2003/01/09 13:40:11 rwaldhoff Exp $ * $Date: 2003/01/09 13:40:11 $ package org.apache.commons.collections.primitives.adapters; import org.apache.commons.collections.primitives.IntIterator; * @version $Revision: 1.1 $ $Date: 2003/01/09 13:40:11 $
0
webAppContext.setAllowNullPathInfo(true);
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
spec.setProperty( Constants.CREATED_BY, "sigil.felix.apache.org" ); addResources( bundle, spec ); private void addResources( IBldBundle bundle, Properties spec )
0
return wrappedCollection(key); } @Override List<V> wrappedCollection(final K key) {
0
import org.apache.commons.bcel6.Const; super(Const.T_UNKNOWN, "<UNINITIALIZED OBJECT OF TYPE '"+t.getClassName()+"'>");
0
package org.apache.commons.beanutils2;
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/JXPathCompiledExpression.java,v 1.2 2002/05/08 23:05:05 dmitri Exp $ * $Revision: 1.2 $ * $Date: 2002/05/08 23:05:05 $ * * @version $Revision: 1.2 $ $Date: 2002/05/08 23:05:05 $ public Pointer createPathAndSetValue(JXPathContext context, Object value) { return ((JXPathContextReferenceImpl)context). createPathAndSetValue(xpath, expression, value); } /** * @deprecated use createPathAndSetValue */ createPathAndSetValue(context, value); /** * @see CompiledExpression#remove(JXPathContext) */ public void removePath(JXPathContext context){ ((JXPathContextReferenceImpl)context).removePath(xpath, expression); } /** * @see CompiledExpression#removeAll(JXPathContext) */ public void removeAll(JXPathContext context){ ((JXPathContextReferenceImpl)context).removeAll(xpath, expression); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.accumulo.core.replication; /** * */ public enum RemoteReplicationErrorCode { COULD_NOT_DESERIALIZE, COULD_NOT_APPLY, TABLE_DOES_NOT_EXIST, CANNOT_AUTHENTICATE }
0
import org.apache.beam.harness.test.TestStreams;
0
* <p>Most implementors of this interface are expected to be {@link OldDoFn} instances, and will
0
sb.append(" docID=").append(doc); Value v = iter.getTopValue(); assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k))); Value v = iter.getTopValue(); assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k))); Value v = iter.getTopValue(); assertTrue(new String(v.get()).endsWith(" docID="+iter.getDocID(k)));
0
public class SVGMaskElementBridge extends AbstractSVGBridge implements MaskBridge { /** * Constructs a new bridge for the &lt;mask> element. */ public SVGMaskElementBridge() {} /** * Returns 'mask'. */ public String getLocalName() { return SVG_MASK_TAG; }
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 CVS $Id$
0
initializeDynamicSupport(ctx, e, node); if (!ctx.isInteractive()) return; if (ctx.isDynamic()) { this.e = e; this.node = node; this.ctx = ctx; ((SVGOMElement)e).setSVGContext(this); }
0
Translation.add(translations, FlowUnfolder.InputOperator.class, new InputTranslator( splitAssignerFactory)); for (Translation<Operator<?, ?>> tx : txs) { if (tx.accept == null || tx.accept.apply(originalOp)) {
0
/** * Create a StringBody from the specified text, mime type and character set. * * @param text to be used for the body, not {@code null} * @param mimeType the mime type, may be {@code null} * @param charset the character set, may be {@code null}, in which case the hosts default charset is used * @throws UnsupportedEncodingException * @throws IllegalArgumentException if the {@code text} parameter is null */ /** * Create a StringBody from the specified text and character set. * The mime type is set to "text/plain". * * @param text to be used for the body, not {@code null} * @param charset the character set, may be {@code null}, in which case the hosts default charset is used * @throws UnsupportedEncodingException * @throws IllegalArgumentException if the {@code text} parameter is null */ /** * Create a StringBody from the specified text. * The mime type is set to "text/plain". * The hosts default charset is used. * * @param text to be used for the body, not {@code null} * @throws UnsupportedEncodingException * @throws IllegalArgumentException if the {@code text} parameter is null */
0
// One may add new permissions, but new permissions must use new numbers. Current numbers in use // must not be changed.
0
protected void toStringFields(final StringBuilder builder) {
0
package org.apache.accumulo.server.test.randomwalk.concurrent; import java.util.List; import java.util.Properties; import java.util.Random; import java.util.TreeSet; import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.client.TableOfflineException; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; import org.apache.hadoop.io.Text; public class Compact extends Test { @Override public void visit(State state, Properties props) throws Exception { Connector conn = state.getConnector(); Random rand = (Random) state.get("rand"); @SuppressWarnings("unchecked") List<String> tableNames = (List<String>) state.get("tables"); String tableName = tableNames.get(rand.nextInt(tableNames.size())); //TODO need to sometimes do null start and end ranges TreeSet<Text> range = new TreeSet<Text>(); range.add(new Text(String.format("%016x", Math.abs(rand.nextLong())))); range.add(new Text(String.format("%016x", Math.abs(rand.nextLong())))); try{ boolean wait = rand.nextBoolean(); conn.tableOperations().compact(tableName, range.first(), range.last(), false, wait); log.debug((wait ? "compacted " : "initiated compaction ")+tableName); }catch(TableNotFoundException tne){ log.debug("compact "+tableName+" failed, doesnt exist"); }catch(TableOfflineException toe){ log.debug("compact "+tableName+" failed, offline"); } } }
1
/* ==================================================================== * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * @version $Revision: 1.5 $ $Date: 2004/01/14 21:34:26 $
0
private String tier; .setTier(tier)
0
import org.apache.commons.io.FileUtils; // Remove directory if jar was updated since last extracting if (archiveDir.exists() && viewArchive.lastModified() > archiveDir.lastModified()) { FileUtils.deleteDirectory(archiveDir); }
0
import org.apache.hc.core5.net.URIAuthority; public HttpRoute determineRoute(final HttpHost host, final HttpContext context) throws HttpException { proxy = determineProxy(host, context); @Override public HttpHost determineTargetHost(final HttpRequest request, final HttpContext context) throws HttpException { final URIAuthority authority = request.getAuthority(); if (authority != null) { final String scheme = request.getScheme(); if (scheme == null) { throw new ProtocolException("Protocol scheme is not specified"); } return new HttpHost(authority, scheme); } else { return null; } }
0
ImmutableSet.copyOf(recovery.query(Query.unscoped()))); ImmutableSet.copyOf(recovery.query(Query.unscoped()))); ImmutableSet.copyOf(recovery.query(Query.unscoped())));
0
import org.apache.ambari.server.StaticallyInject; @StaticallyInject @Inject private static AlertDefinitionDAO s_definitionDao;
0
if (xid == null) { throw new NullPointerException("xid is null"); } if (this.currentXid == null) { throw new XAException("There is no current transaction"); } if (!this.currentXid.equals(xid)) { throw new XAException("Invalid Xid: expected " + this.currentXid + ", but was " + xid); }
0
LOG.info("********* Reconciling Alert Definitions **********"); ambariMetaInfo.reconcileAlertDefinitions(clusters);
0
return headerValueList.get(0);
0
import java.net.MalformedURLException; String uri = null; uri = file.toURL().toString(); } else{ uri = arguments[i]; URL url = null; try{ url = new URL(arguments[i]); }catch(MalformedURLException e){ // This is not a valid uri uri = null; } } if (uri != null) { (uri); + arguments[i]);
0
protected static final String[] UNITS = {
1
import org.apache.commons.configuration.event.ConfigurationEvent; assertEquals("Wrong separator", " = ", layout.getSeparator(TEST_KEY)); * Tests if the copy and the original are independent from each other. * Tests changing the separator for a property. */ public void testSetSeparator() throws ConfigurationException { config.addProperty(TEST_KEY, TEST_VALUE); layout.setSeparator(TEST_KEY, ":"); checkLayoutString(TEST_KEY + ":" + TEST_VALUE + CR); } /**
0
final E[] values = (E[]) set.toArray(); // NOPMD - false positive for generics
0
/* import org.apache.commons.cli2.resource.ResourceConstants; public OptionImpl(final int id, final boolean required) { public boolean canProcess(final WriteableCommandLine commandLine, final ListIterator arguments) { final String argument = (String) arguments.next(); } else { final OptionImpl that = (OptionImpl) thatObj; return (getId() == that.getId()) && equals(getPreferredName(), that.getPreferredName()) && equals(getDescription(), that.getDescription()) && equals(getPrefixes(), that.getPrefixes()) && equals(getTriggers(), that.getTriggers()); } else { return false; } private boolean equals(Object left, Object right) { if ((left == null) && (right == null)) { return true; } else if ((left == null) || (right == null)) { } else { return left.equals(right); public int hashCode() { hashCode = (hashCode * 37) + getPreferredName().hashCode(); hashCode = (hashCode * 37) + getDescription().hashCode(); hashCode = (hashCode * 37) + getPrefixes().hashCode(); hashCode = (hashCode * 37) + getTriggers().hashCode(); public Option findOption(String trigger) { if (getTriggers().contains(trigger)) { return this; } else { return null; } } if (prefixes.isEmpty()) { private void checkPrefix(final Set prefixes, final String trigger) { if (trigger.startsWith(prefix)) { final ResourceHelper helper = ResourceHelper.getResourceHelper(); final String message = helper.getMessage(ResourceConstants.OPTION_TRIGGER_NEEDS_PREFIX, trigger, prefixes.toString());
0
import org.apache.ambari.view.hive20.client.DatabaseMetadataWrapper; private DatabaseMetadataWrapper databaseMetadata; public DatabaseMetadataWrapper getDatabaseMetadata() { return databaseMetadata; } public void setDatabaseMetadata(DatabaseMetadataWrapper databaseMetadata) { this.databaseMetadata = databaseMetadata; }
0
if ((ob != null) && (ob.lastrendered != null) && (ob.lastrendered.equals(uri))) { ne.rendered = true; return null; } if ((oldKey == null || !oldKey.equals(key)) && (--free == 0)) { free = entries.length; int newCapacity = free << 2; rehash(newCapacity);
0
* @version CVS $Id: EP_Name.java,v 1.4 2004/01/31 08:50:39 antonio Exp $ public class EP_Name extends BaseElementProcessor { public EP_Name() {
0
import org.apache.http.annotation.Immutable; @Immutable // assuming injected dependencies are immutable
0
final String digest) {
0
port, TCompactProtocol.Factory.class, prop);
0
public List<Header> formatCookies(List<Cookie> cookies) { if (cookies.size() > 1) { // Create a mutable copy and sort the copy. cookies = new ArrayList<Cookie>(cookies); Collections.sort(cookies, PATH_COMPARATOR); }
0
private static final String BASEDIR = XMLSignature sig = doc, null, XMLSignature.ALGO_ID_MAC_HMAC_SHA1, File file = new File(BASEDIR + SEP + "src/test/resources" + SEP + "javax" + SEP + "xml"
1
LogEntry logEntry = new LogEntry(); logEntry.fromBytes(logInfo); logs.add(logEntry.logSet); log.debug("root tablet logSet " + logEntry.logSet); public void unassign(Collection<TabletLocationState> tablets) throws DistributedStoreException {
0
* {@code null} if nonexistent * possibly {@code null} if the entry should be deleted
0
components.registerEnvironment(Environment.newBuilder().setUrl("java").build()); components.registerEnvironment(Environment.newBuilder().setUrl("java").build()); components.registerEnvironment(Environment.newBuilder().setUrl("java").build()); components.registerEnvironment(Environment.newBuilder().setUrl("java").build()); components.registerEnvironment(Environment.newBuilder().setUrl("java").build()); components.registerEnvironment(Environment.newBuilder().setUrl("java").build());
0
import org.apache.http.HttpHeaders; if (!request.containsHeader(HttpHeaders.HOST)) { request.addHeader(HttpHeaders.HOST, targethost.toHostString());
0
import org.apache.ambari.logsearch.config.api.model.inputconfig.InputConfig; public InputConfig getInputConfig(String clusterName, String serviceName) {
0
private final Log log = LogFactory.getLog(Jira339TestCase.class);
0
public Map<String, Object> getWidgetsDescriptorForService(StackInfo stackInfo, String serviceName) public Map<String, Object> getWidgetsDescriptorForCluster(StackInfo stackInfo)
0
import org.junit.Assert;
0
import org.apache.ambari.server.orm.dao.HostDAO; import org.apache.ambari.server.orm.entities.HostEntity; * {@inheritDoc} */ @Override public String[] getCompatibleVersions() { return new String[] {"1.7.*", "2.0.*"}; } /** HostDAO hostDAO = injector.getInstance(HostDAO.class); HostEntity hostToBeDeleted = hostDAO.findByName(hcStateToBeDeleted.getHostName()); if (hostToBeDeleted == null) { continue; }
0
return supportUpdates ? createConnectedSubConfiguration(key) : createIndependentSubConfiguration(key); * Creates a connected sub configuration based on a selector for a tracked * node. * * @param selector the {@code NodeSelector} * @param parentModel the parent node model * @return the newly created sub configuration * @since 2.0 */ protected SubnodeConfiguration createSubConfigurationForTrackedNode( NodeSelector selector, InMemoryNodeModel parentModel) { SubnodeConfiguration subConfig = new SubnodeConfiguration(this, new TrackedNodeModel( parentModel, selector, true)); initSubConfigurationForThisParent(subConfig); return subConfig; } /** * Initializes a {@code SubnodeConfiguration} object. This method should be * called for each sub configuration created for this configuration. It * ensures that the sub configuration is correctly connected to its parent * instance and that update events are correctly propagated. * * @param subConfig the sub configuration to be initialized * @since 2.0 */ protected void initSubConfigurationForThisParent(SubnodeConfiguration subConfig) { initSubConfiguration(subConfig); subConfig.addConfigurationListener(changeListener); } /** BaseHierarchicalConfiguration sub = new BaseHierarchicalConfiguration(new InMemoryNodeModel( targetNodes.get(0))); initSubConfiguration(sub); return sub;
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override
0
import org.apache.commons.beanutils.BeanUtilsTestCase; if (BeanUtilsTestCase.isPre14JVM()) { if (BeanUtilsTestCase.isPre14JVM()) {
0
Object o = helloWorldClass.getDeclaredConstructor().newInstance();
0
import org.apache.http.impl.io.HttpTransportMetricsImpl; import org.apache.http.impl.nio.reactor.SessionOutputBuffer; ByteArrayOutputStream baos = new ByteArrayOutputStream(); WritableByteChannel channel = newChannel(baos); SessionOutputBuffer outbuf = new SessionOutputBuffer(1024, 128); HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl(); IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics); WritableByteChannel channel = newChannel(baos); SessionOutputBuffer outbuf = new SessionOutputBuffer(1024, 128); HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl(); IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics); WritableByteChannel channel = newChannel(baos); SessionOutputBuffer outbuf = new SessionOutputBuffer(1024, 128); HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl(); IdentityEncoder encoder = new IdentityEncoder(channel, outbuf, metrics); ByteArrayOutputStream baos = new ByteArrayOutputStream(); WritableByteChannel channel = newChannel(baos); SessionOutputBuffer outbuf = new SessionOutputBuffer(1024, 128); try { new IdentityEncoder(null, null, null); fail("IllegalArgumentException should have been thrown"); } catch (IllegalArgumentException ex) { // ignore } new IdentityEncoder(channel, null, null); fail("IllegalArgumentException should have been thrown"); } catch (IllegalArgumentException ex) { // ignore } try { new IdentityEncoder(channel, outbuf, null);
0
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); root.paint(g); BridgeContext ctx = new BridgeContext(userAgent);
0
FlinkRunner.class, TestFlinkRunner.class);
0
import org.apache.accumulo.core.client.impl.BaseIteratorEnvironment; IteratorEnvironment env = new BaseIteratorEnvironment();
1
Session session = getSession(); Buffer buf = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_OPEN_FAILURE, Long.SIZE + GenericUtils.length(message) + GenericUtils.length(lang)); Buffer rsp = session.createBuffer(cmd, 2); session.writePacket(rsp);
0
import java.security.AlgorithmParameters; import java.security.GeneralSecurityException; import java.security.spec.ECGenParameterSpec; private final static String ver = System.getProperty("java.version"); private final static boolean atLeast18 = !ver.startsWith("1.5") && !ver.startsWith("1.6") && !ver.startsWith("1.7"); private Method encodePoint, decodePoint; String className = atLeast18 ? "sun.security.util.ECUtil" : "sun.security.ec.ECParameters"; Class<?> c = ClassLoaderUtils.loadClass(className, DOMKeyValue.class); String oid = getCurveName(ecParams); } catch (GeneralSecurityException gse) { throw new MarshalException(gse); private static String getCurveName(ECParameterSpec spec) throws GeneralSecurityException { AlgorithmParameters ap = AlgorithmParameters.getInstance("EC"); ap.init(spec); ECGenParameterSpec nameSpec = ap.getParameterSpec(ECGenParameterSpec.class); if (nameSpec == null) { return null; } return nameSpec.getName(); } ecParams = getECParameterSpec(oid); } catch (GeneralSecurityException gse) { throw new MarshalException(gse); private static ECParameterSpec getECParameterSpec(String name) throws GeneralSecurityException { AlgorithmParameters ap = AlgorithmParameters.getInstance("EC"); ap.init(new ECGenParameterSpec(name)); return ap.getParameterSpec(ECParameterSpec.class); }
0
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
import java.nio.channels.Channel; import java.nio.file.FileSystem; @Test public void testNewByteChannelProviderMismatchException() throws IOException { RootedFileSystemProvider provider = new RootedFileSystemProvider(); Path tempFolder = assertHierarchyTargetFolderExists(getTempTargetFolder()); Path file = Files.createTempFile(tempFolder, getCurrentTestName(), ".txt"); try (FileSystem fs = provider.newFileSystem(tempFolder, Collections.<String, Object>emptyMap()); Channel channel = provider.newByteChannel(fs.getPath(file.getFileName().toString()), Collections.<OpenOption>emptySet())) { assertTrue("Channel not open", channel.isOpen()); } }
0
import java.nio.charset.StandardCharsets; value = new String(v, StandardCharsets.UTF_8);
0
/* * Copyright (C) 1993-2003 SEAGULL * * AllTests.java * Created on Nov 5, 2003, 8:25:55 PM * */ package org.apache.commons.codec.language; import junit.framework.Test; import junit.framework.TestSuite; /** * Tests all test cases in this package. * * @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a> * @version $Id: AllTests.java,v 1.1 2003/11/06 16:31:47 ggregory Exp $ */ public class AllTests { public static Test suite() { TestSuite suite = new TestSuite("Test for org.apache.commons.codec.language"); //$JUnit-BEGIN$ suite.addTest(MetaphoneTest.suite()); suite.addTest(SoundexTest.suite()); suite.addTest(RefinedSoundexTest.suite()); suite.addTest(DoubleMetaphoneTest.suite()); //$JUnit-END$ return suite; } }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/DoubleCollectionCollection.java,v 1.2 2003/08/31 17:21:17 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.2 $ $Date: 2003/08/31 17:21:17 $
0
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
0
public void visitStackMap(StackMap obj){ tostring = toString(obj); }
0
+ "basePath = %s, fileName = %s: %s", basePath, fileName, e));
0
import org.apache.xml.security.utils.RFC2253Parser;
0
return new ArrayList<>();
1
* <p> * This parser should be used to parse request messages on the server server. return new BufferedHeader(buffer, true);
0
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
0
@SuppressWarnings("AssertEqualsBetweenInconvertibleTypes") JexlScript script = JEXL.createScript("#pragma one 1\n#pragma the.very.hard 'truth'\n2;"); Assert.assertTrue(script != null); Map<String, Object> pragmas = script.getPragmas(); Assert.assertEquals(2, pragmas.size()); Assert.assertEquals(1, pragmas.get("one")); Assert.assertEquals("truth", pragmas.get("the.very.hard")); @SuppressWarnings("AssertEqualsBetweenInconvertibleTypes") JxltEngine engine = new JexlBuilder().create().createJxltEngine(); JxltEngine.Template tscript = engine.createTemplate("$$ #pragma one 1\n$$ #pragma the.very.hard 'truth'\n2;"); Assert.assertTrue(tscript != null); Map<String, Object> pragmas = tscript.getPragmas(); Assert.assertEquals(2, pragmas.size()); Assert.assertEquals(1, pragmas.get("one")); Assert.assertEquals("truth", pragmas.get("the.very.hard"));
0
import java.util.Objects; import static java.util.Objects.requireNonNull; this.taskGroupBackoff = requireNonNull(taskGroupBackoff); this.rateLimiter = requireNonNull(rateLimiter); this.executor = requireNonNull(executor); requireNonNull(rateLimiter); requireNonNull(taskScheduler); this.backoff = requireNonNull(backoff); this.rescheduleCalculator = requireNonNull(rescheduleCalculator); return Objects.hash(canonicalTask); return Objects.equals(canonicalTask, other.canonicalTask);
0
import static org.apache.aurora.scheduler.updater.StateEvaluator.Result.EVALUATE_AFTER_MIN_RUNNING_MS; f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, ASSIGNED, STARTING, RUNNING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, KILLING); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, PENDING, ASSIGNED, STARTING, RUNNING);
0
JCEMapper.translateURItoJCEID(EncryptionConstants.ALGO_ID_KEYWRAP_AES128) != null; return mapKeyName(keyName.getKeyName()); if (cert != null && cert.getSerialNumber().toString().equals(rsaCertSerialNumber)) { kek = rsaKey; assertTrue(cc, cc!= null && cc.equals(cardNumber)); "Node count mismatches", myNodeCount > 0 && myNodeCount == nodeCount
0
import org.slf4j.LoggerFactory; import org.slf4j.Logger; private final Logger connLog = LoggerFactory.getLogger("org.apache.hc.core5.http.connection");
0
@Test public void testInflateDeflateRoundTrip() throws CodingException { Identity original = new Identity("aurora", "jsmith"); byte[] deflated = ThriftBinaryCodec.deflateNonNull(original); Identity inflated = ThriftBinaryCodec.inflateNonNull(Identity.class, deflated); assertEquals(original, inflated); }
0
/* .setAllowedOrigins("*") .withSockJS();
0
public HostRequest getHostRequest() { return hostRequest; }
0
// Estimate of overhead per StateId. private static final int PER_STATE_ID_OVERHEAD = 20; // Initial size of hash tables per entry. private static final int INITIAL_HASH_MAP_CAPACITY = 4; // Overhead of each hash map entry. private static final int HASH_MAP_ENTRY_OVERHEAD = 16; // Overhead of each cache entry. Two longs, plus a hash table. private static final int PER_CACHE_ENTRY_OVERHEAD = 16 + HASH_MAP_ENTRY_OVERHEAD * INITIAL_HASH_MAP_CAPACITY; private int displayedWeight = 0; // Only used for status pages and unit tests. displayedWeight -= weigher.weigh(removal.getKey(), removal.getValue()); return displayedWeight; this.displayedWeight += id.getWeight(); this.displayedWeight += entry.getWeight(); this.displayedWeight += entry.put(namespace, address, value, weight); return processingKey.size() + PER_STATE_ID_OVERHEAD; this.values = new HashMap<>(INITIAL_HASH_MAP_CAPACITY); weightDelta += HASH_MAP_ENTRY_OVERHEAD; return weight + PER_CACHE_ENTRY_OVERHEAD;
0
import java.util.Random; import org.apache.accumulo.core.client.BatchWriterConfig; BatchWriter bw = getConnector().createBatchWriter("bwlt", new BatchWriterConfig()); BatchWriter bw = getConnector().createBatchWriter("bwft", new BatchWriterConfig());
0
return new ClusterBuilder(this); /** * Constructor. * * @param grouping * the upgrade/downgrade grouping (not {@code null}). */ private ClusterBuilder(Grouping grouping) { super(grouping); } /** * {@inheritDoc} */ public List<StageWrapper> build(UpgradeContext upgradeContext, List<StageWrapper> stageWrappers) { return stageWrappers; List<StageWrapper> results = new ArrayList<StageWrapper>(stageWrappers); if (null != execution.intendedDirection && execution.intendedDirection != upgradeContext.getDirection()) { wrapper = getManualStageWrapper(upgradeContext, execution); wrapper = getExecuteStageWrapper(upgradeContext, execution);
0
public static final String TIMELINE_METRICS_HOST_INMEMORY_AGGREGATION = "timeline.metrics.host.inmemory.aggregation";
0
* Copyright 2016 Seznam.cz, a.s.
0
import com.twitter.aurora.scheduler.storage.entities.IJobConfiguration; * An action that either accepts a configuration or rejects it with a reason. JobFilterResult filter(IJobConfiguration jobConfiguration);
0
private static final ObjectType GENERIC_ARRAY = new ObjectType("org.apache.bcel.verifier.structurals.GenericArray");
0
import org.apache.ambari.server.orm.OrmTestHelper; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; StackId stackId = new StackId("HDP-2.0.6"); OrmTestHelper helper = injector.getInstance(OrmTestHelper.class); helper.createStack(stackId); RepositoryVersionEntity repositoryVersion = helper.getOrCreateRepositoryVersion(stackId, "2.0.6"); clusters.addCluster(clusterName, stackId); cluster.addService("FLUME", repositoryVersion); cluster.addService("OOZIE", repositoryVersion); ServiceComponent sc = createNiceMock(ServiceComponent.class); expect(sc.getDesiredStackId()).andReturn(cluster.getDesiredStackVersion()).anyTimes(); expect(sch.getServiceComponent()).andReturn(sc).anyTimes(); replay(sc, sch); Service mockService = createStrictMock(Service.class); expect(mockCluster.getService("SERVICE")).andReturn(mockService).once(); expect(mockService.getDesiredStackId()).andReturn(mockStackVersion).once(); replay(mockAmbariMetaInfo, mockCluster, mockService, mockStackVersion, mockServiceInfo, mockPropertyInfo1, mockPropertyInfo2);
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger LOG = LoggerFactory.getLogger(KafkaUtils.class); LOG.debug("Failed to retrieve offsets on {}:{}: {}", new Object[]{server, port, e});
0