method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setHighFreeMemoryColor(Color c) { freeColors[0] = c; }
void function(Color c) { freeColors[0] = c; }
/** * Sets the high free memory block color. */
Sets the high free memory block color
setHighFreeMemoryColor
{ "repo_name": "gmessner/ajf", "path": "src/main/java/com/messners/ajf/ui/MemoryMonitor.java", "license": "mit", "size": 16268 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
149,851
if (!Strings.isNullOrEmpty(emails)) { String[] recipients = StringUtils.split(emails, " "); for (String email : recipients) { FormValidation validation = validateInternetAddress(email); if (validation != FormValidation.ok()) { return validation; } } } return FormValidation.ok(); }
if (!Strings.isNullOrEmpty(emails)) { String[] recipients = StringUtils.split(emails, " "); for (String email : recipients) { FormValidation validation = validateInternetAddress(email); if (validation != FormValidation.ok()) { return validation; } } } return FormValidation.ok(); }
/** * Validates a space separated list of emails. * * @param emails Space separated list of emails * @return {@link hudson.util.FormValidation.ok()} if valid or empty, error otherwise */
Validates a space separated list of emails
validateEmails
{ "repo_name": "jglick/artifactory-plugin", "path": "src/main/java/org/jfrog/hudson/util/FormValidations.java", "license": "apache-2.0", "size": 1881 }
[ "com.google.common.base.Strings", "hudson.util.FormValidation", "org.apache.commons.lang.StringUtils" ]
import com.google.common.base.Strings; import hudson.util.FormValidation; import org.apache.commons.lang.StringUtils;
import com.google.common.base.*; import hudson.util.*; import org.apache.commons.lang.*;
[ "com.google.common", "hudson.util", "org.apache.commons" ]
com.google.common; hudson.util; org.apache.commons;
2,486,530
protected Partition createPartition(List nodes) { // increment the ID counter before getting the ID this.incrementIDCounter(); String id = getPartitionID(this.idCounter()); Partition p = new Partition(nodes, id); p.setIndex(this.idCounter()); p.constructPartition(); mPartitionMap.put(p.getID(), p); // associate the ID with all the nodes for (Iterator it = nodes.iterator(); it.hasNext(); ) { GraphNode node = (GraphNode) it.next(); Bag b = new LabelBag(); b.add(LabelBag.PARTITION_KEY, id); node.setBag(b); } // log a message StringBuffer message = new StringBuffer(); message.append("Partition ").append(p.getID()).append(" is :").append(p.getNodeIDs()); mLogger.log(message.toString(), LogManager.DEBUG_MESSAGE_LEVEL); return p; }
Partition function(List nodes) { this.incrementIDCounter(); String id = getPartitionID(this.idCounter()); Partition p = new Partition(nodes, id); p.setIndex(this.idCounter()); p.constructPartition(); mPartitionMap.put(p.getID(), p); for (Iterator it = nodes.iterator(); it.hasNext(); ) { GraphNode node = (GraphNode) it.next(); Bag b = new LabelBag(); b.add(LabelBag.PARTITION_KEY, id); node.setBag(b); } StringBuffer message = new StringBuffer(); message.append(STR).append(p.getID()).append(STR).append(p.getNodeIDs()); mLogger.log(message.toString(), LogManager.DEBUG_MESSAGE_LEVEL); return p; }
/** * Creates a partition out of a list of nodes. Also stores it in the internal partition map to * track partitions later on. Associates the partition ID with each of the nodes making the * partition also. * * @param nodes the list of <code>GraphNodes</code> making the partition. * @return the partition out of those nodes. */
Creates a partition out of a list of nodes. Also stores it in the internal partition map to track partitions later on. Associates the partition ID with each of the nodes making the partition also
createPartition
{ "repo_name": "pegasus-isi/pegasus", "path": "src/edu/isi/pegasus/planner/partitioner/Horizontal.java", "license": "apache-2.0", "size": 15898 }
[ "edu.isi.pegasus.common.logging.LogManager", "edu.isi.pegasus.planner.partitioner.graph.Bag", "edu.isi.pegasus.planner.partitioner.graph.GraphNode", "edu.isi.pegasus.planner.partitioner.graph.LabelBag", "java.util.Iterator", "java.util.List" ]
import edu.isi.pegasus.common.logging.LogManager; import edu.isi.pegasus.planner.partitioner.graph.Bag; import edu.isi.pegasus.planner.partitioner.graph.GraphNode; import edu.isi.pegasus.planner.partitioner.graph.LabelBag; import java.util.Iterator; import java.util.List;
import edu.isi.pegasus.common.logging.*; import edu.isi.pegasus.planner.partitioner.graph.*; import java.util.*;
[ "edu.isi.pegasus", "java.util" ]
edu.isi.pegasus; java.util;
2,883,865
public OutputSettings charset(Charset charset) { charsetName = charset.name(); return this; }
OutputSettings function(Charset charset) { charsetName = charset.name(); return this; }
/** * Update the document's output charset. * @param charset the new charset to use. * @return the document's output settings, for chaining */
Update the document's output charset
charset
{ "repo_name": "kawasima/moshas", "path": "moshas/src/main/java/net/unit8/moshas/dom/Document.java", "license": "apache-2.0", "size": 12713 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
1,979,203
public boolean verify(Properties conf) throws UnsupportedEncodingException { if (this.validity != null) return(this.validity); Boolean skipSign = Boolean.valueOf(conf.getProperty("SKIP_VERIFY_NOTIFY_SIGN")); // else this.validity = true; if (!skipSign) this.validity = this.validity && this.verifySign(conf); return(this.validity); }
boolean function(Properties conf) throws UnsupportedEncodingException { if (this.validity != null) return(this.validity); Boolean skipSign = Boolean.valueOf(conf.getProperty(STR)); this.validity = true; if (!skipSign) this.validity = this.validity && this.verifySign(conf); return(this.validity); }
/** * verify response sign * @return true if passed (i.e. response content should be trusted), otherwise false */
verify response sign
verify
{ "repo_name": "devulmsale/agriDev", "path": "app/ext/pay/weixin/v3/resps/ResponseBase.java", "license": "gpl-2.0", "size": 6461 }
[ "java.io.UnsupportedEncodingException", "java.util.Properties" ]
import java.io.UnsupportedEncodingException; import java.util.Properties;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,399,785
public boolean shouldExecute() { return EntityShulker.this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL ? false : super.shouldExecute(); }
boolean function() { return EntityShulker.this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL ? false : super.shouldExecute(); }
/** * Returns whether the EntityAIBase should begin execution. */
Returns whether the EntityAIBase should begin execution
shouldExecute
{ "repo_name": "danielyc/test-1.9.4", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/monster/EntityShulker.java", "license": "gpl-3.0", "size": 28144 }
[ "net.minecraft.world.EnumDifficulty" ]
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
1,552,784
public static <TItem> Bson all(final String fieldName, final TItem... values) { return all(fieldName, asList(values)); }
static <TItem> Bson function(final String fieldName, final TItem... values) { return all(fieldName, asList(values)); }
/** * Creates a filter that matches all documents where the value of a field is an array that contains all the specified values. * * @param fieldName the field name * @param values the list of values * @param <TItem> the value type * @return the filter * @mongodb.driver.manual reference/operator/query/all $all */
Creates a filter that matches all documents where the value of a field is an array that contains all the specified values
all
{ "repo_name": "gianpaj/mongo-java-driver", "path": "driver-core/src/main/com/mongodb/client/model/Filters.java", "license": "apache-2.0", "size": 42343 }
[ "java.util.Arrays", "org.bson.conversions.Bson" ]
import java.util.Arrays; import org.bson.conversions.Bson;
import java.util.*; import org.bson.conversions.*;
[ "java.util", "org.bson.conversions" ]
java.util; org.bson.conversions;
1,579,184
T visitStreamSource(@NotNull CQLParser.StreamSourceContext ctx);
T visitStreamSource(@NotNull CQLParser.StreamSourceContext ctx);
/** * Visit a parse tree produced by {@link CQLParser#streamSource}. */
Visit a parse tree produced by <code>CQLParser#streamSource</code>
visitStreamSource
{ "repo_name": "HuaweiBigData/StreamCQL", "path": "cql/src/main/java/com/huawei/streaming/cql/semanticanalyzer/parser/CQLParserVisitor.java", "license": "apache-2.0", "size": 29279 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
2,161,099
public void testPush() { try { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); for (int i = 0; i < SIZE; ++i) { Integer x = new Integer(i); q.push(x); assertEquals(x, q.peek()); } assertEquals(0, q.remainingCapacity()); q.push(new Integer(SIZE)); shouldThrow(); } catch (IllegalStateException success) {} }
void function() { try { LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE); for (int i = 0; i < SIZE; ++i) { Integer x = new Integer(i); q.push(x); assertEquals(x, q.peek()); } assertEquals(0, q.remainingCapacity()); q.push(new Integer(SIZE)); shouldThrow(); } catch (IllegalStateException success) {} }
/** * push succeeds if not full; throws ISE if full */
push succeeds if not full; throws ISE if full
testPush
{ "repo_name": "AdmireTheDistance/android_libcore", "path": "jsr166-tests/src/test/java/jsr166/LinkedBlockingDequeTest.java", "license": "gpl-2.0", "size": 59941 }
[ "java.util.concurrent.LinkedBlockingDeque" ]
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,607,475
BigInteger size();
BigInteger size();
/** * Returns the size of this sequence. * * @return the size of this sequence. */
Returns the size of this sequence
size
{ "repo_name": "iddqdby/PassCracker", "path": "src/main/java/by/iddqd/passcracker/sequence/PassSequence.java", "license": "gpl-3.0", "size": 1814 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
1,842,032
public void deleteProvenanceQuery(final String provenanceId) { // get the query to the provenance repository final ProvenanceRepository provenanceRepository = flowController.getProvenanceRepository(); final QuerySubmission querySubmission = provenanceRepository.retrieveQuerySubmission(provenanceId, NiFiUserUtils.getNiFiUser()); if (querySubmission != null) { querySubmission.cancel(); } }
void function(final String provenanceId) { final ProvenanceRepository provenanceRepository = flowController.getProvenanceRepository(); final QuerySubmission querySubmission = provenanceRepository.retrieveQuerySubmission(provenanceId, NiFiUserUtils.getNiFiUser()); if (querySubmission != null) { querySubmission.cancel(); } }
/** * Deletes the query with the specified id. * * @param provenanceId id */
Deletes the query with the specified id
deleteProvenanceQuery
{ "repo_name": "InspurUSA/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java", "license": "apache-2.0", "size": 86923 }
[ "org.apache.nifi.authorization.user.NiFiUserUtils", "org.apache.nifi.provenance.ProvenanceRepository", "org.apache.nifi.provenance.search.QuerySubmission" ]
import org.apache.nifi.authorization.user.NiFiUserUtils; import org.apache.nifi.provenance.ProvenanceRepository; import org.apache.nifi.provenance.search.QuerySubmission;
import org.apache.nifi.authorization.user.*; import org.apache.nifi.provenance.*; import org.apache.nifi.provenance.search.*;
[ "org.apache.nifi" ]
org.apache.nifi;
1,286,763
public int key() throws ConcurrentModificationException, NoSuchElementException { if (referenceCount != count) { throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating"); } if (current < 0) { throw MathRuntimeException.createNoSuchElementException("iterator exhausted"); } return keys[current]; }
int function() throws ConcurrentModificationException, NoSuchElementException { if (referenceCount != count) { throw MathRuntimeException.createConcurrentModificationException(STR); } if (current < 0) { throw MathRuntimeException.createNoSuchElementException(STR); } return keys[current]; }
/** * Get the key of current entry. * @return key of current entry * @exception ConcurrentModificationException if the map is modified during iteration * @exception NoSuchElementException if there is no element left in the map */
Get the key of current entry
key
{ "repo_name": "SpoonLabs/astor", "path": "examples/Math-issue-288/src/main/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java", "license": "gpl-2.0", "size": 18938 }
[ "java.util.ConcurrentModificationException", "java.util.NoSuchElementException", "org.apache.commons.math.MathRuntimeException" ]
import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; import org.apache.commons.math.MathRuntimeException;
import java.util.*; import org.apache.commons.math.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
1,530,779
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<EncryptionScopeInner>> getWithResponseAsync( String resourceGroupName, String accountName, String encryptionScopeName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (encryptionScopeName == null) { return Mono .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<EncryptionScopeInner>> function( String resourceGroupName, String accountName, String encryptionScopeName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (accountName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (encryptionScopeName == null) { return Mono .error(new IllegalArgumentException(STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context); }
/** * Returns the properties for the specified encryption scope. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names * must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) * only. Every dash (-) character must be immediately preceded and followed by a letter or number. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Encryption Scope resource along with {@link Response} on successful completion of {@link Mono}. */
Returns the properties for the specified encryption scope
getWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/EncryptionScopesClientImpl.java", "license": "mit", "size": 57678 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
573,489
public StateModelFactory<? extends StateModel> getStateModelFactory(String stateModelName);
StateModelFactory<? extends StateModel> function(String stateModelName);
/** * Get a default state model factory for a state model definition. * @param stateModelName * @return */
Get a default state model factory for a state model definition
getStateModelFactory
{ "repo_name": "kongweihan/helix", "path": "helix-core/src/main/java/org/apache/helix/participant/StateMachineEngine.java", "license": "apache-2.0", "size": 3037 }
[ "org.apache.helix.participant.statemachine.StateModel", "org.apache.helix.participant.statemachine.StateModelFactory" ]
import org.apache.helix.participant.statemachine.StateModel; import org.apache.helix.participant.statemachine.StateModelFactory;
import org.apache.helix.participant.statemachine.*;
[ "org.apache.helix" ]
org.apache.helix;
886,212
void setDelegates(Map<K, V> forward, Map<V, K> backward) { checkState(delegate == null); checkState(inverse == null); checkArgument(forward.isEmpty()); checkArgument(backward.isEmpty()); checkArgument(forward != backward); delegate = forward; inverse = makeInverse(backward); }
void setDelegates(Map<K, V> forward, Map<V, K> backward) { checkState(delegate == null); checkState(inverse == null); checkArgument(forward.isEmpty()); checkArgument(backward.isEmpty()); checkArgument(forward != backward); delegate = forward; inverse = makeInverse(backward); }
/** * Specifies the delegate maps going in each direction. Called by the * constructor and by subclasses during deserialization. */
Specifies the delegate maps going in each direction. Called by the constructor and by subclasses during deserialization
setDelegates
{ "repo_name": "DavesMan/guava", "path": "guava/src/com/google/common/collect/AbstractBiMap.java", "license": "apache-2.0", "size": 13018 }
[ "com.google.common.base.Preconditions", "java.util.Map" ]
import com.google.common.base.Preconditions; import java.util.Map;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
365,393
public Builder putAllExtraParam(Map<String, Object> map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } }
Builder function(Map<String, Object> map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } }
/** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link SubscriptionItemRetrieveParams#extraParams} for the field documentation. */
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See <code>SubscriptionItemRetrieveParams#extraParams</code> for the field documentation
putAllExtraParam
{ "repo_name": "stripe/stripe-java", "path": "src/main/java/com/stripe/param/SubscriptionItemRetrieveParams.java", "license": "mit", "size": 3463 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,449,361
Set<String> getAllQueuesInSubmittedSlots() throws AndesException;
Set<String> getAllQueuesInSubmittedSlots() throws AndesException;
/** * Get all queue names for which messages are published * @return Set of queue names * @throws AndesException */
Get all queue names for which messages are published
getAllQueuesInSubmittedSlots
{ "repo_name": "prabathariyaratna/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/AndesContextStore.java", "license": "apache-2.0", "size": 21458 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,599,005
public void actionPerformed(ActionEvent e) { if ((delegate != null) && (getTarget() != null)) { delegate.actionPerformed(new ActionEvent(getTarget(), ActionEvent.ACTION_PERFORMED, VISIT_ACTION)); } }
void function(ActionEvent e) { if ((delegate != null) && (getTarget() != null)) { delegate.actionPerformed(new ActionEvent(getTarget(), ActionEvent.ACTION_PERFORMED, VISIT_ACTION)); } }
/** * This action delegates to the visitingDelegate if both * delegate and target are != null, does nothing otherwise. * The actionEvent carries the target as source. * * PENDING: pass through a null target? - most probably! * * * */
This action delegates to the visitingDelegate if both delegate and target are != null, does nothing otherwise. The actionEvent carries the target as source
actionPerformed
{ "repo_name": "sing-group/aibench-project", "path": "aibench-pluginmanager/src/main/java/org/jdesktop/swingx/hyperlink/LinkModelAction.java", "license": "lgpl-3.0", "size": 5487 }
[ "java.awt.event.ActionEvent" ]
import java.awt.event.ActionEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
747,077
@ApiResponses( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}/{format}") @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) void removeFormat( @NotNull @PathParam("key") String key, @NotNull @PathParam("format") MailTemplateFormat format);
@ApiResponses( @ApiResponse(responseCode = "204", description = STR)) @Path(STR) @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) void removeFormat( @NotNull @PathParam("key") String key, @NotNull @PathParam(STR) MailTemplateFormat format);
/** * Removes the template for the given key and format, if available. * * @param key mail template * @param format template format */
Removes the template for the given key and format, if available
removeFormat
{ "repo_name": "apache/syncope", "path": "common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java", "license": "apache-2.0", "size": 5809 }
[ "io.swagger.v3.oas.annotations.responses.ApiResponse", "io.swagger.v3.oas.annotations.responses.ApiResponses", "javax.validation.constraints.NotNull", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "org.apache.syncope.common.lib.types.MailTemplateFormat", "org.apache.syncope.common.rest.api.RESTHeaders" ]
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import javax.validation.constraints.NotNull; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.apache.syncope.common.lib.types.MailTemplateFormat; import org.apache.syncope.common.rest.api.RESTHeaders;
import io.swagger.v3.oas.annotations.responses.*; import javax.validation.constraints.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.syncope.common.lib.types.*; import org.apache.syncope.common.rest.api.*;
[ "io.swagger.v3", "javax.validation", "javax.ws", "org.apache.syncope" ]
io.swagger.v3; javax.validation; javax.ws; org.apache.syncope;
2,532,960
private void handleException(Throwable throwable) { checkNotNull(throwable); if (allMustSucceed) { // As soon as the first one fails, make that failure the result of the output future. // The results of all other inputs are then ignored (except for logging any failures). boolean completedWithFailure = setException(throwable); if (!completedWithFailure) { // Go up the causal chain to see if we've already seen this cause; if we have, even if // it's wrapped by a different exception, don't log it. boolean firstTimeSeeingThisException = addCausalChain(getOrInitSeenExceptions(), throwable); if (firstTimeSeeingThisException) { log(throwable); return; } } } if (throwable instanceof Error) { log(throwable); } }
void function(Throwable throwable) { checkNotNull(throwable); if (allMustSucceed) { boolean completedWithFailure = setException(throwable); if (!completedWithFailure) { boolean firstTimeSeeingThisException = addCausalChain(getOrInitSeenExceptions(), throwable); if (firstTimeSeeingThisException) { log(throwable); return; } } } if (throwable instanceof Error) { log(throwable); } }
/** * Fails this future with the given Throwable if {@link #allMustSucceed} is true. Also, logs the * throwable if it is an {@link Error} or if {@link #allMustSucceed} is {@code true}, the * throwable did not cause this future to fail, and it is the first time we've seen that * particular Throwable. */
Fails this future with the given Throwable if <code>#allMustSucceed</code> is true. Also, logs the throwable if it is an <code>Error</code> or if <code>#allMustSucceed</code> is true, the throwable did not cause this future to fail, and it is the first time we've seen that particular Throwable
handleException
{ "repo_name": "typetools/guava", "path": "android/guava/src/com/google/common/util/concurrent/AggregateFuture.java", "license": "apache-2.0", "size": 14449 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,629,606
public void setHivaidsassistance(final MedicalassistanceHivaidsassistanceEnum hivaidsassistance) { this.hivaidsassistance = hivaidsassistance; }
void function(final MedicalassistanceHivaidsassistanceEnum hivaidsassistance) { this.hivaidsassistance = hivaidsassistance; }
/** * Set the value related to the column: hivaidsassistance. * @param hivaidsassistance the hivaidsassistance value you wish to set */
Set the value related to the column: hivaidsassistance
setHivaidsassistance
{ "repo_name": "servinglynk/hmis-lynk-open-source", "path": "hmis-model-v2014/src/main/java/com/servinglynk/hmis/warehouse/model/v2014/Medicalassistance.java", "license": "mpl-2.0", "size": 12580 }
[ "com.servinglynk.hmis.warehouse.enums.MedicalassistanceHivaidsassistanceEnum" ]
import com.servinglynk.hmis.warehouse.enums.MedicalassistanceHivaidsassistanceEnum;
import com.servinglynk.hmis.warehouse.enums.*;
[ "com.servinglynk.hmis" ]
com.servinglynk.hmis;
1,467,831
@Check public void checkSpecification(final Specification s) { // // Get Validation Errors if exists: // final URI eUri = s.eResource().getURI(); final String platformString = eUri.toPlatformString(true); final String key = ResourcesPlugin.getWorkspace().getRoot().findMember(platformString).getFullPath().toString(); Map<String, String> err = null; if (null != key) { err = DPFTextJavaValidator.validationErrors.get(key); } try { // Homo and types: final String path = CommonUtil.eObject2IFile(s).getParent().getFullPath().toString(); final List<Tuple<EObject, String>> rs = DPFTextCore.read(s, path, ".temp<**"); for (Tuple<EObject, String> t : rs) { if (!t.y.equals("")) { error(t.y, t.x, null, null); } } // OCL: for (Element e : s.getGraph().getElements()) { if (e instanceof Node) { final Node n = (Node) e; try { setValidationErrMsg(n.getId(), err); } catch (Exception ex) { } if (null != n.getInh()) { for (NodeSimple sn : n.getInh()) { try { setValidationErrMsg(sn.getId(), err); } catch (Exception ex) { } } for (Property p : n.getProperties()) { try { setValidationErrMsg(p.getId(), err); } catch (Exception ex) { } try { setValidationErrMsg(p.getTgNode().getId(), err); } catch (Exception ex) { } } } } if (e instanceof Arrow) { try { final Arrow a = (Arrow)e; setValidationErrMsg(a.getSr().getId(), err); setValidationErrMsg(e.getId(), err); setValidationErrMsg(a.getTgNode().getId(), err); } catch (Exception ex) { } } } } catch (Exception e) { // e.printStackTrace(); System.out.println("Specification not inited:" + e.getMessage()); return; // not inited yet } }
void function(final Specification s) { final String platformString = eUri.toPlatformString(true); final String key = ResourcesPlugin.getWorkspace().getRoot().findMember(platformString).getFullPath().toString(); Map<String, String> err = null; if (null != key) { err = DPFTextJavaValidator.validationErrors.get(key); } try { final String path = CommonUtil.eObject2IFile(s).getParent().getFullPath().toString(); final List<Tuple<EObject, String>> rs = DPFTextCore.read(s, path, STR); for (Tuple<EObject, String> t : rs) { if (!t.y.equals(STRSpecification not inited:" + e.getMessage()); return; } }
/** * Annotate all elements of a specification with its error messages. * @param s */
Annotate all elements of a specification with its error messages
checkSpecification
{ "repo_name": "fmantz/DPF_Text", "path": "no.hib.dpf.text/src/no/hib/dpf/text/validation/DPFTextJavaValidator.java", "license": "epl-1.0", "size": 6283 }
[ "java.util.List", "java.util.Map", "no.hib.dpf.text.scala.DPFTextCore", "no.hib.dpf.text.tdpf.Specification", "no.hib.dpf.text.util.CommonUtil", "no.hib.dpf.text.util.Tuple", "org.eclipse.core.resources.ResourcesPlugin", "org.eclipse.emf.ecore.EObject" ]
import java.util.List; import java.util.Map; import no.hib.dpf.text.scala.DPFTextCore; import no.hib.dpf.text.tdpf.Specification; import no.hib.dpf.text.util.CommonUtil; import no.hib.dpf.text.util.Tuple; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.emf.ecore.EObject;
import java.util.*; import no.hib.dpf.text.scala.*; import no.hib.dpf.text.tdpf.*; import no.hib.dpf.text.util.*; import org.eclipse.core.resources.*; import org.eclipse.emf.ecore.*;
[ "java.util", "no.hib.dpf", "org.eclipse.core", "org.eclipse.emf" ]
java.util; no.hib.dpf; org.eclipse.core; org.eclipse.emf;
465,604
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> beginCreateOrUpdate( String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> beginCreateOrUpdate( String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
/** * Creates or updates an application security group. * * @param resourceGroupName The name of the resource group. * @param applicationSecurityGroupName The name of the application security group. * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of an application security group in a resource group. */
Creates or updates an application security group
beginCreateOrUpdate
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java", "license": "mit", "size": 25248 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.SyncPoller", "com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,594,527
public void register(Callbacks callbacks, Activity activity) { if (checkPlayServices(activity)) { mGcm = GoogleCloudMessaging.getInstance(mContext); mSession.setPushId(getRegistrationId(mContext)); if (mSession.getPushId() == null || mSession.getPushId().isEmpty()) { registerInBackground(callbacks); } else { callbacks.onRegister(mSession); } } else { Log.i(TAG, "No valid Google Play Services APK found."); } }
void function(Callbacks callbacks, Activity activity) { if (checkPlayServices(activity)) { mGcm = GoogleCloudMessaging.getInstance(mContext); mSession.setPushId(getRegistrationId(mContext)); if (mSession.getPushId() == null mSession.getPushId().isEmpty()) { registerInBackground(callbacks); } else { callbacks.onRegister(mSession); } } else { Log.i(TAG, STR); } }
/** * Register device id to back-end for GCM service */
Register device id to back-end for GCM service
register
{ "repo_name": "pablo-co/insight-android-base-library", "path": "app/src/main/java/edu/mit/lastmite/insight_library/util/GcmRegistration.java", "license": "mit", "size": 6445 }
[ "android.app.Activity", "android.util.Log", "com.google.android.gms.gcm.GoogleCloudMessaging" ]
import android.app.Activity; import android.util.Log; import com.google.android.gms.gcm.GoogleCloudMessaging;
import android.app.*; import android.util.*; import com.google.android.gms.gcm.*;
[ "android.app", "android.util", "com.google.android" ]
android.app; android.util; com.google.android;
865,838
default void forEachRemaining(DoubleConsumer action) { Objects.requireNonNull(action); while (hasNext()) action.accept(nextDouble()); } /** * {@inheritDoc}
default void forEachRemaining(DoubleConsumer action) { Objects.requireNonNull(action); while (hasNext()) action.accept(nextDouble()); } /** * {@inheritDoc}
/** * Performs the given action for each remaining element until all elements * have been processed or the action throws an exception. Actions are * performed in the order of iteration, if that order is specified. * Exceptions thrown by the action are relayed to the caller. * * @implSpec * <p>The default implementation behaves as if: * <pre>{@code * while (hasNext()) * action.accept(nextDouble()); * }</pre> * * @param action The action to be performed for each element * @throws NullPointerException if the specified action is null */
Performs the given action for each remaining element until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller
forEachRemaining
{ "repo_name": "flyzsd/java-code-snippets", "path": "ibm.jdk8/src/java/util/PrimitiveIterator.java", "license": "mit", "size": 11733 }
[ "java.util.function.DoubleConsumer" ]
import java.util.function.DoubleConsumer;
import java.util.function.*;
[ "java.util" ]
java.util;
1,376,354
public PrincipalAlias getPrincipalAlias(Long aliasId) throws NotFoundException;
PrincipalAlias function(Long aliasId) throws NotFoundException;
/** * Get a principal alias by its id. * @param aliasId * @return * @throws NotFoundException */
Get a principal alias by its id
getPrincipalAlias
{ "repo_name": "hhu94/Synapse-Repository-Services", "path": "lib/models/src/main/java/org/sagebionetworks/repo/model/principal/PrincipalAliasDAO.java", "license": "apache-2.0", "size": 3764 }
[ "org.sagebionetworks.repo.web.NotFoundException" ]
import org.sagebionetworks.repo.web.NotFoundException;
import org.sagebionetworks.repo.web.*;
[ "org.sagebionetworks.repo" ]
org.sagebionetworks.repo;
540,174
public boolean sendDirect(Identifier i, ByteBuffer msg, Map<String,Object> options);
boolean function(Identifier i, ByteBuffer msg, Map<String,Object> options);
/** * True if we believe the firewall will accept the message (due to a recent message from the node) * @param i * @return */
True if we believe the firewall will accept the message (due to a recent message from the node)
sendDirect
{ "repo_name": "barnyard/pi", "path": "freepastry/src/org/mpisws/p2p/transport/rendezvous/ResponseStrategy.java", "license": "apache-2.0", "size": 3028 }
[ "java.nio.ByteBuffer", "java.util.Map" ]
import java.nio.ByteBuffer; import java.util.Map;
import java.nio.*; import java.util.*;
[ "java.nio", "java.util" ]
java.nio; java.util;
174,397
public static boolean isAjaxRequest(HttpServletRequest request) { String header = request.getHeader("X-Requested-With"); return header != null && "XMLHttpRequest".equals(header); } private ControllerTools() { }
static boolean function(HttpServletRequest request) { String header = request.getHeader(STR); return header != null && STR.equals(header); } private ControllerTools() { }
/** * Determine whether the given request was made via an asynchronous request mechanism. Current * implementation works for prototype.js-initiated requests only. * * @param request */
Determine whether the given request was made via an asynchronous request mechanism. Current implementation works for prototype.js-initiated requests only
isAjaxRequest
{ "repo_name": "CBIIT/caaers", "path": "caAERS/software/web/src/main/java/gov/nih/nci/cabig/caaers/web/ControllerTools.java", "license": "bsd-3-clause", "size": 3198 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
712,282
public List<File> getFiles(final long size, final String ed2kHash, final FileMask fileMask, final AnimeFileMask animeFileMask) throws UdpConnectionException, AniDbException { return this.fileFactory.getFiles(size, ed2kHash, fileMask, animeFileMask); }
List<File> function(final long size, final String ed2kHash, final FileMask fileMask, final AnimeFileMask animeFileMask) throws UdpConnectionException, AniDbException { return this.fileFactory.getFiles(size, ed2kHash, fileMask, animeFileMask); }
/** * <p>Returns the files with the given size and ed2k hash.</p> * <p>Only the fields specified by the two masks will be filled.</p> * @param size The size. * @param ed2kHash The ed2k hash. * @param fileMask The file mask. * @param animeFileMask The anime file mask. * @return The files. * @throws IllegalArgumentException If the size is less than <code>1</code>. * @throws IllegalArgumentException If the ed2k hash is <code>null</code>. * @throws IllegalArgumentException If the file mask is <code>null</code>. * @throws IllegalArgumentException If the anime file mask is * <code>null</code>. * @throws UdpConnectionException If a connection problem occured. * @throws AniDbException If a problem with AniDB occured. * @see UdpReturnCodes#NO_SUCH_FILE */
Returns the files with the given size and ed2k hash. Only the fields specified by the two masks will be filled
getFiles
{ "repo_name": "derBeukatt/AniDBTool", "path": "src/net/anidb/udp/UdpConnection.java", "license": "gpl-3.0", "size": 45351 }
[ "java.util.List", "net.anidb.File", "net.anidb.udp.mask.AnimeFileMask", "net.anidb.udp.mask.FileMask" ]
import java.util.List; import net.anidb.File; import net.anidb.udp.mask.AnimeFileMask; import net.anidb.udp.mask.FileMask;
import java.util.*; import net.anidb.*; import net.anidb.udp.mask.*;
[ "java.util", "net.anidb", "net.anidb.udp" ]
java.util; net.anidb; net.anidb.udp;
454,131
@Test public void authenticateWithBasicAndCertCredentials() throws IOException { Http http = Http.builder().clientCertAuth(certCredentials).clientBasicAuth(trustedPasswordCredentials).build(); HttpRequestResponse response = http.execute(new HttpGet(url("/"))); assertThat(response.getStatusCode(), is(200)); assertThat(response.getResponseBody(), is("Hello World!")); }
void function() throws IOException { Http http = Http.builder().clientCertAuth(certCredentials).clientBasicAuth(trustedPasswordCredentials).build(); HttpRequestResponse response = http.execute(new HttpGet(url("/"))); assertThat(response.getStatusCode(), is(200)); assertThat(response.getResponseBody(), is(STR)); }
/** * Make sure the client can connect when supplying *both* BASIC and * certificate credentials. The server should simply ignore all * authentication credentials. */
Make sure the client can connect when supplying *both* BASIC and certificate credentials. The server should simply ignore all authentication credentials
authenticateWithBasicAndCertCredentials
{ "repo_name": "elastisys/scale.commons", "path": "net/src/test/java/com/elastisys/scale/commons/net/http/TestHttpBuilderClientOnServerRequiringNoAuth.java", "license": "apache-2.0", "size": 5098 }
[ "java.io.IOException", "org.apache.http.client.methods.HttpGet", "org.hamcrest.CoreMatchers", "org.junit.Assert" ]
import java.io.IOException; import org.apache.http.client.methods.HttpGet; import org.hamcrest.CoreMatchers; import org.junit.Assert;
import java.io.*; import org.apache.http.client.methods.*; import org.hamcrest.*; import org.junit.*;
[ "java.io", "org.apache.http", "org.hamcrest", "org.junit" ]
java.io; org.apache.http; org.hamcrest; org.junit;
40,337
@Test public void deleteWithEscapedMappedQueryParams() throws Exception { Map<String, String> inputParams = new HashMap<String, String>(); inputParams.put("name", "us er"); inputParams.put("number", "100"); final Map<String, String> outputParams = new HashMap<String, String>(); final AtomicReference<String> method = new AtomicReference<String>(); handler = new RequestHandler() {
void function() throws Exception { Map<String, String> inputParams = new HashMap<String, String>(); inputParams.put("name", STR); inputParams.put(STR, "100"); final Map<String, String> outputParams = new HashMap<String, String>(); final AtomicReference<String> method = new AtomicReference<String>(); handler = new RequestHandler() {
/** * Verify DELETE with escaped query parameters * * @throws Exception */
Verify DELETE with escaped query parameters
deleteWithEscapedMappedQueryParams
{ "repo_name": "jiripetrlik/droolsjbpm-integration", "path": "kie-remote/kie-remote-common/src/test/java/org/kie/remote/common/rest/KieRemoteHttpRequestTest.java", "license": "apache-2.0", "size": 77298 }
[ "java.util.HashMap", "java.util.Map", "java.util.concurrent.atomic.AtomicReference" ]
import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference;
import java.util.*; import java.util.concurrent.atomic.*;
[ "java.util" ]
java.util;
1,765,915
@JsonGetter("productCheckoutList") public List<ProductCheckoutModel> getProductCheckoutList ( ) { return this.productCheckoutList; }
@JsonGetter(STR) List<ProductCheckoutModel> function ( ) { return this.productCheckoutList; }
/** GETTER * The list of individual product checkout results */
GETTER The list of individual product checkout results
getProductCheckoutList
{ "repo_name": "voxbone/voxapi-client-java", "path": "APIv3SandboxLib/src/com/voxbone/sandbox/models/CartCheckoutModel.java", "license": "mit", "size": 1303 }
[ "com.fasterxml.jackson.annotation.JsonGetter", "java.util.List" ]
import com.fasterxml.jackson.annotation.JsonGetter; import java.util.List;
import com.fasterxml.jackson.annotation.*; import java.util.*;
[ "com.fasterxml.jackson", "java.util" ]
com.fasterxml.jackson; java.util;
1,469,896
public String getConfigValue(String propertyName, String defaultValue) throws SentryUserException { TSentryConfigValueRequest request = new TSentryConfigValueRequest( ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT, propertyName); if (defaultValue != null) { request.setDefaultValue(defaultValue); } try { TSentryConfigValueResponse response = client.get_sentry_config_value(request); Status.throwIfNotOk(response.getStatus()); return response.getValue(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }
String function(String propertyName, String defaultValue) throws SentryUserException { TSentryConfigValueRequest request = new TSentryConfigValueRequest( ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT, propertyName); if (defaultValue != null) { request.setDefaultValue(defaultValue); } try { TSentryConfigValueResponse response = client.get_sentry_config_value(request); Status.throwIfNotOk(response.getStatus()); return response.getValue(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }
/** * Returns the configuration value in the sentry server associated with * propertyName, or if propertyName does not exist, the defaultValue. * There is no "requestorUserName" because this is regarded as an * internal interface. * @param propertyName Config attribute to search for * @param defaultValue String to return if not found * @return The value of the propertyName * @throws SentryUserException */
Returns the configuration value in the sentry server associated with propertyName, or if propertyName does not exist, the defaultValue. There is no "requestorUserName" because this is regarded as an internal interface
getConfigValue
{ "repo_name": "cloudera/sentry-solr-integration", "path": "sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyServiceClient.java", "license": "apache-2.0", "size": 34202 }
[ "org.apache.sentry.SentryUserException", "org.apache.sentry.service.thrift.ServiceConstants", "org.apache.sentry.service.thrift.Status", "org.apache.thrift.TException" ]
import org.apache.sentry.SentryUserException; import org.apache.sentry.service.thrift.ServiceConstants; import org.apache.sentry.service.thrift.Status; import org.apache.thrift.TException;
import org.apache.sentry.*; import org.apache.sentry.service.thrift.*; import org.apache.thrift.*;
[ "org.apache.sentry", "org.apache.thrift" ]
org.apache.sentry; org.apache.thrift;
1,570,090
public void startDelayed(int seconds) throws SchedulerException { invoke("startDelayed", new Object[] {seconds}, new String[] {int.class.getName()}); }
void function(int seconds) throws SchedulerException { invoke(STR, new Object[] {seconds}, new String[] {int.class.getName()}); }
/** * <p> * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>. * </p> */
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
startDelayed
{ "repo_name": "xqiang26/quartz-source-node", "path": "src/main/java/org/quartz/impl/RemoteMBeanScheduler.java", "license": "apache-2.0", "size": 31863 }
[ "org.quartz.SchedulerException" ]
import org.quartz.SchedulerException;
import org.quartz.*;
[ "org.quartz" ]
org.quartz;
2,290,724
private void ensureCapacity(int minCapacity) { long currentCapacity = data.length; if (minCapacity <= currentCapacity) { return; } // increase capacity by at least ~50% long expandedCapacity = Math.max(minCapacity, currentCapacity + (currentCapacity >> 1)); int newCapacity = (int) Math.min(MAX_ARRAY_SIZE, expandedCapacity); if (newCapacity < minCapacity) { // throw exception as unbounded arrays are not expected to fill throw new RuntimeException("Requested array size " + minCapacity + " exceeds limit of " + MAX_ARRAY_SIZE); } data = Arrays.copyOf(data, newCapacity); }
void function(int minCapacity) { long currentCapacity = data.length; if (minCapacity <= currentCapacity) { return; } long expandedCapacity = Math.max(minCapacity, currentCapacity + (currentCapacity >> 1)); int newCapacity = (int) Math.min(MAX_ARRAY_SIZE, expandedCapacity); if (newCapacity < minCapacity) { throw new RuntimeException(STR + minCapacity + STR + MAX_ARRAY_SIZE); } data = Arrays.copyOf(data, newCapacity); }
/** * If the size of the array is insufficient to hold the given capacity then * copy the array into a new, larger array. * * @param minCapacity minimum required number of elements */
If the size of the array is insufficient to hold the given capacity then copy the array into a new, larger array
ensureCapacity
{ "repo_name": "hequn8128/flink", "path": "flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/types/valuearray/DoubleValueArray.java", "license": "apache-2.0", "size": 10061 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,587,341
public void update(EventBean[] newData, EventBean[] oldData) { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".update Received update, " + " newData.length==" + ((newData == null) ? 0 : newData.length) + " oldData.length==" + ((oldData == null) ? 0 : oldData.length)); } resultSetProcessor.processViewResult(newData, oldData, false); if (!super.checkAfterCondition(newData)) { return; } // add the incoming events to the event batches int newDataLength = 0; int oldDataLength = 0; if(newData != null) { newDataLength = newData.length; } if(oldData != null) { oldDataLength = oldData.length; } outputCondition.updateOutputCondition(newDataLength, oldDataLength); }
void function(EventBean[] newData, EventBean[] oldData) { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(STR + STR + ((newData == null) ? 0 : newData.length) + STR + ((oldData == null) ? 0 : oldData.length)); } resultSetProcessor.processViewResult(newData, oldData, false); if (!super.checkAfterCondition(newData)) { return; } int newDataLength = 0; int oldDataLength = 0; if(newData != null) { newDataLength = newData.length; } if(oldData != null) { oldDataLength = oldData.length; } outputCondition.updateOutputCondition(newDataLength, oldDataLength); }
/** * The update method is called if the view does not participate in a join. * @param newData - new events * @param oldData - old events */
The update method is called if the view does not participate in a join
update
{ "repo_name": "intelie/esper", "path": "esper/src/main/java/com/espertech/esper/epl/view/OutputProcessViewSnapshot.java", "license": "gpl-2.0", "size": 9077 }
[ "com.espertech.esper.client.EventBean", "com.espertech.esper.util.ExecutionPathDebugLog" ]
import com.espertech.esper.client.EventBean; import com.espertech.esper.util.ExecutionPathDebugLog;
import com.espertech.esper.client.*; import com.espertech.esper.util.*;
[ "com.espertech.esper" ]
com.espertech.esper;
987,934
public Path getItunesIpswPath(String device) throws IOException { //I'm using split, because i want to get the name (for example iphone, ipad, without the version. String reducedDevice = device.split(" ")[0]; if(super.getOsName().contains("Mac")) { Path path = Paths.get(homePath, "Library", "iTunes", reducedDevice + " Software Updates"); Files.createDirectories(path); return path; } if(super.getOsName().contains("Windows")) { Path path = Paths.get(homePath, "AppData", "Roaming", "Apple Computer", "iTunes", reducedDevice + " Software Updates"); Files.createDirectories(path); return path; } //if is Linux (an operative system not supporte by iTunes) throw an execption throw new IOException(); }
Path function(String device) throws IOException { String reducedDevice = device.split(" ")[0]; if(super.getOsName().contains("Mac")) { Path path = Paths.get(homePath, STR, STR, reducedDevice + STR); Files.createDirectories(path); return path; } if(super.getOsName().contains(STR)) { Path path = Paths.get(homePath, STR, STR, STR, STR, reducedDevice + STR); Files.createDirectories(path); return path; } throw new IOException(); }
/** * Method to get the default folder where iTunes downloads firmwares.<br></br> * Only for mac and windows, because iTunes isn't supported by Linux.<br></br> * If this path doesn't exist, this method creates the path.<br></br> * @param device String that represents the device. * @return Path Path that represents the default folder where iTunes downloads firmwares. * @throws IOException If the current OS is Linux. */
Method to get the default folder where iTunes downloads firmwares. Only for mac and windows, because iTunes isn't supported by Linux. If this path doesn't exist, this method creates the path
getItunesIpswPath
{ "repo_name": "Ks89/BYAUpdater", "path": "src/main/java/it/stefanocappa/User.java", "license": "apache-2.0", "size": 4454 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path", "java.nio.file.Paths" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,463,686
private static CruiseControlMetric toCruiseControlMetric(long now, int brokerId, String name, Map<String, String> tags, double value) { String topic = tags.get(TOPIC_KEY); switch (name) { case BYTES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_BYTES_IN, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_BYTES_IN, now, brokerId, value); } case BYTES_OUT_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_BYTES_OUT, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_BYTES_OUT, now, brokerId, value); } case REPLICATION_BYTES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_REPLICATION_BYTES_IN, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_REPLICATION_BYTES_IN, now, brokerId, value); } case REPLICATION_BYTES_OUT_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_REPLICATION_BYTES_OUT, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_REPLICATION_BYTES_OUT, now, brokerId, value); } case TOTAL_FETCH_REQUEST_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_FETCH_REQUEST_RATE, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_FETCH_REQUEST_RATE, now, brokerId, value); } case TOTAL_PRODUCE_REQUEST_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_PRODUCE_REQUEST_RATE, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_PRODUCE_REQUEST_RATE, now, brokerId, value); } case MESSAGES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_MESSAGES_IN_PER_SEC, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_MESSAGES_IN_PER_SEC, now, brokerId, value); } case REQUEST_PER_SEC: String requestType = tags.get(REQUEST_TYPE_KEY); switch (requestType) { case PRODUCE_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_PRODUCE_REQUEST_RATE, now, brokerId, value); case CONSUMER_FETCH_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_CONSUMER_FETCH_REQUEST_RATE, now, brokerId, value); case FOLLOWER_FETCH_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_FOLLOWER_FETCH_REQUEST_RATE, now, brokerId, value); default: return null; } case SIZE: int partition = Integer.parseInt(tags.get(PARTITION_KEY)); return new PartitionMetric(MetricType.PARTITION_SIZE, now, brokerId, topic, partition, value); case REQUEST_HANDLER_AVG_IDLE_PERCENT: return new BrokerMetric(MetricType.BROKER_REQUEST_HANDLER_AVG_IDLE_PERCENT, now, brokerId, value); default: return null; } }
static CruiseControlMetric function(long now, int brokerId, String name, Map<String, String> tags, double value) { String topic = tags.get(TOPIC_KEY); switch (name) { case BYTES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_BYTES_IN, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_BYTES_IN, now, brokerId, value); } case BYTES_OUT_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_BYTES_OUT, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_BYTES_OUT, now, brokerId, value); } case REPLICATION_BYTES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_REPLICATION_BYTES_IN, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_REPLICATION_BYTES_IN, now, brokerId, value); } case REPLICATION_BYTES_OUT_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_REPLICATION_BYTES_OUT, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_REPLICATION_BYTES_OUT, now, brokerId, value); } case TOTAL_FETCH_REQUEST_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_FETCH_REQUEST_RATE, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_FETCH_REQUEST_RATE, now, brokerId, value); } case TOTAL_PRODUCE_REQUEST_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_PRODUCE_REQUEST_RATE, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_PRODUCE_REQUEST_RATE, now, brokerId, value); } case MESSAGES_IN_PER_SEC: if (topic != null) { return new TopicMetric(MetricType.TOPIC_MESSAGES_IN_PER_SEC, now, brokerId, topic, value); } else { return new BrokerMetric(MetricType.ALL_TOPIC_MESSAGES_IN_PER_SEC, now, brokerId, value); } case REQUEST_PER_SEC: String requestType = tags.get(REQUEST_TYPE_KEY); switch (requestType) { case PRODUCE_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_PRODUCE_REQUEST_RATE, now, brokerId, value); case CONSUMER_FETCH_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_CONSUMER_FETCH_REQUEST_RATE, now, brokerId, value); case FOLLOWER_FETCH_REQUEST_TYPE: return new BrokerMetric(MetricType.BROKER_FOLLOWER_FETCH_REQUEST_RATE, now, brokerId, value); default: return null; } case SIZE: int partition = Integer.parseInt(tags.get(PARTITION_KEY)); return new PartitionMetric(MetricType.PARTITION_SIZE, now, brokerId, topic, partition, value); case REQUEST_HANDLER_AVG_IDLE_PERCENT: return new BrokerMetric(MetricType.BROKER_REQUEST_HANDLER_AVG_IDLE_PERCENT, now, brokerId, value); default: return null; } }
/** * build a CruiseControlMetric object. */
build a CruiseControlMetric object
toCruiseControlMetric
{ "repo_name": "GergoHong/cruise-control", "path": "cruise-control-metrics-reporter/src/main/java/com/linkedin/kafka/cruisecontrol/metricsreporter/metric/MetricsUtils.java", "license": "bsd-2-clause", "size": 11044 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,886,052
public void setStates(List<String> states) { this.states = states; }
void function(List<String> states) { this.states = states; }
/** * Set the states for this contraint to be applied on * * @param states */
Set the states for this contraint to be applied on
setStates
{ "repo_name": "bhutchinson/rice", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/datadictionary/validation/constraint/BaseConstraint.java", "license": "apache-2.0", "size": 11699 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,644,597
public static boolean hasFaultMessage(Exchange exchange) { return exchange.hasOut() && exchange.getOut().isFault() && exchange.getOut().getBody() != null; }
static boolean function(Exchange exchange) { return exchange.hasOut() && exchange.getOut().isFault() && exchange.getOut().getBody() != null; }
/** * Tests whether the exchange has a fault message set and that its not null. * * @param exchange the exchange * @return <tt>true</tt> if fault message exists */
Tests whether the exchange has a fault message set and that its not null
hasFaultMessage
{ "repo_name": "cexbrayat/camel", "path": "camel-core/src/main/java/org/apache/camel/util/ExchangeHelper.java", "license": "apache-2.0", "size": 26462 }
[ "org.apache.camel.Exchange" ]
import org.apache.camel.Exchange;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
1,325,911
protected void saveSubResults(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save) { if (save.saveSubresults()) { SampleResult[] subResults = res.getSubResults(); for (int i = 0; i < subResults.length; i++) { subResults[i].setSaveConfig(save); writeItem(subResults[i], context, writer); } } }
void function(HierarchicalStreamWriter writer, MarshallingContext context, SampleResult res, SampleSaveConfiguration save) { if (save.saveSubresults()) { SampleResult[] subResults = res.getSubResults(); for (int i = 0; i < subResults.length; i++) { subResults[i].setSaveConfig(save); writeItem(subResults[i], context, writer); } } }
/** * Save sub results from sample result into the stream * * @param writer * stream to save objects into * @param context * context for xstream to allow nested objects * @param res * sample to be saved * @param save * configuration telling us what to save */
Save sub results from sample result into the stream
saveSubResults
{ "repo_name": "hizhangqi/jmeter-1", "path": "src/core/org/apache/jmeter/save/converters/SampleResultConverter.java", "license": "apache-2.0", "size": 20776 }
[ "com.thoughtworks.xstream.converters.MarshallingContext", "com.thoughtworks.xstream.io.HierarchicalStreamWriter", "org.apache.jmeter.samplers.SampleResult", "org.apache.jmeter.samplers.SampleSaveConfiguration" ]
import com.thoughtworks.xstream.converters.MarshallingContext; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; import org.apache.jmeter.samplers.SampleResult; import org.apache.jmeter.samplers.SampleSaveConfiguration;
import com.thoughtworks.xstream.converters.*; import com.thoughtworks.xstream.io.*; import org.apache.jmeter.samplers.*;
[ "com.thoughtworks.xstream", "org.apache.jmeter" ]
com.thoughtworks.xstream; org.apache.jmeter;
1,764,096
boolean removeCollection(String name) throws EXistException, PermissionDeniedException, URISyntaxException;
boolean removeCollection(String name) throws EXistException, PermissionDeniedException, URISyntaxException;
/** * Remove an entire collection from the database. * * @param name path to the collection to be removed. * @return * @exception EXistException * @exception PermissionDeniedException * @throws java.net.URISyntaxException */
Remove an entire collection from the database
removeCollection
{ "repo_name": "olvidalo/exist", "path": "exist-core/src/main/java/org/exist/xmlrpc/RpcAPI.java", "license": "lgpl-2.1", "size": 39990 }
[ "java.net.URISyntaxException", "org.exist.EXistException", "org.exist.security.PermissionDeniedException" ]
import java.net.URISyntaxException; import org.exist.EXistException; import org.exist.security.PermissionDeniedException;
import java.net.*; import org.exist.*; import org.exist.security.*;
[ "java.net", "org.exist", "org.exist.security" ]
java.net; org.exist; org.exist.security;
1,965,569
public WorkflowBinDefinitionList findReportDefinitions(Long projectId, String authToken) throws Exception;
WorkflowBinDefinitionList function(Long projectId, String authToken) throws Exception;
/** * Find report definitions. * * @param projectId the project id * @param authToken the auth token * @return the workflow bin definition list * @throws Exception the exception */
Find report definitions
findReportDefinitions
{ "repo_name": "WestCoastInformatics/UMLS-Terminology-Server", "path": "jpa-services/src/main/java/com/wci/umls/server/jpa/services/rest/ReportServiceRest.java", "license": "apache-2.0", "size": 3064 }
[ "com.wci.umls.server.helpers.WorkflowBinDefinitionList" ]
import com.wci.umls.server.helpers.WorkflowBinDefinitionList;
import com.wci.umls.server.helpers.*;
[ "com.wci.umls" ]
com.wci.umls;
620,078
private void getBindAddress(ServiceType service) throws Exception { String localHostName = NetworkAddressUtils.getLocalHostName(); InetSocketAddress workerAddress; // all default ConfigurationTestUtils.resetConfiguration(); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); // bind host only Configuration.set(service.getBindHostKey(), "bind.host"); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress("bind.host", service.getDefaultPort()), workerAddress); // connect host and bind host Configuration.set(service.getHostNameKey(), "connect.host"); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress("bind.host", service.getDefaultPort()), workerAddress); // wildcard connect host and bind host Configuration.set(service.getHostNameKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress("bind.host", service.getDefaultPort()), workerAddress); // wildcard connect host and wildcard bind host Configuration.set(service.getBindHostKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); // connect host and wildcard bind host Configuration.set(service.getHostNameKey(), "connect.host"); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); // connect host and wildcard bind host with port switch (service) { case MASTER_RPC: Configuration.set(PropertyKey.MASTER_RPC_PORT, "20000"); break; case MASTER_WEB: Configuration.set(PropertyKey.MASTER_WEB_PORT, "20000"); break; case PROXY_WEB: Configuration.set(PropertyKey.PROXY_WEB_PORT, "20000"); break; case WORKER_RPC: Configuration.set(PropertyKey.WORKER_RPC_PORT, "20000"); break; case WORKER_DATA: Configuration.set(PropertyKey.WORKER_DATA_PORT, "20000"); break; case WORKER_WEB: Configuration.set(PropertyKey.WORKER_WEB_PORT, "20000"); break; default: Assert.fail("Unrecognized service type: " + service.toString()); break; } workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, 20000), workerAddress); // connect host and bind host with port Configuration.set(service.getBindHostKey(), "bind.host"); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress("bind.host", 20000), workerAddress); // empty connect host and bind host with port Configuration.set(service.getHostNameKey(), ""); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress("bind.host", 20000), workerAddress); // empty connect host and wildcard bind host with port Configuration.set(service.getBindHostKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, 20000), workerAddress); // empty connect host and empty bind host with port Configuration.set(service.getBindHostKey(), ""); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(localHostName, 20000), workerAddress); }
void function(ServiceType service) throws Exception { String localHostName = NetworkAddressUtils.getLocalHostName(); InetSocketAddress workerAddress; ConfigurationTestUtils.resetConfiguration(); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); Configuration.set(service.getBindHostKey(), STR); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(STR, service.getDefaultPort()), workerAddress); Configuration.set(service.getHostNameKey(), STR); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(STR, service.getDefaultPort()), workerAddress); Configuration.set(service.getHostNameKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(STR, service.getDefaultPort()), workerAddress); Configuration.set(service.getBindHostKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); Configuration.set(service.getHostNameKey(), STR); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals( new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, service.getDefaultPort()), workerAddress); switch (service) { case MASTER_RPC: Configuration.set(PropertyKey.MASTER_RPC_PORT, "20000"); break; case MASTER_WEB: Configuration.set(PropertyKey.MASTER_WEB_PORT, "20000"); break; case PROXY_WEB: Configuration.set(PropertyKey.PROXY_WEB_PORT, "20000"); break; case WORKER_RPC: Configuration.set(PropertyKey.WORKER_RPC_PORT, "20000"); break; case WORKER_DATA: Configuration.set(PropertyKey.WORKER_DATA_PORT, "20000"); break; case WORKER_WEB: Configuration.set(PropertyKey.WORKER_WEB_PORT, "20000"); break; default: Assert.fail(STR + service.toString()); break; } workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, 20000), workerAddress); Configuration.set(service.getBindHostKey(), STR); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(STR, 20000), workerAddress); Configuration.set(service.getHostNameKey(), ""); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(STR, 20000), workerAddress); Configuration.set(service.getBindHostKey(), NetworkAddressUtils.WILDCARD_ADDRESS); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(NetworkAddressUtils.WILDCARD_ADDRESS, 20000), workerAddress); Configuration.set(service.getBindHostKey(), ""); workerAddress = NetworkAddressUtils.getBindAddress(service); assertEquals(new InetSocketAddress(localHostName, 20000), workerAddress); }
/** * Tests the {@link NetworkAddressUtils#getBindAddress(ServiceType)} method for specific * service under different conditions. * * @param service the service name used to connect */
Tests the <code>NetworkAddressUtils#getBindAddress(ServiceType)</code> method for specific service under different conditions
getBindAddress
{ "repo_name": "jswudi/alluxio", "path": "core/common/src/test/java/alluxio/util/network/NetworkAddressUtilsTest.java", "license": "apache-2.0", "size": 12933 }
[ "java.net.InetSocketAddress", "org.junit.Assert" ]
import java.net.InetSocketAddress; import org.junit.Assert;
import java.net.*; import org.junit.*;
[ "java.net", "org.junit" ]
java.net; org.junit;
1,553,380
protected void addOcciComputeMemoryPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_X1_32xlarge_occiComputeMemory_feature"), getString("_UI_PropertyDescriptor_description", "_UI_X1_32xlarge_occiComputeMemory_feature", "_UI_X1_32xlarge_type"), Ec2Package.eINSTANCE.getX1_32xlarge_OcciComputeMemory(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), Ec2Package.eINSTANCE.getX1_32xlarge_OcciComputeMemory(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Occi Compute Memory feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Occi Compute Memory feature.
addOcciComputeMemoryPropertyDescriptor
{ "repo_name": "occiware/Multi-Cloud-Studio", "path": "plugins/org.eclipse.cmf.occi.multicloud.aws.ec2.edit/src-gen/org/eclipse/cmf/occi/multicloud/aws/ec2/provider/X1_32xlargeItemProvider.java", "license": "epl-1.0", "size": 7048 }
[ "org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package", "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor" ]
import org.eclipse.cmf.occi.multicloud.aws.ec2.Ec2Package; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.cmf.occi.multicloud.aws.ec2.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.cmf", "org.eclipse.emf" ]
org.eclipse.cmf; org.eclipse.emf;
1,651,839
@SuppressWarnings("unchecked") protected <ITEM> List<ITEM> parseList(JSONArray jsonArray, JsonParser<JSONObject> parser) { List<ITEM> list = Lists.newArrayList(); if (jsonArray != null) { int length = jsonArray.length(); for (int i = 0; i < length; i++) { ITEM parse = (ITEM)parser.parse(jsonArray.getJSONObject(i)); if (parse != null) { list.add(parse); } } } return list; }
@SuppressWarnings(STR) <ITEM> List<ITEM> function(JSONArray jsonArray, JsonParser<JSONObject> parser) { List<ITEM> list = Lists.newArrayList(); if (jsonArray != null) { int length = jsonArray.length(); for (int i = 0; i < length; i++) { ITEM parse = (ITEM)parser.parse(jsonArray.getJSONObject(i)); if (parse != null) { list.add(parse); } } } return list; }
/** * Parses a list of items. * * @param <ITEM> The item's type. * * @param jsonArray The {@link JSONArray} to parse. * @param parser The {@link JsonParser} to parse each list item. * @return The parsed list. */
Parses a list of items
parseList
{ "repo_name": "wskplho/jdroid", "path": "jdroid-java/src/main/java/com/jdroid/java/http/parser/json/JsonParser.java", "license": "apache-2.0", "size": 2639 }
[ "com.jdroid.java.collections.Lists", "com.jdroid.java.json.JSONArray", "com.jdroid.java.json.JSONObject", "java.util.List" ]
import com.jdroid.java.collections.Lists; import com.jdroid.java.json.JSONArray; import com.jdroid.java.json.JSONObject; import java.util.List;
import com.jdroid.java.collections.*; import com.jdroid.java.json.*; import java.util.*;
[ "com.jdroid.java", "java.util" ]
com.jdroid.java; java.util;
2,481,262
INode getNode();
INode getNode();
/** * Returns the node which this rendering object represents. * @return the node which this rendering object represents. */
Returns the node which this rendering object represents
getNode
{ "repo_name": "lumag/JBookReader", "path": "src/org/jbookreader/formatengine/IRenderingObject.java", "license": "gpl-2.0", "size": 1737 }
[ "org.jbookreader.book.bom.INode" ]
import org.jbookreader.book.bom.INode;
import org.jbookreader.book.bom.*;
[ "org.jbookreader.book" ]
org.jbookreader.book;
1,487,624
public void updateSystem(String systemName, boolean resetCalls) { PreparedStatement statement = null; if (checkConnection()) { this.lock.lock(); try { try { if (this.connection.isClosed()) { this.connection = null; setConnection(); } } catch (SQLException e) { logger.error(e.getMessage(), e); } } finally { this.lock.unlock(); } } try { String rq = "update sbb_monitor.check_calls_ext_systems SET LAST_UPDATE = ?, COUNT_CALLS = ? where SYSTEM_NAME = ?"; logger.debug("Statement: " + rq); statement = this.connection.prepareStatement(rq); statement.setTimestamp(1, new Timestamp(new Date().getTime())); if (resetCalls) { statement.setLong(2, 0); } else { statement.setLong(2, countCalls.get()); } statement.setString(3, systemName); int countRows = statement.executeUpdate(); if (countRows == 0) { saveCountCall(systemName); } logger.info("Update system " + systemName + " calls successfully!"); } catch (SQLException e) { logger.error("Failed update system " + systemName + " calls! Error message: " + e.getMessage(), e); } finally { if (null != statement) { try { statement.close(); } catch (SQLException e) { logger.error(e.getMessage(), e); } } } }
void function(String systemName, boolean resetCalls) { PreparedStatement statement = null; if (checkConnection()) { this.lock.lock(); try { try { if (this.connection.isClosed()) { this.connection = null; setConnection(); } } catch (SQLException e) { logger.error(e.getMessage(), e); } } finally { this.lock.unlock(); } } try { String rq = STR; logger.debug(STR + rq); statement = this.connection.prepareStatement(rq); statement.setTimestamp(1, new Timestamp(new Date().getTime())); if (resetCalls) { statement.setLong(2, 0); } else { statement.setLong(2, countCalls.get()); } statement.setString(3, systemName); int countRows = statement.executeUpdate(); if (countRows == 0) { saveCountCall(systemName); } logger.info(STR + systemName + STR); } catch (SQLException e) { logger.error(STR + systemName + STR + e.getMessage(), e); } finally { if (null != statement) { try { statement.close(); } catch (SQLException e) { logger.error(e.getMessage(), e); } } } }
/** * Update count system calls * * @param systemName * - extarnal system name */
Update count system calls
updateSystem
{ "repo_name": "kgobunov/Java", "path": "COD/src/db/DataBaseHelper.java", "license": "gpl-2.0", "size": 8652 }
[ "java.sql.PreparedStatement", "java.sql.SQLException", "java.sql.Timestamp", "java.util.Date" ]
import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
1,585,304
public static void insertTextAtOnceAndAssert(String input, String expectedOutput) { // Type input. onView(withId(android.R.id.primary)) .perform(ViewActions.replaceText(input)); assertExpectedOutput(expectedOutput); }
static void function(String input, String expectedOutput) { onView(withId(android.R.id.primary)) .perform(ViewActions.replaceText(input)); assertExpectedOutput(expectedOutput); }
/** * Insert a text into a view. * * @param input input string which needs to be typed. * @param expectedOutput expected output from this input which will be checked. */
Insert a text into a view
insertTextAtOnceAndAssert
{ "repo_name": "zsavely/PatternedTextWatcher", "path": "patternedtextwatcher/src/androidTest/java/com/szagurskii/patternedtextwatcher/utils/Utils.java", "license": "mit", "size": 2051 }
[ "android.support.test.espresso.Espresso", "android.support.test.espresso.action.ViewActions" ]
import android.support.test.espresso.Espresso; import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.*; import android.support.test.espresso.action.*;
[ "android.support" ]
android.support;
744,306
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "piwi93/ombuestsig", "path": "src/java/Servlets/LogOut.java", "license": "lgpl-2.1", "size": 2811 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,849,038
public Iterator<Identity> getIdentities() { synchronized (identities) { return Collections.unmodifiableList(identities).iterator(); } }
Iterator<Identity> function() { synchronized (identities) { return Collections.unmodifiableList(identities).iterator(); } }
/** * Returns the discovered identities of an XMPP entity. * * @return an Iterator on the discoveted identities */
Returns the discovered identities of an XMPP entity
getIdentities
{ "repo_name": "jtietema/telegraph", "path": "app/libs/asmack-android-16-source/org/jivesoftware/smackx/packet/DiscoverInfo.java", "license": "gpl-3.0", "size": 9276 }
[ "java.util.Collections", "java.util.Iterator" ]
import java.util.Collections; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
180,213
private void queueNextSync() { Calendar nowCalendar = Calendar.getInstance(); long now = nowCalendar.getTimeInMillis(); long syncInterval; syncInterval = 30*60*1000; // And now for some fuzz to make sure all of the ponies don't // ride over the server together. 15 mins either way is good. syncInterval += ((new Random().nextInt(30))-15)*60*1000; }
void function() { Calendar nowCalendar = Calendar.getInstance(); long now = nowCalendar.getTimeInMillis(); long syncInterval; syncInterval = 30*60*1000; syncInterval += ((new Random().nextInt(30))-15)*60*1000; }
/** * Queue up the next sync */
Queue up the next sync
queueNextSync
{ "repo_name": "BitCypher2014/Wardrobe_app", "path": "wardrobe/src/main/java/com/android/busolo/apps/wardrobe/sync/SyncService.java", "license": "apache-2.0", "size": 2607 }
[ "java.util.Calendar", "java.util.Random" ]
import java.util.Calendar; import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
302,583
public PipesFluentPipeline<S, Row> select();
PipesFluentPipeline<S, Row> function();
/** * Add a SelectPipe to the end of the Pipeline. * The objects of the named steps (via as) previous in the pipeline are emitted as a Row object. * A Row object extends ArrayList and simply provides named columns and some helper methods. * * @return the extended Pipeline */
Add a SelectPipe to the end of the Pipeline. The objects of the named steps (via as) previous in the pipeline are emitted as a Row object. A Row object extends ArrayList and simply provides named columns and some helper methods
select
{ "repo_name": "whshev/pipes", "path": "src/main/java/com/tinkerpop/pipes/util/PipesFluentPipeline.java", "license": "bsd-3-clause", "size": 35364 }
[ "com.tinkerpop.pipes.util.structures.Row" ]
import com.tinkerpop.pipes.util.structures.Row;
import com.tinkerpop.pipes.util.structures.*;
[ "com.tinkerpop.pipes" ]
com.tinkerpop.pipes;
1,251,386
@Override public NamedTuple getClassifiers() { return classifiers; }
NamedTuple function() { return classifiers; }
/** * Returns a {@link NamedTuple} keyed to the input field * names, whose values are the {@link Classifier} used * to track the classification of a particular field */
Returns a <code>NamedTuple</code> keyed to the input field names, whose values are the <code>Classifier</code> used to track the classification of a particular field
getClassifiers
{ "repo_name": "numenta/htm.java", "path": "src/main/java/org/numenta/nupic/network/ManualInput.java", "license": "agpl-3.0", "size": 17775 }
[ "org.numenta.nupic.util.NamedTuple" ]
import org.numenta.nupic.util.NamedTuple;
import org.numenta.nupic.util.*;
[ "org.numenta.nupic" ]
org.numenta.nupic;
137,171
public void waitNoPendingTasksOnAll() throws Exception { assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get()); assertBusy(() -> { for (Client client : clients()) { ClusterHealthResponse clusterHealth = client.admin().cluster().prepareHealth().setLocal(true).get(); assertThat("client " + client + " still has in flight fetch", clusterHealth.getNumberOfInFlightFetch(), equalTo(0)); PendingClusterTasksResponse pendingTasks = client.admin().cluster().preparePendingClusterTasks().setLocal(true).get(); assertThat("client " + client + " still has pending tasks " + pendingTasks, pendingTasks, Matchers.emptyIterable()); clusterHealth = client.admin().cluster().prepareHealth().setLocal(true).get(); assertThat("client " + client + " still has in flight fetch", clusterHealth.getNumberOfInFlightFetch(), equalTo(0)); } }); assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get()); }
void function() throws Exception { assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get()); assertBusy(() -> { for (Client client : clients()) { ClusterHealthResponse clusterHealth = client.admin().cluster().prepareHealth().setLocal(true).get(); assertThat(STR + client + STR, clusterHealth.getNumberOfInFlightFetch(), equalTo(0)); PendingClusterTasksResponse pendingTasks = client.admin().cluster().preparePendingClusterTasks().setLocal(true).get(); assertThat(STR + client + STR + pendingTasks, pendingTasks, Matchers.emptyIterable()); clusterHealth = client.admin().cluster().prepareHealth().setLocal(true).get(); assertThat(STR + client + STR, clusterHealth.getNumberOfInFlightFetch(), equalTo(0)); } }); assertNoTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get()); }
/** * Waits until all nodes have no pending tasks. */
Waits until all nodes have no pending tasks
waitNoPendingTasksOnAll
{ "repo_name": "fernandozhu/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java", "license": "apache-2.0", "size": 103624 }
[ "org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse", "org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse", "org.elasticsearch.client.Client", "org.elasticsearch.common.Priority", "org.elasticsearch.test.hamcrest.ElasticsearchAssertions", "org.hamcrest.Matchers" ]
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse; import org.elasticsearch.client.Client; import org.elasticsearch.common.Priority; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.hamcrest.Matchers;
import org.elasticsearch.action.admin.cluster.health.*; import org.elasticsearch.action.admin.cluster.tasks.*; import org.elasticsearch.client.*; import org.elasticsearch.common.*; import org.elasticsearch.test.hamcrest.*; import org.hamcrest.*;
[ "org.elasticsearch.action", "org.elasticsearch.client", "org.elasticsearch.common", "org.elasticsearch.test", "org.hamcrest" ]
org.elasticsearch.action; org.elasticsearch.client; org.elasticsearch.common; org.elasticsearch.test; org.hamcrest;
2,569,774
default void dropRole(ConnectorSession session, String role) { throw new TrinoException(NOT_SUPPORTED, "This connector does not support drop role"); }
default void dropRole(ConnectorSession session, String role) { throw new TrinoException(NOT_SUPPORTED, STR); }
/** * Drops the specified role. */
Drops the specified role
dropRole
{ "repo_name": "electrum/presto", "path": "core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMetadata.java", "license": "apache-2.0", "size": 48062 }
[ "io.trino.spi.TrinoException" ]
import io.trino.spi.TrinoException;
import io.trino.spi.*;
[ "io.trino.spi" ]
io.trino.spi;
2,402,655
public static String getBloomIndexFile(String shardPath, String colName) { return shardPath.concat(File.separator).concat(colName).concat(BLOOM_INDEX_SUFFIX); }
static String function(String shardPath, String colName) { return shardPath.concat(File.separator).concat(colName).concat(BLOOM_INDEX_SUFFIX); }
/** * get bloom index file */
get bloom index file
getBloomIndexFile
{ "repo_name": "ravipesala/incubator-carbondata", "path": "datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomIndexFileStore.java", "license": "apache-2.0", "size": 10394 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
808,786
public List<Map<String, Object>> getToolsLtiLink();
List<Map<String, Object>> function();
/** * Gets a list of tools that can configure themselves in the site */
Gets a list of tools that can configure themselves in the site
getToolsLtiLink
{ "repo_name": "conder/sakai", "path": "basiclti/basiclti-api/src/java/org/sakaiproject/lti/api/LTIService.java", "license": "apache-2.0", "size": 24025 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,726,064
@Test public final void testDeplace() { String testName = new String(typeName + ".deplace(double, double)"); System.out.println(testName); Point2D centreBefore = new Point2D(testFigure.getCentre()); double dx = 1.0; double dy = 1.0; testFigure.deplace(dx, dy); Point2D centreAfter = testFigure.getCentre(); assertEquals(testName, centreBefore.deplace(dx, dy), centreAfter); testFigure.deplace(-dx, -dy); }
final void function() { String testName = new String(typeName + STR); System.out.println(testName); Point2D centreBefore = new Point2D(testFigure.getCentre()); double dx = 1.0; double dy = 1.0; testFigure.deplace(dx, dy); Point2D centreAfter = testFigure.getCentre(); assertEquals(testName, centreBefore.deplace(dx, dy), centreAfter); testFigure.deplace(-dx, -dy); }
/** * Test method for {@link figures.Figure#deplace(double, double)}. */
Test method for <code>figures.Figure#deplace(double, double)</code>
testDeplace
{ "repo_name": "rpereira-dev/ENSIIE", "path": "UE/S2/ILO/TP Listes & Figures/src/tests/FigureTest.java", "license": "gpl-3.0", "size": 16281 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,681,774
public void updateEdgeParents(Object cell, Object root) { // Updates edges on children first int childCount = getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = getChildAt(cell, i); updateEdgeParents(child, root); } // Updates the parents of all connected edges int edgeCount = getEdgeCount(cell); List<Object> edges = new ArrayList<Object>(edgeCount); for (int i = 0; i < edgeCount; i++) { edges.add(getEdgeAt(cell, i)); } Iterator<Object> it = edges.iterator(); while (it.hasNext()) { Object edge = it.next(); // Updates edge parent if edge and child have // a common root node (does not need to be the // model root node) if (isAncestor(root, edge)) { updateEdgeParent(edge, root); } } }
void function(Object cell, Object root) { int childCount = getChildCount(cell); for (int i = 0; i < childCount; i++) { Object child = getChildAt(cell, i); updateEdgeParents(child, root); } int edgeCount = getEdgeCount(cell); List<Object> edges = new ArrayList<Object>(edgeCount); for (int i = 0; i < edgeCount; i++) { edges.add(getEdgeAt(cell, i)); } Iterator<Object> it = edges.iterator(); while (it.hasNext()) { Object edge = it.next(); if (isAncestor(root, edge)) { updateEdgeParent(edge, root); } } }
/** * Updates the parents of the edges connected to the given cell and all its descendants so that * the edge is contained in the nearest-common-ancestor. * * @param cell Cell whose edges should be checked and updated. * @param root Root of the cell hierarchy that contains all cells. */
Updates the parents of the edges connected to the given cell and all its descendants so that the edge is contained in the nearest-common-ancestor
updateEdgeParents
{ "repo_name": "ModelWriter/WP3", "path": "Source/eu.modelwriter.visualization.jgrapx/src/com/mxgraph/model/mxGraphModel.java", "license": "epl-1.0", "size": 58477 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,403,094
@JsonProperty("logging") public synchronized LoggingFactory getLoggingFactory() { if (logging == null) { // Lazy init to avoid a hard dependency to logback logging = new DefaultLoggingFactory(); } return logging; }
@JsonProperty(STR) synchronized LoggingFactory function() { if (logging == null) { logging = new DefaultLoggingFactory(); } return logging; }
/** * Returns the logging-specific section of the configuration file. * * @return logging-specific configuration parameters */
Returns the logging-specific section of the configuration file
getLoggingFactory
{ "repo_name": "pkwarren/dropwizard", "path": "dropwizard-core/src/main/java/io/dropwizard/Configuration.java", "license": "apache-2.0", "size": 4088 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "io.dropwizard.logging.DefaultLoggingFactory", "io.dropwizard.logging.LoggingFactory" ]
import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.logging.DefaultLoggingFactory; import io.dropwizard.logging.LoggingFactory;
import com.fasterxml.jackson.annotation.*; import io.dropwizard.logging.*;
[ "com.fasterxml.jackson", "io.dropwizard.logging" ]
com.fasterxml.jackson; io.dropwizard.logging;
2,112,038
EClass getThrowAction();
EClass getThrowAction();
/** * Returns the meta object for class '{@link org.tud.inf.st.mbt.actions.ThrowAction <em>Throw Action</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Throw Action</em>'. * @see org.tud.inf.st.mbt.actions.ThrowAction * @generated */
Returns the meta object for class '<code>org.tud.inf.st.mbt.actions.ThrowAction Throw Action</code>'.
getThrowAction
{ "repo_name": "paetti1988/qmate", "path": "MATE/org.tud.inf.st.mbt.emf/src-gen/org/tud/inf/st/mbt/actions/ActionsPackage.java", "license": "apache-2.0", "size": 60449 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,031,149
public UpgradeVG getCurrentUpgrade(VirtualGood good) { StoreUtils.LogDebug(mTag, "Fetching upgrade to virtual good: " + good.getName()); String itemId = good.getItemId(); String key = KeyValDatabase.keyGoodUpgrade(itemId); key = StorageManager.getAESObfuscator().obfuscateString(key); String upItemId = StorageManager.getDatabase().getKeyVal(key); if (upItemId == null) { StoreUtils.LogDebug(mTag, "You tried to fetch the current upgrade of " + good.getName() + " but there's not upgrade to it."); return null; } try { upItemId = StorageManager.getAESObfuscator().unobfuscateToString(upItemId); return (UpgradeVG) StoreInfo.getVirtualItem(upItemId); } catch (AESObfuscator.ValidationException e) { StoreUtils.LogError(mTag, e.getMessage()); } catch (VirtualItemNotFoundException e) { StoreUtils.LogError(mTag, "The current upgrade's itemId from the DB is not found in StoreInfo."); } catch (ClassCastException e) { StoreUtils.LogError(mTag, "The current upgrade's itemId from the DB is not an UpgradeVG."); } return null; }
UpgradeVG function(VirtualGood good) { StoreUtils.LogDebug(mTag, STR + good.getName()); String itemId = good.getItemId(); String key = KeyValDatabase.keyGoodUpgrade(itemId); key = StorageManager.getAESObfuscator().obfuscateString(key); String upItemId = StorageManager.getDatabase().getKeyVal(key); if (upItemId == null) { StoreUtils.LogDebug(mTag, STR + good.getName() + STR); return null; } try { upItemId = StorageManager.getAESObfuscator().unobfuscateToString(upItemId); return (UpgradeVG) StoreInfo.getVirtualItem(upItemId); } catch (AESObfuscator.ValidationException e) { StoreUtils.LogError(mTag, e.getMessage()); } catch (VirtualItemNotFoundException e) { StoreUtils.LogError(mTag, STR); } catch (ClassCastException e) { StoreUtils.LogError(mTag, STR); } return null; }
/** * Retrieves the current upgrade for the given VirtualGood. * @param good the VirtualGood to retrieve upgrade for. * @return the current upgrade for the given VirtualGood. */
Retrieves the current upgrade for the given VirtualGood
getCurrentUpgrade
{ "repo_name": "tooflya/beat-my-robo", "path": "proj.android/src/com/soomla/store/data/VirtualGoodsStorage.java", "license": "gpl-2.0", "size": 7305 }
[ "com.soomla.billing.util.AESObfuscator", "com.soomla.store.StoreUtils", "com.soomla.store.domain.virtualGoods.UpgradeVG", "com.soomla.store.domain.virtualGoods.VirtualGood", "com.soomla.store.exceptions.VirtualItemNotFoundException" ]
import com.soomla.billing.util.AESObfuscator; import com.soomla.store.StoreUtils; import com.soomla.store.domain.virtualGoods.UpgradeVG; import com.soomla.store.domain.virtualGoods.VirtualGood; import com.soomla.store.exceptions.VirtualItemNotFoundException;
import com.soomla.billing.util.*; import com.soomla.store.*; import com.soomla.store.domain.*; import com.soomla.store.exceptions.*;
[ "com.soomla.billing", "com.soomla.store" ]
com.soomla.billing; com.soomla.store;
755,341
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(DataGrid.class)) { case Bpmn2Package.DATA_GRID__ROW: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(DataGrid.class)) { case Bpmn2Package.DATA_GRID__ROW: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "adbrucker/SecureBPMN", "path": "designer/src/org.activiti.designer.model.edit/src/org/eclipse/bpmn2/provider/DataGridItemProvider.java", "license": "apache-2.0", "size": 5151 }
[ "org.eclipse.bpmn2.Bpmn2Package", "org.eclipse.bpmn2.DataGrid", "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import org.eclipse.bpmn2.Bpmn2Package; import org.eclipse.bpmn2.DataGrid; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.bpmn2.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.bpmn2", "org.eclipse.emf" ]
org.eclipse.bpmn2; org.eclipse.emf;
226,157
public void transformFiles( File destMatchDIr, File destMismatchDir ) throws IOException { clear( destMatchDIr ); clear( destMismatchDir ); for ( int i = 0; i < matchImageCount; ++i ) { int idx = randomizer.getRand().nextInt( origMatchImgs.size() ); BufferedImage origImg = (BufferedImage) origMatchImgs.get( idx ); File outFile = new File( destMatchDIr, "img" + i + ".tif" ); ImageIO.write( transform( origImg ), "tif", outFile ); } for ( int i = 0; i < mismatchImageCount; ++i ) { int idx = randomizer.getRand().nextInt( origMismatchImgs.size() ); BufferedImage origImg = (BufferedImage) origMismatchImgs.get( idx ); File outFile = new File( destMismatchDir, "img" + i + ".tif" ); ImageIO.write( transform( origImg ), "tif", outFile ); } }
void function( File destMatchDIr, File destMismatchDir ) throws IOException { clear( destMatchDIr ); clear( destMismatchDir ); for ( int i = 0; i < matchImageCount; ++i ) { int idx = randomizer.getRand().nextInt( origMatchImgs.size() ); BufferedImage origImg = (BufferedImage) origMatchImgs.get( idx ); File outFile = new File( destMatchDIr, "img" + i + ".tif" ); ImageIO.write( transform( origImg ), "tif", outFile ); } for ( int i = 0; i < mismatchImageCount; ++i ) { int idx = randomizer.getRand().nextInt( origMismatchImgs.size() ); BufferedImage origImg = (BufferedImage) origMismatchImgs.get( idx ); File outFile = new File( destMismatchDir, "img" + i + ".tif" ); ImageIO.write( transform( origImg ), "tif", outFile ); } }
/** * clears destination dirs then populates them with new transformed images * * @param destMatchDIr directory to which transformed match image files are written * @param destMismatchDir directory to which transformed mismatch image files are written * @throws IOException */
clears destination dirs then populates them with new transformed images
transformFiles
{ "repo_name": "jasoyode/gasneat", "path": "src/main/java/com/anji/imaging/ImageRandomizer.java", "license": "gpl-3.0", "size": 12169 }
[ "java.awt.image.BufferedImage", "java.io.File", "java.io.IOException", "javax.imageio.ImageIO" ]
import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;
import java.awt.image.*; import java.io.*; import javax.imageio.*;
[ "java.awt", "java.io", "javax.imageio" ]
java.awt; java.io; javax.imageio;
2,831,662
public boolean isIDAttribute(QName attributeName) { return idAttribNames.contains(attributeName); }
boolean function(QName attributeName) { return idAttribNames.contains(attributeName); }
/** * Check whether a given attribute is locally registered as having an ID type within * this AttributeMap instance. * * @param attributeName the QName of the attribute to be checked for ID type. * @return true if attribute is registered as having an ID type. */
Check whether a given attribute is locally registered as having an ID type within this AttributeMap instance
isIDAttribute
{ "repo_name": "Safewhere/kombit-service-java", "path": "XmlTooling/src/org/opensaml/xml/util/AttributeMap.java", "license": "mit", "size": 19735 }
[ "javax.xml.namespace.QName" ]
import javax.xml.namespace.QName;
import javax.xml.namespace.*;
[ "javax.xml" ]
javax.xml;
1,809,887
public int getSavegameVersion() throws IOException, XMLStreamException { List<String> v = this.peekAttributes(versionList); int ret = -1; if (v != null && v.size() == 1) { try { ret = Integer.parseInt(v.get(0)); } catch (NumberFormatException nfe) {} } return ret; }
int function() throws IOException, XMLStreamException { List<String> v = this.peekAttributes(versionList); int ret = -1; if (v != null && v.size() == 1) { try { ret = Integer.parseInt(v.get(0)); } catch (NumberFormatException nfe) {} } return ret; }
/** * Gets the save game version from this saved game. * * @return The saved game version, or negative on error. * @exception IOException if there is a problem reading the attributes. * @exception XMLStreamException on stream error. */
Gets the save game version from this saved game
getSavegameVersion
{ "repo_name": "FreeCol/freecol", "path": "src/net/sf/freecol/common/io/FreeColSavegameFile.java", "license": "gpl-2.0", "size": 6423 }
[ "java.io.IOException", "java.util.List", "javax.xml.stream.XMLStreamException" ]
import java.io.IOException; import java.util.List; import javax.xml.stream.XMLStreamException;
import java.io.*; import java.util.*; import javax.xml.stream.*;
[ "java.io", "java.util", "javax.xml" ]
java.io; java.util; javax.xml;
159,358
private boolean startMonitoringDevice(Device device) { SocketChannel socketChannel = openAdbConnection(); if (socketChannel != null) { try { boolean result = sendDeviceMonitoringRequest(socketChannel, device); if (result) { if (mSelector == null) { startDeviceMonitorThread(); } device.setClientMonitoringSocket(socketChannel); synchronized (mDevices) { // always wakeup before doing the register. The synchronized block // ensure that the selector won't select() before the end of this block. // @see deviceClientMonitorLoop mSelector.wakeup(); socketChannel.configureBlocking(false); socketChannel.register(mSelector, SelectionKey.OP_READ, device); } return true; } } catch (TimeoutException e) { try { // attempt to close the socket if needed. socketChannel.close(); } catch (IOException e1) { // we can ignore that one. It may already have been closed. } Log.d("DeviceMonitor", "Connection Failure when starting to monitor device '" + device + "' : timeout"); } catch (AdbCommandRejectedException e) { try { // attempt to close the socket if needed. socketChannel.close(); } catch (IOException e1) { // we can ignore that one. It may already have been closed. } Log.d("DeviceMonitor", "Adb refused to start monitoring device '" + device + "' : " + e.getMessage()); } catch (IOException e) { try { // attempt to close the socket if needed. socketChannel.close(); } catch (IOException e1) { // we can ignore that one. It may already have been closed. } Log.d("DeviceMonitor", "Connection Failure when starting to monitor device '" + device + "' : " + e.getMessage()); } } return false; }
boolean function(Device device) { SocketChannel socketChannel = openAdbConnection(); if (socketChannel != null) { try { boolean result = sendDeviceMonitoringRequest(socketChannel, device); if (result) { if (mSelector == null) { startDeviceMonitorThread(); } device.setClientMonitoringSocket(socketChannel); synchronized (mDevices) { mSelector.wakeup(); socketChannel.configureBlocking(false); socketChannel.register(mSelector, SelectionKey.OP_READ, device); } return true; } } catch (TimeoutException e) { try { socketChannel.close(); } catch (IOException e1) { } Log.d(STR, STR + device + STR); } catch (AdbCommandRejectedException e) { try { socketChannel.close(); } catch (IOException e1) { } Log.d(STR, STR + device + STR + e.getMessage()); } catch (IOException e) { try { socketChannel.close(); } catch (IOException e1) { } Log.d(STR, STR + device + STR + e.getMessage()); } } return false; }
/** * Starts a monitoring service for a device. * @param device the device to monitor. * @return true if success. */
Starts a monitoring service for a device
startMonitoringDevice
{ "repo_name": "consulo/consulo-android", "path": "tools-base/ddmlib/src/main/java/com/android/ddmlib/DeviceMonitor.java", "license": "apache-2.0", "size": 35714 }
[ "java.io.IOException", "java.nio.channels.SelectionKey", "java.nio.channels.SocketChannel" ]
import java.io.IOException; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel;
import java.io.*; import java.nio.channels.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,615,479
List<Finding> retrieveLatestStaticByAppAndUser(int appId, int userId);
List<Finding> retrieveLatestStaticByAppAndUser(int appId, int userId);
/** * The most recent Static Findings matching the application and User * * @param appId * @param userId * @return */
The most recent Static Findings matching the application and User
retrieveLatestStaticByAppAndUser
{ "repo_name": "jqxin2006/threadfixRack", "path": "src/main/java/com/denimgroup/threadfix/data/dao/FindingDao.java", "license": "mpl-2.0", "size": 2315 }
[ "com.denimgroup.threadfix.data.entities.Finding", "java.util.List" ]
import com.denimgroup.threadfix.data.entities.Finding; import java.util.List;
import com.denimgroup.threadfix.data.entities.*; import java.util.*;
[ "com.denimgroup.threadfix", "java.util" ]
com.denimgroup.threadfix; java.util;
2,582,466
public void testAddLastNull() { ArrayDeque q = new ArrayDeque(); try { q.addLast(null); shouldThrow(); } catch (NullPointerException success) {} }
void function() { ArrayDeque q = new ArrayDeque(); try { q.addLast(null); shouldThrow(); } catch (NullPointerException success) {} }
/** * addLast(null) throws NPE */
addLast(null) throws NPE
testAddLastNull
{ "repo_name": "debian-pkg-android-tools/android-platform-libcore", "path": "jsr166-tests/src/test/java/jsr166/ArrayDequeTest.java", "license": "gpl-2.0", "size": 26167 }
[ "java.util.ArrayDeque" ]
import java.util.ArrayDeque;
import java.util.*;
[ "java.util" ]
java.util;
2,709,594
void removeListener(Path path, FileUpdateListener listener);
void removeListener(Path path, FileUpdateListener listener);
/** * Removes a listener from the monitor. * * @param path The path to remove. */
Removes a listener from the monitor
removeListener
{ "repo_name": "zellerdev/jabref", "path": "src/main/java/org/jabref/model/util/FileUpdateMonitor.java", "license": "mit", "size": 539 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
2,374,670
public PathValue computeTarget(PathValue source) { Map<String, FieldValue> secondFieldMap = source.getFieldMap(); PathValue result = new PathValue(); for (Map.Entry<String, FieldTransformer> entry : this.fieldMap.entrySet()) { String field = entry.getKey(); FieldTransformer fieldTransformer = entry.getValue(); FieldValue fieldValue = secondFieldMap.get(field); if (fieldValue == null) { fieldValue = NullFieldValue.v(); } if (fieldTransformer != null) { result.addFieldEntry(field, fieldTransformer.apply(fieldValue)); } else { result.addFieldEntry(field, fieldValue); } } for (Map.Entry<String, FieldValue> entry : secondFieldMap.entrySet()) { String field = entry.getKey(); if (!this.fieldMap.containsKey(field)) { result.addFieldEntry(field, entry.getValue()); } } return result; }
PathValue function(PathValue source) { Map<String, FieldValue> secondFieldMap = source.getFieldMap(); PathValue result = new PathValue(); for (Map.Entry<String, FieldTransformer> entry : this.fieldMap.entrySet()) { String field = entry.getKey(); FieldTransformer fieldTransformer = entry.getValue(); FieldValue fieldValue = secondFieldMap.get(field); if (fieldValue == null) { fieldValue = NullFieldValue.v(); } if (fieldTransformer != null) { result.addFieldEntry(field, fieldTransformer.apply(fieldValue)); } else { result.addFieldEntry(field, fieldValue); } } for (Map.Entry<String, FieldValue> entry : secondFieldMap.entrySet()) { String field = entry.getKey(); if (!this.fieldMap.containsKey(field)) { result.addFieldEntry(field, entry.getValue()); } } return result; }
/** * Computes the result of applying this path transformer to a given {@link PathValue}. * * @param source The source PathValue to which this path transformer should be applied. * @return The resulting PathValue. */
Computes the result of applying this path transformer to a given <code>PathValue</code>
computeTarget
{ "repo_name": "siis/coal", "path": "src/main/java/edu/psu/cse/siis/coal/transformers/PathTransformer.java", "license": "apache-2.0", "size": 4977 }
[ "edu.psu.cse.siis.coal.field.transformers.FieldTransformer", "edu.psu.cse.siis.coal.field.values.FieldValue", "edu.psu.cse.siis.coal.field.values.NullFieldValue", "edu.psu.cse.siis.coal.values.PathValue", "java.util.Map" ]
import edu.psu.cse.siis.coal.field.transformers.FieldTransformer; import edu.psu.cse.siis.coal.field.values.FieldValue; import edu.psu.cse.siis.coal.field.values.NullFieldValue; import edu.psu.cse.siis.coal.values.PathValue; import java.util.Map;
import edu.psu.cse.siis.coal.field.transformers.*; import edu.psu.cse.siis.coal.field.values.*; import edu.psu.cse.siis.coal.values.*; import java.util.*;
[ "edu.psu.cse", "java.util" ]
edu.psu.cse; java.util;
1,047,176
public ISelection getSelection() { return editorSelection; }
ISelection function() { return editorSelection; }
/** * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This implements <code>org.eclipse.jface.viewers.ISelectionProvider</code> to return this editor's overall selection.
getSelection
{ "repo_name": "ejuliot/PlayWithSirius", "path": "tictactoe/plugins/org.obeonetwork.dsl.tictactoe.editor/src/tictactoe/presentation/TictactoeEditor.java", "license": "epl-1.0", "size": 55934 }
[ "org.eclipse.jface.viewers.ISelection" ]
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
249,806
private static void assertServerState(AdminClient adminClient, Collection<Integer> nodeIds, VoldemortState stateToCheck, boolean serverMustBeInThisState) { for(Integer nodeId: nodeIds) { String nodeName = adminClient.getAdminClientCluster().getNodeById(nodeId).briefToString(); try { Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId, MetadataStore.SERVER_STATE_KEY); VoldemortState state = VoldemortState.valueOf(versioned.getValue()); if(state.equals(stateToCheck) != serverMustBeInThisState) { throw new VoldemortException("Cannot execute admin operation: " + nodeName + " is " + (serverMustBeInThisState ? "not in " : "in ") + stateToCheck.name() + " state."); } } catch (UnreachableStoreException e) { System.err.println("Cannot verify the server state of " + nodeName + " because it is unreachable. Skipping."); } } }
static void function(AdminClient adminClient, Collection<Integer> nodeIds, VoldemortState stateToCheck, boolean serverMustBeInThisState) { for(Integer nodeId: nodeIds) { String nodeName = adminClient.getAdminClientCluster().getNodeById(nodeId).briefToString(); try { Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId, MetadataStore.SERVER_STATE_KEY); VoldemortState state = VoldemortState.valueOf(versioned.getValue()); if(state.equals(stateToCheck) != serverMustBeInThisState) { throw new VoldemortException(STR + nodeName + STR + (serverMustBeInThisState ? STR : STR) + stateToCheck.name() + STR); } } catch (UnreachableStoreException e) { System.err.println(STR + nodeName + STR); } } }
/** * Checks if nodes are in a given {@link VoldemortState}. Can also be * used to ensure that nodes are NOT in a given {@link VoldemortState}. * * Either way, throws an exception if any node isn't as expected. * * @param adminClient An instance of AdminClient points to given cluster * @param nodeIds List of node ids to be checked * @param stateToCheck state to be verified * @param serverMustBeInThisState - if true, function will throw if any * server is NOT in the stateToCheck * - if false, function will throw if any * server IS in the stateToCheck * @throws VoldemortException if any node doesn't conform to the required state */
Checks if nodes are in a given <code>VoldemortState</code>. Can also be used to ensure that nodes are NOT in a given <code>VoldemortState</code>. Either way, throws an exception if any node isn't as expected
assertServerState
{ "repo_name": "stotch/voldemort", "path": "src/java/voldemort/tools/admin/AdminToolUtils.java", "license": "apache-2.0", "size": 18670 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,840,227
public static void mixin(MCRViewerConfiguration conf1, MCRViewerConfiguration conf2) { Map<String, Object> conf2Props = conf2.getProperties(); for (Map.Entry<String, Object> property : conf2Props.entrySet()) { conf1.setProperty(property.getKey(), property.getValue()); } Multimap<ResourceType, String> resources = conf2.getResources(); for (Map.Entry<ResourceType, String> resource : resources.entries()) { if (ResourceType.script.equals(resource.getKey())) { conf1.addScript(resource.getValue()); } else if (ResourceType.css.equals(resource.getKey())) { conf1.addCSS(resource.getValue()); } } }
static void function(MCRViewerConfiguration conf1, MCRViewerConfiguration conf2) { Map<String, Object> conf2Props = conf2.getProperties(); for (Map.Entry<String, Object> property : conf2Props.entrySet()) { conf1.setProperty(property.getKey(), property.getValue()); } Multimap<ResourceType, String> resources = conf2.getResources(); for (Map.Entry<ResourceType, String> resource : resources.entries()) { if (ResourceType.script.equals(resource.getKey())) { conf1.addScript(resource.getValue()); } else if (ResourceType.css.equals(resource.getKey())) { conf1.addCSS(resource.getValue()); } } }
/** * Mix in the second configuration into the first. */
Mix in the second configuration into the first
mixin
{ "repo_name": "MyCoRe-Org/mycore", "path": "mycore-viewer/src/main/java/org/mycore/viewer/configuration/MCRViewerConfigurationBuilder.java", "license": "gpl-3.0", "size": 5354 }
[ "com.google.common.collect.Multimap", "java.util.Map", "org.mycore.viewer.configuration.MCRViewerConfiguration" ]
import com.google.common.collect.Multimap; import java.util.Map; import org.mycore.viewer.configuration.MCRViewerConfiguration;
import com.google.common.collect.*; import java.util.*; import org.mycore.viewer.configuration.*;
[ "com.google.common", "java.util", "org.mycore.viewer" ]
com.google.common; java.util; org.mycore.viewer;
2,135,975
public void setDimensions(Object[] left, int top, int width, int height) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setDimensions", left, top, width, height); ScriptSessions.addScript(script); }
void function(Object[] left, int top, int width, int height) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + STR, left, top, width, height); ScriptSessions.addScript(script); }
/** * Sets all four dimensions at once. * @param left the new left value or an array containing all four new values * @param top the new top value * @param width the new width value * @param height the new height value */
Sets all four dimensions at once
setDimensions
{ "repo_name": "burris/dwr", "path": "ui/gi/generated/java/jsx3/html/BlockTag.java", "license": "apache-2.0", "size": 14908 }
[ "org.directwebremoting.ScriptBuffer", "org.directwebremoting.ScriptSessions" ]
import org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSessions;
import org.directwebremoting.*;
[ "org.directwebremoting" ]
org.directwebremoting;
1,856,578
return (m_deviceTypes.get(aProdKey)); } public HashMap<String, DeviceType> getDeviceTypes() { return (m_deviceTypes); }
return (m_deviceTypes.get(aProdKey)); } HashMap<String, DeviceType> functions() { return (m_deviceTypes); }
/** * Finds the device type for a given product key * @param aProdKey product key to search for * @return the device type, or null if not found */
Finds the device type for a given product key
getDeviceType
{ "repo_name": "Greblys/openhab", "path": "bundles/binding/org.openhab.binding.insteonplm/src/main/java/org/openhab/binding/insteonplm/internal/device/DeviceTypeLoader.java", "license": "epl-1.0", "size": 7536 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
156,653
public void setSubjectStratificationAnswersInternal( List<SubjectStratificationAnswer> subjectStratificationAnswers) { lazyListHelper.setInternalList(SubjectStratificationAnswer.class, subjectStratificationAnswers); }
void function( List<SubjectStratificationAnswer> subjectStratificationAnswers) { lazyListHelper.setInternalList(SubjectStratificationAnswer.class, subjectStratificationAnswers); }
/** * Sets the subject stratification answers internal. * * @param subjectStratificationAnswers the new subject stratification answers internal */
Sets the subject stratification answers internal
setSubjectStratificationAnswersInternal
{ "repo_name": "NCIP/c3pr", "path": "codebase/projects/core/src/java/edu/duke/cabig/c3pr/domain/ScheduledEpoch.java", "license": "bsd-3-clause", "size": 23900 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,758,197
@Test public void testSpentJSONSets() throws IOException, JAXBException { for(StackDouble stack : stacks) { File writerFile = new File("setToJSON.txt"); PlateWriterDouble writer = new PlateWriterDouble(writerFile); List<WellSetDouble> sets = new ArrayList<WellSetDouble>(); for(PlateDouble plate : stack) { sets.add(plate.dataSet()); } writer.setToJSON(sets); PlateReaderDouble reader = new PlateReaderDouble(writerFile); Iterator<PlateDouble> iter = stack.iterator(); int index = random.nextInt(sets.size()) + 1; for(int i = 0; i < index; i++) { reader.nextJSONSet(); } List<WellSetDouble> spent = reader.spentJSONSets(); Collections.reverse(spent); Iterator<WellSetDouble> spentIter = spent.iterator(); while(spentIter.hasNext()) { WellSetDouble inputSet = iter.next().dataSet(); WellSetDouble outputSet = spentIter.next(); Iterator<WellDouble> inputSetIter = inputSet.iterator(); Iterator<WellDouble> outputSetIter = outputSet.iterator(); while(outputSetIter.hasNext()) { WellDouble inputWell = inputSetIter.next(); WellDouble outputWell = outputSetIter.next(); assertEquals(inputWell, outputWell); assertEquals(inputWell.data(), outputWell.data()); } } reader.close(); writer.close(); writerFile.delete(); } }
void function() throws IOException, JAXBException { for(StackDouble stack : stacks) { File writerFile = new File(STR); PlateWriterDouble writer = new PlateWriterDouble(writerFile); List<WellSetDouble> sets = new ArrayList<WellSetDouble>(); for(PlateDouble plate : stack) { sets.add(plate.dataSet()); } writer.setToJSON(sets); PlateReaderDouble reader = new PlateReaderDouble(writerFile); Iterator<PlateDouble> iter = stack.iterator(); int index = random.nextInt(sets.size()) + 1; for(int i = 0; i < index; i++) { reader.nextJSONSet(); } List<WellSetDouble> spent = reader.spentJSONSets(); Collections.reverse(spent); Iterator<WellSetDouble> spentIter = spent.iterator(); while(spentIter.hasNext()) { WellSetDouble inputSet = iter.next().dataSet(); WellSetDouble outputSet = spentIter.next(); Iterator<WellDouble> inputSetIter = inputSet.iterator(); Iterator<WellDouble> outputSetIter = outputSet.iterator(); while(outputSetIter.hasNext()) { WellDouble inputWell = inputSetIter.next(); WellDouble outputWell = outputSetIter.next(); assertEquals(inputWell, outputWell); assertEquals(inputWell.data(), outputWell.data()); } } reader.close(); writer.close(); writerFile.delete(); } }
/** * Tests the spent JSON sets method. * @throws JAXBException * @throws IOException */
Tests the spent JSON sets method
testSpentJSONSets
{ "repo_name": "jessemull/MicroFlex", "path": "src/test/java/com/github/jessemull/microflex/io/iodouble/PlateReaderDoubleSetsTest.java", "license": "apache-2.0", "size": 24099 }
[ "com.github.jessemull.microflex.doubleflex.io.PlateReaderDouble", "com.github.jessemull.microflex.doubleflex.io.PlateWriterDouble", "com.github.jessemull.microflex.doubleflex.plate.PlateDouble", "com.github.jessemull.microflex.doubleflex.plate.StackDouble", "com.github.jessemull.microflex.doubleflex.plate.WellDouble", "com.github.jessemull.microflex.doubleflex.plate.WellSetDouble", "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.Collections", "java.util.Iterator", "java.util.List", "javax.xml.bind.JAXBException", "org.junit.Assert" ]
import com.github.jessemull.microflex.doubleflex.io.PlateReaderDouble; import com.github.jessemull.microflex.doubleflex.io.PlateWriterDouble; import com.github.jessemull.microflex.doubleflex.plate.PlateDouble; import com.github.jessemull.microflex.doubleflex.plate.StackDouble; import com.github.jessemull.microflex.doubleflex.plate.WellDouble; import com.github.jessemull.microflex.doubleflex.plate.WellSetDouble; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import javax.xml.bind.JAXBException; import org.junit.Assert;
import com.github.jessemull.microflex.doubleflex.io.*; import com.github.jessemull.microflex.doubleflex.plate.*; import java.io.*; import java.util.*; import javax.xml.bind.*; import org.junit.*;
[ "com.github.jessemull", "java.io", "java.util", "javax.xml", "org.junit" ]
com.github.jessemull; java.io; java.util; javax.xml; org.junit;
1,412,281
public static HttpHeaders prepareAuthedHttpHeader(String JWTBackendAuthtoken) { HttpHeaders headers = buildHttpHeader(); headers.add(AUTH_TOKEN, TOKEN_PREFIX + JWTBackendAuthtoken); return headers; }
static HttpHeaders function(String JWTBackendAuthtoken) { HttpHeaders headers = buildHttpHeader(); headers.add(AUTH_TOKEN, TOKEN_PREFIX + JWTBackendAuthtoken); return headers; }
/** * Contains Mediatype Application Json, User Agent and Auth-Informations * @param JWTBackendAuthtoken valid Auth-Token for the Backend-Session * @return http header required to mak calls against secured API */
Contains Mediatype Application Json, User Agent and Auth-Informations
prepareAuthedHttpHeader
{ "repo_name": "StefanSchubert/sabi", "path": "sabi-server/src/test/java/de/bluewhale/sabi/util/RestHelper.java", "license": "mit", "size": 1333 }
[ "org.springframework.http.HttpHeaders" ]
import org.springframework.http.HttpHeaders;
import org.springframework.http.*;
[ "org.springframework.http" ]
org.springframework.http;
2,049,972
public CmsItemLock getSingle() { if (map.size() > 1) { throw new IllegalStateException("Expected single lock but had " + map.size()); } if (map.size() == 0) { return null; } return map.values().iterator().next(); } /** * {@link Collection#contains(Object)}
CmsItemLock function() { if (map.size() > 1) { throw new IllegalStateException(STR + map.size()); } if (map.size() == 0) { return null; } return map.values().iterator().next(); } /** * {@link Collection#contains(Object)}
/** * Provides return value for lock operation with single path. * @return null if no lock, the lock if there's exactly one * @throws IllegalArgumentException if there is more than one lock, which should never happen if locking was done with a single path */
Provides return value for lock operation with single path
getSingle
{ "repo_name": "simonsoft/cms-item", "path": "src/main/java/se/simonsoft/cms/item/CmsItemLockCollection.java", "license": "apache-2.0", "size": 4680 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,330,991
public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { InetAddress broadcast = interfaceAddress.getBroadcast(); if (broadcast != null) { broadcastAddresses.add(broadcast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }
static List<String> function() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { InetAddress broadcast = interfaceAddress.getBroadcast(); if (broadcast != null) { broadcastAddresses.add(broadcast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error(STR, ex.getMessage(), ex); } return broadcastAddresses; }
/** * Get all broadcast addresses on the current host * * @return list of broadcast addresses, empty list if no broadcast addresses found */
Get all broadcast addresses on the current host
getAllBroadcastAddresses
{ "repo_name": "Snickermicker/smarthome", "path": "bundles/core/org.eclipse.smarthome.core/src/main/java/org/eclipse/smarthome/core/net/NetUtil.java", "license": "epl-1.0", "size": 27860 }
[ "java.net.Inet4Address", "java.net.InetAddress", "java.net.InterfaceAddress", "java.net.NetworkInterface", "java.net.SocketException", "java.util.Enumeration", "java.util.LinkedList", "java.util.List" ]
import java.net.Inet4Address; import java.net.InetAddress; import java.net.InterfaceAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import java.util.LinkedList; import java.util.List;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
1,134,273
public Mapper parse(ParseContext context) throws IOException { final List<Field> fields = new ArrayList<>(2); try { parseCreateField(context, fields); for (Field field : fields) { if (!customBoost()) { field.setBoost(fieldType().boost()); } context.doc().add(field); } } catch (Exception e) { throw new MapperParsingException("failed to parse [" + fieldType().names().fullName() + "]", e); } multiFields.parse(this, context); return null; }
Mapper function(ParseContext context) throws IOException { final List<Field> fields = new ArrayList<>(2); try { parseCreateField(context, fields); for (Field field : fields) { if (!customBoost()) { field.setBoost(fieldType().boost()); } context.doc().add(field); } } catch (Exception e) { throw new MapperParsingException(STR + fieldType().names().fullName() + "]", e); } multiFields.parse(this, context); return null; }
/** * Parse using the provided {@link ParseContext} and return a mapping * update if dynamic mappings modified the mappings, or {@code null} if * mappings were not modified. */
Parse using the provided <code>ParseContext</code> and return a mapping update if dynamic mappings modified the mappings, or null if mappings were not modified
parse
{ "repo_name": "vvcephei/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java", "license": "apache-2.0", "size": 30453 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List", "org.apache.lucene.document.Field" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.apache.lucene.document.Field;
import java.io.*; import java.util.*; import org.apache.lucene.document.*;
[ "java.io", "java.util", "org.apache.lucene" ]
java.io; java.util; org.apache.lucene;
574,294
public static void finishProcess() { try { wtxt.close(); wpos.close(); wparse.close(); wdep.close(); if (X.getBoolean("segmentation")) { wseg.close(); } outputStream.close(); if (X.get("outputFile") != null) { outputWriter.close(); } } catch (Exception e) { e.printStackTrace(); } }
static void function() { try { wtxt.close(); wpos.close(); wparse.close(); wdep.close(); if (X.getBoolean(STR)) { wseg.close(); } outputStream.close(); if (X.get(STR) != null) { outputWriter.close(); } } catch (Exception e) { e.printStackTrace(); } }
/** * close the files * * @param filename */
close the files
finishProcess
{ "repo_name": "zhangcongle/NewsSpikeRe", "path": "nsre2/src/main/java/edu/washington/cs/figer/analysis/Preprocessing.java", "license": "apache-2.0", "size": 20260 }
[ "edu.washington.cs.figer.util.X" ]
import edu.washington.cs.figer.util.X;
import edu.washington.cs.figer.util.*;
[ "edu.washington.cs" ]
edu.washington.cs;
2,383,690
@Override protected Date getNextExecutionTime() { long millisToExecution = ONE_MINUTE; long timestamp = millisToExecution + new Date().getTime(); return new Date(timestamp); }
Date function() { long millisToExecution = ONE_MINUTE; long timestamp = millisToExecution + new Date().getTime(); return new Date(timestamp); }
/** * Schedule to run every minute * @see ScheduledTask#getNextExecutionTime() */
Schedule to run every minute
getNextExecutionTime
{ "repo_name": "wheresmybrain/syp-scheduler", "path": "src/test/java/com/wheresmybrain/syp/scheduler/testtasks/LogSchedulerState.java", "license": "lgpl-3.0", "size": 1434 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
908,240
protected void sequence_VariableDeclarationAssign(EObject context, VariableDeclarationAssign semanticObject) { genericSequencer.createSequence(context, semanticObject); }
void function(EObject context, VariableDeclarationAssign semanticObject) { genericSequencer.createSequence(context, semanticObject); }
/** * Constraint: * (varName=ID t12+=ID* typ=TypeExpression1? t4=Expression?) */
Constraint: (varName=ID t12+=ID* typ=TypeExpression1? t4=Expression?)
sequence_VariableDeclarationAssign
{ "repo_name": "martinbaker/euclideanspace", "path": "com.euclideanspace.spad/src-gen/com/euclideanspace/spad/serializer/EditorSemanticSequencer.java", "license": "agpl-3.0", "size": 147119 }
[ "com.euclideanspace.spad.editor.VariableDeclarationAssign", "org.eclipse.emf.ecore.EObject" ]
import com.euclideanspace.spad.editor.VariableDeclarationAssign; import org.eclipse.emf.ecore.EObject;
import com.euclideanspace.spad.editor.*; import org.eclipse.emf.ecore.*;
[ "com.euclideanspace.spad", "org.eclipse.emf" ]
com.euclideanspace.spad; org.eclipse.emf;
465,946
public static LeafReader wrap(LeafReader leafReader, String field) { return UninvertingReader.wrap( new NumericHidingLeafReader(leafReader, field), Collections.singletonMap(field, UninvertingReader.Type.SORTED)::get); } private final String field; private final FieldInfos fieldInfos; private NumericHidingLeafReader(LeafReader in, String field) { super(in); this.field = field; ArrayList<FieldInfo> filteredInfos = new ArrayList<>(); for (FieldInfo fi : in.getFieldInfos()) { if (fi.name.equals(field)) { filteredInfos.add( new FieldInfo( fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(), fi.hasPayloads(), fi.getIndexOptions(), DocValuesType.NONE, -1, Collections.emptyMap(), fi.getPointDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.getVectorDimension(), fi.getVectorSimilarityFunction(), fi.isSoftDeletesField())); } else { filteredInfos.add(fi); } } fieldInfos = new FieldInfos(filteredInfos.toArray(new FieldInfo[filteredInfos.size()])); }
static LeafReader function(LeafReader leafReader, String field) { return UninvertingReader.wrap( new NumericHidingLeafReader(leafReader, field), Collections.singletonMap(field, UninvertingReader.Type.SORTED)::get); } private final String field; private final FieldInfos fieldInfos; private NumericHidingLeafReader(LeafReader in, String field) { super(in); this.field = field; ArrayList<FieldInfo> filteredInfos = new ArrayList<>(); for (FieldInfo fi : in.getFieldInfos()) { if (fi.name.equals(field)) { filteredInfos.add( new FieldInfo( fi.name, fi.number, fi.hasVectors(), fi.omitsNorms(), fi.hasPayloads(), fi.getIndexOptions(), DocValuesType.NONE, -1, Collections.emptyMap(), fi.getPointDimensionCount(), fi.getPointIndexDimensionCount(), fi.getPointNumBytes(), fi.getVectorDimension(), fi.getVectorSimilarityFunction(), fi.isSoftDeletesField())); } else { filteredInfos.add(fi); } } fieldInfos = new FieldInfos(filteredInfos.toArray(new FieldInfo[filteredInfos.size()])); }
/** * Returns a view over {@code leafReader} where {@code field} is a string instead of a numeric. */
Returns a view over leafReader where field is a string instead of a numeric
wrap
{ "repo_name": "apache/solr", "path": "solr/core/src/java/org/apache/solr/search/NumericHidingLeafReader.java", "license": "apache-2.0", "size": 4383 }
[ "java.util.ArrayList", "java.util.Collections", "org.apache.lucene.index.DocValuesType", "org.apache.lucene.index.FieldInfo", "org.apache.lucene.index.FieldInfos", "org.apache.lucene.index.LeafReader", "org.apache.solr.uninverting.UninvertingReader" ]
import java.util.ArrayList; import java.util.Collections; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.LeafReader; import org.apache.solr.uninverting.UninvertingReader;
import java.util.*; import org.apache.lucene.index.*; import org.apache.solr.uninverting.*;
[ "java.util", "org.apache.lucene", "org.apache.solr" ]
java.util; org.apache.lucene; org.apache.solr;
2,777,160
default List<Policy> findByScopeIds(List<String> scopeIds, String resourceId, String resourceServerId) { List<Policy> result = new LinkedList<>(); findByScopeIds(scopeIds, resourceId, resourceServerId, result::add); return result; }
default List<Policy> findByScopeIds(List<String> scopeIds, String resourceId, String resourceServerId) { List<Policy> result = new LinkedList<>(); findByScopeIds(scopeIds, resourceId, resourceServerId, result::add); return result; }
/** * Returns a list of {@link Policy} associated with a {@link org.keycloak.authorization.core.model.Scope} with the given <code>resourceId</code> and <code>scopeIds</code>. * * @param scopeIds the id of the scopes * @param resourceId the id of the resource. Ignored if {@code null}. * @param resourceServerId the resource server id * @return a list of policies associated with the given scopes */
Returns a list of <code>Policy</code> associated with a <code>org.keycloak.authorization.core.model.Scope</code> with the given <code>resourceId</code> and <code>scopeIds</code>
findByScopeIds
{ "repo_name": "thomasdarimont/keycloak", "path": "server-spi-private/src/main/java/org/keycloak/authorization/store/PolicyStore.java", "license": "apache-2.0", "size": 7088 }
[ "java.util.LinkedList", "java.util.List", "org.keycloak.authorization.model.Policy" ]
import java.util.LinkedList; import java.util.List; import org.keycloak.authorization.model.Policy;
import java.util.*; import org.keycloak.authorization.model.*;
[ "java.util", "org.keycloak.authorization" ]
java.util; org.keycloak.authorization;
2,588,280
public boolean checkAndMarkIfReadOnlyReplicaComplete(int replicaIndex, UserCredentials userCredentials) throws IOException, AddressToUUIDNotFoundException;
boolean function(int replicaIndex, UserCredentials userCredentials) throws IOException, AddressToUUIDNotFoundException;
/** * Checks if a read-only replica with index "replicaIndex" is a complete replica and marks it as complete * if not done yet. * * @param replicaIndex * Index of the replica. */
Checks if a read-only replica with index "replicaIndex" is a complete replica and marks it as complete if not done yet
checkAndMarkIfReadOnlyReplicaComplete
{ "repo_name": "jswrenn/xtreemfs", "path": "java/servers/src/org/xtreemfs/common/libxtreemfs/AdminFileHandle.java", "license": "bsd-3-clause", "size": 4235 }
[ "java.io.IOException", "org.xtreemfs.common.libxtreemfs.exceptions.AddressToUUIDNotFoundException", "org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC" ]
import java.io.IOException; import org.xtreemfs.common.libxtreemfs.exceptions.AddressToUUIDNotFoundException; import org.xtreemfs.foundation.pbrpc.generatedinterfaces.RPC;
import java.io.*; import org.xtreemfs.common.libxtreemfs.exceptions.*; import org.xtreemfs.foundation.pbrpc.generatedinterfaces.*;
[ "java.io", "org.xtreemfs.common", "org.xtreemfs.foundation" ]
java.io; org.xtreemfs.common; org.xtreemfs.foundation;
2,747,332
ImmutableOptionalValue<Double> lastDamage();
ImmutableOptionalValue<Double> lastDamage();
/** * Gets the last amount of damage dealt as an optional value. * * @return The last damage dealt as an optional value */
Gets the last amount of damage dealt as an optional value
lastDamage
{ "repo_name": "joshgarde/SpongeAPI", "path": "src/main/java/org/spongepowered/api/data/manipulator/immutable/entity/ImmutableDamageableData.java", "license": "mit", "size": 2520 }
[ "org.spongepowered.api.data.value.immutable.ImmutableOptionalValue" ]
import org.spongepowered.api.data.value.immutable.ImmutableOptionalValue;
import org.spongepowered.api.data.value.immutable.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
77,970
RegionSpaceUseReportRequest buildRegionSpaceUseReportRequest(Map<HRegionInfo,Long> regionSizes) { RegionSpaceUseReportRequest.Builder request = RegionSpaceUseReportRequest.newBuilder(); for (Entry<HRegionInfo, Long> entry : Objects.requireNonNull(regionSizes).entrySet()) { request.addSpaceUse(convertRegionSize(entry.getKey(), entry.getValue())); } return request.build(); } /** * Converts a pair of {@link HRegionInfo} and {@code long} into a {@link RegionSpaceUse}
RegionSpaceUseReportRequest buildRegionSpaceUseReportRequest(Map<HRegionInfo,Long> regionSizes) { RegionSpaceUseReportRequest.Builder request = RegionSpaceUseReportRequest.newBuilder(); for (Entry<HRegionInfo, Long> entry : Objects.requireNonNull(regionSizes).entrySet()) { request.addSpaceUse(convertRegionSize(entry.getKey(), entry.getValue())); } return request.build(); } /** * Converts a pair of {@link HRegionInfo} and {@code long} into a {@link RegionSpaceUse}
/** * Builds a {@link RegionSpaceUseReportRequest} protobuf message from the region size map. * * @param regionSizes Map of region info to size in bytes. * @return The corresponding protocol buffer message. */
Builds a <code>RegionSpaceUseReportRequest</code> protobuf message from the region size map
buildRegionSpaceUseReportRequest
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java", "license": "apache-2.0", "size": 143925 }
[ "java.util.Map", "java.util.Objects", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos", "org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos" ]
import java.util.Map; import java.util.Objects; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos;
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.shaded.protobuf.generated.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,849,525
if (asc == null) { asc = new OrderSpecifier<T>(Order.ASC, mixin); } return asc; }
if (asc == null) { asc = new OrderSpecifier<T>(Order.ASC, mixin); } return asc; }
/** * Create an OrderSpecifier for ascending order of this expression * * @return ascending order by this */
Create an OrderSpecifier for ascending order of this expression
asc
{ "repo_name": "izeye/querydsl", "path": "querydsl-core/src/main/java/com/querydsl/core/types/dsl/ComparableExpressionBase.java", "license": "apache-2.0", "size": 2711 }
[ "com.querydsl.core.types.Order", "com.querydsl.core.types.OrderSpecifier" ]
import com.querydsl.core.types.Order; import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.*;
[ "com.querydsl.core" ]
com.querydsl.core;
342,393
@Override public void addInputConnection(Connection connection) { super.addInputConnection(connection); if (connection.getConnectedNeuron().getParentLayer() == this .getParentLayer()) { connectionsFromThisLayer.add(connection); } else { connectionsFromOtherLayers.add(connection); } }
void function(Connection connection) { super.addInputConnection(connection); if (connection.getConnectedNeuron().getParentLayer() == this .getParentLayer()) { connectionsFromThisLayer.add(connection); } else { connectionsFromOtherLayers.add(connection); } }
/** * Adds input connection for this competitive neuron * @param connection input connection */
Adds input connection for this competitive neuron
addInputConnection
{ "repo_name": "mhl787156/MinecraftAI", "path": "libraries/neat-preview/neuroph-core-2.3/src/org/neuroph/nnet/comp/CompetitiveNeuron.java", "license": "lgpl-2.1", "size": 4023 }
[ "org.neuroph.core.Connection" ]
import org.neuroph.core.Connection;
import org.neuroph.core.*;
[ "org.neuroph.core" ]
org.neuroph.core;
2,797,953
public static Map<String, PassivePattern> getPassivesMap(String basePath) throws ParserConfigurationException, SAXException, IOException { Map<String, PassivePattern> passivesMap = new HashMap<>(); if (!basePath.endsWith(".base")) basePath += ".base"; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document base = db.parse(basePath); NodeList nl = base.getDocumentElement().getChildNodes(); // Iterating skills nodes for (int i = 0; i < nl.getLength(); i++) { Node skillNode = nl.item(i); if (skillNode.getNodeType() == javax.xml.soap.Node.ELEMENT_NODE) { try { PassivePattern pattern = SkillParser.getPassiveFromNode(skillNode); passivesMap.put(pattern.getId(), pattern); } catch (NumberFormatException | NoSuchElementException e) { Log.addSystem("passives_base_builder-fail msg///base node corrupted!"); e.printStackTrace(); } } } return passivesMap; }
static Map<String, PassivePattern> function(String basePath) throws ParserConfigurationException, SAXException, IOException { Map<String, PassivePattern> passivesMap = new HashMap<>(); if (!basePath.endsWith(".base")) basePath += ".base"; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document base = db.parse(basePath); NodeList nl = base.getDocumentElement().getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node skillNode = nl.item(i); if (skillNode.getNodeType() == javax.xml.soap.Node.ELEMENT_NODE) { try { PassivePattern pattern = SkillParser.getPassiveFromNode(skillNode); passivesMap.put(pattern.getId(), pattern); } catch (NumberFormatException NoSuchElementException e) { Log.addSystem("passives_base_builder-fail msg e.printStackTrace(); } } } return passivesMap; }
/** * Parses XML base file content and builds map with passive skills patterns as values and its IDs * as keys * * @param basePath Path to XML base * @return Map with skills patterns as values and its IDs as keys * @throws ParserConfigurationException * @throws IOException * @throws SAXException */
Parses XML base file content and builds map with passive skills patterns as values and its IDs as keys
getPassivesMap
{ "repo_name": "Isangeles/Senlin", "path": "src/main/java/pl/isangeles/senlin/util/DConnector.java", "license": "gpl-2.0", "size": 25872 }
[ "java.io.IOException", "java.util.HashMap", "java.util.Map", "java.util.NoSuchElementException", "javax.xml.parsers.DocumentBuilder", "javax.xml.parsers.DocumentBuilderFactory", "javax.xml.parsers.ParserConfigurationException", "org.w3c.dom.Document", "org.w3c.dom.Node", "org.w3c.dom.NodeList", "org.xml.sax.SAXException", "pl.isangeles.senlin.cli.Log", "pl.isangeles.senlin.data.pattern.PassivePattern", "pl.isangeles.senlin.util.parser.SkillParser" ]
import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.NoSuchElementException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import pl.isangeles.senlin.cli.Log; import pl.isangeles.senlin.data.pattern.PassivePattern; import pl.isangeles.senlin.util.parser.SkillParser;
import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; import pl.isangeles.senlin.cli.*; import pl.isangeles.senlin.data.pattern.*; import pl.isangeles.senlin.util.parser.*;
[ "java.io", "java.util", "javax.xml", "org.w3c.dom", "org.xml.sax", "pl.isangeles.senlin" ]
java.io; java.util; javax.xml; org.w3c.dom; org.xml.sax; pl.isangeles.senlin;
2,273,063
public Iterator<E> iterator() { return bag.cursor(); }
Iterator<E> function() { return bag.cursor(); }
/** * Returns a cursor over the elements of the bag. * * @return A cursor over the elements of the bag. */
Returns a cursor over the elements of the bag
iterator
{ "repo_name": "hannoman/xxl", "path": "src/xxl/core/collections/sweepAreas/BagSAImplementor.java", "license": "lgpl-3.0", "size": 6283 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,196,348
public List<HeadMatter> getHeadMatter() { return headMatter; }
List<HeadMatter> function() { return headMatter; }
/** * Returns configured head matter. * Like meta headers, but also supports e.g. &lt;link&gt; tags. */
Returns configured head matter. Like meta headers, but also supports e.g. &lt;link&gt; tags
getHeadMatter
{ "repo_name": "kdeforche/jwt", "path": "src/eu/webtoolkit/jwt/Configuration.java", "license": "gpl-2.0", "size": 31620 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
783,848
@Internal public void setSemanticProperties(SingleInputSemanticProperties properties) { this.udfSemantics = properties; this.analyzedUdfSemantics = false; }
void function(SingleInputSemanticProperties properties) { this.udfSemantics = properties; this.analyzedUdfSemantics = false; }
/** * Sets the semantic properties for the user-defined function (UDF). The semantic properties * define how fields of tuples and other objects are modified or preserved through this UDF. * The configured properties can be retrieved via {@link UdfOperator#getSemanticProperties()}. * * @param properties The semantic properties for the UDF. * @see UdfOperator#getSemanticProperties() */
Sets the semantic properties for the user-defined function (UDF). The semantic properties define how fields of tuples and other objects are modified or preserved through this UDF. The configured properties can be retrieved via <code>UdfOperator#getSemanticProperties()</code>
setSemanticProperties
{ "repo_name": "zohar-mizrahi/flink", "path": "flink-java/src/main/java/org/apache/flink/api/java/operators/SingleInputUdfOperator.java", "license": "apache-2.0", "size": 15761 }
[ "org.apache.flink.api.common.operators.SingleInputSemanticProperties" ]
import org.apache.flink.api.common.operators.SingleInputSemanticProperties;
import org.apache.flink.api.common.operators.*;
[ "org.apache.flink" ]
org.apache.flink;
1,232,556
public ConstructorAccessor getConstructorAccessor(Constructor<?> c) { return langReflectAccess().getConstructorAccessor(c); }
ConstructorAccessor function(Constructor<?> c) { return langReflectAccess().getConstructorAccessor(c); }
/** Gets the ConstructorAccessor object for a java.lang.reflect.Constructor */
Gets the ConstructorAccessor object for a
getConstructorAccessor
{ "repo_name": "karianna/jdk8_tl", "path": "jdk/src/share/classes/sun/reflect/ReflectionFactory.java", "license": "gpl-2.0", "size": 18312 }
[ "java.lang.reflect.Constructor" ]
import java.lang.reflect.Constructor;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,332,202
@SuppressWarnings("unchecked") public static <T> Class<T> getClassForName(String fullyQualifiedName) throws ClassNotFoundException { Class<?> klass = ClassUtils.getClass(fullyQualifiedName); return (Class<T>) klass; }
@SuppressWarnings(STR) static <T> Class<T> function(String fullyQualifiedName) throws ClassNotFoundException { Class<?> klass = ClassUtils.getClass(fullyQualifiedName); return (Class<T>) klass; }
/** * Gets the class for a given string name * * @param <T> * the generic type to that is this class. * * @param fullyQualifiedName * the fully qualified java name of that class * * @return the class for that fully qualified name * * @throws ClassNotFoundException * the class not found exception if the name can not be found */
Gets the class for a given string name
getClassForName
{ "repo_name": "yahoo/FlowEtl", "path": "core/src/main/java/com/yahoo/flowetl/core/util/KlassUtils.java", "license": "bsd-3-clause", "size": 3726 }
[ "org.apache.commons.lang.ClassUtils" ]
import org.apache.commons.lang.ClassUtils;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
1,595,990
protected void prepareForIndividualProperty(String name) { targetReady = true; empty = true; String[] names = propertyNodePointer.getPropertyNames(); if (!reverse) { if (startPropertyIndex == EStructuralFeaturePointer.UNSPECIFIED_PROPERTY) { startPropertyIndex = 0; } if (startIndex == NodePointer.WHOLE_COLLECTION) { startIndex = 0; } for (int i = startPropertyIndex; i < names.length; i++) { if (names[i].equals(name)) { propertyNodePointer.setPropertyIndex(i); if (i != startPropertyIndex) { startIndex = 0; includeStart = true; } empty = false; break; } } } else { if (startPropertyIndex == EStructuralFeaturePointer.UNSPECIFIED_PROPERTY) { startPropertyIndex = names.length - 1; } if (startIndex == NodePointer.WHOLE_COLLECTION) { startIndex = -1; } for (int i = startPropertyIndex; i >= 0; i--) { if (names[i].equals(name)) { propertyNodePointer.setPropertyIndex(i); if (i != startPropertyIndex) { startIndex = -1; includeStart = true; } empty = false; break; } } } }
void function(String name) { targetReady = true; empty = true; String[] names = propertyNodePointer.getPropertyNames(); if (!reverse) { if (startPropertyIndex == EStructuralFeaturePointer.UNSPECIFIED_PROPERTY) { startPropertyIndex = 0; } if (startIndex == NodePointer.WHOLE_COLLECTION) { startIndex = 0; } for (int i = startPropertyIndex; i < names.length; i++) { if (names[i].equals(name)) { propertyNodePointer.setPropertyIndex(i); if (i != startPropertyIndex) { startIndex = 0; includeStart = true; } empty = false; break; } } } else { if (startPropertyIndex == EStructuralFeaturePointer.UNSPECIFIED_PROPERTY) { startPropertyIndex = names.length - 1; } if (startIndex == NodePointer.WHOLE_COLLECTION) { startIndex = -1; } for (int i = startPropertyIndex; i >= 0; i--) { if (names[i].equals(name)) { propertyNodePointer.setPropertyIndex(i); if (i != startPropertyIndex) { startIndex = -1; includeStart = true; } empty = false; break; } } } }
/** * Prepare for an individual property. * @param name property name */
Prepare for an individual property
prepareForIndividualProperty
{ "repo_name": "Nasdanika/server", "path": "org.nasdanika.cdo/src/org/nasdanika/cdo/xpath/EStructuralFeatureIterator.java", "license": "epl-1.0", "size": 11356 }
[ "org.apache.commons.jxpath.ri.model.NodePointer" ]
import org.apache.commons.jxpath.ri.model.NodePointer;
import org.apache.commons.jxpath.ri.model.*;
[ "org.apache.commons" ]
org.apache.commons;
2,501,514