Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import java.security.AccessController; import java.security.PrivilegedAction; import org.apache.commons.digester.annotations.internal.GetDeclaredFieldsPrivilegedAction; import org.apache.commons.digester.annotations.internal.GetDeclaredMethodsPrivilegedAction; for (Field field : run(new GetDeclaredFieldsPrivilegedAction(target))) { for (Method method : run(new GetDeclaredMethodsPrivilegedAction(target))) { /** * Perform action with AccessController.doPrivileged() if possible. * * @param action - the action to run * @return result of running the action */ private static <T> T run(PrivilegedAction<T> action) { if (System.getSecurityManager() != null) { return AccessController.doPrivileged(action); } else { return action.run(); } }
0
try (BatchWriter bw = c.createBatchWriter(table)) { try (BatchWriter bw = c.createBatchWriter(table)) { try (BatchWriter bw = c.createBatchWriter(table)) {
0
boolean success = "src/test/resources/at/iaik/ixsil/coreFeatures/signatures", "src/test/resources/at/iaik/ixsil/coreFeatures/signatures",
1
package org.apache.hc.core5.http.nio.support; import org.apache.hc.core5.http.nio.AsyncClientExchangeHandler; import org.apache.hc.core5.http.nio.AsyncRequestProducer; import org.apache.hc.core5.http.nio.AsyncResponseConsumer; import org.apache.hc.core5.http.nio.CapacityChannel; import org.apache.hc.core5.http.nio.DataStreamChannel; import org.apache.hc.core5.http.nio.RequestChannel; public void produceRequest(final RequestChannel requestChannel) throws HttpException, IOException { if (resultCallback != null) { resultCallback.cancelled(); } public int consume(final ByteBuffer src) throws IOException { return responseConsumer.consume(src); if (resultCallback != null) { resultCallback.failed(cause); }
1
injector.getInstance(GroupDAO.class), injector.getInstance(ViewInstanceDAO.class), injector.getInstance(PrivilegeDAO.class));
0
@VisibleForTesting static final String DEFAULT_USER = "UNSECURE"; String getRemoteUserName() { .orElse(DEFAULT_USER); com.google.common.base.Optional<String> transitionedBy() { return com.google.common.base.Optional.of("Transition forced by " + getRemoteUserName()); com.google.common.base.Optional<String> killedByRemoteUser() { return com.google.common.base.Optional.of("Killed by " + getRemoteUserName()); com.google.common.base.Optional<String> restartedByRemoteUser() { return com.google.common.base.Optional.of("Restarted by " + getRemoteUserName());
0
import java.util.regex.MatchResult; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; private Matcher _preparse_matcher_; //_preparse_matcher_ = new Perl5Matcher(); _preparse_pattern_ = Pattern.compile(PRE_PARSE_REGEX); catch (PatternSyntaxException pse) _preparse_matcher_ = _preparse_pattern_.matcher(entry); if (_preparse_matcher_.matches()) { result = _preparse_matcher_.toMatchResult(); _preparse_matcher_ = _preparse_pattern_.matcher(entry); if (_preparse_matcher_.matches()) { result = _preparse_matcher_.toMatchResult();
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.xml.security.keys.storage; import org.apache.xml.security.exceptions.XMLSecurityException; /** * * @author $Author$ */ public class StorageResolverException extends XMLSecurityException { /** * */ private static final long serialVersionUID = 1L; /** * Constructor StorageResolverException * */ public StorageResolverException() { super(); } /** * Constructor StorageResolverException * * @param _msgID */ public StorageResolverException(String _msgID) { super(_msgID); } /** * Constructor StorageResolverException * * @param _msgID * @param exArgs */ public StorageResolverException(String _msgID, Object exArgs[]) { super(_msgID, exArgs); } /** * Constructor StorageResolverException * * @param _msgID * @param _originalException */ public StorageResolverException(String _msgID, Exception _originalException) { super(_msgID, _originalException); } /** * Constructor StorageResolverException * * @param _msgID * @param exArgs * @param _originalException */ public StorageResolverException(String _msgID, Object exArgs[], Exception _originalException) { super(_msgID, exArgs, _originalException); } }
0
* Tests for {@link FlinkStateInternals}. This is based on the tests for * {@code InMemoryStateInternals}.
0
import org.apache.http.conn.util.SocketUtils; SocketUtils.connect(sock, host, port, timeout);
0
return parsePatterns(GenericUtils.isEmpty(patterns) ? Collections.emptyList() : Arrays.asList(patterns)); return PATTERN_CHARS.indexOf(ch) >= 0;
0
import org.apache.cocoon.woody.FormContext; public void readFromRequest(FormContext formContext) { enteredValue = formContext.getRequest().getParameter(getFullyQualifiedId()); value = definition.getDatatype().convertFromStringLocalized(enteredValue, formContext.getLocale()); public boolean validate(FormContext formContext) {
0
import org.apache.http.util.Args; this.out = Args.notNull(out, "Session output buffer");
0
* @return A {@link DaemonController} object that can be used to control * the {@link Daemon} instance that this <code>DaemonContext</code> * is passed to. * @return An array of {@link String} arguments supplied by the environment * corresponding to the array of arguments given in the * <code>public static void main()</code> method used as an entry * point to most other java programs.
0
return IOUtils.toByteArray(in); // Do NOT use file.length() - see IO-453
0
import org.apache.beam.sdk.values.WindowingStrategy;
0
* @version $Revision: 1.3 $ $Date: 2003/01/11 05:41:23 $ public NameAttributeTest(Expression namePath, Expression nameValue) { public Expression getNameTestExpression() {
1
import javax.inject.Singleton;
1
protected static synchronized boolean isXalanInstalled() {
0
List<Object> list = Arrays.asList(data); IOUtils.writeLines((List<?>) null, "*", out); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data); IOUtils.writeLines((List<?>) null, "*", out, "US-ASCII"); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data); IOUtils.writeLines((List<?>) null, "*", writer); List<Object> list = Arrays.asList(data); List<Object> list = Arrays.asList(data);
0
* @version CVS $Id: JSIntrospector.java,v 1.4 2003/03/24 14:33:56 stefano Exp $ Context.enter(); Context.enter(); Context.enter(); Context.enter(); Context.enter();
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
private final static String PROP_DEFAULT_QUERYTIMEOUT = "defaultQueryTimeout"; PROP_ENABLE_AUTOCOMMIT_ON_RETURN, PROP_DEFAULT_QUERYTIMEOUT value = properties.getProperty(PROP_DEFAULT_QUERYTIMEOUT); if (value != null) { dataSource.setDefaultQueryTimeout(Integer.valueOf(value)); }
0
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; private static DocumentBuilder documentBuilder; static { try { documentBuilder = XMLUtils.createDocumentBuilder(false); } catch (ParserConfigurationException e) { throw new RuntimeException(e); } } return documentBuilder.parse(new FileInputStream(getControlFilePath(fileName)));
0
import org.apache.commons.net.ftp.FTPSClient; * Usage: ftp [-s] [-b] [-l] [-#] [-k nnn] <hostname> <username> <password> <remote file> <local file> [<SSLprotocol>] "Usage: ftp [-s] [-b] [-l|-f] [-a] [-e] [-k secs [-w msec]] [-#] <hostname> <username> <password> <remote file> <local file> [TLS|etc.]\n" + boolean printHash = false; long keepAliveTimeout = -1; int controlKeepAliveReplyTimeout = -1; printHash = true; keepAliveTimeout = Long.parseLong(args[++base]); controlKeepAliveReplyTimeout = Integer.parseInt(args[++base]); if ((args.length - base) < 5) // server, user, pass, remote, local [protocol] String server = args[base++]; int port = 0; String username = args[base++]; String password = args[base++]; String remote = args[base++]; String local = args[base++]; String protocol = null; if (args.length - base > 0) { protocol = args[base++]; } final FTPClient ftp; if (protocol == null ) { ftp = new FTPClient(); } else { ftp = new FTPSClient(protocol); } if (printHash) { ftp.setCopyStreamListener(createListener()); } if (keepAliveTimeout >= 0) { ftp.setControlKeepAliveTimeout(keepAliveTimeout); } if (controlKeepAliveReplyTimeout >= 0) { ftp.setControlKeepAliveReplyTimeout(controlKeepAliveReplyTimeout); } if (port > 0) { ftp.connect(server, port); } else { ftp.connect(server); } System.out.println("Connected to " + server + " on "+ftp.getRemotePort());
0
public abstract RemoteInputDestination<WindowedValue<?>> getRemoteInputDestination();
0
new PassThroughThenCleanup<>( new PassThroughThenCleanup<>(
0
*/ public IOR() { super(org.apache.bcel.Constants.IOR); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ public void accept( Visitor v ) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitArithmeticInstruction(this); v.visitIOR(this); }
0
/* This is not thread safe filesystemClose(key.getFileSystem()); */ Reference old = (Reference)files.put(file.getName(), ref); if (old != null) { refReverseMap.remove(old); } refReverseMap.put(ref, key);
0
* @version $Id$ * @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(Element, ParserContext) final String location = getAttributeValue(element, "location", DEFAULT_COCOON_XCONF_LOCATION); final ConfigurationInfo info = readConfiguration(location, resourceLoader); createComponents(element, info, parserContext.getRegistry(), parserContext.getDelegate().getReaderContext().getReader(), resourceLoader); addContext(element, registry); addComponent(AvalonServiceManager.class, AvalonUtils.SERVICE_MANAGER_ROLE, null, false, registry); addLogger(registry, info.getRootLogger()); * final RootBeanDefinition beanDef = createBeanDefinition(AvalonLoggerFactoryBean.class, null, false); if (loggerCategory != null) { register(beanDef, AvalonUtils.LOGGER_ROLE, registry);
0
public static Set<String> pkPropertyIds = new HashSet<>(); new HashMap<>(); public static Set<String> propertyIds = new HashSet<>(); Set<Resource> resources = new HashSet<>(); Set<Resource> resources = new HashSet<>(); Set<Resource> resources = new HashSet<>(); descriptor = new HashMap<>(); Set<Resource> resources = new HashSet<>(); Collection<KerberosServiceDescriptor> serviceDescriptors = new ArrayList<>();
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * 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
@XmlElement
1
import org.apache.accumulo.cluster.ClusterUser; import org.apache.accumulo.core.client.ClientConfiguration; import org.apache.accumulo.core.client.ClientConfiguration.ClientProperty; import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; import org.apache.hadoop.security.UserGroupInformation; private boolean saslEnabled; private String username; private String password; private Instance inst; Connector conn = getConnector(); inst = conn.getInstance(); ClientConfiguration clientConf = cluster.getClientConfig(); ClusterUser user = getUser(0); username = user.getPrincipal(); saslEnabled = clientConf.getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(), false); PasswordToken passwdToken = null; if (!saslEnabled) { password = user.getPassword(); passwdToken = new PasswordToken(password); } conn.securityOperations().createLocalUser(username, passwdToken); public void deleteLocalUser() throws Exception { if (saslEnabled) { ClusterUser root = getAdminUser(); UserGroupInformation.loginUserFromKeytab(root.getPrincipal(), root.getKeytab().getAbsolutePath()); } public void testConnectorWithDestroyedToken() throws Exception { AuthenticationToken token = getUser(0).getToken(); inst.getConnector("non_existent_user", token); public void testDestroyTokenBeforeRPC() throws Exception { AuthenticationToken token = getUser(0).getToken(); Connector userConnector = inst.getConnector(username, token);
0
import javax.swing.SwingUtilities; * The OK button. */ protected JButton okButton; /** JDialog dialog = dialog.getRootPane().setDefaultButton(okButton); okButton = bf.createJButton("OKButton");
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.transformation; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.SitemapComponentTestCase; /** * * * @version $Id$ */ public class LexicalTransformerTestCase extends SitemapComponentTestCase { public void testLexicalTransformer1() throws Exception { String src = "resource://org/apache/cocoon/transformation/lexertest-lexicon1.xml"; Parameters parameters = new Parameters(); String input = "resource://org/apache/cocoon/transformation/lexertest-input1.xml"; String result = "resource://org/apache/cocoon/transformation/lexertest-result1.xml"; assertEqual(load(result), transform("lexer", src, parameters, load(input))); } public void testLexicalTransformer2() throws Exception { String src = "resource://org/apache/cocoon/transformation/lexertest-lexicon2.xml"; Parameters parameters = new Parameters(); String input = "resource://org/apache/cocoon/transformation/lexertest-input2.xml"; String result = "resource://org/apache/cocoon/transformation/lexertest-result2.xml"; assertEqual(load(result), transform("lexer", src, parameters, load(input))); } }
0
import com.google.cloud.dataflow.sdk.values.TimestampedValue; public <T> Iterable<TimestampedValue<T>> readTagList(CodedTupleTag<T> tag) throws IOException {
0
import java.io.ByteArrayOutputStream; import java.io.PrintStream; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; else if (element instanceof IBundleRepository) else if (element instanceof Throwable) { return PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJS_ERROR_TSK); } if ( element instanceof Throwable ) { Throwable t = (Throwable) element; ByteArrayOutputStream buf = new ByteArrayOutputStream(); PrintStream print = new PrintStream(buf); t.printStackTrace(print); print.flush(); return buf.toString(); }
0
values.put(CSSConstants.CSS_BASELINE_VALUE, values.put(CSSConstants.CSS_SUB_VALUE, values.put(CSSConstants.CSS_SUPER_VALUE, return false; return CSSConstants.CSS_BASELINE_SHIFT_PROPERTY; Object v = values.get(lu.getStringValue().toLowerCase().intern()); if (v == null) { if (type != CSSPrimitiveValue.CSS_IDENT) { Object v = values.get(value.toLowerCase().intern()); if (v == null) { } CSSStylableElement parent; parent = (CSSStylableElement)elt.getParentNode(); if (parent == null) { // Hmmm somthing pretty odd - can't happen accordint to spec, // should always have text parent. // http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty parent = elt; }
1
* @version $Id$
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
package org.apache.zookeeper.server.quorum; public interface LocalPeerMXBean extends ServerMXBean { * @return the number of milliseconds of each tick */ public int getTickTime(); /** * @return the number of ticks that the initial sync phase can take */ public int getInitLimit(); /** * @return the number of ticks that can pass between sending a request * and getting a acknowledgment */ public int getSyncLimit(); /** * @return the current tick */ public int getTick(); /** * @return the current server state */ public String getState(); /** * @return the quorum address /** * @return the election type */ public int getElectionType();
0
try (SftpClient sftp = createSftpClient(session)) { try (SftpClient sftp = createSftpClient(session)) {
0
final String enc = mock.calculateHttpEncoding(
0
public static boolean isMultiple(Requirement req) { return Namespace.CARDINALITY_MULTIPLE.equals(req.getDirectives() .get(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE)) && !isDynamic(req); } public static boolean isDynamic(Requirement req) { return PackageNamespace.RESOLUTION_DYNAMIC.equals(req.getDirectives() .get(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE)); }
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * *---------------------------------------------------------------------------* * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.refimpl.script.rhino; import org.mozilla.javascript.WrapHandler; import org.mozilla.javascript.Scriptable; import org.w3c.dom.events.EventTarget; /** * This is utility class allowing to pass an ECMAScript function * as a parameter of the <code>addEventListener</code> method of * <code>EventTarget</code> objects as DOM Level 2 recommendation * required. * @author <a href="mailto:[email protected]">Christophe Jolif</a> * @version $Id$ */ class EventTargetWrapHandler implements WrapHandler { private RhinoInterpreter interpreter; public EventTargetWrapHandler(RhinoInterpreter interp) { interpreter = interp; } public Object wrap(Scriptable scope, Object obj, Class staticType) { if (obj instanceof EventTarget) { return interpreter.buildEventTargetWrapper((EventTarget)obj); } return null; } }
0
/** * 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
import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Singleton; @Singleton Injector injector = Guice.createInjector(new ControllerModule()); Controller controller = injector.getInstance(Controller.class);
0
@SuppressWarnings("unchecked") Class<? extends PipelineOptions> clazz = (Class<? extends PipelineOptions>) args[0]; return as(clazz);
0
import org.apache.beam.runners.flink.translation.types.FlinkCoder; UnboundedFlinkSource<T> flinkSourceFunction = (UnboundedFlinkSource<T>) transform.getSource(); DataStream<T> flinkSource = context.getExecutionEnvironment() .addSource(flinkSourceFunction.getFlinkSource()); flinkSourceFunction.setCoder( new FlinkCoder<T>(flinkSource.getType(), context.getExecutionEnvironment().getConfig())); source = flinkSource
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
import java.util.Map; public class DefaultDatatypeManager implements DatatypeManager { private Map datatypeBuilders; private Map validatorRuleBuilders; DatatypeBuilder builder = (DatatypeBuilder) datatypeBuilders.get(typeName); if (builder == null) { throw new Exception("Unknown datatype '" + typeName + "' specified at " + DomHelper.getLocation(datatypeElement)); ValidationRuleBuilder builder = (ValidationRuleBuilder) validatorRuleBuilders.get(name); if (builder == null) { throw new Exception("Unknown validation rule \"" + name + "\" specified at " + DomHelper.getLocation(validationRuleElement)); DatatypeBuilder builder = (DatatypeBuilder)datatypeBuilders.get(dataTypeName); if (builder == null) { throw new Exception("Unknown datatype '" + dataTypeName + "' specified for " + DomHelper.getLocation(convertorElement)); } return builder.buildConvertor(convertorElement); } public void setDatatypeBuilders( Map datatypeBuilders ) { this.datatypeBuilders = datatypeBuilders; public void setValidatorRuleBuilders( Map validatorRuleBuilders ) { this.validatorRuleBuilders = validatorRuleBuilders;
0
import org.apache.atlas.model.instance.AtlasRelationship; /** * This is upon adding new relationships to the repository. * * @param relationships the created relationships * @param isImport */ void onRelationshipsAdded(List<AtlasRelationship> relationships, boolean isImport) throws AtlasBaseException; /** * This is upon updating an relationships. * * @param relationships the updated relationships * @param isImport */ void onRelationshipsUpdated(List<AtlasRelationship> relationships, boolean isImport) throws AtlasBaseException; /** * This is upon deleting relationships from the repository. * * @param relationships the deleted relationships * @param isImport */ void onRelationshipsDeleted(List<AtlasRelationship> relationships, boolean isImport) throws AtlasBaseException;
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.dm.test.bundle.annotation.bundledependency; import org.apache.felix.dm.annotation.api.Service; import org.apache.felix.dm.annotation.api.ServiceDependency; import org.apache.felix.dm.annotation.api.Start; import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer; /** * ServiceInterface Consumer. */ @Service public class ServiceConsumer { @ServiceDependency(filter="(test=adapter)") Sequencer m_sequencer; @ServiceDependency ServiceInterface m_service; @Start void start() { m_sequencer.step(2); m_service.run(); } }
0
* * added in front of the jexl engine, or after in the evaluation. public interface JexlExprResolver { /** represents an expression result of no value. */ * Evaluates an expression against the context. * @return value (may be null) or the NO_VALUE object to
0
import org.apache.accumulo.core.conf.SiteConfiguration; private static SiteConfiguration siteConfg = SiteConfiguration.create(); super(context, siteConfg);
0
* The lookup for Base64 decoding. BASE64_DECODER("base64Decoder", new StringLookupAdapter(StringLookupFactory.INSTANCE.base64StringLookup())), /** * The lookup for Base64 decoding. * * @since 2.4 */ //BASE64_ENCODER("base64Encoder", new StringLookupAdapter(StringLookupFactory.INSTANCE.base64EncoderStringLookup())),
0
implements Initializable {
0
"The path relative to the top level instance directory (instance.dfs.dir) where to store the key encryption key within HDFS."), CRYPTO_DEFAULT_KEY_STRATEGY_KEY_LOCATION("crypto.default.key.strategy.key.location", "/crypto/secret/keyEncryptionKey", PropertyType.ABSOLUTEPATH, "The path relative to the top level instance directory (instance.dfs.dir) where to store the key encryption key within HDFS."), @Experimental CRYPTO_DEFAULT_KEY_STRATEGY_CIPHER_SUITE("crypto.default.key.strategy.cipher.suite", "NullCipher", PropertyType.STRING, "The cipher suite to use when encrypting session keys with a key encryption key. This should be set to match the overall encryption algorithm " + "but with ECB mode and no padding unless you really know what you're doing and are sure you won't break internal file formats"), @Experimental CRYPTO_OVERRIDE_KEY_STRATEGY_WITH_CONFIGURED_STRATEGY("crypto.override.key.strategy.with.configured.strategy", "false", PropertyType.BOOLEAN, "The default behavior is to record the key encryption strategy with the encrypted file, and continue to use that strategy for the life " + "of that file. Sometimes, you change your strategy and want to use the new strategy, not the old one. (Most commonly, this will be " + "because you have moved key material from one spot to another.) If you want to override the recorded key strategy with the one in " + "the configuration file, set this property to true."),
0
package org.apache.http.conn;
0
* http://www.apache.org/licenses/LICENSE-2.0
0
columnLineageProcess.setAttribute(ATTRIBUTE_NAME, hiveProcess.getAttribute(ATTRIBUTE_QUALIFIED_NAME) + ":" + outputColumn.getAttribute(ATTRIBUTE_NAME));
0
import org.apache.xml.security.stax.ext.XMLSecurityUtils; XMLSecurityConstants.KeyIdentifierType keyIdentifierType = getSecurityProperties().getSignatureKeyIdentifierType(); if (x509Certificates == null) { return; } if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.KEY_VALUE) { XMLSecurityUtils.createKeyValueTokenStructure(this, outputProcessorChain, x509Certificates); } else if (keyIdentifierType == null || keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.X509_ISSUER_SERIAL) { } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.X509_SKI) { XMLSecurityUtils.createX509SubjectKeyIdentifierStructure(this, outputProcessorChain, x509Certificates); } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.X509_CERTIFICATE) { XMLSecurityUtils.createX509CertificateStructure(this, outputProcessorChain, x509Certificates); } else if (keyIdentifierType == XMLSecurityConstants.XMLKeyIdentifierType.X509_SUBJECT_NAME) { XMLSecurityUtils.createX509SubjectNameStructure(this, outputProcessorChain, x509Certificates); } else { throw new XMLSecurityException(XMLSecurityException.ErrorCode.FAILED_SIGNATURE, "unsupportedSecurityToken");
0
import org.apache.http.HttpHeaders; request.addHeader(HttpHeaders.TRANSFER_ENCODING, "chunked"); request.addHeader(HttpHeaders.TRANSFER_ENCODING, "chunked");
0
* Copyright 2016 Seznam.cz, a.s.
0
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
0
Map<String,Set<String>> expectedHashes) {
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.LinkedList; import com.google.common.collect.Lists; import org.apache.aurora.common.quantity.Amount; import org.apache.aurora.common.quantity.Time; import org.apache.commons.io.FileUtils; * {@link #ZooKeeperTestServer()}. private final LinkedList<Runnable> cleanupActions = Lists.newLinkedList(); public ZooKeeperTestServer() throws IOException { this(DEFAULT_SESSION_TIMEOUT); public ZooKeeperTestServer(Amount<Integer, Time> defaultSessionTimeout) throws IOException { * Starts zookeeper up on an ephemeral port. public void startNetwork() throws IOException, InterruptedException { cleanupActions.addFirst((this::shutdownNetwork)); } /** * Stops the zookeeper server. */ public void stop() { for (Runnable cleanup : cleanupActions) { cleanup.run(); } cleanupActions.clear(); cleanupActions.addFirst(client::close); cleanupActions.addFirst(new Runnable() { @Override public void run() { try { FileUtils.deleteDirectory(tempDir); } catch (IOException e) { // No-op. }
0
public class BeamRecordSqlType extends BeamRecordType { public List<Integer> fieldTypes; protected BeamRecordSqlType(List<String> fieldsName, List<Coder> fieldsCoder) { private BeamRecordSqlType(List<String> fieldsName, List<Integer> fieldTypes this.fieldTypes = fieldTypes; public static BeamRecordSqlType create(List<String> fieldNames, return new BeamRecordSqlType(fieldNames, fieldTypes, fieldCoders); int fieldType = fieldTypes.get(index); public List<Integer> getFieldTypes() { return fieldTypes; } public Integer getFieldTypeByIndex(int index){ return fieldTypes.get(index); if (obj != null && obj instanceof BeamRecordSqlType) { BeamRecordSqlType ins = (BeamRecordSqlType) obj; return fieldTypes.equals(ins.getFieldTypes()) && getFieldNames().equals(ins.getFieldNames()); return 31 * getFieldNames().hashCode() + getFieldTypes().hashCode(); } @Override public String toString() { return "BeamRecordSqlType [fieldNames=" + getFieldNames() + ", fieldTypes=" + fieldTypes + "]";
0
return new TestSuite(LocaleBeanUtilsTestCase.class);
0
boolean useOnlyIPV4 = Boolean.valueOf(getPropertyDefault(Activator.bc,Constants.NET_ONLY_IPV4_PROP,"true")).booleanValue(); boolean useOnlyIPV6 = Boolean.valueOf(getPropertyDefault(Activator.bc,Constants.NET_ONLY_IPV6_PROP,"true")).booleanValue(); boolean useLoopback = Boolean.valueOf(getPropertyDefault(Activator.bc,Constants.NET_USE_LOOPBACK_PROP,"true")).booleanValue(); boolean useExporter = Boolean.valueOf(getPropertyDefault(Activator.bc,Constants.EXPORTER_ENABLED_PROP,"true")).booleanValue(); boolean useImporter = Boolean.valueOf(getPropertyDefault(Activator.bc,Constants.IMPORTER_ENABLED_PROP,"true")).booleanValue();
0
final String versionToCompare; final String summaryReleaseVersion; if (StringUtils.isEmpty(manifest.releaseVersion)) { versionToCompare = release.getFullVersion(); summaryReleaseVersion = release.version; } else { versionToCompare = manifest.releaseVersion; summaryReleaseVersion = manifest.releaseVersion; } summary.setVersions(manifest.version, summaryReleaseVersion); if (VersionUtils.compareVersionsWithBuild(versionToCompare, serviceVersion, 4) > 0) {
0
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.InvalidProtocolBufferException;
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
|| (!request.endsWith(REQUEST_SUFFIX))) {
1
import java.util.List; final List<? extends Header> trailers = decoder.getTrailers(); Assert.assertEquals(null, trailers); final List<? extends Header> trailers = decoder.getTrailers(); Assert.assertEquals(2, trailers.size()); Assert.assertEquals("Footer1", trailers.get(0).getName()); Assert.assertEquals("abcde", trailers.get(0).getValue()); Assert.assertEquals("Footer2", trailers.get(1).getName()); Assert.assertEquals("fghij", trailers.get(1).getValue()); final List<? extends Header> trailers = decoder.getTrailers(); Assert.assertEquals(2, trailers.size()); Assert.assertEquals("Footer1", trailers.get(0).getName()); Assert.assertEquals("abcde", trailers.get(0).getValue()); Assert.assertEquals("Footer2", trailers.get(1).getName()); Assert.assertEquals("fghij", trailers.get(1).getValue()); final List<? extends Header> trailers = decoder.getTrailers(); Assert.assertEquals(1, trailers.size()); Assert.assertEquals("Footer1", trailers.get(0).getName()); Assert.assertEquals("abcde fghij", trailers.get(0).getValue()); final List<? extends Header> trailers = decoder1.getTrailers(); Assert.assertNotNull(trailers); Assert.assertEquals(1, trailers.size()); final List<? extends Header> trailers = decoder1.getTrailers(); Assert.assertNotNull(trailers); Assert.assertEquals(1, trailers.size()); final List<? extends Header> trailers = decoder1.getTrailers(); Assert.assertNotNull(trailers); Assert.assertEquals(4, trailers.size());
1
private final Tablet committer; CommitSession(Tablet committer, long seq, InMemoryMap imm) {
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
Option histogramOption = new Option("h", "histogram", false, "print a histogram of the key-value sizes"); opts.addOption(histogramOption); boolean dump = commandLine.hasOption(dumpKeys.getOpt()); boolean doHistogram = commandLine.hasOption(histogramOption.getOpt()); long countBuckets[] = new long[11]; long sizeBuckets[] = new long[countBuckets.length]; long totalSize = 0; if (doHistogram || dump) { if (dump) System.out.println(key + " -> " + value); if (doHistogram) { long size = key.getSize() + value.getSize(); int bucket = (int) Math.log10(size); countBuckets[bucket]++; sizeBuckets[bucket] += size; totalSize += size; } if (doHistogram) { System.out.println("Up to size count %-age"); for (int i = 1; i < countBuckets.length; i++) { System.out.println(String.format("%11.0f : %10d %6.2f%%", Math.pow(10, i), countBuckets[i], sizeBuckets[i] * 100. / totalSize)); } }
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Objects;
0
import javax.naming.AuthenticationException; import javax.naming.CommunicationException; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import javax.naming.directory.BasicAttribute; import javax.naming.directory.BasicAttributes; import javax.naming.directory.DirContext; import javax.naming.directory.ModificationItem; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; } else if ("sAMAccountName".equals(key) && (value != null)) { // Replace the following _illegal_ characters: [ ] : ; | = + * ? < > / , (space) \ value = value.toString().replaceAll("\\[|\\]|\\:|\\;|\\||\\=|\\+|\\*|\\?|\\<|\\>|\\/|\\\\|\\,|\\s", "_"); attribute.add(value); Rdn rdn = new Rdn("cn", cn); LdapName name = new LdapName(principalContainerDn); name.add(name.size(), rdn); dn,
0
import cz.seznam.euphoria.testing.DatasetAssert;
0
if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_SUCCESS) {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BidiMap.java,v 1.2 2003/10/05 20:38:55 scolebourne Exp $ * @version $Revision: 1.2 $ $Date: 2003/10/05 20:38:55 $ * Puts the key-value pair into the map, replacing any previous pair. * <p> * When adding a key-value pair, the value may already exist in the map * against a different key. That mapping is removed, to ensure that the * value only occurs once in the inverse map. * <pre> * BidiMap map1 = new HashBidiMap(); * map.put("A","B"); // contains A mapped to B, as per Map * map.put("A","C"); // contains A mapped to C, as per Map * * BidiMap map2 = new HashBidiMap(); * map.put("A","B"); // contains A mapped to B, as per Map * map.put("C","B"); // contains C mapped to B, key A is removed * </pre> * * @param key the key to store * @param value the value to store * @return the previous value mapped to this key * * @throws UnsupportedOperationException if the <code>put</code> method is not supported * @throws ClassCastException (optional) if the map limits the type of the * value and the specifed value is inappropriate * @throws IllegalArgumentException (optional) if the map limits the values * in some way and the value was invalid * @throws NullPointerException (optional) if the map limits the values to * non-null and null was specified */ public Object put(Object key, Object value); /**
0
System.out.println("query [" + dslQuery + "] failed, results:" + results);
0
package org.apache.beam.sdk.options; import org.apache.beam.sdk.options.Validation.Required; import org.apache.beam.sdk.util.common.ReflectHelpers;
0
import org.apache.http.testserver.SimpleEventListener; import org.apache.http.testserver.SimpleHttpRequestHandlerResolver;
0
final int buffersize, final int buffersize, public void setSocketTimeout(final int timeout) {
0
public CompositeMap(Map<K, V>... composite) {
0
* Copyright (C) 2015 Google Inc.
0
import org.apache.batik.ext.awt.image.SpotLight; if (light instanceof SpotLight) { SpotLight slight = (SpotLight)light; final double[][] LA = new double[w][4]; slight.getLightRow4(x, y+i*scaleY, scaleX, w, NR, LA); double vs = L[3]; if (vs == 0) { a = 0; } else { L[2] += 1; norm = L[0]*L[0] + L[1]*L[1] + L[2]*L[2]; double dot = N[0]*L[0] + N[1]*L[1] + N[2]*L[2]; vs = vs*Math.pow(dot/norm, specularExponent); a = (int)(mult*vs + 0.5); } else if(!light.isConstant()){ final double[][] LA = new double[w][4]; for(i=0; i<h; i++){ // System.out.println("Row: " + i); final double [][] NR = NA[i]; light.getLightRow(x, y+i*scaleY, scaleX, w, NR, LA); for (j=0; j<w; j++){ // Get Normal final double [] N = NR[j]; // Get Light Vector final double [] L = LA[j]; L[2] += 1; norm = L[0]*L[0] + L[1]*L[1] + L[2]*L[2]; norm = Math.sqrt(norm); double dot = N[0]*L[0] + N[1]*L[1] + N[2]*L[2]; // vs = vs/norm; norm = Math.pow(dot/norm, specularExponent); a = (int)(mult*norm + 0.5); if ((a & 0xFFFFFF00) != 0) a = ((a & 0x80000000) != 0)?0:255; pixels[p++] = (a << 24 | pixel); } p += adjust; }
0
* * @deprecated use {@link javax.servlet.http.Cookie} instead.
0
package org.apache.commons.digester3;
1
if (!s.keepAlive(this.conn, this.response)) {
0
import org.apache.batik.svggen.font.table.Os2Table; import org.apache.batik.svggen.font.table.Table; import org.apache.batik.svggen.font.table.TableDirectory;
0
this(null); super(createNodeModel(c)); * Creates the {@code NodeModel} for this configuration based on a passed in * source configuration. This implementation creates an * {@link InMemoryNodeModel}. If the passed in source configuration is * defined, its root node also becomes the root node of this configuration. * Otherwise, a new, empty root node is used. * * @param c the configuration that is to be copied * @return the {@code NodeModel} for the new configuration */ private static NodeModel<ImmutableNode> createNodeModel( HierarchicalConfiguration<ImmutableNode> c) { ImmutableNode root = (c != null) ? c.getRootNode() : null; return new InMemoryNodeModel(root); } /**
0
if (ke instanceof SessionMovedException) { throw ke; } if (subTxnResult.err == Code.SESSIONMOVED.intValue()) { throw new SessionMovedException(); }
0
public class CheckAccessTransformer extends AbstractSAXTransformer implements Disposable { /* (non-Javadoc) public void startElement(String uri, String name, String raw, Attributes attr) throws SAXException { if (RIGHTS_NAMESPACE_URI.equals(uri) && ACCESS_TAG.equals(name)) { if(!urs.userIsAllowed(id, this.ptm.getPortalObjects().getProfileManager().getUser())) {
0
FlinkBatchPortablePipelineTranslator.createTranslationContext( jobInfo, pipelineOptions, filesToStage); FlinkStreamingPortablePipelineTranslator.createTranslationContext( jobInfo, pipelineOptions, filesToStage);
0