Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
* * * * * * * * * * * * * * * * * * * * * * * *
0
* Licensed under the Apache License, Version 2.0 (the "License") * initSubNodeList(createSubNodeList((ConfigurationNode) parent.getNode(), name)); if (name.getPrefix() != null) if (!WILDCARD.equals(name.getName()))
0
assertEquals(builder, writer.getBuilder());
0
public WildcardFilter(final String wildcard) { public WildcardFilter(final String[] wildcards) { public WildcardFilter(final List<String> wildcards) { public boolean accept(final File dir, final String name) { for (final String wildcard : wildcards) { public boolean accept(final File file) { for (final String wildcard : wildcards) {
1
@ServiceDependency(service=Sequencer.class, filter="(test=simple)")
0
dep.addAttribute(new Attribute("Id", m_dependencies[i].getId()));
0
* builder.setPTransformLabel("myTransform"); * builder.setLabel(MonitoringInfoConstants.Labels.PTRANSFORM, "myTransform"); MonitoringInfo mi = * builder.build(); /** * Sets the IntDistributionData of the DistributionData in the MonitoringInfo, and the appropriate * type URN. */ public SimpleMonitoringInfoBuilder setInt64DistributionValue(DistributionData data) { this.builder .getMetricBuilder() .getDistributionDataBuilder() .getIntDistributionDataBuilder() .setCount(data.count()) .setSum(data.sum()) .setMin(data.min()) .setMax(data.max()); this.setInt64DistributionTypeUrn(); return this; } /** Sets the the appropriate type URN for int64 distribution tuples. */ public SimpleMonitoringInfoBuilder setInt64DistributionTypeUrn() { this.builder.setType(MonitoringInfoConstants.TypeUrns.DISTRIBUTION_INT64); return this; }
0
protected FakeClock clock = new FakeClock(); new StateManager(DbStorageTestUtil.setupStorage(this), clock);
0
* @version $Revision$
0
* * * * * * * * * * * * * *
0
(last instanceof ATHROW) )) { throw new StaticCodeInstructionConstraintException("Execution must not fall off the bottom of the code array. This constraint is enforced statically as some existing verifiers do - so it may be a false alarm if the last instruction is not reachable."); } if (ints[j]==i) { return true; } if ((f.getAccessFlags() & (Constants.ACC_PUBLIC | Constants.ACC_PROTECTED)) == 0) { f = null; } if (f == null) { constraintViolated(o, "Referenced field '"+field_name+"' does not exist in class '"+jc.getClassName()+"'."); } if (meth != null) { break; }
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.
0
import org.apache.beam.sdk.util.SerializableUtils; private static class NonSerializable {} private static class NonSerializableTranslator implements SerializableFunction<String, NonSerializable> { @Override public NonSerializable apply(String from) { return new NonSerializable(); } } @Test public void testNestedValueProviderSerialize() throws Exception { ValueProvider<NonSerializable> nvp = NestedValueProvider.of( StaticValueProvider.of("foo"), new NonSerializableTranslator()); SerializableUtils.ensureSerializable(nvp); }
0
public List<UnboundedJmsSource> split(
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.event; /** * Listener invoked when a field value changes. * * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a> * @version CVS $Id: ValueChangedListener.java,v 1.1 2004/03/09 10:33:45 reinhard Exp $ */ public interface ValueChangedListener extends WidgetListener { void valueChanged(ValueChangedEvent event); }
0
import org.apache.cocoon.core.container.spring.CocoonRequestAttributes; import org.apache.cocoon.core.container.spring.Container; import org.apache.cocoon.environment.Context; import org.apache.cocoon.environment.ObjectModelHelper; import org.apache.cocoon.environment.Request; public void service(ServiceManager avalonManager) throws ServiceException { this.manager = avalonManager; final EnvironmentInfo info = stack.getCurrentInfo(); final Request request = ObjectModelHelper.getRequest(info.environment.getObjectModel()); final Context context = ObjectModelHelper.getContext(info.environment.getObjectModel()); final Container container = Container.getCurrentContainer(context, new CocoonRequestAttributes(request)); return (ServiceManager)container.getBeanFactory().getBean(ProcessingUtil.SERVICE_MANAGER_ROLE);
0
sources.add(state(sourceNamespace, address)); sources.add(state(sourceNamespace, address)); sources.add(state(sourceNamespace, address));
0
import com.google.common.base.Predicate; import com.google.common.collect.Iterables;
0
bw = context.createBatchWriter(tableName, bwConfig);
0
import org.apache.beam.sdk.testing.ValidatesRunner; @Category({ValidatesRunner.class, UsesUnboundedPCollections.class}) @Category(ValidatesRunner.class)
0
Stage s = new Stage(requestId, "/tmp", "cluster1", 1L, "context", clusterHostInfo);
1
@Deprecated
0
public class VerifierFactoryListModel implements VerifierFactoryObserver,
0
TimerProcessor<String> timerProcessor = firedTimers::put;
0
ZooKeeperServer.ChangeRecord cr = zks.outstandingChanges.remove(0); if (zks.outstandingChangesForPath.get(cr.path) == cr) { zks.outstandingChangesForPath.remove(cr.path); }
0
* http://www.apache.org/licenses/LICENSE-2.0
0
clearBean();
0
new Object[]{str, null, prefixResolver, XPath.SELECT, null, funcTable};
1
return new HashSet<>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ? GANGLIA_CLUSTER_NAME_MAP.get(component) : Collections.<String>emptyList());
0
public static final int ACTIVE = 0; public static final int CLOSING = 1; public static final int CLOSED = Integer.MAX_VALUE; int getStatus();
0
import java.sql.SQLException; import org.apache.ambari.server.H2DatabaseCleaner; H2DatabaseCleaner.resetSequences(injector); public void teardown() throws AmbariException, SQLException { H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);
0
return getTable(tableRef, null); } @Override public Table getTable(TableReference tableRef, @Nullable List<String> selectedFields) throws InterruptedException, IOException {
0
cookie.setDomain(".co.com"); Assert.assertTrue(h.match(cookie, new CookieOrigin("apache.co.com", 80, "/stuff", false))); cookie.setDomain("co.com"); Assert.assertFalse(h.match(cookie, new CookieOrigin("apache.co.com", 80, "/stuff", false))); cookie.setDomain("apache.com"); Assert.assertTrue(h.match(cookie, new CookieOrigin("apache.com", 80, "/stuff", false))); cookie.setDomain(".apache.com"); Assert.assertTrue(h.match(cookie, new CookieOrigin("www.apache.com", 80, "/stuff", false)));
0
import org.apache.ambari.server.api.services.Result; import org.apache.ambari.server.api.services.ResultStatus; import org.apache.ambari.server.api.util.TreeNode; import org.apache.ambari.server.controller.spi.Resource; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVPrinter;
0
/** The current synchronized upstream processing time or {@code null} if unknown. */ @Nullable public abstract Instant currentSynchronizedProcessingTime(); /** The current event time for the input or {@code null} if unknown. */ @Nullable public abstract Instant currentEventTime();
0
executeWork(worker, progressUpdater); /** Executes the work and report progress. For testing only. */ void executeWork(WorkExecutor worker, DataflowWorkProgressUpdater progressUpdater) throws Exception { progressUpdater.startReportingProgress(); // Blocks while executing the work. try { worker.execute(); } finally { // stopReportingProgress can throw an exception if the final progress // update fails. For correctness, the task must then be marked as failed. progressUpdater.stopReportingProgress(); } }
0
import java.util.ArrayList; import org.apache.xml.security.utils.resolver.*; //for javadoc
0
* @deprecated This has been deprecated. Use the org.apache.felix.status * API instead.
0
import java.util.Map; import org.apache.avalon.excalibur.pool.Poolable; import org.apache.avalon.excalibur.pool.Recyclable; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.ServiceSelector; import org.apache.avalon.framework.service.Serviceable; import org.apache.cocoon.components.web3.Web3; import org.apache.cocoon.components.web3.Web3Client; import org.apache.cocoon.components.web3.Web3DataSource; import org.apache.cocoon.components.web3.Web3Streamer; import org.apache.cocoon.environment.SourceResolver; import com.sap.mw.jco.IFunctionTemplate; import com.sap.mw.jco.JCO; * @version CVS $Id: Web3RfcTransformer.java,v 1.8 2004/02/06 22:54:05 joerg Exp $ implements Serviceable, Disposable, Configurable, Poolable, Recyclable { /** The service manager instance */ protected ServiceManager manager = null; public void service(ServiceManager manager) { ServiceSelector r3sc = null; r3sc = (ServiceSelector) ServiceSelector streamerSelector = null; (ServiceSelector)
0
package org.apache.beam.sdk.extensions.sql.interpreter.operator.comparison; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlExpression; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlPrimitive; import org.apache.beam.sdk.extensions.sql.schema.BeamSqlRow;
0
package org.apache.hc.core5.http.impl.nio; import org.apache.hc.core5.http.nio.HttpAsyncRequestConsumer;
1
package org.apache.sshd.server.auth.password; import org.apache.sshd.server.auth.AbstractUserAuth;
0
/* * Copyright 2001-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 $Id: FilenameUtils.java,v 1.7 2004/02/23 04:35:59 bayard Exp $
0
(currTransY != prevTransY));
0
* Copyright 2002-2005 The Apache Software Foundation.
0
import java.nio.file.Paths; * @see #detectTargetFolder(Path) public static Path detectTargetFolder(Class<?> anchor) { return detectTargetFolder(getClassContainerLocationPath(anchor)); * @return A {@link Path} of the location of the class bytes container * @throws IllegalArgumentException If location is not a valid {@link Path} location * @see #toPathSource(URI) public static Path getClassContainerLocationPath(Class<?> clazz) return toPathSource(uri); * a {@link Path} representing is &quot;source&quot; container (e.g., * @return The matching {@link Path} * @see #toPathSource(URI) public static Path toPathSource(URL url) throws MalformedURLException { return toPathSource(url.toURI()); * a {@link Path} representing is &quot;source&quot; container (e.g., * @return The matching {@link Path} public static Path toPathSource(URI uri) throws MalformedURLException { return Paths.get(new URI(src)); * @param anchorFile An anchor {@link Path} we want to use public static Path detectTargetFolder(Path anchorFile) { for (Path file = anchorFile; file != null; file = file.getParent()) { if (!Files.isDirectory(file)) { String name = Objects.toString(file.getFileName(), ""); Path targetFolder = Objects.requireNonNull(CommonTestSupportUtils.detectTargetFolder(anchor), "Failed to detect target folder"); Path file = targetFolder.resolve("hostkey." + DEFAULT_TEST_HOST_KEY_PROVIDER_ALGORITHM.toLowerCase()); private static Path getFile(String resource) { return Paths.get(url.toURI()); return Paths.get(url.getPath()); Path file = getFile(resource); file = file.toAbsolutePath(); String filePath = Objects.toString(file, ""); provider.setPaths(Collections.singletonList(file));
0
* @version $Id$
0
try { return pArray.getBytes("UTF8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } /** String str = null; try { str = new String(encode, "UTF8"); } catch (UnsupportedEncodingException ue) { throw new RuntimeException(ue); } return str; } /**
0
String SVG_HORIZ_ORIGIN_X_DEFAULT_VALUE = "0"; String SVG_HORIZ_ORIGIN_Y_DEFAULT_VALUE = "0";
0
if (queryThreadPool.isShutdown()) { String shortMsg = "The BatchScanner was unexpectedly closed while this Iterator was still in use."; log.error(shortMsg + " Ensure that a reference to the BatchScanner is retained so that it can be closed when this Iterator is exhausted." + " Not retaining a reference to the BatchScanner guarantees that you are leaking threads in your client JVM."); throw new RuntimeException(shortMsg + " Ensure proper handling of the BatchScanner."); }
0
import com.google.common.annotations.VisibleForTesting; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
0
final int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1); } catch (final SocketException ignore) { } catch (final SocketException ignore) { final Socket tmpsocket = this.socket; final Socket sock = this.socket; } catch (final IOException ignore) { } catch (final IOException ignore) { } catch (final UnsupportedOperationException ignore) { final InetSocketAddress addr = ((InetSocketAddress) socketAddress); final StringBuilder buffer = new StringBuilder(); final SocketAddress remoteAddress = this.socket.getRemoteSocketAddress(); final SocketAddress localAddress = this.socket.getLocalSocketAddress();
0
public void testFail_badCryptoService() { m.put(Property.INSTANCE_CRYPTO_SERVICE.getKey(), "DoesNotExistCryptoService"); public void testPass_defaultCryptoService() { m.put(Property.INSTANCE_CRYPTO_SERVICE.getKey(), Property.INSTANCE_CRYPTO_SERVICE.getDefaultValue());
0
protected final HttpParams params; this.params = params; ConnPerRoute connPerRoute = ConnManagerParams.getMaxConnectionsPerRoute(params); int maxTotalConnections = ConnManagerParams.getMaxTotalConnections(params);
0
* multiple values are added for this property. (With the * <code>setListDelimiter()</code> method the delimiter character can be * specified; per default a comma is used. The * <code>setDelimiterParsingDisabled()</code> method can be used to disable * list splitting completely.)</li> * <li>Allows to specify how missing properties are treated. Per default the * get methods returning an object will return <b>null</b> if the searched * property key is not found (and no default value is provided). With the * <code>setThrowExceptionOnMissing()</code> method this behavior can be * changed to throw an exception when a requested property cannot be found.</li> * @see #setThrowExceptionOnMissing(boolean) * @see #setThrowExceptionOnMissing(boolean) * @see #setThrowExceptionOnMissing(boolean) * Get an array of strings associated with the given configuration key. * If the key doesn't map to an existing object, an empty array is returned. * If a property is added to a configuration, it is checked whether it * contains multiple values. This is obvious if the added object is a list * or an array. For strings it is checked whether the string contains the * list delimiter character that can be specified using the * <code>setListDelimiter()</code> method. If this is the case, the string * is splitted at these positions resulting in a property with multiple * values. * * @param key The configuration key. * @return The associated string array if key is found. * * @throws ConversionException is thrown if the key maps to an * object that is not a String/List of Strings. * @see #setListDelimiter(char) * @see #setDelimiterParsingDisabled(boolean) * @see #getStringArray(String)
0
public abstract class STOMPHostEvent extends STOMPEvent { public STOMPHostEvent(Type type) {
1
hints.put(BatikHints.KEY_BACKGROUND, Color.white);
0
* * parentMatched = parentMatch( key, parentPattern ); private boolean parentMatch( String key, String parentPattern )
0
final String challenge = "Basic"; final Header header = new BasicHeader(AUTH.WWW_AUTH, challenge); final AuthScheme authscheme = new BasicScheme(); final int[] germanChars = { 0xE4, 0x2D, 0xF6, 0x2D, 0xFc }; final StringBuilder buffer = new StringBuilder(); for (final int germanChar : germanChars) { final UsernamePasswordCredentials creds = new UsernamePasswordCredentials("dh", buffer.toString()); final BasicScheme authscheme = new BasicScheme(Consts.ISO_8859_1); final HttpRequest request = new BasicHttpRequest("GET", "/"); final HttpContext context = new BasicHttpContext(); final Header header = authscheme.authenticate(creds, request, context); final UsernamePasswordCredentials creds = final Header challenge = new BasicHeader(AUTH.WWW_AUTH, "Basic realm=\"test\""); final BasicScheme authscheme = new BasicScheme(); final HttpRequest request = new BasicHttpRequest("GET", "/"); final HttpContext context = new BasicHttpContext(); final Header authResponse = authscheme.authenticate(creds, request, context); final String expected = "Basic " + EncodingUtils.getAsciiString( final UsernamePasswordCredentials creds = final Header challenge = new BasicHeader(AUTH.PROXY_AUTH, "Basic realm=\"test\""); final BasicScheme authscheme = new BasicScheme(); final HttpRequest request = new BasicHttpRequest("GET", "/"); final HttpContext context = new BasicHttpContext(); final Header authResponse = authscheme.authenticate(creds, request, context); final String expected = "Basic " + EncodingUtils.getAsciiString(
0
synchronized public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
0
public static <K, V> OrderedMap<K, V> unmodifiableOrderedMap(final OrderedMap<K, V> map) { private UnmodifiableOrderedMap(final OrderedMap<K, V> map) { private void writeObject(final ObjectOutputStream out) throws IOException { private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { final OrderedMapIterator<K, V> it = decorated().mapIterator(); public V put(final K key, final V value) { public void putAll(final Map<? extends K, ? extends V> mapToCopy) { public V remove(final Object key) { final Set<Map.Entry<K, V>> set = super.entrySet(); final Set<K> set = super.keySet(); final Collection<V> coll = super.values();
0
import static org.apache.beam.sdk.testing.CombineFnTester.testCombineFn; testCombineFn(new NullCombiner(), Arrays.asList(3, 3, 5), 45); testCombineFn(new NullCombiner(), Arrays.asList(null, 3, 5), 30); testCombineFn(new NullCombiner(), Arrays.asList(3, 3, null), 18); testCombineFn(new NullCombiner(), Arrays.asList(null, 3, null), 12); testCombineFn(new NullCombiner(), Arrays.<Integer>asList(null, null, null), 8);
0
@Override @Override default: break; default: break; @Override @Override @Override @Override @Override @Override @Override private Map<KeyExtent,Long> recentlyUnloadedCache = Collections.synchronizedMap(new LRUMap(1000)); @Override ServerConfiguration.getSystemConfiguration().getCount(Property.TSERV_WORKQ_THREADS), new NamingThreadFactory("distributed work queue")); @Override @Override
0
import org.apache.http.impl.nio.codecs.AbstractContentEncoder;
0
import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.lang.reflect.Method; protected transient LocalizableSupport localizableSupport = protected transient DOMImplementation implementation; ad.localizableSupport = new LocalizableSupport(RESOURCES); ad.localizableSupport = new LocalizableSupport(RESOURCES); // Serialization ////////////////////////////////////////////////////// /** * Writes the object to the given stream. */ private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); // Save the name of the DOM implementation class. s.writeObject(implementation.getClass().getName()); } /** * Reads the object from the given stream. */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); localizableSupport = new LocalizableSupport(RESOURCES); Class c = Class.forName((String)s.readObject()); try { Method m = c.getMethod("getDOMImplementation", null); implementation = (DOMImplementation)m.invoke(null, null); } catch (Exception e) { try { implementation = (DOMImplementation)c.newInstance(); } catch (Exception ex) { } } }
1
public TabletLocation _locateTablet(Text row, boolean skipRow, boolean retry, boolean lock, TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
0
* Structure used to store an {@link org.apache.http.HttpResponse} in a cache. * Some entries can optionally depend on system resources that may require * explicit deallocation. In such a case {@link #getResource()} should return * a non null instance of {@link Resource} that must be deallocated by calling * Returns the {@link StatusLine} from the origin * {@link org.apache.http.HttpResponse}. * Returns the {@link ProtocolVersion} from the origin * {@link org.apache.http.HttpResponse}. * Gets the reason phrase from the origin * {@link org.apache.http.HttpResponse}, for example, "Not Modified". * Returns the HTTP response code from the origin * {@link org.apache.http.HttpResponse}.
0
import org.apache.beam.sdk.io.fs.PathValidator; * @deprecated use {@link org.apache.beam.sdk.io.fs.NoopPathValidator}. @Deprecated
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables;
0
EvaluationContext evaluationContext) final EvaluationContext evaluationContext) { final EvaluationContext evaluationContext) { private final EvaluationContext evaluationContext; EvaluationContext evaluationContext, public TransformResult finishBundle() throws IOException {
0
final XTestArray01[] array = new TestArrayAccess01[1];
1
public RequestStatus deleteResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException,
0
/** * Removes a ProtocolCommandListener. * * Delegates this incorrectly named method - removeProtocolCommandistener (note the missing "L")- to * the correct method {@link SocketClient#removeProtocolCommandListener} * @param listener The ProtocolCommandListener to remove */ public void removeProtocolCommandistener(org.apache.commons.net.ProtocolCommandListener listener){ removeProtocolCommandListener(listener); }
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.ambari.metrics.adservice.seriesgenerator;
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.accumulo.core.client.security.tokens; import javax.security.auth.DestroyFailedException; import org.apache.accumulo.core.Constants; import org.junit.Assert; import org.junit.Test; /** * */ public class PasswordTokenTest { @Test public void testMultiByte() throws DestroyFailedException { PasswordToken pt = new PasswordToken(); AuthenticationToken.Properties props = new AuthenticationToken.Properties(); props.put("password", "五六"); pt.init(props); props.destroy(); String s = new String(pt.getPassword(), Constants.UTF8); Assert.assertEquals("五六", s); pt = new PasswordToken("五六"); s = new String(pt.getPassword(), Constants.UTF8); Assert.assertEquals("五六", s); } }
0
@Test public void testHTTPCLIENT_1997() { Assert.assertTrue(DefaultHostnameVerifier.matchIdentity( "service.apps.dev.b.cloud.a", "*.apps.dev.b.cloud.a")); Assert.assertTrue(DefaultHostnameVerifier.matchIdentityStrict( "service.apps.dev.b.cloud.a", "*.apps.dev.b.cloud.a")); Assert.assertTrue(DefaultHostnameVerifier.matchIdentity( "service.apps.dev.b.cloud.a", "*.apps.dev.b.cloud.a", publicSuffixMatcher)); Assert.assertTrue(DefaultHostnameVerifier.matchIdentityStrict( "service.apps.dev.b.cloud.a", "*.apps.dev.b.cloud.a", publicSuffixMatcher)); }
0
package org.apache.jcp.xml.dsig.internal.dom;
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override @Override
0
import org.apache.ambari.server.api.services.stackadvisor.recommendations.RecommendationResponse.BindingHostGroup; import org.apache.ambari.server.api.services.stackadvisor.recommendations.RecommendationResponse.HostGroup;
0
List<KeyValue> currentBatch = ThriftScanner.scan(instance, credentials, scanState, timeOut, ServerConfigurationUtil.getConfiguration(instance));
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.sdk.schemas.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.annotations.Experimental.Kind; /** * When used on a POJO field or a JavaBean getter, that field or getter is ignored from the inferred * schema. * * <p>For example, a Java POJO with a field that we don't want included in the schema. * * <pre><code> * {@literal @}DefaultSchema(JavaBeanSchema.class) * class MyClass { * public String user; * public int age; * {@literal @}SchemaIgnore public String pleaseDontAddToSchema; * } * </code></pre> * * <p>In this case, the pleaseDontAddToSchema will be excluded from the schema, and implicitly * dropped from calculations. */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) @SuppressWarnings("rawtypes") @Experimental(Kind.SCHEMAS) public @interface SchemaIgnore {}
0
public abstract class FilesCacheTestsBase extends AbstractProviderTestCase
0
if (reset) { ((ByteArrayOutputStream)this._writer).reset(); } byte [] sol=((ByteArrayOutputStream)this._writer).toByteArray(); if (reset) { ((ByteArrayOutputStream)this._writer).reset(); } return sol;
0
AppliedPTransform.of( Collections.emptyMap(), Collections.emptyMap(), Flatten.pCollections(), AppliedPTransform.of( Collections.emptyMap(), Flatten.pCollections(), Matchers.hasEntry( .of( Collections.emptyMap(), Collections.emptyMap(), Flatten.pCollections(),
0
public UsernamePasswordCredentials(final String usernamePassword) { public UsernamePasswordCredentials(final String userName, final String password) { public boolean equals(final Object o) {
0
public static URI getArtifactURI( ArtifactRepository repository, Artifact artifact )
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
expect(context.getZooKeeperRoot()).andReturn("zkroot").anyTimes();
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
<T> T get( Class<T> key ); <T> T put( Class<T> key, T value );
0
JSONObject response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API_V1.VERSION, null, (String[]) null);
0
/* $Id$ *
0
import org.apache.sshd.common.util.security.SecurityUtils;
0
return getDefaultCoder( typeDescriptor, getTypeToCoderBindings(contextTypeDescriptor.getType(), contextCoder)); ParameterizedType fnType = (ParameterizedType) TypeDescriptor.of(fn.getClass()).getSupertype(SerializableFunction.class).getType(); return getDefaultCoder( fn.getClass(), SerializableFunction.class, ImmutableMap.of(fnType.getActualTypeArguments()[0], inputCoder), SerializableFunction.class.getTypeParameters()[1]); private <T> Coder<?>[] getDefaultCoders(
0
import cz.seznam.euphoria.core.client.dataset.HashPartitioner; import cz.seznam.euphoria.guava.shaded.com.google.common.collect.Iterables; // apply custom partitioner if different from default HashPartitioner if (!(operator.getPartitioning().getPartitioner().getClass() == HashPartitioner.class)) { tuples = tuples.partitionCustom( new PartitionerWrapper<>(operator.getPartitioning().getPartitioner()), p -> p.getKey()); } return tuples;
0
return this.servletContext.getInitParameter(path);
0
if (SecurityHelper.getSysPerm(state, SecurityHelper.getSysUserName(state), SystemPermission.CREATE_USER)) hasPermission = true; if (hasPermission) throw new AccumuloException("Got a security exception when I should have had permission.", ae); if (!exists) throw new AccumuloException("Got security exception when the user shouldn't have existed", ae); else return; if (!hasPermission) throw new AccumuloException("Didn't get Security Exception when we should have");
1
c.bytes = bytes.clone();
0
import org.apache.http.message.LineParser; /** * The line parser to use for created connections. * <code>null</code> indicates the default parser. */ protected LineParser lineParser; /** * Obtains the line parser to be used by the connections. * * @return the line parser, or <code>null</code> for the default */ public LineParser getParser() { return lineParser; } /** * Specifies the line parser to be used by the connections. * * @param parser the line parser, or <code>null</code> for the default */ public void setParser(LineParser parser) { lineParser = parser; } DefaultClientConnection dcc = new DefaultClientConnection(); dcc.setParser(lineParser); return dcc;
0