Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
//todo exception is wrong. We don't miss a signature when we are decrypting but we miss EncryptedData
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/TestAll.java,v 1.6 2003/10/01 21:54:54 scolebourne Exp $ * $Revision: 1.6 $ * $Date: 2003/10/01 21:54:54 $ * @version $Id: TestAll.java,v 1.6 2003/10/01 21:54:54 scolebourne Exp $ suite.addTest(TestObjectArrayListIterator2.suite());
0
import org.apache.hc.core5.io.GracefullyCloseable; public abstract class ConnectionEndpoint implements GracefullyCloseable {
1
package org.apache.beam.sdk.extensions.euphoria.core.client.operator; import org.apache.beam.sdk.extensions.euphoria.core.annotation.audience.Audience; import org.apache.beam.sdk.extensions.euphoria.core.annotation.operator.Derived; import org.apache.beam.sdk.extensions.euphoria.core.annotation.operator.StateComplexity; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.Dataset; import org.apache.beam.sdk.extensions.euphoria.core.client.flow.Flow; import org.apache.beam.sdk.extensions.euphoria.core.client.functional.ExtractEventTime; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.hint.OutputHint; import org.apache.beam.sdk.extensions.euphoria.core.executor.graph.DAG;
0
import com.twitter.mesos.scheduler.base.JobKeys; import com.twitter.mesos.scheduler.base.Query;
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
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
public HttpRequest receiveRequestHeader() throws HttpException, IOException { final Socket socket = ensureOpen(); final HttpRequest request = this.requestParser.parse(this.inbuffer, socket.getInputStream()); final Socket socket = ensureOpen(); final HttpEntity entity = createIncomingEntity(request, this.inbuffer, socket.getInputStream(), len); final Socket socket = ensureOpen(); this.responseWriter.write(response, this.outbuffer, socket.getOutputStream()); final Socket socket = ensureOpen(); final OutputStream outstream = createContentOutputStream(len, this.outbuffer, socket.getOutputStream(), entity.getTrailers());
1
import org.apache.hc.core5.util.Timeout; Future<AsyncClientEndpoint> future = requester.connect(target, Timeout.ofSeconds(5));
0
if (zk == null || !zk.getState().isAlive()) {
0
// Improve the log message because of FELIX-4455, we will see if we get better feedback. "[" + m_name + "] iPOJO did not find a suitable constructor to create the " + "object: " + e.getMessage(), e);
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.servicemix.kernel.gshell.config; import java.util.Dictionary; import java.util.Enumeration; import org.osgi.service.cm.ConfigurationAdmin; public class PropListCommand extends ConfigCommandSupport { protected void doExecute(ConfigurationAdmin admin) throws Exception { Dictionary props = getEditedProps(); if (props == null) { System.err.println("No configuration is being edited. Run the edit command first"); } else { for (Enumeration e = props.keys(); e.hasMoreElements();) { Object key = e.nextElement(); io.out.println(" " + key + " = " + props.get(key)); } } } }
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
class ConverterBuilderImpl implements ConverterBuilder {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/observed/Attic/ObservableBuffer.java,v 1.3 2003/10/13 21:18:56 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/10/13 21:18:56 $ * A {@link org.apache.commons.collections.observed.standard.StandardModificationHandler} will be created. * A <code>null</code> listener will create a * {@link org.apache.commons.collections.observed.standard.StandardModificationHandler}.
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 java.io.File; import org.apache.felix.sigil.eclipse.PathUtil; IPath p = PathUtil.newPathIfExists(getBundle().getLocation());
0
str = str.trim(); } finally { try { br.close(); } catch (IOException ioe) { }
0
final CopletInstance original = this.portalService.getProfileManager().getCopletInstance(ci.getCopletId()); layout.setCopletInstanceId(cid.getId()); CopletInstance cid = this.portalService.getProfileManager().getCopletInstance(ci.getCopletId()); CopletInstance cid = this.portalService.getProfileManager().getCopletInstance(ci.getCopletId());
0
import java.util.Arrays; import java.util.List;
0
* @param state the maintenance state public void setMaintenanceState(MaintenanceState state); * @return the maintenance state public MaintenanceState getMaintenanceState();
0
private static Map<String, Class<?>> algorithmsClassMapInOut; private static Map<String, Class<?>> algorithmsClassMapIn; private static Map<String, Class<?>> algorithmsClassMapOut; algorithmsClassMapInOut = new HashMap<String, Class<?>>(); algorithmsClassMapIn = new HashMap<String, Class<?>>(); algorithmsClassMapOut = new HashMap<String, Class<?>>(); Class<?> clazz = null;
0
public class BasicClientExchangeHandler<T> implements AsyncClientExchangeHandler {
0
JSONArray guids = metadataServiceClient.createEntity(entityJSON); System.out.println("created instance for type " + typeName + ", guid: " + guids); return new Id(guids.getString(0), referenceable.getId().getVersion(), referenceable.getTypeName()); JSONArray results = metadataServiceClient.search(dslQuery); if (results != null) { System.out.println("query [" + dslQuery + "] returned [" + results.length() + "] rows");
1
private static final boolean DISPLAY_THREAD_DETAILS= Boolean.valueOf(System.getProperty("TestConnectionPool.display.thread.details", "false")).booleanValue(); // To pass this to a Maven test, use: // mvn test -DargLine="-DTestConnectionPool.display.thread.details=true" // @see http://jira.codehaus.org/browse/SUREFIRE-121 if (DISPLAY_THREAD_DETAILS || (pts.length/2 != failed)){ long offset = pts[0].created; // To reduce size of output numbers System.out.println("Offset: "+offset); "Pre: " + (pt.preconnected-offset) // First, so can sort on this easily + ". Post: " + (pt.postconnected-offset) + ". Startup: " + (pt.started-pt.created) + ". getConn(): " + (pt.connected > 0 ? Long.toString(pt.connected-pt.preconnected) : "-") + ". IDX: " + i private long postconnected; // when thread released connection postconnected = timeStamp();
0
import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.ParDo; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; public void testConflictingNames() { final PipelineOptions options = TestPipeline.testingPipelineOptions(); final Pipeline p = Pipeline.create(options); // Check pipeline runner correctly catches user errors. thrown.expect(IllegalStateException.class); thrown.expectMessage(new BaseMatcher<String>() { // more readable than a regex @Override public void describeTo(final Description description) { description.appendText("validates the conflicting instances are " + "listed into the exception message"); } @Override public boolean matches(final Object o) { final String sanitized = String.class.cast(o) .replaceAll("\\$[\\p{Alnum}]+@[\\p{Alnum}]+", "\\$x@y"); return sanitized.contains( "Conflicting instances:\n" + "- name=ParDo(Anonymous):\n" + " - org.apache.beam.sdk.PipelineTest$x@y\n" + " - org.apache.beam.sdk.PipelineTest$x@y\n\n" + "You can fix it adding a name when you call apply(): " + "pipeline.apply(<name>, <transform>)."); } }); p.apply(Create.of("a")) // 2 anonymous classes are conflicting .apply(ParDo.of(new DoFn<String, String>() { @ProcessElement public void onElement(final ProcessContext ctx) { ctx.output(ctx.element()); } })) .apply(ParDo.of(new DoFn<String, String>() { @ProcessElement public void onElement(final ProcessContext ctx) { // no-op } })); p.run(); } @Test
0
new LocalizableSupport(RESOURCES, Messages.class.getClassLoader());
1
package iterator; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.core.file.map.MyMapFile; import org.apache.accumulo.core.file.map.MyMapFile.Reader; import org.apache.accumulo.core.iterators.IteratorEnvironment; import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope; import org.apache.accumulo.core.iterators.SortedKeyValueIterator; import org.apache.accumulo.core.util.CachedConfiguration; public class DefaultIteratorEnvironment implements IteratorEnvironment { public Reader reserveMapFileReader(String mapFileName) throws IOException { Configuration conf = CachedConfiguration.getInstance(); FileSystem fs = FileSystem.get(conf); return new MyMapFile.Reader(fs,mapFileName,conf); } public AccumuloConfiguration getConfig() { return AccumuloConfiguration.getDefaultConfiguration(); } public IteratorScope getIteratorScope() { throw new UnsupportedOperationException(); } public boolean isFullMajorCompaction() { throw new UnsupportedOperationException(); } public void registerSideChannel(SortedKeyValueIterator<Key, Value> iter) { throw new UnsupportedOperationException(); } }
1
/** * Microsoft Windows specific user principal implementation.
0
public DualHashBidiMap(final Map<K, V> map) { protected DualHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) { protected BidiMap<V, K> createBidiMap(final Map<V, K> normalMap, final Map<K, V> reverseMap, final BidiMap<K, V> inverseBidiMap) { private void writeObject(final ObjectOutputStream out) throws IOException { private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { final
0
public class NoopTriggerScheduler<W extends Window, K> implements TriggerScheduler<W, K> { public void cancelAll() {} public void cancel(long stamp, KeyedWindow<W, K> window) {} public void close() {}
0
cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "15s");
0
* Copyright 1999-2006 The Apache Software Foundation
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.Parameter; public class ClientOnDefaultTable extends ClientOpts { private final String defaultTable; public ClientOnDefaultTable(String table) { this.defaultTable = table; } @Parameter(names="--table", description="table to use") String tableName; public String getTableName() { if (tableName == null) return defaultTable; return tableName; } }
0
* Exception thrown if a property is attempted to be extracted from an object that does not have such a property. public class NoSuchPropertyException extends OgnlException private Object target; private Object name; super( getReason( target, name ) ); super( getReason( target, name ), reason ); this.target = target; this.name = name; static String getReason( Object target, Object name ) if ( target == null ) else if ( target instanceof Class ) ret = ( (Class) target ).getName(); return target; return name;
0
Assert.assertEquals(Arrays.asList("xx", "jp", "ac.jp", "*.tokyo.jp", "no", "h\u00E5.no"), suffixList.getRules());
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/bidimap/AbstractBidiMapDecorator.java,v 1.2 2003/12/03 14:03:35 scolebourne Exp $ * @version $Revision: 1.2 $ $Date: 2003/12/03 14:03:35 $ protected AbstractBidiMapDecorator(BidiMap map) {
0
import net.sf.ehcache.config.PersistenceConfiguration.Strategy;
0
private static HashMap<String,String> response= new HashMap<>();
0
TabletStateChangeIterator.setMigrations(tabletChange, state.migrationsSnapshot());
0
import java.util.HashMap; import org.codehaus.jackson.annotate.JsonProperty; private Map<String, String> params = new HashMap<String, String>(); private Map<String, List<String>> clusterHostInfo = new HashMap<String, List<String>>(); @JsonProperty("commandId") @JsonProperty("commandId") @JsonProperty("roleCommands") public synchronized List<RoleExecution> getRoleCommands() { return this.rolesCommands; } @Override @Override public String toString() { return "Host=" + hostname + ", commandId="+commandId; } @Override /** * Role Execution commands sent to the * */ public static class RoleExecution { public RoleExecution() {} @JsonProperty("role") @JsonProperty("role") @JsonProperty("roleParams") @JsonProperty("roleParams") @JsonProperty("cmd") @JsonProperty("cmd") public String toString() { return null; } @JsonProperty("clusterName") @JsonProperty("clusterName") @JsonProperty("hostname") @JsonProperty("hostname") @JsonProperty("params") @JsonProperty("params") @JsonProperty("clusterHostInfo") @JsonProperty("clusterHostInfo") @JsonProperty("configurations") @JsonProperty("configurations")
1
import org.apache.zookeeper.server.quorum.flexible.QuorumVerifier; import org.apache.zookeeper.server.quorum.flexible.QuorumMaj; /** * QuorumVerifier implementation; default (majority). */ private QuorumVerifier quorumConfig; /** * For backward compatibility purposes, we instantiate QuorumMaj by default. */ this(quorumPeers, dataDir, dataLogDir, electionType, myid, tickTime, initLimit, syncLimit, cnxnFactory, new QuorumMaj(quorumPeers.size())); } public QuorumPeer(Map<Long, QuorumServer> quorumPeers, File dataDir, File dataLogDir, int electionType, long myid, int tickTime, int initLimit, int syncLimit, NIOServerCnxn.Factory cnxnFactory, QuorumVerifier quorumConfig) throws IOException { if(quorumConfig == null) this.quorumConfig = new QuorumMaj(quorumPeers.size()); else this.quorumConfig = quorumConfig; new NIOServerCnxn.Factory(clientPort), new QuorumMaj(quorumPeers.size())); } /** * This constructor is only used by the existing unit test code. * It defaults to FileLogProvider persistence provider. */ public QuorumPeer(Map<Long,QuorumServer> quorumPeers, File snapDir, File logDir, int clientPort, int electionAlg, long myid, int tickTime, int initLimit, int syncLimit, QuorumVerifier quorumConfig) throws IOException { this(quorumPeers, snapDir, logDir, electionAlg, myid,tickTime, initLimit,syncLimit, new NIOServerCnxn.Factory(clientPort), quorumConfig); * Return QuorumVerifier object */ public QuorumVerifier getQuorumVerifier(){ return quorumConfig; } public void setQuorumVerifier(QuorumVerifier quorumConfig){ this.quorumConfig = quorumConfig; } /**
0
try (BigQueryTableRowIterator iterator = BigQueryTableRowIterator.of( try (BigQueryTableRowIterator iterator = BigQueryTableRowIterator.of( try (BigQueryTableRowIterator iterator = BigQueryTableRowIterator.of( try (BigQueryTableRowIterator iterator = BigQueryTableRowIterator.of( try (BigQueryTableRowIterator iterator = BigQueryTableRowIterator.of(
0
import java.io.PrintStream; // Cache the original System.err, because the logging infrastructure modifies it and redirects // it to a logger. private static final PrintStream originalStandardError = System.err; public void uncaughtException(Thread thread, Throwable e) { try { LOG.error("Uncaught exception in main thread. Exiting with status code 1.", e); System.err.println("Uncaught exception in main thread. Exiting with status code 1."); e.printStackTrace(); } catch (Throwable t) { originalStandardError.println( "Uncaught exception in main thread. Exiting with status code 1."); e.printStackTrace(originalStandardError); originalStandardError.println( "UncaughtExceptionHandler caused another exception to be thrown, as follows:"); t.printStackTrace(originalStandardError); } finally { System.exit(1); }
0
package org.apache.commons.ognl.test.enhance; import org.apache.commons.ognl.Node; import org.apache.commons.ognl.Ognl; import org.apache.commons.ognl.OgnlContext; import org.apache.commons.ognl.enhance.ExpressionCompiler; import org.apache.commons.ognl.enhance.OgnlExpressionCompiler; import org.apache.commons.ognl.test.objects.*;
0
// tarFile = createTarFile(this.file); finally { closeCommunicationLink(); } /** * will be called after all file-objects closed their streams. */ protected void notifyAllStreamsClosed() { closeCommunicationLink(); }
0
public java.util.List getDefinitionSet(){
0
package org.apache.aurora.scheduler.base; import org.apache.aurora.gen.JobKey; import org.apache.aurora.gen.TaskQuery; import org.apache.aurora.scheduler.storage.entities.IJobConfiguration; import org.apache.aurora.scheduler.storage.entities.IJobKey; import org.apache.aurora.scheduler.storage.entities.ITaskConfig;
0
if (batches < 0) {
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects.firstNonNull; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Strings.isNullOrEmpty; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Joiner; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Utf8; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
0
String subparts[] = ((parts[i].split(";"))[0]).split(":"); String clientPort = (parts[i].split(";"))[1];
0
* * @version $Id$
0
@SuppressWarnings("unchecked") void add(AccState<VALUE> other) { MapElements.of(firstStep).using(Pair::getSecond).output();
0
requestDate, responseDate, response); new Date(), new Date(), response); new Date(), new Date(), response); new Date(), new Date(), response); new Date(), response); twoSecondsAgo, oneSecondAgo, response); twoSecondsAgo, oneSecondAgo, response); twoSecondsAgo, oneSecondAgo, response); twoSecondsAgo, oneSecondAgo, response); response);
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 class WordsAlphabet { private String alphabet; private String fruit; private String country; public WordsAlphabet(String alphabet, String fruit, String country) { this.alphabet = alphabet; this.fruit = fruit; this.country = country; } @Override public String toString() { return "WordsAlphabet{" + "alphabet='" + alphabet + '\'' + ", fruit='" + fruit + '\'' + ", country='" + country + '\'' + '}'; } }
0
* "Apache" nor may "Apache" appear in their name without prior * @version $Revision: 1.4 $ $Date: 2003/10/05 21:45:49 $
0
* Callback for initializing the reference (field references) /** * Initialize the reference. This is usually setting the value of a field. * @param componentInstance The component instance * @param logger The logger * @return {@code true} if initialization succeeded */ boolean init( Object componentInstance, SimpleLogger logger );
0
import org.apache.accumulo.core.client.AccumuloClient; private AccumuloClient c; c = getAccumuloClient(); AccumuloClient user1Con = c.changeUser(u1, user1.getToken());
0
ret.setEntityGuid(AtlasGraphUtilsV2.getEncodedProperty(classificationVertex, CLASSIFICATION_ENTITY_GUID, String.class)); String strValidityPeriods = AtlasGraphUtilsV2.getEncodedProperty(classificationVertex, CLASSIFICATION_VALIDITY_PERIODS_KEY, String.class);
0
if (isOpen()) { session.close(true); }
0
@Override @Override public Lock getLock() { return ioSession.getLock(); } @Override return ioSession.getLock(); @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override
0
import java.util.List; protected List textRuns; public List getTextRuns() { return textRuns; } public void setTextRuns(List textRuns) { this.textRuns = textRuns; } beginMark = rc.getTextPainter().selectFirst(x, y, aci, this, rc); endMark = rc.getTextPainter().selectLast(x, y, aci, this, rc); if ((ranges != null) && (ranges.length > 1)) { // make sure that they are in order if (ranges[0] > ranges[1]) { int temp = ranges[1]; ranges[1] = ranges[0]; ranges[0] = temp; o = new AttributedCharacterSpanIterator( aci, ranges[0], ranges[1]+1); // System.out.println("getting highlight shape for " + this);
0
private Map<String, Alert> m_alertCache = new ConcurrentHashMap<>();
1
.setName(PORTS.getMesosName())
0
/** * Copyright 2003-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.cli2.bug; import junit.framework.TestCase; import org.apache.commons.cli2.CommandLine; import org.apache.commons.cli2.Group; import org.apache.commons.cli2.Option; import org.apache.commons.cli2.builder.ArgumentBuilder; import org.apache.commons.cli2.builder.DefaultOptionBuilder; import org.apache.commons.cli2.builder.GroupBuilder; import org.apache.commons.cli2.commandline.Parser; /** * @author John Keyes */ public class Bug13935Test extends TestCase { public Bug13935Test(final String name) { super(name); } public void testRequiredGroup() throws Exception { final DefaultOptionBuilder obuilder = new DefaultOptionBuilder(); final ArgumentBuilder abuilder = new ArgumentBuilder(); final GroupBuilder gbuilder = new GroupBuilder(); final Option testOption = obuilder .withShortName("a") .withArgument(abuilder.withName("quoted string").create()) .create(); final Group options = gbuilder.withOption(testOption).create(); final Parser parser = new Parser(); parser.setGroup(options); final CommandLine cmdLine = parser.parse(new String[] { "-a", "\"two tokens\"" }); assertTrue(cmdLine.hasOption("-a")); assertEquals("two tokens", cmdLine.getValue("-a")); } }
0
import static org.apache.commons.collections4.functors.NullPredicate.*;
0
* https://issues.apache.org/jira/browse/ZOOKEEPER-1343
0
"TableCell can hold arbitrary instances, which may be non-deterministic.");
0
return convertCollectionToSingleValue(targetAsClass); } else if (object instanceof Map.Entry) { return convertMapEntryToSingleValue(targetAsClass); return convertArrayToSingleValue(targetAsClass); @SuppressWarnings("rawtypes") private Object convertMapEntryToSingleValue(Class<?> cls) { Map.Entry entry = (Map.Entry) object; Class keyCls = entry.getKey() != null ? entry.getKey().getClass() : null; Class valueCls = entry.getValue() != null ? entry.getValue().getClass() : null; if (cls.equals(keyCls)) { return converter.convert(entry.getKey()).to(cls); } else if (cls.equals(valueCls)) { return converter.convert(entry.getValue()).to(cls); } else if (cls.isAssignableFrom(keyCls)) { return converter.convert(entry.getKey()).to(cls); } else if (cls.isAssignableFrom(valueCls)) { return converter.convert(entry.getValue()).to(cls); } else if (entry.getKey() instanceof String) { return converter.convert(entry.getKey()).to(cls); } else if (entry.getValue() instanceof String) { return converter.convert(entry.getValue()).to(cls); } return converter.convert(converter.convert(entry.getKey()).to(String.class)).to(cls); }
0
import org.apache.sshd.common.session.Session; public void startFileEvent( Session session, FileOperation op, Path file, long length, Set<PosixFilePermission> perms) throws IOException { log.trace("startFileEvent({})[{}] - length={}, permissions={}, file={}", session, op, length, perms, file); public void endFileEvent( Session session, FileOperation op, Path file, long length, Set<PosixFilePermission> perms, Throwable thrown) throws IOException { log.trace("endFileEvent({})[{}] - length={}, permissions={}, file={} - {}", session, op, length, perms, file, (thrown == null) ? "OK" : thrown.getClass().getSimpleName() + ": " + thrown.getMessage()); public void startFolderEvent( Session session, FileOperation op, Path file, Set<PosixFilePermission> perms) throws IOException { log.trace("startFolderEvent({})[{}] - permissions={}, file={}", session, op, perms, file); public void endFolderEvent( Session session, FileOperation op, Path file, Set<PosixFilePermission> perms, Throwable thrown) throws IOException { log.trace("endFolderEvent({})[{}] - permissions={}, file={} - {}", session, op, perms, file, (thrown == null) ? "OK" : thrown.getClass().getSimpleName() + ": " + thrown.getMessage());
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
/** * Provide a String representaion of this file filter. * * @return a String representaion */ public String toString() { String condition = acceptOlder ? "<=" : ">"; return super.toString() + "(" + condition + cutoff + ")"; }
0
@SuppressWarnings("serial") @SuppressWarnings("serial")
0
tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Tablet&nbsp;Servers</a>", NumberType.commas(info.tServerInfo.size(), 1, Long.MAX_VALUE)); tableRow(sb, (highlight = !highlight), "<a href='/tservers'>Dead&nbsp;Tablet&nbsp;Servers</a>", NumberType.commas(info.deadTabletServers.size(), 0, 0)); tableRow(sb, (highlight = !highlight), "Tablets", NumberType.commas(Monitor.getTotalTabletCount(), 1, Long.MAX_VALUE));
0
import com.google.common.collect.ImmutableSet;
0
import org.apache.http.util.Args; Args.notNull(requestExecutor, "HTTP request executor"); Args.notNull(retryStrategy, "Retry strategy");
0
* @version CVS $Id: EPNames.java,v 1.4 2004/01/31 08:50:39 antonio Exp $ public class EPNames extends BaseElementProcessor { public EPNames() { } // end public class EPNames
0
import org.apache.accumulo.core.client.impl.Credentials; import org.apache.accumulo.core.data.impl.KeyExtent;
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. */ package org.apache.felix.ipojo.test.scenarios.manipulation.service; import java.util.Properties; public interface FooService { boolean foo(); Properties fooProps(); Boolean getObject(); boolean getBoolean(); int getInt(); long getLong(); double getDouble(); }
0
throw new IllegalStateException( "Security module currently cannot support Kerberos/SASL instances"); if (WalkingSecurity.get(state, env) .userExists(WalkingSecurity.get(state, env).getTabUserName())) {
0
if ( m_userConfig.isRemoteFile() ) { m_logger.info( "Deploying " + resourceURI ); } else { m_logger.info( "Installing " + resourceURI ); }
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.slf4j.LoggerFactory; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; // Reduce pax exam log level. Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); root.setLevel(Level.WARN);
0
* Sets the hdfs file name to use, containing a newline separated list of Base64 encoded split * points that represent ranges for partitioning
0
throw new RuntimeException(e);
0
((DefaultContext)this.context).makeReadOnly(); /* (non-Javadoc) * @see org.apache.avalon.framework.activity.Disposable#dispose()
0
package org.apache.beam.runners.direct; import org.apache.beam.runners.direct.InProcessPipelineRunner.CommittedBundle; import org.apache.beam.runners.direct.InProcessPipelineRunner.UncommittedBundle;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedIntArrayList.java,v 1.2 2002/08/13 19:41:36 pjack Exp $ * $Revision: 1.2 $ * $Date: 2002/08/13 19:41:36 $ * A list of unsigned 32-bit values, stored in a <Code>long</Code> array. * Mutators on this class will reject any <Code>long</Code> that does not * express an unsigned 16-bit value. * * @version $Revision: 1.2 $ $Date: 2002/08/13 19:41:36 $ /** * Constructs a new <Code>UnsignedIntArrayList</Code> with a * default initial capacity. */ /** * Constructs a new <Code>UnsignedIntArrayList</Code> with the * specified initial capacity. * * @param capacity the capacity for this list * @throws IllegalArgumentException if the given capacity is less than * or equal to zero */ if (capacity <= 0) { throw new IllegalArgumentException("capacity=" + capacity); } /** * The maximum possible unsigned 32-bit value. */ /** * The minimum possible unsigned 32-bit value. */
0
* A host was registered with the server. */ HOST_REGISTERED, /**
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.ipojo.runtime.core.components; import org.apache.felix.ipojo.configuration.Configuration; import org.apache.felix.ipojo.configuration.Instance; import java.util.Properties; import static org.apache.felix.ipojo.configuration.Instance.instance; /** * Simple configuration */ @Configuration public class ConfigureTwoInstancesWithOverridding extends ParentConfiguration { // Declare an instance of MyComponent named myInstance Instance myInstance1 = instance().of(MyComponent.class) .with("floating").setto("1.0") .with("message").setto("foo") .with("bool").setto(true) .with("number").setto(1l) .with("integer").setto(1) .with("props").setto(new Properties()); protected Instance myInstance2 = instance().of(MyComponent.class) .named("hello-over") .with("floating").setto("1.0") .with("message").setto("foo") .with("bool").setto(true) .with("number").setto(1l) .with("integer").setto(1) .with("props").setto(new Properties()); }
0
import org.apache.aurora.scheduler.cron.quartz.CronModule; // TODO(Suman Karumuri): Pass in AUTH as extra module modules.add(Modules.wrapInPrivateModule(AUTH_MODULE.get(), AUTH_MODULE_CLASSES)); .add(new CronModule())
0
* @since Commons IO 2.0 * @since Commons IO 2.0
0
ServletContextHelper.class.getName(),
0
import org.apache.aurora.common.stats.StatsProvider; import org.apache.aurora.common.util.Clock; import org.apache.aurora.common.util.testing.FakeClock;
0
import org.apache.beam.sdk.values.TypeDescriptor; @Test public void testGenericStandardCoderFallsBackToT() throws Exception { Assert.assertThat( new Foo<String>().getEncodedTypeDescriptor().getType(), CoreMatchers.not(TypeDescriptor.of(String.class).getType())); } @Test public void testGenericStandardCoder() throws Exception { Assert.assertThat(new FooTwo().getEncodedTypeDescriptor(), CoreMatchers.equalTo(TypeDescriptor.of(String.class))); } private static class Foo<T> extends StandardCoder<T> { @Override public void encode(T value, OutputStream outStream, Coder.Context context) throws CoderException, IOException { throw new UnsupportedOperationException(); } @Override public T decode(InputStream inStream, Coder.Context context) throws CoderException, IOException { throw new UnsupportedOperationException(); } @Override public List<? extends Coder<?>> getCoderArguments() { throw new UnsupportedOperationException(); } @Override public void verifyDeterministic() throws Coder.NonDeterministicException {} } private static class FooTwo extends Foo<String> { }
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
String NO_OPTIONS_VALUE = "none"; if (NO_OPTIONS_VALUE.equalsIgnoreCase(propValue)) { return false; }
0
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
0
import javax.persistence.LockModeType; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; public WidgetLayoutEntity mergeWithFlush(WidgetLayoutEntity widgetLayoutEntity) { EntityManager entityManager = entityManagerProvider.get(); widgetLayoutEntity = entityManager.merge(widgetLayoutEntity); entityManager.flush(); return widgetLayoutEntity; } @Transactional
0