Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
try { graphProvider.get().shutdown(); } catch (Exception e) { e.printStackTrace(); }
0
tableRef.set("tableType", hiveTable.getTableType().name());
0
Element defs = domFactory.createElement(SVG_DEFS_TAG);
0
import static org.apache.beam.sdk.io.common.FileBasedIOITHelper.readFileBasedIOITPipelineOptions; import org.apache.beam.sdk.io.common.FileBasedIOTestPipelineOptions; FileBasedIOTestPipelineOptions options = readFileBasedIOITPipelineOptions(); .write() .to(filenamePrefix) .withCompression(compressionType) .withSuffix(".tfrecord"); .apply("Generate sequence", GenerateSequence.from(0).to(numberOfTextLines)) .apply("Produce text lines", ParDo.of(new FileBasedIOITHelper.DeterministicallyConstructTestTextLineFn())) .apply("Transform strings to bytes", MapElements.via(new StringToByteArray())) .apply("Write content to files", writeTransform); PCollection<String> consolidatedHashcode = readPipeline .apply(TFRecordIO.read().from(filenamePattern).withCompression(AUTO)) .apply("Transform bytes to strings", MapElements.via(new ByteArrayToString())) .apply("Calculate hashcode", Combine.globally(new HashingFn())) .apply(Reshuffle.viaRandomKey()); .apply(Create.of(filenamePattern)) .apply("Delete test files", ParDo.of(new DeleteFileFn()) .withSideInputs(consolidatedHashcode.apply(View.asSingleton())));
0
package org.apache.hc.core5.reactor;
1
import org.apache.bcel.generic.InstructionHandle;
0
/* * $Header: $ * $Revision$ * $Date$ * * ==================================================================== * * 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. * ==================================================================== * * 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.http; import org.apache.http.params.HttpParams; /** * <p> * </p> * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> * * @version $Revision$ * * @since 4.0 */ public interface HttpRequest { RequestLine getRequestLine(); HeaderGroup getHeaders(); HttpParams getParams(); }
0
public void testSynchronized() throws Exception { Map<String, Object> ns = new TreeMap<String, Object>(); JexlContext jc = new SynchronizedContext(new MapContext()); JexlEngine jexl = new JexlBuilder().namespaces(ns).create(); JexlScript js0 = jexl.createScript("@synchronized(y) {return y.size(); }", "y"); Object size = js0.execute(jc, "foobar"); Assert.assertEquals(6, size); } @Test t = js0.execute(jc, foo); Assert.assertEquals(10.0d, t); Assert.assertTrue(monitor.isBalanced()); Assert.assertEquals(4, monitor.getCount());
1
components = new TreeMap<>(); List<Map<String, Object>> list = new ArrayList<>();
1
Factory<UserAuthFactory> factory = NamedResource.findByName(name, String.CASE_INSENSITIVE_ORDER, VALUES);
0
/* * Copyright 2006 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.felix.shell.gui.plugin; import java.io.OutputStream; class OutputAreaStream extends OutputStream { private ScrollableOutputArea m_soa; public OutputAreaStream(ScrollableOutputArea soa) { m_soa = soa; } public void write(byte[] b) { String tmp = new String(b); m_soa.addText(tmp); } public void write(byte[] b, int off, int len) { String tmp = new String(b, off, len); m_soa.addText(tmp); } public void write(int b) { byte[] ba = { (byte) b }; m_soa.addText(new String(ba)); } }
0
pipeline.apply("Create base", Create.of(40)).apply(View.asSingleton()); return Collections.emptyList(); .apply(WithKeys.of("k"))
0
import com.twitter.mesos.scheduler.base.JobKeys; import com.twitter.mesos.scheduler.base.Query;
0
int DOM_KEY_LOCATION_STANDARD = 0x00; int DOM_KEY_LOCATION_LEFT = 0x01; int DOM_KEY_LOCATION_RIGHT = 0x02; int DOM_KEY_LOCATION_NUMPAD = 0x03; String getKeyIdentifier(); int getKeyLocation(); boolean getCtrlKey(); boolean getShiftKey(); boolean getAltKey(); boolean getMetaKey(); boolean getModifierState(String keyIdentifierArg); void initKeyboardEvent(String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String keyIdentifierArg, int keyLocationArg, String modifiersList); void initKeyboardEventNS(String namespaceURI, String typeArg, boolean canBubbleArg, boolean cancelableArg, AbstractView viewArg, String keyIdentifierArg, int keyLocationArg, String modifiersList);
0
return new ChainedClosure<E>(FunctorUtils.copy(closures));
0
@SuppressWarnings("deprecation") String fsUri = sconf.get(Property.INSTANCE_DFS_URI); if (fsUri.equals("")) printInitializeFailureMessages(sconf); @SuppressWarnings("deprecation") static void printInitializeFailureMessages(SiteConfiguration sconf) { String instanceDfsDir = sconf.get(Property.INSTANCE_DFS_DIR); log.fatal("It appears the directories " + Arrays.asList(VolumeConfiguration.getVolumeUris(ServerConfiguration.getSiteConfiguration())) + " were previously initialized."); String instanceVolumes = sconf.get(Property.INSTANCE_VOLUMES); String instanceDfsUri = sconf.get(Property.INSTANCE_DFS_URI); if (!instanceVolumes.isEmpty()) { log.fatal("Change the property " + Property.INSTANCE_VOLUMES + " to use different filesystems,"); } else if (!instanceDfsDir.isEmpty()) { log.fatal("Change the property " + Property.INSTANCE_DFS_URI + " to use a different filesystem,"); } else { log.fatal("You are using the default URI for the filesystem. Set the property " + Property.INSTANCE_VOLUMES + " to use a different filesystem,"); } log.fatal("or change the property " + Property.INSTANCE_DFS_DIR + " to use a different directory."); log.fatal("The current value of " + Property.INSTANCE_DFS_URI + " is |" + instanceDfsUri + "|"); log.fatal("The current value of " + Property.INSTANCE_DFS_DIR + " is |" + instanceDfsDir + "|"); log.fatal("The current value of " + Property.INSTANCE_VOLUMES + " is |" + instanceVolumes + "|"); }
0
package org.apache.batik.bridge;
0
import java.util.Collection; import org.apache.commons.vfs.Capability;
0
* Copyright 2001-2006 The Apache Software Foundation
0
eq(mapRequestProps), eq(false))).andReturn(response).once();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestFixedSizeSortedMap.java,v 1.4 2003/10/02 23:01:09 scolebourne Exp $ import org.apache.commons.collections.AbstractTestSortedMap; * @version $Revision: 1.4 $ $Date: 2003/10/02 23:01:09 $ public class TestFixedSizeSortedMap extends AbstractTestSortedMap {
0
import com.google.inject.persist.UnitOfWork; private UnitOfWork unitOfWork; unitOfWork = injector.getInstance(UnitOfWork.class); new HostsMap((String) null), null, unitOfWork); new ActionDBInMemoryImpl(), new HostsMap((String) null), null, unitOfWork);
0
* @throws IOException if an error occurs * @throws ClassNotFoundException if an error occurs
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CollectionUtils.java,v 1.32 2003/05/11 14:12:46 scolebourne Exp $ * @version $Revision: 1.32 $ $Date: 2003/05/11 14:12:46 $
0
private String user = "_db";
0
// Test that sequential filenames are being created correctly, // with 0-padding in the filename public void testSequentialNodeNames() throws IOException, InterruptedException, KeeperException { String path = "/SEQUENCE"; String file = "TEST"; String filepath = path + "/" + file; ZooKeeper zk = null; try { zk =createClient(this); zk.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE, 0); zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateFlags.SEQUENCE); List<String> children = zk.getChildren(path, false); assertEquals(1, children.size()); assertEquals(file + "0000000000", children.get(0)); zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateFlags.SEQUENCE); children = zk.getChildren(path, false); assertEquals(2, children.size()); assertTrue(children.contains(file + "0000000001")); zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateFlags.SEQUENCE); children = zk.getChildren(path, false); assertEquals(3, children.size()); assertTrue(children.contains(file + "0000000002")); // The pattern is holding so far. Let's run the counter a bit // to be sure it continues to spit out the correct answer for(int i = children.size(); i < 105; i++) zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateFlags.SEQUENCE); children = zk.getChildren(path, false); assertTrue(children.contains(file + "0000000104")); } finally { if(zk != null) zk.close(); } }
0
@Test(expected = AmbariException.class) users.createUser("admin2", "admin2"); users.promoteToAdmin(user); user = users.getLocalUser("admin2"); user = users.getLocalUser("admin2"); users.demoteAdmin(user); @Test(expected = AmbariException.class) public void testRemoveUser() throws Exception { users.createUser("admin", "admin"); User user = users.getLocalUser("admin"); users.promoteToAdmin(user); user = users.getLocalUser("admin"); assertTrue(user.getRoles().contains(users.getAdminRole())); users.removeUser(user); } users.createUser("localadmin", "admin"); User localUser = users.getLocalUser("localadmin"); users.promoteToAdmin(localUser);
0
logs.put(new Path(log).toString(), logEntry.extent.getTableId().toString());
0
tester.assertHasOnlyGlobalAndFinishedSetsFor(firstWindow); tester.assertHasOnlyGlobalAndFinishedSetsFor(firstWindow); tester.assertHasOnlyGlobalAndFinishedSetsFor(firstWindow); tester.assertHasOnlyGlobalAndFinishedSetsFor(firstWindow); tester.assertHasOnlyGlobalAndFinishedSetsFor(); tester.assertHasOnlyGlobalAndFinishedSetsFor( new IntervalWindow(new Instant(1), new Instant(22))); tester.assertHasOnlyGlobalAndFinishedSetsFor(window);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/priv/PrivateIndirect.java,v 1.2 2001/12/15 19:19:24 craigmcc Exp $ * $Revision: 1.2 $ * $Date: 2001/12/15 19:19:24 $ * @version $Revision: 1.2 $ $Date: 2001/12/15 19:19:24 $ /** * A method accessible via an indirectly implemented interface. */ public String methodBaz(String in);
0
if (isRemoveSupported() == false) { return; } if (isFailFastExpected() == false) { return; } if (isRemoveSupported() == false) { return; } if (isFailFastExpected() == false) { return; } if (isRemoveSupported() == false) { return; } if (isFailFastExpected() == false) { return; }
0
* AccumuloClassLoader loads jars from locations in general.classpaths. Usually the URLs for HADOOP_HOME, ZOOKEEPER_HOME, ACCUMULO_HOME/lib and their associated directories
0
public final long sessionId; public final int cxid; public final int type; public final ByteBuffer request; public final ServerCnxn cnxn; public final List<Id> authInfo; public final long createTime = System.currentTimeMillis(); sb.append("sessionid:0x").append(Long.toHexString(sessionId)) .append(" type:").append(op2String(type)) .append(" cxid:0x").append(Long.toHexString(cxid)) .append(" zxid:0x").append(Long.toHexString(hdr == null ? -2 : hdr.getZxid())) .append(" txntype:").append(hdr == null ? "unknown" : "" + hdr.getType()); // best effort to print the path assoc with this request if (type != OpCode.createSession && type != OpCode.setWatches && type != OpCode.closeSession && request != null // make sure we don't mess with request itself ByteBuffer rbuf = request.asReadOnlyBuffer(); rbuf.clear(); int pathLen = rbuf.getInt(); // sanity check if (pathLen >= 0 && pathLen < 4096 && rbuf.remaining() >= pathLen) { byte b[] = new byte[pathLen]; rbuf.get(b); path = new String(b); } // ignore - can't find the path, will output "n/a" instead sb.append(" reqpath:").append(path);
0
* Partial update a single entity using its guid. * @param entityType type of the entity * @param guid Entity guid * @return EntityMutationResponse details of the updates performed by this call * @throws AtlasBaseException * */ EntityMutationResponse updateByGuid(AtlasEntityType entityType, String guid, AtlasEntity entity) throws AtlasBaseException; /** * Partial update entities attribute using its guid. * @param guid Entity guid * @param attrName attribute name to be updated * @param attrValue updated attribute value * @return EntityMutationResponse details of the updates performed by this call * @throws AtlasBaseException */ EntityMutationResponse updateEntityAttributeByGuid(String guid, String attrName, Object attrValue) throws AtlasBaseException; /**
0
import org.apache.cocoon.woody.event.AbstractFormHandler; import org.apache.cocoon.woody.event.ValueChangedEvent; * This implementation currently doesn't do anything interesting. public class Form1Handler extends AbstractFormHandler { public void handleActionEvent(ActionEvent actionEvent) { //System.out.println("action event reported to Form1Handler: " + actionEvent.getActionCommand()); } public void handleValueChangedEvent(ValueChangedEvent valueChangedEvent) { //System.out.println("value changed reported to Form1Handler");
0
.setIsDaemon(true) .setIsDaemon(true)
0
/* * Copyright 1999,2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package javax.servlet; /** * Ensures that servlets handle * only one request at a time. This interface has no methods. * * <p>If a servlet implements this interface, you are <i>guaranteed</i> * that no two threads will execute concurrently in the * servlet's <code>service</code> method. The servlet container * can make this guarantee by synchronizing access to a single * instance of the servlet, or by maintaining a pool of servlet * instances and dispatching each new request to a free servlet. * * <p>This interface does not prevent * synchronization problems that result from servlets accessing shared * resources such as static class variables or classes outside * the scope of the servlet. * * * @author Various * @version $Version$ * */ public interface SingleThreadModel { }
0
private Object createInstance(Class clazz) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { return constructor.newInstance(null);
0
import org.osgi.resource.Capability; private final Set<Capability> m_capSet = new HashSet<Capability>(); public Set<Capability> match(SimpleFilter sf, boolean obeyMandatory) Set<Capability> matches = match(m_capSet, sf); private Set<Capability> match(Set<Capability> caps, SimpleFilter sf) Set<Capability> matches = new HashSet<Capability>(); for (Iterator<Capability> it = caps.iterator(); it.hasNext(); ) Capability cap = it.next(); public static boolean matches(Capability cap, SimpleFilter sf) private static boolean matchesInternal(Capability cap, SimpleFilter sf) private static Set<Capability> matchMandatory( Set<Capability> caps, SimpleFilter sf) for (Iterator<Capability> it = caps.iterator(); it.hasNext(); ) Capability cap = it.next(); private static boolean matchMandatory(Capability cap, SimpleFilter sf) return compareApproximate(lhs, rhs);
1
if (args != null) { for (int a = 0; a < args.length; ++a) { Object arg = args[a]; if (arg instanceof Number) { Number narg = (Number) arg; Number narrow = narrow(narg); if (!narg.equals(narrow)) { args[a] = narrow; narrowed = true; }
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
if (version != null) { version = version.trim(); }
0
protected final DefaultCloseFuture gracefulFuture; gracefulFuture = new DefaultCloseFuture(discriminator, lock); return new AbstractIoWriteFuture(req, null) { Session s = getSession(); return new AbstractIoWriteFuture(s.toString(), null) {
0
class DoFnFunction<I, O> implements FlatMapFunction<Iterator<I>, O> {
0
private final boolean m_propagate; public ResourceAdapterImpl(Object impl, Class iface, boolean propagate) { m_propagate = propagate; .setPropagate(m_propagate)
0
if (SecurityHelper.getSysPerm(state, username, SystemPermission.DROP_TABLE) || SecurityHelper.getTabPerm(state, username, TablePermission.DROP_TABLE)) hasPermission = true; if (hasPermission) throw new AccumuloException("Got a security exception when I should have had permission.", ae); if (exists) throw new TableExistsException(null, tableName, "Got a TableNotFOundException but it should have existed", tnfe); else return; if (!hasPermission) throw new AccumuloException("Didn't get Security Exception when we should have");
1
return new Person(id, name, email, creditCard, city, state, timestamp.toInstant(), extra);
0
import org.apache.hc.client5.http.async.methods.SimpleHttpRequests; final SimpleHttpRequest request = SimpleHttpRequests.GET.create(target, requestUri);
0
import java.util.HashMap; import org.apache.beam.sdk.extensions.sql.meta.provider.TableProvider; abstract Map<String, TableProvider> tableProviderMap(); tableProviderMap().forEach(sqlEnv::addSchema); .setTableProviderMap(Collections.emptyMap()) public SqlTransform withTableProvider(String name, TableProvider tableProvider) { Map<String, TableProvider> map = new HashMap<>(tableProviderMap()); map.put(name, tableProvider); return toBuilder().setTableProviderMap(ImmutableMap.copyOf(map)).build(); } abstract Builder setTableProviderMap(Map<String, TableProvider> tableProviderMap);
0
setSessionClosing(s.sessionId); // Return false, if the session doesn't exists or marked as closing if (s == null || s.isClosing()) { SessionSet set = sessionSets.get(s.tickTime); // Session expiration has been removing the sessions if(set != null){ set.sessions.remove(s); } if (session == null || session.isClosing()) {
0
* @version $Id$
0
new HttpHost("http", "localhost", 8080), null, null), new HttpHost("http", "test-httpd", 8080), new HttpHost("localhost", 8888), null), new HttpHost("http", "test-httpd", 8080), new HttpHost("localhost", 8889), new HttpHost("https", "localhost", 8443), null, null), new HttpHost("https", "test-httpd", 8443), new HttpHost("localhost", 8888), null), new HttpHost("https", "test-httpd", 8443), new HttpHost("localhost", 8889), new HttpHost("http", "localhost", 8080), null, null), new HttpHost("https", "localhost", 8443), null, null)
0
import cz.seznam.euphoria.core.client.operator.Builders.Output; Output<S>> output)
0
/* * $Header: /cvshome/build/org.osgi.framework/src/org/osgi/framework/BundleListener.java,v 1.10 2006/03/14 01:21:02 hargrave Exp $ * * Copyright (c) OSGi Alliance (2000, 2005). All Rights Reserved. * * 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.osgi.framework; import java.util.EventListener; /** * A <code>BundleEvent</code> listener. When a <code>BundleEvent</code> is * fired, it is asynchronously delivered to a <code>BundleListener</code>. * * <p> * <code>BundleListener</code> is a listener interface that may be implemented * by a bundle developer. * <p> * A <code>BundleListener</code> object is registered with the Framework using * the {@link BundleContext#addBundleListener} method. * <code>BundleListener</code>s are called with a <code>BundleEvent</code> * object when a bundle has been installed, resolved, started, stopped, updated, * unresolved, or uninstalled. * * @version $Revision: 1.10 $ * @see BundleEvent */ public interface BundleListener extends EventListener { /** * Receives notification that a bundle has had a lifecycle change. * * @param event The <code>BundleEvent</code>. */ public void bundleChanged(BundleEvent event); }
0
import org.apache.accumulo.core.util.SimpleThreadPool; sendThreadPool = new SimpleThreadPool(numSendThreads, this.getClass().getName());
0
public AtlasEntityHeader toAtlasEntityHeaderWithClassifications(String guid) throws AtlasBaseException { return toAtlasEntityHeaderWithClassifications(getEntityVertex(guid), Collections.emptySet()); } public AtlasEntityHeader toAtlasEntityHeaderWithClassifications(AtlasVertex entityVertex) throws AtlasBaseException { return toAtlasEntityHeaderWithClassifications(entityVertex, Collections.emptySet()); } public AtlasEntityHeader toAtlasEntityHeaderWithClassifications(AtlasVertex entityVertex, Set<String> attributes) throws AtlasBaseException { AtlasEntityHeader ret = toAtlasEntityHeader(entityVertex, attributes); ret.setClassifications(getClassifications(entityVertex)); return ret; } if (CollectionUtils.isNotEmpty(entity.getClassifications())) { List<AtlasClassification> classifications = new ArrayList<>(entity.getClassifications().size()); List<String> classificationNames = new ArrayList<>(entity.getClassifications().size()); for (AtlasClassification classification : entity.getClassifications()) { classifications.add(classification); classificationNames.add(classification.getTypeName()); } ret.setClassifications(classifications); ret.setClassificationNames(classificationNames); } ret.setPropagate(isPropagationEnabled(classificationVertex));
0
import org.apache.beam.sdk.transforms.OldDoFn; private final OldDoFn<InputT, OutputT> mFunction; public DoFnFunction(OldDoFn<InputT, OutputT> fn, ProcCtxt(OldDoFn<InputT, OutputT> fn, SparkRuntimeContext runtimeContext, Map<TupleTag<?>,
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
private Configuration configuration;
0
import java.util.Base64; byte[] data = Base64.getDecoder().decode(migrations.getBytes(UTF_8)); byte[] data = Base64.getDecoder().decode(merges.getBytes(UTF_8)); String encoded = new String(Base64.getEncoder().encode(Arrays.copyOf(buffer.getData(), buffer.getLength())), UTF_8); String encoded = new String(Base64.getEncoder().encode(Arrays.copyOf(buffer.getData(), buffer.getLength())), UTF_8);
0
case RELATIONSHIP: ret = ((AtlasRelationshipType) type).getRelationshipDef(); break;
0
* @since 3.0
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
import java.io.Serializable; public interface JXPathBeanInfo extends Serializable {
0
return Collections.<T>emptyList(); List<T> valueList = new ArrayList<>(tagList.getValuesCount()); valueList.add(elemCoder.decode(inputStream, Coder.Context.OUTER)); return Collections.unmodifiableList(valueList);
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.sshd.common.file.nativefs; import org.junit.Test; import static org.junit.Assert.assertEquals; public class NativeSshFileTest { @Test public void testResolve() { assertEquals("/bar", NativeSshFile.getPhysicalName("/", "/foo", "/bar", false)); assertEquals("/bar", NativeSshFile.getPhysicalName("/", "/", "/bar", false)); assertEquals("/bar", NativeSshFile.getPhysicalName("/", "/", "bar", false)); assertEquals("/foo/bar", NativeSshFile.getPhysicalName("/", "/foo", "bar", false)); assertEquals("/foo/bar", NativeSshFile.getPhysicalName("/", "/foo/xyz", "../bar", false)); assertEquals("/foo/xyz/bar", NativeSshFile.getPhysicalName("/", "/foo/xyz", "./bar", false)); assertEquals("/foo/bar", NativeSshFile.getPhysicalName("/foo", "/", "bar", false)); assertEquals("/foo/bar", NativeSshFile.getPhysicalName("/foo", "/xyz", "../bar", false)); assertEquals("/foo/bar", NativeSshFile.getPhysicalName("/foo", "/xyz", "../../bar", false)); assertEquals("/foo/xyz/bar", NativeSshFile.getPhysicalName("/foo", "/xyz", "./bar", false)); } }
0
int desiredBundleSizeBytes = 2000;
0
* @version CVS $Id: ExpiresCachingProcessingPipeline.java,v 1.1 2003/09/04 12:42:42 cziegeler Exp $
0
Thread updateRequester = null; if (progressUpdatePeriodMs != 0) { updateRequester = new Thread() { @Override public void run() { while (true) { isProgressUpdateRequested.set(true); try { Thread.sleep(progressUpdatePeriodMs); } catch (InterruptedException e) { break; } };
0
public interface FileName extends Comparable<FileName>
0
package org.apache.batik.anim.dom; import org.apache.batik.dom.svg.SVGZoomAndPanSupport;
0
import org.apache.commons.jelly.JellyTagException; import org.dom4j.DocumentException; import org.xml.sax.SAXException; public SAXReader getSAXReader() { protected abstract SAXReader createSAXReader(); protected Document parseBody() throws JellyTagException { try { handler.startDocument(); invokeBody(newOutput); handler.endDocument(); } catch (SAXException e) { throw new JellyTagException(e); } protected Document parse(Object source) throws JellyTagException { try { if (source instanceof Document) { return (Document) source; } else if (source instanceof String) { String uri = (String) source; InputStream in = context.getResourceAsStream(uri); return getSAXReader().read(in, uri); } else if (source instanceof Reader) { return getSAXReader().read((Reader) source); } else if (source instanceof InputStream) { return getSAXReader().read((InputStream) source); } else if (source instanceof URL) { return getSAXReader().read((URL) source); } else { throw new IllegalArgumentException( "Invalid source argument. Must be a Document, String, Reader, InputStream or URL." + " Was type: " + source.getClass().getName() + " with value: " + source); } } catch (DocumentException e) { throw new JellyTagException(e); }
0
new ArrayList<>(requests.size()); new ArrayList<>(requests.size());
0
import javax.inject.Qualifier; @Qualifier
0
private static final Logger LOG = LoggerFactory.getLogger(LoggingRequestHelperImpl.class); LOG.debug("Attempting to connect to LogSearch server at {}", logSearchURI); LOG.debug("For componentName = {}, log file name is = {}", componentName, lineOne.getLogFilePath()); LOG.debug("Attempting to connect to LogSearch server at {}", logLevelQueryURI); LOG.debug("LogSearch credentials were not of the correct type, this is likely an error in configuration, credential type is = {}", credential.getClass().getName()); LOG.debug("Response code from LogSearch Service is = {}", httpURLConnection.getResponseCode()); LOG.debug("Sucessfully retrieved response from server, response = {}", buffer);
1
package com.twitter.mesos.scheduler;
0
JexlEngine jexl = new JexlBuilder().create(); JxltEngine uel = jexl.createJxltEngine(); expr = jexl.createExpression(expr.getParsedText()); expr = jexl.createExpression(expr.getParsedText()); expr = jexl.createExpression(expr.getParsedText()); expr = jexl.createExpression(expr.getParsedText()); expr = jexl.createExpression(expr.getParsedText());
1
JAVA_TO_CALCITE_MAPPING.put(Types.DATE, SqlTypeName.DATE);
0
package org.apache.accumulo.core.util.shell.commands; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command;
0
private synchronized <T> void addColumn(String title, CellType<T> type, String legend, boolean sortable) { boolean sortAscending = !"false".equals(BasicServlet.getCookieValue(req, "tableSort." + BasicServlet.encode(page) + "." + BasicServlet.encode(tableName) + "." + "sortAsc")); String sortColStr = BasicServlet.getCookieValue(req, "tableSort." + BasicServlet.encode(page) + "." + BasicServlet.encode(tableName) + "." + "sortCol"); if (!(col < 0 || sortCol >= columns.size()) && columns.get(col).getCellType().isSortable()) String showStr = BasicServlet.getCookieValue(req, "tableLegend." + BasicServlet.encode(page) + "." + BasicServlet.encode(tableName) + "." + "show"); String legendUrl = String.format("/op?action=toggleLegend&redir=%s&page=%s&table=%s&show=%s", redir, page, tableName, !showLegend); sb.append("<a href='").append(legendUrl).append("'>").append(showLegend ? "Hide" : "Show") .append("&nbsp;Legend</a>\n"); String url = String.format("/op?action=sortTable&redir=%s&page=%s&table=%s&%s=%s", redir, page, tableName, sortCol == i ? "asc" : "col", sortCol == i ? !sortAscending : i); img = String.format("&nbsp;<img width='10px' height='10px' src='/web/%s.gif' alt='%s' />", sortAscending ? "up" : "down", !sortAscending ? "^" : "v"); sb.append("<dt class='smalltext'><b>").append(title.replace("<br />", "&nbsp;")) .append("</b><dd>").append(legend).append("</dd></dt>\n"); sb.append("<th").append(first ? " class='firstcell'" : "").append(">") .append(cellValue.isEmpty() ? "-" : cellValue).append("</th>"); sb.append("<tr><td class='center' colspan='").append(columns.size()) .append("'><i>Empty</i></td></tr>\n"); private static void row(StringBuilder sb, boolean highlight, ArrayList<TableColumn<?>> columns, TableRow row) {
0
import javax.management.JMException; import org.apache.zookeeper.jmx.ManagedUtil; try { ManagedUtil.registerLog4jMBeans(); } catch (JMException e) { LOG.warn("Unable to register log4j JMX control", e); }
0
* @return The InboundSecurityContext InboundSecurityContext getSecurityContext();
0
if (!cookie.isExpired(now)) {
0
import aQute.bnd.build.*; private String bndResourceName; public boolean isProjectFile() { return Project.BNDFILE.equals(getBndResourceName()); public boolean isBndrun() { return getBndResourceName().endsWith(Constants.DEFAULT_BNDRUN_EXTENSION); public String getBndResourceName() { if (bndResourceName == null) return ""; return bndResourceName; } public void setBndResourceName(String bndResourceName) { this.bndResourceName = bndResourceName; }
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.iterators; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; /** * This class remains here for backwards compatibility. * * @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.VersioningIterator} */ @Deprecated public class VersioningIterator extends org.apache.accumulo.core.iterators.user.VersioningIterator { public VersioningIterator() {} public VersioningIterator(SortedKeyValueIterator<Key,Value> iterator, int maxVersions) { super(); this.setSource(iterator); this.maxVersions = maxVersions; } }
0
AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), args[0], args[1]); AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), args[2], args[3].getBytes(), true, args[6]);
0
package org.apache.beam.sdk.extensions.gcp.options; import org.apache.beam.sdk.extensions.gcp.auth.CredentialFactory; import org.apache.beam.sdk.extensions.gcp.auth.GcpCredentialFactory; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.DefaultValueFactory; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.options.PipelineOptions;
0
Iterable<Resource> iterable = new HashSet<>(); Iterable<Resource> iterable = new HashSet<>(); Iterable<Resource> iterable = new HashSet<>(); Iterable<Resource> iterable = new HashSet<>();
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at
0
import org.apache.sshd.common.util.KeyUtils; final String keyAlg = KeyUtils.getKeyType(serverKey); if (keyAlg == 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. * @version $Revision: 1.12 $ $Date: 2004/02/18 01:13:19 $
0
/* * Copyright 2006 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.configuration; /** * <p> * Definition of an interface for objects that can create a configuration. * </p> * <p> * This interface defines an abstract way of creating a * <code>Configuration</code> object. It does not assume any specific way of * how this is done; this is completely in the responsibility of an * implementation class. There is just a single method that returns the * configuration constructed by this builder. * </p> * * @author Oliver Heger * @version $Id$ */ public interface ConfigurationBuilder { /** * Returns the configuration provided by this builder. An implementation has * to perform all necessary steps for creating and initializing a * <code>Configuration</code> object. * * @return the configuration * @throws ConfigurationException if an error occurs */ Configuration getConfiguration() throws ConfigurationException; }
0
private boolean closed; if (this.closed) { return; } this.closed = true; return this.closed;
0
public void checkEncoding(final String expected, final String source) throws EncoderException { protected void checkEncodings(final String[][] data) throws EncoderException { for (final String[] element : data) { protected void checkEncodingVariations(final String expected, final String data[]) throws EncoderException { for (final String element : data) { final Encoder encoder = this.getStringEncoder(); final StringEncoder encoder = this.getStringEncoder(); } catch (final EncoderException ee) { final StringEncoder encoder = this.getStringEncoder(); } catch (final Exception e) { final StringEncoder encoder = this.getStringEncoder(); final String[] data = {"I", "i",}; final Locale orig = Locale.getDefault(); final Locale[] locales = {Locale.ENGLISH, new Locale("tr"), Locale.getDefault()}; for (final String element : data) { } catch (final Exception e) {
1
logger.debug("Register FactoryBean=" + itfName + " hint=" + hint + " service=" + service); this.bundleContext.registerService(itfName, service, properties);
0
package org.apache.accumulo.monitor.servlets.trace;
1
String TAG_METADATA = "metadata"; String TAG_TSPAN = "tspan";
0
* @version $Revision$
0
import org.apache.beam.sdk.values.Row; public BeamSqlPrimitive evaluate(Row inputRow, BoundedWindow window) {
0