Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
ctx.setErrorHandler(new DefaultErrorHandler());
0
import org.apache.batik.anim.dom.AnimatedAttributeListener; import org.apache.batik.anim.dom.AnimatedLiveAttributeValue; import org.apache.batik.anim.dom.SVGDOMImplementation; import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.anim.dom.SVGOMElement; import org.apache.batik.anim.dom.SVGStylableElement;
0
import org.apache.ambari.server.orm.entities.PrincipalEntity; PrincipalEntity principalEntity = createNiceMock(PrincipalEntity.class); expect(privilege1.getPrincipal()).andReturn(principalEntity); expect(privilege2.getPrincipal()).andReturn(principalEntity); principalEntity.removePrivilege(privilege1); principalEntity.removePrivilege(privilege2); replay(viewInstanceDAO, privilegeDAO, handlerList, privilege1, privilege2, principalEntity); verify(viewInstanceDAO, privilegeDAO, handlerList, privilege1, privilege2, principalEntity);
0
import org.apache.atlas.AtlasException; import org.apache.atlas.AtlasClient; response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.GUID, guid); response.put(AtlasClient.DEFINITION, } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.GUID, guid); response.put(AtlasClient.DEFINITION, entityDefinition); response.put(AtlasClient.ERROR, Servlets.escapeJsonString( } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.TYPENAME, entityType); response.put(AtlasClient.RESULTS, new JSONArray(entityList)); response.put(AtlasClient.COUNT, entityList.size()); } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Thread.currentThread().getName()); } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.GUID, guid); response.put(AtlasClient.RESULTS, new JSONArray(traitNames)); response.put(AtlasClient.COUNT, traitNames.size()); } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.GUID, guid); } catch (AtlasException | IllegalArgumentException e) { response.put(AtlasClient.REQUEST_ID, Servlets.getRequestId()); response.put(AtlasClient.GUID, guid); } catch (AtlasException | IllegalArgumentException e) {
0
// Kept to maintain binary compatibility // Not strictly necessary, but Clirr complains even though there is a super-impl return super._openDataConnection_(command, arg); } /** * {@inheritDoc} * * @throws IllegalStateException if connection mode is not passive */ @Override protected Socket _openDataConnection_(String command, String arg) throws IOException {
0
final Map<String,String> props = new HashMap<>(); preferred = new HashSet<>(Arrays.asList(StringUtils.split(volumes, ','))); final ArrayList<String> filteredOptions = new ArrayList<>(Arrays.asList(options));
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.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.transforms.SerializableFunction; import org.apache.beam.sdk.values.Row; @Experimental /** * Given atype, return a function that converts that type to a {@link Row} object. */ public abstract <T> SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor); /** * Given a type, returns a function that converts from a {@link Row} object to that type. */ public abstract <T> SerializableFunction<Row, T> fromRowFunction( TypeDescriptor<T> typeDescriptor);
0
setUpIterator(Integer.MAX_VALUE - cl.getArgs().length + i, "grep" + i, cl.getArgs()[i], scanner);
0
import javax.management.JMException; boolean registerJMX(LearnerHandlerBean handlerBean) { try { MBeanRegistry.getInstance().register(handlerBean, jmxServerBean); return true; } catch (JMException e) { LOG.warn("Could not register connection", e); } return false; }
0
@Override
0
Map<String, Charset> map = Charset.availableCharsets(); public void testConstructor_File_encoding_badEncoding() { public void testConstructor_File_directory() {
0
@Override public void execute(TaskConfig task) { @Override public void validate(Number value) throws TaskDescriptionException { @Override public void execute(TaskConfig task) { @Override public void execute(TaskConfig task) { @Override public boolean apply(IConstraint constraint) { @Override public boolean apply(Constraint constraint) {
0
import java.nio.charset.StandardCharsets; logFile.write(LOG_FILE_HEADER_V3.getBytes(StandardCharsets.UTF_8));
0
return defaultValue; return value; return results; return defaultValue; return results; return defaultValue;
0
public class ComponentSubclass extends ComponentImpl { public void setCount( int count )
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.ambari.server.state.theme; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; import java.util.List; @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class Widget{ @JsonProperty("type") private String type; @JsonProperty("units") private List<Unit> units; public String getType() { return type; } public void setType(String type) { this.type = type; } public List<Unit> getUnits() { return units; } public void setUnits(List<Unit> units) { this.units = units; } }
0
int minSessionTimeout, int maxSessionTimeout, int listenBacklog, super(logFactory, tickTime, minSessionTimeout, maxSessionTimeout, listenBacklog, zkDb, self);
0
return Hex.encodeHexString(md5(data)); return Hex.encodeHexString(md5(data)); return Hex.encodeHexString(md5(data)); return Hex.encodeHexString(sha256(data)); return Hex.encodeHexString(sha256(data)); return Hex.encodeHexString(sha256(data)); return Hex.encodeHexString(sha384(data)); return Hex.encodeHexString(sha384(data)); return Hex.encodeHexString(sha384(data)); return Hex.encodeHexString(sha512(data)); return Hex.encodeHexString(sha512(data)); return Hex.encodeHexString(sha512(data)); return Hex.encodeHexString(sha(data)); return Hex.encodeHexString(sha(data)); return Hex.encodeHexString(sha(data));
0
* @version $Id$
0
* * * * *
1
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
/** * 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.zookeeper.server; public class ServerCnxnFactoryAccessor { public static ZooKeeperServer getZkServer(ServerCnxnFactory fac) { return fac.zkServer; } }
0
//TODO implement subresource parsing not only for ComparisonPredicate
0
* 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
* 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
context.getClient().createScanner(MetadataTable.NAME, Authorizations.EMPTY));
0
super(new DefaultPartitioning<>(input.getNumPartitions()));
0
fsm.getCluster("c1"), new HostsMap(injector.getInstance(Configuration.class)), injector.getInstance(Configuration.class));
1
import static org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.deleteAllEntities; import static org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.getDatastore; import static org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.makeAncestorKey; import static org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.makeEntity; import org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.UpsertMutationBuilder; import org.apache.beam.sdk.io.gcp.datastore.V1TestUtil.V1TestWriter; import com.google.datastore.v1.Entity; import com.google.datastore.v1.Key; import com.google.datastore.v1.Query; import com.google.datastore.v1.client.Datastore; * End-to-end tests for Datastore DatastoreV1.Read. public class V1ReadIT { private V1TestOptions options; PipelineOptionsFactory.register(V1TestOptions.class); options = TestPipeline.testingPipelineOptions().as(V1TestOptions.class); * An end-to-end test for {@link DatastoreV1.Read}. public void testE2EV1Read() throws Exception { Query query = V1TestUtil.makeAncestorKindQuery( DatastoreV1.Read read = DatastoreIO.v1().read() private static void writeEntitiesToDatastore(V1TestOptions options, String ancestor, V1TestWriter writer = new V1TestWriter(datastore, new UpsertMutationBuilder());
0
import org.apache.cocoon.portal.coplet.CopletInstance; import org.apache.cocoon.portal.coplet.CopletInstanceFeatures; final List changedCoplets = CopletInstanceFeatures.getChangedCopletInstanceDataObjects(service); final CopletInstance cid = (CopletInstance)i.next(); final String adapterName = cid.getCopletDefinition().getCopletType().getCopletAdapterName();
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
import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.SocketFactory;
0
* Test class for HierarchicalXMLConfiguration, * @version $Id: TestHierarchicalXMLConfiguration.java,v 1.1 2004/07/12 12:14:38 ebourg Exp $ public class TestHierarchicalXMLConfiguration extends TestCase private static final String TEST_FILENAME = "testHierarchicalXMLConfiguration.xml"; private HierarchicalXMLConfiguration config; config = new HierarchicalXMLConfiguration(); private void configTest(HierarchicalXMLConfiguration config)
0
* nor may "Apache" appear in their name, without
0
import org.apache.felix.http.base.internal.logger.SystemLogger; SystemLogger.error("Failed to register servlet", e);
0
import org.apache.http.params.CoreProtocolPNames; CoreProtocolPNames.WAIT_FOR_CONTINUE, 3000);
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
@Override @Override
0
* @param stringTokenizer the tokenizer to convert to a {@link #List(String)}
0
return patterns;
0
Tables.clearCache(master.getContext()); AuditedSecurityOperation.getInstance(master.getContext()) .deleteNamespace(master.getContext().rpcCreds(), namespaceId);
0
for (SftpClient.DirEntry entry : sftp.listDir(h)) {
0
public TestHttpsAsyncTimeout() { super(ProtocolScheme.https); }
0
import org.apache.cocoon.portal.services.VariableResolver; /** * Get the variable resolver * @since 2.2 */ VariableResolver getVariableResolver();
0
* http://www.apache.org/licenses/LICENSE-2.0
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 $Revision: 1.9 $ $Date: 2004/02/29 14:17:37 $
0
/* * $HeadURL$ * $Revision$ * $Date$ * * ==================================================================== * * Copyright 1999-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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.http.nio.reactor; import java.io.IOException; import java.net.SocketAddress; public interface ConnectingIOReactor extends IOReactor { SessionRequest connect(SocketAddress remoteAddress, SocketAddress localAddress, Object attachment) throws IOException; }
0
* * <h2>Windowing</h2> * <pre>{@code * }</pre> * <h2>Triggers</h2> * <pre>{@code * }</pre> * <pre>{@code * }</pre>
0
this.getLogger().debug("Block with core=true"); this.serviceManager = this.parentServiceManager; this.serviceManager = } // Create a service manager with the exposed components of the block if (this.blockWiring.getComponentConfiguration() != null) { DefaultConfiguration componentConf = new DefaultConfiguration("components", confLocation); componentConf.addAll(this.blockWiring.getComponentConfiguration()); this.serviceManager = new CocoonServiceManager(this.serviceManager); LifecycleHelper.setupComponent(this.serviceManager, this.getLogger(), newContext, null, componentConf);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/impl/ScriptBlock.java,v 1.12 2003/01/24 19:03:24 morgand Exp $ * $Revision: 1.12 $ * $Date: 2003/01/24 19:03:24 $ * $Id: ScriptBlock.java,v 1.12 2003/01/24 19:03:24 morgand Exp $ import org.apache.commons.jelly.JellyTagException; * @version $Revision: 1.12 $ public void run(JellyContext context, XMLOutput output) throws JellyTagException {
1
Copyright 2001,2003 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
if (keyUsage != null && !keyUsage[0]) { return ("DSA".equalsIgnoreCase(algName) && algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1) || "RSA".equalsIgnoreCase(algName) && algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/dynabean/src/java/org/apache/commons/jelly/tags/dynabean/DynabeanTag.java,v 1.3 2003/10/09 21:21:17 rdonkin Exp $ * $Revision: 1.3 $ * $Date: 2003/10/09 21:21:17 $ * 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. * $Id: DynabeanTag.java,v 1.3 2003/10/09 21:21:17 rdonkin Exp $ * @version $Revision: 1.3 $
0
* Copyright 2004 The Apache Software Foundation. * @author Niall Pemberton * @version $Revision: 1.2 $ $Date: 2004/07/13 23:04:21 $
0
dataSource.setDefaultAutoCommit(Boolean.valueOf(value)); dataSource.setDefaultReadOnly(Boolean.valueOf(value));
0
/** Tests for {@link KeyedWorkItems}. */ CoderProperties.coderSerializable( KeyedWorkItemCoder.of( GlobalWindow.Coder.INSTANCE, GlobalWindow.Coder.INSTANCE, GlobalWindow.Coder.INSTANCE));
1
import org.apache.atlas.AtlasException; public void processNode(ObjectGraphWalker.Node nd) throws AtlasException {
0
package org.apache.commons.configuration; * @since 1.0 * * @author <a href="mailto:[email protected]">Herve Quiroz</a> * @version $Revision: 1.3 $, $Date: 2004/06/22 09:56:38 $
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ProxyListIterator.java,v 1.7 2004/01/04 18:04:16 scolebourne Exp $ * Copyright (c) 1999-2004 The Apache Software Foundation. All rights * @deprecated Use AbstractListIteratorDecorator. Will be removed in v4.0 * @version $Revision: 1.7 $ $Date: 2004/01/04 18:04:16 $
0
/** Full join implementation of {@link JoinFn}. */ public FullJoinFn( BinaryFunctor<LeftT, RightT, OutputT> joiner, TupleTag<LeftT> leftTag, ProcessContext c, K key, CoGbkResult value,
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractDoubleCollectionCollection.java,v 1.3 2003/11/07 20:09: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:09:15 $
0
(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1); ("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI()); ("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
0
List<? extends BoundedSource<String>> sources = source.splitIntoBundles(32, null); for (BoundedSource<String> split : sources) { List<? extends BoundedSource<String>> sources = source.splitIntoBundles(512, null); for (BoundedSource<String> split : sources) {
0
import java.util.Map.Entry; import org.apache.accumulo.core.file.rfile.RFile; import org.apache.accumulo.core.file.rfile.RFileOperations; String newMapFile = String.format("%s/" + RFile.EXTENSION + "_%04d", newDir, count++); String outFile = String.format("%s/index", newMapFile); FileSKVWriter writer = new RFileOperations().openWriter(outFile, fs, conf, acuConf); writer.append(key, new Value(new byte[0]));
0
* http://www.apache.org/licenses/LICENSE-2.0
0
if (parent == null) { throw new NullPointerException("parent is null"); } if (!(parent instanceof javax.xml.crypto.dom.DOMStructure)) {
0
package org.apache.bcel.generic; super(org.apache.bcel.Const.IMPDEP1, (short) 1);
1
* <strong>Note that TransformedMap is not synchronized and is not thread-safe.</strong> * If you wish to use this map from multiple threads concurrently, you must use * appropriate synchronization. The simplest approach is to wrap this map * using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw * exceptions when accessed by concurrent threads without synchronization. * <p>
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 com.sun.jersey.core.util.Base64; import javax.ws.rs.DELETE; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import java.nio.charset.Charset; mapIds.put(Resource.Type.User, userName);
0
sm.validate( cm10 ); // service metadata requires validation to set scope properly assertEquals( "servicefactory", ServiceMetadata.Scope.bundle, sm.getScope() );
0
import org.apache.cocoon.xml.util.NamespacesTable;
0
public boolean isValidAuthorizations(String user, List<ByteBuffer> auths) {
0
/* * Copyright (c) OSGi Alliance (2017). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.osgi.util.converter; import org.osgi.annotation.versioning.ProviderType; /** * The Converter service is used to start a conversion. The service is obtained * from the service registry. The conversion is then completed via the * Converting interface that has methods to specify the target type. * * @author $Id: bed4a27f1d9cbff0f3646d6df355843518280e33 $ * @ThreadSafe */ @ProviderType public interface Converter { /** * Start a conversion for the given object. * * @param obj The object that should be converted. * @return A {@link Converting} object to complete the conversion. */ Converting convert(Object obj); /** * Start defining a function that can perform given conversions. * @return A {@link Functioning} object to complete the definition. */ Functioning function(); /** * Obtain a builder to create a modified converter based on this converter. * For more details see the {@link ConverterBuilder} interface. * * @return A new Converter Builder. */ ConverterBuilder newConverterBuilder(); }
0
import it.sauronsoftware.cron4j.InvalidPatternException; import it.sauronsoftware.cron4j.Scheduler; import it.sauronsoftware.cron4j.SchedulingPattern;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/converters/SqlTimeConverter.java,v 1.2 2002/04/11 19:50:06 craigmcc Exp $ * $Revision: 1.2 $ * $Date: 2002/04/11 19:50:06 $ * @version $Revision: 1.2 $ $Date: 2002/04/11 19:50:06 $ this.defaultValue = null; this.useDefault = false; this.useDefault = true; /** * Should we return the default value on conversion errors? */ private boolean useDefault = true; if (useDefault) { if (useDefault) {
0
} @Test public void testAvailableBuildVersion() throws Exception { Cluster cluster = createNiceMock(Cluster.class); RepositoryVersionEntity repositoryVersion = createNiceMock(RepositoryVersionEntity.class); expect(repositoryVersion.getVersion()).andReturn("2.3.4.1-1").atLeastOnce(); Service serviceHdfs = createNiceMock(Service.class); expect(serviceHdfs.getName()).andReturn("HDFS").atLeastOnce(); expect(serviceHdfs.getDisplayName()).andReturn("HDFS").atLeastOnce(); expect(serviceHdfs.getDesiredRepositoryVersion()).andReturn(repositoryVersion).atLeastOnce(); Service serviceHBase = createNiceMock(Service.class); expect(serviceHBase.getName()).andReturn("HBASE").atLeastOnce(); expect(serviceHBase.getDisplayName()).andReturn("HBase").atLeastOnce(); expect(serviceHBase.getDesiredRepositoryVersion()).andReturn(repositoryVersion).atLeastOnce(); // !!! should never be accessed as it's not in any VDF Service serviceAMS = createNiceMock(Service.class); expect(cluster.getServices()).andReturn(ImmutableMap.<String, Service>builder() .put("HDFS", serviceHdfs) .put("HBASE", serviceHBase) .put("AMBARI_METRICS", serviceAMS).build()).atLeastOnce(); replay(cluster, repositoryVersion, serviceHdfs, serviceHBase); File f = new File("src/test/resources/version_definition_test_maint_partial.xml"); VersionDefinitionXml xml = VersionDefinitionXml.load(f.toURI().toURL()); xml.release.version = "2.3.4.1"; xml.release.build = "2"; ClusterVersionSummary summary = xml.getClusterSummary(cluster); assertEquals(1, summary.getAvailableServiceNames().size());
0
import org.apache.beam.sdk.values.WindowingStrategy;
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
StringBuilder sb = new StringBuilder();
0
m.put(new Text("acf"), new Text("foo"), new Value(new byte[] {'1'}));
0
hiveConf.set("hive.hook.dgi.synchronous", "true");
0
import java.util.concurrent.ConcurrentHashMap; import org.apache.commons.io.FilenameUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.PhoenixHBaseAccessor; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricDistributedCache; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.availability.MetricCollectorHAController; import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataManager;
0
import org.apache.sshd.server.shell.ShellFactory; * Retrieve the {@link ShellFactory} object to be used to create shells. * @return a valid {@link ShellFactory} object or {@code null} if shells ShellFactory getShellFactory();
0
if (obj instanceof String) { // Optimization for when the value is already a String // David B.: is this ok? Or does the Converter do something else // other than just returning a String?? // I noticed that a lot of calculations were going on, just // to return a String anyway. return "\"" + (String)obj + "\""; } else if (obj instanceof Map) {
0
return Collections.unmodifiableList(new ArrayList<>(
0
* */ private static final long serialVersionUID = 1L; /**
0
* @version CVS $Id: Paginator.java,v 1.1 2003/06/27 20:10:42 stefano Exp $
0
Set<String> tables = new HashSet<>( Arrays.asList(MetadataTable.NAME, RootTable.NAME, "a1", "a2"));
0
/* * $Header: /cvshome/build/ee.foundation/src/java/security/KeyPair.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 KeyPair implements java.io.Serializable { public KeyPair(java.security.PublicKey var0, java.security.PrivateKey var1) { } public java.security.PrivateKey getPrivate() { return null; } public java.security.PublicKey getPublic() { return null; } }
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.accumulo.core.cli; import com.beust.jcommander.JCommander; import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; public class Help { @Parameter(names={"-h", "-?", "--help", "-help"}, help=true) public boolean help = false; public void parseArgs(String programName, String[] args, Object ... others) { JCommander commander = new JCommander(); commander.addObject(this); for (Object other : others) commander.addObject(other); commander.setProgramName(programName); try { commander.parse(args); } catch (ParameterException ex) { commander.usage(); System.err.println(ex.getMessage()); System.exit(0); } if (help) { commander.usage(); System.exit(0); } } }
1
* Copyright (c) 2002, 2003 The Apache Software Foundation. All rights
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 spell.checker; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Instantiate; import org.apache.felix.ipojo.annotations.Provides; import org.apache.felix.ipojo.annotations.Requires; import spell.services.DictionaryService; import spell.services.SpellChecker; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; //TODO public class SpellCheck implements SpellChecker { //TODO /** * Implements SpellChecker.check(). Checks the given passage for misspelled words. * * @param passage the passage to spell check. * @return An array of misspelled words or null if no words are misspelled. */ public String[] check(String passage) { //TODO return new String[] {}; } }
0
public int defaultTimeoutSeconds() { return 2 * 60; } @Override return akey.compareTo(bkey, PartialKey.ROW_COLFAM_COLQUAL_COLVIS) == 0 && a.getValue().equals(b.getValue()); @Test
0
assertThat(protoComponents.getCoder(payload.getCoderId()), equalTo(testStream.getValueCoder()));
1
public class DefaultThreadFactoryTestCase extends TestCase private static class DummyRunnable implements Runnable
0
private static final Map<Resource.Type, String> keyPropertyIds = ImmutableMap.<Resource.Type, String>builder() private static final Set<String> propertyIds = Sets.newHashSet(
0
import cz.seznam.euphoria.core.client.triggers.Trigger; import java.util.List; * Returns list of triggers used by this instance of {@link Window} List<Trigger> createTriggers();
0
import org.apache.avalon.framework.component.Component; * Interface component to the ODMG Implementation. It is used to get * the ODMG Implementation object to interact with object database * through ODMG API. public interface ODMG extends Component { String ROLE = ODMG.class.getName();
0