Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.ambari.server.configuration.Configuration; @Inject private Configuration configs; int maxTaskTimeout = Integer.parseInt(configs.getDefaultAgentTaskTimeout(false)); if(maxTaskTimeout < actionContext.getTimeout()) { commandParams.put(COMMAND_TIMEOUT, Integer.toString(maxTaskTimeout)); } else { commandParams.put(COMMAND_TIMEOUT, actionContext.getTimeout().toString()); }
0
* Copyright (c) 2004 The Apache Software Foundation. All rights
0
import org.w3c.css.sac.SiblingSelector;
0
import org.apache.beam.sdk.testing.ValidatesRunner; @Category(ValidatesRunner.class) @Category(ValidatesRunner.class) @Category(ValidatesRunner.class)
0
return clone();
0
protected final byte type; public static final ObjectType OBJECT = ObjectType.getInstance("java.lang.Object"); public static final ObjectType CLASS = ObjectType.getInstance("java.lang.Class"); public static final ObjectType STRING = ObjectType.getInstance("java.lang.String"); public static final ObjectType STRINGBUFFER = ObjectType.getInstance("java.lang.StringBuffer"); public static final ObjectType THROWABLE = ObjectType.getInstance("java.lang.Throwable"); return ObjectType.getInstance(signature.substring(1, index).replace('/', '.')); return ObjectType.getInstance(cl.getName());
0
package org.apache.batik.bridge; import org.apache.batik.gvt.font.GVTFontFamily;
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.core5.http; import java.io.IOException; import java.net.Socket; /** * Factory for {@link HttpConnection} instances. * * @since 4.3 */ public interface HttpConnectionFactory<T extends HttpConnection> { T createConnection(Socket socket) throws IOException; }
1
String qName = (prefix == null || prefix.length() == 0) ? tag : prefix + ":" + tag;
0
import org.apache.accumulo.server.AccumuloServerContext; private final AccumuloServerContext context; * @param context * the collection server's context GarbageCollectWriteAheadLogs(AccumuloServerContext context, VolumeManager fs, boolean useTrash) throws IOException { this.context = context; return context.getInstance(); count = removeMetadataEntries(nameToFileMap, sortedWALogs, status); count = removeReplicationEntries(nameToFileMap, sortedWALogs, status); String zpath = ZooUtil.getRoot(context.getInstance()) + Constants.ZTSERVERS + "/" + addr.toString(); tserver = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, context); tserver.removeLogs(Tracer.traceInfo(), context.rpcCreds(), paths2strings(entry.getValue())); protected int removeMetadataEntries(Map<String,Path> nameToFileMap, Map<String,Path> sortedWALogs, GCStatus status) throws IOException, KeeperException, InterruptedException { Iterator<LogEntry> iterator = MetadataTableUtil.getLogEntries(context); protected int removeReplicationEntries(Map<String,Path> nameToFileMap, Map<String,Path> sortedWALogs, GCStatus status) throws IOException, KeeperException, InterruptedException { conn = context.getConnector();
1
import org.apache.aurora.scheduler.offers.HostOffer;
0
@SuppressWarnings({"rawtypes", "unchecked"})
0
readWriteLock.writeLock().lock(); try { this.configGroupEntity.setGroupName(name); } finally { readWriteLock.writeLock().unlock(); } readWriteLock.writeLock().lock(); try { this.configGroupEntity.setTag(tag); } finally { readWriteLock.writeLock().unlock(); } readWriteLock.writeLock().lock(); try { this.configGroupEntity.setDescription(description); } finally { readWriteLock.writeLock().unlock(); } readWriteLock.writeLock().lock(); try { this.hosts = hosts; } finally { readWriteLock.writeLock().unlock(); } readWriteLock.writeLock().lock(); try { this.configurations = configs; } finally { readWriteLock.writeLock().unlock(); }
0
import org.apache.atlas.AtlasServiceException; @Test(expectedExceptions = AtlasServiceException.class)
0
/** * Makes any necessary but nonexistent parent directories for a given File. If the parent directory cannot be * created then an IOException is thrown. * * @param file * file with parent to create, must not be {@code null} * @throws NullPointerException * if the file is {@code null} * @throws IOException * if the parent directory cannot be created * @since 2.5 */ public static void forceMkdirParent(final File file) throws IOException { final File parent = file.getParentFile(); if (parent == null) { return; } forceMkdir(parent); }
0
import java.util.Arrays; import java.util.concurrent.ExecutionException; /** Test {@code FlatMap} operator's integration with beam. */ final ListDataSource<Integer> input = ListDataSource.unbounded(Arrays.asList(1, 2, 3), Arrays.asList(2, 3, 4)); MapElements.of(flow.createInput(input)).using(i -> i + 1).output().persist(output); DatasetAssert.unorderedEquals(output.getOutputs(), 2, 3, 3, 4, 4, 5);
0
package org.apache.xml.security.algorithms.encryption.implementations.BC; import org.apache.xml.security.utils.EncryptionConstants; /** * * @author $Author$ */ public class BlockEncryptionImpl_AES128_BC extends BlockEncryptionImpl { public int engineGetIvLength() { return 16; } public String getImplementedAlgorithmURI() { return EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128; } public String getRequiredProviderName() { return "BC"; } }
0
int indexOfHash = line.indexOf('#'); if (indexOfHash >= 0) { line = line.substring(0, indexOfHash); } line = line.trim();
0
* @version $Revision$
0
import org.apache.accumulo.core.clientImpl.AcceptableThriftTableOperationException; import org.apache.accumulo.core.clientImpl.Namespace; import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.clientImpl.thrift.TableOperation; import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType;
0
import org.apache.cocoon.components.expression.ExpressionContext; import org.apache.cocoon.template.jxtg.environment.ExecutionContext; import org.apache.cocoon.template.jxtg.script.Invoker; import org.apache.cocoon.xml.XMLConsumer; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; public Event execute(final XMLConsumer consumer, ExpressionContext expressionContext, ExecutionContext executionContext, StartElement macroCall, Event startEvent, Event endEvent) throws SAXException { StartWhen startWhen = this.firstChoice; while (startWhen != null) { Object val; try { val = startWhen.getTest().getValue(expressionContext); } catch (Exception e) { throw new SAXParseException(e.getMessage(), getLocation(), e); } boolean result; if (val instanceof Boolean) { result = ((Boolean) val).booleanValue(); } else { result = (val != null); } if (result) { Invoker.execute(consumer, expressionContext, executionContext, macroCall, startWhen.getNext(), startWhen.getEndInstruction()); break; } startWhen = startWhen.getNextChoice(); } if (startWhen == null && this.otherwise != null) { Invoker.execute(consumer, expressionContext, executionContext, macroCall, this.otherwise.getNext(), this.otherwise.getEndInstruction()); } return getEndInstruction().getNext(); }
0
import org.apache.atlas.repository.graphdb.janus.migration.RelationshipCacheGenerator; import org.apache.atlas.v1.typesystem.types.utils.TypesUtil; import static org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags.ONE_TO_TWO; import static org.apache.atlas.model.typedef.AtlasRelationshipDef.PropagateTags.TWO_TO_ONE; public class RelationshipCacheGeneratorTest { final String PROCESS_INPUT_KEY = "__Process.inputs"; final String PROCESS_OUTPUT_KEY = "__Process.outputs"; String ONE_TO_TWO_STR = ONE_TO_TWO.toString(); String TWO_TO_ONE_STR = TWO_TO_ONE.toString(); Map<String, RelationshipCacheGenerator.TypeInfo> cache = RelationshipCacheGenerator.get(typeRegistry); for (Map.Entry<String, RelationshipCacheGenerator.TypeInfo> entry : cache.entrySet()) { assertEquals(cache.get(PROCESS_INPUT_KEY).getTypeName(), "dataset_process_inputs"); assertEquals(cache.get(PROCESS_INPUT_KEY).getPropagateTags(), ONE_TO_TWO_STR); assertEquals(cache.get(PROCESS_OUTPUT_KEY).getTypeName(), "process_dataset_outputs"); assertEquals(cache.get(PROCESS_OUTPUT_KEY).getPropagateTags(), TWO_TO_ONE_STR);
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
* @version $Id: SourceRepository.java,v 1.6 2004/03/27 22:01:22 unico Exp $
0
node -> node.getTransform() instanceof PAssert.GroupThenAssert || node.getTransform() instanceof PAssert.GroupThenAssertForSingleton || node.getTransform() instanceof PAssert.OneSideInputAssert;
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 org.apache.ambari.logsearch.config.api.ShipperConfigElementDescription; import org.apache.ambari.logsearch.config.api.ShipperConfigTypeDescription; @ShipperConfigTypeDescription( name = "Fields", description = "Describes a the fields which's value should be met in order to match a filter to an input element.\n" + "\n" + "It has the following attributes:" ) @ShipperConfigElementDescription( path = "/filter/[]/conditions/fields/type", type = "list of strings", description = "The acceptable values for the type field in the input element.", examples = {"ambari_server", "\"spark_jobhistory_server\", \"spark_thriftserver\", \"livy_server\""} )
0
int type = buffer.getUByte(); int type = buffer.getUByte(); int type = buffer.getUByte(); int type = buffer.getUByte(); int type = buffer.getUByte(); attrs.type = buffer.getUByte(); buffer.putByte((byte) attributes.type); int type = buffer.getUByte(); int type = buffer.getUByte();
0
private static final InvocationHandler stub = new InvocationHandler() { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return null; } }; public void testCreateConnection() { assertNotNull(ProxyFactory.instance().createConnection(stub)); } public void testCreateDriver() { assertNotNull(ProxyFactory.instance().createDriver(stub)); } public void testCreatePreparedStatement() { assertNotNull(ProxyFactory.instance().createPreparedStatement(stub)); } public void testCreateResultSet() { assertNotNull(ProxyFactory.instance().createResultSet(stub)); } public void testCreateResultSetMetaData() { assertNotNull(ProxyFactory.instance().createResultSetMetaData(stub)); } public void testCreateStatement() { assertNotNull(ProxyFactory.instance().createStatement(stub)); } public void testCreateCallableStatement() { assertNotNull(ProxyFactory.instance().createCallableStatement(stub)); }
0
* Autogenerated by Thrift Compiler (0.10.0) public enum TableOperationExceptionType implements org.apache.thrift.TEnum {
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
Service srv = dm.createResourceAdapterService(filter, propagate, null, changed); srv.setInterface(provides, properties);
0
try (BatchScanner bs = client.createBatchScanner(tableName)) {
0
@Parameter(names = "--inputDir", required = true) @Parameter(names = "--workDir", required = true)
0
import org.apache.http.params.CoreProtocolPNames; CoreProtocolPNames.ORIGIN_SERVER);
0
if (!isNullOrEmpty(dataflowOptions.getSaveProfilesToGcs())) {
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
0
InputProcessorChain subInputProcessorChain = inputProcessorChain.createSubChain(this, false); // copy all processor back to main chain for finalization inputProcessorChain.getProcessors().clear(); inputProcessorChain.getProcessors().addAll(subInputProcessorChain.getProcessors());
0
String uuid = getConnector().getInstance().getInstanceID(); String uuid = getConnector().getInstance().getInstanceID(); String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH; String zpath = ZooUtil.getRoot(getConnector().getInstance()) + RootTable.ZROOT_TABLET_PATH;
0
() -> { ready.countDown(); try { start.await(); } catch (InterruptedException e) { try { byte[] encoded = CoderUtils.encodeToByteArray(coder, elem); assertEquals( new TestType("abc", index), CoderUtils.decodeFromByteArray(coder, encoded)); } catch (Throwable e) { thrown.compareAndSet(null, e); } done.countDown();
0
List<ByteBuffer> bbList = Collections.< ByteBuffer>singletonList(ByteBuffer.wrap(bs.getBackingArray(), bs.offset(), bs.length()));
0
* http://www.apache.org/licenses/LICENSE-2.0
0
import cz.seznam.euphoria.shaded.guava.com.google.common.base.Preconditions;
0
/* * Gets the component type version. * @return the component type version or * <code>null</code> if not set. */ public String getVersion() { return m_factory.getVersion(); } /** String name = pd.getName(); * Computes the default service properties to publish : // Add the version if set String v = getVersion(); if (v != null) { props.put("factory.version", v); } new Attribute("bundle",
0
* @version $Revision: 1.5 $ $Date: 2003/03/14 03:48:37 $ assertTrue( "file exists", file.getType() != FileType.IMAGINARY ); assertTrue( "folder exists", file.getType() != FileType.IMAGINARY ); assertTrue( "unknown file does not exist", file.getType() == FileType.IMAGINARY ); assertTrue( "unknown file does not exist", file.getType() == FileType.IMAGINARY ); } /** * Tests root of file system exists. */ public void testRoot() throws FileSystemException { final FileObject file = getReadFolder().getFileSystem().getRoot(); assertTrue( file.exists() ); assertTrue( file.getType() != FileType.IMAGINARY );
0
* @return the hash value
0
byte[] octets = pubReader.read(Short.MAX_VALUE); // reasonable max. allowed size
0
import org.apache.accumulo.harness.UnmanagedAccumuloIT; import org.apache.log4j.Logger; public class LogicalTimeIT extends UnmanagedAccumuloIT { private static final Logger log = Logger.getLogger(LogicalTimeIT.class); String tableName = getUniqueNames(1)[0];
0
/* * Copyright 1999-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.cocoon.forms.datatype.convertor; import java.util.Locale; /** * Convertor for {@link Float}s that does not do any (locale-dependent) * formatting. * * @version CVS $Id: PlainFloatConvertor.java,v 1.1 2004/03/09 10:34:06 reinhard Exp $ */ public class PlainFloatConvertor implements Convertor { public Object convertFromString(String value, Locale locale, Convertor.FormatCache formatCache) { try { return new Float(value); } catch (NumberFormatException e) { return null; } } public String convertToString(Object value, Locale locale, Convertor.FormatCache formatCache) { return value.toString(); } public Class getTypeClass() { return Float.class; } }
0
import org.apache.accumulo.core.util.MetadataTable; if (MetadataTable.PREV_ROW_COLUMN.equals(new Text(cu.getColumnFamily()), new Text(cu.getColumnQualifier())) && count > 0) {
0
import org.apache.beam.sdk.PipelineResult; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PValue;
0
import org.apache.ambari.server.orm.entities.AlertTargetEntity; import org.codehaus.jackson.annotate.JsonProperty; private Long m_id; @JsonProperty("id") public Long getId() { public void setId(Long id) { @JsonProperty("name") @JsonProperty("description") @JsonProperty("notification_type") @JsonProperty("properties") * @param entity * @return public static AlertTarget coerce(AlertTargetEntity entity) { AlertTarget target = new AlertTarget(); target.setId(entity.getTargetId()); target.setDescription(entity.getDescription()); target.setName(entity.getTargetName()); target.setNotificationType(entity.getNotificationType()); target.setProperties(entity.getProperties()); return target;
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.HashMap; private HashMap namespaces = new HashMap(); System.out.println("will parse this: " + args[0]); // parse schemeName in prefix and localName String schemeNamespace = null, schemeLocalName = null; int colonPos = schemeName.indexOf(':'); if (colonPos != -1) { String schemePrefix = schemeName.substring(0, colonPos); schemeNamespace = (String)namespaces.get(schemePrefix); schemeLocalName = schemeName.substring(colonPos + 1); } else { schemeLocalName = schemeName; } if (schemeNamespace == null && schemeLocalName.equals("xmlns")) { namespaces.put(prefix, namespace); } else if (schemeNamespace == null && schemeLocalName.equals("xpointer")) { } else if ("http://apache.org/cocoon/xpointer".equals(schemeNamespace) && schemeLocalName.equals("elementpath")) { xpointer.addPart(new ElementPathPart(schemeData)); final private boolean jj_3R_7() { if (jj_scan_token(QName)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } final private boolean jj_3_1() { if (jj_3R_4()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
0
* @param parameterName - name of parameter * @param methodName - calling method String parameterName, String typeDefGUID, String methodName) throws TypeErrorException; String attributeTypeDefGUID, String methodName) throws TypeErrorException; * @param guidParameterName - name of guid parameter * @param nameParameterName - name of name parameter * @param methodName - calling method String guidParameterName, String nameParameterName, String typeDefName, String methodName) throws TypeErrorException; * @param methodName - calling method String attributeTypeDefName, String methodName) throws TypeErrorException;
0
private static final Object lock = new Object();
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
Map<String,TabletBalancer> perTableBalancers = new HashMap<>(); Map<String,Map<KeyExtent,TServerInstance>> groupedUnassigned = new HashMap<>(); tableUnassigned = new HashMap<>(); Map<KeyExtent,TServerInstance> newAssignments = new HashMap<>(); ArrayList<TabletMigration> newMigrations = new ArrayList<>();
0
import org.apache.accumulo.tserver.log.DfsLogger.ServerResources; final ServerResources conf = tserver.getServerConfig(); final VolumeManager fs = conf.getFileSystem(); DfsLogger alog = null; alog = new DfsLogger(conf, syncCounter, flushCounter); String fileName = alog.getFileName(); log.debug("Created next WAL " + fileName); log.info("Our WAL was not used for 12 hours: " + fileName); log.error("Failed to open WAL", t); if (null != alog) { // It's possible that the sync of the header and OPEN record to the WAL failed // We want to make sure that clean up the resources/thread inside the DfsLogger // object before trying to create a new one. try { alog.close(); } catch (IOException e) { log.error("Failed to close WAL after it failed to open", e); } // Try to avoid leaving a bunch of empty WALs lying around try { Path path = alog.getPath(); if (fs.exists(path)) { fs.delete(path); } } catch (IOException e) { log.warn("Failed to delete a WAL that failed to open", e); } }
0
bundle(dummyJar.toURI().toURL().toExternalForm()) );
0
info.setRole(role);
0
import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.ManagedChannel; import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.Server; import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.CallStreamObserver; import org.apache.beam.vendor.grpc.v1p13p1.io.grpc.stub.StreamObserver; import org.apache.beam.vendor.grpc.v1p13p1.io.netty.channel.epoll.Epoll;
0
static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TransformXSLTTest.class.getName());
1
import org.apache.atlas.web.security.BaseSecurityTest; import org.eclipse.jetty.server.Server;
0
* @version CVS $Id: AbstractConstrainedTransformer.java,v 1.3 2003/11/15 04:21:29 joerg Exp $ *@since 14 May 2002
0
/* * Copyright 1999-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.environment.http; import org.apache.avalon.framework.CascadingRuntimeException; public final class ContextURLException extends CascadingRuntimeException { public ContextURLException(String message) { super(message, null); } public ContextURLException(String message, Throwable cause) { super(message, cause); } }
0
import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLContext; import org.apache.hc.core5.http.config.SocketConfig; import org.apache.hc.core5.io.ShutdownType; private final SSLContext sslContext; private final SocketConfig socketConfig; private final AtomicReference<HttpRequester> requesterRef; public ClassicTestClient(final SSLContext sslContext, final SocketConfig socketConfig) { this.sslContext = sslContext; this.socketConfig = socketConfig != null ? socketConfig : SocketConfig.DEFAULT; this.requesterRef = new AtomicReference<>(null); public ClassicTestClient(final SocketConfig socketConfig) { this(null, socketConfig); public ClassicTestClient() { this(null, null); start(null); } public void start(final HttpProcessor httpProcessor) { if (requesterRef.get() == null) { final HttpRequester requester = RequesterBootstrap.bootstrap() .setSslSocketFactory(sslContext != null ? sslContext.getSocketFactory() : null) .setHttpProcessor(httpProcessor) .setConnectFactory(new LoggingConnFactory()) .create(); requesterRef.compareAndSet(null, requester); } else { throw new IllegalStateException("Requester has already been started"); } public void shutdown(final ShutdownType shutdownType) { final HttpRequester requester = requesterRef.getAndSet(null); if (requester != null) { requester.shutdown(shutdownType); final HttpRequester requester = this.requesterRef.get(); if (requester == null) { throw new IllegalStateException("Requester has not been started"); return requester.execute(targetHost, request, socketConfig, context);
0
while (i < len && subject.charAt(i) >= '0' && subject.charAt(i) <= '9') { } && subject.charAt(i + 1) == ':') { if ("(no subject)".equals(simplifiedSubject)) { } while (end > start && subject.charAt(end - 1) < ' ') { } if (start == 0 && end == len) { } else { } for (int i = 0; i < depth; ++i) { } if (article.kid != null) { } if (article.next != null) { } if(simplifiedSubject == null) { }
1
* @version CVS $Id: XMLDBGenerator.java,v 1.3 2003/10/29 14:27:07 vgritsenko Exp $ getLogger().error("Unable to connect to the XML:DB database"); getLogger().error("There was a problem setting up the connection"); getLogger().error("Make sure that your driver is available"); getLogger().error("The XML:DB driver raised an exception"); getLogger().error("probably the document was not found");
0
? entryName.lastIndexOf('/', endIdx - 1) + 1
0
p.apply(GenerateSequence.from(0).to(10))
0
switch (ae.getSecurityErrorCode()) { switch (ae.getSecurityErrorCode()) {
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
Element element = ElementProxy.createElementForFamily( _contextDocument, EncryptionConstants.EncryptionSpecNS, EncryptionConstants._TAG_CARRIEDKEYNAME); Node node = _contextDocument.createTextNode(carriedName); element.appendChild(node); result.appendChild(element);
0
import org.apache.accumulo.core.client.impl.Tables; if (!testTableName.matches(Tables.VALID_NAME_REGEX)) {
0
@Deprecated
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableFloatCollectionCollection.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
* * * * Sets the name of the new DynaClass
1
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class TableInfo implements org.apache.thrift.TBase<TableInfo, TableInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TableInfo> { public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0
if (res != null) { }
0
Assert.assertEquals(true, basicScheme.isProxy()); } @Test public void testSerializationUnchallenged() throws Exception { final BasicScheme basicScheme = new BasicScheme(); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final ObjectOutputStream out = new ObjectOutputStream(buffer); out.writeObject(basicScheme); out.flush(); final byte[] raw = buffer.toByteArray(); final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(raw)); final BasicScheme authScheme = (BasicScheme) in.readObject(); Assert.assertEquals(basicScheme.getSchemeName(), authScheme.getSchemeName()); Assert.assertEquals(basicScheme.getRealm(), authScheme.getRealm()); Assert.assertEquals(basicScheme.isComplete(), authScheme.isComplete()); Assert.assertEquals(false, basicScheme.isProxy());
0
import org.apache.avalon.framework.parameters.Parameters; /** The context */ private Context context; this.context = this.setupContext( conf.getChild( "context" ) ); conf.getChild( "roles" )); final Configuration confRM) ecManager.contextualize( this.context ); private Object getComponent(String classname, Configuration conf, Parameters p) throws Exception { final Object instance = Class.forName(classname).newInstance(); ContainerUtil.enableLogging(instance, getLogger()); ContainerUtil.contextualize(instance, this.context); ContainerUtil.service(instance, getManager()); ContainerUtil.configure(instance, conf); ContainerUtil.parameterize(instance, p); ContainerUtil.initialize(instance); return instance; } protected Object getComponent(String classname, Configuration conf) throws Exception { return this.getComponent(classname, conf, null); } protected Object getComponent(String classname, Parameters p) throws Exception { return this.getComponent(classname, null, p); } /** * We use this simple logger manager that sends all output to the console (logger) */
0
/* * Copyright 1999-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.cocoon.forms.formmodel; import java.util.Iterator; import org.apache.cocoon.forms.event.ValueChangedListener; import org.apache.cocoon.forms.util.DomHelper; import org.w3c.dom.Element; /** * Builds {@link org.apache.cocoon.forms.formmodel.UploadDefinition}s. * * @version $Id$ */ public final class UploadDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { String mimeTypes = DomHelper.getAttribute(widgetElement, "mime-types", null); UploadDefinition uploadDefinition = new UploadDefinition(); super.setupDefinition(widgetElement, uploadDefinition); setDisplayData(widgetElement, uploadDefinition); Iterator iter = buildEventListeners(widgetElement, "on-value-changed", ValueChangedListener.class).iterator(); while (iter.hasNext()) { uploadDefinition.addValueChangedListener((ValueChangedListener)iter.next()); } if(widgetElement.hasAttribute("required")) uploadDefinition.setRequired(DomHelper.getAttributeAsBoolean(widgetElement, "required", false)); uploadDefinition.addMimeTypes(mimeTypes); uploadDefinition.makeImmutable(); return uploadDefinition; } }
0
import org.apache.http.HttpMutableEntity; EntityWriter entitywriter = new DefaultEntityWriter(); entitywriter.write( request.getEntity(), request.getRequestLine().getHttpVersion(), this.datatransmitter); HttpMutableEntity entity = entitygen.generate(this.datareceiver, response); InputStream instream = entity.getContent(); entity.setContent(instream); entity.setContent(null);
0
compositeFilter.setAttribute(ATTR_FILTER_UNITS, SVG_OBJECT_BOUNDING_BOX_VALUE); feComposite.setAttribute(SVG_IN_ATTRIBUTE, input1); feComposite.setAttribute(SVG_IN2_ATTRIBUTE, input2); feMergeNodeFlood.setAttribute(SVG_IN_ATTRIBUTE, VALUE_FLOOD); feMergeNodeComposite.setAttribute(SVG_IN_ATTRIBUTE, VALUE_COMPOSITE); Element defs = domFactory.createElement(SVG_DEFS_TAG); Element newDefs = domFactory.createElement(SVG_DEFS_TAG);
0
import org.slf4j.Logger;
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
expectedChar = (Character.valueOf(refLine.charAt(cn))).toString(); foundChar = (Character.valueOf(newLine.charAt(cn))).toString();
0
* * */ * @return The converted value * @throws ParseException if an error occurs parsing a String to a Number
0
private final Collection<AbstractBackToLinkedRuleBuilder<? extends Rule>> providers = new LinkedList<AbstractBackToLinkedRuleBuilder<? extends Rule>>(); private final Map<Key, Collection<AbstractBackToLinkedRuleBuilder<? extends Rule>>> providersIndex = new HashMap<Key, Collection<AbstractBackToLinkedRuleBuilder<? extends Rule>>>(); * @param <RB> * @param ruleBuilder public <R extends Rule, RB extends AbstractBackToLinkedRuleBuilder<R>> void registerProvider( RB ruleBuilder ) this.providers.add( ruleBuilder ); Key key = new Key( ruleBuilder.getPattern(), ruleBuilder.getNamespaceURI() ); // O(1) Collection<AbstractBackToLinkedRuleBuilder<? extends Rule>> indexedProviders = this.providersIndex.get( key ); indexedProviders = new ArrayList<AbstractBackToLinkedRuleBuilder<? extends Rule>>(); indexedProviders.add( ruleBuilder ); * @param <RB> public <R extends Rule, RB extends AbstractBackToLinkedRuleBuilder<R>> RB getProvider( String keyPattern, /* @Nullable */String namespaceURI, Class<RB> type ) // O(1) Collection<AbstractBackToLinkedRuleBuilder<? extends Rule>> indexedProviders = this.providersIndex.get( key ); // FIXME O(n) not so good for ( AbstractBackToLinkedRuleBuilder<? extends Rule> ruleProvider : indexedProviders ) for ( AbstractBackToLinkedRuleBuilder<? extends Rule> provider : providers ) {
0
import org.apache.commons.vfs.FileSystemException; private final ZipFileSystem fs; // protected final ZipFile file; ZipFileSystem fs, boolean zipExists) throws FileSystemException this.fs = fs; if (!zipExists) return fs.getZipFile().getInputStream(entry);
0
import com.google.inject.persist.PersistService; import junit.framework.Assert;
0
if (namespaceId.equals(Constants.DEFAULT_NAMESPACE_ID) || namespaceId.equals(Constants.ACCUMULO_NAMESPACE_ID)) {
1
accClientConf.getProperties(props, x -> true);
0
final Header[] origheaders = request.getAllHeaders(); } catch (final IOException ex) {
0
EasyMock.expect(context.getClient()).andReturn(conn); EasyMock.expect(context.getClient()).andReturn(conn); EasyMock.expect(context.getClient()).andReturn(conn);
0
import org.apache.beam.sdk.io.Read; import org.apache.beam.sdk.io.TextIO; import org.apache.beam.sdk.transforms.Aggregator; import org.apache.beam.sdk.transforms.Count; import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.Filter; import org.apache.beam.sdk.transforms.Flatten; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.transforms.ParDo; import org.apache.beam.sdk.transforms.Partition; import org.apache.beam.sdk.transforms.SerializableFunction; import org.apache.beam.sdk.transforms.Sum; import org.apache.beam.sdk.transforms.Top; import org.apache.beam.sdk.transforms.windowing.AfterWatermark; import org.apache.beam.sdk.transforms.windowing.FixedWindows; import org.apache.beam.sdk.transforms.windowing.Window; import org.apache.beam.sdk.transforms.windowing.WindowFn;
0
return parameters != null ? new ArrayList<>(parameters) : parameters = new LinkedList<>();
0
"org.apache.felix.webconsole.internal.compendium.LogServlet",
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override
0