Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
"org.apache.batik.parser.resources.Messages"; return current; localizableSupport.setLocale(l); errorHandler = handler; switch (current) { default: break wsp1; case 0x20: case 0x9: case 0xD: case 0xA: } current = reader.read(); } if (current == ',') { switch (current = reader.read()) { default: break wsp2; case 0x20: case 0x9: case 0xD: case 0xA: } } }
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/IteratorLongIterator.java,v 1.3 2003/11/07 20:08:15 rwaldhoff Exp $ * * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) * @version $Revision: 1.3 $ $Date: 2003/11/07 20:08:15 $
0
import static org.mockito.Mockito.times; // To make sure that we retry requests, each invocation below throws an IOException first time // they are invoked. .thenThrow(new IOException()) MockLowLevelHttpResponse response = new MockLowLevelHttpResponse() .setContentType(Json.MEDIA_TYPE) .setContent(GET_TABLE_RESPONSE_JSON); .thenThrow(new IOException()) MockLowLevelHttpResponse response = new MockLowLevelHttpResponse() .setContentType(Json.MEDIA_TYPE) .setContent(LIST_TABLEDATA_RESPONSE_JSON); verify(mockTransport, times(2)).buildRequest(eq("GET"), endsWith(GET_TABLE_REQUEST_PATH)); verify(mockTransport, times(2)).buildRequest(eq("GET"), endsWith(LIST_TABLE_DATA_REQUEST_PATH));
0
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir"); base += fs + "data" + fs + "com";
0
package org.apache.zookeeper.server.quorum; public class LeaderElectionBean implements LeaderElectionMXBean, ZKMBeanInfo { private final Date startTime = new Date();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Bag.java,v 1.12 2003/12/28 18:08:54 scolebourne Exp $ * @version $Revision: 1.12 $ $Date: 2003/12/28 18:08:54 $ // The following is not part of the formal Bag interface, however where possible // Bag implementations should follow these comments. // /** // * Compares this Bag to another. // * This Bag equals another Bag if it contains the same number of occurances of // * the same elements. // * This equals definition is compatable with the Set interface. // * // * @param obj the Bag to compare to // * @return true if equal // */ // boolean equals(Object obj); // // /** // * Gets a hash code for the Bag compatable with the definition of equals. // * The hash code is defined as the sum total of a hash code for each element. // * The per element hash code is defined as // * <code>(e==null ? 0 : e.hashCode()) ^ noOccurances)</code>. // * This hash code definition is compatable with the Set interface. // * // * @return the hash code of the Bag // */ // int hashCode();
0
public static final String topNDownSamplerKey = "topn"; public static final String eventDownSamplerKey = "event"; if (StringUtils.isNotEmpty(type) && type.equalsIgnoreCase(topNDownSamplerKey)) { if (StringUtils.isNotEmpty(type) && type.equalsIgnoreCase(eventDownSamplerKey)) { return EventMetricDownSampler.fromConfig(conf); }
0
import org.apache.ambari.server.orm.entities.HostComponentDesiredStateEntity; HostComponentDesiredStateEntity hostComponentDesiredStateEntity = sch.getDesiredStateEntity(); return isStaleConfigs(sch, requestDesiredConfigs, hostComponentDesiredStateEntity); } public boolean isStaleConfigs(ServiceComponentHost sch, Map<String, DesiredConfig> requestDesiredConfigs, HostComponentDesiredStateEntity hostComponentDesiredStateEntity) throws AmbariException { boolean stale = calculateIsStaleConfigs(sch, requestDesiredConfigs, hostComponentDesiredStateEntity); sch.getHostName(), sch.getServiceComponentName(), stale); HostComponentDesiredStateEntity hostComponentDesiredStateEntity = sch.getDesiredStateEntity(); return calculateIsStaleConfigs(sch, desiredConfigs, hostComponentDesiredStateEntity); } private boolean calculateIsStaleConfigs(ServiceComponentHost sch, Map<String, DesiredConfig> desiredConfigs, HostComponentDesiredStateEntity hostComponentDesiredStateEntity) throws AmbariException { if (sch.isRestartRequired(hostComponentDesiredStateEntity)) { desiredConfigs); desired.hashCode(), sch.getHostName(), sch.getServiceComponentName(), sch.getServiceName()); stackId.getStackVersion(), sch.getServiceName());
0
package org.apache.cocoon.portal.om;
0
/* * Copyright 2013 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
import org.apache.ambari.server.orm.OrmTestHelper; private OrmTestHelper helper; helper = injector.getInstance(OrmTestHelper.class); helper.getOrCreateRepositoryVersion(c.getDesiredStackVersion().getStackName(), c.getDesiredStackVersion().getStackVersion());
0
* @since 1.11.0 * @since 1.11.0
0
import org.apache.accumulo.server.ServerContext; ServerContext context; context = EasyMock.createMock(ServerContext.class);
0
private static final List<String> TEST_VALUES = Arrays.asList( "", "a", "13", "hello", null, "a longer string with spaces and all that", "a string with a \n newline", "スタリング");
0
HttpRoute route, HttpClientConnection conn, HttpRoute route, HttpContext context) throws IOException; void routeComplete( HttpClientConnection conn, HttpRoute route,
0
* @since 1.4
1
public final long id; public Id(long id, int version, String className) { this(- System.currentTimeMillis(), 0, className); return id < 0; } public String toString() { return String.format("(type: %s, id: %s)", className, isUnassigned() ? "<unassigned>" : "" + id);
0
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { final String tableName = OptUtil.getTableOpt(cl, shellState); final Text startRow = OptUtil.getStartRow(cl); final Text endRow = OptUtil.getEndRow(cl); if (cl.hasOption(verboseOpt.getOpt())) { } if (cl.hasOption(forceOpt.getOpt())) { } if (size < 0) { } else { final Merge merge = new Merge() { final Options o = new Options();
0
COMPARE_CONTAINS, COMPARE_IS_NULL, COMPARE_NOT_NULL
0
List<Long> clusterIds = new ArrayList<>();
1
/* * $Header: /cvshome/build/ee.foundation/src/java/security/SignedObject.java,v 1.6 2006/03/14 01:20:26 hargrave Exp $ * * (C) Copyright 2001 Sun Microsystems, Inc. * Copyright (c) OSGi Alliance (2001, 2005). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package java.security; public final class SignedObject implements java.io.Serializable { public SignedObject(java.io.Serializable var0, java.security.PrivateKey var1, java.security.Signature var2) throws java.io.IOException, java.security.InvalidKeyException, java.security.SignatureException { } public java.lang.String getAlgorithm() { return null; } public byte[] getSignature() { return null; } public boolean verify(java.security.PublicKey var0, java.security.Signature var1) throws java.security.InvalidKeyException, java.security.SignatureException { return false; } public java.lang.Object getObject() throws java.io.IOException, java.lang.ClassNotFoundException { return null; } }
0
* @version CVS $Id: Evaluation.java,v 1.3 2004/03/24 18:54:23 joerg Exp $ * @param context
0
sslsock.setReuseAddress(HttpConnectionParams.getSoReuseaddr(params));
0
import org.apache.http.client.utils.DateUtils;
0
import org.apache.hc.core5.http.protocol.HttpProcessor; import org.apache.hc.core5.util.Args; private final HttpProcessor httpProcessor; final HttpProcessor httpProcessor, this.httpProcessor = Args.notNull(httpProcessor, "HTTP processor"); this.exchangeHandlerFactory = Args.notNull(exchangeHandlerFactory, "Exchange handler factory"); return new ServerHttpProtocolNegotiator(httpProcessor, exchangeHandlerFactory, charset, h2Config, streamListener, errorListener) {
0
import com.google.common.collect.ImmutableList; import org.apache.hadoop.metadata.types.AttributeDefinition; import org.apache.hadoop.metadata.types.ClassType; import org.apache.hadoop.metadata.types.HierarchicalTypeDefinition; import org.apache.hadoop.metadata.types.IDataType; import org.apache.hadoop.metadata.types.Multiplicity; import org.apache.hadoop.metadata.types.TraitType; protected AttributeDefinition createRequiredAttrDef(String name, IDataType dataType) { return new AttributeDefinition(name, dataType.getName(), Multiplicity.REQUIRED, false, null); } @SuppressWarnings("unchecked") protected HierarchicalTypeDefinition<TraitType> createTraitTypeDef( String name, ImmutableList<String> superTypes, AttributeDefinition... attrDefs) { return new HierarchicalTypeDefinition(TraitType.class, name, superTypes, attrDefs); } @SuppressWarnings("unchecked") protected HierarchicalTypeDefinition<ClassType> createClassTypeDef( String name, ImmutableList<String> superTypes, AttributeDefinition... attrDefs) { return new HierarchicalTypeDefinition(ClassType.class, name, superTypes, attrDefs); }
0
* --runner=BlockingDataflowRunner
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
* 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: EPUIData.java,v 1.5 2004/03/05 13:02:04 bdelacretaz Exp $
1
@SuppressWarnings("deprecation")
0
String expected = NamedResource.getNames(BuiltinCompressions.VALUES); String expected = NamedResource.getNames(BuiltinCiphers.VALUES); String expected = NamedResource.getNames(BuiltinMacs.VALUES); String expected = NamedResource.getNames(BuiltinSignatures.VALUES);
0
* http://www.apache.org/licenses/LICENSE-2.0
0
if (!isSymlink(file)) { size += sizeOf(file); }
0
public String apply(RepoDefinitionEntity input) {
0
m_name = name; m_p = mp; capability.setAttribute( "name", getName() ); for ( int i = 0; i < getP().size(); i++ ) capability.appendChild( ( ( PElement ) ( getP().get( i ) ) ).getNode( father ) );
0
import com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn; import java.util.ArrayList; import java.util.List; private WindowFn<Object, W> windowFn; WindowFn<Object, W> windowFn, KeyedCombineFn<K, InputT, AccumT, OutputT> combineFn) { this.windowFn = windowFn; final K key = c.element().getKey(); final PriorityQueue<W> liveWindows = final Map<W, AccumT> accumulators = Maps.newHashMap(); final Map<W, Instant> minTimestamps = Maps.newHashMap(); WindowFn<Object, W>.MergeContext mergeContext = new CombiningMergeContext() { @Override public Collection<W> windows() { return liveWindows; } @Override public void merge(Collection<W> toBeMerged, W mergeResult) throws Exception { List<AccumT> accumsToBeMerged = new ArrayList<>(toBeMerged.size()); Instant minTimestamp = null; for (W window : toBeMerged) { accumsToBeMerged.add(accumulators.remove(window)); Instant timestampToBeMerged = minTimestamps.remove(window); if (minTimestamp == null || (timestampToBeMerged != null && timestampToBeMerged.isBefore(minTimestamp))) { minTimestamp = timestampToBeMerged; } } liveWindows.removeAll(toBeMerged); minTimestamps.put(mergeResult, minTimestamp); liveWindows.add(mergeResult); accumulators.put(mergeResult, combineFn.mergeAccumulators(key, accumsToBeMerged)); } }; windowFn.mergeWindows(mergeContext); // To have gotten here, we've either not had any elements added, or we've only run merge // and then closed windows. We don't need to retry merging. private abstract class CombiningMergeContext extends WindowFn<Object, W>.MergeContext { public CombiningMergeContext() { windowFn.super(); } }
0
private static final long serialVersionUID = 5236493427411303394L;
0
import javax.annotation.Nullable; import com.google.common.collect.Maps; /** * Gets all versions of the desired configurations for the cluster. * @return a map of type-to-configuration information. */ @Override public Map<String, Set<DesiredConfig>> getAllDesiredConfigVersions() { return getDesiredConfigs(true); } /** * Gets the active desired configurations for the cluster. * @return a map of type-to-configuration information. */ Map<String, Set<DesiredConfig>> activeConfigsByType = getDesiredConfigs(false); return Maps.transformEntries( activeConfigsByType, new Maps.EntryTransformer<String, Set<DesiredConfig>, DesiredConfig>() { @Override public DesiredConfig transformEntry(@Nullable String key, @Nullable Set<DesiredConfig> value) { return value.iterator().next(); } }); } /** * Gets desired configurations for the cluster. * @param allVersions specifies if all versions of the desired configurations to be returned * or only the active ones. It is expected that there is one and only one active * desired configuration per config type. * @return a map of type-to-configuration information. */ private Map<String, Set<DesiredConfig>> getDesiredConfigs(boolean allVersions) { Map<String, Set<DesiredConfig>> map = new HashMap<>(); Collection<String> types = new HashSet<>(); if (allVersions || e.isSelected() > 0) { Set<DesiredConfig> configs = map.get(e.getType()); if (configs == null) configs = new HashSet<>(); configs.add(c); map.put(e.getType(), configs); for (Entry<String, Set<DesiredConfig>> entry : map.entrySet()) { for (DesiredConfig c: entry.getValue()) c.setHostOverrides(hostOverrides);
0
private final Set<Capability> m_capSet = new HashSet<Capability>(); m_capSet.add(cap); if (m_capSet.remove(cap)) Set<Capability> matches = match(m_capSet, sf);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestCharListIteratorListIterator.java,v 1.2 2003/08/31 17:28:38 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $
0
DoFnSignatures.getSignature(BadTypeVariables.class); DoFnSignatures.getSignature(new DoFn<String, String>() {}.getClass()); DoFnSignatures.getSignature( DoFnSignatures.getSignature( DoFnSignatures.getSignature(GoodTypeVariables.class); DoFnSignatures.getSignature(new IdentityFn<String>() {}.getClass());
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
result.getNodeModel().setRootNode(cn);
0
ver.put("version", "0.9.0");
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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
* @version $Id$
0
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; public class TestJNDIEnvironmentValues @Before @Test @Test @Test @Test(expected = NoSuchElementException.class) conf.getString("test.imaginarykey"); @Test @Test @Test @Test @Test Iterator<String> it = conf.getKeys(); @Test Iterator<String> it = conf.getKeys("foo.bar"); @Test Iterator<String> it = conf.getKeys("test"); @Test Iterator<String> it = conf.getKeys("test.boolean");
0
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.junit.Before; import org.junit.Test; public class IteratorUtilsTest { /** * Collection of {@link Integer}s */ private List<Integer> collectionA = null; private Iterable<Integer> iterableA = null; @Before public void setUp() { collectionA = new ArrayList<Integer>(); collectionA.add(1); collectionA.add(2); collectionA.add(2); collectionA.add(3); collectionA.add(3); collectionA.add(3); collectionA.add(4); collectionA.add(4); collectionA.add(4); collectionA.add(4); iterableA = collectionA; @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test @Test public void getFromIterator() throws Exception { // Iterator, entry exists Iterator<Integer> iterator = iterableA.iterator(); assertEquals(1, (int) IteratorUtils.get(iterator, 0)); iterator = iterableA.iterator(); assertEquals(2, (int) IteratorUtils.get(iterator, 1)); // Iterator, non-existent entry try { IteratorUtils.get(iterator, 10); fail("Expecting IndexOutOfBoundsException."); } catch (final IndexOutOfBoundsException e) { // expected } assertTrue(!iterator.hasNext()); }
0
* <li>{@link #getCreateCount() numActive} &gt; {@link #getMaxActive() maxActive} - 3</li>
0
for (final PropertyDescriptor descriptor : descriptors) {
0
* Get a blueprint's revisions * @param revision Revision of the blueprint * @param locationURL URL pointing to the location of the blueprint
0
* @version $Id: Union.java,v 1.11 2004/05/07 16:43:43 mpo Exp $ caseWidget = ((ContainerWidget)getParent()).getChild(caseWidgetId); if ((widget = getChild(value)) != null) if ((widget = getChild(value)) != null) public Widget getChild(String id) { return super.getChild(id);
0
import org.apache.felix.dm.DependencyManager;
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
.put( PTransformMatchers.stateOrTimerParDoMulti(), .put( PTransformMatchers.stateOrTimerParDoSingle(), PTransformMatchers.classEqualTo(Combine.GloballyAsSingletonView.class), new BatchViewOverrides.BatchCombineGloballyAsSingletonViewFactory(this)) .put(
0
import org.apache.ambari.server.controller.PassiveStateHelper; PassiveState newState = PassiveState.valueOf(request.getPassiveState()); PassiveState oldState = h.getPassiveState(c.getClusterId()); if (!newState.equals(oldState)) { if (newState.equals(PassiveState.IMPLIED)) { h.setPassiveState(c.getClusterId(), newState); try { PassiveStateHelper.createRequest(controller, c.getClusterName(), h.getHostName()); } catch (Exception e) { LOG.warn("Could not send passive status to Nagios (" + e.getMessage() + ")"); }
0
@Override @Override
0
final int minArgs = 2; final int maxArgs = 3; assertArgRange(minArgs, maxArgs); final int argCount = 3; assertArgCount(argCount); final int minArgs = 2; final int maxArgs = 3; assertArgRange(minArgs, maxArgs); if (getArgumentCount() == maxArgs) {
0
import static org.apache.aurora.scheduler.state.StateChangeResult.ILLEGAL; import static org.apache.aurora.scheduler.state.StateChangeResult.INVALID_CAS_STATE; import static org.apache.aurora.scheduler.state.StateChangeResult.NOOP; import static org.apache.aurora.scheduler.state.StateChangeResult.SUCCESS; assertEquals(SUCCESS, changeState(taskId, KILLING)); assertEquals(ILLEGAL, changeState(taskId, KILLING)); assertEquals(SUCCESS, changeState(taskId, RUNNING)); assertEquals(SUCCESS, changeState(taskId, KILLING)); assertEquals(SUCCESS, changeState(taskId, KILLED)); assertEquals(NOOP, changeState(taskId, KILLED)); assertEquals(INVALID_CAS_STATE, changeState( assertEquals(SUCCESS, changeState( assertEquals(INVALID_CAS_STATE, changeState( private StateChangeResult changeState( return storage.write(new Storage.MutateWork.Quiet<StateChangeResult>() { public StateChangeResult apply(Storage.MutableStoreProvider storeProvider) { private StateChangeResult changeState(final String taskId, final ScheduleStatus status) {
0
import org.joda.time.DateTime; DateTime time = str2DateTime("2017-05-22 16:17:18");
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/UnmodifiableListIterator.java,v 1.2 2003/12/03 12:27:37 scolebourne Exp $ * @version $Revision: 1.2 $ $Date: 2003/12/03 12:27:37 $ private UnmodifiableListIterator(ListIterator iterator) {
0
// Poke the iterator so we can test dynamic splitting. assertTrue(iter.hasNext()); // Poke the iterator so we can test dynamic splitting. assertTrue(iter.hasNext()); assertNotNull(dynamicSplitResult);
0
HiveMetaStoreBridge hiveMetaStoreBridge = new HiveMetaStoreBridge(ApplicationProperties.get(), new HiveConf(), atlasClient);
0
import java.util.Collections; import java.util.Set;
0
List children = cgn.getChildren(); if (children.size() == 0) return null; gn = (GraphicsNode)children.get(0); * Informs the user agent that the text selection should changed. /** * Informs the user agent that the text selection should changed. * @param start The Mark for the start of the selection. * @param end The Mark for the end of the selection. */ public void deselectAll() { if (EventQueue.isDispatchThread()) { userAgent.deselectAll(); } else { EventQueue.invokeLater(new Runnable() { public void run() { userAgent.deselectAll(); } }); } } JSVGComponent.this.select(start, end); } /** * Informs the user agent that the text selection should be * cleared. */ public void deselectAll() { JSVGComponent.this.deselectAll();
0
if (password != null) { } else if (keytab != null) { if (keytab == null) { if (other.keytab != null) { if (password == null) { if (other.password != null) {
0
* implement the @{@link #makeObject()}, {@link #makeConfirmedCollection()} * and {@link #makeConfirmedFullCollection()} methods. * You might want to override some of the additional public methods as well:
0
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
0
this(sslcontext, sslHandler, DefaultHttpRequestFactory.INSTANCE, HeapByteBufferAllocator.INSTANCE, params);
0
package org.apache.felix.karaf.jaas.config.impl; import org.apache.felix.karaf.jaas.config.KeystoreInstance;
0
* garbage collector status
0
names.put(Integer.toString(offset), name); types.put(Integer.toString(offset), t); return names.get(Integer.toString(offset));
0
import org.apache.hadoop.hive.metastore.api.StorageDescriptor; import org.apache.hadoop.metadata.typesystem.persistence.Id; final Id sdId = (Id) tableRef.get("sd"); Referenceable sdRef = dgiCLient.getEntity(sdId.id); Assert.assertEquals(sdRef.get(HiveDataModelGenerator.STORAGE_IS_STORED_AS_SUB_DIRS),false);
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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
/* * Created on Sep 15, 2003 * */ package org.apache.commons.jelly.test.xml; import org.apache.commons.jelly.Jelly; import org.apache.commons.jelly.JellyContext; import org.apache.commons.jelly.Script; import org.apache.commons.jelly.XMLOutput; import junit.framework.TestCase; /** * @author mdelagrange * */ public class TestCData extends TestCase { public TestCData(String arg) { super(arg); } /** * CDATA sections should be retained in the output. * * @throws Exception */ public void testCData() throws Exception { Jelly jelly = new Jelly(); jelly.setScript("file:src/test/org/apache/commons/jelly/test/xml/testCData.jelly"); Script script = jelly.compileScript(); JellyContext context = new JellyContext(); script.run(context, XMLOutput.createDummyXMLOutput()); String output = (String) context.getVariable("foo"); assertTrue("'foo' is not null", output != null); String golden = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; golden += "<!DOCTYPE foo [\n"; golden += " <!ELEMENT foo (#PCDATA)>\n"; golden += "]><foo></foo>"; assertEquals("output should contain the CDATA section", output, golden); } }
0
, initialValue = 8
0
import org.apache.beam.model.pipeline.v1.RunnerApi; import org.apache.beam.model.pipeline.v1.RunnerApi.FunctionSpec;
0
final Iterator<Entry<String,String>> iter = shellState.getAccumuloClient().tableOperations() shellState.getAccumuloClient().tableOperations().setProperty(tableName, tableProp.toString(), shellState.getAccumuloClient().tableOperations().removeProperty(tableName, tableProp.toString()); props = shellState.getAccumuloClient().tableOperations().getProperties(tableName).iterator();
0
import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.expect; import java.util.Collections; import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; import org.apache.ambari.server.ldap.service.AmbariLdapConfigurationProvider; import org.easymock.EasyMockRule; import org.easymock.Mock; import org.easymock.MockType; import org.junit.Rule; @Rule public EasyMockRule mocks = new EasyMockRule(this); @Mock(type = MockType.NICE) private AmbariLdapAuthoritiesPopulator authoritiesPopulator; @Mock(type = MockType.NICE) private AmbariLdapConfigurationProvider ldapConfigurationProvider; private AmbariLdapAuthenticationProvider authenticationProvider; final AmbariLdapConfiguration ldapConfiguration = new AmbariLdapConfiguration(); ldapConfiguration.setValueFor(AmbariLdapConfigurationKeys.SERVER_HOST, "localhost"); ldapConfiguration.setValueFor(AmbariLdapConfigurationKeys.SERVER_PORT, String.valueOf(getLdapServer().getPort())); ldapConfiguration.setValueFor(AmbariLdapConfigurationKeys.USER_SEARCH_BASE, "dc=ambari,dc=the apache,dc=org"); ldapConfiguration.setValueFor(AmbariLdapConfigurationKeys.GROUP_BASE, "ou=the groups,dc=ambari,dc=the apache,dc=org"); expect(ldapConfigurationProvider.get()).andReturn(ldapConfiguration).anyTimes(); expect(authoritiesPopulator.getGrantedAuthorities(anyObject(), anyObject())).andReturn(Collections.emptyList()).anyTimes(); replayAll(); authenticationProvider = new AmbariLdapAuthenticationProvider(users, configuration, ldapConfigurationProvider, authoritiesPopulator);
0
import static org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType.PREV_ROW; .fetch(PREV_ROW).build(ctx).stream().limit(100).map(TabletMetadata::getExtent);
0
import com.google.common.base.MoreObjects; return MoreObjects.toStringHelper(this)
0
@SuppressWarnings("deprecation")
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/IdentityMap.java,v 1.3 2004/01/05 22:04:19 scolebourne Exp $ * Copyright (c) 2003-2004 The Apache Software Foundation. All rights * @version $Revision: 1.3 $ $Date: 2004/01/05 22:04:19 $ public class IdentityMap extends AbstractHashedMap implements Serializable, Cloneable {
0
import org.apache.http.auth.CredentialsProvider;
0
import org.eclipse.jetty.server.session.SessionHandler; binder.bind(SessionHandler.class).toInstance(EasyMock.createNiceMock(SessionHandler.class));
0
Map<State, List<Service>> changedServices, if (changedServices != null) { for (Entry<State, List<Service>> entry : changedServices.entrySet()) { if (State.STARTED != entry.getKey()) { continue; } for (Service s : entry.getValue()) { if (State.INSTALLED == s.getDesiredState()) { services.add(s.getName()); } } } } addClientSchForReinstall(cluster, changedServices, changedScHosts);
0
* @version CVS $Id: XMLUtils.java,v 1.2 2003/03/12 15:11:15 cziegeler Exp $ if ( node.getNodeType() != Node.DOCUMENT_NODE ) { transformerHandler.startDocument(); } if ( node.getNodeType() != Node.DOCUMENT_NODE ) { transformerHandler.endDocument(); }
0
import org.apache.batik.util.SVGTypes; * Implements {@link ValueManager#isAnimatableProperty()}. */ public boolean isAnimatableProperty() { return true; } /** * Implements {@link ValueManager#isAdditiveProperty()}. */ public boolean isAdditiveProperty() { return false; } /** * Implements {@link ValueManager#getPropertyType()}. */ public int getPropertyType() { return SVGTypes.TYPE_IDENT; } /**
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
public void updateKerberosCredentials(String clientConfigFile) { boolean saslEnabled = false; if (clientConfigFile != null) { saslEnabled = Connector.builder().usingProperties(clientConfigFile).info().saslEnabled(); updateKerberosCredentials(saslEnabled); } public void updateKerberosCredentials() { updateKerberosCredentials(true); public void updateKerberosCredentials(boolean clientSaslEnabled) { if ((saslEnabled || clientSaslEnabled) && null == tokenClassName) { updateKerberosCredentials(clientConfigFile);
0
return "parsed=" + NamedResource.getNames(getParsedResources())
0
import org.apache.hadoop.metadata.web.util.Servlets; .accept(Servlets.JSON_MEDIA_TYPE) .type(Servlets.JSON_MEDIA_TYPE) .accept(Servlets.JSON_MEDIA_TYPE) .type(Servlets.JSON_MEDIA_TYPE)
0
import org.apache.beam.model.pipeline.v1.Endpoints;
0
public void testParseShortPastDates1() throws Exception { GregorianCalendar now = new GregorianCalendar(2001, Calendar.MAY, 30, 12, 0); checkShortParse("2001-5-30",now,now); // should always work checkShortParse("2001-5-30 -1 week",now,target); checkShortParse("2001-5-30 -13 weeks",now,target); checkShortParse("2001-5-30 -26 weeks",now,target); public void testParseShortPastDates2() throws Exception { GregorianCalendar now = new GregorianCalendar(2004, Calendar.AUGUST, 1, 12, 0); checkShortParse("2004-8-1",now,now); // should always work GregorianCalendar target = (GregorianCalendar) now.clone(); target.add(Calendar.WEEK_OF_YEAR, -1); checkShortParse("2004-8-1 -1 week",now,target); target.add(Calendar.WEEK_OF_YEAR, -12); checkShortParse("2004-8-1 -13 weeks",now,target); target.add(Calendar.WEEK_OF_YEAR, -13); checkShortParse("2004-8-1 -26 weeks",now,target); } public void testParseShortFutureDates1() throws Exception { GregorianCalendar now = new GregorianCalendar(2001, Calendar.MAY, 30, 12, 0); checkShortParse("2001-5-30",now,now); // should always work GregorianCalendar target = (GregorianCalendar) now.clone(); target.add(Calendar.WEEK_OF_YEAR, 1); checkShortParse("2001-5-30 +1 week",now,target); target.add(Calendar.WEEK_OF_YEAR, 12); checkShortParse("2001-5-30 +13 weeks",now,target); target.add(Calendar.WEEK_OF_YEAR, 13); checkShortParse("2001-5-30 +26 weeks",now,target); } public void testParseShortFutureDates2() throws Exception { GregorianCalendar now = new GregorianCalendar(2004, Calendar.AUGUST, 1, 12, 0); checkShortParse("2004-8-1",now,now); // should always work checkShortParse("2004-8-1 +1 week",now,target); checkShortParse("2004-8-1 +13 weeks",now,target); checkShortParse("2004-8-1 +26 weeks",now,target);
0
* Copyright 2016 Seznam.cz, a.s.
0
public Shape getPaintedArea(){
0
* @version CVS $Id: AbstractCopletAdapter.java,v 1.9 2004/03/03 14:35:49 cziegeler Exp $ Exception error = null; error = exception; if ( !this.renderErrorContent(coplet, contentHandler, error)) { * @param coplet The coplet instance data * @param handler The content handler * @param error The exception that occured protected boolean renderErrorContent(CopletInstanceData coplet, ContentHandler handler, Exception error)
0
public void start(MutateWork.NoResult.Quiet initilizationLogic) { public <T, E extends Exception> T doInWriteTransaction(MutateWork<T, E> work) throws StorageException, E { return storage.doInWriteTransaction(work); } @Override
0
final DoFn<InputT, OutputT>.ProcessContext processContext = createProcessContext(elem); } catch (Exception ex) { throw wrapUserCodeException(ex);
0
* Default {@link org.apache.http.message.LineFormatter} implementation. void formatProtocolVersion(final CharArrayBuffer buffer, final ProtocolVersion version) { buffer.append(version.getProtocol()); buffer.append('/'); buffer.append(Integer.toString(version.getMajor())); buffer.append('.'); buffer.append(Integer.toString(version.getMinor())); public void formatRequestLine(final CharArrayBuffer buffer, final RequestLine reqline) { Args.notNull(buffer, "Char array buffer"); buffer.append(reqline.getMethod()); buffer.append(reqline.getUri()); formatProtocolVersion(buffer, reqline.getProtocolVersion()); public void formatStatusLine(final CharArrayBuffer buffer, final StatusLine statline) { Args.notNull(buffer, "Char array buffer"); formatProtocolVersion(buffer, statline.getProtocolVersion()); final String reasonPhrase = statline.getReasonPhrase(); if (reasonPhrase != null) { buffer.append(reasonPhrase); public void formatHeader(final CharArrayBuffer buffer, final Header header) { Args.notNull(buffer, "Char array buffer"); buffer.append(header.getName()); final String value = header.getValue(); }
0