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.GL_SHORT; case PIXEL_COMPONENT_UNSIGNED_BYTE: return GL.GL_UNSIGNED_BYTE; case PIXEL_COMPONENT_UNSIGNED_INT: return GL.GL_UNSIGNED_INT; case PIXEL_COMPONENT_UNSIGNED_SHORT: return GL.GL_UNSIGNED_SHORT; case PIXEL_PACKED_UNSIGNED_INT_1010102: return GL2ES2.GL_UNSIGNED_INT_10_10_10_2; case PIXEL_PACKED_UNSIGNED_SHORT_4444: return GL.GL_UNSIGNED_SHORT_4_4_4_4; case PIXEL_PACKED_UNSIGNED_SHORT_5551: return GL.GL_UNSIGNED_SHORT_5_5_5_1; case PIXEL_PACKED_UNSIGNED_SHORT_565: return GL.GL_UNSIGNED_SHORT_5_6_5; case PIXEL_COMPONENT_HALF_FLOAT: return GL.GL_HALF_FLOAT; case PIXEL_PACKED_UNSIGNED_INT_24_8: return GL.GL_UNSIGNED_INT_24_8; } throw new UnreachableCodeException(); }
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 PIXEL_COMPONENT_UNSIGNED_INT: return GL.GL_UNSIGNED_INT; case PIXEL_COMPONENT_UNSIGNED_SHORT: return GL.GL_UNSIGNED_SHORT; case PIXEL_PACKED_UNSIGNED_INT_1010102: return GL2ES2.GL_UNSIGNED_INT_10_10_10_2; case PIXEL_PACKED_UNSIGNED_SHORT_4444: return GL.GL_UNSIGNED_SHORT_4_4_4_4; case PIXEL_PACKED_UNSIGNED_SHORT_5551: return GL.GL_UNSIGNED_SHORT_5_5_5_1; case PIXEL_PACKED_UNSIGNED_SHORT_565: return GL.GL_UNSIGNED_SHORT_5_6_5; case PIXEL_COMPONENT_HALF_FLOAT: return GL.GL_HALF_FLOAT; case PIXEL_PACKED_UNSIGNED_INT_24_8: return GL.GL_UNSIGNED_INT_24_8; } throw new UnreachableCodeException(); }
/** * 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(int i=0;i<nProts;i++) { if(gapped[i].length != protLen) { throw new IllegalArgumentException(String.format( "Expected a rectangular array, but row 0 has %d elements " + "while row %d has %d.", protLen,i,gapped[i].length)); } } // determine where gaps exist in any structures boolean[] isGap = new boolean[protLen]; int gaps = 0; for(int j=0;j<protLen;j++) { for(int i=0;i<nProts;i++) { if(gapped[i][j] == null ) { isGap[j] = true; gaps++; break; //go to next position } } } // Create ungapped array T[][] ungapped = Arrays.copyOf(gapped,nProts); final int ungappedLen = protLen-gaps; for(int i=0;i<nProts;i++) { ungapped[i] = Arrays.copyOf(gapped[i],ungappedLen); int k = 0; for(int j=0;j<protLen;j++) { if(!isGap[j]) { //skip gaps assert(gapped[i][j] != null); ungapped[i][k] = gapped[i][j]; k++; } } assert(k == ungappedLen); } return ungapped; }
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(String.format( STR + STR, protLen,i,gapped[i].length)); } } boolean[] isGap = new boolean[protLen]; int gaps = 0; for(int j=0;j<protLen;j++) { for(int i=0;i<nProts;i++) { if(gapped[i][j] == null ) { isGap[j] = true; gaps++; break; } } } T[][] ungapped = Arrays.copyOf(gapped,nProts); final int ungappedLen = protLen-gaps; for(int i=0;i<nProts;i++) { ungapped[i] = Arrays.copyOf(gapped[i],ungappedLen); int k = 0; for(int j=0;j<protLen;j++) { if(!isGap[j]) { assert(gapped[i][j] != null); ungapped[i][k] = gapped[i][j]; k++; } } assert(k == ungappedLen); } return ungapped; }
/** * 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 columns containing nulls */
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; break; } i++; } if (found == null) { throw DataUtils.newIllegalStateException( DataUtils.ERROR_INTERNAL, "Cannot find spot to mark as unused in free list"); } if (start + required == found.start) { // if the used space is adjacent to the beginning of a // free-space-range found.start = start; found.length += required; // compact: merge the previous entry into this one if // they are now adjacent if (i > 0) { BlockRange previous = freeSpaceList.get(i - 1); if (previous.start + previous.length == found.start) { previous.length += found.length; freeSpaceList.remove(i); } } return; } if (i > 0) { // if the used space is adjacent to the end of a free-space-range BlockRange previous = freeSpaceList.get(i - 1); if (previous.start + previous.length == start) { previous.length += required; return; } } // it is between 2 entries, so add a new one BlockRange newRange = new BlockRange(start, required); freeSpaceList.add(i, newRange); }
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( DataUtils.ERROR_INTERNAL, STR); } if (start + required == found.start) { found.start = start; found.length += required; if (i > 0) { BlockRange previous = freeSpaceList.get(i - 1); if (previous.start + previous.length == found.start) { previous.length += found.length; freeSpaceList.remove(i); } } return; } if (i > 0) { BlockRange previous = freeSpaceList.get(i - 1); if (previous.start + previous.length == start) { previous.length += required; return; } } BlockRange newRange = new BlockRange(start, required); freeSpaceList.add(i, newRange); }
/** * 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.append(getValue(var).toTexString()); i++; } sb.append("$\\}"); return sb.toString(); }
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("$\\}"); return sb.toString(); }
/** * 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. * @throws StorageException If IO exception occurred during the write. If an exception is thrown from this * method, the WAL will be invalidated and the node will be stopped. */
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 : forwardUrls) { final long id = forwardAggregateId.incrementAndGet(); context .insertInto( FORWARD_AGGREGATE, FORWARD_AGGREGATE.ID, FORWARD_AGGREGATE.UPDATE_TIME_MS, FORWARD_AGGREGATE.FK_FORWARD_URL_ID, FORWARD_AGGREGATE.FK_AGGREGATE_ID, FORWARD_AGGREGATE.SUCCESS, FORWARD_AGGREGATE.NEW_POSITION) .values(id, System.currentTimeMillis(), forwardUrl.getId(), aggregateId, false, writePos.incrementAndGet()) .execute(); } // Remove the queue position from the aggregate so we don't try and create forwarders again. context .update(AGGREGATE) .setNull(AGGREGATE.NEW_POSITION) .where(AGGREGATE.ID.eq(aggregateId)) .execute(); })); return null; }); }
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, FORWARD_AGGREGATE.UPDATE_TIME_MS, FORWARD_AGGREGATE.FK_FORWARD_URL_ID, FORWARD_AGGREGATE.FK_AGGREGATE_ID, FORWARD_AGGREGATE.SUCCESS, FORWARD_AGGREGATE.NEW_POSITION) .values(id, System.currentTimeMillis(), forwardUrl.getId(), aggregateId, false, writePos.incrementAndGet()) .execute(); } context .update(AGGREGATE) .setNull(AGGREGATE.NEW_POSITION) .where(AGGREGATE.ID.eq(aggregateId)) .execute(); })); return null; }); }
/** * 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.findProcessDefinitionFromCache(processDefinitionId); if (processDefinition == null) { CommandContext commandContext = Context.getCommandContext(); ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager(); processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId); if (processDefinition != null) { processDefinition = deploymentCache.resolveProcessDefinition(processDefinition); } } return processDefinition; }
ProcessDefinitionEntity function(String processDefinitionId) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); DeploymentCache deploymentCache = configuration.getDeploymentCache(); ProcessDefinitionEntity processDefinition = deploymentCache.findProcessDefinitionFromCache(processDefinitionId); if (processDefinition == null) { CommandContext commandContext = Context.getCommandContext(); ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager(); processDefinition = processDefinitionManager.findLatestProcessDefinitionById(processDefinitionId); if (processDefinition != null) { processDefinition = deploymentCache.resolveProcessDefinition(processDefinition); } } return processDefinition; }
/** * 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()); Resource resource = new EcoreResourceFactoryImpl().createResource(uri); try { resource.load(null); } catch (IOException exception) { throw new WrappedException(exception); } initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0)); createResource(eNS_URI); } private boolean isFixed = false;
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); } catch (IOException exception) { throw new WrappedException(exception); } initializeFromLoadedEPackage(this, (EPackage)resource.getContents().get(0)); createResource(eNS_URI); } private boolean isFixed = false;
/** * 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() instanceof String) { m = p.matcher((String)item.getKey()); if(m.find()) { // match result.put((String) item.getKey(), (String) item.getValue()); } } } return result; }
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()); if(m.find()) { result.put((String) item.getKey(), (String) item.getValue()); } } } return result; }
/** * 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>}'. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Is Predecessor To</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Is Predecessor To</em>' reference list. * @see #isSetIsPredecessorTo() * @see #unsetIsPredecessorTo() * @see org.bimserver.models.ifc4.Ifc4Package#getIfcProcess_IsPredecessorTo() * @see org.bimserver.models.ifc4.IfcRelSequence#getRelatingProcess * @model opposite="RelatingProcess" unsettable="true" * annotation="inverse" * @generated */
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' reference list isn't clear, there really should be more of a description here...
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); for(WordBlock wb : blocks){ if(!wb.equals(from)) { //Ensure that they are on the same line before proceeding if(centerY < wb.getY2() && centerY > wb.getY1()) { double tempResult; switch (direction) { case "UP": tempResult = from.getY2() - wb.getY1(); if ((minDistance == -1 || tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "DOWN": tempResult = wb.getY2() - from.getY1(); if ((minDistance == -1 || tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "LEFT": tempResult = from.getX1() - wb.getX2(); if ((minDistance == -1 || tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "RIGHT": tempResult = wb.getX1() - from.getX2(); if ((minDistance == -1 || tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; default: double centerLineX = wb.getX1() + ((wb.getX2() - wb.getX1()) / 2), centerLineY = wb.getY1() + ((wb.getY2() - wb.getY1()) / 2); double distance = Math.sqrt(Math.pow(centerX - centerLineX, 2) + Math.pow(centerY - centerLineY, 2)); if ((minDistance == -1 || distance < minDistance) && distance >= 0) { minDistance = distance; returner = wb; } break; } } } } return returner; }
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)) { if(centerY < wb.getY2() && centerY > wb.getY1()) { double tempResult; switch (direction) { case "UP": tempResult = from.getY2() - wb.getY1(); if ((minDistance == -1 tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "DOWN": tempResult = wb.getY2() - from.getY1(); if ((minDistance == -1 tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "LEFT": tempResult = from.getX1() - wb.getX2(); if ((minDistance == -1 tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; case "RIGHT": tempResult = wb.getX1() - from.getX2(); if ((minDistance == -1 tempResult < minDistance) && tempResult >= 0) { minDistance = tempResult; returner = wb; } break; default: double centerLineX = wb.getX1() + ((wb.getX2() - wb.getX1()) / 2), centerLineY = wb.getY1() + ((wb.getY2() - wb.getY1()) / 2); double distance = Math.sqrt(Math.pow(centerX - centerLineX, 2) + Math.pow(centerY - centerLineY, 2)); if ((minDistance == -1 distance < minDistance) && distance >= 0) { minDistance = distance; returner = wb; } break; } } } } return returner; }
/** * 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 search * @param blocks The WordBlocks in which we will look (usually all WordBlocks on the page/of the line) * @return The nextWordBlock in the given direction */
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"); } senderSigner = builder.senderSigner; if (builder.recipientPublicKey == null) { throw new IllegalArgumentException( "must set recipient's public key with Builder.withRecipientPublicKeyBytes"); } recipientPublicKey = builder.recipientPublicKey; if (builder.padding == null) { throw new IllegalArgumentException( "must set padding with Builder.withPadding"); } padding = builder.padding; if (padding == Padding.OAEP && builder.oaepParameterSpec == null) { throw new IllegalArgumentException( "must set OAEP parameter spec with Builder.withOaepParameterSpec"); } oaepParameterSpec = builder.oaepParameterSpec; }
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( STR); } recipientPublicKey = builder.recipientPublicKey; if (builder.padding == null) { throw new IllegalArgumentException( STR); } padding = builder.padding; if (padding == Padding.OAEP && builder.oaepParameterSpec == null) { throw new IllegalArgumentException( STR); } oaepParameterSpec = builder.oaepParameterSpec; }
/** * 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 " + contextName; }
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 instanceof Tag ) { Tag objectTag = (Tag) objectNode; //If it is not an end node then we process its attributes, if it is an empty //XML tag then we do the same I believe an empty XML tag is smth like: <TAG /> if( !objectTag.isEndTag() || objectTag.isEmptyXmlTag() ) { //Process the attributes logger.debug("Processing object node's '" + objectTag + "' attributes"); Vector<Attribute> atts = (Vector<Attribute>) objectTag.getAttributesEx(); if( atts != null ) { for( Attribute att : atts ) { String nameValue = att.getName(); String valueValue = att.getValue(); if( ! flashObjToFill.setNameValue( nameValue, valueValue ) ) { logger.warn("An unknown OBJECT attribute, name='" + nameValue + "' value='" + valueValue + "'" ); } else { logger.debug("Set the OBJECT attribute, name='" + nameValue + "' value='" + valueValue + "'"); } } } //Process the parameters logger.debug("Processing object node's '" + objectTag + "' parameters"); NodeList parameters = objectTag.getChildren().extractAllNodesThatMatch( new TagNameFilter( FlashEmbeddedObject.PARAM_TAG_NAME ) ); for( int i = 0 ; i < parameters.size(); i++) { Node node = parameters.elementAt( i ); if( node instanceof Tag ){ String nameValue = ((Tag) node).getAttribute( FlashEmbeddedObject.PARAM_NAME_ATTR ); String valueValue = ((Tag) node).getAttribute( FlashEmbeddedObject.PARAM_VALUE_ATT ); if( nameValue != null && valueValue != null ) { if( ! flashObjToFill.setNameValue( nameValue, valueValue ) ) { logger.warn("An unknown OBJECT parameter, name='" + nameValue + "' value='" + valueValue + "'" ); } else { logger.debug("Set the OBJECT tag parameter, name='" + nameValue + "' value='" + valueValue + "'"); } } } else { logger.warn( "Encountered a PARAM node: " + node + " that is not a PARAM tag!" ); } } //Process the embed tag if any logger.debug("Processing object node's '" + objectTag + "' embed child tags"); NodeList embeds = objectTag.getChildren().extractAllNodesThatMatch( new TagNameFilter( FlashEmbeddedObject.EMBED_TAG_NAME ) ); //Note we might have at most two tags, one opening and one closing if( embeds.size() <= 2 ) { parseFlashEmbedTag( embeds, flashObjToFill ); } else { logger.error("The number of the EMBED subtags of the OBJECT tag is greater than two (" + embeds.size() + ")"); throw new MessageException( MessageException.IMPROPER_EMBEDDED_OBJECT ); } } else { logger.warn( "Encountered an OBJECT node: " + objectTag + " that is an end tag!" ); } } } } return flashObjToFill; }
@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) objectNode; if( !objectTag.isEndTag() objectTag.isEmptyXmlTag() ) { logger.debug(STR + objectTag + STR); Vector<Attribute> atts = (Vector<Attribute>) objectTag.getAttributesEx(); if( atts != null ) { for( Attribute att : atts ) { String nameValue = att.getName(); String valueValue = att.getValue(); if( ! flashObjToFill.setNameValue( nameValue, valueValue ) ) { logger.warn(STR + nameValue + STR + valueValue + "'" ); } else { logger.debug(STR + nameValue + STR + valueValue + "'"); } } } logger.debug(STR + objectTag + STR); NodeList parameters = objectTag.getChildren().extractAllNodesThatMatch( new TagNameFilter( FlashEmbeddedObject.PARAM_TAG_NAME ) ); for( int i = 0 ; i < parameters.size(); i++) { Node node = parameters.elementAt( i ); if( node instanceof Tag ){ String nameValue = ((Tag) node).getAttribute( FlashEmbeddedObject.PARAM_NAME_ATTR ); String valueValue = ((Tag) node).getAttribute( FlashEmbeddedObject.PARAM_VALUE_ATT ); if( nameValue != null && valueValue != null ) { if( ! flashObjToFill.setNameValue( nameValue, valueValue ) ) { logger.warn(STR + nameValue + STR + valueValue + "'" ); } else { logger.debug(STR + nameValue + STR + valueValue + "'"); } } } else { logger.warn( STR + node + STR ); } } logger.debug(STR + objectTag + STR); NodeList embeds = objectTag.getChildren().extractAllNodesThatMatch( new TagNameFilter( FlashEmbeddedObject.EMBED_TAG_NAME ) ); if( embeds.size() <= 2 ) { parseFlashEmbedTag( embeds, flashObjToFill ); } else { logger.error(STR + embeds.size() + ")"); throw new MessageException( MessageException.IMPROPER_EMBEDDED_OBJECT ); } } else { logger.warn( STR + objectTag + STR ); } } } } return flashObjToFill; }
/** * 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 are more than one EMBED subtags */
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 clear the container log.println("remove old elements in container"); System.out.println("remove old elements in container"); try { oObj.removeByName(Name); log.println("old elements removed -> OK"); System.out.println("old elements removed -> OK"); } catch (com.sun.star.container.NoSuchElementException e) { log.println("no old elements available -> OK"); System.out.println("no old elements available -> OK"); } // insert an element log.println("insertNewByName"); try { System.out.println("Inserting element with name '" + Name + "'"); log.println("Inserting element with name '" + Name + "'"); oGroup = oObj.insertNewByName(Name); System.out.println("done"); } catch (com.sun.star.container.ElementExistException e) { log.println("insertNewByName(): " + e); result &= false; } catch (com.sun.star.lang.IllegalArgumentException e) { log.println("insertNewByName(): " + e); result &= false; } result &= ( oGroup != null ); tRes.tested("insertNewByName()", result); } // end insertNewByName()
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.println(STR); } catch (com.sun.star.container.NoSuchElementException e) { log.println(STR); System.out.println(STR); } log.println(STR); try { System.out.println(STR + Name + "'"); log.println(STR + Name + "'"); oGroup = oObj.insertNewByName(Name); System.out.println("done"); } catch (com.sun.star.container.ElementExistException e) { log.println(STR + e); result &= false; } catch (com.sun.star.lang.IllegalArgumentException e) { log.println(STR + e); result &= false; } result &= ( oGroup != null ); tRes.tested(STR, result); }
/** * 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); } while (it.hasNext()) { Order ord = (Order) it.next(); if (order.getPrice() < ord.getPrice()) { int buyVolume = ord.getVolume(); int sellVolume = order.getVolume(); if (buyVolume == sellVolume) { buyOrders.remove(ord.getPrice(), ord); break; } else if (buyVolume > sellVolume) { buyOrders.get(ord.getPrice()).setVolume(buyVolume - sellVolume); break; } else if (sellVolume > buyVolume) { order.setVolume(sellVolume - buyVolume); } } else { sellOrders.put(order.getPrice(), order); break; } } } else { //Проверяем есть ли цена нижу в sell ордерах. Iterator it = sellOrders.values().iterator(); if (!it.hasNext()) { buyOrders.put(order.getPrice(), order); } while (it.hasNext()) { Order ord = (Order) it.next(); if (order.getPrice() > ord.getPrice()) { int buyVolume = order.getVolume(); int sellVolume = ord.getVolume(); if (buyVolume == sellVolume) { sellOrders.remove(ord.getPrice(), ord); break; } else if (buyVolume < sellVolume) { sellOrders.get(ord.getPrice()).setVolume(buyVolume - sellVolume); break; } else if (sellVolume < buyVolume) { order.setVolume(buyVolume - sellVolume); } } else { buyOrders.put(order.getPrice(), order); break; } } } }
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 = order.getVolume(); if (buyVolume == sellVolume) { buyOrders.remove(ord.getPrice(), ord); break; } else if (buyVolume > sellVolume) { buyOrders.get(ord.getPrice()).setVolume(buyVolume - sellVolume); break; } else if (sellVolume > buyVolume) { order.setVolume(sellVolume - buyVolume); } } else { sellOrders.put(order.getPrice(), order); break; } } } else { Iterator it = sellOrders.values().iterator(); if (!it.hasNext()) { buyOrders.put(order.getPrice(), order); } while (it.hasNext()) { Order ord = (Order) it.next(); if (order.getPrice() > ord.getPrice()) { int buyVolume = order.getVolume(); int sellVolume = ord.getVolume(); if (buyVolume == sellVolume) { sellOrders.remove(ord.getPrice(), ord); break; } else if (buyVolume < sellVolume) { sellOrders.get(ord.getPrice()).setVolume(buyVolume - sellVolume); break; } else if (sellVolume < buyVolume) { order.setVolume(buyVolume - sellVolume); } } else { buyOrders.put(order.getPrice(), order); break; } } } }
/** * 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(precision, rm); BigDecimal result = new BigDecimal(value, offset, len, mc); String res = "3.805E-40"; int resScale = 43; assertEquals("incorrect value", res, result.toString()); assertEquals("incorrect scale", resScale, result.scale()); try { // Regression for HARMONY-783 new BigDecimal(new char[] {}, 0, 0, MathContext.DECIMAL32); fail("NumberFormatException has not been thrown"); } catch (NumberFormatException e) { } // Now test more than just RoundingMode.CEILING: // // ATTENTION: // The remaining section is TEXTUALLY COPIED // from testConstrBigIntegerScaleMathContext // with minor repetitive modifications. // char[] biCA = "bla: 12345678901234567890123456789012345.0E+10, and more bla".toCharArray(); char[] nbiCA = "bla: -12345678901234567890123456789012345.E+10, and more bla".toCharArray(); BigDecimal bd; mc = new MathContext(31, RoundingMode.UP); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678902E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678902E+44", bd.toString()); mc = new MathContext(28, RoundingMode.DOWN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678E+44", bd.toString()); mc = new MathContext(33, RoundingMode.CEILING); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.23456789012345678901234567890124E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.23456789012345678901234567890123E+44", bd.toString()); mc = new MathContext(34, RoundingMode.FLOOR); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678901234E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678901235E+44", bd.toString()); mc = new MathContext(34, RoundingMode.HALF_EVEN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678901234E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678901234E+44", bd.toString()); bd = new BigDecimal("-123456789012345678901234567890123350000000000".toCharArray(), 0, 46, mc); assertEquals("incorrect value", "-1.234567890123456789012345678901234E+44", bd.toString()); mc = new MathContext(34, RoundingMode.HALF_UP); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678901235E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678901235E+44", bd.toString()); mc = new MathContext(34, RoundingMode.HALF_DOWN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals("incorrect value", "1.234567890123456789012345678901234E+44", bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals("incorrect value", "-1.234567890123456789012345678901234E+44", bd.toString()); mc = new MathContext(34, RoundingMode.UNNECESSARY); try { bd = new BigDecimal(biCA, 5, 41, mc); fail("No ArithmeticException for RoundingMode.UNNECESSARY"); } catch (ArithmeticException e) { // expected } try { bd = new BigDecimal(nbiCA, 5, 41, mc); fail("No ArithmeticException for RoundingMode.UNNECESSARY"); } catch (ArithmeticException e) { // expected } }
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 res = STR; int resScale = 43; assertEquals(STR, res, result.toString()); assertEquals(STR, resScale, result.scale()); try { new BigDecimal(new char[] {}, 0, 0, MathContext.DECIMAL32); fail(STR); } catch (NumberFormatException e) { } char[] nbiCA = STR.toCharArray(); BigDecimal bd; mc = new MathContext(31, RoundingMode.UP); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(28, RoundingMode.DOWN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(33, RoundingMode.CEILING); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(34, RoundingMode.FLOOR); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(34, RoundingMode.HALF_EVEN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(STR.toCharArray(), 0, 46, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(34, RoundingMode.HALF_UP); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(34, RoundingMode.HALF_DOWN); bd = new BigDecimal(biCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); bd = new BigDecimal(nbiCA, 5, 41, mc); assertEquals(STR, STR, bd.toString()); mc = new MathContext(34, RoundingMode.UNNECESSARY); try { bd = new BigDecimal(biCA, 5, 41, mc); fail(STR); } catch (ArithmeticException e) { } try { bd = new BigDecimal(nbiCA, 5, 41, mc); fail(STR); } catch (ArithmeticException e) { } }
/** * 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) { if (((List<String>) outObj).size() == 1) { output = ((List<String>) outObj).get(0); } // if there are multiple values, return null. } } return output; }
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); } } } return output; }
/** * 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 = 0; while (numericCount < 13 && isDigit(ch)) { numericCount++; //textCount++; int i = idx + numericCount; if (i >= len) { break; } ch = msg.charAt(i); } if (numericCount >= 13) { return idx - startpos; } ch = msg.charAt(idx); if (!encoder.canEncode(ch)) { throw new WriterException("Non-encodable character detected: " + ch + " (Unicode: " + (int) ch + ')'); } idx++; } return idx - startpos; }
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 = idx + numericCount; if (i >= len) { break; } ch = msg.charAt(i); } if (numericCount >= 13) { return idx - startpos; } ch = msg.charAt(idx); if (!encoder.canEncode(ch)) { throw new WriterException(STR + ch + STR + (int) ch + ')'); } idx++; } return idx - startpos; }
/** * 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 = new Person(30, "name", "surname", Gender.MALE); final Person personProxy = createWrapperFactory(Person.class).wrap(person); scenario.apply(personProxy); verifyDirtyEntityManager( dirtyEntityManager, expectedNumberOfDirtyEntities, expectedDirtyEntityManagerCalls, new BeanFieldMatcher<Person>(Person.class, "id", person.getId())); }
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", STR, Gender.MALE); final Person personProxy = createWrapperFactory(Person.class).wrap(person); scenario.apply(personProxy); verifyDirtyEntityManager( dirtyEntityManager, expectedNumberOfDirtyEntities, expectedDirtyEntityManagerCalls, new BeanFieldMatcher<Person>(Person.class, "id", person.getId())); }
/** * 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 expectedDirtyEntityManagerCalls */
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(); // Create POST message for server httpRequestLogger.logInfo("Setting POST Request for JSON String"); httpConnection.setRequestMethod("POST"); httpConnection.setRequestProperty("User-Agent", USER_AGENT); httpConnection.setRequestProperty("Content-Type", JSON_CONTENT_TYPE); // Send POST message to server httpRequestLogger.logInfo("Sending POST Request with Payload: " + jsonString); httpConnection.setDoOutput(true); DataOutputStream requestDataOut = new DataOutputStream(httpConnection.getOutputStream()); requestDataOut.writeBytes(jsonString); // Flush and close output connection requestDataOut.flush(); requestDataOut.close(); // Get the server response code httpRequestLogger.logInfo("Getting Response from Server"); int responseCode = httpConnection.getResponseCode(); // Fields for building server response message String lineBuffer; StringBuffer serverResponse = new StringBuffer(); try{ // Only build server response message if server response status is 200/OK BufferedReader serverResponseReader = new BufferedReader(new InputStreamReader(httpConnection.getInputStream())); if (responseCode == HttpURLConnection.HTTP_OK){ httpRequestLogger.logInfo("HTTP Response Code: " + responseCode + " OK"); while ((lineBuffer = serverResponseReader.readLine()) != null){ serverResponse.append(lineBuffer); } } } catch (Exception e){ // Log error response form server if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { httpRequestLogger.logInfo("HTTP Response Code: " + responseCode + " NOT FOUND"); } else if (responseCode == HttpURLConnection.HTTP_BAD_METHOD){ httpRequestLogger.logInfo("HTTP Response Code: " + responseCode + " METHOD NOT ALLOWED"); } else { httpRequestLogger.logInfo("HTTP Response Code: " + responseCode + " Unrecognised Response"); } httpRequestLogger.logError(e.toString()); } // Recreate server response message into a single string String responseMessage = serverResponse.toString(); return responseMessage; }
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.setRequestProperty(STR, USER_AGENT); httpConnection.setRequestProperty(STR, JSON_CONTENT_TYPE); httpRequestLogger.logInfo(STR + jsonString); httpConnection.setDoOutput(true); DataOutputStream requestDataOut = new DataOutputStream(httpConnection.getOutputStream()); requestDataOut.writeBytes(jsonString); requestDataOut.flush(); requestDataOut.close(); httpRequestLogger.logInfo(STR); int responseCode = httpConnection.getResponseCode(); String lineBuffer; StringBuffer serverResponse = new StringBuffer(); try{ BufferedReader serverResponseReader = new BufferedReader(new InputStreamReader(httpConnection.getInputStream())); if (responseCode == HttpURLConnection.HTTP_OK){ httpRequestLogger.logInfo(STR + responseCode + STR); while ((lineBuffer = serverResponseReader.readLine()) != null){ serverResponse.append(lineBuffer); } } } catch (Exception e){ if (responseCode == HttpURLConnection.HTTP_NOT_FOUND) { httpRequestLogger.logInfo(STR + responseCode + STR); } else if (responseCode == HttpURLConnection.HTTP_BAD_METHOD){ httpRequestLogger.logInfo(STR + responseCode + STR); } else { httpRequestLogger.logInfo(STR + responseCode + STR); } httpRequestLogger.logError(e.toString()); } String responseMessage = serverResponse.toString(); return responseMessage; }
/** * 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.startsWith("fabric-ensemble-" + clusterId)) { toRemove.add(p); } } profiles.removeAll(toRemove); dataStore.setContainerProfiles(container, profiles); }
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(toRemove); dataStore.setContainerProfiles(container, profiles); }
/** * 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(), Matchers.greaterThan(0) ); }
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 DemoBehaviour behaviour) { applicationSettingsService.set(DemoBehaviour.class, behaviour); container.informUser("Subscriber behaviour set to: " + behaviour); }
@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()) { Map.Entry<String, JsonNode> entry = tableUpdatesItr.next(); TableSchema tableSchema = dbSchema.getTableSchema(entry.getKey()); TableUpdate tableUpdate = jsonNodeToTableUpdate(tableSchema, entry.getValue()); tableUpdateMap.put(entry.getKey(), tableUpdate); } return TableUpdates.tableUpdates(tableUpdateMap); }
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(); TableSchema tableSchema = dbSchema.getTableSchema(entry.getKey()); TableUpdate tableUpdate = jsonNodeToTableUpdate(tableSchema, entry.getValue()); tableUpdateMap.put(entry.getKey(), tableUpdate); } return TableUpdates.tableUpdates(tableUpdateMap); }
/** * 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.TableSchema" ]
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.onosproject.ovsdb.rfc.schema.TableSchema;
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.setSelect(this); res.setStore(store); res.setLocking(forUpdate); try { addEagerResults(res, this, store, fetch); } catch (SQLException se) { res.close(); throw se; } return res; }
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); try { addEagerResults(res, this, store, fetch); } catch (SQLException se) { res.close(); throw se; } return res; }
/** * 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().getDAO(Constants.JDBC_DAO); try { dao.openSession(null); for(String aliasName: queryResultsObjectDataMap.keySet()) { //SQL to get information regarding which column to be hyperlined for the given table alias. String columnIdSQL = "Select col.COLUMN_NAME, coltable.alias_name From CATISSUE_INTERFACE_COLUMN_DATA col, CATISSUE_QUERY_TABLE_DATA maintable, CATISSUE_QUERY_TABLE_DATA coltable, CATISSUE_QUERY_EDITLINK_COLS linkcol " + " where maintable.TABLE_ID = linkcol.TABLE_ID " + " and linkcol.col_id = col.IDENTIFIER " + " and coltable.TABLE_ID = col.TABLE_ID" + " and maintable.ALIAS_NAME = '" + aliasName +"' "; List<List<String>> list = dao.executeQuery(columnIdSQL, null, false, null); for (List<String> row: list) { String columnName = row.get(0); String actualTableAliasName = row.get(1); int index = getIndex(resultView, actualTableAliasName, columnName); if (index!=-1) { // This column is present in the view. boolean attributeFound = true; QueryResultObjectData queryResultObjectData = queryResultsObjectDataMap.get(actualTableAliasName); if (queryResultObjectData==null) // this attribute belongs to the one of the dependent object. { attributeFound = false; for(String theAliasName: queryResultsObjectDataMap.keySet()) { queryResultObjectData = queryResultsObjectDataMap.get(theAliasName); if (queryResultObjectData.getDependentObjectAliases().contains(actualTableAliasName)) { //The dependent object containing the required attribute found!!!!! attributeFound = true; break; } } } if (attributeFound) { map.put(index, queryResultObjectData); } } } } return map; } catch (ClassNotFoundException classExp) { throw new DAOException(classExp.getMessage(), classExp); } finally { dao.closeSession(); } }
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_DAO); try { dao.openSession(null); for(String aliasName: queryResultsObjectDataMap.keySet()) { String columnIdSQL = STR + STR + STR + STR + STR + aliasName +STR; List<List<String>> list = dao.executeQuery(columnIdSQL, null, false, null); for (List<String> row: list) { String columnName = row.get(0); String actualTableAliasName = row.get(1); int index = getIndex(resultView, actualTableAliasName, columnName); if (index!=-1) { boolean attributeFound = true; QueryResultObjectData queryResultObjectData = queryResultsObjectDataMap.get(actualTableAliasName); if (queryResultObjectData==null) { attributeFound = false; for(String theAliasName: queryResultsObjectDataMap.keySet()) { queryResultObjectData = queryResultsObjectDataMap.get(theAliasName); if (queryResultObjectData.getDependentObjectAliases().contains(actualTableAliasName)) { attributeFound = true; break; } } } if (attributeFound) { map.put(index, queryResultObjectData); } } } } return map; } catch (ClassNotFoundException classExp) { throw new DAOException(classExp.getMessage(), classExp); } finally { dao.closeSession(); } }
/** * 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 information of the different objects present in Query like, alias Name, index of the id in the query results etc. * @return the map of columns to be hyperlinked. * @throws DAOException if any db related error occures. * * Patch ID: SimpleSearchEdit_2 * Description: Method to get the Map which contains information about which columns to be Hyperlinked. */
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.util.Vector;
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)){ selectedPeopleCol = Arrays.<String>asList(selectedPeople); } for (String personID : checkpointDb.getKeys()){ if ((selectedPeople == null) || (selectedPeople.length == 0) || (selectedPeopleCol.contains(personID))){ Collection<KeyFrame> personFrames = new ArrayList<>(); List<CheckPoint> checkPoints = checkpointDb.getList(personID); Node personShape = buildPersonShape(checkPoints, shapeProvider); if (personShape == null){ continue; } final Map<String,String> personInfo = getInfoForPerson(personID, checkPoints); personShape.setOnMouseClicked(new EventHandler<MouseEvent>() {
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(selectedPeople); } for (String personID : checkpointDb.getKeys()){ if ((selectedPeople == null) (selectedPeople.length == 0) (selectedPeopleCol.contains(personID))){ Collection<KeyFrame> personFrames = new ArrayList<>(); List<CheckPoint> checkPoints = checkpointDb.getList(personID); Node personShape = buildPersonShape(checkPoints, shapeProvider); if (personShape == null){ continue; } final Map<String,String> personInfo = getInfoForPerson(personID, checkPoints); personShape.setOnMouseClicked(new EventHandler<MouseEvent>() {
/** * 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 of people * @param selectedPeople People whose visualizations will be updated * @return {@link KeyFrame} instances describing the movements of people on the map. * @throws IOException When a person shape could not be loaded for any reason */
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 be passed as an argument with expected results to * {@link JDBC#assertUnorderedResultSet(ResultSet,String[][])}. * * @param rows a collection of rows, where each row is a list of strings * @return a {@code String[][]} containing the same values as {@code rows}
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#assertUnorderedResultSet(ResultSet,String[][])}. * * @param rows a collection of rows, where each row is a list of strings * @return a {@code String[][]} containing the same values as {@code rows}
/** * 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(); verify(unpacker).readValue(); verify(unpacker).readArrayEnd(); }
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()) { entityplayer.openContainer.updateProgressBar(packetIn.getVarIndex(), packetIn.getVarValue()); } }
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.updateProgressBar(packetIn.getVarIndex(), packetIn.getVarValue()); } }
/** * 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.close(); }
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); } return format; } private static final class AllocationNode { public final long startPosition; public final long endPosition; public boolean wasInitialized; @Nullable public Allocation allocation; @Nullable public AllocationNode next; public AllocationNode(long startPosition, int allocationLength) { this.startPosition = startPosition; this.endPosition = startPosition + allocationLength; }
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 AllocationNode { public final long startPosition; public final long endPosition; public boolean wasInitialized; @Nullable public Allocation allocation; @Nullable public AllocationNode next; public AllocationNode(long startPosition, int allocationLength) { this.startPosition = startPosition; this.endPosition = startPosition + allocationLength; }
/** * 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; } } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {} connectFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container pane = connectFrame.getContentPane(); pane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); final JLabel compLabel = new JLabel(messages.getString("comp_uri")); c.gridx = 0; c.gridy = 0; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; pane.add(compLabel,c); final JTextField compField = new JTextField(); c.gridx = 1; pane.add(compField,c); final JLabel portLabel = new JLabel(messages.getString("port")); c.gridx = 0; c.gridy = 1; pane.add(portLabel,c); final JTextField portField = new JTextField(); c.gridx = 1; c.gridy = 1; pane.add(portField,c); final JLabel langLabel = new JLabel(messages.getString("localization")); c.gridx = 0; c.gridy = 2; pane.add(langLabel,c); final JComboBox<String> langBox = new JComboBox<>(new String[]{"EN","CZ"}); c.gridx = 1; c.gridy = 2; pane.add(langBox,c); final JButton connectButton = new JButton(messages.getString("connect")); c.gridx = 0; c.gridy = 3; c.fill = GridBagConstraints.NONE; connectButton.addActionListener(new ActionListener() {
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.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container pane = connectFrame.getContentPane(); pane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); final JLabel compLabel = new JLabel(messages.getString(STR)); c.gridx = 0; c.gridy = 0; c.weightx = 1; c.fill = GridBagConstraints.HORIZONTAL; pane.add(compLabel,c); final JTextField compField = new JTextField(); c.gridx = 1; pane.add(compField,c); final JLabel portLabel = new JLabel(messages.getString("port")); c.gridx = 0; c.gridy = 1; pane.add(portLabel,c); final JTextField portField = new JTextField(); c.gridx = 1; c.gridy = 1; pane.add(portField,c); final JLabel langLabel = new JLabel(messages.getString(STR)); c.gridx = 0; c.gridy = 2; pane.add(langLabel,c); final JComboBox<String> langBox = new JComboBox<>(new String[]{"EN","CZ"}); c.gridx = 1; c.gridy = 2; pane.add(langBox,c); final JButton connectButton = new JButton(messages.getString(STR)); c.gridx = 0; c.gridy = 3; c.fill = GridBagConstraints.NONE; connectButton.addActionListener(new ActionListener() {
/** * 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.UnsupportedLookAndFeelException" ]
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.swing.UnsupportedLookAndFeelException;
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.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */
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(IOException ex) { ex.printStackTrace(); } } public void setBackgroundColor(Color b){this.background=b;}
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 setBackgroundColor(Color b){this.background=b;}
/** * 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 BluetoothGattCharacteristic batteryLevelCharacteristic = batteryService.getCharacteristic(BATTERY_LEVEL_CHARACTERISTIC); if (batteryLevelCharacteristic == null) return false; // Check characteristic property final int properties = batteryLevelCharacteristic.getProperties(); if ((properties & BluetoothGattCharacteristic.PROPERTY_READ) == 0) { return setBatteryNotifications(true); } Logger.a(mLogSession, "Reading battery level..."); return readCharacteristic(batteryLevelCharacteristic); }
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(BATTERY_LEVEL_CHARACTERISTIC); if (batteryLevelCharacteristic == null) return false; final int properties = batteryLevelCharacteristic.getProperties(); if ((properties & BluetoothGattCharacteristic.PROPERTY_READ) == 0) { return setBatteryNotifications(true); } Logger.a(mLogSession, STR); return readCharacteristic(batteryLevelCharacteristic); }
/** * 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.getSeriesKey(series).toString(); String description = label; Shape shape = getSeriesShape(series); Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke outlineStroke = getSeriesOutlineStroke(series); result = new LegendItem(label, description, null, null, shape, paint, outlineStroke, outlinePaint); } } return result; }
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); Paint paint = getSeriesPaint(series); Paint outlinePaint = getSeriesOutlinePaint(series); Stroke outlineStroke = getSeriesOutlineStroke(series); result = new LegendItem(label, description, null, null, shape, paint, outlineStroke, outlinePaint); } } return result; }
/** * 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.toLowerCase(Locale.US).startsWith(AuthenticatorConstants.BEARER_PREFIX)) { // Split the auth header to get the access token. String[] authHeaderParts = authHeader.split(" "); if (authHeaderParts.length == 2) { token = authHeaderParts[1]; } else if (authHeaderParts.length < 2) { return null; } } } else { return null; } String cookie = headers.get(AuthenticatorConstants.COOKIE_HEADER); if (cookie != null) { cookie = cookie.trim(); String[] cookies = cookie.split(";"); String tokenFromCookie = Arrays.stream(cookies).filter(name -> name.contains(cookieHeader)).findFirst() .orElse(""); String[] tokenParts = tokenFromCookie.split("="); if (tokenParts.length == 2) { token += tokenParts[1]; } } return token; }
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 regexps from them String versionRegex = "-?[0-9]*.*\\.jar"; ArrayList<Pattern> patterns = new ArrayList<>(tomcatRequiredJars.length); for (String jar : tomcatRequiredJars) patterns.add(Pattern.compile(jar + versionRegex)); // Don't need to copy any jars already in the tomcat install File tomcatLib = new File(tomcatLibPath); // Find all jars in the tomcatModulePath and add them as required jars try { for (File file : (new File(moduleJarDir)).listFiles()) { if (file.isFile() && file.getName().endsWith(".jar")) { requiredFiles.add(file); } } } catch (NullPointerException e) { throw new IOException( "No files found in tomcat module directory " + getModulePath() + "/lib/"); } // Find all the required jars in the extraJarsPath try { for (File file : (new File(extraJarsPath)).listFiles()) { for (Pattern pattern : patterns) { if (pattern.matcher(file.getName()).find()) { requiredFiles.add(file); break; } } } } catch (NullPointerException e) { throw new IOException("No files found in extra jars directory " + extraJarsPath); } // Copy the required jars to the given tomcat lib folder for (File file : requiredFiles) { Files.copy(file.toPath(), tomcatLib.toPath().resolve(file.toPath().getFileName()), StandardCopyOption.REPLACE_EXISTING); logger.debug("Copied required jar from " + file.toPath() + " to " + (new File(tomcatLibPath)).toPath().resolve(file.toPath().getFileName())); } logger.info("Copied required jars into the Tomcat installation"); } /** * Update the tomcat installation property file using {@link #editPropertyFile)}
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.add(Pattern.compile(jar + versionRegex)); File tomcatLib = new File(tomcatLibPath); try { for (File file : (new File(moduleJarDir)).listFiles()) { if (file.isFile() && file.getName().endsWith(".jar")) { requiredFiles.add(file); } } } catch (NullPointerException e) { throw new IOException( STR + getModulePath() + "/lib/"); } try { for (File file : (new File(extraJarsPath)).listFiles()) { for (Pattern pattern : patterns) { if (pattern.matcher(file.getName()).find()) { requiredFiles.add(file); break; } } } } catch (NullPointerException e) { throw new IOException(STR + extraJarsPath); } for (File file : requiredFiles) { Files.copy(file.toPath(), tomcatLib.toPath().resolve(file.toPath().getFileName()), StandardCopyOption.REPLACE_EXISTING); logger.debug(STR + file.toPath() + STR + (new File(tomcatLibPath)).toPath().resolve(file.toPath().getFileName())); } logger.info(STR); } /** * Update the tomcat installation property file using {@link #editPropertyFile)}
/** * 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())); Assert.assertEquals("Invocation on remote interface of Hello did *not* use pass-by-reference semantics", ret.getValue(), "Hello " + this.getClass().getSimpleName()); try { remote.hello(null); } catch(RemoteByReferenceException he) { Assert.assertEquals("Invocation on remote interface of an EJB did *not* use pass-by-reference in exception", he.getMessage(), "Param was null"); } }
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(null); } catch(RemoteByReferenceException he) { Assert.assertEquals(STR, he.getMessage(), STR); } }
/** * 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); } else if ("init".equals(action)) { return init(data, callbackContext); } else if ("setHandler".equals(action)) { return setHandler(data, callbackContext); } else if ("setLogger".equals(action)) { return setLogger(data, callbackContext); } else if ("load".equals(action)) { return load(data, callbackContext); } else if ("exit".equals(action)) { return exit(data, callbackContext); } log(DEBUG, "execute() did not recognize this action: " + action); return false; }
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)) { return setHandler(data, callbackContext); } else if (STR.equals(action)) { return setLogger(data, callbackContext); } else if ("load".equals(action)) { return load(data, callbackContext); } else if ("exit".equals(action)) { return exit(data, callbackContext); } log(DEBUG, STR + action); return false; }
/** * 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(rewardString, ","); this.reward_min = this.validValue(rewardTokenizer.nextToken()); this.reward_max = this.validValue(rewardTokenizer.nextToken()); } else { this.reward_min = Double.NaN; this.reward_max = Double.NaN; } }
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 = Double.NaN; this.reward_max = Double.NaN; } }
/** * 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 invocation was successful (for example, it could be * false if item is disabled). */
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, FINAL); final EnumSet<Modifier> private_modifier = EnumSet.of(PRIVATE); final JavaWriter java_writer = new JavaWriter(writer); final boolean is_default_module = !class_name.equals(_DEFAULT_MODEL_MODULE); java_writer.setCompressingTypes(true); java_writer.emitSingleLineComment(_HEADER_COMMENT) .emitPackage(package_name) .emitImports(_SEGUE_CONTROLLER_CLASS, "dagger.Module", "dagger.Provides", "javax.inject.Singleton", JavaWriter.type(Gson.class), JavaWriter.type(GsonProvider.class), JavaWriter.type(GsonConverter.class), JavaWriter.type(InputStream.class), JavaWriter.type(IOException.class), JavaWriter.type(Named.class), JavaWriter.type(ExclusionStrategy.class), JavaWriter.type(FieldAttributes.class), JavaWriter.type(InstanceCreator.class), JavaWriter.type(Set.class), JavaWriter.type(SegueController.class), JavaWriter.type(Timber.class), JavaWriter.type(HashSet.class), JavaWriter.type(Arrays.class)); if (has_default_models && is_default_module) { java_writer.emitStaticImports(default_model_module + ".default_models"); } java_writer.emitEmptyLine(); final Map<String, Object> attributes = new HashMap<>(5); attributes.put("inject", "{\n" + "_SegueController.class" + "\n}"); attributes.put("overrides", is_default_module); attributes.put("library", true); attributes.put("complete", false); java_writer.emitJavadoc("<p>Module for injecting:\n" + "<ul>\n" + "%s" + "</ul></p>", modelList(models)) .emitAnnotation(Module.class, attributes) .beginType(class_name, _CLASS, EnumSet.of(PUBLIC)); final List<String> model_exclusions = new ArrayList<>(models.size()); final String model_exclusion = "(Class) %s.class"; if (class_name.equals(_DEFAULT_MODEL_MODULE)) { for (ModelData model : models) model_exclusions.add(String.format(model_exclusion, model.contract)); java_writer.emitJavadoc("Set of production models") .emitField(JavaWriter.type(Set.class, JavaWriter.type(Class.class)), "default_models" , EnumSet.of(PUBLIC, STATIC, FINAL)) .beginControlFlow("static"); final String put = "default_models.put(%s)"; for (String exclusion : model_exclusions) java_writer.emitStatement(put, exclusion); } java_writer.emitEmptyLine() .beginMethod(null, class_name, EnumSet.of(PUBLIC), JavaWriter.type(SegueController.class) , _SEGUE_CONTROLLER) .emitStatement("_segue_controller = segue_controller") .endMethod() .emitEmptyLine() .emitAnnotation(Provides.class) .emitAnnotation(Singleton.class) .beginMethod(JavaWriter.type(Gson.class), "providesGson", EnumSet.noneOf(Modifier.class) , JavaWriter.type(GsonProvider.class), "gson_provider") .emitStatement("return buildGson(gson_provider.gsonBuilder())") .endMethod(); // Model providers for (ModelData model : models) { java_writer.emitEmptyLine() .emitAnnotation(Provides.class) .emitAnnotation(Singleton.class); String[] provider_parameters = model.should_serialize ? new String[] { JavaWriter.type(GsonProvider.class) , "gson_provider" , "@Named(" + stringLiteral(model.contract + "") + ") " + JavaWriter.type( GsonConverter.class) , "converter" // TODO: could only do this and register if implementation has @Produce methods , "@Named(com.imminentmeals.prestige.ControllerContract.BUS) " + JavaWriter.type(Bus.class) , "controller_bus"} : new String[] { "@Named(com.imminentmeals.prestige.ControllerContract.BUS) " + JavaWriter.type( Bus.class) , "controller_bus" }; final String[] new_instance_format_parameters; if (model.parameters == null || model.parameters.isEmpty()) { new_instance_format_parameters = new String[] {java_writer.compressType(model.implementation + ""), ""}; } else { final Set<String> provider_method_parameters = new LinkedHashSet<>(Arrays.asList(provider_parameters)); final List<String> constructor_parameters = constructorParameters(model, provider_method_parameters); provider_parameters = provider_method_parameters.toArray(provider_parameters); new_instance_format_parameters = new String[] { java_writer.compressType(model.implementation + "") , Joiner.on(", ").join(constructor_parameters)}; } java_writer.beginMethod(model.contract + "", "provides" + model.contract.getSimpleName(), EnumSet.noneOf(Modifier.class), provider_parameters); if (model.should_serialize) { java_writer.emitStatement("InputStream input_stream = null") .emitStatement("%s model", java_writer.compressType(model.implementation + "")) .beginControlFlow("try") .beginControlFlow(String.format("if (!_%s%s)", model.variable_name, file_tested)) .emitStatement("_%s%s = true", model.variable_name, file_tested) .emitStatement("input_stream = gson_provider.inputStreamFor(%s.class)", model.contract) .emitStatement("Timber.d(\"Restoring %s from input stream\")", java_writer.compressType(model.implementation + "")) .emitStatement("model = (%s) converter.from(input_stream)", java_writer.compressType(model.implementation + "")) .emitStatement("controller_bus.register(model)") .emitStatement("return model") .nextControlFlow("else") .emitStatement("model = new %s(%s)", (Object[]) new_instance_format_parameters) .emitStatement("controller_bus.register(model)") .emitStatement("return model") .endControlFlow() .nextControlFlow("catch (Exception _)") .emitStatement("Timber.d(\"Nothing to restore; creating model %s\")", model.contract) .emitStatement("model = new %s(%s)", (Object[]) new_instance_format_parameters) .emitStatement("controller_bus.register(model)") .emitStatement("return model") .nextControlFlow("finally") .beginControlFlow("if (input_stream != null)") .beginControlFlow("try") .emitStatement("input_stream.close()") .nextControlFlow("catch (IOException ignored)") .endControlFlow() .endControlFlow() .endControlFlow() .endMethod(); // Creates the GsonConverter java_writer.emitEmptyLine() .emitAnnotation(Provides.class) .emitAnnotation(Singleton.class) .emitAnnotation(Named.class, stringLiteral(model.contract + "")) .beginMethod(JavaWriter.type(GsonConverter.class), "provides" + model.implementation.getSimpleName() + "Converter", EnumSet.noneOf(Modifier.class), JavaWriter.type(Gson.class), "gson") .emitStatement("return new %s(gson, %s.class)" , JavaWriter.type(GsonConverter.class, model.implementation + ""), model.implementation) .endMethod(); } else { java_writer.emitStatement("return new %s(%s)", (Object[]) new_instance_format_parameters) .endMethod(); } } java_writer.emitEmptyLine() .beginMethod(JavaWriter.type(Gson.class), "buildGson", EnumSet.of(PRIVATE) , JavaWriter.type(GsonBuilder.class), "gson_builder"); final Joiner new_line_joiner = Joiner.on("%n"); for (ModelData model : models) { if (is_default_module) model_exclusions.add(String.format(model_exclusion, model.contract)); if (model.should_serialize) { java_writer.emitStatement( "final InstanceCreator<%1$s> %1$s_creator = _segue_controller.instanceCreator(%2$s.class)" , java_writer.compressType(model.implementation + ""), model.contract) .emitStatement("gson_builder.registerTypeAdapter(%1$s.class, %1$s_creator)" , java_writer.compressType(model.implementation + "")); } } java_writer.emitStatement(new_line_joiner.join( "gson_builder.addSerializationExclusionStrategy(new ExclusionStrategy() {" , " public boolean shouldSkipField(FieldAttributes field) {" , " return _models.contains(field.getDeclaredClass());" , " }" , " public boolean shouldSkipClass(Class<?> _) {" , " return false;" , " }" , " private final Set<Class> _models = " + (class_name.equals(_DEFAULT_MODEL_MODULE) ? "default_models;" : (has_default_models ? "default_models.addAll(Arrays.asList(%s));" : "new HashSet(Arrays.asList(%s));")) , "})"), Joiner.on(",\n\t\t").join(model_exclusions)) .emitStatement("return gson_builder.create()") .endMethod() .emitEmptyLine() .emitJavadoc("Log where messages are written") .emitField(JavaWriter.type(String.class), "_TAG", EnumSet.of(PRIVATE, STATIC, FINAL), stringLiteral("Prestige")) .emitJavadoc("Segue Controller") .emitField(JavaWriter.type(SegueController.class), "_segue_controller", private_final); for (ModelData model : models) if (model.should_serialize) { java_writer.emitField(JavaWriter.type(boolean.class), '_' + model.variable_name + file_tested, private_modifier, "false"); } java_writer.endType(); java_writer.close(); }
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 = EnumSet.of(PRIVATE); final JavaWriter java_writer = new JavaWriter(writer); final boolean is_default_module = !class_name.equals(_DEFAULT_MODEL_MODULE); java_writer.setCompressingTypes(true); java_writer.emitSingleLineComment(_HEADER_COMMENT) .emitPackage(package_name) .emitImports(_SEGUE_CONTROLLER_CLASS, STR, STR, STR, JavaWriter.type(Gson.class), JavaWriter.type(GsonProvider.class), JavaWriter.type(GsonConverter.class), JavaWriter.type(InputStream.class), JavaWriter.type(IOException.class), JavaWriter.type(Named.class), JavaWriter.type(ExclusionStrategy.class), JavaWriter.type(FieldAttributes.class), JavaWriter.type(InstanceCreator.class), JavaWriter.type(Set.class), JavaWriter.type(SegueController.class), JavaWriter.type(Timber.class), JavaWriter.type(HashSet.class), JavaWriter.type(Arrays.class)); if (has_default_models && is_default_module) { java_writer.emitStaticImports(default_model_module + STR); } java_writer.emitEmptyLine(); final Map<String, Object> attributes = new HashMap<>(5); attributes.put(STR, "{\n" + STR + "\n}"); attributes.put(STR, is_default_module); attributes.put(STR, true); attributes.put(STR, false); java_writer.emitJavadoc(STR + STR + "%s" + STR, modelList(models)) .emitAnnotation(Module.class, attributes) .beginType(class_name, _CLASS, EnumSet.of(PUBLIC)); final List<String> model_exclusions = new ArrayList<>(models.size()); final String model_exclusion = STR; if (class_name.equals(_DEFAULT_MODEL_MODULE)) { for (ModelData model : models) model_exclusions.add(String.format(model_exclusion, model.contract)); java_writer.emitJavadoc(STR) .emitField(JavaWriter.type(Set.class, JavaWriter.type(Class.class)), STR , EnumSet.of(PUBLIC, STATIC, FINAL)) .beginControlFlow(STR); final String put = STR; for (String exclusion : model_exclusions) java_writer.emitStatement(put, exclusion); } java_writer.emitEmptyLine() .beginMethod(null, class_name, EnumSet.of(PUBLIC), JavaWriter.type(SegueController.class) , _SEGUE_CONTROLLER) .emitStatement(STR) .endMethod() .emitEmptyLine() .emitAnnotation(Provides.class) .emitAnnotation(Singleton.class) .beginMethod(JavaWriter.type(Gson.class), STR, EnumSet.noneOf(Modifier.class) , JavaWriter.type(GsonProvider.class), STR) .emitStatement(STR) .endMethod(); for (ModelData model : models) { java_writer.emitEmptyLine() .emitAnnotation(Provides.class) .emitAnnotation(Singleton.class); String[] provider_parameters = model.should_serialize ? new String[] { JavaWriter.type(GsonProvider.class) , STR , STR + stringLiteral(model.contract + STR) STRconverterSTR@Named(com.imminentmeals.prestige.ControllerContract.BUS) STRcontroller_busSTR@Named(com.imminentmeals.prestige.ControllerContract.BUS) STRcontroller_busSTRSTRSTRSTR, STRSTRprovidesSTRInputStream input_stream = nullSTR%s modelSTRSTRtrySTRif (!_%s%s)STR_%s%s = trueSTRinput_stream = gson_provider.inputStreamFor(%s.class)STRTimber.d(\STR)STRSTRmodel = (%s) converter.from(input_stream)STRSTRcontroller_bus.register(model)STRreturn modelSTRelseSTRmodel = new %s(%s)STRcontroller_bus.register(model)STRreturn modelSTRcatch (Exception _)STRTimber.d(\STR)STRmodel = new %s(%s)STRcontroller_bus.register(model)STRreturn modelSTRfinallySTRif (input_stream != null)STRtrySTRinput_stream.close()STRcatch (IOException ignored)STRSTRprovidesSTRConverterSTRgsonSTRreturn new %s(gson, %s.class)STRSTRreturn new %s(%s)STRbuildGsonSTRgson_builderSTR%nSTRfinal InstanceCreator<%1$s> %1$s_creator = _segue_controller.instanceCreator(%2$s.class)STRSTRgson_builder.registerTypeAdapter(%1$s.class, %1$s_creator)STRSTRgson_builder.addSerializationExclusionStrategy(new ExclusionStrategy() {STR public boolean shouldSkipField(FieldAttributes field) {STR return _models.contains(field.getDeclaredClass());STR }STR public boolean shouldSkipClass(Class<?> _) {STR return false;STR }STR private final Set<Class> _models = STRdefault_models;STRdefault_models.addAll(Arrays.asList(%s));STRnew HashSet(Arrays.asList(%s));STR})STR,\n\t\tSTRreturn gson_builder.create()STRLog where messages are writtenSTR_TAGSTRPrestigeSTRSegue ControllerSTR_segue_controllerSTRfalse"); } java_writer.endType(); java_writer.close(); }
/** * 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.JavaWriter", "java.io.IOException", "java.io.InputStream", "java.io.Writer", "java.util.ArrayList", "java.util.Arrays", "java.util.EnumSet", "java.util.HashMap", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "javax.inject.Named", "javax.inject.Singleton", "javax.lang.model.element.Modifier" ]
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.squareup.javawriter.JavaWriter; import java.io.IOException; import java.io.InputStream; import java.io.Writer; import java.util.ArrayList; import java.util.Arrays; import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import javax.inject.Named; import javax.inject.Singleton; import javax.lang.model.element.Modifier;
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 preferences // editor.clear(); // // and commit the changes // editor.commit(); }
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 : argLen = compiler.getArgLength(opPos); break; default : argLen = compiler.getArgLengthOfStep(opPos); } int pos = compiler.getFirstPredicateOpPos(opPos); int nPredicates = compiler.countPredicates(pos); return (nPredicates > 0) ? true : false; }
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 : argLen = compiler.getArgLengthOfStep(opPos); } int pos = compiler.getFirstPredicateOpPos(opPos); int nPredicates = compiler.countPredicates(pos); return (nPredicates > 0) ? true : false; }
/** * 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 position for the step. * @param stepType The type of step, one of OP_GROUP, etc. * * @return true if step has a predicate. * * @throws javax.xml.transform.TransformerException */
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(); batchFetchQueue.removeBatchLoadableEntityKey( entityKey ); }
static void function( Serializable id, EntityPersister persister, SharedSessionContractImplementor session) { final EntityKey entityKey = session.generateEntityKey( id, persister ); final BatchFetchQueue batchFetchQueue = session.getPersistenceContext().getBatchFetchQueue(); batchFetchQueue.removeBatchLoadableEntityKey( entityKey ); }
/** * 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 null) * @param pathSpec The path spec for the servlet * @param clazz The servlet class */
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 CoordinateReferenceSystem[crs.size()])); } }
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)) { continue; } indexByUuid.put(n.getUUID(), n); for (final Object e : n.getInEdges()) { if (e instanceof Edge) { final Edge edge = (Edge) e; final String from = edge.getSourceNode().getUUID(); final String to = n.getUUID(); reorderedGraph.addEdge(from, to); } } for (final Object e : n.getOutEdges()) { if (e instanceof Edge) { final Edge edge = (Edge) e; final String to = edge.getTargetNode().getUUID(); final String from = n.getUUID(); reorderedGraph.addEdge(from, to); } } } this.cycleBreaker.breakCycle(reorderedGraph); this.vertexLayerer.createLayers(reorderedGraph); this.vertexOrdering.orderVertices(reorderedGraph); this.vertexPositioning.calculateVerticesPositions(reorderedGraph, LayerArrangement.BottomUp); final List<GraphLayer> orderedLayers = reorderedGraph.getLayers(); return buildLayout(indexByUuid, orderedLayers); }
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()) { if (e instanceof Edge) { final Edge edge = (Edge) e; final String from = edge.getSourceNode().getUUID(); final String to = n.getUUID(); reorderedGraph.addEdge(from, to); } } for (final Object e : n.getOutEdges()) { if (e instanceof Edge) { final Edge edge = (Edge) e; final String to = edge.getTargetNode().getUUID(); final String from = n.getUUID(); reorderedGraph.addEdge(from, to); } } } this.cycleBreaker.breakCycle(reorderedGraph); this.vertexLayerer.createLayers(reorderedGraph); this.vertexOrdering.orderVertices(reorderedGraph); this.vertexPositioning.calculateVerticesPositions(reorderedGraph, LayerArrangement.BottomUp); final List<GraphLayer> orderedLayers = reorderedGraph.getLayers(); return buildLayout(indexByUuid, orderedLayers); }
/** * 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.graph.processing.layout.Layout", "org.kie.workbench.common.stunner.core.graph.processing.layout.sugiyama.step04.LayerArrangement" ]
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.common.stunner.core.graph.processing.layout.Layout; import org.kie.workbench.common.stunner.core.graph.processing.layout.sugiyama.step04.LayerArrangement;
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); // en/disable add popupMenu.getAddMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning()) { popupMenu.getAddMenuItem().setEnabled(true); } // en/disable edit popupMenu.getEditMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && itemList.getSelectedIndex() > -1) { popupMenu.getEditMenuItem().setEnabled(true); } // en/disable delete popupMenu.getDeleteMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && itemList.getSelectedIndex() > -1) { popupMenu.getDeleteMenuItem().setEnabled(true); } // en/disable move up popupMenu.getMoveUpMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && !itemList.isFirstItem() && itemList.getSelectedIndex() > -1) { popupMenu.getMoveUpMenuItem().setEnabled(true); } // en/disable move down popupMenu.getMoveDownMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && !itemList.isLastItem() && itemList.getSelectedIndex() > -1) { popupMenu.getMoveDownMenuItem().setEnabled(true); } // en/disable midi learn popupMenu.getMidiLearnMenuItem().setEnabled(false); if (itemList.getSelectedIndex() > -1 && midiInRemoteDeviceName != null && !midiInRemoteDeviceName .equals(MidiAutomatorProperties.VALUE_NULL)) { popupMenu.getMidiLearnMenuItem().setEnabled(true); } // en/disable send midi String sendingSignature = itemListService .getMidiFileListSendingSignature(itemList.getSelectedIndex()); popupMenu.getSendMidiMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && switchItemDeviceName != null && !switchItemDeviceName .equals(MidiAutomatorProperties.VALUE_NULL) && sendingSignature != null) { popupMenu.getSendMidiMenuItem().setEnabled(true); } }
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 (!midiLearnService.isMidiLearning()) { popupMenu.getAddMenuItem().setEnabled(true); } popupMenu.getEditMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && itemList.getSelectedIndex() > -1) { popupMenu.getEditMenuItem().setEnabled(true); } popupMenu.getDeleteMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && itemList.getSelectedIndex() > -1) { popupMenu.getDeleteMenuItem().setEnabled(true); } popupMenu.getMoveUpMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && !itemList.isFirstItem() && itemList.getSelectedIndex() > -1) { popupMenu.getMoveUpMenuItem().setEnabled(true); } popupMenu.getMoveDownMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && !itemList.isLastItem() && itemList.getSelectedIndex() > -1) { popupMenu.getMoveDownMenuItem().setEnabled(true); } popupMenu.getMidiLearnMenuItem().setEnabled(false); if (itemList.getSelectedIndex() > -1 && midiInRemoteDeviceName != null && !midiInRemoteDeviceName .equals(MidiAutomatorProperties.VALUE_NULL)) { popupMenu.getMidiLearnMenuItem().setEnabled(true); } String sendingSignature = itemListService .getMidiFileListSendingSignature(itemList.getSelectedIndex()); popupMenu.getSendMidiMenuItem().setEnabled(false); if (!midiLearnService.isMidiLearning() && switchItemDeviceName != null && !switchItemDeviceName .equals(MidiAutomatorProperties.VALUE_NULL) && sendingSignature != null) { popupMenu.getSendMidiMenuItem().setEnabled(true); } }
/** * 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 (!"contextDAO is null".equals(t.getMessage())) { // not using log.error here so it can be garbage collected System.out.println("Listener.contextDestroyed: Error while shutting down openmrs: "); t.printStackTrace(); } } finally { if ("true".equalsIgnoreCase(System.getProperty("FUNCTIONAL_TEST_MODE"))) { //Delete the temporary file created for functional testing and shutdown the mysql daemon String filename = WebConstants.WEBAPP_NAME + "-test-runtime.properties"; File file = new File(OpenmrsUtil.getApplicationDataDirectory(), filename); System.out.println(filename + " delete=" + file.delete()); //new com.mysql.management.MysqldResource(new File("../openmrs/target/database")).shutdown(); } // remove the user context that we set earlier Context.closeSession(); } // commented out because we are not init'ing it in the contextInitialization anymore // super.contextDestroyed(event); try { for (Enumeration<Driver> e = DriverManager.getDrivers(); e.hasMoreElements();) { Driver driver = e.nextElement(); ClassLoader classLoader = driver.getClass().getClassLoader(); // only unload drivers for this webapp if (classLoader == null || classLoader == getClass().getClassLoader()) { DriverManager.deregisterDriver(driver); } else { System.err.println("Didn't remove driver class: " + driver.getClass() + " with classloader of: " + driver.getClass().getClassLoader()); } } } catch (Throwable e) { System.err.println("Listener.contextDestroyed: Failed to cleanup drivers in webapp"); e.printStackTrace(); } OpenmrsClassLoader.onShutdown(); LogManager.shutdown(); // just to make things nice and clean. System.gc(); System.gc(); }
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))) { String filename = WebConstants.WEBAPP_NAME + STR; File file = new File(OpenmrsUtil.getApplicationDataDirectory(), filename); System.out.println(filename + STR + file.delete()); } Context.closeSession(); } try { for (Enumeration<Driver> e = DriverManager.getDrivers(); e.hasMoreElements();) { Driver driver = e.nextElement(); ClassLoader classLoader = driver.getClass().getClassLoader(); if (classLoader == null classLoader == getClass().getClassLoader()) { DriverManager.deregisterDriver(driver); } else { System.err.println(STR + driver.getClass() + STR + driver.getClass().getClassLoader()); } } } catch (Throwable e) { System.err.println(STR); e.printStackTrace(); } OpenmrsClassLoader.onShutdown(); LogManager.shutdown(); System.gc(); System.gc(); }
/** * 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 org.openmrs.util.OpenmrsUtil;
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 (IOException e) { throw new IgniteException(e); } }
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. if (rowWithFocusStyle != null) { setStyleName(rowWithFocusStyle, rowFocusStyleName, false); } rowWithFocusStyle = row.getElement(); setStyleName(rowWithFocusStyle, rowFocusStyleName, true); } } else if (rowWithFocusStyle == row.getElement() || containerWithFocus != escalator.getBody() && rowWithFocusStyle != null) { // Remove focus style. setStyleName(rowWithFocusStyle, rowFocusStyleName, false); rowWithFocusStyle = null; } }
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, rowFocusStyleName, true); } } else if (rowWithFocusStyle == row.getElement() containerWithFocus != escalator.getBody() && rowWithFocusStyle != null) { setStyleName(rowWithFocusStyle, rowFocusStyleName, false); rowWithFocusStyle = null; } }
/** * 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); attributes.put("checkUrl",m.toStemUrl()); attributes.put("checkDependsOn",m.getDependsOn()); } }
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 byte[] buffer = new byte[sizeOfFiles]; String fileName = f.getName(); //try-with-resources to ensure closing stream try (FileInputStream fis = new FileInputStream(f); BufferedInputStream bis = new BufferedInputStream(fis)) { int bytesAmount = 0; while ((bytesAmount = bis.read(buffer)) > 0) { //write each chunk of data into separate file with different number in name String filePartName = String.format("%s.%03d", fileName, partCounter++); File newFile = new File(f.getParent(), filePartName); try (FileOutputStream out = new FileOutputStream(newFile)) { out.write(buffer, 0, bytesAmount); } } } }
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)) { int bytesAmount = 0; while ((bytesAmount = bis.read(buffer)) > 0) { String filePartName = String.format(STR, fileName, partCounter++); File newFile = new File(f.getParent(), filePartName); try (FileOutputStream out = new FileOutputStream(newFile)) { out.write(buffer, 0, bytesAmount); } } } }
/** * 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 * 1Mb. * * The implementation is from this Stackoverflow answer * * https://stackoverflow.com/a/10864346/803890 */
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; } // TODO fix this method to not release any locks if the // redundancy is zero, since no locks are grabbed. try { DistributedMemberLock thePrimaryLock = getPrimaryLock(false); if (thePrimaryLock != null) { thePrimaryLock.unlock(); } else { // InternalDistributedSystem.isDisconnecting probably prevented us from // creating the DLS... hope there's a thread closing this advisor but // it's probably not safe to assert that it already happened } } catch (LockNotHeldException e) { Assert.assertTrue(!isHosting(), "Got LockNotHeldException for Bucket = " + this); } catch (LockServiceDestroyedException e) { Assert.assertTrue(isClosed(), "BucketAdvisor was not closed before destroying PR lock service"); } }
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 { } } catch (LockNotHeldException e) { Assert.assertTrue(!isHosting(), STR + this); } catch (LockServiceDestroyedException e) { Assert.assertTrue(isClosed(), STR); } }
/** * 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, resourceName, tags), serviceCallback); }
ServiceFuture<DigitalTwinsDescriptionInner> function(String resourceGroupName, String resourceName, Map<String, String> tags, final ServiceCallback<DigitalTwinsDescriptionInner> serviceCallback) { return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName, tags), serviceCallback); }
/** * 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 handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
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"); ldrFld.setAccessible(true); Iterable ldrs = (Iterable)ldrFld.get(path); for (Object ldr : ldrs) if (ldr.getClass().getName().endsWith("JarLoader")) try { Field jarFld = ldr.getClass().getDeclaredField("jar"); jarFld.setAccessible(true); ZipFile jar = (ZipFile)jarFld.get(ldr); jar.close(); } catch (Exception e) { warn(log, "Failed to close resource: " + e.getMessage()); } } catch (Exception e) { warn(log, "Failed to close resource: " + e.getMessage()); } }
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 (Object ldr : ldrs) if (ldr.getClass().getName().endsWith(STR)) try { Field jarFld = ldr.getClass().getDeclaredField("jar"); jarFld.setAccessible(true); ZipFile jar = (ZipFile)jarFld.get(ldr); jar.close(); } catch (Exception e) { warn(log, STR + e.getMessage()); } } catch (Exception e) { warn(log, STR + e.getMessage()); } }
/** * 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. * @param log Logger to log possible checked exception with (optional). */
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