Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.osgi.framework.BundleContext; private volatile ConfigurationSupport optionalSupport; @Override public void deactivate() { if ( this.optionalSupport != null ) { this.optionalSupport.close(); this.optionalSupport = null; } super.deactivate(); } @Override public void activate(final BundleContext bundleContext) { super.activate(bundleContext); this.optionalSupport = new ConfigurationSupport(bundleContext); } @SuppressWarnings("unchecked") if (this.optionalSupport.isConfigurable(
0
import javax.annotation.Nullable; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Stream;
0
import java.util.HashMap; import java.util.Map; * The attribute-value map map. */ protected static Map attributeValues = new HashMap(3); static { Map values = new HashMap(2); values.put("mode", "normal"); attributeValues.put(null, values); } /** /** * Returns the default attribute values in a map. * @return null if this element has no attribute with a default value. */ protected Map getDefaultAttributeValues() { return attributeValues; }
0
import org.apache.ambari.server.orm.dao.RequestDAO;
0
* <p> * It is expected that <code>newStackIdentities</code> and <code>userIdentities</code> are not null. * However, <code>previousStackIdentities</code> may be null in the event the user added a Kerberos * identity that was then added in the new Kerberos descriptor. In this case, the user's values * for the principal name and keytab file are kept while adding any other changes from tne new stack. KerberosPrincipalDescriptor oldValuePrincipal = (previousStackIdentity == null) ? null : previousStackIdentity.getPrincipalDescriptor(); KerberosKeytabDescriptor oldValueKeytab = (previousStackIdentity == null) ? null : previousStackIdentity.getKeytabDescriptor();
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; /** * Signals that the connection has been closed unexpectedly. * * @since 4.0 */ public class ConnectionClosedException extends IOException { private static final long serialVersionUID = 617550366255636674L; /** * Creates a new ConnectionClosedException with the specified detail message. * * @param message The exception detail message */ public ConnectionClosedException(final String message) { super(message); } }
1
protected InProcessStepContext createStepContext(String stepName, String transformName) {
0
private final Class<? extends T> type; public BeanHandler(Class<? extends T> type) { public BeanHandler(Class<? extends T> type, RowProcessor convert) {
0
public MagicNumberFileFilter(final byte[] magicNumber) { public MagicNumberFileFilter(final String magicNumber) { public MagicNumberFileFilter(final String magicNumber, final long offset) { public MagicNumberFileFilter(final byte[] magicNumber, final long offset) { public boolean accept(final File file) { final byte[] fileBytes = new byte[this.magicNumbers.length]; final int read = randomAccessFile.read(fileBytes); } catch (final IOException ioe) { final StringBuilder builder = new StringBuilder(super.toString());
1
* Closes this random access file stream and releases any system resources associated with the stream.
0
* @version $Id$ public class LoopingIteratorTest extends TestCase { public LoopingIteratorTest(String testName) {
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.beam.dsls.sql.interpreter.operator.date; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlExpression; import org.apache.calcite.sql.type.SqlTypeName; import org.junit.Test; /** * Test for BeamSqlLocalTimestampExpression. */ public class BeamSqlLocalTimestampExpressionTest extends BeamSqlDateExpressionTestBase { @Test public void test() { List<BeamSqlExpression> operands = new ArrayList<>(); assertEquals(SqlTypeName.TIMESTAMP, new BeamSqlLocalTimestampExpression(operands).evaluate(record).getOutputType()); } }
0
import org.apache.accumulo.core.spi.cache.CacheEntry; public <T extends Weighable> T getIndex(Supplier<T> indexSupplier) {
0
private LocalVariable[] local_variable_table; // variables public final void setLocalVariableTable( LocalVariable[] local_variable_table ) { this.local_variable_table = local_variable_table; }
0
if (getLogger().isDebugEnabled()) { getLogger().debug("InsertBean performed.");
0
.setOfflineScan(isOfflineScan(implementingClass, conf));
0
new HashSet<>(Arrays.asList(new String[]{ GROUP_GROUPNAME_PROPERTY_ID})); final Set<GroupRequest> requests = new HashSet<>(); final Set<GroupRequest> requests = new HashSet<>(); Set<Resource> resources = new HashSet<>(); final Set<GroupRequest> requests = new HashSet<>(); final Set<GroupRequest> requests = new HashSet<>();
1
/* (non-Javadoc) * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ /* <catalogues default="portalTools"> <catalogue id="portalTools" name="portalTools" location="cocoon:/i18n"/> </catalogues> */ if (conf.getChild("catalogues").getAttribute("new", "no").equals("no")) { DefaultConfiguration root = new DefaultConfiguration("root"); DefaultConfiguration defconf = new DefaultConfiguration("catalogues"); defconf.setAttribute("default", "default"); root.addChild(defconf); PortalToolManager ptm = null; try { ptm = (PortalToolManager) this.manager.lookup(PortalToolManager.ROLE); List i18nc = ptm.getI18n(); for(Iterator it = i18nc.iterator(); it.hasNext();) { PortalToolCatalogue ptc = (PortalToolCatalogue) it.next(); DefaultConfiguration catConf = new DefaultConfiguration("catalogue"); catConf.setAttribute("id", ptc.getId()); catConf.setAttribute("name", ptc.getName()); catConf.setAttribute("location", ptc.getLocation()); defconf.addChild(catConf); } super.configure(root); } catch (ServiceException e) { e.printStackTrace(); } catch (ConfigurationException e) { e.printStackTrace(); } finally { this.manager.release(ptm); }
0
PrepRequestProcessor.checkACL(zks, zks.dataTree.convertLong(n.acl), ZooDefs.Perms.READ, PrepRequestProcessor.checkACL(zks, zks.dataTree.convertLong(n.acl), ZooDefs.Perms.READ,
0
ret.add(AtlasTypeUtil.getObjectId(entity)); AtlasEntity ret = toTableEntity(AtlasTypeUtil.getObjectId(dbEntity), table, entityExtInfo); AtlasObjectId tableId = AtlasTypeUtil.getObjectId(ret); ret.setRelationshipAttribute(ATTRIBUTE_STORAGEDESC, AtlasTypeUtil.getAtlasRelatedObjectId(sd, RELATIONSHIP_HIVE_TABLE_STORAGE_DESC)); ret.setRelationshipAttribute(ATTRIBUTE_PARTITION_KEYS, AtlasTypeUtil.getAtlasRelatedObjectIds(partitionKeys, RELATIONSHIP_HIVE_TABLE_PART_KEYS)); ret.setRelationshipAttribute(ATTRIBUTE_COLUMNS, AtlasTypeUtil.getAtlasRelatedObjectIds(columns, RELATIONSHIP_HIVE_TABLE_COLUMNS)); ret.setRelationshipAttribute(ATTRIBUTE_BUCKET, AtlasTypeUtil.getAtlasRelatedObjectId(bucketEntity, RELATIONSHIP_AWS_S3_BUCKET_S3_PSEUDO_DIRS)); ret.setRelationshipAttribute(ATTRIBUTE_INPUTS, AtlasTypeUtil.getAtlasRelatedObjectIds(inputs, RELATIONSHIP_DATASET_PROCESS_INPUTS)); ret.setRelationshipAttribute(ATTRIBUTE_OUTPUTS, AtlasTypeUtil.getAtlasRelatedObjectIds(outputs, RELATIONSHIP_PROCESS_DATASET_OUTPUTS)); AtlasObjectId objId = AtlasTypeUtil.getObjectId(dbOrTable); AtlasRelatedObjectId objIdRelatedObject = new AtlasRelatedObjectId(AtlasTypeUtil.getObjectId(nsEntity), RELATIONSHIP_HBASE_TABLE_NAMESPACE);
0
* From the Java documentation <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html">Standard * charsets</a>: public class CharEncoding { * CharEncodingISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1. </p>
0
File outputDirectory = new File( buildDirectory, "test-classes" ); File testFile = getTestFile( "target/test-classes/org.apache.maven.maven-model_1.0.0.0.jar" );
0
if (elemRefs) { getRoot().setReference(document.getDocumentElement()); } * @param listDelimiter the delimiter for attributes with multiple values
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
import org.apache.accumulo.core.client.TableNamespaceNotFoundException; import org.apache.accumulo.core.client.impl.TableNamespaces; OpTimer opTimer = new OpTimer(log, Level.TRACE).start("Checking if table " + tableName + " exists..."); String namespace = Tables.extractNamespace(tableName); if (!namespaceExists(namespace)) { String info = "Table namespace not found while trying to create table"; throw new RuntimeException(new TableNamespaceNotFoundException(null, namespace, info)); } String namespace = Tables.extractNamespace(newTableName); if (!namespaceExists(namespace)) { String info = "Table namespace not found while cloning table"; throw new RuntimeException(new TableNamespaceNotFoundException(null, namespace, info)); } String namespace = Tables.extractNamespace(newTableName); if (!namespaceExists(namespace)) { String info = "Table namespace not found while renaming table"; throw new RuntimeException(new TableNamespaceNotFoundException(null, namespace, info)); } String namespace = Tables.extractNamespace(tableName); if (!namespaceExists(namespace)) { String info = "Table namespace not found while importing to table"; throw new RuntimeException(new TableNamespaceNotFoundException(null, namespace, info)); } private boolean namespaceExists(String namespace) { return TableNamespaces.getNameToIdMap(instance).containsKey(namespace); }
0
protected final void useAnnotationHandlerFactory( AnnotationHandlerFactory annotationHandlerFactory ) protected final void bindRulesFrom( final Class<?> type ) @SuppressWarnings( "unchecked" )
0
* Copyright 2017 Seznam.cz, a.s.
0
case ALTERDATABASE: case ALTERDATABASE_OWNER: alterDatabase(dgiBridge, event); break; private void alterDatabase(HiveMetaStoreBridge dgiBridge, HiveEvent event) throws Exception { assert event.outputs != null && event.outputs.size() > 0; for (WriteEntity writeEntity : event.outputs) { if (writeEntity.getType() == Type.DATABASE) { //Create/update table entity createOrUpdateEntities(dgiBridge, writeEntity); } } }
0
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElements;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/VariablePointer.java,v 1.14 2003/03/11 00:59:23 dmitri Exp $ * $Revision: 1.14 $ * $Date: 2003/03/11 00:59:23 $ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * @version $Revision: 1.14 $ $Date: 2003/03/11 00:59:23 $
0
import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.util.SortedSet; SortedSet<String> sigTypes = new TreeSet<>(pairsMap.keySet()); for (String kt : sigTypes) { } else if (BuiltinIdentities.Constants.ED25519.equalsIgnoreCase(keyType)) { return Collections.singletonList(BuiltinSignatures.ed25519); throw new NoSuchAlgorithmException("Unknown key type: " + keyType); if ("*".equalsIgnoreCase(kt) || "all".equalsIgnoreCase(kt)) { ValidateUtils.checkTrue(typeNames.size() == 1, "Wildcard key type must be the only one specified: %s", typeNames); return createKeyPairs(BuiltinIdentities.NAMES); } throw new NoSuchAlgorithmException("ECC not supported: " + keyType); } else if (BuiltinIdentities.Constants.ED25519.equalsIgnoreCase(keyType)) { if (!SecurityUtils.isEDDSACurveSupported()) { throw new NoSuchAlgorithmException("EDDSA curves not supported: " + keyType); } KeyPairGenerator g = SecurityUtils.getKeyPairGenerator(SecurityUtils.EDDSA); return Collections.singletonList(g.generateKeyPair());
0
if (tableManager == null) tableManager = new TableManager(); if (oldData != null) oldState = TableState.valueOf(new String(oldData)); if (!transition) throw new IllegalTableTransitionException(oldState, newState); if (zooStateCache.get(ZooUtil.getRoot(instance) + Constants.ZTABLES + "/" + tableId + Constants.ZTABLE_STATE) != null) updateTableStateCache(tableId); if (log.isTraceEnabled()) log.trace(event); if (Constants.ZTABLE_STATE.equals("/" + sa[1])) tableId = sa[0]; .equals(tablesPrefix + "/" + tableId + Constants.ZTABLE_NAME))) tableStateCache.remove(tableId); if (log.isTraceEnabled()) log.trace("Session expired " + event); if (log.isTraceEnabled()) log.trace("Ignored " + event);
1
@Override @Override @Override @Override
0
package org.apache.commons.dbcp2;
1
LOG.warn("Exception while trying to get socket address for {}", hostPort, e); LOG.info("Found matched server id {} with host port: {}", id, hostPort); LOG.info("Could not find matching address entry for id: {}", id);
0
private static long now(PubsubReader<?> reader) {
0
Set<Map<String, Object>> propertySet = new LinkedHashSet<>(); Map<String, Object> properties = new LinkedHashMap<>(); Set<Map<String, Object>> propertySet = new LinkedHashSet<>(); Map<String, Object> properties = new LinkedHashMap<>(); Set<ConfigurationResponse> allResponse = new HashSet<>(); Set<ConfigurationResponse> orResponse = new HashSet<>(); Set<String> propertyIds = new HashSet<>(); Map<String, Object> properties = new LinkedHashMap<>();
1
/* * Copyright 2003-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Revision: 1.4 $ $Date: 2004/02/18 00:57:39 $
0
return new MultiSetIterator<>(this); return new UniqueSet<>(this); return new EntrySet<>(this);
1
base64os.write(StringUtils.getBytesUtf8(STRING_FIXTURE)); base64os.close(); byte[] decodedBytes = Base64TestData.streamToBytes(ins, new byte[64]); String str = StringUtils.newStringUtf8(decodedBytes);
0
import static org.apache.beam.sdk.values.TypeDescriptors.integers; import static org.apache.beam.sdk.values.TypeDescriptors.iterables; import static org.apache.beam.sdk.values.TypeDescriptors.kvs; import static org.apache.beam.sdk.values.TypeDescriptors.lists; import static org.apache.beam.sdk.values.TypeDescriptors.sets; import static org.apache.beam.sdk.values.TypeDescriptors.strings; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; * Tests for {@link TypeDescriptors}. TypeDescriptor<Iterable<String>> descriptor = iterables(strings()); assertEquals(descriptor, new TypeDescriptor<Iterable<String>>() {}); TypeDescriptor<Set<String>> descriptor = sets(strings()); assertEquals(descriptor, new TypeDescriptor<Set<String>>() {}); kvs(strings(), integers()); assertEquals(descriptor, new TypeDescriptor<KV<String, Integer>>() {}); TypeDescriptor<List<String>> descriptor = lists(strings()); assertEquals(descriptor, new TypeDescriptor<List<String>>() {}); assertNotEquals(descriptor, new TypeDescriptor<List<Boolean>>() {}); public void testTypeDescriptorsListsOfLists() throws Exception { TypeDescriptor<List<List<String>>> descriptor = lists(lists(strings())); assertEquals(descriptor, new TypeDescriptor<List<List<String>>>() {}); assertNotEquals(descriptor, new TypeDescriptor<List<String>>() {}); assertNotEquals(descriptor, new TypeDescriptor<List<Boolean>>() {});
0
* * 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/>. *
0
if (auths != null && auths.length() > 0) if (auths != null && auths.length() > 0) for (String a : auths.split(",")) authorizations.add(a);
0
import org.apache.cocoon.components.flow.Interpreter.Argument; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; fom_wk.setLogger(logger); result.setLogger(logger); result.setLogger(logger);
0
this.registerPropertyOverrideConfigurer(parserContext, Constants.DEFAULT_SPRING_SITEMAP_CONFIGURATION_FILES);
0
* * */ * @return The converted value * @throws ParseException if an error occurs parsing a String to a Number
0
package org.apache.beam.dsls.sql.planner; import org.apache.beam.dsls.sql.rel.BeamRelNode; import org.apache.beam.dsls.sql.schema.BaseBeamTable;
0
import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.INVOKESTATIC; import org.apache.bcel.generic.InstructionList; import org.apache.bcel.generic.MethodGen; import org.apache.bcel.generic.Type; org.apache.bcel.Constants {
0
* @return the iterator for the resolvers. * @return true if there is more elements. * @return the next element
0
Method m; m = c.getMethod("getName", (Class[]) null); name = (String) m.invoke(felixCommand, (Object[]) null); m = c.getMethod("getShortDescription", (Class[]) null); help = (String) m.invoke(felixCommand, (Object[]) null); m = c.getMethod("getUsage", (Class[]) null); usage = (String) m.invoke(felixCommand, (Object[]) null);
0
/* import org.apache.felix.ipojo.ComponentInstance; import org.apache.felix.ipojo.test.scenarios.component.SimpleClass; } public void testWhenNoInterface() { IPOJOHelper helper = new IPOJOHelper(this); String factoryName = "org.apache.felix.ipojo.test.scenarios.component.SimpleClass"; ComponentInstance ci = helper.createComponentInstance(factoryName); waitForService(SimpleClass.class.getName(), null, 5000); SimpleClass simple = (SimpleClass) getServiceObject(SimpleClass.class.getName(), null); assertEquals("Hello", simple.hello()); ci.dispose();
0
import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Context; public Response performLogout(@Context HttpServletRequest servletRequest) { servletRequest.getSession().invalidate();
0
final InputStream instream, int buffersize, final InputStream instream, final byte[] bytes, final byte[] bytes, int buffersize, final byte[] bytes, final String s, final String charset, final HttpParams params) final String s, final String charset, int buffersize) final String s, final HttpParams params) final String s, final String charset)
0
public static ExecutorSettings thermosOnlyWithOverhead(Iterable<Resource> resources) { executor.clearResources().addAllResources(resources);
0
package org.apache.http.impl.client.cache;
0
// FTPS Reply Codes public static final int CODE_234 = 234; public static final int CODE_235 = 235; public static final int CODE_334 = 334; public static final int CODE_335 = 335; public static final int CODE_431 = 431; public static final int CODE_533 = 533; public static final int CODE_534 = 534; public static final int CODE_535 = 535; public static final int CODE_536 = 536; public static final int SECURITY_DATA_EXCHANGE_COMPLETE = CODE_234; public static final int SECURITY_DATA_EXCHANGE_SUCCESSFULLY = CODE_235; public static final int SECURITY_MECHANISM_IS_OK = CODE_334; public static final int SECURITY_DATA_IS_ACCEPTABLE = CODE_335; public static final int UNAVAILABLE_RESOURCE = CODE_431; public static final int DENIED_FOR_POLICY_REASONS = CODE_533; public static final int REQUEST_DENIED = CODE_534; public static final int FAILED_SECURITY_CHECK = CODE_535; public static final int REQUESTED_PROT_LEVEL_NOT_SUPPORTED = CODE_536;
0
import com.google.common.collect.ImmutableList; import java.io.Serializable; import java.util.List;
0
import java.awt.RenderingHints; /** * Sets the specified rendering hints to be used for future renderings. * @param rh the rendering hints to use */ void setRenderingHints(RenderingHints rh); /** * Returns the rendering hints this ImageRenderer is using for its * rendering. * @return the rendering hints being used */ RenderingHints getRenderingHints();
0
import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.ServiceSelector; import org.apache.avalon.framework.service.Serviceable; * @version CVS $Id: TagTransformer.java,v 1.5 2004/02/06 22:56:46 joerg Exp $ implements Transformer, Serviceable, Configurable, Disposable, Recyclable { private ServiceSelector tagNamespaceSelector; private ServiceSelector transformerSelector; /** The Avalon ServiceManager */ private ServiceManager manager; * Avalon Serviceable Interface * @param manager The Avalon Service Manager public void service(ServiceManager manager) throws ServiceException { tagNamespaceSelector = (ServiceSelector) manager.lookup(Tag.ROLE + "Selector"); transformerSelector = (ServiceSelector) manager.lookup(Transformer.ROLE + "Selector"); } catch (ServiceException e) { ServiceSelector tagSelector = (ServiceSelector)tagSelectorStack.pop(); } catch (ServiceException e) { ServiceSelector tagSelector = (ServiceSelector)tagSelectorStack.pop(); ServiceSelector tagSelector = null; tagSelector = (ServiceSelector) tagNamespaceSelector.select(namespaceURI); } catch (ServiceException e) {
0
* * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * - Redistributions of source code must retain the above copyright * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * nor the names of its contributors may be used to endorse or * promote products derived from this software without specific prior * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * * * * * * * * *
0
import org.apache.xml.security.stax.securityEvent.AlgorithmSuiteSecurityEvent; checkEncryptionMethod(securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"); checkEncryptionMethod(securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"); checkEncryptionMethod(securityEventListener, "http://www.w3.org/2001/04/xmlenc#aes256-cbc"); checkEncryptionMethod(securityEventListener, "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"); protected void checkEncryptionMethod( TestSecurityEventListener securityEventListener, String encryptionAlgorithm ) { List<SecurityEvent> algorithmEvents = securityEventListener.getTokenEvents(SecurityEventConstants.AlgorithmSuite); assertFalse(algorithmEvents.isEmpty()); for (SecurityEvent event : algorithmEvents) { AlgorithmSuiteSecurityEvent algorithmEvent = (AlgorithmSuiteSecurityEvent) event; if (algorithmEvent.getKeyUsage() == XMLSecurityConstants.Enc) { assertEquals(encryptionAlgorithm, algorithmEvent.getAlgorithmURI()); } } }
0
import org.slf4j.LoggerFactory; import org.slf4j.Logger; private final Logger log = LoggerFactory.getLogger(getClass());
0
* } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && } } else if (frame_type == Const.FULL_FRAME) { } } else if (frame_type == Const.FULL_FRAME) { } else if (frame_type == Const.FULL_FRAME) { } else if (frame_type >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && } } else if (frame_type == Const.FULL_FRAME) { } else if (f >= Const.SAME_LOCALS_1_STACK_ITEM_FRAME && * *
0
* <li>{@link AccumuloOutputFormat#setConnectorInfo(Job, String, String)} * Gets the serialized token class from either the configuration or the token file. * @deprecated since 1.6.0; Use {@link #getAuthenticationToken(JobContext)} instead. @Deprecated return getAuthenticationToken(context).getClass().getName(); } /** * Gets the serialized token from either the configuration or the token file. * * @since 1.5.0 * @deprecated since 1.6.0; Use {@link #getAuthenticationToken(JobContext)} instead. */ @Deprecated protected static byte[] getToken(JobContext context) { return AuthenticationTokenSerializer.serialize(getAuthenticationToken(context)); * Gets the authenticated token from either the specified token file or directly from the configuration, whichever was used when the job was configured. * @return the principal's authentication token * @since 1.6.0 * @see #setConnectorInfo(Job, String, String) protected static AuthenticationToken getAuthenticationToken(JobContext context) { return OutputConfigurator.getAuthenticationToken(CLASS, InputFormatBase.getConfiguration(context)); this.conn = getInstance(context).getConnector(getPrincipal(context), getAuthenticationToken(context)); String principal = getPrincipal(job); AuthenticationToken token = getAuthenticationToken(job); Connector c = getInstance(job).getConnector(principal, token); if (!c.securityOperations().authenticateUser(principal, token))
0