Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
Copyright 2000-2001,2003 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
import org.apache.accumulo.core.security.thrift.Credential; private Credential credentials; MetadataLocationObtainer(Credential credentials, Instance instance) {
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
1
import org.apache.http.annotation.NotThreadSafe;
0
public Header decodeHeader(final ByteBuffer src) throws HPackException { try { while (src.hasRemaining()) { final int b = peekByte(src); if ((b & 0x80) == 0x80) { return decodeIndexedHeader(src); } else if ((b & 0xc0) == 0x40) { return decodeLiteralHeader(src, HPackRepresentation.WITH_INDEXING); } else if ((b & 0xf0) == 0x00) { return decodeLiteralHeader(src, HPackRepresentation.WITHOUT_INDEXING); } else if ((b & 0xf0) == 0x10) { return decodeLiteralHeader(src, HPackRepresentation.NEVER_INDEXED); } else if ((b & 0xe0) == 0x20) { final int maxSize = decodeInt(src, 5); this.dynamicTable.setMaxSize(Math.min(this.maxTableSize, maxSize)); } else { throw new HPackException("Unexpected header first byte: 0x" + Integer.toHexString(b)); } return null; } catch (CharacterCodingException ex) { throw new HPackException(ex.getMessage(), ex); public List<Header> decodeHeaders(final ByteBuffer src) throws HPackException {
0
import org.apache.zookeeper.MultiTransactionRecord; import org.apache.zookeeper.Op; if ((request.type != OpCode.create && request.type != OpCode.create2 && request.type != OpCode.multi) || if (OpCode.multi == request.type) { MultiTransactionRecord multiTransactionRecord = new MultiTransactionRecord(); request.request.rewind(); ByteBufferInputStream.byteBuffer2Record(request.request, multiTransactionRecord); request.request.rewind(); boolean containsEphemeralCreate = false; for (Op op : multiTransactionRecord) { if (op.getType() == OpCode.create || op.getType() == OpCode.create2) { CreateRequest createRequest = (CreateRequest)op.toRequestRecord(); CreateMode createMode = CreateMode.fromFlag(createRequest.getFlags()); if (createMode.isEphemeral()) { containsEphemeralCreate = true; break; } } } if (!containsEphemeralCreate) { return null; } } else { CreateRequest createRequest = new CreateRequest(); request.request.rewind(); ByteBufferInputStream.byteBuffer2Record(request.request, createRequest); request.request.rewind(); CreateMode createMode = CreateMode.fromFlag(createRequest.getFlags()); if (!createMode.isEphemeral()) { return null; }
0
SslFilterRequest sreq = new SslFilterRequest(req, null); SslFilterRequest sreq = new SslFilterRequest(req, null); SslFilterRequest sreq = new SslFilterRequest(req, null);
0
/* * 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. */ package org.apache.commons.vfs.provider.sftp; import org.apache.commons.vfs.provider.FileNameParser; import org.apache.commons.vfs.provider.URLFileNameParser; import org.apache.commons.vfs.provider.ftp.FtpFileNameParser; import org.apache.commons.vfs.provider.http.HttpFileNameParser; import org.apache.commons.vfs.provider.webdav.WebdavFileNameParser; /** * Implementation for the webdav filesystem. * < p/> * Additionally encodes every character below space (' ') */ public class SftpFileNameParser extends URLFileNameParser { private final static SftpFileNameParser INSTANCE = new SftpFileNameParser(); public SftpFileNameParser() { super(22); } public boolean encodeCharacter(char ch) { return super.encodeCharacter(ch) || ch < ' '; } public static FileNameParser getInstance() { return INSTANCE; } }
0
Long value, OutputStream outStream) throws IOException { public Long decode(InputStream inStream) throws IOException {
0
* <pre><code> * </code></pre>
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.http.base.internal.runtime.dto; import java.util.Arrays; import org.apache.felix.http.base.internal.handler.ListenerHandler; import org.apache.felix.http.base.internal.runtime.ListenerInfo; import org.osgi.service.http.runtime.dto.FailedListenerDTO; import org.osgi.service.http.runtime.dto.ListenerDTO; public final class ListenerDTOBuilder { public static ListenerDTO build(final ListenerInfo info, final int reason) { final ListenerDTO dto = (reason == -1 ? new ListenerDTO() : new FailedListenerDTO()); dto.serviceId = info.getServiceId(); dto.types = Arrays.copyOf(info.getListenerTypes(), info.getListenerTypes().length); if ( reason != -1 ) { ((FailedListenerDTO)dto).failureReason = reason; } return dto; } public static ListenerDTO build(final ListenerHandler handler, final int reason) { final ListenerDTO dto = build(handler.getListenerInfo(), reason); dto.servletContextId = handler.getContextServiceId(); return dto; } }
0
import org.apache.xml.security.utils.XMLUtils; javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
0
testKexOpcodeName(KeyExchange.SIMPLE_KEX_OPCODES_MAP, KeyExchange::getSimpleKexOpcodeName); testKexOpcodeName(KeyExchange.GROUP_KEX_OPCODES_MAP, KeyExchange::getGroupKexOpcodeName);
0
* * @param results ValidatorResults to merge. * * @param field The field validated. * @param validatorName The name of the validator. * @param result The result of the validation. * * @param field The field validated. * @param validatorName The name of the validator. * @param result The result of the validation. * @param value The value returned by the validator. * * @return Whether these results are empty. * * @return The result of a specified key. * * @return Map of objections returned by validators.
1
import javax.inject.Inject;
1
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.SummingArrayCombiner} with * {@link org.apache.accumulo.core.iterators.user.SummingArrayCombiner.Type#VARLEN}
0
* * * /** return createTestSuite(TestJSLSuite.class, "suite.jelly");
1
package org.apache.batik.ext.awt.image;
0
import org.apache.atlas.ocf.properties.beans.Connection;
0
import org.apache.accumulo.core.iterators.user.ReqVisFilter; IteratorSetting setting = new IteratorSetting(priority, name, classname, options); shellState.getConnector().tableOperations().attachIterator(tableName, setting, scopes);
0
public int ranking = 0; public long serviceId;
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.io.ByteStreams; import org.apache.beam.vendor.guava.v20_0.com.google.common.io.CountingOutputStream;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v 1.23 2003/06/24 05:45:43 martinc Exp $ * $Revision: 1.23 $ * $Date: 2003/06/24 05:45:43 $ * @version $Id: FileUpload.java,v 1.23 2003/06/24 05:45:43 martinc Exp $
0
* @version $Id: AbstractOjbImpl.java,v 1.3 2004/06/25 14:49:56 cziegeler Exp $ throws Exception { throws ServiceException {
0
package aQute.bnd.component; import java.io.*; import aQute.bnd.osgi.*; import aQute.lib.tag.*; class TagResource extends WriteResource { final Tag tag; public TagResource(Tag tag) { this.tag = tag; } public void write(OutputStream out) throws UnsupportedEncodingException { OutputStreamWriter ow = new OutputStreamWriter(out, "UTF-8"); PrintWriter pw = new PrintWriter(ow); pw.println("<?xml version='1.1'?>"); try { tag.print(0, pw); } finally { pw.flush(); } } public long lastModified() { return 0; } }
0
for (Entry e : (Set<Entry>)map.entrySet()) { put(e.getKey().toString(), e.getValue()); }
0
* limitations under the License.
0
case LOCAL_HOST_MACRO: {
0
* @param directAdjacent the direct adjacent selector * equals to org.w3c.dom.Node.ELEMENT_NODE
0
for (Connection element : c) { element.close(); for (Connection element : c) { element.close(); for (Connection element : c) { element.close(); for (Connection element : c) { element.close(); for (Connection element : c) { element.close();
0
package org.apache.felix.sigil.eclipse.ui.internal.quickfix;
0
import com.google.cloud.spanner.DatabaseAdminClient; public abstract ValueProvider<String> getProjectId(); public abstract ValueProvider<String> getInstanceId(); public abstract ValueProvider<String> getDatabaseId(); public abstract String getHost(); DatabaseAdminClient databaseAdminClient = spanner.getDatabaseAdminClient(); return new SpannerAccessor(spanner, databaseClient, databaseAdminClient, batchClient);
0
* Copyright (c) 2002, 2003 The Apache Software Foundation. All rights * @version $Revision: 1.3 $ $Date: 2003/02/12 07:56:09 $
0
@Override @Override @Override @Override
0
* @see java.awt.GradientPaint * @see java.awt.TexturePaint * @param x x coordinate of the origin of the rotation * @param y y coordinate of the origin of the rotation * {@link java.awt.Graphics#setClip(Shape) setClip} with a * <code>null</code> argument, the specified <code>Shape</code> becomes * the new user clip.
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.bundlerepository.impl; import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.osgi.resource.Requirement; public class OSGiRequirementAdapterTest extends TestCase { public void testDirectives() { Map<String, Object> attrs = new HashMap<String, Object>(); Map<String, String> dirs = new HashMap<String, String>(); dirs.put("cardinality", "multiple"); dirs.put("filter", "(osgi.wiring.package=y)"); dirs.put("foo", "bar"); dirs.put("resolution", "optional"); dirs.put("test", "test"); Requirement req = new OSGiRequirementImpl("osgi.wiring.package", attrs, dirs); OSGiRequirementAdapter adapter = new OSGiRequirementAdapter(req); assertEquals("(package=y)", adapter.getFilter()); assertTrue(adapter.isMultiple()); assertTrue(adapter.isOptional()); assertEquals("package", adapter.getName()); Map<String, String> expected = new HashMap<String, String>(); expected.put("foo", "bar"); expected.put("test", "test"); assertEquals(expected, adapter.getDirectives()); } }
0
public Response handleRequest(HttpHeaders headers, UriInfo ui, RequestType requestType, MediaType mediaType, String resourceId) { getMediaType(mediaType), createResource(resourceId)); throw new IllegalArgumentException("Unknown resource type " + type); } // get the JAX-RS media type from the view media type private javax.ws.rs.core.MediaType getMediaType(MediaType type) { switch (type) { case TEXT_PLAIN: return javax.ws.rs.core.MediaType.TEXT_PLAIN_TYPE; case APPLICATION_JSON: return javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE; } throw new IllegalArgumentException("Unknown media type " + type);
0
.apply(BigQueryIO.write()
0
final String id = ioSession.getId(); sessionLog.debug(id + " " + connection + " connected"); sessionLog.debug(id + " " + connection + " disconnected"); sessionLog.error(id + " " + ex.getMessage(), ex); return super.createStreamMultiplexer(new LoggingIOSession(ioSession, sessionLog));
0
import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.annotations.Experimental.Kind; @Experimental(Kind.FILESYSTEM)
0
proxyManifest.getLocationList().stream()
0
RPC_SSL_KEYSTORE_PATH("rpc.javax.net.ssl.keyStore", "", PropertyType.PATH, "Path of the keystore file for the servers' priva:q" + "te SSL key"), RPC_SSL_TRUSTSTORE_PATH("rpc.javax.net.ssl.trustStore", "", PropertyType.PATH, "Path of the truststore file for the root cert"),
0
import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.windowing.BoundedWindow; new DoFn<KV<String, Long>, CompletionCandidate>() { @ProcessElement extends DoFn<KV<String, List<CompletionCandidate>>, CompletionCandidate> { @ProcessElement * A DoFn that keys each candidate by all its prefixes. extends DoFn<CompletionCandidate, KV<String, CompletionCandidate>> { @ProcessElement static class ExtractWordsFn extends DoFn<String, String> { @ProcessElement * Takes as input a the top candidates per prefix, and emits an entity suitable for writing to * Datastore. static class FormatForPerTaskLocalFile extends DoFn<KV<String, List<CompletionCandidate>>, String> { @ProcessElement public void processElement(ProcessContext c, BoundedWindow window) { str.append(elem.getKey() +" @ "+ window +" -> "); for (CompletionCandidate cand: elem.getValue()) {
0
doc = XMLUtils.parse(is, false); doc = XMLUtils.parse(is, false);
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
0
profile("log").version("1.3.0"), profile("felix.config").version("1.0.10"),
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.svggen; import java.awt.image.BufferedImage; import org.w3c.dom.*; /** * Caching version of the PNG image handler. * * @author <a href="mailto:[email protected]">Paul Evenblij</a> * @version $Id$ */ public class CachedImageHandlerPNGEncoder extends ImageHandlerPNGEncoder { /** * @param imageDir directory where this handler should generate images. * If null, an IllegalArgumentException is thrown. * @param urlRoot root for the urls that point to images created by this * image handler. If null, then the url corresponding to imageDir * is used. */ public CachedImageHandlerPNGEncoder(String imageDir, String urlRoot) throws SVGGraphics2DIOException { super(imageDir, urlRoot); setImageCacher(new ImageCacher.External(imageDir, getPrefix(), getSuffix())); } /** * Save with caching. */ protected void saveBufferedImageToFile(Element imageElement, BufferedImage buf, SVGGeneratorContext generatorContext) throws SVGGraphics2DIOException { cacheBufferedImage(imageElement, buf, generatorContext); } }
0
/* for (int i = 0; i < m_configurableProperties.size(); i++) { m_updated.call(instance, new Object[] {props});
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bag/AbstractMapBag.java,v 1.10 2004/01/02 01:36:51 psteitz Exp $ * Copyright (c) 2002-2004 The Apache Software Foundation. All rights * @version $Revision: 1.10 $ $Date: 2004/01/02 01:36:51 $ * @param object the Bag to compare to
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. */ @Override public boolean accept(Key k, Value v) { ColumnVisibility label = new ColumnVisibility(k.getColumnVisibility()); return label.getExpression().length > 0; } @Override public void init(Map<String,String> options) { // No Options to set } @Override public IteratorOptions describeOptions() { return new IteratorOptions("nolabel", "NoLabelFilter hides entries without a visibility label", null, null); } @Override public boolean validateOptions(Map<String,String> options) { return true; }
0
Config config = cluster.getConfig(configType, cr.getVersionTag()); if (null != config) { configs.add(config); }
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.Lists; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets; import org.apache.beam.vendor.guava.v20_0.com.google.common.util.concurrent.Uninterruptibles;
0
} catch (XMLSecurityException e) { if (log.isDebugEnabled()) { log.debug(e); } }
0
import java.util.concurrent.CountDownLatch; import org.apache.sshd.common.SshConstants; import org.apache.sshd.common.session.AbstractSession; import org.apache.sshd.server.Command; sshd.setShellFactory(new TestEchoShellFactory()); @Test public void testClientDisconnect() throws Exception { TestEchoShellFactory.TestEchoShell.latch = new CountDownLatch(1); try { SshClient client = SshClient.setUpDefaultClient(); client.start(); ClientSession session = client.connect("localhost", port).await().getSession(); session.authPassword("smx", "smx"); ClientChannel channel = session.createChannel(ClientChannel.CHANNEL_SHELL); ByteArrayOutputStream sent = new ByteArrayOutputStream(); PipedOutputStream pipedIn = new TeePipedOutputStream(sent); channel.setIn(new PipedInputStream(pipedIn)); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); channel.setOut(out); channel.setErr(err); channel.open().await(); ((AbstractSession) session).disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, "Cancel"); TestEchoShellFactory.TestEchoShell.latch.await(); } finally { TestEchoShellFactory.TestEchoShell.latch = null; } } public static class TestEchoShellFactory extends EchoShellFactory { @Override public Command create() { return new TestEchoShell(); } public static class TestEchoShell extends EchoShell { public static CountDownLatch latch = new CountDownLatch(1); @Override public void destroy() { if (latch != null) { latch.countDown(); } super.destroy(); } } }
0
import java.util.Optional; this(offer, attributes, Optional.empty());
0
* A WindowSet where windows are never merged or deleted. This allows us to improve upon the default * {@link BufferingWindowSet} by not maintaining a merge tree (or the list of active windows at all) * and by blindly using tag lists to store elements. class NonMergingBufferingWindowSet<K, V, W extends BoundedWindow> return new NonMergingBufferingWindowSet<>( private NonMergingBufferingWindowSet( // Create a copy here, since otherwise we may return the same list object from readTagList, and // that may be mutated later, which would lead to mutation of output values.
0
* Euphoria operators test suite, see * {@link cz.seznam.euphoria.operator.test.AllOperatorsSuite}. package cz.seznam.euphoria.operator.test;
0
_output_.write(NULL_CHAR);
0
@Override
0
public TaskResourceDefinition() { super(Resource.Type.Task);
1
/* * Copyright 2002-2005 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. * * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.core.container.handler; import org.apache.avalon.framework.logger.Logger; import org.apache.cocoon.components.ComponentInfo; import org.apache.cocoon.core.container.ComponentFactory; /** * This class acts like a Factory to instantiate the correct version * of the component handler that you need. * * @version $Id$ * @since 2.2 */ public abstract class AbstractFactoryHandler extends AbstractComponentHandler { /** This factory is used to created new objects */ protected final ComponentFactory factory; /** * Creates a new ComponentHandler. */ public AbstractFactoryHandler(ComponentInfo info, Logger logger, ComponentFactory factory) { super(info, logger); this.factory = factory; } /** * Decommission a component * @param component Object to be decommissioned */ protected void decommission( final Object component ) { try { this.factory.decommission( component ); } catch( final Exception e ) { if( this.logger.isWarnEnabled() ) { this.logger.warn( "Error decommissioning component: " + this.factory.getCreatedClass().getName(), e ); } } } }
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. */
0
return href.equals(name) || href.equals(fileName.getPath());
0
* Copyright (c) 2004 The Apache Software Foundation. All rights * @version $Id: FTPFileList.java,v 1.6 2004/01/01 21:04:18 scohen Exp $
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
0
if (isMultipart() || (part.getContent() != null && part.getContent() instanceof Part))
0
.put(TypeName.BYTES, str -> BaseEncoding.base64().decode(str)) return BaseEncoding.base64().encode((byte[]) fieldValue);
0
/** * Sets the filter for the services that should be tracked. Any service object * matching the filter will be returned, without any additional filter on the * class. * * @param serviceFilter the filter condition * @return this service dependency */ ServiceDependency setService(String serviceFilter);
0
final ConnectTimeoutException ctx = new ConnectTimeoutException(null, null); final ConnectTimeoutException ctx = new ConnectTimeoutException(cause, null); final ConnectTimeoutException ctx = new ConnectTimeoutException(cause, target); final HttpHostConnectException ctx = new HttpHostConnectException(null, null, (InetAddress [])null); final HttpHostConnectException ctx = new HttpHostConnectException(cause, null); final HttpHostConnectException ctx = new HttpHostConnectException(cause, target);
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
0
StageUtils.setConfiguration(injector.getInstance(Configuration.class));
0
* The 'mode' attribute values. protected final static String[] MODE_VALUES = { "", SVG_NORMAL_VALUE, SVG_MULTIPLY_VALUE, SVG_SCREEN_VALUE, SVG_DARKEN_VALUE, SVG_LIGHTEN_VALUE }; return getAnimatedStringAttribute(null, SVG_IN_ATTRIBUTE); return getAnimatedStringAttribute(null, SVG_IN2_ATTRIBUTE); return getAnimatedEnumerationAttribute (null, SVG_MODE_ATTRIBUTE, MODE_VALUES, (short)1);
0
/* @XmlElement(name="unlimitedKeyJCERequired") private UnlimitedKeyJCERequirement unlimitedKeyJCERequired; unlimitedKeyJCERequired = prototype.unlimitedKeyJCERequired; public UnlimitedKeyJCERequirement getUnlimitedKeyJCERequired() { return unlimitedKeyJCERequired; } public void setUnlimitedKeyJCERequired(UnlimitedKeyJCERequirement unlimitedKeyJCERequired) { this.unlimitedKeyJCERequired = unlimitedKeyJCERequired; } if (unlimitedKeyJCERequired != null ? !unlimitedKeyJCERequired.equals(that.unlimitedKeyJCERequired) : that.unlimitedKeyJCERequired != null) return false; result = 31 * result + (unlimitedKeyJCERequired != null ? unlimitedKeyJCERequired.hashCode() : 0);
0
import org.apache.accumulo.core.util.shell.Shell.TableOperation; public class RevokeCommand extends TableOperation { private Option systemOpt, userOpt; private String user; private String[] permission; public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { user = cl.hasOption(userOpt.getOpt()) ? cl.getOptionValue(userOpt.getOpt()) : shellState.getConnector().whoami(); permission = cl.getArgs()[0].split("\\.", 2); } else if (permission[0].equalsIgnoreCase("Table")) { super.execute(fullCommand, cl, shellState); protected void doTableOp(Shell shellState, String tableName) throws Exception { try { shellState.getConnector().securityOperations().revokeTablePermission(user, tableName, TablePermission.valueOf(permission[1])); Shell.log.debug("Revoked from " + user + " the " + permission[1] + " permission on table " + tableName); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("No such table permission", e); } } @Override super.getOptions(); group.addOption(optTableName); group.addOption(optTablePattern);
0
try (AccumuloClient accumuloClient = getClient()) { String tableName = getUniqueNames(1)[0]; ReadWriteIT.ingest(accumuloClient, getClientInfo(), ROWS, COLS, 50, 0, tableName); ReadWriteIT.verify(accumuloClient, getClientInfo(), ROWS, COLS, 50, 0, tableName); accumuloClient.tableOperations().flush(tableName, null, null, true); accumuloClient.tableOperations().offline(tableName, true); log.debug("Replacing rfile(s) with empty"); try (Scanner meta = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { String tableId = accumuloClient.tableOperations().tableIdMap().get(tableName); meta.setRange(new Range(new Text(tableId + ";"), new Text(tableId + "<"))); meta.fetchColumnFamily(DataFileColumnFamily.NAME); boolean foundFile = false; for (Entry<Key,Value> entry : meta) { foundFile = true; Path rfile = new Path(entry.getKey().getColumnQualifier().toString()); log.debug("Removing rfile '{}'", rfile); cluster.getFileSystem().delete(rfile, false); Process info = cluster.exec(CreateEmpty.class, rfile.toString()); assertEquals(0, info.waitFor()); } assertTrue(foundFile); log.trace("invalidate cached file handles by issuing a compaction"); accumuloClient.tableOperations().online(tableName, true); accumuloClient.tableOperations().compact(tableName, null, null, false, true); log.debug("make sure we can still scan"); try (Scanner scan = accumuloClient.createScanner(tableName, Authorizations.EMPTY)) { scan.setRange(new Range()); long cells = 0L; for (Entry<Key,Value> entry : scan) { if (entry != null) cells++; } assertEquals(0L, cells);
0
* * @version $Id$
0
builder.environment().put("ACCUMULO_CONF_DIR", config.getConfDir().getAbsolutePath());
0
/** * Signals corrupt HTTP/2 frame. * * @since 5.0 */
0
import org.apache.accumulo.shell.ShellOptions; userOpt = new Option(ShellOptions.userOption, "user", true, "user to operate on");
1
import org.apache.ambari.server.state.UriInfo; * A special {@link JMXHostProvider} that resolves JMX URIs based on cluster configuration.
0
import org.apache.hc.core5.io.CloseMode; client.shutdown(CloseMode.GRACEFUL);
0
* * @version $Id$ /** * Translates a List of Interpreter.Argument objects into a classic
0
// don't allow instantiation String parentName = attr.getOwnerElement().getTagName(); String attrValue = attr.getValue(); Object exArgs[] = { parentName, nodeAttrName, attrValue };
0
import static org.junit.Assert.assertTrue; public class SignedEncryptedTest { assertTrue(xmlSignatureVerifier.checkSignatureValue(pub)); }
0
* $Id: TestCollectionUtils.java,v 1.10 2002/12/08 15:29:26 scolebourne Exp $ * $Revision: 1.10 $ * $Date: 2002/12/08 15:29:26 $ * @version $Revision: 1.10 $ $Date: 2002/12/08 15:29:26 $ public void testCountMatches() { List list = new ArrayList(); list.add("One"); list.add("Two"); list.add("Three"); list.add("Four"); int count = CollectionUtils.countMatches(list, new Predicate() { public boolean evaluate(Object input) { return (input.equals("Two")); } }); assertEquals(4, list.size()); assertEquals(1, count); }
0
write(Op.saveJobUpdateEvent(new SaveJobUpdateEvent(event.newBuilder(), key.newBuilder()))); new SaveJobInstanceUpdateEvent(event.newBuilder(), key.newBuilder())));
0
* limitations under the License.
0
import org.apache.xml.security.utils.XMLUtils; DocumentBuilder db = XMLUtils.createDocumentBuilder(false); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader); DocumentBuilder builder = XMLUtils.createDocumentBuilder(false); document = StAX2DOM.readDoc(XMLUtils.createDocumentBuilder(false), securityStreamReader);
0
package org.apache.batik.dom.svg; import org.apache.batik.util.CSSConstants;
0
/** * An {@link Int2IntFunction} that returns same value as input */ Int2IntFunction IDENTITY = new Int2IntFunction() { @Override public int apply(int value) { return value; } }; final class Utils { throw new UnsupportedOperationException("No instance allowed");
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. */ package org.apache.commons.digester.annotations.handlers; import java.lang.reflect.Field; import org.apache.commons.digester.annotations.DigesterLoaderHandler; import org.apache.commons.digester.annotations.FromAnnotationsRuleSet; import org.apache.commons.digester.annotations.providers.SetPropertiesRuleProvider; import org.apache.commons.digester.annotations.rules.SetProperty; /** * Handler that takes care to create the {@link SetPropertiesRuleProvider}. * * @version $Id$ * @since 2.1 */ public final class SetPropertiesLoaderHandler implements DigesterLoaderHandler<SetProperty, Field> { /** * {@inheritDoc} */ public void handle(SetProperty annotation, Field element, FromAnnotationsRuleSet ruleSet) { SetPropertiesRuleProvider ruleProvider = ruleSet.getProvider(annotation.pattern(), SetPropertiesRuleProvider.class); if (ruleProvider == null) { ruleProvider = new SetPropertiesRuleProvider(); ruleSet.addRuleProvider(annotation.pattern(), ruleProvider); } ruleProvider.addAlias(annotation, element); } }
0
import org.apache.accumulo.core.client.impl.Table; public static final Validator<Table.ID> VALID_ID = new Validator<Table.ID>() { public boolean test(Table.ID tableId) { && (RootTable.ID.equals(tableId) || MetadataTable.ID.equals(tableId) || ReplicationTable.ID.equals(tableId) || tableId.canonicalID().matches( VALID_ID_REGEX)); public String invalidMessage(Table.ID tableId) { public static final Validator<Table.ID> NOT_ROOT_ID = new Validator<Table.ID>() { public boolean test(Table.ID tableId) { public String invalidMessage(Table.ID tableId) {
1
* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>.
0
* Merge the given accumulators according to the underlying combiner. AccumT mergeAccumulators(Iterable<AccumT> accumulators);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java,v 1.6 2003/05/06 11:32:23 rdonkin Exp $ * $Revision: 1.6 $ * $Date: 2003/05/06 11:32:23 $ * @version $Revision: 1.6 $ $Date: 2003/05/06 11:32:23 $ private static final PropertyUtilsBean singleton = new PropertyUtilsBean(); return singleton;
0
public class DataflowServiceException extends DataflowJobException { DataflowServiceException(DataflowPipelineJob job, String message) { DataflowServiceException(DataflowPipelineJob job, String message, @Nullable Throwable cause) {
0
public abstract class AbstractListHandler<T> implements ResultSetHandler<List<T>> { public List<T> handle(ResultSet rs) throws SQLException { List<T> rows = new ArrayList<T>(); protected abstract T handleRow(ResultSet rs) throws SQLException;
0
@Test(timeout=30*1000)
1
import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.impl.client.CloseableHttpClient; import static org.easymock.EasyMock.expectLastCall; private CloseableHttpClient httpClient; httpClient = createMock(CloseableHttpClient.class); CloseableHttpResponse httpResponse = createMock(CloseableHttpResponse.class); HttpEntity entity = createMock(HttpEntity.class); expect(entity.isStreaming()).andReturn(false); expect(httpResponse.getEntity()).andReturn(entity); httpResponse.close(); expectLastCall().once(); expect(httpClient.execute(capture(httpPostCapture))).andReturn(httpResponse);
0