Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components"); ComponentFactory cf = new ComponentFactory(getContext(), getNothing()); ComponentFactory cf = new ComponentFactory(getContext(), getNoField()); ComponentFactory cf = new ComponentFactory(getContext(), getBadField()); ComponentFactory cf = new ComponentFactory(getContext(), getBadFilter()); ComponentFactory cf = new ComponentFactory(getContext(), getBadFrom()); ComponentFactory cf = new ComponentFactory(getContext(), getBadType());
0
import org.apache.zookeeper.AsyncCallback.MultiCallback; public void commit(MultiCallback cb, Object ctx) { zk.multi(ops, cb, ctx); }
0
String inAttr = filterElement.getAttributeNS(null, SVG_IN_ATTRIBUTE);
0
static final TimelineMetricReadHelper TIMELINE_METRIC_READ_HELPER = new TimelineMetricReadHelper(); static ObjectMapper mapper = new ObjectMapper(); static TypeReference<TreeMap<Long, Double>> metricValuesTypeRef = new TypeReference<TreeMap<Long, Double>>() {};
0
import org.apache.cocoon.core.Settings;
0
@Override @Override
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
final CRC32 crc32 = new CRC32(); final StringEntity wrapped = new StringEntity("1234567890", "ASCII"); final ChecksumEntity entity = new ChecksumEntity(wrapped, crc32); final String s = EntityUtils.toString(entity); final InputStream in1 = entity.getContent(); final InputStream in2 = entity.getContent(); final CRC32 crc32 = new CRC32(); final ByteArrayInputStream in = new ByteArrayInputStream("1234567890".getBytes("ASCII")); final InputStreamEntity wrapped = new InputStreamEntity(in, -1); final ChecksumEntity entity = new ChecksumEntity(wrapped, crc32); final String s = EntityUtils.toString(entity); final InputStream in1 = entity.getContent(); final InputStream in2 = entity.getContent(); final CRC32 crc32 = new CRC32(); final StringEntity wrapped = new StringEntity("1234567890", "ASCII"); final ChecksumEntity entity = new ChecksumEntity(wrapped, crc32); final ByteArrayOutputStream out = new ByteArrayOutputStream(); final String s = new String(out.toByteArray(), "ASCII");
0
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
@Deprecated
0
extends AbstractSVGGradientElementBridge { * Returns 'linearGradient'. */ public String getLocalName() { return SVG_LINEAR_GRADIENT_TAG; } /**
0
import org.apache.commons.vfs2.provider.AbstractFileName; protected WebdavFileObject(final AbstractFileName name, final WebdavFileSystem fileSystem)
0
private String salesDBName; @Test public void testSchemaForDB() throws Exception { WebResource resource = service.path(BASE_URI).path(salesDBName).path("schema"); ClientResponse clientResponse = resource.accept(Servlets.JSON_MEDIA_TYPE).type(Servlets.JSON_MEDIA_TYPE) .method(HttpMethod.GET, ClientResponse.class); Assert.assertEquals(clientResponse.getStatus(), Response.Status.NOT_FOUND.getStatusCode()); } salesDBName = "Sales" + randomString(); Id salesDB = database(salesDBName, "Sales Database", "John ETL",
0
import java.util.ArrayList; import java.util.List; import org.apache.xml.security.utils.resolver.ResourceResolverSpi; import org.apache.xml.security.utils.resolver.implementations.ResolverDirectHTTP; import org.apache.xml.security.utils.resolver.implementations.ResolverFragment; import org.apache.xml.security.utils.resolver.implementations.ResolverLocalFilesystem; import org.apache.xml.security.utils.resolver.implementations.ResolverXPointer; private static List<ResourceResolverSpi> defaultResolverList = new ArrayList<ResourceResolverSpi>(); // // Default Resolvers // defaultResolverList.add(new ResolverFragment()); defaultResolverList.add(new ResolverLocalFilesystem()); defaultResolverList.add(new ResolverXPointer()); defaultResolverList.add(new ResolverDirectHTTP()); for (ResourceResolverSpi resourceResolverSpi : defaultResolverList) { ResourceResolver.register(resourceResolverSpi, false); }
0
throw new UnsupportedOperationException("loadKeys(files) Iterator#remove() N/A");
0
Copyright 2001,2003 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. */
0
private int writeTimeout; this.writeTimeout = 0; request.setWriteTimeout(this.writeTimeout); public void setWriteTimeout(int writeTimeout) { this.writeTimeout = writeTimeout; }
0
/* * Copyright (C) 2015 Google 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. */ package com.google.cloud.dataflow.sdk.util.common.worker; /** * Abstract interface that counts elements processed. */ public interface ElementCounter { /** * Updates output counters. */ public void update(Object elem) throws Exception; /** * Finishes output counters lazy updates. */ public void finishLazyUpdate(Object elem); }
0
// If values are not defined in stack (null), we skip them // Or if values in old stack and in new stack are the same, and value // in current config is different, skip it if (!(newStackVal == null && oldStackVal == null) && !newStackVal.equals(savedVal) &&
0
* Copyright 2002,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 $
0
import org.apache.commons.vfs.provider.http.HttpFileNameParser; setFileNameParser(HttpFileNameParser.getInstance());
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
import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; // release all references to external objects rootMetricsContext.gauges.clear(); private final ConcurrentMap<String, Gauge> gauges = new ConcurrentHashMap<>(); // no hierarchy yet public void registerGauge(String name, Gauge gauge) { Objects.requireNonNull(gauge, "Cannot register a null Gauge for "+name); gauges.put(name, gauge); } @Override public void unregisterGauge(String name) { gauges.remove(name); gauges.forEach((name, metric) -> { Number value = metric.get(); if (value != null) { sink.accept(name, value); } }); // no need to reset gauges
0
LogService.LOG_DEBUG,
0
import com.google.auto.value.AutoValue; return new AutoValue_AvroIO_Read.Builder<T>().build(); return new AutoValue_AvroIO_Read.Builder<GenericRecord>() .setRecordClass(GenericRecord.class) .setSchema(schema) .build(); @AutoValue public abstract static class Read<T> extends PTransform<PBegin, PCollection<T>> { @Nullable abstract String getFilepattern(); @Nullable abstract Class<T> getRecordClass(); @Nullable abstract Schema getSchema(); abstract Builder<T> toBuilder(); @AutoValue.Builder abstract static class Builder<T> { abstract Builder<T> setFilepattern(String filepattern); abstract Builder<T> setRecordClass(Class<T> recordClass); abstract Builder<T> setSchema(Schema schema); abstract Read<T> build(); return toBuilder().setFilepattern(filepattern).build(); return toBuilder().setRecordClass(type).setSchema(ReflectData.get().getSchema(type)).build(); if (getFilepattern() == null) { if (getSchema() == null) { getRecordClass() == GenericRecord.class AvroSource.from(getFilepattern()).withSchema(getSchema())) AvroSource.from(getFilepattern()).withSchema(getRecordClass())); .addIfNotNull(DisplayData.item("filePattern", getFilepattern()) return AvroCoder.of(getRecordClass(), getSchema());
0
// super type attributes referenceable.set("inputs", inputTables); referenceable.set("outputs", outputTables);
0
if (!(obj instanceof User)) { return false; }
0
/** import org.apache.ambari.server.security.authorization.ClusterInheritedPermissionHelper; import com.google.common.collect.FluentIterable; List<String> permissions = autoInstanceConfig.getPermissions(); addClusterInheritedPermissions(viewInstanceEntity, permissions); * Validates principalTypes and creates privilege entities for each permission type for the view instance entity * resource. * @param viewInstanceEntity - view instance entity for which permission has to be set. * @param principalTypes - list of cluster inherited principal types private void addClusterInheritedPermissions(ViewInstanceEntity viewInstanceEntity, List<String> principalTypes) { List<String> validPermissions = FluentIterable.from(principalTypes) .filter(ClusterInheritedPermissionHelper.validPrincipalTypePredicate) .toList(); for(String permission: validPermissions) { addClusterInheritedPermission(viewInstanceEntity, permission); } } private void addClusterInheritedPermission(ViewInstanceEntity viewInstanceEntity, String principalType) { ResourceEntity resource = viewInstanceEntity.getResource(); List<PrincipalEntity> principals = principalDAO.findByPrincipalType(principalType); if (principals.size() == 0) { LOG.error("Failed to find principal for principal type '{}'", principalType); return; } PrincipalEntity principal = principals.get(0); // There will be only one principal associated with the principal type PermissionEntity permission = permissionDAO.findViewUsePermission(); if (!privilegeDAO.exists(principal, resource, permission)) { PrivilegeEntity privilege = new PrivilegeEntity(); privilege.setPrincipal(principal); privilege.setResource(resource); privilege.setPermission(permission); privilegeDAO.create(privilege);
0
* @version CVS $Id: EffectWidgetReplacingPipe.java,v 1.9 2004/04/12 14:05:09 tim Exp $
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/>. * */ package org.apache.hc.client5.http.conn.ssl; public class SSLInitializationException extends IllegalStateException { private static final long serialVersionUID = -8243587425648536702L; public SSLInitializationException(final String message, final Throwable cause) { super(message, cause); } }
0
public int hashCode() { // uncomment when JDK 1.4 is required // assert false : "hashCode not designed"; return 51; }
0
* Copyright (c) OSGi Alliance (2010, 2017). All Rights Reserved. * @author $Id: a2bc7aac583601ace28b252fdf4ae9a53ce32a9a $ throw new IllegalArgumentException("invalid filter", e); @Override map.put("id", Long.valueOf(bundle.getBundleId()));
1
SerializableFunction<Row, T> fromRowFunction) { SerializableFunction<Row, T> fromRowFunction) {
0
* Copyright 2015 Google Inc. All Rights Reserved.
0
LOG.debug("Creating type with definition {} ", typeDefinition);
0
sessions.remove(session); // Create a copy, as calling session.close() will remove the session from the map CommandSession[] toClose = this.sessions.keySet().toArray(new CommandSession[this.sessions.size()]); for (CommandSession session : toClose) // Just in case...
0
public static final String ID_PREFIX_IMAGE = "image"; public static final String ID_PREFIX_IMAGE_DEFS = "imageDefs"; public static final String DATA_PROTOCOL_PNG_PREFIX = "data:image/png;base64,";
0
import org.apache.beam.sdk.options.PipelineOptionsFactory; @Test public void testUserScoreOptions() { PipelineOptionsFactory.as(HourlyTeamScore.Options.class); }
0
final AccumuloClient client = context.getClient(); final String tableId = client.tableOperations().tableIdMap().get(tableName); final AccumuloClient client = getClient(); final Table.ID tableId = Table.ID.of(client.tableOperations().tableIdMap().get(tableName)); try (Scanner s = client.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { final AccumuloClient client = getClient(); final String tableId = client.tableOperations().tableIdMap().get(tableName); try (Scanner s = client.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { final AccumuloClient client = getClient(); ReplicationTable.setOnline(client); client.tableOperations().create(table); client.tableOperations().setProperty(table, Property.TABLE_REPLICATION.getKey(), "true"); BatchWriter bw = client.createBatchWriter(table, null); client.tableOperations().flush(table, null, null, true); client.tableOperations().flush(MetadataTable.NAME, null, null, true); client.tableOperations().compact(table, null, null, false, true); final AccumuloClient client = getClient(); ReplicationTable.setOnline(client); client.tableOperations().create(table); client.tableOperations().setProperty(table, Property.TABLE_REPLICATION.getKey(), "true"); BatchWriter bw = client.createBatchWriter(table, null); client.tableOperations().flush(table, null, null, true); client.tableOperations().flush(MetadataTable.NAME, null, null, true); client.tableOperations().compact(table, null, null, false, true); client.tableOperations().create(otherTable); bw = client.createBatchWriter(otherTable, null); client.tableOperations().flush(otherTable, null, null, true); cli -> cli.getActiveTservers(Tracer.traceInfo(), context.rpcCreds())); Client cli = ThriftUtil.getTServerClient(tserver, context); List<String> activeWalsForTserver = cli.getActiveLogs(Tracer.traceInfo(), context.rpcCreds());
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.cocoon.core.xml.avalon; import java.io.IOException; import org.apache.excalibur.xml.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** * A wrapper implementation to support the Excalibur XML interfaces. * * @version $Id$ * @since 2.2 */ public class DefaultResolver implements EntityResolver { protected org.xml.sax.EntityResolver resolver; public void setResolver(org.xml.sax.EntityResolver resolver) { this.resolver = resolver; } public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { return this.resolver.resolveEntity(publicId, systemId); } }
0
Copyright 2000-2001 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. */
0
* @version $Id$
0
* @param beanClass to register * @param beanClass to register * @param dynamicPropertyHandlerClass to handle beanClass public static void registerDynamicClass(Class beanClass, Class dynamicPropertyHandlerClass) { * Creates and registers a JXPathBeanInfo object for the supplied class. If * @param beanClass whose info to get * @return JXPathBeanInfo * @param beanClass to search for * @return JXPathBeanInfo Class[] interfaces = beanClass.getInterfaces(); /** * find a JXPathBeanInfo instance for the specified class. * Similar to javax.beans property handler discovery; search for a * class with "XBeanInfo" appended to beanClass.name, then check * whether beanClass implements JXPathBeanInfo for itself. * Invokes the default constructor for any class it finds. * @param beanClass for which to look for an info provider * @return JXPathBeanInfo instance or null if none found */ * @param sibling Class * @param className to instantiate * @return new Object * @throws Exception if instantiation fails throws Exception {
0
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
0
* {@link org.apache.beam.sdk.transforms.windowing.Window.Assign}.
0
* Copyright 2001-2005 The Apache Software Foundation. import java.util.Iterator; for (Iterator it = node.getAttributes().iterator(); it.hasNext();) Node child = (Node) it.next(); if (child.getValue() != null) String attr = child.getName(); return node.isAttribute();
0
if (decoderLength < 5 || decoderLength > (256 * 1024)) {
0
/* * Copyright 1999-2002,2004-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.portal.event.aspect; import java.util.Map; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.portal.PortalService; import org.apache.cocoon.portal.event.EventConverter; /** * * @version $Id$ */ public interface EventAspectContext { /** * Invoke next aspect */ void invokeNext(PortalService service); /** * Get the {@link Parameters} of the aspect. */ Parameters getAspectParameters(); /** * Get the encoder */ EventConverter getEventConverter(); /** * Get the object model */ Map getObjectModel(); }
0
* @param dStart gradient start point, in user space * @param dEnd gradient end point, in user space
0
import org.apache.cocoon.forms.transformation.FormPipelineConfig; this.wrapperContextMap.put(FormPipelineConfig.COCOONFORM, this.form);
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
final AbstractSession s = this; log.info("Session {}@{} closed", s.getUsername(), s.getIoSession().getRemoteAddress()); log.debug("Closing session"); log.debug("Send SSH_MSG_NEWKEYS"); log.debug("Received SSH_MSG_CHANNEL_OPEN_CONFIRMATION on channel {}", channel.getId()); log.debug("Received SSH_MSG_CHANNEL_OPEN_FAILURE on channel {}", channel.getId());
0
/** * * @version $Id$ */
0
import org.apache.cocoon.configuration.MutableSettings;
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.services; import java.util.Properties; public interface FooService { boolean foo(); Properties fooProps(); Boolean getObject(); boolean getBoolean(); int getInt(); long getLong(); double getDouble(); }
0
void guaranteeThatElementInCorrectSpace(ElementProxy expected, Element actual) boolean isNamespaceElement(Node el, String type, String ns);
1
List<String> valueList = new ArrayList<String>(); array[i] = Boolean.valueOf( valueList[i] );
0
import java.util.function.Predicate; if (filter.test(entry.getKey())) {
0
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0
import java.io.Writer; import org.apache.commons.io.output.WriterOutputStream; import org.apache.commons.cli.CommandLine; /** * Will only be set if you use either the Writer constructor or the setWriter(Writer) method * @deprecated since 1.6.0; use out */ @Deprecated protected Writer writer = null; // we presume they don't use the writer field unless they use the other constructor. } /** * @deprecated since 1.6.0; use OutputStream version */ @Deprecated public MockShell(InputStream in, Writer out) throws IOException { this(in, new WriterOutputStream(out, Constants.UTF8.name())); this.writer = out; /** * @deprecated since 1.6.0; use ShellOptionsJC version */ @Deprecated protected void setInstance(CommandLine cl) { // same result as in previous version setInstance((ShellOptionsJC)null); } /** * @deprecated since 1.6.0; use the OutputStream version */ @Deprecated public void setConsoleWriter(Writer out) { setConsoleWriter(new WriterOutputStream(out, Constants.UTF8.name())); this.writer = out; }
0
/** Returns the current range. */ public synchronized ByteKeyRange getRange() { return range; } if (position == null) { range = range.withStartKey(recordStart); }
0
import java.util.logging.Logger; private static final Logger LOG = Logger.getLogger(DefaultJDBCLock.class.getName()); LOG.addHandler(BootstrapLogManager.getDefaultHandler()); LOG.warning("Could not obtain connection: " + e.getMessage()); LOG.severe("Cleaning up DB connection."); LOG.severe("Caught while closing statement: " + e1.getMessage()); LOG.info("Connected to data source: " + url); LOG.severe("Could not set DB update cursor"); LOG.warning("Failed to acquire database lock: " + e.getMessage()); LOG.severe("Failed to close statement" + e); LOG.severe("Lost lock!"); LOG.severe("Error occured while testing lock: " + ex + " " + ex.getMessage()); LOG.severe("Error occured after testing lock: " + ex1.getMessage()); LOG.severe("Error occured while setting up JDBC connection: " + e);
0
BenchmarkConnection conn = new BenchmarkConnection(stats, request.getParams()); conn.bind(socket);
0
upgradeCatalog.updateConfigurationProperties("oozie-env", Collections.singletonMap("oozie_admin_port", "11001"), false, false); expectLastCall();
0
import org.apache.ambari.server.stack.upgrade.UpgradeType;
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
import java.util.Map; import java.util.Set; factory.getConfiguration(true); factory.getConfiguration(true); System.getProperties().remove("Id");
0
protected volatile boolean running; LOG.warn("unable to parse zxid string into long: " + nameParts[1]); FileInputStream snapFIS = new FileInputStream(f); try { InputStream snapIS = new BufferedInputStream(snapFIS); try { loadData(BinaryInputArchive.getArchive(snapIS)); } finally { snapIS.close(); } } finally { snapFIS.close(); } File f = new File(dataDir, "snapshot." + Long.toHexString(lastZxid)); try { BinaryOutputArchive oa = BinaryOutputArchive.getArchive(sessOS); snapshot(oa); sessOS.flush(); } finally { sessOS.close(); } running = true;
0
import org.apache.accumulo.core.client.IteratorSetting; static private final String SLEEP_TIME = "sleepTime"; public static void setSleepTime(IteratorSetting is, long millis) { is.addOption(SLEEP_TIME, Long.toString(millis)); } sleepTime = Long.parseLong(options.get(SLEEP_TIME));
0
/* * Copyright 2000-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. */ package org.apache.bcel.classfile;
0
package org.apache.felix.karaf.shell.ssh;
0
return ADD_PRECEDENCE;
0
import org.apache.accumulo.core.conf.DefaultConfiguration; private static final long CACHE_BLOCK_SIZE = DefaultConfiguration.getInstance().getAsBytes(Property.TSERV_DEFAULT_BLOCKSIZE); DefaultConfiguration.getInstance())));
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 * 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
events = events.apply(name + ".CpuDelay", NexmarkUtils.cpuDelay(name, configuration.cpuDelayMs)); events = events.apply(name + ".DiskBusy", NexmarkUtils.diskBusy(configuration.diskBusyBytes));
0
super(message); exception = null; exception = e; super(message); exception = e; String message = super.getMessage(); if (message == null && exception != null) { return exception.getMessage(); } else { return message; } return exception;
1
package org.apache.beam.sdk.extensions.euphoria.fluent; import org.apache.beam.sdk.extensions.euphoria.core.util.Settings; public static <T> Dataset<T> lift(org.apache.beam.sdk.extensions.euphoria.core.client.dataset.Dataset<T> xs) {
0
* <p>Currently this implementation is specific to how Calcite parses 'TIMESTAMPDIFF(..)'. It * converts the TIMESTAMPDIFF() call into infix minus and normalizes it with corresponding * TimeUnit's multiplier. /** Requires exactly 2 operands. One should be a timestamp, another an interval */ Period period = new Period( timestampStart, timestampEnd, PeriodType.forFields(new DurationFieldType[] {durationFieldType(intervalType)})); throw new IllegalArgumentException( "Counting " + intervalTypeToCount.getName() + "s between dates is not supported");
0
@ManyToOne(cascade = CascadeType.PERSIST)
0
/* * $HeadURL$ * $Revision$ * $Date$ * ==================================================================== * * Copyright 1999-2006 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. * ==================================================================== * * 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/>. * */ package org.apache.http.cookie; import junit.framework.*; public class TestAllCookie extends TestCase { public TestAllCookie(String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(TestCookiePathComparator.suite()); return suite; } public static void main(String args[]) { String[] testCaseName = { TestAllCookie.class.getName() }; junit.textui.TestRunner.main(testCaseName); } }
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkNotNull; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Maps;
0
import org.apache.accumulo.core.util.UnsynchronizedBuffer; final byte[] timeBuffer = new byte[9]; UnsynchronizedBuffer.writeVLong(out, timeBuffer, systemTime);
0
List<Order> sortOrders = new ArrayList<>(sortProperties.size());
0
public final synchronized void setLogLevel(int i) public final synchronized int getLogLevel()
0
import java.util.ArrayList; import java.util.Collection; import java.util.List; Collection<T> build(Collection<? extends ServletState> whiteboardServices, long servletContextId) { List<T> dtoList = new ArrayList<T>(); for (ServletState whiteboardService : whiteboardServices) { if ( whiteboardService.getPatterns().length > 0 && whiteboardService.getServletInfo().isResource() ) { dtoList.add(buildDTO(whiteboardService, servletContextId)); } } return dtoList; } @Override
0
if (!tokenizer.hasMoreElements()) { } if (!tokenizer.hasMoreElements()) { } if (!tokenizer.hasMoreElements()) { } if (!tokenizer.hasMoreElements()) { } if (getState() != AUTHORIZATION_STATE) { } if (sendCommand(POP3Command.USER, username) != POP3Reply.OK) { } if (sendCommand(POP3Command.PASS, password) != POP3Reply.OK) { } if (getState() != AUTHORIZATION_STATE) { } if (digit <= 15) { // Add leading zero if necessary (NET-351) digestBuffer.append("0"); } if (sendCommand(POP3Command.APOP, buffer.toString()) != POP3Reply.OK) { } if (getState() == TRANSACTION_STATE) { } if (getState() == TRANSACTION_STATE) { } if (getState() == TRANSACTION_STATE) { } if (getState() == TRANSACTION_STATE) { } if (getState() != TRANSACTION_STATE) { } if (sendCommand(POP3Command.STAT) != POP3Reply.OK) { } if (getState() != TRANSACTION_STATE) { } != POP3Reply.OK) { } if (getState() != TRANSACTION_STATE) { } if (sendCommand(POP3Command.LIST) != POP3Reply.OK) { } for (int line = 0; line < messages.length; line++) { } if (getState() != TRANSACTION_STATE) { } != POP3Reply.OK) { } if (getState() != TRANSACTION_STATE) { } if (sendCommand(POP3Command.UIDL) != POP3Reply.OK) { } for (int line = 0; line < messages.length; line++) { }
1
* @author William Farner * TODO(William Farner): During a rollback, need to get the updated set of shard IDs since the update * TODO(William Farner): Need to make sure to issue a kill command to shards that are being removed. // TODO(William Farner): Can/should we do anything if this fails?
0
reuseStrategy = DefaultConnectionReuseStrategy.INSTANCE;
0
for (int bIndex = 0, uIndex = 0; (bIndex < builtin.size()) || (uIndex < unknown.size());) {
0
package com.twitter.aurora.scheduler.async; import com.twitter.aurora.scheduler.async.TaskGroups.GroupKey; private final GroupKey key; GroupKey getKey() { return key; } return key.toString();
1
import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import java.util.LinkedHashMap; when(stepContext .lookup(Mockito.<CodedTupleTag<Map<IntervalWindow, Set<Windmill.GlobalDataRequest>>>>any())) .thenReturn(blockedMap); when(stepContext.readTagLists( Mockito.<Iterable<CodedTupleTag<WindowedValue<String>>>>any())) .thenAnswer(readTagListAnswer(Arrays.asList(createDatum("e", 0)))); private <T> Answer<Map<CodedTupleTag<T>, Iterable<T>>> readTagListAnswer( final Iterable<T> answer) { return new Answer<Map<CodedTupleTag<T>, Iterable<T>>>() { @Override public Map<CodedTupleTag<T>, Iterable<T>> answer(InvocationOnMock invocation) throws Throwable { Map<CodedTupleTag<T>, Iterable<T>> result = new LinkedHashMap<>(); @SuppressWarnings("unchecked") Iterable<CodedTupleTag<T>> tags = (Iterable<CodedTupleTag<T>>) invocation.getArguments()[0]; for (CodedTupleTag<T> tag : tags) { result.put(tag, answer); } return result; } }; } when(stepContext.lookup( Mockito.<CodedTupleTag<Map<IntervalWindow, Set<Windmill.GlobalDataRequest>>>>any())) .thenReturn(blockedMap); when(stepContext.readTagLists( Mockito.<Iterable<CodedTupleTag<WindowedValue<String>>>>any())) .thenAnswer(readTagListAnswer(Arrays.asList(createDatum("e1", 0))));
0
@Test public void testTableDecoratorStripping() { TableDestination tableDestination = tableDestination = new TableDestination( "project:dataset.table$decorator", ""); assertEquals("project:dataset.table", tableDestination.getStrippedTableSpec()); tableDestination = new TableDestination("project:dataset.table", ""); assertEquals("project:dataset.table", tableDestination.getStrippedTableSpec()); }
0
package org.apache.commons.vfs2;
1
import org.apache.batik.constants.XMLConstants;
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/converters/URLConverterTestCase.java,v 1.3 2003/10/09 20:39:15 rdonkin Exp $ * $Revision: 1.3 $ * $Date: 2003/10/09 20:39:15 $ * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.3 $ $Date: 2003/10/09 20:39:15 $
0
import org.apache.ambari.server.stack.StackManagerFactory; private OsFamily osFamily; private AlertDefinitionDAO alertDefinitionDao; /** * Factory for injecting {@link StackManager} instances. */ private StackManagerFactory stackManagerFactory; /** * Singleton instance of the stack manager. */ private StackManager stackManager; String commonServicesPath = conf.getCommonServicesPath(); String serverVersionFilePath = conf.getServerVersionFilePath(); customActionRoot = new File(conf.getCustomActionDefinitionPath()); ALL_SUPPORTED_OS = new ArrayList<String>(osFamily.os_list()); stackManager = stackManagerFactory.create(stackRoot, commonServicesRoot, osFamily);
0
ResourceResolverSpi resolver = new OfflineResolver();; ResourceResolverSpi resolver = new OfflineResolver();
0
String hash(String storageKey);
0
* 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