Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
HandlerManagerFactory hf2 = (HandlerManagerFactory) ipojoHelper.getFactoryHelper().getHandlerFactory("controller", 1, false); assertFalse("Check Architecture availability -1", ipojoHelper .isServiceAvailableByName(Architecture.class.getName(), "SimpleInstance"));
0
import org.apache.accumulo.core.metadata.schema.MetadataSchema.CurrentLogsSection; String file = "hdfs://localhost:8020/accumulo/wal/tserver1+9997/" + UUID.randomUUID(); data.add(entry("tserver1:9997[1234567890]", file)); bs.setRanges(Collections.singleton(CurrentLogsSection.getRange())); bs.fetchColumnFamily(CurrentLogsSection.COLF); Assert.assertEquals(Collections.singleton(file), wals); // This is a silly test now String filename = "hdfs://localhost:8020/accumulo/wal/tserver+9997/" + uuid; data.add(entry("tserver1:9997[0123456789]", filename)); bs.setRanges(Collections.singleton(CurrentLogsSection.getRange())); bs.fetchColumnFamily(CurrentLogsSection.COLF); Assert.assertEquals(Collections.singleton(filename), wals); String file1 = "hdfs://localhost:8020/accumulo/wal/tserver1+9997/" + UUID.randomUUID(); String file2 = "hdfs://localhost:8020/accumulo/wal/tserver2+9997/" + UUID.randomUUID(); String file3 = "hdfs://localhost:8020/accumulo/wal/tserver3+9997/" + UUID.randomUUID(); data.add(entry("tserver1:9997[1234567890]", file1)); data.add(entry("tserver2:9997[1234567891]", file2)); data.add(entry("tserver3:9997[1234567891]", file3)); bs.setRanges(Collections.singleton(CurrentLogsSection.getRange())); bs.fetchColumnFamily(CurrentLogsSection.COLF); private static Entry<Key,Value> entry(String session, String file) { Key key = new Key(new Text(CurrentLogsSection.getRowPrefix() + session), CurrentLogsSection.COLF, new Text(file)); return Maps.immutableEntry(key, new Value()); }
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
affectedHosts.put(hostname, new ArrayList<>());
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 interface SetState<T> extends GroupingState<T, Iterable<T>> {
0
Document doc = XMLUtils.newDocument(); Document doc = XMLUtils.newDocument(); docxslt = XMLUtils.read(is, false); doc = XMLUtils.read(new InputSource(new StringReader(sw.toString())), false); Document doc = XMLUtils.newDocument(); Document doc = XMLUtils.newDocument();
0
// Support query by category if (categoryIds.contains(propertyId)) { return true; } String category = PropertyHelper.getPropertyCategory(propertyId);
0
@Test public void testGetArtifactDefinition() { ResourceDefinition resourceDefinition = ResourceInstanceFactoryImpl.getResourceDefinition( Resource.Type.Artifact, null); assertEquals("artifact", resourceDefinition.getSingularName()); assertEquals("artifacts", resourceDefinition.getPluralName()); assertEquals(Resource.Type.Artifact, resourceDefinition.getType()); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/Arg.java,v 1.17 2004/02/21 17:10:29 rleland Exp $ * $Revision: 1.17 $ * $Date: 2004/02/21 17:10:29 $ * Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
package org.apache.felix.scrplugin.helper; public class MetatypeContainer { private String id; private String name; private String description; private String factoryPid; private final List<MetatypeAttributeDefinition> properties = new ArrayList<MetatypeAttributeDefinition>(); public List<MetatypeAttributeDefinition> getProperties() { public String getFactoryPid() { return this.factoryPid; } public void setFactoryPid(String pid) { this.factoryPid = pid;
0
@VisibleForTesting static final String CONTAINER_AND_IMAGE_ARE_MUTUALLY_EXCLUSIVE = "A task may not have both a Docker container and an image."; if (containerType.get() != Container._Fields.MESOS && config.isSetImage()) { throw new TaskDescriptionException(CONTAINER_AND_IMAGE_ARE_MUTUALLY_EXCLUSIVE); }
0
* A result of {@link SpannerIO#write()} transform. Use {@link #getFailedMutations()} to access * failed Mutations. {@link #getOutput()} can be used as a completion signal with the {@link * org.apache.beam.sdk.transforms.Wait Wait} transform.
0
import java.nio.file.Paths; @Override public String resolve(String path, String other) throws IOException { return Paths.get(path).resolve(other).toString(); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
package cz.seznam.euphoria.flink.streaming; import cz.seznam.euphoria.core.client.operator.ExtractEventTime; import org.apache.flink.streaming.api.functions.timestamps.BoundedOutOfOrdernessTimestampExtractor; import java.time.Duration; import java.util.Objects; class EventTimeAssigner extends BoundedOutOfOrdernessTimestampExtractor<StreamingElement> { private final ExtractEventTime eventTimeFn; EventTimeAssigner(Duration allowedLateness, ExtractEventTime eventTimeFn) { super(millisTime(allowedLateness.toMillis())); this.eventTimeFn = Objects.requireNonNull(eventTimeFn); } @SuppressWarnings("unchecked") @Override public long extractTimestamp(StreamingElement element) { return eventTimeFn.extractTimestamp(element.getElement()); } private static org.apache.flink.streaming.api.windowing.time.Time millisTime(long millis) { return org.apache.flink.streaming.api.windowing.time.Time.milliseconds(millis); } }
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists;
0
static void validateOption(final String opt) throws IllegalArgumentException private static boolean isValidOpt(final char c) private static boolean isValidChar(final char c)
0
* <p> * NOTE: In versions prior to 3.2 an array size of zero or one * threw an exception. *
0
import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; import org.apache.excalibur.source.SourceResolver; env = new BackgroundEnvironment(ctx);
0
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory; private final ZooCache zc; private final String root; this(instance, new ZooCacheFactory()); } ZookeeperLockChecker(Instance instance, ZooCacheFactory zcf) { zc = zcf.getZooCache(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut());
0
.put("MAP<STRING,STRING>", FieldType.map(FieldType.STRING, FieldType.STRING))
0
* @version $Id: HierarchicalConfiguration.java,v 1.4 2004/03/09 10:31:31 epugh Exp $
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.forms.event; import org.apache.cocoon.forms.formmodel.Widget; /** * A {@link ValueChangedEvent} that defers getting the new value from the widget * until it's actually requested. * <p> * This allows widget validity to be checked only if a listener actually uses the * value, thus avoiding unnecessary validation warnings when a user clicks an action. * * @version $Id$ */ public class DeferredValueChangedEvent extends ValueChangedEvent { public DeferredValueChangedEvent(Widget source, Object oldValue) { super(source, oldValue, null); } public Object getNewValue() { return getSourceWidget().getValue(); } }
0
ZooKeeper zk = new ZooKeeper(HOSTPORT, CONNECTION_TIMEOUT, this);
0
} else if (ch0 == UNIX_SEPARATOR) { return 1;
0
@Override @Override
0
RequestStatus response = resourceProvider.deleteResources(new RequestImpl(null, null, null, null), predicate);
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. */ public static abstract class Fold<Value> { public static abstract class Output<Key,Value> {
0
import java.util.regex.Pattern; import aQute.libg.header.OSGiHeader; private final Pattern MISSING_KEY_PATTERN = Pattern.compile( "^[a-zA-Z]+=" ); protected final void processInstructions( String header ) throws MojoExecutionException if ( MISSING_KEY_PATTERN.matcher( header ).lookingAt() ) { header = "*;" + header; } Map instructions = OSGiHeader.parseHeader( header ); processDependencies( filteredDependencies, inline ); protected abstract void processDependencies( Collection dependencies, String inline );
0
return new KeyExtent(new Table.ID(t), er == null ? null : new Text(er), per == null ? null : new Text(per)); TabletLocatorImpl tab1TabletCache = new TabletLocatorImpl(new Table.ID(table), rootTabletCache, ttlo, tslc); TabletLocatorImpl tab1TabletCache = new TabletLocatorImpl(new Table.ID("tab1"), rootTabletCache, ttlo, new YesLockChecker()); TabletLocatorImpl tab0TabletCache = new TabletLocatorImpl(new Table.ID("0"), rootTabletCache, ttlo, new YesLockChecker()); KeyExtent ke1 = new KeyExtent(new Table.ID("0"), new Text("0bbf20e"), null); KeyExtent ke2 = new KeyExtent(new Table.ID("0"), new Text("0bc0756"), new Text("0bbf20e")); TabletLocatorImpl tab0TabletCache = new TabletLocatorImpl(new Table.ID("0"), rootTabletCache, ttlo, new YesLockChecker()); KeyExtent ke1 = new KeyExtent(new Table.ID("1"), null, null); TabletLocatorImpl tab0TabletCache = new TabletLocatorImpl(new Table.ID("1"), rootTabletCache, ttlo, new YesLockChecker());
1
* @version $Revision$
0
import org.apache.batik.ext.awt.ColorSpaceHintKey; import org.apache.batik.ext.awt.RenderingHintsKeyExt; rh.put(RenderingHintsKeyExt.KEY_COLORSPACE, ColorSpaceHintKey.VALUE_COLORSPACE_ALPHA_CONVERT); Object val = cr.getProperty(ColorSpaceHintKey.PROPERTY_COLORSPACE); if (val == ColorSpaceHintKey.VALUE_COLORSPACE_ALPHA_CONVERT)
0
* * * Execute a list of commands. * @since 23 October 2002
0
* Whether user accepted GPL license */ @Markdown( description = "Whether user accepted GPL license.") public static final ConfigurationProperty<Boolean> GPL_LICENSE_ACCEPTED = new ConfigurationProperty<>( "gpl.license.accepted", false); /** public Boolean getGplLicenseAccepted(){ return Boolean.valueOf(getProperty(GPL_LICENSE_ACCEPTED)); }
0
log.debug("Loaded class : " + clazzName, new Throwable()); log.info("Using default class " + defaultInstance.getClass().getName());
0
import org.apache.hc.core5.http.config.Http1Config; final Http1Config h1Config) throws Exception { final Http1Config h1Config) throws Exception { return start(HttpProcessors.server(), Http1Config.DEFAULT);
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.components.expression; import java.util.HashMap; import java.util.Map; public class ExpressionContext extends HashMap { private ExpressionContext closure; private Object contextBean = null; public ExpressionContext() { this(null); } public ExpressionContext(ExpressionContext closure) { this.closure = closure; } public Object getContextBean() { if (contextBean != null) return contextBean; else if (closure != null) return closure.getContextBean(); else return null; } public void setContextBean(Object contextBean) { this.contextBean = contextBean; } public Map getVars() { return this; } public void setVars(Map map) { clear(); putAll(map); } public boolean containsKey(Object key) { return this.get(key) != null; } public Object get(Object key) { if (key.equals("this")) { return this; } Object result = super.get(key); if (result == null && closure != null) { result = closure.get(key); } return result; } }
0
import cz.seznam.euphoria.core.annotation.audience.Audience; @Audience(Audience.Type.CLIENT)
0
* A {@link Coder} that encodes a joda {@link Duration} as a {@link Long} using the format of {@link * VarLongCoder}. public ReadableDuration decode(InputStream inStream) throws CoderException, IOException { return fromLong(LONG_CODER.decode(inStream)); public void registerByteSizeObserver(ReadableDuration value, ElementByteSizeObserver observer) throws Exception {
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
import java.io.PrintStream; import org.apache.accumulo.core.conf.DefaultConfiguration; else if (req.getRequestURI().equals("/docs/config.html")) new DefaultConfiguration() { public void generate(HttpServletResponse resp) throws IOException { generateDocumentation(new PrintStream(resp.getOutputStream())); } }.generate(resp); getResource(req, resp);
0
public BeanPropertyValueEqualsPredicateTestCase(final String name) { final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final TestBean testBean = new TestBean(); final TestBean nestedBean = new TestBean("match"); final BeanPropertyValueEqualsPredicate predicate = } catch (final IllegalArgumentException e) { final BeanPropertyValueEqualsPredicate predicate = } catch (final IllegalArgumentException e) { final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final BeanPropertyValueEqualsPredicate predicate = final TestBean testBean = new TestBean(); final TestBean testBean = new TestBean(); final TestBean testBean = new TestBean(); } catch (final ArrayIndexOutOfBoundsException e) { final BeanPropertyValueEqualsPredicate predicate = final TestBean testBean = new TestBean(); final TestBean nestedBean = new TestBean(); } catch (final IllegalArgumentException e) { final TestBean testBean = new TestBean(); final BeanPropertyValueEqualsPredicate predicate = } catch (final IllegalArgumentException e) {
0
import com.twitter.mesos.gen.JobUpdateConfiguration; import com.twitter.mesos.gen.TaskUpdateConfiguration;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/ProcessingInstructionTest.java,v 1.7 2003/10/09 21:31:39 rdonkin Exp $ * $Revision: 1.7 $ * $Date: 2003/10/09 21:31:39 $ * 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 $Revision: 1.7 $ $Date: 2003/10/09 21:31:39 $
0
Map<Resource.Type,String> mapIds = new HashMap<>();
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
new LoopingIterator<>(null); final List<Object> list = new ArrayList<>(); final LoopingIterator<Object> loop = new LoopingIterator<>(list); final LoopingIterator<String> loop = new LoopingIterator<>(list); final LoopingIterator<String> loop = new LoopingIterator<>(list); final LoopingIterator<String> loop = new LoopingIterator<>(list); final List<String> list = new ArrayList<>(Arrays.asList("a", "b", "c")); final LoopingIterator<String> loop = new LoopingIterator<>(list); final LoopingIterator<String> loop = new LoopingIterator<>(list); final List<String> list = new ArrayList<>(Arrays.asList("a", "b", "c")); final LoopingIterator<String> loop = new LoopingIterator<>(list);
1
if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
String reason = "Host Role in invalid state"; abortHostRole(host, requestId, stageId, role, reason); } @Override public void abortHostRole(String host, long requestId, long stageId, String role, String reason) { report.setStdErr(reason);
0
import java.util.Objects; private final Object id; public KeySetPublickeyAuthenticator(Object id, Collection<? extends PublicKey> keySet) { this.id = id; /** * @return Some kind of mnemonic identifier for the authenticator - used also in {@link #toString()} */ public Object getId() { return id; } @Override public String toString() { return Objects.toString(getId()); }
0
* Return the class name of the handler */ String getHandlerClassName(); /**
0
* {@link DefaultValueFactory} for getting a default value for the parallelism option on {@link * FlinkPipelineOptions}. * <p>This will return either the default value from {@link GlobalConfiguration} or {@code 1}. A * valid {@link GlobalConfiguration} is only available if the program is executed by the Flink run * scripts.
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayLongList.java,v 1.2 2003/04/13 22:30:57 rwaldhoff Exp $ * @version $Revision: 1.2 $ $Date: 2003/04/13 22:30:57 $ public class ArrayLongList extends RandomAccessLongList implements LongList, Serializable {
0
* matches the specified interface and filter. The aspect will be registered * with the same interface and properties as the original service, plus any * extra properties you supply here. It will also inherit all dependencies, * and if you can declare the original service as a member it will be injected. * Sets the service interface to apply the aspect to. By default, the directly implemented interface is used. * Sets the filter condition to use with the service interface this aspect is applying to. * Sets Additional properties to use with the aspect service registration * Sets the ranking of this aspect. Since aspects are chained, the ranking defines the order in which they are chained. * Sets the field name where to inject the original service. By default, the original service is injected * Sets the static method used to create the AspectService implementation instance. By default, the * default constructor of the annotated class is used. The factoryMethod can be used to provide a specific * aspect implements, like a DynamicProxy.
0
* will not be reused after destroying the corresponding application instance. * @version $Revision: 7937 $ * <code>listener> will only receive the {@link ApplicationServiceEvent}s related to the referred service. * <code>listener> will only receive the {@link ApplicationServiceEvent}s related to the referred * This method returns the identifier of the corresponding application instance. * This identifier is guaranteed to be unique within the scope of the device. * This method return the identifier of the corresponding application type. This identifier * it first obtains a reference to the service by calling * method, if they declared their dependence on the registered service.
0
forPattern("root/alpha") .addRule(firstRule) .then() .addRule(secondRule) .then() .addRule(thirdRule); forPattern("root") .createObject().ofType("org.apache.commons.digester3.SimpleTestBean") .then() .setBeanProperty().withName("alpha"); forPattern("root") .createObject().ofType("org.apache.commons.digester3.SimpleTestBean") .then() .setBeanProperty().withName("unknown");
0
MASTER_STATUS_THREAD_POOL_SIZE("master.status.threadpool.size", "0", PropertyType.COUNT, "The number of threads to use when fetching the tablet server status for balancing. Zero " + "indicates an unlimited number of threads will be used."),
0
suite.addTest(TestLangUtils.suite());
0
private AccessUnauthorizedAuditEventBuilder() { super(AccessUnauthorizedAuditEventBuilder.class); }
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.commons.validator.routines.checkdigit; /** * ISIN Check Digit Test. * * @version $Revision$ * @since Validator 1.4 */ public class ISINCheckDigitTest extends AbstractCheckDigitTest { /** * Constructor * @param name test name */ public ISINCheckDigitTest(String name) { super(name); } /** * Set up routine & valid codes. */ protected void setUp() throws Exception { super.setUp(); routine = ISINCheckDigit.INSTANCE; valid = new String[] {"US0378331005", "BMG8571G1096", "AU0000XVGZA3", "GB0002634946", "FR0004026250", "DK0009763344" }; invalid = new String[] {"0378#3100"}; } }
0
* @cocoon.sitemap.component.documentation * The <code>SendMailTransformer</code> send mails with optional attachments using a SMTP
0
throw new Error("should not have SEG_CLOSE here"); throw new Error( "invalid segmentType:" + segType );
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.junit.Assert; import org.junit.Test; @SuppressWarnings({"UnnecessaryBoxing", "AssertEqualsBetweenInconvertibleTypes"}) @Test Assert.assertTrue( Arrays.equals(check, (Object[])o) ); @Test Assert.assertTrue( Arrays.equals(check, (Object[])o) ); @Test Assert.assertTrue( Arrays.equals(check, (Object[])o) ); Assert.assertTrue (o.getClass().isArray() && o.getClass().getComponentType().equals(Number.class)); @Test Assert.assertTrue(exprs[t], Arrays.equals(checks[t], (Object[])o) ); @Test Assert.assertTrue( Arrays.equals(check, (int[])o) ); @Test Assert.assertEquals( new Integer( 2 ), o ); @Test Assert.assertEquals( new Integer( 1 ), o ); @Test Assert.assertFalse( (Boolean) o ); @Test public void testChangeThroughVariables() throws Exception { JexlContext jc = new MapContext(); JexlExpression e147 = JEXL.createExpression("quux = [one, two]"); jc.set("one", 1); jc.set("two", 2); int[] o1 = (int[]) e147.evaluate(jc); Assert.assertEquals(1, o1[0]); Assert.assertEquals(2, o1[1]); jc.set("one", 10); jc.set("two", 20); int[] o2 = (int[]) e147.evaluate(jc); Assert.assertEquals(10, o2[0]); Assert.assertEquals(20, o2[1]); }
0
private final Log log = LogFactory.getLog(LocaleConvertUtilsBean.class);
0
package org.apache.batik.ext.awt.image.renderable;
0
trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); results.addAll(readEverythingFromReader(split.createReader(null))); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); readEverythingFromReader(source.createReader(null)); readEverythingFromReader(source.createReader(null)); readEverythingFromReader(source.createReader(null)); readEverythingFromReader(source.createReader(null)); assertEquals(readEverythingFromReader(source.createReader(null)), new ArrayList<Train>()); try (Reader<WrongTrainType> reader = source.createReader(null)) { trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); trainsToStrings(readEverythingFromReader(source.createReader(null))).toArray())); results.addAll(readEverythingFromReader(split.createReader(null))); results.addAll(readEverythingFromReader(split.createReader(null))); int numItems = readEverythingFromReader(splitSource.createReader(null)).size();
0
import org.apache.commons.logging.LogFactory; setLogger(LogFactory.getLog(XMLConfiguration.class)); setLogger(LogFactory.getLog(XMLConfiguration.class)); setLogger(LogFactory.getLog(XMLConfiguration.class)); setLogger(LogFactory.getLog(XMLConfiguration.class)); setLogger(LogFactory.getLog(XMLConfiguration.class));
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. */
1
private final char[] charValue; private final Object value; this.value = val; this.charValue = val.toCharArray(); public Literal(Integer val) { this.value = val; this.charValue = val.toString().toCharArray(); } public Literal(Boolean val) { this.value = val; this.charValue = val.toString().toCharArray(); return charValue; //ignore return value; return value instanceof Integer ? ((Integer)value).intValue() : Integer.parseInt(getStringValue(objectModel)); throw new UnsupportedOperationException(); return value.toString(); throw new UnsupportedOperationException(); throw new UnsupportedOperationException(); return value; throw new UnsupportedOperationException(); } public String getRaw() { return value.toString();
0
import com.thinkaurelius.titan.core.EdgeLabel; * @param label The Gremlin propertyKey. * */ public static Titan1EdgeLabel createEdgeLabel(EdgeLabel label) { if (label == null) { return null; } return new Titan1EdgeLabel(label); } /**
0
import com.google.cloud.dataflow.sdk.runners.inprocess.StepTransformResult; StepTransformResult.withoutHold(application).addOutput(outputBundle).build();
0
/* * Copyright 2000-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.bcel.generic;
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
0
* 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.commons.httpclient.URIException; import org.apache.commons.httpclient.util.URIUtil; import org.apache.commons.vfs.provider.URLFileName; void setupMethod(final HttpMethod method) throws FileSystemException, URIException String pathEncoded = ((URLFileName) getName()).getPathQueryEncoded(); method.setPath(pathEncoded); protected String encodePath(final String decodedPath) throws URIException { String pathEncoded = URIUtil.encodePath(decodedPath); return pathEncoded; }
0
* @version $Id: Uberspect.java,v 1.2 2002/12/16 10:41:59 jstrachan Exp $
0
import org.apache.avalon.framework.service.ServiceManager; * FIXME - we should not use the service manager ServiceManager getComponentLocator();
0
write = write.withNumShards(numShards); String shardNameTemplate = write.getShardNameTemplate(); assertTestOutputs(expectedElements, numShards, outputFilePrefix, shardNameTemplate); } public static void assertTestOutputs( String[] expectedElements, int numShards, String outputFilePrefix, String shardNameTemplate) throws IOException { for (int i = 0; i < numShards; i++) { expectedFiles.add( new File( IOChannelUtils.constructName( outputFilePrefix, shardNameTemplate, "" /* no suffix */, i, numShards))); new DataFileReader<>(outputFile, AvroCoder.of(String.class).createDatumReader())) {
0
* Copyright 2001-2005 The Apache Software Foundation
0
/* * Copyright 2000-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. package org.apache.bcel.classfile;
0
import org.xml.sax.ErrorHandler; import org.xml.sax.SAXParseException; import org.xml.sax.SAXException; db.setErrorHandler(new ErrorHandler() { public void warning(SAXParseException exception) throws SAXException { } public void error(SAXParseException exception) throws SAXException { } public void fatalError(SAXParseException exception) throws SAXException { throw exception; } });
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
* 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 String servicePrincipalName; public WindowsNegotiateScheme(final String scheme, final String servicePrincipalName) { this.servicePrincipalName = servicePrincipalName; response = getToken(null, null, this.servicePrincipalName != null ? this.servicePrincipalName : username); response = getToken(this.sppicontext, continueTokenBuffer, this.servicePrincipalName != null ? this.servicePrincipalName : "localhost");
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. super(element, BaseURI); super(doc); XMLUtils.addReturnToElement(this._constructionElement); XMLUtils.addReturnToElement(this._constructionElement); this.addTextElement(X509SerialNumber.toString(), Constants._TAG_X509SERIALNUMBER); public String getBaseLocalName() { return Constants._TAG_X509ISSUERSERIAL; }
0
import org.apache.accumulo.core.Constants; LineIterator it = FileUtils.lineIterator(file, Constants.UTF8.name()); @Test(timeout = 60 * 1000) @Test(timeout = 60 * 1000) @Test(timeout = 60 * 1000) LineIterator it = FileUtils.lineIterator(distCpTxt, Constants.UTF8.name()); @Test(timeout = 60 * 1000) @Test(timeout = 60 * 1000) @Test(timeout = 60 * 1000)
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.cocoon.core.container.spring.avalon; import org.apache.cocoon.core.container.spring.avalon.AvalonElementParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** * Spring namespace handler for the cocoon avalon namespace. * Currently this namespace defines the following elements * (in the namespace "http://org.apache.cocoon/avalon"): * "avalon" : This adds all Avalon configured components to the bean factory. * (Attribute location is required) * * @version $Id$ * @since 2.2 */ public class AvalonNamespaceHandler extends NamespaceHandlerSupport { /** * @see org.springframework.beans.factory.xml.NamespaceHandler#init() */ public void init() { registerBeanDefinitionParser("avalon", new AvalonElementParser()); } }
0
import org.apache.accumulo.core.util.DeprecationUtil; DeprecationUtil.setMockInstance(split, true); Assert.assertEquals(DeprecationUtil.isMockInstanceSet(split), DeprecationUtil.isMockInstanceSet(newSplit));
0
@Override
0
* @version $Id$
0
long nextTimestamp = time + interval; if (nextTimestamp < window.getEndMillis()) { ctx.registerTimer(time + interval, window); fireStamp.set(time + interval); }
0
import java.util.AbstractMap.SimpleImmutableEntry; import java.util.Map; private final List<Map.Entry<KeyPair, String>> keys = new ArrayList<>(); public List<? extends Map.Entry<PublicKey, String>> getIdentities() throws IOException { return GenericUtils.map(keys, kp -> new SimpleImmutableEntry<>(kp.getKey().getPublic(), kp.getValue())); Map.Entry<KeyPair, String> pp = Objects.requireNonNull(getKeyPair(keys, key), "Key not found"); KeyPair kp = ValidateUtils.checkNotNull(pp.getKey(), "No key pair for agent=%s", pp.getValue()); PublicKey pubKey = ValidateUtils.checkNotNull(kp.getPublic(), "No public key for agent=%s", pp.getValue()); keys.add(new SimpleImmutableEntry<>(Objects.requireNonNull(key, "No key"), comment)); Map.Entry<KeyPair, String> kp = getKeyPair(keys, key); protected static Map.Entry<KeyPair, String> getKeyPair(Collection<? extends Map.Entry<KeyPair, String>> keys, PublicKey key) { for (Map.Entry<KeyPair, String> k : keys) { KeyPair kp = k.getKey();
0
import org.apache.beam.runners.core.OldDoFn;
0
import java.net.InetAddress; Assert.assertEquals(3, identities.size()); Assert.assertEquals(3, identities.size()); Assert.assertEquals(3, identities.size()); expect(cluster.getServiceComponentHosts(InetAddress.getLocalHost().getCanonicalHostName().toLowerCase())) .andReturn(new ArrayList<ServiceComponentHost>()) .anyTimes(); final Map<String, String> kerberosEnvProperties = new HashMap<String, String>() { { put("kdc_type", "mit-kdc"); put("realm", "FOOBAR.COM"); put("case_insensitive_username_rules", "false"); put("create_ambari_principal", "false"); } }; final Config kerberosEnvConfig = createMock(Config.class); expect(kerberosEnvConfig.getProperties()).andReturn(kerberosEnvProperties).anyTimes(); final Map<String, String> krb5ConfProperties = createMock(Map.class); final Config krb5ConfConfig = createMock(Config.class); expect(krb5ConfConfig.getProperties()).andReturn(krb5ConfProperties).anyTimes(); expect(cluster.getDesiredConfigByType("krb5-conf")) .andReturn(krb5ConfConfig) .anyTimes(); expect(cluster.getDesiredConfigByType("kerberos-env")) .andReturn(kerberosEnvConfig) .anyTimes();
0
thrown.expectMessage("must have only ProcessContext and RestrictionTracker parameters");
0
List<ServiceComponentHost> schs = cluster.getServiceComponentHosts(serviceName,componentName); List<Host> winners = Lists.newArrayList(); winners.addAll(candidates); winners.add(candidates.iterator().next()); winners.add(candidates.iterator().next()); winners.add(candidates.iterator().next()); return winners;
0
package org.osgi.util.converter;
0