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 static int pixelTypeToGL( final JCGLPixelFormat p) { switch (p) { case PIXEL_COMPONENT_BYTE: return GL.GL_BYTE; case PIXEL_COMPONENT_FLOAT: return GL.GL_FLOAT; case PIXEL_COMPONENT_INT: return GL2ES2.GL_INT; case PIXEL_COMPONENT_SHORT: return GL...
static int function( final JCGLPixelFormat p) { switch (p) { case PIXEL_COMPONENT_BYTE: return GL.GL_BYTE; case PIXEL_COMPONENT_FLOAT: return GL.GL_FLOAT; case PIXEL_COMPONENT_INT: return GL2ES2.GL_INT; case PIXEL_COMPONENT_SHORT: return GL.GL_SHORT; case PIXEL_COMPONENT_UNSIGNED_BYTE: return GL.GL_UNSIGNED_BYTE; case ...
/** * Convert pixel types to GL constants. * * @param p The pixel type. * * @return The resulting GL constant. */
Convert pixel types to GL constants
pixelTypeToGL
{ "repo_name": "io7m/jcanephora", "path": "com.io7m.jcanephora.jogl/src/main/java/com/io7m/jcanephora/jogl/JOGLTypeConversions.java", "license": "isc", "size": 42369 }
[ "com.io7m.jcanephora.core.JCGLPixelFormat", "com.io7m.junreachable.UnreachableCodeException" ]
import com.io7m.jcanephora.core.JCGLPixelFormat; import com.io7m.junreachable.UnreachableCodeException;
import com.io7m.jcanephora.core.*; import com.io7m.junreachable.*;
[ "com.io7m.jcanephora", "com.io7m.junreachable" ]
com.io7m.jcanephora; com.io7m.junreachable;
1,399,588
public final void setTableFocusModel( final TableViewFocusModel<List<T>> value) { this.getWrappedControl().setFocusModel(value); }
final void function( final TableViewFocusModel<List<T>> value) { this.getWrappedControl().setFocusModel(value); }
/** * Sets the value of the focus model property. * * @param value * the value of the focus model property. */
Sets the value of the focus model property
setTableFocusModel
{ "repo_name": "aftenkap/jutility-javafx", "path": "src/main/java/org/jutility/javafx/control/wrapper/TableDataViewWrapper.java", "license": "apache-2.0", "size": 18577 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,869,769
char readCharLE(long position) throws IOException, EOFException;
char readCharLE(long position) throws IOException, EOFException;
/** * Read one char at the given position, little endian order. */
Read one char at the given position, little endian order
readCharLE
{ "repo_name": "ncso/openmarker", "path": "src/main/java/openmarker/trove/file/DataFileBuffer.java", "license": "apache-2.0", "size": 4017 }
[ "java.io.EOFException", "java.io.IOException" ]
import java.io.EOFException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,250,685
public static <T> T[][] removeGaps(final T[][] gapped) { if(gapped == null ) return null; if(gapped.length < 1) return Arrays.copyOf(gapped, gapped.length); final int nProts = gapped.length; final int protLen = gapped[0].length; // length of gapped proteins // Verify that input is rectangular for(i...
static <T> T[][] function(final T[][] gapped) { if(gapped == null ) return null; if(gapped.length < 1) return Arrays.copyOf(gapped, gapped.length); final int nProts = gapped.length; final int protLen = gapped[0].length; for(int i=0;i<nProts;i++) { if(gapped[i].length != protLen) { throw new IllegalArgumentException(Str...
/** * Creates a new list consisting of all columns of gapped where no row * contained a null value. * * Here, "row" refers to the first index and "column" to the second, eg * gapped.get(row).get(column) * @param gapped A rectangular matrix containing null to mark gaps * @return A new List without column...
Creates a new list consisting of all columns of gapped where no row contained a null value. Here, "row" refers to the first index and "column" to the second, eg gapped.get(row).get(column)
removeGaps
{ "repo_name": "kumar-physics/BioJava", "path": "biojava3-structure/src/main/java/org/biojava/bio/structure/io/StructureSequenceMatcher.java", "license": "lgpl-2.1", "size": 11390 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
23,787
public synchronized void free(long pos, int length) { int start = (int) (pos / blockSize); int required = getBlockCount(length); BlockRange found = null; int i = 0; for (BlockRange pr : freeSpaceList) { if (pr.start > start) { found = pr; ...
synchronized void function(long pos, int length) { int start = (int) (pos / blockSize); int required = getBlockCount(length); BlockRange found = null; int i = 0; for (BlockRange pr : freeSpaceList) { if (pr.start > start) { found = pr; break; } i++; } if (found == null) { throw DataUtils.newIllegalStateException( DataU...
/** * Mark the space as free. * * @param pos the position in bytes * @param length the number of bytes */
Mark the space as free
free
{ "repo_name": "vdr007/ThriftyPaxos", "path": "src/applications/h2/src/test/org/h2/test/store/FreeSpaceList.java", "license": "apache-2.0", "size": 6714 }
[ "org.h2.mvstore.DataUtils" ]
import org.h2.mvstore.DataUtils;
import org.h2.mvstore.*;
[ "org.h2.mvstore" ]
org.h2.mvstore;
130,273
public String toTexString(boolean useInternalVariableNames){ StringBuffer sb = new StringBuffer(); sb.append("\\{$"); int i = 0; for (Variable var: bindings.keySet()){ if (i > 0) sb.append(", "); sb.append(var.toTexString(false, useInternalVariableNames)); sb.append('='); sb.appen...
String function(boolean useInternalVariableNames){ StringBuffer sb = new StringBuffer(); sb.append("\\{$"); int i = 0; for (Variable var: bindings.keySet()){ if (i > 0) sb.append(STR); sb.append(var.toTexString(false, useInternalVariableNames)); sb.append('='); sb.append(getValue(var).toTexString()); i++; } sb.append("...
/** * Returns a representation of this solution as a latex expression. * @return a representation of this solution as a latex expression. */
Returns a representation of this solution as a latex expression
toTexString
{ "repo_name": "wwu-pi/muggl", "path": "muggl-solvers/src/de/wwu/muggl/solvers/Solution.java", "license": "gpl-3.0", "size": 8689 }
[ "de.wwu.muggl.solvers.expressions.Variable" ]
import de.wwu.muggl.solvers.expressions.Variable;
import de.wwu.muggl.solvers.expressions.*;
[ "de.wwu.muggl" ]
de.wwu.muggl;
1,640,518
public void setPrevious( Node<T> node ) { this.previous = node; }
void function( Node<T> node ) { this.previous = node; }
/** * Set the previous node. */
Set the previous node
setPrevious
{ "repo_name": "jasonpritchard/airport-baggage", "path": "src/main/java/com/flydenver/bagrouter/routing/search/SearchNode.java", "license": "mit", "size": 3581 }
[ "com.flydenver.bagrouter.routing.Node" ]
import com.flydenver.bagrouter.routing.Node;
import com.flydenver.bagrouter.routing.*;
[ "com.flydenver.bagrouter" ]
com.flydenver.bagrouter;
1,610,753
public MetaProperty<FxSingle> product() { return product; }
MetaProperty<FxSingle> function() { return product; }
/** * The meta-property for the {@code product} property. * @return the meta-property, not null */
The meta-property for the product property
product
{ "repo_name": "OpenGamma/Strata", "path": "modules/product/src/main/java/com/opengamma/strata/product/fx/FxSingleTrade.java", "license": "apache-2.0", "size": 12750 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,190,278
public void fsync(WALPointer ptr) throws IgniteCheckedException, StorageException;
void function(WALPointer ptr) throws IgniteCheckedException, StorageException;
/** * Makes sure that all log entries written to the log up until the specified pointer are actually persisted to * the underlying storage. * * @param ptr Optional pointer to sync. If {@code null}, will sync up to the latest record. * @throws IgniteCheckedException If failed to fsync. * @t...
Makes sure that all log entries written to the log up until the specified pointer are actually persisted to the underlying storage
fsync
{ "repo_name": "psadusumilli/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/IgniteWriteAheadLogManager.java", "license": "apache-2.0", "size": 5310 }
[ "org.apache.ignite.IgniteCheckedException" ]
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
626,859
public void createForwardAggregates(final long aggregateId, final List<ForwardUrl> forwardUrls) { jooq.underLock(() -> { newQueue.put(writePos -> jooq.transaction(context -> { for (final ForwardUrl forwardUrl : f...
void function(final long aggregateId, final List<ForwardUrl> forwardUrls) { jooq.underLock(() -> { newQueue.put(writePos -> jooq.transaction(context -> { for (final ForwardUrl forwardUrl : forwardUrls) { final long id = forwardAggregateId.incrementAndGet(); context .insertInto( FORWARD_AGGREGATE, FORWARD_AGGREGATE.ID, ...
/** * Create a record of the fact that we forwarded an aggregate or at least tried to. */
Create a record of the fact that we forwarded an aggregate or at least tried to
createForwardAggregates
{ "repo_name": "gchq/stroom", "path": "stroom-proxy/stroom-proxy-repo/src/main/java/stroom/proxy/repo/dao/ForwardAggregateDao.java", "license": "apache-2.0", "size": 14430 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,208,367
public void setTransactionCurrencyExchangeRate(BigDecimal transactionCurrencyExchangeRate) { this.transactionCurrencyExchangeRate = transactionCurrencyExchangeRate; }
void function(BigDecimal transactionCurrencyExchangeRate) { this.transactionCurrencyExchangeRate = transactionCurrencyExchangeRate; }
/** * Sets the transactionCurrencyExchangeRate attribute. * * @param transactionCurrencyExchangeRate The transactionCurrencyExchangeRate to set. */
Sets the transactionCurrencyExchangeRate attribute
setTransactionCurrencyExchangeRate
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/fp/businessobject/ProcurementCardTransactionDetail.java", "license": "agpl-3.0", "size": 17787 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,740,320
protected ProcessDefinitionEntity loadProcessDefinition(String processDefinitionId) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); DeploymentCache deploymentCache = configuration.getDeploymentCache(); ProcessDefinitionEntity processDefinition = deploymentCache.f...
ProcessDefinitionEntity function(String processDefinitionId) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); DeploymentCache deploymentCache = configuration.getDeploymentCache(); ProcessDefinitionEntity processDefinition = deploymentCache.findProcessDefinitionFromCache(processD...
/** * Returns the cached version if exists; does not update the entity from the database in that case */
Returns the cached version if exists; does not update the entity from the database in that case
loadProcessDefinition
{ "repo_name": "bentrm/camunda-bpm-platform", "path": "engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/ProcessDefinitionEntity.java", "license": "apache-2.0", "size": 13981 }
[ "org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl", "org.camunda.bpm.engine.impl.context.Context", "org.camunda.bpm.engine.impl.interceptor.CommandContext", "org.camunda.bpm.engine.impl.persistence.deploy.DeploymentCache" ]
import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; import org.camunda.bpm.engine.impl.context.Context; import org.camunda.bpm.engine.impl.interceptor.CommandContext; import org.camunda.bpm.engine.impl.persistence.deploy.DeploymentCache;
import org.camunda.bpm.engine.impl.cfg.*; import org.camunda.bpm.engine.impl.context.*; import org.camunda.bpm.engine.impl.interceptor.*; import org.camunda.bpm.engine.impl.persistence.deploy.*;
[ "org.camunda.bpm" ]
org.camunda.bpm;
2,041,569
@FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.TransactTime, required=true) public Date getTransactTime() { return transactTime; }
@FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.TransactTime, required=true) Date function() { return transactTime; }
/** * Message field getter. * @return field value */
Message field getter
getTransactTime
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/ConfirmationMsg.java", "license": "gpl-3.0", "size": 94557 }
[ "java.util.Date", "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import java.util.Date; import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import java.util.*; import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "java.util", "net.hades.fix" ]
java.util; net.hades.fix;
502,487
public void loadPackage() { if (isLoaded) return; isLoaded = true; URL url = getClass().getResource(packageFilename); if (url == null) { throw new RuntimeException("Missing serialized package: " + packageFilename); } URI uri = URI.createURI(url.toString()...
void function() { if (isLoaded) return; isLoaded = true; URL url = getClass().getResource(packageFilename); if (url == null) { throw new RuntimeException(STR + packageFilename); } URI uri = URI.createURI(url.toString()); Resource resource = new EcoreResourceFactoryImpl().createResource(uri); try { resource.load(null); ...
/** * Laods the package and any sub-packages from their serialized form. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Laods the package and any sub-packages from their serialized form.
loadPackage
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.wmts/src/net/opengis/gml311/impl/Gml311PackageImpl.java", "license": "lgpl-2.1", "size": 805616 }
[ "java.io.IOException", "org.eclipse.emf.common.util.URI", "org.eclipse.emf.common.util.WrappedException", "org.eclipse.emf.ecore.EPackage", "org.eclipse.emf.ecore.resource.Resource", "org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl" ]
import java.io.IOException; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.common.util.WrappedException; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import java.io.*; import org.eclipse.emf.common.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.resource.*; import org.eclipse.emf.ecore.xmi.impl.*;
[ "java.io", "org.eclipse.emf" ]
java.io; org.eclipse.emf;
1,025,136
public Map<String,String> getValByRegex(String regex) { Pattern p = Pattern.compile(regex); Map<String,String> result = new HashMap<String,String>(); Matcher m; for(Map.Entry<Object,Object> item: getProps().entrySet()) { if (item.getKey() instanceof String && item.getValue()...
Map<String,String> function(String regex) { Pattern p = Pattern.compile(regex); Map<String,String> result = new HashMap<String,String>(); Matcher m; for(Map.Entry<Object,Object> item: getProps().entrySet()) { if (item.getKey() instanceof String && item.getValue() instanceof String) { m = p.matcher((String)item.getKey()...
/** * get keys matching the the regex * @param regex * @return Map<String,String> with matching keys */
get keys matching the the regex
getValByRegex
{ "repo_name": "kl0u/visco", "path": "src/core/org/apache/hadoop/conf/Configuration.java", "license": "apache-2.0", "size": 47623 }
[ "java.util.HashMap", "java.util.Map", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
2,816,039
EList<IfcRelSequence> getIsPredecessorTo();
EList<IfcRelSequence> getIsPredecessorTo();
/** * Returns the value of the '<em><b>Is Predecessor To</b></em>' reference list. * The list contents are of type {@link org.bimserver.models.ifc4.IfcRelSequence}. * It is bidirectional and its opposite is '{@link org.bimserver.models.ifc4.IfcRelSequence#getRelatingProcess <em>Relating Process</em>}'. * <!...
Returns the value of the 'Is Predecessor To' reference list. The list contents are of type <code>org.bimserver.models.ifc4.IfcRelSequence</code>. It is bidirectional and its opposite is '<code>org.bimserver.models.ifc4.IfcRelSequence#getRelatingProcess Relating Process</code>'. If the meaning of the 'Is Predecessor To'...
getIsPredecessorTo
{ "repo_name": "opensourceBIM/BIMserver", "path": "PluginBase/generated/org/bimserver/models/ifc4/IfcProcess.java", "license": "agpl-3.0", "size": 11236 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,810,230
public void deleteFacetById(Integer facetId) throws Exception { MozuClient client = com.mozu.api.clients.commerce.catalog.admin.FacetClient.deleteFacetByIdClient( facetId); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); }
void function(Integer facetId) throws Exception { MozuClient client = com.mozu.api.clients.commerce.catalog.admin.FacetClient.deleteFacetByIdClient( facetId); client.setContext(_apiContext); client.executeRequest(); client.cleanupHttpConnection(); }
/** * Deletes the facet specified by its unique identifier. * <p><pre><code> * Facet facet = new Facet(); * facet.deleteFacetById( facetId); * </code></pre></p> * @param facetId Unique identifier of the facet to retrieve. * @return */
Deletes the facet specified by its unique identifier. <code><code> Facet facet = new Facet(); facet.deleteFacetById( facetId); </code></code>
deleteFacetById
{ "repo_name": "johngatti/mozu-java", "path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/catalog/admin/FacetResource.java", "license": "mit", "size": 8542 }
[ "com.mozu.api.MozuClient" ]
import com.mozu.api.MozuClient;
import com.mozu.api.*;
[ "com.mozu.api" ]
com.mozu.api;
880,570
public static WordBlock getWordBlockInDirOf(String direction, WordBlock from, ArrayList<WordBlock> blocks){ double minDistance = -1; WordBlock returner = null; double centerX = from.getX1() + ((from.getX2() - from.getX1()) / 2), centerY = from.getY1() + ((from.getY2() - from.getY1()) / 2); ...
static WordBlock function(String direction, WordBlock from, ArrayList<WordBlock> blocks){ double minDistance = -1; WordBlock returner = null; double centerX = from.getX1() + ((from.getX2() - from.getX1()) / 2), centerY = from.getY1() + ((from.getY2() - from.getY1()) / 2); for(WordBlock wb : blocks){ if(!wb.equals(from)...
/** * This method returns the next WordBlock in the given direction from the WordBlock passed in as an argument, * looking only in the passed list of WordBlocks * @param direction The direction in which to look for WordBlocks (UP,DOWN,LEFT,RIGHT) * @param from The WordBlock from which out we will se...
This method returns the next WordBlock in the given direction from the WordBlock passed in as an argument, looking only in the passed list of WordBlocks
getWordBlockInDirOf
{ "repo_name": "denkbares/lapdftext", "path": "src/main/java/edu/isi/bmkeg/lapdf/utils/PageOperations.java", "license": "gpl-3.0", "size": 10572 }
[ "edu.isi.bmkeg.lapdf.model.WordBlock", "java.util.ArrayList" ]
import edu.isi.bmkeg.lapdf.model.WordBlock; import java.util.ArrayList;
import edu.isi.bmkeg.lapdf.model.*; import java.util.*;
[ "edu.isi.bmkeg", "java.util" ]
edu.isi.bmkeg; java.util;
2,666,202
public Collection<Annotation> getAnnotations() { return Collections.unmodifiableCollection(annotations.values()); }
Collection<Annotation> function() { return Collections.unmodifiableCollection(annotations.values()); }
/** * Returns a collection of the annotations defined on the class. * * @return Immutable set of annotations. */
Returns a collection of the annotations defined on the class
getAnnotations
{ "repo_name": "anhth12/java-gpu", "path": "src/java/graph/Method.java", "license": "apache-2.0", "size": 8111 }
[ "java.util.Collection", "java.util.Collections" ]
import java.util.Collection; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
149,699
public RsaEcdsaHybridEncrypt build() { return new RsaEcdsaHybridEncrypt(this); } } private RsaEcdsaHybridEncrypt(Builder builder) { if (builder.senderSigner == null) { throw new IllegalArgumentException( "must set sender's signer with Builder.withSenderSigner"); } senderSi...
RsaEcdsaHybridEncrypt function() { return new RsaEcdsaHybridEncrypt(this); } } RsaEcdsaHybridEncrypt(Builder functioner) { if (builder.senderSigner == null) { throw new IllegalArgumentException( STR); } senderSigner = builder.senderSigner; if (builder.recipientPublicKey == null) { throw new IllegalArgumentException( ST...
/** * Creates the {@link RsaEcdsaHybridEncrypt} instance for this builder. * * @return the created {@link RsaEcdsaHybridEncrypt} instance. */
Creates the <code>RsaEcdsaHybridEncrypt</code> instance for this builder
build
{ "repo_name": "google/capillary", "path": "lib/src/main/java/com/google/capillary/RsaEcdsaHybridEncrypt.java", "license": "apache-2.0", "size": 7754 }
[ "com.google.capillary.RsaEcdsaConstants" ]
import com.google.capillary.RsaEcdsaConstants;
import com.google.capillary.*;
[ "com.google.capillary" ]
com.google.capillary;
1,665,928
@Override public String toString() { final String nameLevel = Strings.EMPTY + getName() + ':' + getLevel(); if (context == null) { return nameLevel; } final String contextName = context.getName(); return contextName == null ? nameLevel : nameLevel + " in " + c...
String function() { final String nameLevel = Strings.EMPTY + getName() + ':' + getLevel(); if (context == null) { return nameLevel; } final String contextName = context.getName(); return contextName == null ? nameLevel : nameLevel + STR + contextName; }
/** * Returns a String representation of this instance in the form {@code "name:level[ in context_name]"}. * @return A String describing this Logger instance. */
Returns a String representation of this instance in the form "name:level[ in context_name]"
toString
{ "repo_name": "neuro-sys/logging-log4j2", "path": "log4j-core/src/main/java/org/apache/logging/log4j/core/Logger.java", "license": "apache-2.0", "size": 15749 }
[ "org.apache.logging.log4j.util.Strings" ]
import org.apache.logging.log4j.util.Strings;
import org.apache.logging.log4j.util.*;
[ "org.apache.logging" ]
org.apache.logging;
1,144,071
@Override @SuppressWarnings("unchecked") public <T> T unwrap(Class<T> iface) throws SQLException { if (isWrapperFor(iface)) { return (T) this; } throw DbException.getInvalidValueException("iface", iface); }
@SuppressWarnings(STR) <T> T function(Class<T> iface) throws SQLException { if (isWrapperFor(iface)) { return (T) this; } throw DbException.getInvalidValueException("iface", iface); }
/** * Return an object of this class if possible. * * @param iface the class * @return this */
Return an object of this class if possible
unwrap
{ "repo_name": "vdr007/ThriftyPaxos", "path": "src/applications/h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java", "license": "apache-2.0", "size": 14281 }
[ "java.sql.SQLException", "org.h2.message.DbException" ]
import java.sql.SQLException; import org.h2.message.DbException;
import java.sql.*; import org.h2.message.*;
[ "java.sql", "org.h2.message" ]
java.sql; org.h2.message;
2,540,394
public Stream<String> containedPackagesWithoutRepository() { return getStream().map(PackageSpecification::toStringWithoutRepository); }
Stream<String> function() { return getStream().map(PackageSpecification::toStringWithoutRepository); }
/** * Returns {@link String} representations of the component {@link PackageSpecification}s of the * same format accepted by {@link #fromString}. * * <p>The returned {@link String}s are insensitive to the {@link RepositoryName} associated with * the {@link PackageSpecification}. */
Returns <code>String</code> representations of the component <code>PackageSpecification</code>s of the same format accepted by <code>#fromString</code>. The returned <code>String</code>s are insensitive to the <code>RepositoryName</code> associated with the <code>PackageSpecification</code>
containedPackagesWithoutRepository
{ "repo_name": "davidzchen/bazel", "path": "src/main/java/com/google/devtools/build/lib/packages/PackageSpecification.java", "license": "apache-2.0", "size": 15911 }
[ "java.util.stream.Stream" ]
import java.util.stream.Stream;
import java.util.stream.*;
[ "java.util" ]
java.util;
1,140,691
Vec3d getUpdatePosition();
Vec3d getUpdatePosition();
/** * Returns the camera position when the renderer was last updated * @return */
Returns the camera position when the renderer was last updated
getUpdatePosition
{ "repo_name": "maruohon/minihud", "path": "src/main/java/fi/dy/masa/minihud/renderer/IOverlayRenderer.java", "license": "lgpl-3.0", "size": 1735 }
[ "net.minecraft.util.math.Vec3d" ]
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,040,172
@SuppressWarnings("unchecked") private FlashEmbeddedObject parseFlashObjectTag( final NodeList objects, final FlashEmbeddedObject flashObjToFill ) throws MessageException { if( objects != null ) { for( int j = 0; j < objects.size() ; j++ ) { Node objectNode = objects.elementAt( j ); if( objectNode inst...
@SuppressWarnings(STR) FlashEmbeddedObject function( final NodeList objects, final FlashEmbeddedObject flashObjToFill ) throws MessageException { if( objects != null ) { for( int j = 0; j < objects.size() ; j++ ) { Node objectNode = objects.elementAt( j ); if( objectNode instanceof Tag ) { Tag objectTag = (Tag) objectN...
/** * Processes the OBJECT node that should contain the Flash animation: * @param objects the list of object tag nodes, should not be more than two, the begin and the end tags! * @param flashObjToFill the flash obect to fill in with data * @return the updated flash object * @throws MessageException if there a...
Processes the OBJECT node that should contain the Flash animation:
parseFlashObjectTag
{ "repo_name": "ivan-zapreev/x-cure-chat", "path": "src/com/xcurechat/server/utils/FlashEmbeddedParser.java", "license": "gpl-3.0", "size": 14474 }
[ "com.xcurechat.client.rpc.exceptions.MessageException", "com.xcurechat.client.utils.FlashEmbeddedObject", "java.util.Vector", "org.htmlparser.Attribute", "org.htmlparser.Node", "org.htmlparser.Tag", "org.htmlparser.filters.TagNameFilter", "org.htmlparser.util.NodeList" ]
import com.xcurechat.client.rpc.exceptions.MessageException; import com.xcurechat.client.utils.FlashEmbeddedObject; import java.util.Vector; import org.htmlparser.Attribute; import org.htmlparser.Node; import org.htmlparser.Tag; import org.htmlparser.filters.TagNameFilter; import org.htmlparser.util.NodeList;
import com.xcurechat.client.rpc.exceptions.*; import com.xcurechat.client.utils.*; import java.util.*; import org.htmlparser.*; import org.htmlparser.filters.*; import org.htmlparser.util.*;
[ "com.xcurechat.client", "java.util", "org.htmlparser", "org.htmlparser.filters", "org.htmlparser.util" ]
com.xcurechat.client; java.util; org.htmlparser; org.htmlparser.filters; org.htmlparser.util;
1,661,221
System.out.println("Starting: insertNewByName"); boolean result = true; Name = "XAutoTextContainerx" + Thread.currentThread().getName(); Name = Name.replace('-','x'); Name = Name.replace(':','x'); Name = Name.replace('.','x'); XAutoTextGroup oGroup = null; //first...
System.out.println(STR); boolean result = true; Name = STR + Thread.currentThread().getName(); Name = Name.replace('-','x'); Name = Name.replace(':','x'); Name = Name.replace('.','x'); XAutoTextGroup oGroup = null; log.println(STR); System.out.println(STR); try { oObj.removeByName(Name); log.println(STR); System.out.pr...
/** * First removes old element from container with the specified name * if it exists. Then tries to add a new group with the specified * name. <p> * * Has <b>OK</b> status if not <code>null</code> * <code>AutoTextGroup</code> instance is returned. */
First removes old element from container with the specified name if it exists. Then tries to add a new group with the specified name. Has OK status if not <code>null</code> <code>AutoTextGroup</code> instance is returned
_insertNewByName
{ "repo_name": "Limezero/libreoffice", "path": "qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java", "license": "gpl-3.0", "size": 4836 }
[ "com.sun.star.text.XAutoTextGroup" ]
import com.sun.star.text.XAutoTextGroup;
import com.sun.star.text.*;
[ "com.sun.star" ]
com.sun.star;
2,915,281
@Test public void testGetMinimumParameters() { final GrumpyAction action = new GrumpyAction(); assertThat(action.getMinimumParameters(), is(0)); }
void function() { final GrumpyAction action = new GrumpyAction(); assertThat(action.getMinimumParameters(), is(0)); }
/** * Tests for getMinimumParameters. */
Tests for getMinimumParameters
testGetMinimumParameters
{ "repo_name": "AntumDeluge/arianne-stendhal", "path": "tests/games/stendhal/client/actions/GrumpyActionTest.java", "license": "gpl-2.0", "size": 2134 }
[ "org.hamcrest.CoreMatchers", "org.junit.Assert" ]
import org.hamcrest.CoreMatchers; import org.junit.Assert;
import org.hamcrest.*; import org.junit.*;
[ "org.hamcrest", "org.junit" ]
org.hamcrest; org.junit;
2,583,326
private void firstEnty(Order order) { if (order.getAction() == Action.SELL) { //Проверяем есть ли цена выше в buy ордерах Iterator it = buyOrders.values().iterator(); if (!it.hasNext()) { sellOrders.put(order.getPrice(), order); } w...
void function(Order order) { if (order.getAction() == Action.SELL) { Iterator it = buyOrders.values().iterator(); if (!it.hasNext()) { sellOrders.put(order.getPrice(), order); } while (it.hasNext()) { Order ord = (Order) it.next(); if (order.getPrice() < ord.getPrice()) { int buyVolume = ord.getVolume(); int sellVolume...
/** * FirstEnty method. * Adding in dom set. * * @param order - order to add. */
FirstEnty method. Adding in dom set
firstEnty
{ "repo_name": "KDanila/KDanila", "path": "chapter_004/src/main/java/ru/job4j/tradesystem/DepthOfMarket.java", "license": "apache-2.0", "size": 4880 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
540,265
public void testConstrCharIntIntMathContext() { char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'}; int offset = 3; int len = 12; int precision = 4; RoundingMode rm = RoundingMode.CEILING; MathContext mc = new MathContext(p...
void function() { char value[] = {'-', '1', '2', '3', '8', '0', '.', '4', '7', '3', '8', 'E', '-', '4', '2', '3'}; int offset = 3; int len = 12; int precision = 4; RoundingMode rm = RoundingMode.CEILING; MathContext mc = new MathContext(precision, rm); BigDecimal result = new BigDecimal(value, offset, len, mc); String ...
/** * new BigDecimal(char[] value, int offset, int len, MathContext mc); */
new BigDecimal(char[] value, int offset, int len, MathContext mc)
testConstrCharIntIntMathContext
{ "repo_name": "google/desugar_jdk_libs", "path": "jdk11/src/libcore/luni/src/test/java/libcore/java/math/OldBigDecimalConstructorsTest.java", "license": "gpl-2.0", "size": 35102 }
[ "java.math.BigDecimal", "java.math.MathContext", "java.math.RoundingMode" ]
import java.math.BigDecimal; import java.math.MathContext; import java.math.RoundingMode;
import java.math.*;
[ "java.math" ]
java.math;
1,660,152
public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(Blocks.DAYLIGHT_DETECTOR); }
Item function(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(Blocks.DAYLIGHT_DETECTOR); }
/** * Get the Item that this Block should drop when harvested. */
Get the Item that this Block should drop when harvested
getItemDropped
{ "repo_name": "Severed-Infinity/technium", "path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockDaylightDetector.java", "license": "gpl-3.0", "size": 7311 }
[ "java.util.Random", "net.minecraft.block.state.IBlockState", "net.minecraft.init.Blocks", "net.minecraft.item.Item" ]
import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.item.Item;
import java.util.*; import net.minecraft.block.state.*; import net.minecraft.init.*; import net.minecraft.item.*;
[ "java.util", "net.minecraft.block", "net.minecraft.init", "net.minecraft.item" ]
java.util; net.minecraft.block; net.minecraft.init; net.minecraft.item;
2,540,961
protected static String getElement(JWTPayload payload, String element) { String output = null; if (payload != null) { Object outObj = payload.get(element); if (outObj instanceof String) { output = (String) outObj; } else if (outObj instanceof List)...
static String function(JWTPayload payload, String element) { String output = null; if (payload != null) { Object outObj = payload.get(element); if (outObj instanceof String) { output = (String) outObj; } else if (outObj instanceof List) { if (((List<String>) outObj).size() == 1) { output = ((List<String>) outObj).get(0...
/** * Get Aud element. * */
Get Aud element
getElement
{ "repo_name": "kgibm/open-liberty", "path": "dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/token/JsonTokenUtil.java", "license": "epl-1.0", "size": 16532 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,683,678
public static byte[] getBytes(long value) { return getBytes(BigInteger.valueOf(value)); }
static byte[] function(long value) { return getBytes(BigInteger.valueOf(value)); }
/** * Get value as eight bytes in big endian byte order. * @param value the value to convert * @return value as eight bytes in big endian byte order */
Get value as eight bytes in big endian byte order
getBytes
{ "repo_name": "puppetlabs/commons-compress", "path": "src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java", "license": "apache-2.0", "size": 7955 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
35,407
private static int determineConsecutiveBinaryCount(String msg, int startpos, Charset encoding) throws WriterException { final CharsetEncoder encoder = encoding.newEncoder(); int len = msg.length(); int idx = startpos; while (idx < len) { char ch = msg.charAt(idx); int numericCount = ...
static int function(String msg, int startpos, Charset encoding) throws WriterException { final CharsetEncoder encoder = encoding.newEncoder(); int len = msg.length(); int idx = startpos; while (idx < len) { char ch = msg.charAt(idx); int numericCount = 0; while (numericCount < 13 && isDigit(ch)) { numericCount++; int i...
/** * Determines the number of consecutive characters that are encodable using binary compaction. * * @param msg the message * @param startpos the start position within the message * @param encoding the charset used to convert the message to a byte array * @return the requested character count ...
Determines the number of consecutive characters that are encodable using binary compaction
determineConsecutiveBinaryCount
{ "repo_name": "Discounty/Discounty.android", "path": "app/src/main/java/discounty/com/google/zxing/pdf417/encoder/PDF417HighLevelEncoder.java", "license": "apache-2.0", "size": 17497 }
[ "java.nio.charset.Charset", "java.nio.charset.CharsetEncoder" ]
import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
2,064,533
private void testDirtyData(final Function<Person, Void> scenario, final int expectedNumberOfDirtyEntities, final int expectedDirtyEntityManagerCalls) { final DirtyEntityManager dirtyEntityManager = getDirtyEntityManager(); doReturn(dirtyEntityManager).when(ctx).getDirtyEntityManager(); final Person person = n...
void function(final Function<Person, Void> scenario, final int expectedNumberOfDirtyEntities, final int expectedDirtyEntityManagerCalls) { final DirtyEntityManager dirtyEntityManager = getDirtyEntityManager(); doReturn(dirtyEntityManager).when(ctx).getDirtyEntityManager(); final Person person = new Person(30, "name", S...
/** * Defines test that creates required mock-ups, then creates object, wraps it and invokes * {@code scenario} that is expected to invoke various methods of wrapped object. * Then test verifies that number of updates of {@link DirtyEntityManager} is as expected. * * @param scenario * @param expectedDirtyEn...
Defines test that creates required mock-ups, then creates object, wraps it and invokes scenario that is expected to invoke various methods of wrapped object. Then test verifies that number of updates of <code>DirtyEntityManager</code> is as expected
testDirtyData
{ "repo_name": "alexradzin/Mestor", "path": "core/src/test/java/org/mestor/metadata/ObjectWrapperFactoryTest.java", "license": "apache-2.0", "size": 13777 }
[ "com.google.common.base.Function", "org.mestor.context.DirtyEntityManager", "org.mestor.entities.Person", "org.mestor.util.BeanFieldMatcher", "org.mockito.Mockito" ]
import com.google.common.base.Function; import org.mestor.context.DirtyEntityManager; import org.mestor.entities.Person; import org.mestor.util.BeanFieldMatcher; import org.mockito.Mockito;
import com.google.common.base.*; import org.mestor.context.*; import org.mestor.entities.*; import org.mestor.util.*; import org.mockito.*;
[ "com.google.common", "org.mestor.context", "org.mestor.entities", "org.mestor.util", "org.mockito" ]
com.google.common; org.mestor.context; org.mestor.entities; org.mestor.util; org.mockito;
1,602,502
public String sendJSONPost(String server, String jsonString) throws Exception { //Open connection to the server httpRequestLogger.logInfo("Openning Connection to " + server); URL targetServer = new URL (server); HttpURLConnection httpConnection = (HttpURLConnection) targetServer.openConnection(); // Cre...
String function(String server, String jsonString) throws Exception { httpRequestLogger.logInfo(STR + server); URL targetServer = new URL (server); HttpURLConnection httpConnection = (HttpURLConnection) targetServer.openConnection(); httpRequestLogger.logInfo(STR); httpConnection.setRequestMethod("POST"); httpConnection...
/** * This method is used to send JSON payloads in a POST request * @param server Server URL * @param jsonString JSON string to be sent to server * @return Returns the response from the server as a String * @throws Exception Throws exception for any errors encountered */
This method is used to send JSON payloads in a POST request
sendJSONPost
{ "repo_name": "Reemahs/Cloud-Based-Internet-of-Things-Data-Interoperability-Repository", "path": "IoTCommon/src/iot/interop/http/HTTPRequest.java", "license": "lgpl-2.1", "size": 5749 }
[ "java.io.BufferedReader", "java.io.DataOutputStream", "java.io.InputStreamReader", "java.net.HttpURLConnection" ]
import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
2,610,186
private void cleanUpEnsembleProfiles(DataStore dataStore, String container, String clusterId) { List<String> profiles = new LinkedList<String>(dataStore.getContainerProfiles(container)); List<String> toRemove = new LinkedList<String>(); for (String p : profiles) { if (p.startsWit...
void function(DataStore dataStore, String container, String clusterId) { List<String> profiles = new LinkedList<String>(dataStore.getContainerProfiles(container)); List<String> toRemove = new LinkedList<String>(); for (String p : profiles) { if (p.startsWith(STR + clusterId)) { toRemove.add(p); } } profiles.removeAll(t...
/** * Removes all ensemble profiles matching the clusterId from the container. */
Removes all ensemble profiles matching the clusterId from the container
cleanUpEnsembleProfiles
{ "repo_name": "chirino/fabric8", "path": "fabric/fabric-core/src/main/java/io/fabric8/internal/ZooKeeperClusterServiceImpl.java", "license": "apache-2.0", "size": 30070 }
[ "io.fabric8.api.DataStore", "java.util.LinkedList", "java.util.List" ]
import io.fabric8.api.DataStore; import java.util.LinkedList; import java.util.List;
import io.fabric8.api.*; import java.util.*;
[ "io.fabric8.api", "java.util" ]
io.fabric8.api; java.util;
1,398,815
@Override public Iterator<Tag> iterator() { return list.iterator(); }
Iterator<Tag> function() { return list.iterator(); }
/** * Returns an iterator over this list tag. * * @return An iterator over this list tag. */
Returns an iterator over this list tag
iterator
{ "repo_name": "skunkiferous/SMEdit", "path": "jo_plugin/src/main/java/jo/sm/plugins/ship/imp/nbt/Tag.java", "license": "apache-2.0", "size": 53231 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,253,743
void hoveredValue( long eventTime, int hoveredValueIndex, PointLong devHoveredValue, int devXMouseMove, int devYMouseMove);
void hoveredValue( long eventTime, int hoveredValueIndex, PointLong devHoveredValue, int devXMouseMove, int devYMouseMove);
/** * Event is fired when mouse is moved over a line graph value point. * @param eventTime * @param hoveredValueIndex * @param devHoveredValue * @param devXMouseMove * @param devYMouseMove */
Event is fired when mouse is moved over a line graph value point
hoveredValue
{ "repo_name": "rhchen/aftrace", "path": "libs/plugins/net.tourbook.chart/src/net/tourbook/chart/IHoveredListener.java", "license": "epl-1.0", "size": 1502 }
[ "net.tourbook.common.PointLong" ]
import net.tourbook.common.PointLong;
import net.tourbook.common.*;
[ "net.tourbook.common" ]
net.tourbook.common;
2,874,925
public boolean followedFileListContains(File file) { return fileListContains(getFollowedFilesList(), file); }
boolean function(File file) { return fileListContains(getFollowedFilesList(), file); }
/** * Checks the existence of a file in the list of followed files * * @return true iff any File in the List of followed Files * (getFollowedFiles()) has the same Canonical Path as the supplied * File */
Checks the existence of a file in the list of followed files
followedFileListContains
{ "repo_name": "thecarlhall/follow", "path": "src/main/java/ghm/follow/config/FollowAppAttributes.java", "license": "gpl-2.0", "size": 17800 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
517,270
@Test public void producesACollectionOfValidators() throws Exception { MatcherAssert.assertThat( new DefaultValidatorsProvider().external().size(), Matchers.greaterThan(0) ); MatcherAssert.assertThat( new DefaultValidatorsProvider().internal().size(), ...
void function() throws Exception { MatcherAssert.assertThat( new DefaultValidatorsProvider().external().size(), Matchers.greaterThan(0) ); MatcherAssert.assertThat( new DefaultValidatorsProvider().internal().size(), Matchers.greaterThan(0) ); }
/** * ValidatorsProvider can produce a list of validators. * @throws Exception If something wrong happens inside */
ValidatorsProvider can produce a list of validators
producesACollectionOfValidators
{ "repo_name": "antonini/qulice", "path": "qulice-maven-plugin/src/test/java/com/qulice/maven/DefaultValidatorsProviderTest.java", "license": "bsd-3-clause", "size": 2363 }
[ "org.hamcrest.MatcherAssert", "org.hamcrest.Matchers" ]
import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
2,184,116
@Action( semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING ) @ActionLayout( named="Set subscriber behaviour", cssClassFa="phone" ) @MemberOrder(sequence = "500.20.1") public void subscriberBehaviour( final DemoBeha...
@Action( semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING ) @ActionLayout( named=STR, cssClassFa="phone" ) @MemberOrder(sequence = STR) void function( final DemoBehaviour behaviour) { applicationSettingsService.set(DemoBehaviour.class, behaviour); container.informUser(STR + behaviour); }
/** * To demo/test what occurs if a subscriber that might veto an event. */
To demo/test what occurs if a subscriber that might veto an event
subscriberBehaviour
{ "repo_name": "zhiqinghuang/isis-app-todoapp", "path": "app/src/main/java/todoapp/app/services/demoeventsubscriber/DemoDomainEventSubscriptions.java", "license": "apache-2.0", "size": 18703 }
[ "org.apache.isis.applib.annotation.Action", "org.apache.isis.applib.annotation.ActionLayout", "org.apache.isis.applib.annotation.MemberOrder", "org.apache.isis.applib.annotation.RestrictTo", "org.apache.isis.applib.annotation.SemanticsOf" ]
import org.apache.isis.applib.annotation.Action; import org.apache.isis.applib.annotation.ActionLayout; import org.apache.isis.applib.annotation.MemberOrder; import org.apache.isis.applib.annotation.RestrictTo; import org.apache.isis.applib.annotation.SemanticsOf;
import org.apache.isis.applib.annotation.*;
[ "org.apache.isis" ]
org.apache.isis;
1,128,628
public static void HandleUncaughtException(ConfigCompileException e, String optionalMessage, MCPlayer player) { if (optionalMessage != null) { DoWarning(optionalMessage); } DoReport(e, player); }
static void function(ConfigCompileException e, String optionalMessage, MCPlayer player) { if (optionalMessage != null) { DoWarning(optionalMessage); } DoReport(e, player); }
/** * Compile errors are always handled with the default mechanism, but to * standardize error handling, this method must be used. * * @param e * @param optionalMessage * @param player */
Compile errors are always handled with the default mechanism, but to standardize error handling, this method must be used
HandleUncaughtException
{ "repo_name": "Murreey/CommandHelper", "path": "src/main/java/com/laytonsmith/core/exceptions/ConfigRuntimeException.java", "license": "gpl-3.0", "size": 19832 }
[ "com.laytonsmith.abstraction.MCPlayer" ]
import com.laytonsmith.abstraction.MCPlayer;
import com.laytonsmith.abstraction.*;
[ "com.laytonsmith.abstraction" ]
com.laytonsmith.abstraction;
1,981,847
public void setBeginningBalance (BigDecimal BeginningBalance) { set_Value (COLUMNNAME_BeginningBalance, BeginningBalance); }
void function (BigDecimal BeginningBalance) { set_Value (COLUMNNAME_BeginningBalance, BeginningBalance); }
/** Set Beginning Balance. @param BeginningBalance Balance prior to any transactions */
Set Beginning Balance
setBeginningBalance
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_C_BankStatement.java", "license": "gpl-2.0", "size": 14636 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,181,453
public boolean checkServiceAvailable(String servicePath) { Service s = this.findService(servicePath, true); return s != null && s.getProcessingStage() == ProcessingStage.AVAILABLE; }
boolean function(String servicePath) { Service s = this.findService(servicePath, true); return s != null && s.getProcessingStage() == ProcessingStage.AVAILABLE; }
/** * Checks if the service associated with the supplied path is started * and in processing stage available */
Checks if the service associated with the supplied path is started and in processing stage available
checkServiceAvailable
{ "repo_name": "toliaqat/xenon", "path": "xenon-common/src/main/java/com/vmware/xenon/common/ServiceHost.java", "license": "apache-2.0", "size": 246752 }
[ "com.vmware.xenon.common.Service" ]
import com.vmware.xenon.common.Service;
import com.vmware.xenon.common.*;
[ "com.vmware.xenon" ]
com.vmware.xenon;
2,030,972
public static TableUpdates jsonNodeToTableUpdates(JsonNode updatesJson, DatabaseSchema dbSchema) { Map<String, TableUpdate> tableUpdateMap = Maps.newHashMap(); Iterator<Map.Entry<String, JsonNode>> tableUpdatesItr = updatesJson.fields(); while (tableUpdatesItr.hasNext()) { Ma...
static TableUpdates function(JsonNode updatesJson, DatabaseSchema dbSchema) { Map<String, TableUpdate> tableUpdateMap = Maps.newHashMap(); Iterator<Map.Entry<String, JsonNode>> tableUpdatesItr = updatesJson.fields(); while (tableUpdatesItr.hasNext()) { Map.Entry<String, JsonNode> entry = tableUpdatesItr.next(); TableSc...
/** * convert the params of Update Notification into TableUpdates. * @param updatesJson the params of Update Notification * @param dbSchema DatabaseSchema entity * @return TableUpdates */
convert the params of Update Notification into TableUpdates
jsonNodeToTableUpdates
{ "repo_name": "kuangrewawa/OnosFw", "path": "ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/utils/FromJsonUtil.java", "license": "apache-2.0", "size": 13935 }
[ "com.fasterxml.jackson.databind.JsonNode", "com.google.common.collect.Maps", "java.util.Iterator", "java.util.Map", "org.onosproject.ovsdb.rfc.message.TableUpdate", "org.onosproject.ovsdb.rfc.message.TableUpdates", "org.onosproject.ovsdb.rfc.schema.DatabaseSchema", "org.onosproject.ovsdb.rfc.schema.Ta...
import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Maps; import java.util.Iterator; import java.util.Map; import org.onosproject.ovsdb.rfc.message.TableUpdate; import org.onosproject.ovsdb.rfc.message.TableUpdates; import org.onosproject.ovsdb.rfc.schema.DatabaseSchema; import org.onosproj...
import com.fasterxml.jackson.databind.*; import com.google.common.collect.*; import java.util.*; import org.onosproject.ovsdb.rfc.message.*; import org.onosproject.ovsdb.rfc.schema.*;
[ "com.fasterxml.jackson", "com.google.common", "java.util", "org.onosproject.ovsdb" ]
com.fasterxml.jackson; com.google.common; java.util; org.onosproject.ovsdb;
1,111,125
public Single<Member<Connection>> member() { return pool.member(); }
Single<Member<Connection>> function() { return pool.member(); }
/** * Returns a Single of a member of the connection pool. When finished with the * emitted member you must call {@code member.checkin()} to return the * connection to the pool. * * @return a single member of the connection pool */
Returns a Single of a member of the connection pool. When finished with the emitted member you must call member.checkin() to return the connection to the pool
member
{ "repo_name": "davidmoten/rxjava2-jdbc", "path": "rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/Database.java", "license": "apache-2.0", "size": 10113 }
[ "io.reactivex.Single", "java.sql.Connection", "org.davidmoten.rx.pool.Member" ]
import io.reactivex.Single; import java.sql.Connection; import org.davidmoten.rx.pool.Member;
import io.reactivex.*; import java.sql.*; import org.davidmoten.rx.pool.*;
[ "io.reactivex", "java.sql", "org.davidmoten.rx" ]
io.reactivex; java.sql; org.davidmoten.rx;
764,358
public Result getEagerResult(Connection conn, PreparedStatement stmnt, ResultSet rs, JDBCStore store, JDBCFetchConfiguration fetch, boolean forUpdate, SQLBuffer sql) throws SQLException { SQLAzureSelectResult res = new SQLAzureSelectResult(conn, stmnt, rs, _dict); res.setSele...
Result function(Connection conn, PreparedStatement stmnt, ResultSet rs, JDBCStore store, JDBCFetchConfiguration fetch, boolean forUpdate, SQLBuffer sql) throws SQLException { SQLAzureSelectResult res = new SQLAzureSelectResult(conn, stmnt, rs, _dict); res.setSelect(this); res.setStore(store); res.setLocking(forUpdate);...
/** * This method is to provide override for non-JDBC or JDBC-like implementation of executing eager selects. */
This method is to provide override for non-JDBC or JDBC-like implementation of executing eager selects
getEagerResult
{ "repo_name": "Tirasa/protojpasqlazure", "path": "src/main/java/org/apache/openjpa/jdbc/sql/SQLAzureSelectImpl.java", "license": "apache-2.0", "size": 106232 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException", "org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration", "org.apache.openjpa.jdbc.kernel.JDBCStore" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCStore;
import java.sql.*; import org.apache.openjpa.jdbc.kernel.*;
[ "java.sql", "org.apache.openjpa" ]
java.sql; org.apache.openjpa;
1,205,150
ResizeRequestBuilder prepareResizeIndex(String sourceIndex, String targetIndex);
ResizeRequestBuilder prepareResizeIndex(String sourceIndex, String targetIndex);
/** * Resize an index using an explicit request allowing to specify the settings, mappings and aliases of the target index of the index. */
Resize an index using an explicit request allowing to specify the settings, mappings and aliases of the target index of the index
prepareResizeIndex
{ "repo_name": "ern/elasticsearch", "path": "server/src/main/java/org/elasticsearch/client/IndicesAdminClient.java", "license": "apache-2.0", "size": 26477 }
[ "org.elasticsearch.action.admin.indices.shrink.ResizeRequestBuilder" ]
import org.elasticsearch.action.admin.indices.shrink.ResizeRequestBuilder;
import org.elasticsearch.action.admin.indices.shrink.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
587,236
public Map<Integer, QueryResultObjectData> getHyperlinkMap(Map<String,QueryResultObjectData> queryResultsObjectDataMap, Vector<DataElement> resultView) throws DAOException { Map<Integer, QueryResultObjectData> map = new HashMap<Integer, QueryResultObjectData>(); JDBCDAO dao = (JDBCDAO) DAOFactory.getInstance...
Map<Integer, QueryResultObjectData> function(Map<String,QueryResultObjectData> queryResultsObjectDataMap, Vector<DataElement> resultView) throws DAOException { Map<Integer, QueryResultObjectData> map = new HashMap<Integer, QueryResultObjectData>(); JDBCDAO dao = (JDBCDAO) DAOFactory.getInstance().getDAO(Constants.JDBC_...
/** * To get the Map representing the Index of the column to be hyperlinked verses the QueryResultObjectData, which containes information about the Id column & alias name of the object associated with that column. * @param queryResultsObjectDataMap The Map of alias name verses QueryResultObjectData, Contains info...
To get the Map representing the Index of the column to be hyperlinked verses the QueryResultObjectData, which containes information about the Id column & alias name of the object associated with that column
getHyperlinkMap
{ "repo_name": "NCIP/cab2b", "path": "software/dependencies/commonpackage/HEAD_TAG_10_Jan_2007_RELEASE_BRANCH_FOR_V11/src/edu/wustl/common/bizlogic/SimpleQueryBizLogic.java", "license": "bsd-3-clause", "size": 36521 }
[ "edu.wustl.common.beans.QueryResultObjectData", "edu.wustl.common.dao.DAOFactory", "edu.wustl.common.query.DataElement", "edu.wustl.common.util.dbManager.DAOException", "edu.wustl.common.util.global.Constants", "java.util.HashMap", "java.util.List", "java.util.Map", "java.util.Vector" ]
import edu.wustl.common.beans.QueryResultObjectData; import edu.wustl.common.dao.DAOFactory; import edu.wustl.common.query.DataElement; import edu.wustl.common.util.dbManager.DAOException; import edu.wustl.common.util.global.Constants; import java.util.HashMap; import java.util.List; import java.util.Map; import java.u...
import edu.wustl.common.beans.*; import edu.wustl.common.dao.*; import edu.wustl.common.query.*; import edu.wustl.common.util.*; import edu.wustl.common.util.global.*; import java.util.*;
[ "edu.wustl.common", "java.util" ]
edu.wustl.common; java.util;
2,104,428
public BlockingQueue<InotifyEvent> getQueue() { return queue; }
BlockingQueue<InotifyEvent> function() { return queue; }
/** * Returns the blocking queue backing the service. * * @return Blocking queue containing inotify events */
Returns the blocking queue backing the service
getQueue
{ "repo_name": "glassbeam/watcher", "path": "src/java/classes/com/den_4/inotify_java/MonitorService.java", "license": "gpl-3.0", "size": 25230 }
[ "java.util.concurrent.BlockingQueue" ]
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,837,004
private Collection<KeyFrame> buildFramesForPeople(SceneBuilder.ShapeProvider shapeProvider, String[] selectedPeople) throws IOException{ Collection<KeyFrame> frames = new ArrayList<>(); Collection<String> selectedPeopleCol = null; if ((selectedPeople != null) && (selectedPeople.length != 0)){ selectedPeople...
Collection<KeyFrame> function(SceneBuilder.ShapeProvider shapeProvider, String[] selectedPeople) throws IOException{ Collection<KeyFrame> frames = new ArrayList<>(); Collection<String> selectedPeopleCol = null; if ((selectedPeople != null) && (selectedPeople.length != 0)){ selectedPeopleCol = Arrays.<String>asList(sele...
/** * Using the {@link MapScene#checkpointDb}, this method converts its contents into the format * specified by JavaFX {@link Timeline} animation model. The people shapes collection is * filled with the individual nodes that represent the persons. * @param shapeProvider Used for generating the visualizations...
Using the <code>MapScene#checkpointDb</code>, this method converts its contents into the format specified by JavaFX <code>Timeline</code> animation model. The people shapes collection is filled with the individual nodes that represent the persons
buildFramesForPeople
{ "repo_name": "d3scomp/ascens-tutorial-visualiser", "path": "src/cz/filipekt/jdcv/MapScene.java", "license": "mit", "size": 31465 }
[ "cz.filipekt.jdcv.SceneBuilder", "java.io.IOException", "java.util.ArrayList", "java.util.Arrays", "java.util.Collection", "java.util.List", "java.util.Map" ]
import cz.filipekt.jdcv.SceneBuilder; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map;
import cz.filipekt.jdcv.*; import java.io.*; import java.util.*;
[ "cz.filipekt.jdcv", "java.io", "java.util" ]
cz.filipekt.jdcv; java.io; java.util;
556,417
public Artifact compiledStoryboardZip(Artifact input) { return appendExtension("/" + BundleableFile.flatBundlePath(input.getExecPath()) + ".zip"); }
Artifact function(Artifact input) { return appendExtension("/" + BundleableFile.flatBundlePath(input.getExecPath()) + ".zip"); }
/** * The artifact which contains the zipped-up results of compiling the storyboard. This is merged * into the final bundle under the {@code .app} or {@code .bundle} directory root. */
The artifact which contains the zipped-up results of compiling the storyboard. This is merged into the final bundle under the .app or .bundle directory root
compiledStoryboardZip
{ "repo_name": "hhclam/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java", "license": "apache-2.0", "size": 14045 }
[ "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.*;
[ "com.google.devtools" ]
com.google.devtools;
8,983
public TransportListener getListener() { checkActivateWarning("getListener"); if (listener == null && parent != null) { return parent.getListener(); } return listener; }
TransportListener function() { checkActivateWarning(STR); if (listener == null && parent != null) { return parent.getListener(); } return listener; }
/** * Get listener used for incoming message. * * @return listener */
Get listener used for incoming message
getListener
{ "repo_name": "jsdjayanga/wso2-axis2", "path": "modules/kernel/src/org/apache/axis2/client/Options.java", "license": "apache-2.0", "size": 61024 }
[ "org.apache.axis2.transport.TransportListener" ]
import org.apache.axis2.transport.TransportListener;
import org.apache.axis2.transport.*;
[ "org.apache.axis2" ]
org.apache.axis2;
882,888
private static Collection<List<String>> newBagOrSet(boolean bag) { if (bag) { return new ArrayList<List<String>>(); } else { return new HashSet<List<String>>(); } } /** * Convert a {@code Collection} of rows to an array of string arrays that * can b...
static Collection<List<String>> function(boolean bag) { if (bag) { return new ArrayList<List<String>>(); } else { return new HashSet<List<String>>(); } } /** * Convert a {@code Collection} of rows to an array of string arrays that * can be passed as an argument with expected results to * {@link JDBC#assertUnorderedResu...
/** * Create a {@code Collection} that can be used as a bag or a set. * * @param bag tells whether or not the collection should be a bag * @return a {@code List} if a bag is requested, or a {@code Set} otherwise */
Create a Collection that can be used as a bag or a set
newBagOrSet
{ "repo_name": "trejkaz/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/lang/GroupByTest.java", "license": "apache-2.0", "size": 108453 }
[ "java.sql.ResultSet", "java.util.ArrayList", "java.util.Collection", "java.util.HashSet", "java.util.List" ]
import java.sql.ResultSet; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
216,353
@Test public final void testReadFrom() throws IOException { Unpacker unpacker = Mockito.mock(Unpacker.class); doReturn("publisherId").doReturn("eventType").when(unpacker) .readString(); target.readFrom(unpacker); verify(unpacker).readArrayBegin(); verify(unpacker, times(3)).readString(...
final void function() throws IOException { Unpacker unpacker = Mockito.mock(Unpacker.class); doReturn(STR).doReturn(STR).when(unpacker) .readString(); target.readFrom(unpacker); verify(unpacker).readArrayBegin(); verify(unpacker, times(3)).readString(); verify(unpacker).readValue(); verify(unpacker).readArrayEnd(); }
/** * Test method for {@link org.o3project.odenos.remoteobject.message.Event#readFrom(org.msgpack.unpacker.Unpacker)}. * @throws IOException throws IOException in targets */
Test method for <code>org.o3project.odenos.remoteobject.message.Event#readFrom(org.msgpack.unpacker.Unpacker)</code>
testReadFrom
{ "repo_name": "haizawa/odenos", "path": "src/test/java/org/o3project/odenos/remoteobject/message/EventTest.java", "license": "apache-2.0", "size": 11042 }
[ "java.io.IOException", "org.mockito.Mockito", "org.msgpack.unpacker.Unpacker" ]
import java.io.IOException; import org.mockito.Mockito; import org.msgpack.unpacker.Unpacker;
import java.io.*; import org.mockito.*; import org.msgpack.unpacker.*;
[ "java.io", "org.mockito", "org.msgpack.unpacker" ]
java.io; org.mockito; org.msgpack.unpacker;
43,130
public void handleWindowProperty(S31PacketWindowProperty packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); EntityPlayer entityplayer = this.gameController.thePlayer; if (entityplayer.openContainer != null && entityplayer.openContainer.windowId == packetIn.getWindowId()) ...
void function(S31PacketWindowProperty packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); EntityPlayer entityplayer = this.gameController.thePlayer; if (entityplayer.openContainer != null && entityplayer.openContainer.windowId == packetIn.getWindowId()) { entityplayer.openContainer....
/** * Sets the progressbar of the opened window to the specified value */
Sets the progressbar of the opened window to the specified value
handleWindowProperty
{ "repo_name": "SkidJava/BaseClient", "path": "new_1.8.8/net/minecraft/client/network/NetHandlerPlayClient.java", "license": "gpl-2.0", "size": 83135 }
[ "net.minecraft.entity.player.EntityPlayer", "net.minecraft.network.PacketThreadUtil", "net.minecraft.network.play.server.S31PacketWindowProperty" ]
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.PacketThreadUtil; import net.minecraft.network.play.server.S31PacketWindowProperty;
import net.minecraft.entity.player.*; import net.minecraft.network.*; import net.minecraft.network.play.server.*;
[ "net.minecraft.entity", "net.minecraft.network" ]
net.minecraft.entity; net.minecraft.network;
2,663,924
@Override public String generateMatchArgWhere(String id) { ArrayList<IdField> keys = getParentKeys(); CharBuffer cb = CharBuffer.allocate(); for (int i = 0; i < keys.size(); i++) { if (i != 0) cb.append(" and "); generateMatchArgWhere(cb, keys.get(i), id); } return cb.c...
String function(String id) { ArrayList<IdField> keys = getParentKeys(); CharBuffer cb = CharBuffer.allocate(); for (int i = 0; i < keys.size(); i++) { if (i != 0) cb.append(STR); generateMatchArgWhere(cb, keys.get(i), id); } return cb.close(); }
/** * Generates the where clause. */
Generates the where clause
generateMatchArgWhere
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/amber/field/SubId.java", "license": "gpl-2.0", "size": 7074 }
[ "com.caucho.util.CharBuffer", "java.util.ArrayList" ]
import com.caucho.util.CharBuffer; import java.util.ArrayList;
import com.caucho.util.*; import java.util.*;
[ "com.caucho.util", "java.util" ]
com.caucho.util; java.util;
475,848
private static Format getAdjustedSampleFormat(Format format, long sampleOffsetUs) { if (format == null) { return null; } if (sampleOffsetUs != 0 && format.subsampleOffsetUs != Format.OFFSET_SAMPLE_RELATIVE) { format = format.copyWithSubsampleOffsetUs(format.subsampleOffsetUs + sampleOffsetUs);...
static Format function(Format format, long sampleOffsetUs) { if (format == null) { return null; } if (sampleOffsetUs != 0 && format.subsampleOffsetUs != Format.OFFSET_SAMPLE_RELATIVE) { format = format.copyWithSubsampleOffsetUs(format.subsampleOffsetUs + sampleOffsetUs); } return format; } private static final class Al...
/** * Adjusts a {@link Format} to incorporate a sample offset into {@link Format#subsampleOffsetUs}. * * @param format The {@link Format} to adjust. * @param sampleOffsetUs The offset to apply. * @return The adjusted {@link Format}. */
Adjusts a <code>Format</code> to incorporate a sample offset into <code>Format#subsampleOffsetUs</code>
getAdjustedSampleFormat
{ "repo_name": "antoniodiraff/ExoPlayer_Library_0.1", "path": "library/core/src/main/java/com/google/android/exoplayer2/source/SampleQueue.java", "license": "apache-2.0", "size": 25971 }
[ "android.support.annotation.Nullable", "com.google.android.exoplayer2.Format", "com.google.android.exoplayer2.upstream.Allocation" ]
import android.support.annotation.Nullable; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.upstream.Allocation;
import android.support.annotation.*; import com.google.android.exoplayer2.*; import com.google.android.exoplayer2.upstream.*;
[ "android.support", "com.google.android" ]
android.support; com.google.android;
565,519
private void createAndShowConnectFrame(){ try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } ...
void function(){ try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (STR.equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException InstantiationException IllegalAccessException UnsupportedLookAndFeelException e) {} connectFrame.setDefau...
/** * Creates and shows the window containing connection options. */
Creates and shows the window containing connection options
createAndShowConnectFrame
{ "repo_name": "filipekt/save-the-world", "path": "src/main/java/cz/filipekt/GUIclient.java", "license": "mit", "size": 32585 }
[ "java.awt.Container", "java.awt.GridBagConstraints", "java.awt.GridBagLayout", "java.awt.event.ActionListener", "javax.swing.JButton", "javax.swing.JComboBox", "javax.swing.JFrame", "javax.swing.JLabel", "javax.swing.JTextField", "javax.swing.UIManager", "javax.swing.UnsupportedLookAndFeelExcept...
import java.awt.Container; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.UIManager; import javax.sw...
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
270,096
@ServiceMethod(returns = ReturnType.SINGLE) void performMaintenance(String resourceGroupName, String vmName);
@ServiceMethod(returns = ReturnType.SINGLE) void performMaintenance(String resourceGroupName, String vmName);
/** * The operation to perform maintenance on a virtual machine. * * @param resourceGroupName The name of the resource group. * @param vmName The name of the virtual machine. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.ex...
The operation to perform maintenance on a virtual machine
performMaintenance
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java", "license": "mit", "size": 106942 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.*;
[ "com.azure.core" ]
com.azure.core;
2,054,158
public void saveGame(Game2D game, String fileName) { FileOutputStream fos = null; ObjectOutputStream out = null; try { fos = new FileOutputStream(fileName); out = new ObjectOutputStream(fos); out.writeObject(game); out.close(); game.setSaved(true); } catch(IO...
void function(Game2D game, String fileName) { FileOutputStream fos = null; ObjectOutputStream out = null; try { fos = new FileOutputStream(fileName); out = new ObjectOutputStream(fos); out.writeObject(game); out.close(); game.setSaved(true); } catch(IOException ex) { ex.printStackTrace(); } } public void setBackgroundC...
/** * Save a Game to a File * @param game Game2D to save * @param fileName File name of the Game2D saved */
Save a Game to a File
saveGame
{ "repo_name": "tabuto/j2dgf", "path": "src/com/tabuto/j2dgf/gui/J2DCanvasPanel.java", "license": "lgpl-3.0", "size": 8622 }
[ "com.tabuto.j2dgf.Game2D", "java.awt.Color", "java.io.FileOutputStream", "java.io.IOException", "java.io.ObjectOutputStream" ]
import com.tabuto.j2dgf.Game2D; import java.awt.Color; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream;
import com.tabuto.j2dgf.*; import java.awt.*; import java.io.*;
[ "com.tabuto.j2dgf", "java.awt", "java.io" ]
com.tabuto.j2dgf; java.awt; java.io;
2,860,857
public void setGestureDetector(ScaleGestureDetector gestureDetector) { this.mGestureDetector = gestureDetector; }
void function(ScaleGestureDetector gestureDetector) { this.mGestureDetector = gestureDetector; }
/** * Set external custom gesture detector */
Set external custom gesture detector
setGestureDetector
{ "repo_name": "PAC-ROM/android_frameworks_opt_cards", "path": "src/com/android/cards/view/CardListView.java", "license": "apache-2.0", "size": 15498 }
[ "android.view.ScaleGestureDetector" ]
import android.view.ScaleGestureDetector;
import android.view.*;
[ "android.view" ]
android.view;
672,660
public String getNotificationMessage(Resources resources) { switch (state) { case ERROR: return getError(resources); default: return null; } }
String function(Resources resources) { switch (state) { case ERROR: return getError(resources); default: return null; } }
/** * Pass notification messages to the main UI */
Pass notification messages to the main UI
getNotificationMessage
{ "repo_name": "aksalj/SMSSync", "path": "smssync/src/main/java/org/addhen/smssync/presentation/task/state/State.java", "license": "lgpl-3.0", "size": 2863 }
[ "android.content.res.Resources" ]
import android.content.res.Resources;
import android.content.res.*;
[ "android.content" ]
android.content;
1,559,494
public final boolean readBatteryLevel() { final BluetoothGatt gatt = mBluetoothGatt; if (gatt == null) return false; final BluetoothGattService batteryService = gatt.getService(BATTERY_SERVICE); if (batteryService == null) return false; final Bluetoo...
final boolean function() { final BluetoothGatt gatt = mBluetoothGatt; if (gatt == null) return false; final BluetoothGattService batteryService = gatt.getService(BATTERY_SERVICE); if (batteryService == null) return false; final BluetoothGattCharacteristic batteryLevelCharacteristic = batteryService.getCharacteristic(BA...
/** * Reads the battery level from the device. * * @return true if request has been sent */
Reads the battery level from the device
readBatteryLevel
{ "repo_name": "codezork/BlueNodes", "path": "mobile/bluenodes/src/main/java/de/bluenodes/bluenodescontroller/profile/BleManager.java", "license": "apache-2.0", "size": 47051 }
[ "android.bluetooth.BluetoothGatt", "android.bluetooth.BluetoothGattCharacteristic", "android.bluetooth.BluetoothGattService", "no.nordicsemi.android.log.Logger" ]
import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattService; import no.nordicsemi.android.log.Logger;
import android.bluetooth.*; import no.nordicsemi.android.log.*;
[ "android.bluetooth", "no.nordicsemi.android" ]
android.bluetooth; no.nordicsemi.android;
2,113,289
public LegendItem getLegendItem(int series) { LegendItem result = null; PolarPlot polarPlot = getPlot(); if (polarPlot != null) { XYDataset dataset; dataset = polarPlot.getDataset(); if (dataset != null) { String label = dataset.getSeriesKe...
LegendItem function(int series) { LegendItem result = null; PolarPlot polarPlot = getPlot(); if (polarPlot != null) { XYDataset dataset; dataset = polarPlot.getDataset(); if (dataset != null) { String label = dataset.getSeriesKey(series).toString(); String description = label; Shape shape = getSeriesShape(series); Pain...
/** * Return the legend for the given series. * * @param series the series index. * * @return The legend item. */
Return the legend for the given series
getLegendItem
{ "repo_name": "opensim-org/opensim-gui", "path": "Gui/opensim/jfreechart/src/org/jfree/chart/renderer/DefaultPolarItemRenderer.java", "license": "apache-2.0", "size": 11424 }
[ "java.awt.Paint", "java.awt.Shape", "java.awt.Stroke", "org.jfree.chart.LegendItem", "org.jfree.chart.plot.PolarPlot", "org.jfree.data.xy.XYDataset" ]
import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import org.jfree.chart.LegendItem; import org.jfree.chart.plot.PolarPlot; import org.jfree.data.xy.XYDataset;
import java.awt.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*;
[ "java.awt", "org.jfree.chart", "org.jfree.data" ]
java.awt; org.jfree.chart; org.jfree.data;
2,722,467
protected void beforeShow(Form f) { }
void function(Form f) { }
/** * This method allows binding an action that should occur before showing the given * form * * @param f the form about to be shown */
This method allows binding an action that should occur before showing the given form
beforeShow
{ "repo_name": "sdwolf/CodenameOne", "path": "CodenameOne/src/com/codename1/ui/util/UIBuilder.java", "license": "gpl-2.0", "size": 117544 }
[ "com.codename1.ui.Form" ]
import com.codename1.ui.Form;
import com.codename1.ui.*;
[ "com.codename1.ui" ]
com.codename1.ui;
1,325,322
public static List<String> jsonToList(String json) { json = "{array:" + json + "}"; JSONObject obj = new JSONObject(json); JSONArray arr = obj.optJSONArray("array"); final List<String> list = new ArrayList<>(); for(int i = 0; i < arr.length(); i++) { list.add(arr.getString(i)); } return list; }
static List<String> function(String json) { json = STR + json + "}"; JSONObject obj = new JSONObject(json); JSONArray arr = obj.optJSONArray("array"); final List<String> list = new ArrayList<>(); for(int i = 0; i < arr.length(); i++) { list.add(arr.getString(i)); } return list; }
/** * Converts JSON to a list of strings * * @param json json string * @return list of strings */
Converts JSON to a list of strings
jsonToList
{ "repo_name": "MarcinWieczorek/NovaGuilds", "path": "src/main/java/co/marcin/novaguilds/util/StringUtils.java", "license": "gpl-3.0", "size": 14594 }
[ "java.util.ArrayList", "java.util.List", "org.json.JSONArray", "org.json.JSONObject" ]
import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONObject;
import java.util.*; import org.json.*;
[ "java.util", "org.json" ]
java.util; org.json;
1,360,903
@NotNull @Size(max = 5) public String getAllowGrade() { return (String) get(4); }
@Size(max = 5) String function() { return (String) get(4); }
/** * Getter for <code>isy.internship_release.allow_grade</code>. */
Getter for <code>isy.internship_release.allow_grade</code>
getAllowGrade
{ "repo_name": "zbeboy/ISY", "path": "src/main/java/top/zbeboy/isy/domain/tables/records/InternshipReleaseRecord.java", "license": "mit", "size": 16347 }
[ "javax.validation.constraints.Size" ]
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
[ "javax.validation" ]
javax.validation;
2,797,028
public static String extractTokenFromHeaders(Headers headers, String cookieHeader) { String authHeader = headers.get(AuthenticatorConstants.AUTHORIZATION_HTTP_HEADER); String token = ""; if (authHeader != null) { authHeader = authHeader.trim(); if (authHeader.toLowerC...
static String function(Headers headers, String cookieHeader) { String authHeader = headers.get(AuthenticatorConstants.AUTHORIZATION_HTTP_HEADER); String token = STR STR;STRSTR="); if (tokenParts.length == 2) { token += tokenParts[1]; } } return token; }
/** * Method used to extract refresh token from headers. * @param headers headers which contains the access token * @return refresh token present in the cookie and authorization header.. */
Method used to extract refresh token from headers
extractTokenFromHeaders
{ "repo_name": "abimarank/carbon-apimgt", "path": "components/web/services/org.wso2.carbon.apimgt.authenticator/src/main/java/org/wso2/carbon/apimgt/authenticator/utils/AuthUtil.java", "license": "apache-2.0", "size": 6490 }
[ "org.wso2.carbon.apimgt.authenticator.constants.AuthenticatorConstants", "org.wso2.carbon.messaging.Headers" ]
import org.wso2.carbon.apimgt.authenticator.constants.AuthenticatorConstants; import org.wso2.carbon.messaging.Headers;
import org.wso2.carbon.apimgt.authenticator.constants.*; import org.wso2.carbon.messaging.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
765,569
private void copyTomcatGeodeReqFiles(String moduleJarDir, String extraJarsPath) throws IOException { ArrayList<File> requiredFiles = new ArrayList<>(); // The library path for the current tomcat installation String tomcatLibPath = getHome() + "/lib/"; // List of required jars and form version r...
void function(String moduleJarDir, String extraJarsPath) throws IOException { ArrayList<File> requiredFiles = new ArrayList<>(); String tomcatLibPath = getHome() + "/lib/"; String versionRegex = STR; ArrayList<Pattern> patterns = new ArrayList<>(tomcatRequiredJars.length); for (String jar : tomcatRequiredJars) patterns...
/** * Copies jars specified by {@link #tomcatRequiredJars} from the {@link #getModulePath()} and the * specified other directory passed to the function * * @throws IOException if the {@link #getModulePath()}, installation lib directory, or extra * directory passed in contain no files. */
Copies jars specified by <code>#tomcatRequiredJars</code> from the <code>#getModulePath()</code> and the specified other directory passed to the function
copyTomcatGeodeReqFiles
{ "repo_name": "smanvi-pivotal/geode", "path": "geode-assembly/src/test/java/org/apache/geode/session/tests/TomcatInstall.java", "license": "apache-2.0", "size": 12153 }
[ "java.io.File", "java.io.IOException", "java.nio.file.Files", "java.nio.file.StandardCopyOption", "java.util.ArrayList", "java.util.regex.Pattern" ]
import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.regex.Pattern;
import java.io.*; import java.nio.file.*; import java.util.*; import java.util.regex.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
1,343,117
@Field(offset = 12 * 8, length = 32) public byte[] nextHop() { return super.getByteArray(12, 4); } }
@Field(offset = 12 * 8, length = 32) byte[] function() { return super.getByteArray(12, 4); } }
/** * Next hop. * * @return the byte[] */
Next hop
nextHop
{ "repo_name": "universsky/diddler", "path": "src/org/jnetpcap/protocol/network/Rip2.java", "license": "lgpl-3.0", "size": 2631 }
[ "org.jnetpcap.packet.annotate.Field" ]
import org.jnetpcap.packet.annotate.Field;
import org.jnetpcap.packet.annotate.*;
[ "org.jnetpcap.packet" ]
org.jnetpcap.packet;
1,550,771
@Test public void testPassByReferenceObjectAndException() throws Exception { final HelloRemote remote = lookup(HelloBean.class.getSimpleName(), HelloRemote.class); // invoke on the remote interface TransferReturnValue ret = remote.hello(new TransferParameter(this.getClass().getSimpleName...
void function() throws Exception { final HelloRemote remote = lookup(HelloBean.class.getSimpleName(), HelloRemote.class); TransferReturnValue ret = remote.hello(new TransferParameter(this.getClass().getSimpleName())); Assert.assertEquals(STR, ret.getValue(), STR + this.getClass().getSimpleName()); try { remote.hello(nu...
/** * Test that invocation on a remote interface of an EJB uses pass-by-reference semantics and the Exception also is pass-by-reference * @throws Exception */
Test that invocation on a remote interface of an EJB uses pass-by-reference semantics and the Exception also is pass-by-reference
testPassByReferenceObjectAndException
{ "repo_name": "iweiss/wildfly", "path": "testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ejb/remote/byreference/RemoteInvocationByReferenceTestCase.java", "license": "lgpl-2.1", "size": 8559 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
219,695
@Override public boolean execute(final String action, final JSONArray data, final CallbackContext callbackContext) { log(DEBUG, "execute() called with action:" + action + " and options: " + data); if ("setVerbosity".equals(action)) { return setVerbosity(data, callbackContext); ...
boolean function(final String action, final JSONArray data, final CallbackContext callbackContext) { log(DEBUG, STR + action + STR + data); if (STR.equals(action)) { return setVerbosity(data, callbackContext); } else if ("init".equals(action)) { return init(data, callbackContext); } else if (STR.equals(action)) { retur...
/** * Generic plugin command executor * * @param action * @param data * @param callbackContext * @return */
Generic plugin command executor
execute
{ "repo_name": "turtl/mobile", "path": "bundle/cordova-plugin-openwith/src/android/cc/fovea/openwith/OpenWithPlugin.java", "license": "gpl-3.0", "size": 8938 }
[ "org.apache.cordova.CallbackContext", "org.json.JSONArray" ]
import org.apache.cordova.CallbackContext; import org.json.JSONArray;
import org.apache.cordova.*; import org.json.*;
[ "org.apache.cordova", "org.json" ]
org.apache.cordova; org.json;
1,776,464
public void save(Bundle state) { onSave(state); }
void function(Bundle state) { onSave(state); }
/** * Saves the presenter. */
Saves the presenter
save
{ "repo_name": "Aphoh/nucleus", "path": "nucleus/src/main/java/nucleus/presenter/Presenter.java", "license": "mit", "size": 4184 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
1,471,925
protected void parseRewards(String rewardString) throws Exception { //if both min and max rewards are defined if (this.rangeKnown(rewardString)) { //rewardString = rewardString.substring(1, rewardString.length()-1); StringTokenizer rewardTokenizer = new StringTokenizer(reward...
void function(String rewardString) throws Exception { if (this.rangeKnown(rewardString)) { StringTokenizer rewardTokenizer = new StringTokenizer(rewardString, ","); this.reward_min = this.validValue(rewardTokenizer.nextToken()); this.reward_max = this.validValue(rewardTokenizer.nextToken()); } else { this.reward_min = ...
/** * Parses all information out of the reward portion of the Task Spec. * Reward string is passed in, the min and max reward is stored. * * @param observationString Reward portion of the Task Spec string * @throws java.lang.Exception * @return none */
Parses all information out of the reward portion of the Task Spec. Reward string is passed in, the min and max reward is stored
parseRewards
{ "repo_name": "shiwalimohan/RLInfiniteMario", "path": "system/codecs/Java/src/org/rlcommunity/rlglue/codec/taskspec/TaskSpecV3.java", "license": "gpl-2.0", "size": 32286 }
[ "java.util.StringTokenizer" ]
import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
1,350,064
protected Image getImage() { return image; }
Image function() { return image; }
/** * Return the image that was created for the receiver. This image corresponds * to the image descriptor which the subclass provided in getImageDescriptor(). * * This image may be used by subclasses for the lifetime of this edit part. * TODO: Get rid of this. Subclasses should handle the lifecycle. ...
Return the image that was created for the receiver. This image corresponds to the image descriptor which the subclass provided in getImageDescriptor(). This image may be used by subclasses for the lifetime of this edit part
getImage
{ "repo_name": "Drifftr/devstudio-tooling-bps", "path": "plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/editparts/CollapsableEditPart.java", "license": "apache-2.0", "size": 19127 }
[ "org.eclipse.swt.graphics.Image" ]
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
103,962
@Test public void testGetAllForStoragePool() { List<StorageDomainStatic> result = dao.getAllForStoragePool(EXISTING_POOL_ID); assertNotNull(result); assertFalse(result.isEmpty()); }
void function() { List<StorageDomainStatic> result = dao.getAllForStoragePool(EXISTING_POOL_ID); assertNotNull(result); assertFalse(result.isEmpty()); }
/** * Ensures the right collection of domains are returned. */
Ensures the right collection of domains are returned
testGetAllForStoragePool
{ "repo_name": "halober/ovirt-engine", "path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/StorageDomainStaticDAOTest.java", "license": "apache-2.0", "size": 6120 }
[ "java.util.List", "org.junit.Assert", "org.ovirt.engine.core.common.businessentities.StorageDomainStatic" ]
import java.util.List; import org.junit.Assert; import org.ovirt.engine.core.common.businessentities.StorageDomainStatic;
import java.util.*; import org.junit.*; import org.ovirt.engine.core.common.businessentities.*;
[ "java.util", "org.junit", "org.ovirt.engine" ]
java.util; org.junit; org.ovirt.engine;
343,887
@Override public boolean invokeContextMenuAction(Activity targetActivity, int id, int flag) { return this.mBase.invokeContextMenuAction(targetActivity, id, flag); }
boolean function(Activity targetActivity, int id, int flag) { return this.mBase.invokeContextMenuAction(targetActivity, id, flag); }
/** * Show the context menu for the currently focused view and executes a * particular context menu item. * * @param targetActivity The activity in question. * @param id The identifier associated with the context menu item. * @param flag Additional flags, if any. * @return Whether the...
Show the context menu for the currently focused view and executes a particular context menu item
invokeContextMenuAction
{ "repo_name": "liujianying/OpenAtlas", "path": "OpenAtlasCore/src/com/openatlas/runtime/InstrumentationHook.java", "license": "mit", "size": 38585 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
865,729
private void generateModelModule(Writer writer, String package_name, List<ModelData> models, String class_name , boolean has_default_models, String default_model_module) throws IOException { final String file_tested = "_file_tested"; final EnumSet<Modifier> private_final = EnumSet.of(PRIVATE...
void function(Writer writer, String package_name, List<ModelData> models, String class_name , boolean has_default_models, String default_model_module) throws IOException { final String file_tested = STR; final EnumSet<Modifier> private_final = EnumSet.of(PRIVATE, FINAL); final EnumSet<Modifier> private_modifier = EnumS...
/** * TODO: should there be a no-op GsonConverter for when model is serialized only under certain * scopes? Or move that declaration to @Model */
scopes? Or move that declaration to @Model
generateModelModule
{ "repo_name": "imminent/Prestige", "path": "prestige/src/main/java/com/imminentmeals/prestige/codegen/CodeGenerator.java", "license": "apache-2.0", "size": 45482 }
[ "com.google.gson.ExclusionStrategy", "com.google.gson.FieldAttributes", "com.google.gson.Gson", "com.google.gson.InstanceCreator", "com.imminentmeals.prestige.ControllerContract", "com.imminentmeals.prestige.GsonProvider", "com.imminentmeals.prestige.SegueController", "com.squareup.javawriter.JavaWrit...
import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; import com.google.gson.Gson; import com.google.gson.InstanceCreator; import com.imminentmeals.prestige.ControllerContract; import com.imminentmeals.prestige.GsonProvider; import com.imminentmeals.prestige.SegueController; import com.squar...
import com.google.gson.*; import com.imminentmeals.prestige.*; import com.squareup.javawriter.*; import java.io.*; import java.util.*; import javax.inject.*; import javax.lang.model.element.*;
[ "com.google.gson", "com.imminentmeals.prestige", "com.squareup.javawriter", "java.io", "java.util", "javax.inject", "javax.lang" ]
com.google.gson; com.imminentmeals.prestige; com.squareup.javawriter; java.io; java.util; javax.inject; javax.lang;
335,002
private void clearCurrentFile() { // // get settings // SharedPreferences settings = m_context.getSharedPreferences( ConfigurationSettings.TAGSTORE_PREFERENCES_NAME, Context.MODE_PRIVATE); // // get settings editor // SharedPreferences.Editor editor = settings.edit(); // // clear all p...
void function() { ConfigurationSettings.TAGSTORE_PREFERENCES_NAME, Context.MODE_PRIVATE); }
/** * clears the current file setting, which is used to determine which file * was last tagged / started to be tagged */
clears the current file setting, which is used to determine which file was last tagged / started to be tagged
clearCurrentFile
{ "repo_name": "novoid/tstest", "path": "android/src/org/me/tagstore/core/DatabaseResetTask.java", "license": "gpl-3.0", "size": 3538 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
2,132,048
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argL...
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType) throws javax.xml.transform.TransformerException { int argLen; switch (stepType) { case OpCodes.OP_VARIABLE : case OpCodes.OP_EXTFUNCTION : case OpCodes.OP_FUNCTION : case OpCodes.OP_GROUP : argLen = compiler.getArgLength(opPos); break; default ...
/** * Analyze a step and give information about it's predicates. Right now this * just returns true or false if the step has a predicate. * * @param compiler non-null reference to compiler object that has processed * the XPath operations into an opcode map. * @param opPos The opcode p...
Analyze a step and give information about it's predicates. Right now this just returns true or false if the step has a predicate
analyzePredicate
{ "repo_name": "haikuowuya/android_system_code", "path": "src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java", "license": "apache-2.0", "size": 60043 }
[ "com.sun.org.apache.xpath.internal.compiler.Compiler", "com.sun.org.apache.xpath.internal.compiler.OpCodes" ]
import com.sun.org.apache.xpath.internal.compiler.Compiler; import com.sun.org.apache.xpath.internal.compiler.OpCodes;
import com.sun.org.apache.xpath.internal.compiler.*;
[ "com.sun.org" ]
com.sun.org;
2,762,604
public static void removeBatchLoadableEntityKey( Serializable id, EntityPersister persister, SharedSessionContractImplementor session) { final EntityKey entityKey = session.generateEntityKey( id, persister ); final BatchFetchQueue batchFetchQueue = session.getPersistenceContext().getBatchFetchQueue(); ...
static void function( Serializable id, EntityPersister persister, SharedSessionContractImplementor session) { final EntityKey entityKey = session.generateEntityKey( id, persister ); final BatchFetchQueue batchFetchQueue = session.getPersistenceContext().getBatchFetchQueue(); batchFetchQueue.removeBatchLoadableEntityKey...
/** * Remove the entity key with the specified {@code id} and {@code persister} from * the batch loadable entities {@link BatchFetchQueue}. * * @param id - the ID for the entity to be removed * @param persister - the entity persister * @param session - the session */
Remove the entity key with the specified id and persister from the batch loadable entities <code>BatchFetchQueue</code>
removeBatchLoadableEntityKey
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/hibernate-core/org/hibernate/engine/internal/BatchFetchQueueHelper.java", "license": "gpl-2.0", "size": 2812 }
[ "java.io.Serializable", "org.hibernate.engine.spi.BatchFetchQueue", "org.hibernate.engine.spi.EntityKey", "org.hibernate.engine.spi.SharedSessionContractImplementor", "org.hibernate.persister.entity.EntityPersister" ]
import java.io.Serializable; import org.hibernate.engine.spi.BatchFetchQueue; import org.hibernate.engine.spi.EntityKey; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.entity.EntityPersister;
import java.io.*; import org.hibernate.engine.spi.*; import org.hibernate.persister.entity.*;
[ "java.io", "org.hibernate.engine", "org.hibernate.persister" ]
java.io; org.hibernate.engine; org.hibernate.persister;
2,493,811
public void addInternalServlet(String name, String pathSpec, Class<? extends HttpServlet> clazz) { addInternalServlet(name, pathSpec, clazz, false); }
void function(String name, String pathSpec, Class<? extends HttpServlet> clazz) { addInternalServlet(name, pathSpec, clazz, false); }
/** * Add an internal servlet in the server. * Note: This method is to be used for adding servlets that facilitate * internal communication and not for user facing functionality. For * servlets added using this method, filters are not enabled. * * @param name The name of the servlet (can be passed as ...
Add an internal servlet in the server. Note: This method is to be used for adding servlets that facilitate internal communication and not for user facing functionality. For servlets added using this method, filters are not enabled
addInternalServlet
{ "repo_name": "Ethanlm/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java", "license": "apache-2.0", "size": 57514 }
[ "javax.servlet.http.HttpServlet" ]
import javax.servlet.http.HttpServlet;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
478,770
public Pitch getPitch(int i) { if (i >= this.start && i <= this.end) { return this.contour.get(i - this.start); } else { return null; } }
Pitch function(int i) { if (i >= this.start && i <= this.end) { return this.contour.get(i - this.start); } else { return null; } }
/** * Returns the pitch at the given index or null, if the index is out of bounds. Note that even if the index is within bounds, the Pitch can still be null. * * @param i Index for which to return a pitch. */
Returns the pitch at the given index or null, if the index is out of bounds. Note that even if the index is within bounds, the Pitch can still be null
getPitch
{ "repo_name": "vitrivr/cineast", "path": "cineast-core/src/main/java/org/vitrivr/cineast/core/util/audio/pitch/tracking/PitchContour.java", "license": "mit", "size": 5638 }
[ "org.vitrivr.cineast.core.util.audio.pitch.Pitch" ]
import org.vitrivr.cineast.core.util.audio.pitch.Pitch;
import org.vitrivr.cineast.core.util.audio.pitch.*;
[ "org.vitrivr.cineast" ]
org.vitrivr.cineast;
1,284,096
//------------------------------------------------------------------------- protected HistoricalTimeSeriesMaster getUnderlying() { return _underlying; }
HistoricalTimeSeriesMaster function() { return _underlying; }
/** * Gets the underlying time-series master. * * @return the underlying master, not null */
Gets the underlying time-series master
getUnderlying
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Master/src/main/java/com/opengamma/master/historicaltimeseries/impl/PermissionedHistoricalTimeSeriesMaster.java", "license": "apache-2.0", "size": 12657 }
[ "com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster" ]
import com.opengamma.master.historicaltimeseries.HistoricalTimeSeriesMaster;
import com.opengamma.master.historicaltimeseries.*;
[ "com.opengamma.master" ]
com.opengamma.master;
2,058,775
private void setComponents(final List<? extends CoordinateReferenceSystem> crs) { if (setSingleComponents(crs)) { components = singles; // Shares the same list. } else { components = UnmodifiableArrayList.wrap(crs.toArray(new CoordinateReferenceSyste...
void function(final List<? extends CoordinateReferenceSystem> crs) { if (setSingleComponents(crs)) { components = singles; } else { components = UnmodifiableArrayList.wrap(crs.toArray(new CoordinateReferenceSystem[crs.size()])); } }
/** * Computes the {@link #components} and {@link #singles} fields from the given CRS list. * If the two lists have the same content, then the two fields will reference the same list. * * @see #getComponents() */
Computes the <code>#components</code> and <code>#singles</code> fields from the given CRS list. If the two lists have the same content, then the two fields will reference the same list
setComponents
{ "repo_name": "apache/sis", "path": "core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java", "license": "apache-2.0", "size": 31324 }
[ "java.util.List", "org.apache.sis.internal.util.UnmodifiableArrayList", "org.opengis.referencing.crs.CoordinateReferenceSystem" ]
import java.util.List; import org.apache.sis.internal.util.UnmodifiableArrayList; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import java.util.*; import org.apache.sis.internal.util.*; import org.opengis.referencing.crs.*;
[ "java.util", "org.apache.sis", "org.opengis.referencing" ]
java.util; org.apache.sis; org.opengis.referencing;
2,377,216
@Override public Layout createLayout(final Graph<?, ?> graph) { final HashMap<String, Node> indexByUuid = new HashMap<>(); final LayeredGraph reorderedGraph = new LayeredGraph(); for (final Node n : graph.nodes()) { if (!(n.getContent() instanceof HasBounds)) { ...
Layout function(final Graph<?, ?> graph) { final HashMap<String, Node> indexByUuid = new HashMap<>(); final LayeredGraph reorderedGraph = new LayeredGraph(); for (final Node n : graph.nodes()) { if (!(n.getContent() instanceof HasBounds)) { continue; } indexByUuid.put(n.getUUID(), n); for (final Object e : n.getInEdges...
/** * Performs the automatic layout in graph using Sugiyama method, * putting vertices in layers in order to reduce edges crossing. * @param graph The graph. * @return The Layout for the vertices. * @see Layout */
Performs the automatic layout in graph using Sugiyama method, putting vertices in layers in order to reduce edges crossing
createLayout
{ "repo_name": "jhrcek/kie-wb-common", "path": "kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-commons/kie-wb-common-stunner-core-common/src/main/java/org/kie/workbench/common/stunner/core/graph/processing/layout/sugiyama/SugiyamaLayoutService.java", "license": "apache-2.0", "size": 7298...
[ "java.util.HashMap", "java.util.List", "org.kie.workbench.common.stunner.core.graph.Edge", "org.kie.workbench.common.stunner.core.graph.Graph", "org.kie.workbench.common.stunner.core.graph.Node", "org.kie.workbench.common.stunner.core.graph.content.HasBounds", "org.kie.workbench.common.stunner.core.grap...
import java.util.HashMap; import java.util.List; import org.kie.workbench.common.stunner.core.graph.Edge; import org.kie.workbench.common.stunner.core.graph.Graph; import org.kie.workbench.common.stunner.core.graph.Node; import org.kie.workbench.common.stunner.core.graph.content.HasBounds; import org.kie.workbench.comm...
import java.util.*; import org.kie.workbench.common.stunner.core.graph.*; import org.kie.workbench.common.stunner.core.graph.content.*; import org.kie.workbench.common.stunner.core.graph.processing.layout.*; import org.kie.workbench.common.stunner.core.graph.processing.layout.sugiyama.step04.*;
[ "java.util", "org.kie.workbench" ]
java.util; org.kie.workbench;
1,454,391
private void configurePopUpMenuOnItemList(ItemList itemList) { String midiInRemoteDeviceName = midiService .getMidiDeviceName(MidiAutomatorProperties.KEY_MIDI_IN_REMOTE_DEVICE); String switchItemDeviceName = midiService .getMidiDeviceName(MidiAutomatorProperties.KEY_MIDI_OUT_SWITCH_ITEM_DEVICE); // e...
void function(ItemList itemList) { String midiInRemoteDeviceName = midiService .getMidiDeviceName(MidiAutomatorProperties.KEY_MIDI_IN_REMOTE_DEVICE); String switchItemDeviceName = midiService .getMidiDeviceName(MidiAutomatorProperties.KEY_MIDI_OUT_SWITCH_ITEM_DEVICE); popupMenu.getAddMenuItem().setEnabled(false); if (!...
/** * Configures the popup menu on the item list * * @param itemList * The item list */
Configures the popup menu on the item list
configurePopUpMenuOnItemList
{ "repo_name": "aguelle/MIDI-Automator", "path": "Midi Automator/src/main/java/com/midi_automator/view/windows/MainFrame/listener/MainFramePopupListener.java", "license": "mit", "size": 6077 }
[ "com.midi_automator.model.MidiAutomatorProperties", "com.midi_automator.view.windows.MainFrame" ]
import com.midi_automator.model.MidiAutomatorProperties; import com.midi_automator.view.windows.MainFrame;
import com.midi_automator.model.*; import com.midi_automator.view.windows.*;
[ "com.midi_automator.model", "com.midi_automator.view" ]
com.midi_automator.model; com.midi_automator.view;
873,997
void postDeleteTable(final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException;
void postDeleteTable(final ObserverContext<MasterCoprocessorEnvironment> ctx, TableName tableName) throws IOException;
/** * Called after the deleteTable operation has been requested. Called as part * of delete table RPC call. * @param ctx the environment to interact with the framework and master * @param tableName the name of the table */
Called after the deleteTable operation has been requested. Called as part of delete table RPC call
postDeleteTable
{ "repo_name": "Jackygq1982/hbase_src", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MasterObserver.java", "license": "apache-2.0", "size": 31996 }
[ "java.io.IOException", "org.apache.hadoop.hbase.TableName" ]
import java.io.IOException; import org.apache.hadoop.hbase.TableName;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,869,995
@Override public void contextDestroyed(ServletContextEvent event) { try { Context.openSession(); Context.shutdown(); WebModuleUtil.shutdownModules(event.getServletContext()); } catch (Throwable t) { // don't print the unhelpful "contextDAO is null" message if (!"cont...
void function(ServletContextEvent event) { try { Context.openSession(); Context.shutdown(); WebModuleUtil.shutdownModules(event.getServletContext()); } catch (Throwable t) { if (!STR.equals(t.getMessage())) { System.out.println(STR); t.printStackTrace(); } } finally { if ("true".equalsIgnoreCase(System.getProperty(STR)...
/** * Called when the webapp is shut down properly Must call Context.shutdown() and then shutdown * all the web layers of the modules * * @see org.springframework.web.context.ContextLoaderListener#contextDestroyed(javax.servlet.ServletContextEvent) */
Called when the webapp is shut down properly Must call Context.shutdown() and then shutdown all the web layers of the modules
contextDestroyed
{ "repo_name": "Bhamni/openmrs-core", "path": "web/src/main/java/org/openmrs/web/Listener.java", "license": "mpl-2.0", "size": 23277 }
[ "java.io.File", "java.sql.Driver", "java.sql.DriverManager", "java.util.Enumeration", "javax.servlet.ServletContextEvent", "org.apache.log4j.LogManager", "org.openmrs.api.context.Context", "org.openmrs.module.web.WebModuleUtil", "org.openmrs.util.OpenmrsClassLoader", "org.openmrs.util.OpenmrsUtil"...
import java.io.File; import java.sql.Driver; import java.sql.DriverManager; import java.util.Enumeration; import javax.servlet.ServletContextEvent; import org.apache.log4j.LogManager; import org.openmrs.api.context.Context; import org.openmrs.module.web.WebModuleUtil; import org.openmrs.util.OpenmrsClassLoader; import ...
import java.io.*; import java.sql.*; import java.util.*; import javax.servlet.*; import org.apache.log4j.*; import org.openmrs.api.context.*; import org.openmrs.module.web.*; import org.openmrs.util.*;
[ "java.io", "java.sql", "java.util", "javax.servlet", "org.apache.log4j", "org.openmrs.api", "org.openmrs.module", "org.openmrs.util" ]
java.io; java.sql; java.util; javax.servlet; org.apache.log4j; org.openmrs.api; org.openmrs.module; org.openmrs.util;
2,094,937
public static byte[] toBytes(Serializable obj) { try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(obj); oos.flush(); return bos.toByteArray(); } catch (IOEx...
static byte[] function(Serializable obj) { try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos)) { oos.writeObject(obj); oos.flush(); return bos.toByteArray(); } catch (IOException e) { throw new IgniteException(e); } }
/** * Serialize object to byte array. * * @param obj Object. * @return Serialized object. */
Serialize object to byte array
toBytes
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 385578 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "java.io.ObjectOutputStream", "java.io.Serializable", "org.apache.ignite.IgniteException" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import org.apache.ignite.IgniteException;
import java.io.*; import org.apache.ignite.*;
[ "java.io", "org.apache.ignite" ]
java.io; org.apache.ignite;
2,273,740
public void updateFocusedRowStyle(Row row) { if (rowWithFocus == row.getRow() && containerWithFocus == escalator.getBody()) { if (row.getElement() != rowWithFocusStyle) { // Row should have focus style but does not have it. ...
void function(Row row) { if (rowWithFocus == row.getRow() && containerWithFocus == escalator.getBody()) { if (row.getElement() != rowWithFocusStyle) { if (rowWithFocusStyle != null) { setStyleName(rowWithFocusStyle, rowFocusStyleName, false); } rowWithFocusStyle = row.getElement(); setStyleName(rowWithFocusStyle, rowFo...
/** * Sets focus style for the given row if needed. * * @param row * a row object */
Sets focus style for the given row if needed
updateFocusedRowStyle
{ "repo_name": "kironapublic/vaadin", "path": "client/src/main/java/com/vaadin/client/widgets/Grid.java", "license": "apache-2.0", "size": 330612 }
[ "com.vaadin.client.widget.escalator.Row" ]
import com.vaadin.client.widget.escalator.Row;
import com.vaadin.client.widget.escalator.*;
[ "com.vaadin.client" ]
com.vaadin.client;
839,179
public void calcCheckUrl(Map attributes, String userDefined, Object descriptor, String field) { if(userDefined!=null || field==null) return; if (descriptor instanceof Descriptor) { Descriptor d = (Descriptor) descriptor; CheckMethod m = d.getCheckMethod(field); ...
void function(Map attributes, String userDefined, Object descriptor, String field) { if(userDefined!=null field==null) return; if (descriptor instanceof Descriptor) { Descriptor d = (Descriptor) descriptor; CheckMethod m = d.getCheckMethod(field); attributes.put(STR,m.toStemUrl()); attributes.put(STR,m.getDependsOn());...
/** * Determines the parameters that client-side needs for a form validation check. See prepareDatabinding.jelly * @since 1.528 */
Determines the parameters that client-side needs for a form validation check. See prepareDatabinding.jelly
calcCheckUrl
{ "repo_name": "msrb/jenkins", "path": "core/src/main/java/hudson/Functions.java", "license": "mit", "size": 70132 }
[ "hudson.model.Descriptor", "hudson.util.FormValidation", "java.util.Map" ]
import hudson.model.Descriptor; import hudson.util.FormValidation; import java.util.Map;
import hudson.model.*; import hudson.util.*; import java.util.*;
[ "hudson.model", "hudson.util", "java.util" ]
hudson.model; hudson.util; java.util;
1,380,512
public static void split(File f, int file_size) throws FileNotFoundException, IOException { int partCounter = 1;//I like to name parts from 001, 002, 003, ... //you can change it to 0 if you want 000, 001, ... int sizeOfFiles = 1024 * 1024;// 1MB...
static void function(File f, int file_size) throws FileNotFoundException, IOException { int partCounter = 1; int sizeOfFiles = 1024 * 1024; byte[] buffer = new byte[sizeOfFiles]; String fileName = f.getName(); try (FileInputStream fis = new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(fis)) { i...
/** * Breaks up the original file into separate files. The files will contain * file_size bytes, and likely one one of those will have * <p> * </p> * <p> * </p> * (total_bytes modulus file_size) bytes. * <p> * </p> * NOTE: any value for file_size less than 500,000 bytes will be adjusted to...
Breaks up the original file into separate files. The files will contain file_size bytes, and likely one one of those will have (total_bytes modulus file_size) bytes. 1Mb. The implementation is from this Stackoverflow answer HREF
split
{ "repo_name": "onebeartoe/java-libraries", "path": "system/src/main/java/org/onebeartoe/filesystem/FileHelper.java", "license": "lgpl-3.0", "size": 7084 }
[ "java.io.BufferedInputStream", "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "java.io.FileOutputStream", "java.io.IOException" ]
import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,330,333
protected void releasePrimaryLock() { // We don't have a lock if we have a parent advisor if (parentAdvisor != null) { return; } if (startingBucketAdvisor == null) { assignStartingBucketAdvisor(); if (startingBucketAdvisor != null) { return; } } else { return;...
void function() { if (parentAdvisor != null) { return; } if (startingBucketAdvisor == null) { assignStartingBucketAdvisor(); if (startingBucketAdvisor != null) { return; } } else { return; } try { DistributedMemberLock thePrimaryLock = getPrimaryLock(false); if (thePrimaryLock != null) { thePrimaryLock.unlock(); } else...
/** * Releases the primary lock for this bucket. */
Releases the primary lock for this bucket
releasePrimaryLock
{ "repo_name": "deepakddixit/incubator-geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java", "license": "apache-2.0", "size": 100306 }
[ "org.apache.geode.distributed.LockNotHeldException", "org.apache.geode.distributed.LockServiceDestroyedException", "org.apache.geode.distributed.internal.locks.DistributedMemberLock", "org.apache.geode.internal.Assert" ]
import org.apache.geode.distributed.LockNotHeldException; import org.apache.geode.distributed.LockServiceDestroyedException; import org.apache.geode.distributed.internal.locks.DistributedMemberLock; import org.apache.geode.internal.Assert;
import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.locks.*; import org.apache.geode.internal.*;
[ "org.apache.geode" ]
org.apache.geode;
2,062,037
public Map<String, Object> getMetaStorage();
Map<String, Object> function();
/** * Implementation should return an instance of the map to store meta attributes. */
Implementation should return an instance of the map to store meta attributes
getMetaStorage
{ "repo_name": "nivanov/ignite", "path": "modules/math/src/main/java/org/apache/ignite/math/MetaAttributes.java", "license": "apache-2.0", "size": 2384 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,363,767
public void pearlInsert(ExilePearl pearl);
void function(ExilePearl pearl);
/** * Inserts a new prison pearl into storage * @param pearl The pearl to insert */
Inserts a new prison pearl into storage
pearlInsert
{ "repo_name": "DevotedMC/ExilePearl", "path": "src/main/java/com/devotedmc/ExilePearl/storage/PearlStorage.java", "license": "mit", "size": 568 }
[ "com.devotedmc.ExilePearl" ]
import com.devotedmc.ExilePearl;
import com.devotedmc.*;
[ "com.devotedmc" ]
com.devotedmc;
854,053
public ServiceFuture<DigitalTwinsDescriptionInner> beginUpdateAsync(String resourceGroupName, String resourceName, Map<String, String> tags, final ServiceCallback<DigitalTwinsDescriptionInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourc...
ServiceFuture<DigitalTwinsDescriptionInner> function(String resourceGroupName, String resourceName, Map<String, String> tags, final ServiceCallback<DigitalTwinsDescriptionInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallba...
/** * Update metadata of DigitalTwinsInstance. * * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. * @param resourceName The name of the DigitalTwinsInstance. * @param tags Instance tags * @param serviceCallback the async ServiceCallback to h...
Update metadata of DigitalTwinsInstance
beginUpdateAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/digitaltwins/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/digitaltwins/v2020_03_01_preview/implementation/DigitalTwinsInner.java", "license": "mit", "size": 84895 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture", "java.util.Map" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.Map;
import com.microsoft.rest.*; import java.util.*;
[ "com.microsoft.rest", "java.util" ]
com.microsoft.rest; java.util;
2,465,700
public ServoControl publishMoveTo(ServoControl sc) { log.debug("{}.publishMoveTo()", getName()); return sc; }
ServoControl function(ServoControl sc) { log.debug(STR, getName()); return sc; }
/** * moveTo requests are published through this publishing point */
moveTo requests are published through this publishing point
publishMoveTo
{ "repo_name": "MyRobotLab/myrobotlab", "path": "src/main/java/org/myrobotlab/service/abstracts/AbstractServo.java", "license": "apache-2.0", "size": 30820 }
[ "org.myrobotlab.service.interfaces.ServoControl" ]
import org.myrobotlab.service.interfaces.ServoControl;
import org.myrobotlab.service.interfaces.*;
[ "org.myrobotlab.service" ]
org.myrobotlab.service;
173,807
public static void close(@Nullable URLClassLoader clsLdr, @Nullable IgniteLogger log) { if (clsLdr != null) try { URLClassPath path = SharedSecrets.getJavaNetAccess().getURLClassPath(clsLdr); Field ldrFld = path.getClass().getDeclaredField("loaders"); ...
static void function(@Nullable URLClassLoader clsLdr, @Nullable IgniteLogger log) { if (clsLdr != null) try { URLClassPath path = SharedSecrets.getJavaNetAccess().getURLClassPath(clsLdr); Field ldrFld = path.getClass().getDeclaredField(STR); ldrFld.setAccessible(true); Iterable ldrs = (Iterable)ldrFld.get(path); for (O...
/** * Closes class loader logging possible checked exception. * Note: this issue for problem <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014"> * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014</a>. * * @param clsLdr Class loader. If it's {@code null} - it's no-op....
Closes class loader logging possible checked exception. Note: this issue for problem HREF
close
{ "repo_name": "shurun19851206/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 289056 }
[ "java.lang.reflect.Field", "java.net.URLClassLoader", "java.util.zip.ZipFile", "org.apache.ignite.IgniteLogger", "org.jetbrains.annotations.Nullable" ]
import java.lang.reflect.Field; import java.net.URLClassLoader; import java.util.zip.ZipFile; import org.apache.ignite.IgniteLogger; import org.jetbrains.annotations.Nullable;
import java.lang.reflect.*; import java.net.*; import java.util.zip.*; import org.apache.ignite.*; import org.jetbrains.annotations.*;
[ "java.lang", "java.net", "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.lang; java.net; java.util; org.apache.ignite; org.jetbrains.annotations;
1,742,985