Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
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
0
EasyMock.expect(marker.state(server1, id)).andReturn(new Pair<>(WalState.UNREFERENCED, path)); EasyMock.expect(marker.state(server1, id)).andReturn(new Pair<>(WalState.CLOSED, path)); EasyMock.expect(marker.state(server1, id)).andReturn(new Pair<>(WalState.UNREFERENCED, path));
1
import org.apache.batik.gvt.event.GraphicsNodePaintEvent; import org.apache.batik.gvt.event.GraphicsNodePaintListener; /** * Constructs a new dynamic renderer with the specified buffer image. * @param offScreen the offscreen buffer to use */ //root.removeGlobalPropertyChangeListener(updateListener); root.removeGraphicsNodePaintListener(updateListener); //root.addGlobalPropertyChangeListener(updateListener); root.addGraphicsNodePaintListener(updateListener); /** * Sets the repaint handler to the specified repaint handler. * @param repaintHandler the new repaint handler of this renderer */ * Returns the repaint handler of this dynamic renderer. public RepaintHandler getRepaintHandler() { return repaintHandler; protected class UpdateListener implements PropertyChangeListener, GraphicsNodePaintListener { } public void graphicsNodeModified(GraphicsNodePaintEvent evt) { AffineTransform Gx = node.getGlobalTransform(); Shape oldAoi = evt.getOldBounds(); Shape newAoi = Gx.createTransformedShape(node.getBounds()).getBounds(); repaintHandler.notifyRepaintedRegion(oldAoi, newAoi); void notifyRepaintedRegion(Shape oldAoi, Shape newAoi);
0
* Utility class to manage hierarchical application contexts. * * @since 1.0
0
import org.apache.cocoon.core.TestBootstrapEnvironment; import org.apache.cocoon.core.TestCoreUtil;
0
* * */ } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
0
import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpEntity; import org.apache.hc.core5.http.HttpRequest; import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.NameValuePair; import org.apache.hc.core5.http.entity.BasicHttpEntity; import org.apache.hc.core5.http.entity.ContentType; import org.apache.hc.core5.http.entity.EntityUtils; import org.apache.hc.core5.http.entity.StringEntity; import org.apache.hc.core5.http.message.BasicHeader; import org.apache.hc.core5.http.message.BasicNameValuePair; Assert.assertSame(entity, request.getEntity()); Assert.assertSame(entity, request.getEntity()); final HttpEntity entity = request.getEntity(); Assert.assertSame(entity, copy.getEntity()); assertNameValuePair(new BasicNameValuePair("p1", "this"), parameters.get(0)); assertNameValuePair(new BasicNameValuePair("p2", "that"), parameters.get(1)); private static void assertNameValuePair ( final NameValuePair expected, final NameValuePair result) { Assert.assertNotNull(result); Assert.assertEquals(expected.getName(), result.getName()); Assert.assertEquals(expected.getValue(), result.getValue()); }
0
elemsCoder.encode(value.residualElements, outStream); elemsCoder.decode(inStream),
0
if (!Tables.exists(context, scanState.tableId)) else if (Tables.getTableState(context, scanState.tableId) == TableState.OFFLINE) Tables.clearCache(context); if (!Tables.exists(context, scanState.tableId)) e.setTableInfo(Tables.getPrintableTableInfoFromId(context, scanState.tableId)); String message = "Table " + Tables.getPrintableTableInfoFromId(context, scanState.tableId)
0
addInlinedPaths( ( Artifact ) i.next(), inline, m_inlinedPaths ); String[] filters = inline.split( "\\|" ); else // Analyzer.BUNDLE_CLASSPATH
0
import org.apache.commons.bcel6.Const; super(Const.ATTR_DEPRECATED, name_index, length, constant_pool); return Const.getAttributeName(Const.ATTR_DEPRECATED);
0
package org.apache.batik.anim.dom;
0
* @version CVS $Id: SerializeNode.java,v 1.5 2003/08/12 15:48:02 sylvain Exp $ Map objectModel = env.getObjectModel(); ProcessingPipeline pipeline = context.getProcessingPipeline(); if (objectModel.containsKey(Constants.LINK_OBJECT)) { pipeline.addTransformer("<translator>", null, Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS); if (objectModel.containsKey(Constants.LINK_COLLECTION_OBJECT) && env.isExternal()) { pipeline.addTransformer("<gatherer>", null, Parameters.EMPTY_PARAMETERS, Parameters.EMPTY_PARAMETERS);
0
Copyright 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
/* ==================================================================== * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * @version $Revision: 1.11 $ $Date: 2004/01/14 21:34:30 $
0
if (log.isTraceEnabled()) { out = new LoggingFilterOutputStream(out, "IN(" + resolver + "): ", log);
0
transformedMap = TransformedMap.transformingMap(backingMap, NOPTransformer.<String> nopTransformer(),
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.testing; import org.apache.beam.sdk.util.SerializableUtils; import com.google.api.client.util.Base64; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.node.ObjectNode; import java.io.IOException; /** * MatcherDeserializer is used with Jackson to enable deserialization of SerializableMatchers. */ class MatcherDeserializer extends JsonDeserializer<SerializableMatcher<?>> { @Override public SerializableMatcher<?> deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException { ObjectNode node = jsonParser.readValueAsTree(); String matcher = node.get("matcher").asText(); byte[] in = Base64.decodeBase64(matcher); return (SerializableMatcher<?>) SerializableUtils .deserializeFromByteArray(in, "SerializableMatcher"); } }
0
return Long.MAX_VALUE != status.getBegin();
0
private static final Logger log = Logger.getLogger(CleanZookeeper.class); /** * @param args * should contain one element: the address of a zookeeper node * @throws IOException * error connecting to accumulo or zookeeper */ public static void main(String[] args) throws IOException { if (args.length < 1) { System.err.println("Usage: " + CleanZookeeper.class.getName() + " hostname[:port]"); System.exit(1); } String root = Constants.ZROOT; ZooReaderWriter zk = ZooReaderWriter.getInstance(); try { for (String child : zk.getChildren(root)) { if (Constants.ZINSTANCES.equals("/" + child)) { for (String instanceName : zk.getChildren(root + Constants.ZINSTANCES)) { String instanceNamePath = root + Constants.ZINSTANCES + "/" + instanceName; byte[] id = zk.getData(instanceNamePath, null); if (id != null && !new String(id).equals(HdfsZooInstance.getInstance().getInstanceID())) { try { zk.recursiveDelete(instanceNamePath, NodeMissingPolicy.SKIP); } catch (KeeperException.NoAuthException ex) { log.warn("Unable to delete " + instanceNamePath); } } } else if (!child.equals(HdfsZooInstance.getInstance().getInstanceID())) { String path = root + "/" + child; try { zk.recursiveDelete(path, NodeMissingPolicy.SKIP); } catch (KeeperException.NoAuthException ex) { log.warn("Unable to delete " + path); } } } catch (Exception ex) { System.out.println("Error Occurred: " + ex); }
1
for (String pattern : this.map.keySet()) {
0
* * * * @version $Revision: 1.5 $
1
import org.apache.ambari.annotations.TransactionalLock; import org.apache.ambari.annotations.TransactionalLock.LockArea; import org.apache.ambari.annotations.TransactionalLock.LockType; @TransactionalLock(lockArea = LockArea.HRC_STATUS_CACHE, lockType = LockType.WRITE) @Transactional @Transactional
1
* <p> * NOTE: If you experience problems with unwanted firing of <pre>setSoTimeout()</pre> * during periods of client inactivity, this can be alleviated by calling <pre>setReaderThread(false)</pre>. * For more details, see <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=31122">this thread</a>. * </p>
0
if(inDrag) { int newValue; if (isVertical) newValue = vertical.getValue(); else newValue = horizontal.getValue(); if (newValue != startValue) setScrollPosition(); // This is the 'end' of a drag else canvas.setPaintingTransform(new AffineTransform()); }
0
t -> onError.run(), return item -> { throw new RuntimeException(item); return () -> { return item -> { return () -> true;
0
return SVG_SWITCH_TAG;
0
* $HeadURL$ * $Revision$ * $Date$ import org.apache.http.Header; httpentity.setContentType(new Header("Content-Type", "text/plain; param=yadayada")); httpentity.setContentType(new Header("Content-Type", "text/plain; charset = UTF-8")); httpentity.setContentType(new Header("Content-Type", "text/plain")); httpentity.setContentType(new Header("Content-Type", "text/plain")); httpentity.setContentType(new Header("Content-Type", "text/plain; charset=UTF-8"));
0
import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.apache.http.client.protocol.HttpClientContext; private final Set<Class<? extends IOException>> nonRetriableClasses; * @since 4.3 protected DefaultHttpRequestRetryHandler( final int retryCount, final boolean requestSentRetryEnabled, final Collection<Class<? extends IOException>> clazzes) { this.nonRetriableClasses = new HashSet<Class<? extends IOException>>(); for (final Class<? extends IOException> clazz: clazzes) { this.nonRetriableClasses.add(clazz); } } /** * Default constructor */ @SuppressWarnings("unchecked") public DefaultHttpRequestRetryHandler(final int retryCount, final boolean requestSentRetryEnabled) { this(retryCount, requestSentRetryEnabled, Arrays.asList( InterruptedIOException.class, UnknownHostException.class, ConnectException.class, SSLException.class)); for (final Class<? extends IOException> rejectException : this.nonRetriableClasses) { if (rejectException.isInstance(exception)) { return false; } final HttpClientContext localcontext = HttpClientContext.adapt(context); final HttpRequest request = localcontext.getRequest(); if (!localcontext.isRequestSent() || this.requestSentRetryEnabled) {
0
values.apply(new DirectGroupByKeyOnly<String, Integer>()); CommittedBundle<KV<String, Integer>> inputBundle = bundleFactory.createBundle(values).commit(Instant.now()); ((KvCoder<String, Integer>) values.getCoder()).getKeyCoder(); TransformEvaluator<KV<String, Integer>> evaluator = evaluator.processElement(WindowedValue.valueInGlobalWindow(firstFoo)); evaluator.processElement(WindowedValue.valueInGlobalWindow(secondFoo)); evaluator.processElement(WindowedValue.valueInGlobalWindow(thirdFoo)); evaluator.processElement(WindowedValue.valueInGlobalWindow(firstBar)); evaluator.processElement(WindowedValue.valueInGlobalWindow(secondBar)); evaluator.processElement(WindowedValue.valueInGlobalWindow(firstBaz));
0
import org.apache.hc.core5.annotation.NotThreadSafe; import org.apache.hc.core5.util.Args;
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
/* * Gets the version of the component type. * @return the version of <code>null</code> if not set.
0
public LazyDynaClass(final String name) { public LazyDynaClass(final String name, final Class<?> dynaBeanClass) { public LazyDynaClass(final String name, final DynaProperty[] properties) { public LazyDynaClass(final String name, final Class<?> dynaBeanClass, final DynaProperty properties[]) { public void setRestricted(final boolean restricted) { public void setReturnNull(final boolean returnNull) { public void add(final String name) { public void add(final String name, final Class<?> type) { public void add(final String name, final Class<?> type, final boolean readable, final boolean writeable) { protected void add(final DynaProperty property) { final DynaProperty[] oldProperties = getDynaProperties(); final DynaProperty[] newProperties = new DynaProperty[oldProperties.length+1]; public void remove(final String name) { final DynaProperty[] oldProperties = getDynaProperties(); final DynaProperty[] newProperties = new DynaProperty[oldProperties.length-1]; public DynaProperty getDynaProperty(final String name) { public boolean isDynaProperty(final String name) {
0
public interface Widget {
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 * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * 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.atlas.notification; import org.apache.atlas.AtlasException; import org.apache.commons.configuration.Configuration; /** * Abstract notification interface implementation. */ public abstract class AbstractNotification implements NotificationInterface { private static final String PROPERTY_EMBEDDED = PROPERTY_PREFIX + ".embedded"; private final boolean embedded; // ----- Constructors ------------------------------------------------------ public AbstractNotification(Configuration applicationProperties) throws AtlasException { this.embedded = applicationProperties.getBoolean(PROPERTY_EMBEDDED, false); } // ----- AbstractNotificationInterface ------------------------------------- /** * Determine whether or not the notification service embedded in Atlas server. * * @return true if the the notification service embedded in Atlas server. */ protected final boolean isEmbedded() { return embedded; } }
0
return new BundleInfo(key, (webConsoleRoot == null ? "" : webConsoleRoot) + "/components/" + cfg.id, //$NON-NLS-1$
0
* @version CVS $Id: EncodingSerializer.java,v 1.2 2003/06/24 16:59:19 cziegeler Exp $
0
throw new UnsupportedOperationException(node.getClass().getSimpleName() + " : not supported yet."); protected abstract Object visit(ASTAnnotation node, Object data); protected abstract Object visit(ASTAnnotatedStatement node, Object data);
1
package org.apache.beam.sdk.runners.inprocess; import org.apache.beam.sdk.coders.KvCoder; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.coders.VoidCoder; import org.apache.beam.sdk.runners.inprocess.InProcessPipelineRunner.CommittedBundle; import org.apache.beam.sdk.runners.inprocess.InProcessPipelineRunner.PCollectionViewWriter; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.transforms.Create; import org.apache.beam.sdk.transforms.GroupByKey; import org.apache.beam.sdk.transforms.Values; import org.apache.beam.sdk.transforms.View.CreatePCollectionView; import org.apache.beam.sdk.transforms.WithKeys; import org.apache.beam.sdk.util.PCollectionViews; import org.apache.beam.sdk.util.WindowedValue; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PCollectionView;
0
verifyCondition(condition); verifyCondition(condition); private void verifyCondition(Condition condition) throws SQLException { throw new SQLException("No filter criteria specified.");
0
case 0 :
0
package org.apache.accumulo.server.test.randomwalk.unit; import java.util.Properties; import org.apache.accumulo.server.test.randomwalk.State; import org.apache.accumulo.server.test.randomwalk.Test; public class CreateTable extends Test { @Override public void visit(State state, Properties props) throws Exception { } }
1
* 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
private final BundleRevision m_revision; BundleRevision revision, String namespace, m_revision = revision; return m_revision; return "[" + m_revision + "] " + m_namespace + "; " + getFilter().toString();
0
properties.put(HostResourceProvider.HOST_HOST_NAME_PROPERTY_ID, hostName);
0
import org.apache.atlas.repository.graphdb.titan0.Titan0GraphDatabase; * public class NativeTitan0GraphQuery implements NativeTitanGraphQuery<Titan0Vertex, Titan0Edge> { private Titan0Graph graph; private TitanGraphQuery<?> query; query = Titan0GraphDatabase.getGraphInstance().query(); this.graph = graph; public Iterable<AtlasVertex<Titan0Vertex, Titan0Edge>> vertices() { Iterable it = query.vertices(); return graph.wrapVertices(it); query.has(propertyName, Contain.IN, values); query.has(propertyName, pred, value);
1
return new QueryResult<>(resultNode, null); return new QueryResult<>(parentNode, attrName);
0
super(org.apache.commons.bcel6.Const.DUP);
0
import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions; import org.apache.beam.runners.dataflow.testing.TestDataflowPipelineRunner;
0
import com.google.inject.TypeLiteral; import org.apache.aurora.scheduler.storage.log.SnapshotStoreImpl.ExperimentalTaskStore; private Storage storage; private SnapshotStoreImpl getSnapshotStore() { Bindings.KeyFactory keyFactory = Bindings.annotatedKeyFactory(Storage.Volatile.class); Injector injector = Guice.createInjector( new AbstractModule() { @Override protected void configure() { bind(Clock.class).toInstance(Clock.SYSTEM_CLOCK); bind(StatsProvider.class).toInstance(new FakeStatsProvider()); bind(SnapshotStoreImpl.class).in(Singleton.class); bind(new TypeLiteral<Boolean>() { }).annotatedWith(ExperimentalTaskStore.class) .toInstance(true); } }, DbModule.testModule(keyFactory, Optional.of(new DbModule.TaskStoreModule(keyFactory)))); storage = injector.getInstance(Key.get(Storage.class, Storage.Volatile.class)); storage.prepare(); return injector.getInstance(SnapshotStoreImpl.class); } private Snapshot createSnapshot(int updates, int events, int instanceEvents) { JobUpdates.saveUpdates(storage, new JobUpdates.Builder() .setNumEvents(events) .setNumInstanceEvents(instanceEvents) .build(updates)); return snapshotStore.createSnapshot();
0
private Map<String, String> m_configMap = new HashMap<>();
1
* $HeadURL:https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/impl/nio/TestAllImpl.java $ * $Revision:503277 $ * $Date:2007-02-03 18:22:45 +0000 (Sat, 03 Feb 2007) $
0
import org.apache.accumulo.core.Constants; if (name.startsWith(Constants.MAPFILE_EXTENSION + "_")) { if (extension.equals(Constants.MAPFILE_EXTENSION) || extension.equals(Constants.MAPFILE_EXTENSION + "_tmp")) { private static final HashSet<String> validExtensions = new HashSet<String>(Arrays.asList(Constants.MAPFILE_EXTENSION, RFile.EXTENSION));
0
/** {@link org.apache.commons.logging} logging facility */ static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(Algorithm.class.getName());
0
switch (this.status) { case ACTIVE: buffer.append("ACTIVE"); break; case CLOSING: buffer.append("CLOSING"); break; case CLOSED: buffer.append("CLOSED"); break; } buffer.append("]["); buffer.append(":");
0
protected Object convert(Object value, Class<?> type) {
0
* * @version $Id$
0
import java.io.File; import java.io.IOException; import java.net.ServerSocket; import java.net.URI; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; private static int cassandraPort; private static int cassandraNativePort; private static int getFreeLocalPort() throws IOException { ServerSocket serverSocket = new ServerSocket(0); int port = serverSocket.getLocalPort(); serverSocket.close(); return port; } conf.set(CASSANDRA_NATIVE_PORT_PROPERTY, String.valueOf(cassandraNativePort)); conf.set(CASSANDRA_THRIFT_PORT_PROPERTY, String.valueOf(cassandraPort)); cassandraPort = getFreeLocalPort(); cassandraNativePort = getFreeLocalPort(); replacePortsInConfFile(); .withPort(cassandraNativePort) private static void replacePortsInConfFile() throws Exception { URI uri = HIFIOWithEmbeddedCassandraTest.class.getResource("/cassandra.yaml").toURI(); Path cassandraYamlPath = new File(uri).toPath(); String content = new String(Files.readAllBytes(cassandraYamlPath), Charset.defaultCharset()); content = content.replaceAll("9043", String.valueOf(cassandraNativePort)); content = content.replaceAll("9161", String.valueOf(cassandraPort)); Files.write(cassandraYamlPath, content.getBytes(Charset.defaultCharset())); }
0
import org.apache.beam.sdk.transforms.DoFn; * Interface that may be required by some (internal) {@link DoFn}s to implement windowing. It
0
props.put("instance.name",compName); props.put("instance.name",compName); props.put("instance.name",compName);
0
* @version $Revision$
0
* @version CVS $Id: PortletURLProviderImpl.java,v 1.6 2004/03/19 07:24:12 cziegeler Exp $ /** The generated url */ protected String generatedURL; if ( this.generatedURL == null ) { final PortletWindowImpl impl = (PortletWindowImpl)this.portletWindow; final CopletLayout cl = impl.getLayout(); Event sizingEvent = null; if ( cl != null ) { final CopletInstanceData cid = cl.getCopletInstanceData(); WindowState oldState = (WindowState)cid.getAttribute("window-state"); if ( oldState == null ) { oldState = WindowState.NORMAL; } if ( this.state != null && !this.state.equals(oldState) ) { if ( oldState.equals(WindowState.MAXIMIZED) ) { sizingEvent = new FullScreenCopletEvent( cid, null ); } else { if ( this.state.equals(WindowState.MAXIMIZED) ) { sizingEvent = new FullScreenCopletEvent( cid, cl ); } PortalService service = null; try { service = (PortalService) this.manager.lookup(PortalService.ROLE); LinkService linkService = service.getComponentManager().getLinkService(); //TODO - secure List l = new ArrayList(); if ( sizingEvent != null ) { l.add(sizingEvent); } l.add(this); this.generatedURL = linkService.getLinkURI(l); } catch (ServiceException se) { throw new CascadingRuntimeException("Unable to lookup portal service.", se); } finally { this.manager.release(service); return this.generatedURL;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/test/org/apache/commons/jelly/define/Attic/TestDynamicTags.java,v 1.6 2002/06/25 19:12:29 jstrachan Exp $ * $Revision: 1.6 $ * $Date: 2002/06/25 19:12:29 $ * $Id: TestDynamicTags.java,v 1.6 2002/06/25 19:12:29 jstrachan Exp $ * @version $Revision: 1.6 $ StringWriter buffer = new StringWriter(); public void testJellyBean() throws Exception { StringWriter buffer = new StringWriter(); output = XMLOutput.createXMLOutput(buffer); runScript("src/test/org/apache/commons/jelly/define/jellyBeanSample.jelly"); log.info("The output was as follows"); log.info(buffer.toString()); }
0
package org.apache.sshd.cli.server; * Just a test class used to invoke {@link SshServerMain#main(String[])} in public final class SshServerMainDevelopment { private SshServerMainDevelopment() { SshServerMain.main(args);
0
/** * This class is left in place specifically to test for regressions against the published version of TableOperationsHelper. */ public class TableOperationsHelperTest extends org.apache.accumulo.core.client.impl.TableOperationsHelperTest { @SuppressWarnings("deprecation") @Override protected org.apache.accumulo.core.client.impl.TableOperationsHelper getHelper() { return new Tester();
0
protected List<Integer> getInput() { return Arrays.asList( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); public List<Integer> getUnorderedOutput() { return Arrays.asList(2, 4, 6, 8, 10, 12, 14);
0
filePattern = LocalResources.fromFile(tmpFolder.getRoot(), true) .resolve("*", StandardResolveOptions.RESOLVE_FILE) .toString(); String contents1 = "To be or not to be, ", filePattern = LocalResources.fromFile(tmpFolder.getRoot(), true) .resolve("result-*", StandardResolveOptions.RESOLVE_FILE) .toString(); NumberedShardedFile shardedFile = new NumberedShardedFile(filePattern, Pattern.compile("incorrect-template")); doThrow(IOException.class).when(shardedFile).readLines(anyCollection());
1
import org.apache.cocoon.Constants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; * Add a bean definition for the settings object to the bean factory. * @see CocoonNamespaceHandler * @see SettingsBeanFactoryPostProcessor /** Logger (we use the same logging mechanism as Spring!) */ protected final Log logger = LogFactory.getLog(getClass()); this.logger.info("Initializing Apache Cocoon " + Constants.VERSION);
0
@Override @Override @Override @Override @Override @Override
0
* * * * tmpMap.put(_Fields.EXTENT, new org.apache.thrift.meta_data.FieldMetaData("extent", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.AGE, new org.apache.thrift.meta_data.FieldMetaData("age", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.INPUT_FILES, new org.apache.thrift.meta_data.FieldMetaData("inputFiles", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, tmpMap.put(_Fields.OUTPUT_FILE, new org.apache.thrift.meta_data.FieldMetaData("outputFile", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.REASON, new org.apache.thrift.meta_data.FieldMetaData("reason", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.LOCALITY_GROUP, new org.apache.thrift.meta_data.FieldMetaData("localityGroup", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.ENTRIES_READ, new org.apache.thrift.meta_data.FieldMetaData("entriesRead", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.ENTRIES_WRITTEN, new org.apache.thrift.meta_data.FieldMetaData("entriesWritten", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.ITERATORS, new org.apache.thrift.meta_data.FieldMetaData("iterators", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, * * * * if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { } else { } else { } else { } else { } else { } else { } else { } else { } else { } else {
0
/* ==================================================================== * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * @version $Revision: 1.2 $ $Date: 2004/01/14 21:34:28 $
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/OptionBuilder.java,v 1.8 2002/09/09 19:48:13 jkeyes Exp $ * $Revision: 1.8 $ * $Date: 2002/09/09 19:48:13 $ // PMM 9/6/02 - these were missing optionalArg = false; valuesep = (char) 0;
0
private boolean isZkConnectString=false;//by default its false public SolrClient connectToSolr(String url, String zkConnectString, solrDetail = "zkConnectString=" + zkConnectString + ", collection=" + collection if (!stringUtil.isEmpty(zkConnectString)) { isZkConnectString=true; solrDetail = "zkConnectString=" + zkConnectString + ", collection=" + collection; solrClouldClient = new CloudSolrClient(zkConnectString); throw new Exception("Both zkConnectString and URL are empty. zkConnectString=" + zkConnectString + ", collection=" + collection + ", url=" if (isZkConnectString) {
0
private String attribute; * Sets the attribute name from which the property name has to be extracted. * * @param propertyName The name of property to set * @return this builder instance */ public BeanPropertySetterBuilder extractPropertyNameFromAttribute( String attribute ) { if ( attribute == null ) { reportError( "setBeanProperty().extractPropertyNameFromAttribute( String )", "Attribute name can not be null" ); } this.attribute = attribute; return this; } /** BeanPropertySetterRule rule = new BeanPropertySetterRule( propertyName ); rule.setPropertyNameFromAttribute( attribute ); return rule;
0
error("The input file is not a JarFile : " + in.getAbsolutePath()); jos.putNextEntry(curEntry); if (!meta.equals("")) { att.putValue("iPOJO-Components", meta); } warn("Neither component types, nor instances in " + path);
0
expect(executor.submit(anyObject(AsyncCallableService.class))).andReturn(mockFuture).times(2);
0
public class DefaultFileComparator implements Comparator<File>, Serializable { public static final Comparator<File> DEFAULT_COMPARATOR = new DefaultFileComparator(); public static final Comparator<File> DEFAULT_REVERSE = new ReverseComparator(DEFAULT_COMPARATOR); * @param file1 The first file to compare * @param file2 The second file to compare public int compare(File file1, File file2) {
0
/** * Copyright 2016 Seznam a.s. * * 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 javax.sql.StatementEventListener; /** * Add a statement event listener */ public void addStatementEventListener(StatementEventListener listener) { if (!eventListeners.contains(listener)) { eventListeners.add(listener); } } /** * Remove a statement event listener */ public void removeStatementEventListener(StatementEventListener listener) { eventListeners.remove(listener); }
0
info.view = getView(info.queryString, env); public static String getView(String query, Environment env) { if (query != null) { int index = query.indexOf(Constants.VIEW_PARAM); if (index != -1 && (index == 0 || query.charAt(index-1) == '&') && query.length() > index + Constants.VIEW_PARAM.length() && query.charAt(index+Constants.VIEW_PARAM.length()) == '=') { String tmp = query.substring(index+Constants.VIEW_PARAM.length()+1); index = tmp.indexOf('&'); if (index != -1) { return tmp.substring(0,index); } else { return tmp; } } else { return env.getView(); } } else { return env.getView(); } }
0
import org.apache.accumulo.tserver.tablet.Durability; if (Durability.fromString(acuTableConf.get(Property.TABLE_DURABILITY)) != Durability.NONE) {
0
* * @param clusterDesiredConfigs * the desired configurations for the cluster. Obtaining these can be * expensive and since this method operates on hosts, it could be * called 1,000's of times when generating host responses. Therefore, * the caller should build these once and pass them in. If * {@code null}, then this method will retrieve them at runtime, * incurring a performance penality. Map<String, HostConfig> getDesiredHostConfigs(Cluster cluster, Map<String, DesiredConfig> clusterDesiredConfigs) throws AmbariException;
0
import org.apache.http.HttpVersion; HttpRequest request = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1); HttpVersion.HTTP_1_1, cacheEntryHeaders, new ByteArrayEntity(new byte[0]), HttpRequest request = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1); HttpVersion.HTTP_1_1, cacheEntryHeaders, new ByteArrayEntity(new byte[0]),
0
String id = cid.getId(); if (id != null) { this.setId(cid.getId()); }
0
* @version $Id$ public abstract class AbstractSortedBidiMapDecorator<K, V> extends AbstractOrderedBidiMapDecorator<K, V> implements SortedBidiMap<K, V> { /** * {@inheritDoc} */ /** * {@inheritDoc} */ /** * {@inheritDoc} */ /** * {@inheritDoc} */ /** * {@inheritDoc} */
0
if (getXblBoundElement((Node) target) == null) { // ??? suspect cast ??? if (getXblBoundElement((Node) target) == null) { // ??? suspect cast ???
0
* @version CVS $Id$
0
import org.apache.hc.core5.http.config.CharCodingConfig; import org.apache.hc.core5.http.impl.ConnectionListener; import org.apache.hc.core5.http.impl.Http1StreamListener; import org.apache.hc.core5.http.nio.NHttpMessageParserFactory; import org.apache.hc.core5.http.nio.NHttpMessageWriterFactory; private final CharCodingConfig charCodingConfig; private final NHttpMessageParserFactory<HttpRequest> requestParserFactory; private final NHttpMessageWriterFactory<HttpResponse> responseWriterFactory; final CharCodingConfig charCodingConfig, this.charCodingConfig = charCodingConfig != null ? charCodingConfig : CharCodingConfig.DEFAULT; this.requestParserFactory = new DefaultHttpRequestParserFactory(this.h1Config); this.responseWriterFactory = DefaultHttpResponseWriterFactory.INSTANCE; final CharCodingConfig charCodingConfig, charCodingConfig, connectionReuseStrategy, incomingMessageParser, outgoingMessageWriter, charCodingConfig, requestParserFactory.create(), responseWriterFactory.create(),
0
import java.net.URL; * * @param documentURL the url for the document which will be scripted public Interpreter createInterpreter(URL documentURL) {
0
nullList.set(pos, instance.nullFlags[nullPos]);
0
* Output the value to a tagged output at the specified timestamp in the listed windows. <AdditionalOutputT> void outputWindowedValue( TupleTag<AdditionalOutputT> tag, AdditionalOutputT output,
0
return logSearchConfigConfigurer.getConfig().getServices(clusterName); InputConfig inputConfig = logSearchConfigConfigurer.getConfig().getInputConfig(clusterName, serviceName); if (logSearchConfigConfigurer.getConfig().inputConfigExists(clusterName, serviceName)) { logSearchConfigConfigurer.getConfig().createInputConfig(clusterName, serviceName, new ObjectMapper().writeValueAsString(inputConfig)); if (!logSearchConfigConfigurer.getConfig().inputConfigExists(clusterName, serviceName)) { logSearchConfigConfigurer.getConfig().setInputConfig(clusterName, serviceName, new ObjectMapper().writeValueAsString(inputConfig)); String globalConfigs = logSearchConfigConfigurer.getConfig().getGlobalConfigs(clusterName); return new LSServerLogLevelFilterMap(logSearchConfigConfigurer.getConfig().getLogLevelFilters(clusterName)); logSearchConfigConfigurer.getConfig().setLogLevelFilters(clusterName, request.convertToApi());
0
import java.util.Arrays; import java.util.LinkedList; import java.util.List; public BasePredicate create(BasePredicate... predicates) { return instance(predicates); } public static BasePredicate instance(BasePredicate... predicates) { List<BasePredicate> predicateList = new LinkedList<BasePredicate>(); // Simplify the predicate array for (BasePredicate predicate : predicates) { if (!(predicate instanceof AlwaysPredicate)) { if (predicate instanceof AndPredicate) { predicateList.addAll(Arrays.asList(((AndPredicate) predicate).getPredicates())); } else { predicateList.add(predicate); } } } return predicateList.size() == 1 ? predicateList.get(0) : new AndPredicate(predicateList.toArray(new BasePredicate[predicateList.size()])); } @Override
1
allInputs.put(new TupleTag<Void>() {}, voids);
1
import org.apache.http.client.methods.CloseableHttpResponse; final CloseableHttpResponse response1 = this.httpclient.execute(target, httpRequest, context); try { EntityUtils.consume(response1.getEntity()); } finally { response1.close(); } final CloseableHttpResponse response2 = this.httpclient.execute(target, httpRequest, context); try { EntityUtils.consume(response2.getEntity()); } finally { response2.close(); } final CloseableHttpResponse response3 = this.httpclient.execute(target, httpRequest, context); try { EntityUtils.consume(response3.getEntity()); } finally { response3.close(); }
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
public void terminate(ScheduleStatus terminalState, String reason) {
0
Set<String> setMatches = new HashSet<>(); mapProperties = new HashMap<>(setMatches.size()); List<SortRequestProperty> properties = new ArrayList<>();
1
import org.apache.batik.bridge.FilterPrimitiveBridge; * @author <a href="mailto:[email protected]">Thierry Kormann</a> public class SVGFeMorphologyElementBridge implements FilterPrimitiveBridge,
0