Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
final PersistenceManager persistenceManager, final String baseId, final String bundleLocation ) this.staticBundleLocation = bundleLocation; // 104.15.2.8 The bundle location will be set persistently this.staticBundleLocation = bundleLocation; storeSilently(); if ( ( this instanceof ConfigurationImpl ) && ( bundleLocation != null ) ) if ( getDynamicBundleLocation() != null && !bundleLocation.equals( getDynamicBundleLocation() ) ) { getConfigurationManager().revokeConfiguration( ( ConfigurationImpl ) this ); } // check whether we have to assign the configuration to new targets getConfigurationManager().reassignConfiguration( ( ConfigurationImpl ) this ); // FELIX-1488: If a dynamically bound configuration is unbound and not // statically bound, it may be rebound to another bundle asking for it // (unless the dynamic unbind happens due to configuration deletion) if ( bundleLocation == null && getStaticBundleLocation() == null && ( this instanceof ConfigurationImpl ) ) { getConfigurationManager().reassignConfiguration( ( ConfigurationImpl ) this ); }
0
package aQute.bnd.service.diff; import aQute.lib.osgi.*; /** * Compare two Jars and report the differences. */ public interface Differ { Tree tree(Analyzer source ) throws Exception; Tree tree(Jar source) throws Exception; Tree deserialize(Tree.Data data) throws Exception; }
0
implements Parameterizable {
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java,v 1.3 2003/10/13 07:04:31 rdonkin Exp $ * $Revision: 1.3 $ * $Date: 2003/10/13 07:04:31 $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation. * @version $Id: ByteArrayOutputStream.java,v 1.3 2003/10/13 07:04:31 rdonkin Exp $
0
/* * Copyright 2002, 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.10 $ $Date: 2004/02/28 03:35:51 $
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.runners.core; import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.transforms.GroupByKey; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.util.KeyedWorkItem; import org.apache.beam.sdk.values.KV; import org.apache.beam.sdk.values.PCollection; /** * Interface for creating a runner-specific {@link GroupByKey GroupByKey-like} {@link PTransform} * that produces {@link KeyedWorkItem KeyedWorkItems} so that downstream transforms can access state * and timers. */ @Experimental(Experimental.Kind.SPLITTABLE_DO_FN) public class GBKIntoKeyedWorkItems<KeyT, InputT> extends PTransform<PCollection<KV<KeyT, InputT>>, PCollection<KeyedWorkItem<KeyT, InputT>>> { @Override public PCollection<KeyedWorkItem<KeyT, InputT>> apply(PCollection<KV<KeyT, InputT>> input) { return PCollection.createPrimitiveOutputInternal( input.getPipeline(), input.getWindowingStrategy(), input.isBounded()); } }
0
@Retention(RetentionPolicy.RUNTIME)
0
private final Map<String, ServiceRegistration> registeredConfigurations = new LinkedHashMap<>(); private final List<CloseableHttpClient> trackedHttpClients = new LinkedList<>(); final Hashtable<String, Object> props = new Hashtable<>();
0
import org.apache.cocoon.portal.coplet.CopletInstance; public void service(ServiceManager aManager) throws ServiceException { super.service(aManager); Object preparableObject = object; preparableObject = ((Map)object).values(); preparableObject = this.checkAvailability((Layout)object); if ( preparableObject != null ) { this.portalService.getLayoutFactory().prepareLayout((Layout)preparableObject); final Iterator iterator = ((Collection)preparableObject).iterator(); if ( o instanceof CopletInstance) { CopletInstance cid = (CopletInstance)o; if ( cid.getCopletDefinition() != null ) { adapter = this.portalService.getCopletAdapter(cid.getCopletDefinition().getCopletType().getCopletAdapterName()); if ( cl.getCopletInstanceData() == null || cl.getCopletInstanceData().getCopletDefinition() == null ) { return aspectContext.getProfile();
0
import java.util.LinkedHashMap; /** * The OptionDescriber interface allows you to set up iterator properties interactively in the accumulo shell. If your iterator and/or filter must implement * this interface for the interactive part. The alternative would be to manually set configuration options with the config -t tableName property=value. If you * go the manual route, be careful to use the correct structure for the property and to set all the properties required for the iterator. * OptionDescribers will need to implement two methods: describeOptions() which returns an instance of IteratorOptions and validateOptions(Map<String,String> * options) which is intended to throw an exception or return false if the options are not acceptable. /** * IteratorOptions requires the following: * * @param name * is the distinguishing name for the iterator or filter * @param description * is a description of the iterator or filter * @param namedOptions * is a map from specifically named options to their descriptions (null if unused) e.g., the AgeOffFilter requires a parameter called "ttl", so its * namedOptions = Collections.singletonMap("ttl", "time to live (milliseconds)") * @param unnamedOptionDescriptions * is a list of descriptions of additional options that don't have fixed names (null if unused). The descriptions are intended to describe a * category, and the user will provide parameter names and values in that category; e.g., the FilteringIterator needs a list of Filters intended to * be named by their priority numbers, so its unnamedOptionDescriptions = * Collections.singletonList("<filterPriorityNumber> <ageoff|regex|filterClass>")
0
throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); throw createDOMException(DOMException.INVALID_CHARACTER_ERR, "prefix", new Object[] { new Integer(getNodeType()), getNodeName(), prefix }); super.export(n, d); SVGOMElement e = (SVGOMElement)n; e.prefix = prefix; return n; super.deepExport(n, d); SVGOMElement e = (SVGOMElement)n; e.prefix = prefix; return n; super.copyInto(n); SVGOMElement e = (SVGOMElement)n; e.prefix = prefix; return n; super.deepCopyInto(n); SVGOMElement e = (SVGOMElement)n; e.prefix = prefix; return n;
1
import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import org.apache.ambari.server.utils.CollectionPresentationUtils; // Depends on hashing, string representation can be different // We need a sophisticated comparison List<String> parts = Arrays.asList(dump.substring(1, 522).split(Pattern.quote("],"))); assertEquals(3, parts.size()); assertTrue(parts.contains("\"RoleCommandPair{role=SECONDARY_NAMENODE, cmd=UPGRADE}\":[{\"role\":{\"name\":\"NAMENODE\"},\"cmd\":\"UPGRADE\"}")); assertTrue(parts.contains("\"RoleCommandPair{role=SECONDARY_NAMENODE, cmd=START}\":[{\"role\":{\"name\":\"NAMENODE\"},\"cmd\":\"START\"}")); boolean datanodeCommandExists = false; for (String part : parts) { if (part.contains("RoleCommandPair{role=DATANODE, cmd=STOP}")) { datanodeCommandExists = true; String[] parts2 = part.split(Pattern.quote(":[")); assertEquals(2, parts2.length); assertEquals("\"RoleCommandPair{role=DATANODE, cmd=STOP}\"", parts2[0]); List<String> components = Arrays.asList(new String[]{"\"role\":{\"name\":\"HBASE_MASTER\"},\"cmd\":\"STOP\"", "\"role\":{\"name\":\"RESOURCEMANAGER\"},\"cmd\":\"STOP\"", "\"role\":{\"name\":\"TASKTRACKER\"},\"cmd\":\"STOP\"", "\"role\":{\"name\":\"NODEMANAGER\"},\"cmd\":\"STOP\"", "\"role\":{\"name\":\"HISTORYSERVER\"},\"cmd\":\"STOP\"", "\"role\":{\"name\":\"JOBTRACKER\"},\"cmd\":\"STOP\""}); Assert.assertTrue(CollectionPresentationUtils.isStringPermutationOfCollection(parts2[1], components, "},{", 1, 1)); } } assertTrue(datanodeCommandExists);
0
import org.ow2.chameleon.testing.helpers.BaseTest; import java.util.Arrays; import java.util.List; public class TestTypeBoxing extends BaseTest { @Override protected List<String> getExtraExports() { return Arrays.asList("org.apache.felix.ipojo.runtime.core.components"); }
0
final String servicePid = getKeyPid( key ); if ( servicePid != null ) { return this.configurations.get( servicePid ); } // the targeted PID does not match here return null; final String servicePid = getKeyPid( key ); if ( servicePid != null ) protected String getKeyPid( final TargetedPID targetedPid ) { // regular use case: service PID is the key if ( this.accepts( targetedPid.getServicePid() ) ) { return targetedPid.getServicePid(); } // the raw PID is the key (if the service PID contains pipes) if ( this.accepts( targetedPid.getRawPid() ) ) { return targetedPid.getRawPid(); } // this is not really expected here return null; }
0
import org.apache.http.HttpHost; // Populate the context with a default HTTP host based on the // inet address of the target host if (conn instanceof HttpInetConnection) { InetAddress address = ((HttpInetConnection) conn).getRemoteAddress(); int port = ((HttpInetConnection) conn).getRemotePort(); if (address != null) { HttpHost host = new HttpHost(address.getHostName(), port); context.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST, host); } }
0
import org.apache.ambari.server.configuration.Configuration; import org.quartz.SimpleTrigger; import java.util.Properties; Properties properties; InMemoryDefaultTestModule defaultTestModule = new InMemoryDefaultTestModule(); properties = defaultTestModule.getProperties(); injector = Guice.createInjector(Modules.override(defaultTestModule) .with(new ExecutionSchedulerTestModule())); private RequestExecution createRequestExecution(boolean addSchedule) throws Exception { if (!addSchedule) { schedule = null; } RequestExecution requestExecution = createRequestExecution(true); RequestExecution requestExecution = createRequestExecution(true); @Test public void testPointInTimeExecutionJob() throws Exception { RequestExecution requestExecution = createRequestExecution(false); Assert.assertNotNull(requestExecution); executionScheduleManager.scheduleBatch(requestExecution); String jobName1 = executionScheduleManager.getJobName(requestExecution .getId(), 10L); String jobName2 = executionScheduleManager.getJobName(requestExecution .getId(), 12L); JobDetail jobDetail1 = scheduler.getJobDetail(JobKey.jobKey(jobName1, ExecutionJob.LINEAR_EXECUTION_JOB_GROUP)); JobDetail jobDetail2 = scheduler.getJobDetail(JobKey.jobKey(jobName2, ExecutionJob.LINEAR_EXECUTION_JOB_GROUP)); Assert.assertNotNull(jobDetail1); Assert.assertNotNull(jobDetail2); List<? extends Trigger> triggers = scheduler.getTriggersOfJob (JobKey.jobKey(jobName1, ExecutionJob.LINEAR_EXECUTION_JOB_GROUP)); Assert.assertNotNull(triggers); Assert.assertEquals(1, triggers.size()); assertThat(triggers.get(0), instanceOf(SimpleTrigger.class)); int waitCount = 0; while (scheduler.getCurrentlyExecutingJobs().size() != 0 && waitCount < 10) { Thread.sleep(100); waitCount++; } }
0
import org.apache.ambari.server.configuration.Configuration; Configuration configuration = EasyMock.createMock(Configuration.class); expect(configuration.getRollingUpgradeMinStack()).andReturn("HDP-2.2").anyTimes(); expect(configuration.getRollingUpgradeMaxStack()).andReturn("").anyTimes(); replay(configuration); m_check.config = configuration;
0
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @BeforeEach
0
package org.apache.bcel.generic; super(org.apache.bcel.Const.D2I);
1
package org.apache.accumulo.shell.commands; import org.apache.accumulo.shell.Shell; import org.apache.accumulo.shell.Shell.Command;
0
boolean ret = updateRenderingTransform(); initialTransform = new AffineTransform(); if (!initialTransform.equals(getRenderingTransform())) { setRenderingTransform(initialTransform, false); ret = true; Dimension d = getSize(); if (d.width < 1) d.width = 1; if (d.height < 1) d.height = 1; AffineTransform at = ViewBox.getViewTransform (fragmentIdentifier, elt, d.width, d.height); cgn.setViewingTransform(at); initialTransform = new AffineTransform(); setRenderingTransform(initialTransform, false);
0
import org.apache.beam.runners.core.SplittableParDo.GBKIntoKeyedWorkItems; import org.apache.beam.sdk.runners.PTransformOverrideFactory; GBKIntoKeyedWorkItems<KeyT, InputT>> { getReplacementTransform(GBKIntoKeyedWorkItems<KeyT, InputT> transform) {
0
import static org.apache.aurora.gen.apiConstants.BYPASS_LEADER_REDIRECT_HEADER_NAME; if (request.getHeader(BYPASS_LEADER_REDIRECT_HEADER_NAME) != null) { LOG.info(BYPASS_LEADER_REDIRECT_HEADER_NAME + " header was present on the request, bypassing " + "leader redirection."); chain.doFilter(request, response); return; }
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.ipojo.runtime.core.services; public interface PrimitiveManipulationTestService { byte getByte(); void setByte(byte b); short getShort(); void setShort(short s); int getInt(); void setInt(int i); long getLong(); void setLong(long l); float getFloat(); void setFloat(float f); double getDouble(); void setDouble(double d); char getChar(); void setChar(char c); boolean getBoolean(); void setBoolean(boolean b); // Array types byte[] getBytes(); void setBytes(byte[] bs); short[] getShorts(); void setShorts(short[] ss); int[] getInts(); void setInts(int is[]); long[] getLongs(); void setLongs(long[] ls); float[] getFloats(); void setFloats(float[] fs); double[] getDoubles(); void setDoubles(double[] ds); char[] getChars(); void setChars(char[] cs); boolean[] getBooleans(); void setBooleans(boolean[] bs); // This method has been added to test an issue when autoboxing. void setLong(long l, String s); }
0
String[] tableDirs = ServerConstants.getTablesDirs(master.getContext());
0
import org.apache.accumulo.server.rpc.TServerUtils;
1
* Copyright 2016-2017 Seznam.cz, a.s.
0
import static org.apache.beam.sdk.extensions.sql.impl.schema.BeamTableUtils.csvLine2BeamRow; import org.apache.beam.sdk.values.Row; import org.apache.beam.sdk.values.RowType; extends PTransform<PCollection<String>, PCollection<Row>> protected RowType rowType; public BeamTextCSVTableIOReader(RowType rowType, String filePattern, this.rowType = rowType; public PCollection<Row> expand(PCollection<String> input) { return input.apply(ParDo.of(new DoFn<String, Row>() { ctx.output(csvLine2BeamRow(csvFormat, str, rowType));
0
* </p> * </p>
0
* @version $Id$
0
private static final String SECURITY_JSON_LOCATION = "security-json-location"; + "\n./solrCloudCli.sh --setup-kerberos-plugin -z host1:2181,host2:2181 -zn /ambari-solr --security-json-location /etc/infra-solr/conf/security.json\n"; final Option securityJsonLocationOption = Option.builder("sjl") .longOpt(SECURITY_JSON_LOCATION) .desc("Local security.json path") .numberOfArgs(1) .argName("security.json location") .build(); options.addOption(securityJsonLocationOption); String securityJsonLocation = cli.hasOption("sjl") ? cli.getOptionValue("sjl") : ""; .withSecurityJsonLocation(securityJsonLocation)
0
import org.apache.beam.sdk.values.Row; private static final Row NULL_ROW = null;
0
package org.apache.zookeeper.server.quorum; import org.apache.jute.BinaryInputArchive; import org.apache.jute.BinaryOutputArchive; import org.apache.jute.Record; import org.apache.zookeeper.ZooDefs.OpCode; import org.apache.zookeeper.server.ZooKeeperServer; import org.apache.zookeeper.server.ZooTrace; import org.apache.zookeeper.server.quorum.Leader.Proposal; import org.apache.zookeeper.txn.TxnHeader;
0
package org.apache.felix.mishell; import java.io.PrintStream; import java.util.HashSet; import java.util.Set; import java.util.Map.Entry; import java.util.logging.Logger; import javax.script.ScriptContext; public class Commander extends HashSet<Command> implements Command{ private Logger log=Logger.getLogger(this.getClass().getName()); public void executeCommand(String cmd, PrintStream out) throws Exception { String[] parsedCmd=cmd.split(" "); if (parsedCmd.length==0)throw new CommandNotFoundException(); for (Command c: this) { if (c.getName().equals(parsedCmd[0])){ log.finest("executing: "+c.getName()); c.executeCommand(cmd, out); return; } } throw new CommandNotFoundException(); } public String getName() { return "commander"; } public Commander() { } public String getHelp() { return "mishell commander"; } }
0
final boolean alphaPremult; this.tiledRegion = tiledRegion; this.xStep = xStep; this.yStep = yStep; this.hints = hints; this.alphaPremult = false; SampleModel sm = fixSampleModel(tile, xStep, yStep); ColorModel cm = fixColorModel(tile, alphaPremult); double smSz = AbstractTiledRed.getDefaultTileSize(); smSz = smSz*smSz; // it means the image tile will fit in it... // System.out.println("Using Raster for pattern"); // System.out.println("Is INT PACK: " + is_INT_PACK); GraphicsUtil.coerceData(wr, src.getColorModel(), alphaPremult); protected static ColorModel fixColorModel(RenderedImage src, boolean alphaPremult) { return GraphicsUtil.coerceColorModel(src.getColorModel(), alphaPremult); } int stepX, int stepY) { if (w > stepX) w = stepX; if (h > stepY) h = stepY;
0
public class CaseTransform implements Transform { public void setCase( String caseType ) { if ( caseType.equalsIgnoreCase( "upper" ) ) else public String transform( String s ) { if ( toLower )
0
this.pool = new LinkedBlockingQueue<>(session.getIntProperty(POOL_SIZE_PROP, DEFAULT_POOL_SIZE));
0
/** Tests for the {@link POJOUtils} class. */
0
public class KerberosConfigDataFileReader extends AbstractKerberosDataFileReader implements KerberosConfigDataFile{ * @throws java.io.IOException if an error occurs while accessing the file KerberosConfigDataFileReader(File file) throws IOException {
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 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
package org.apache.cocoon.blocks;
0
String s = (String) m_configMap.get(Constants.FRAMEWORK_BEGINNING_STARTLEVEL); }
0
import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; public class BeanPropertySetterRuleTestCase { @Before @After @Test @Test @Test @Test @Test
0
import java.io.IOException; public synchronized void putEntry(String url, HttpCacheEntry entry) throws IOException { public synchronized HttpCacheEntry getEntry(String url) throws IOException { public synchronized void removeEntry(String url) throws IOException { HttpCacheUpdateCallback callback) throws IOException {
0
import org.apache.batik.ext.awt.image.rendered.TurbulencePatternRed8Bit; final Rectangle devRect if ((devRect.width <= 0) || (devRect.height <= 0)) Rectangle2D tile = null; if (stitched) tile = (Rectangle2D)region.clone(); return new TurbulencePatternRed8Bit (baseFreqX, baseFreqY, numOctaves, seed, fractalNoise, tile, patternTxf, devRect, cs, true);
0
* Tests manipulating the list delimiter handler. This object is derived * from the parent. public void testSetListDelimiterHandler() ListDelimiterHandler handler1 = new DefaultListDelimiterHandler('/'); ListDelimiterHandler handler2 = new DefaultListDelimiterHandler(';'); parent.setListDelimiterHandler(handler1); parent.setListDelimiterHandler(handler2); assertEquals("List delimiter handler not obtained from parent", handler1, config.getListDelimiterHandler()); assertEquals("List was incorrectly splitted", "test1,test2", parent.getString("tables.table(0).newProp")); config.setListDelimiterHandler(DisabledListDelimiterHandler.INSTANCE); assertEquals("List delimiter changed on parent", handler2, parent.getListDelimiterHandler());
0
//it has already been deactivated.... this should cause an exception? //FactoryInstance.deactivate disposes the instance. Don't do it again // instanceNonMatch.dispose(); // TestCase.assertNull( SimpleComponent.INSTANCE ); // TestCase.assertNull( instanceNonMatch.getInstance() ); // SCR 112.12.6.2
0
return shape.getBounds2D();
0
package org.apache.felix.fileinstall.internal; import org.apache.felix.fileinstall.ArtifactInstaller; import org.apache.felix.fileinstall.ArtifactListener; import org.apache.felix.fileinstall.ArtifactTransformer; import org.apache.felix.fileinstall.internal.Util; * It uses {@link Artifact#getPath()} as location
0
public AuthFuture authAgent(String user) throws IOException { userAuth = new UserAuthAgent(this, user); public AuthFuture authPassword(String user, String password) throws IOException { userAuth = new UserAuthPassword(this, user, password); public AuthFuture authPublicKey(String user, KeyPair key) throws IOException { userAuth = new UserAuthPublicKey(this, user, key);
0
ioSession.updateReadTime(); ioSession.updateWriteTime(); ioSession.updateReadTime(); ioSession.updateWriteTime(); public void updateReadTime() { ioSession.updateReadTime(); } @Override public void updateWriteTime() { ioSession.updateWriteTime(); } @Override public long getLastReadTime() { return ioSession.getLastReadTime(); } @Override public long getLastWriteTime() { return ioSession.getLastWriteTime(); } @Override
0
* Version of {@link java.io.ByteArrayOutputStream} that allows to retrieve the internal byte[] * buffer without incurring an array copy. /** Get the underlying byte array. */
1
import org.apache.batik.css.value.SystemColorResolver.Color;
0
@Test public void test() { } public static void main(String[] args) { long now = System.currentTimeMillis(); for (long i = 0; i < 1000 * 1000; i++) { @SuppressWarnings("unused") Long x = new Long(i); } System.out.println(String.format("Trivial took %d millis", System.currentTimeMillis() - now)); now = System.currentTimeMillis(); for (long i = 0; i < 1000 * 1000; i++) { Span s = Trace.start("perf"); s.stop(); } System.out.println(String.format("Span Loop took %d millis", System.currentTimeMillis() - now)); now = System.currentTimeMillis(); Trace.on("test"); for (long i = 0; i < 1000 * 1000; i++) { Span s = Trace.start("perf"); s.stop(); Trace.off(); System.out.println(String.format("Trace took %d millis", System.currentTimeMillis() - now)); }
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestAll.java,v 1.7 2003/04/15 01:55:21 rwaldhoff Exp $ * @version $Revision: 1.7 $ $Date: 2003/04/15 01:55:21 $ suite.addTest(TestCollectionByteCollection.suite()); suite.addTest(TestByteCollectionCollection.suite()); suite.addTest(TestByteListList.suite()); suite.addTest(TestListByteList.suite()); suite.addTest(TestIteratorByteIterator.suite()); suite.addTest(TestListIteratorByteListIterator.suite()); suite.addTest(TestByteIteratorIterator.suite()); suite.addTest(TestByteListIteratorListIterator.suite());
0
import org.apache.felix.dm.annotation.api.dependency.ServiceDependency;
0
/** * Test setting a value out of a mapped Map */ public void testSetMappedMap() { TestBean bean = new TestBean(); Map map = new HashMap(); map.put("sub-key-1", "sub-value-1"); map.put("sub-key-2", "sub-value-2"); map.put("sub-key-3", "sub-value-3"); bean.getMapProperty().put("mappedMap", map); assertEquals("BEFORE", "sub-value-3", ((Map)bean.getMapProperty().get("mappedMap")).get("sub-key-3")); try { BeanUtils.setProperty(bean, "mapProperty(mappedMap)(sub-key-3)", "SUB-KEY-3-UPDATED"); } catch (Throwable t) { fail("Threw " + t + ""); } assertEquals("AFTER", "SUB-KEY-3-UPDATED", ((Map)bean.getMapProperty().get("mappedMap")).get("sub-key-3")); }
0
package cz.seznam.euphoria.inmem; import cz.seznam.euphoria.core.client.operator.Distinct; import cz.seznam.euphoria.core.client.operator.FlatMap; import cz.seznam.euphoria.core.client.operator.ReduceByKey; import cz.seznam.euphoria.core.client.operator.ReduceWindow;
0
conn.setSocketTimeoutMillis(123); conn.setSocketTimeoutMillis(123); Assert.assertEquals(-1, conn.getSocketTimeoutMillis()); Assert.assertEquals(345, conn.getSocketTimeoutMillis()); Assert.assertEquals(-1, conn.getSocketTimeoutMillis()); Assert.assertEquals(-1, conn.getSocketTimeoutMillis());
0
private final Map<Integer, SshdSocketAddress> localToRemote = new HashMap<>(); private final Map<Integer, SshdSocketAddress> remoteToLocal = new HashMap<>(); private final Map<Integer, SocksProxy> dynamicLocal = new HashMap<>(); private final Set<LocalForwardingEntry> localForwards = new HashSet<>(); prev = localToRemote.put(port, remote); bound = localToRemote.remove(local.getPort()); prev = remoteToLocal.put(port, local); bound = remoteToLocal.remove(remote.getPort()); prev = dynamicLocal.put(port, socksProxy); obj = dynamicLocal.remove(local.getPort()); return remoteToLocal.get(remotePort); SshdSocketAddress remote = localToRemote.get(localPort);
0
/** * @see Method * * @param file Input stream * @param constant_pool Array of constants * @return Attribute * @throws IOException * @throws ClassFormatException
0
import java.util.Collections; import org.apache.sshd.common.util.threads.ExecutorService; public ChannelAgentForwarding(ExecutorService executor) { super("", Collections.emptyList(), executor);
1
import org.apache.beam.sdk.testing.DataflowPortabilityApiUnsupported; @Category({ValidatesRunner.class, DataflowPortabilityApiUnsupported.class}) @Category({ValidatesRunner.class, DataflowPortabilityApiUnsupported.class})
0
private static ThreadPoolExecutor readaheadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 3L, if (0L == readaheadThreshold) {
0
/** {@link org.apache.commons.logging} logging facility */ static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog( ResolverAnonymous.class.getName());
0
ResultSet rs = null; try { rs = statement.executeQuery(query); if (rs != null) { if (rs.next()) { return rs.getInt(1) > 0; } } } catch (Exception e) { LOG.error("Unable to check if table " + tableName + " has any data. Exception: " + e.getMessage()); } finally { if (rs != null) { rs.close();
0
package org.apache.bcel.util; import org.apache.bcel.classfile.JavaClass;
1
ParDo.SingleOutput<Integer, EmptyClass> uninferrableParDo = ParDo.of(new EmptyClassDoFn());
0
import org.apache.hc.core5.annotation.Contract; import org.apache.hc.core5.annotation.ThreadingBehavior; @Contract(threading = ThreadingBehavior.IMMUTABLE)
0
// Add any patterns } // If we didn't get any tables, and we have a table selected, add the current table if (tablesToFlush.isEmpty() && !shellState.getTableName().isEmpty()) {
0
import org.apache.beam.runners.fnexecution.environment.InProcessEnvironmentFactory; import org.apache.beam.sdk.options.PipelineOptionsFactory; InProcessEnvironmentFactory.create( PipelineOptionsFactory.create(), loggingServer, controlServer, (workerId, timeout) -> clientPool.take());
0
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
0
public void dump(DataOutputStream dos) throws IOException dos.writeShort(type_index); // u2 index of type name in cpool dos.writeShort(element_value_pairs.size()); // u2 element_value pair count for (int i = 0 ; i<element_value_pairs.size();i++) { ElementValuePair envp = (ElementValuePair) element_value_pairs.get(i); envp.dump(dos); }
0
* Copyright (c) 1999 The Apache Software Foundation. All rights * notice, this list of conditions and the following disclaimer. * if any, must include the following acknowledgment: * software without prior written permission. For written * The development of this software was partly funded by the European * Commission in the <WebSig> project in the ISIS Programme. public class XPathContainer extends SignatureElementProxy { super(doc, Constants._TAG_XPATH); "./text()"); for (int i = 0; i < textNodes.getLength(); i++) { result += ((Text) textNodes.item(i)).getData();
0
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost;
0
import org.apache.beam.sdk.util.state.CombiningState; private static final StateTag<Object, CombiningState<Integer, int[], Integer>> CombiningState<Integer, int[], Integer> value1 = CombiningState<Integer, int[], Integer> value2 = CombiningState<Integer, int[], Integer> value1 = CombiningState<Integer, int[], Integer> value2 = CombiningState<Integer, int[], Integer> value3 =
0
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:12:14 $ suite.addTest(TestTypedSet.suite());
0
import org.apache.accumulo.core.client.impl.Namespace; public static boolean setNamespaceProperty(Namespace.ID namespaceId, String property, String value) throws KeeperException, InterruptedException { public static void removeNamespaceProperty(Namespace.ID namespaceId, String property) throws InterruptedException, KeeperException { private static String getPath(Namespace.ID namespaceId) {
1
try{ zks.getZKDatabase().close(); } catch (IOException ie) { LOG.warn("Error closing logs ", ie); }
0
public final class Dispatcher final HttpServletRequest wrappedRequest = new ServletRequestWrapper(req, servletContext, requestInfo, null, public void forward(final ServletResolution resolution, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException final String requestURI = UriUtils.relativePath(request.getContextPath(), request.getRequestURI()); public void include(final ServletResolution resolution, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException final String requestURI = UriUtils.relativePath(request.getContextPath(), request.getRequestURI());
0
// Read by hostname (hosts=h1) // Read by hostname (hosts/host_name=h1) predicate = new PredicateBuilder().property(ConfigGroupResourceProvider .CONFIGGROUP_CLUSTER_NAME_PROPERTY_ID).equals("Cluster100").and() .property(ConfigGroupResourceProvider.CONFIGGROUP_HOSTS_HOSTNAME_PROPERTY_ID) .equals("h1").toPredicate(); resources = resourceProvider.getResources(request, predicate); assertEquals(1, resources.size()); hostSet = (Set<Map<String, Object>>) resources.iterator().next() .getPropertyValue(ConfigGroupResourceProvider .CONFIGGROUP_HOSTS_PROPERTY_ID); assertEquals("h1", hostSet.iterator().next().get (ConfigGroupResourceProvider.CONFIGGROUP_HOSTNAME_PROPERTY_ID)); // Read by tag and hostname (hosts=h1) - Positive // Read by tag and hostname (hosts/host_name=h1) - Positive predicate = new PredicateBuilder().property(ConfigGroupResourceProvider .CONFIGGROUP_CLUSTER_NAME_PROPERTY_ID).equals("Cluster100").and() .property(ConfigGroupResourceProvider.CONFIGGROUP_TAG_PROPERTY_ID) .equals("t4").and().property(ConfigGroupResourceProvider .CONFIGGROUP_HOSTS_HOSTNAME_PROPERTY_ID).equals("h1").toPredicate(); resources = resourceProvider.getResources(request, predicate); assertEquals(1, resources.size()); hostSet = (Set<Map<String, Object>>) resources.iterator().next() .getPropertyValue(ConfigGroupResourceProvider .CONFIGGROUP_HOSTS_PROPERTY_ID); assertEquals("h1", hostSet.iterator().next().get (ConfigGroupResourceProvider.CONFIGGROUP_HOSTNAME_PROPERTY_ID));
0
new scala.collection.immutable.Map.Map1<>(
0
@Command(scope = "obr", name = "listUrl", description = "Displays the repository URLs currently associated with the OBR service.")
0
public class TestHttpServerNio { public TestHttpServerNio(final HttpParams params) throws IOException {
0
* Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ * @version CVS $Id: MarkupLanguage.java,v 1.3 2004/03/05 13:02:47 bdelacretaz Exp $
1
import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import java.util.Collection; import java.util.HashSet; import java.util.Set; }
0
package org.apache.felix.sigil.model.osgi; import org.apache.felix.sigil.model.IModelElement;
0
import org.apache.cocoon.forms.formmodel.library.Library; /** * Gets the Library object containing this definition */ Library getEnclosingLibrary(); /** * Sets the Library object containing this definition (should only be used by Library itself!) */ void setEnclosingLibrary(Library library);
0
import org.apache.cocoon.environment.ObjectModelHelper; import org.apache.cocoon.environment.Request; * @version CVS $Id: SessionContextImpl.java,v 1.2 2003/05/04 20:19:41 cziegeler Exp $ /** The current request */ private Request request; this.request = ObjectModelHelper.getRequest( objectModel ); public Request getRequest() { return this.request; }
0
import cz.seznam.euphoria.testing.DatasetAssert;
0
if (this.paramTypes.length == 1) {
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 * 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
* @author <a href="mailto:[email protected]">Vincent Hardy</a>
1
self.maxSessionTimeout, self.clientPortListenBacklog, zkDb, self.getInitialConfig());
0
* <p> * This class cuts the wrapped InputStream off after a specified number of bytes. * </p> * <p> * Note that this class NEVER closes the underlying stream, even when close * gets called. Instead, it will read until the "end" of its chunking on close, * which allows for the seamless invocation of subsequent HTTP 1.1 calls, while * not requiring the client to remember to read the entire contents of the * response. * </p>
0
tservers = new ArrayList<>();
1
* * * if (definition == null) { throw new Exception("Widget '" + id + "' not found! (at " + DomHelper.getLocation(element) + ")"); }
0
return getOSFamilyFromHostAttributes(hostAttributes); } @Override public String getOSFamilyFromHostAttributes(Map<String, String> hostAttributes) { try { String majorVersion = hostAttributes.get(OS_RELEASE_VERSION).split("\\.")[0]; return hostAttributes.get(OSFAMILY) + majorVersion; } catch(Exception e) { LOG.error("Error while getting os family from host attributes:", e); } return null; @Override
0
import org.apache.beam.dsls.sql.schema.BeamSqlRowType; BeamSqlRowType type = BeamSqlRowType.create( .of(BeamSqlRowType.create(names, types))
0