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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
private static void addColor( String colorName, int r, int g, int b ) {
colorMap.put( colorName, new ColoringAttributes( r / 255.0f, g / 255.0f, b / 255.0f, ColoringAttributes.FASTEST) );
} | static void function( String colorName, int r, int g, int b ) { colorMap.put( colorName, new ColoringAttributes( r / 255.0f, g / 255.0f, b / 255.0f, ColoringAttributes.FASTEST) ); } | /**
* Add the given color with RGB values to the color map
*/ | Add the given color with RGB values to the color map | addColor | {
"repo_name": "saem/JaamSim",
"path": "com/sandwell/JavaSimulation3D/util/Shape.java",
"license": "gpl-3.0",
"size": 23602
} | [
"javax.media.j3d.ColoringAttributes"
] | import javax.media.j3d.ColoringAttributes; | import javax.media.j3d.*; | [
"javax.media"
] | javax.media; | 1,947,274 |
@Test
public void matchIPv6FlowLabelTest() {
Criterion criterion = Criteria.matchIPv6FlowLabel(0xffffe);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
} | void function() { Criterion criterion = Criteria.matchIPv6FlowLabel(0xffffe); ObjectNode result = criterionCodec.encode(criterion, context); assertThat(result, matchesCriterion(criterion)); } | /**
* Tests IPv6 flow label criterion.
*/ | Tests IPv6 flow label criterion | matchIPv6FlowLabelTest | {
"repo_name": "sonu283304/onos",
"path": "core/common/src/test/java/org/onosproject/codec/impl/CriterionCodecTest.java",
"license": "apache-2.0",
"size": 14736
} | [
"com.fasterxml.jackson.databind.node.ObjectNode",
"org.hamcrest.MatcherAssert",
"org.onosproject.codec.impl.CriterionJsonMatcher",
"org.onosproject.net.flow.criteria.Criteria",
"org.onosproject.net.flow.criteria.Criterion"
] | import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.CriterionJsonMatcher; import org.onosproject.net.flow.criteria.Criteria; import org.onosproject.net.flow.criteria.Criterion; | import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.flow.criteria.*; | [
"com.fasterxml.jackson",
"org.hamcrest",
"org.onosproject.codec",
"org.onosproject.net"
] | com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net; | 844,334 |
public Builder mergeDependentCcCompilationContext(
CcCompilationContext otherCcCompilationContext) {
Preconditions.checkNotNull(otherCcCompilationContext);
compilationPrerequisites.addTransitive(
otherCcCompilationContext.getTransitiveCompilationPrerequisites());
includeDirs.addA... | Builder function( CcCompilationContext otherCcCompilationContext) { Preconditions.checkNotNull(otherCcCompilationContext); compilationPrerequisites.addTransitive( otherCcCompilationContext.getTransitiveCompilationPrerequisites()); includeDirs.addAll(otherCcCompilationContext.getIncludeDirs()); quoteIncludeDirs.addAll(o... | /**
* Merges the {@link CcCompilationContext} of a dependency into this one by adding the contents
* of all of its attributes.
*/ | Merges the <code>CcCompilationContext</code> of a dependency into this one by adding the contents of all of its attributes | mergeDependentCcCompilationContext | {
"repo_name": "ulfjack/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationContext.java",
"license": "apache-2.0",
"size": 49395
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 2,600,954 |
private void writeBufferChain(BufferChainOutputStream bufferChain, boolean compressed) {
ByteBuffer header = ByteBuffer.wrap(headerScratch);
header.put(compressed ? COMPRESSED : UNCOMPRESSED);
int messageLength = bufferChain.readableBytes();
header.putInt(messageLength);
WritableBuffer writeableHe... | void function(BufferChainOutputStream bufferChain, boolean compressed) { ByteBuffer header = ByteBuffer.wrap(headerScratch); header.put(compressed ? COMPRESSED : UNCOMPRESSED); int messageLength = bufferChain.readableBytes(); header.putInt(messageLength); WritableBuffer writeableHeader = bufferAllocator.allocate(HEADER... | /**
* Write a message that has been serialized to a sequence of buffers.
*/ | Write a message that has been serialized to a sequence of buffers | writeBufferChain | {
"repo_name": "carl-mastrangelo/grpc-java",
"path": "core/src/main/java/io/grpc/internal/MessageFramer.java",
"license": "apache-2.0",
"size": 15333
} | [
"java.nio.ByteBuffer",
"java.util.List"
] | import java.nio.ByteBuffer; import java.util.List; | import java.nio.*; import java.util.*; | [
"java.nio",
"java.util"
] | java.nio; java.util; | 1,897,280 |
public static void assertContainsKeyValue(
String mapIterableName,
Object expectedKey,
Object expectedValue,
ImmutableMapIterable<?, ?> immutableMapIterable)
{
try
{
Verify.assertContainsKey(mapIterableName, expectedKey, immutableMapIte... | static void function( String mapIterableName, Object expectedKey, Object expectedValue, ImmutableMapIterable<?, ?> immutableMapIterable) { try { Verify.assertContainsKey(mapIterableName, expectedKey, immutableMapIterable); Object actualValue = immutableMapIterable.get(expectedKey); if (!Comparators.nullSafeEquals(actua... | /**
* Assert that the given {@link ImmutableMapIterable} contains an entry with the given key and value.
*/ | Assert that the given <code>ImmutableMapIterable</code> contains an entry with the given key and value | assertContainsKeyValue | {
"repo_name": "bhav0904/eclipse-collections",
"path": "eclipse-collections-testutils/src/main/java/org/eclipse/collections/impl/test/Verify.java",
"license": "bsd-3-clause",
"size": 138680
} | [
"org.eclipse.collections.api.map.ImmutableMapIterable",
"org.eclipse.collections.impl.block.factory.Comparators",
"org.junit.Assert"
] | import org.eclipse.collections.api.map.ImmutableMapIterable; import org.eclipse.collections.impl.block.factory.Comparators; import org.junit.Assert; | import org.eclipse.collections.api.map.*; import org.eclipse.collections.impl.block.factory.*; import org.junit.*; | [
"org.eclipse.collections",
"org.junit"
] | org.eclipse.collections; org.junit; | 2,592,651 |
private void signalNextAvailable() {
lock.lock();
try {
WALRecord rec = head.get();
if (!cctx.kernalContext().invalid()) {
assert rec instanceof FakeRecord : "Expected head FakeRecord, actual head "
+ (rec != null ... | void function() { lock.lock(); try { WALRecord rec = head.get(); if (!cctx.kernalContext().invalid()) { assert rec instanceof FakeRecord : STR + (rec != null ? rec.getClass().getSimpleName() : "null"); assert written == lastFsyncPos mode != WALMode.FSYNC : STR + written + STR + lastFsyncPos + ']'; fileIO = null; } else... | /**
* Signals next segment available to wake up other worker threads waiting for WAL to write
*/ | Signals next segment available to wake up other worker threads waiting for WAL to write | signalNextAvailable | {
"repo_name": "irudyak/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/FsyncModeFileWriteAheadLogManager.java",
"license": "apache-2.0",
"size": 116910
} | [
"java.io.IOException",
"org.apache.ignite.configuration.WALMode",
"org.apache.ignite.internal.pagemem.wal.record.WALRecord",
"org.apache.ignite.internal.util.typedef.internal.U"
] | import java.io.IOException; import org.apache.ignite.configuration.WALMode; import org.apache.ignite.internal.pagemem.wal.record.WALRecord; import org.apache.ignite.internal.util.typedef.internal.U; | import java.io.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.pagemem.wal.record.*; import org.apache.ignite.internal.util.typedef.internal.*; | [
"java.io",
"org.apache.ignite"
] | java.io; org.apache.ignite; | 1,709,447 |
public Map<Double, K> sortItems(List<K> items, PokemonGo api) {
Map<Double, K> result = new TreeMap<>();
for (K point : items) {
result.put(distFrom(api.latitude, api.longitude, point.getLatitude(), point.getLongitude()),
point);
}
return result;
} | Map<Double, K> function(List<K> items, PokemonGo api) { Map<Double, K> result = new TreeMap<>(); for (K point : items) { result.put(distFrom(api.latitude, api.longitude, point.getLatitude(), point.getLongitude()), point); } return result; } | /**
* Sort items map by distance
*
* @param items the items
* @param api the api
* @return the map
*/ | Sort items map by distance | sortItems | {
"repo_name": "Grover-c13/PokeGOAPI-Java",
"path": "library/src/main/java/com/pokegoapi/util/MapUtil.java",
"license": "gpl-3.0",
"size": 2882
} | [
"com.pokegoapi.api.PokemonGo",
"java.util.List",
"java.util.Map",
"java.util.TreeMap"
] | import com.pokegoapi.api.PokemonGo; import java.util.List; import java.util.Map; import java.util.TreeMap; | import com.pokegoapi.api.*; import java.util.*; | [
"com.pokegoapi.api",
"java.util"
] | com.pokegoapi.api; java.util; | 1,117,476 |
public AxisState draw(Canvas canvas, double cursor, RectShape plotArea,
RectShape dataArea, RectangleEdge edge,
PlotRenderingInfo plotState) {
// if the axis is not visible, don't draw it...
if (!isVisible()) {
return new AxisState(cursor);
}
if ... | AxisState function(Canvas canvas, double cursor, RectShape plotArea, RectShape dataArea, RectangleEdge edge, PlotRenderingInfo plotState) { if (!isVisible()) { return new AxisState(cursor); } if (isAxisLineVisible()) { drawAxisLine(canvas, cursor, dataArea, edge); } AxisState state = new AxisState(cursor); if (isTickMa... | /**
* Draws the axis on a graphics device (such as the screen or a
* printer).
*
* @param canvas
* the graphics device (<code>null</code> not permitted).
* @param cursor
* the cursor location.
* @param plotArea
* the area within which the ax... | Draws the axis on a graphics device (such as the screen or a printer) | draw | {
"repo_name": "djun100/afreechart",
"path": "src/org/afree/chart/axis/CategoryAxis.java",
"license": "lgpl-3.0",
"size": 50274
} | [
"android.graphics.Canvas",
"org.afree.chart.plot.PlotRenderingInfo",
"org.afree.graphics.geom.RectShape",
"org.afree.ui.RectangleEdge"
] | import android.graphics.Canvas; import org.afree.chart.plot.PlotRenderingInfo; import org.afree.graphics.geom.RectShape; import org.afree.ui.RectangleEdge; | import android.graphics.*; import org.afree.chart.plot.*; import org.afree.graphics.geom.*; import org.afree.ui.*; | [
"android.graphics",
"org.afree.chart",
"org.afree.graphics",
"org.afree.ui"
] | android.graphics; org.afree.chart; org.afree.graphics; org.afree.ui; | 180,349 |
public MimeBodyPart generate(
MimeMessage message,
OutputEncryptor encryptor)
throws SMIMEException
{
try
{
message.saveChanges(); // make sure we're up to date.
}
catch (MessagingException e)
{
throw new SMIMEExce... | MimeBodyPart function( MimeMessage message, OutputEncryptor encryptor) throws SMIMEException { try { message.saveChanges(); } catch (MessagingException e) { throw new SMIMEException(STR, e); } return make(makeContentBodyPart(message), encryptor); } private class ContentEncryptor implements SMIMEStreamingProcessor { pri... | /**
* generate an enveloped object that contains an SMIME Enveloped
* object using the given provider from the contents of the passed in
* message
*/ | generate an enveloped object that contains an SMIME Enveloped object using the given provider from the contents of the passed in message | generate | {
"repo_name": "iseki-masaya/spongycastle",
"path": "mail/src/main/java/org/spongycastle/mail/smime/SMIMEEnvelopedGenerator.java",
"license": "mit",
"size": 9393
} | [
"javax.mail.MessagingException",
"javax.mail.internet.MimeBodyPart",
"javax.mail.internet.MimeMessage",
"org.bouncycastle.operator.OutputEncryptor"
] | import javax.mail.MessagingException; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import org.bouncycastle.operator.OutputEncryptor; | import javax.mail.*; import javax.mail.internet.*; import org.bouncycastle.operator.*; | [
"javax.mail",
"org.bouncycastle.operator"
] | javax.mail; org.bouncycastle.operator; | 2,470,237 |
public static BufferedReader reader(String fileName, boolean gzip, boolean showExceptions) {
BufferedReader reader = null;
try {
if (fileName.equals("-")) {
return new BufferedReader(new InputStreamReader(System.in));
} else if (fileName.endsWith(".gz") || gzip) {
// This is a gzip compressed file... | static BufferedReader function(String fileName, boolean gzip, boolean showExceptions) { BufferedReader reader = null; try { if (fileName.equals("-")) { return new BufferedReader(new InputStreamReader(System.in)); } else if (fileName.endsWith(".gz") gzip) { File inputFile = new File(fileName); if (inputFile.exists()) re... | /**
* Try to open a file (BufferedReader) using either the file or a gzip file (appending '.gz' to fileName)
* @param fileName
* @param gzip : If true, file is assumed to be gzipped
* @return
*/ | Try to open a file (BufferedReader) using either the file or a gzip file (appending '.gz' to fileName) | reader | {
"repo_name": "leepc12/BigDataScript",
"path": "src/org/bds/util/Gpr.java",
"license": "apache-2.0",
"size": 24566
} | [
"java.io.BufferedReader",
"java.io.File",
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.io.InputStreamReader",
"java.util.zip.GZIPInputStream"
] | import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.zip.GZIPInputStream; | import java.io.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,876,871 |
public void lengthValue(float v) throws ParseException {
currentValue = v;
} | void function(float v) throws ParseException { currentValue = v; } | /**
* Implements {@link LengthListHandler#lengthValue(float)}.
*/ | Implements <code>LengthListHandler#lengthValue(float)</code> | lengthValue | {
"repo_name": "git-moss/Push2Display",
"path": "lib/batik-1.8/sources/org/apache/batik/anim/dom/AbstractSVGLengthList.java",
"license": "lgpl-3.0",
"size": 10092
} | [
"org.apache.batik.parser.ParseException"
] | import org.apache.batik.parser.ParseException; | import org.apache.batik.parser.*; | [
"org.apache.batik"
] | org.apache.batik; | 1,881,834 |
@ApiResponse(code = 200, message = "Valid stock item found"),
@ApiResponse(code = 404, message = "Stock item not found")})
public Response getQuote(@ApiParam(value = "Symbol", required = true)
@PathParam("symbol") String symbol) throws SymbolNotFoundException {
Syste... | @ApiResponse(code = 200, message = STR), @ApiResponse(code = 404, message = STR)}) Response function(@ApiParam(value = STR, required = true) @PathParam(STR) String symbol) throws SymbolNotFoundException { System.out.println(STR); Stock stock = stockQuotes.get(symbol); if (stock == null) { throw new SymbolNotFoundExcept... | /**
* Retrieve a stock for a given symbol.
* http://localhost:8080/stockquote/IBM
*
* @param symbol Stock symbol will be taken from the path parameter.
* @return Response
*/ | Retrieve a stock for a given symbol. HREF | getQuote | {
"repo_name": "callkalpa/product-mss",
"path": "samples/stockquote/fatjar/src/main/java/org/wso2/msf4j/example/StockQuoteService.java",
"license": "apache-2.0",
"size": 8116
} | [
"io.swagger.annotations.ApiParam",
"io.swagger.annotations.ApiResponse",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.NewCookie",
"javax.ws.rs.core.Response",
"org.wso2.msf4j.example.exception.SymbolNotFoundException"
] | import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import javax.ws.rs.PathParam; import javax.ws.rs.core.NewCookie; import javax.ws.rs.core.Response; import org.wso2.msf4j.example.exception.SymbolNotFoundException; | import io.swagger.annotations.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.wso2.msf4j.example.exception.*; | [
"io.swagger.annotations",
"javax.ws",
"org.wso2.msf4j"
] | io.swagger.annotations; javax.ws; org.wso2.msf4j; | 1,407,627 |
public void setGeneCollection(Collection<Gene> geneCollection){
this.geneCollection = geneCollection;
} | void function(Collection<Gene> geneCollection){ this.geneCollection = geneCollection; } | /**
* Sets the value of geneCollection attribute
**/ | Sets the value of geneCollection attribute | setGeneCollection | {
"repo_name": "NCIP/camod",
"path": "software/camod/src/gov/nih/nci/camod/biodbnet/GeneOntology.java",
"license": "bsd-3-clause",
"size": 2320
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,772,248 |
public static IClusterCapacity getRequiredCompacity(ILogicalPlan plan,
AlgebricksAbsolutePartitionConstraint computationLocations, int sortFrameLimit, int groupFrameLimit,
int joinFrameLimit, int frameSize)
throws AlgebricksException {
// Creates a cluster capacity visito... | static IClusterCapacity function(ILogicalPlan plan, AlgebricksAbsolutePartitionConstraint computationLocations, int sortFrameLimit, int groupFrameLimit, int joinFrameLimit, int frameSize) throws AlgebricksException { IClusterCapacity clusterCapacity = new ClusterCapacity(); RequiredCapacityVisitor visitor = new Require... | /**
* Calculates the required cluster capacity from a given query plan, the computation locations,
* the operator memory budgets, and frame size.
*
* @param plan,
* a given query plan.
* @param computationLocations,
* the partitions for computation.
* @param... | Calculates the required cluster capacity from a given query plan, the computation locations, the operator memory budgets, and frame size | getRequiredCompacity | {
"repo_name": "ty1er/incubator-asterixdb",
"path": "asterixdb/asterix-app/src/main/java/org/apache/asterix/utils/ResourceUtils.java",
"license": "apache-2.0",
"size": 3063
} | [
"org.apache.asterix.app.resource.RequiredCapacityVisitor",
"org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint",
"org.apache.hyracks.algebricks.common.exceptions.AlgebricksException",
"org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator",
"org.apache.hyracks.... | import org.apache.asterix.app.resource.RequiredCapacityVisitor; import org.apache.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint; import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException; import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator; import org.a... | import org.apache.asterix.app.resource.*; import org.apache.hyracks.algebricks.common.constraints.*; import org.apache.hyracks.algebricks.common.exceptions.*; import org.apache.hyracks.algebricks.core.algebra.base.*; import org.apache.hyracks.api.job.resource.*; | [
"org.apache.asterix",
"org.apache.hyracks"
] | org.apache.asterix; org.apache.hyracks; | 1,852,395 |
public KualiDecimal getApprovalFromThisAmount() {
return approvalFromThisAmount;
}
| KualiDecimal function() { return approvalFromThisAmount; } | /**
* Gets the approvalFromThisAmount attribute.
*
* @return Returns the approvalFromThisAmount
*/ | Gets the approvalFromThisAmount attribute | getApprovalFromThisAmount | {
"repo_name": "bhutchinson/rice",
"path": "rice-framework/krad-development-tools/src/test/groovy/org/kuali/rice/krad/devtools/maintainablexml/TestDelegateModelDetail.java",
"license": "apache-2.0",
"size": 8656
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 1,206,225 |
public IResourceAggregate getProdConsumption() {
return prodConsumption;
} | IResourceAggregate function() { return prodConsumption; } | /**
* Quota consumed by production jobs.
*
* @return Production job consumption.
*/ | Quota consumed by production jobs | getProdConsumption | {
"repo_name": "kidaa/aurora",
"path": "src/main/java/org/apache/aurora/scheduler/quota/QuotaInfo.java",
"license": "apache-2.0",
"size": 2528
} | [
"org.apache.aurora.scheduler.storage.entities.IResourceAggregate"
] | import org.apache.aurora.scheduler.storage.entities.IResourceAggregate; | import org.apache.aurora.scheduler.storage.entities.*; | [
"org.apache.aurora"
] | org.apache.aurora; | 590,174 |
private void validateACL(List<ACL> acl) throws KeeperException.InvalidACLException {
if (acl == null || acl.isEmpty() || acl.contains(null)) {
throw new KeeperException.InvalidACLException();
}
} | void function(List<ACL> acl) throws KeeperException.InvalidACLException { if (acl == null acl.isEmpty() acl.contains(null)) { throw new KeeperException.InvalidACLException(); } } | /**
* Validates the provided ACL list for null, empty or null value in it.
*
* @param acl
* ACL list
* @throws InvalidACLException
* if ACL list is not valid
*/ | Validates the provided ACL list for null, empty or null value in it | validateACL | {
"repo_name": "Obsidian-StudiosInc/zookeeper",
"path": "src/java/main/org/apache/zookeeper/ZooKeeper.java",
"license": "apache-2.0",
"size": 125854
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,830,673 |
@Override
public List<GluuGroup> findGroups(GluuGroup group, int sizeLimit) {
group.setBaseDn(getDnForGroup(null));
return ldapEntryManager.findEntries(group, sizeLimit);
} | List<GluuGroup> function(GluuGroup group, int sizeLimit) { group.setBaseDn(getDnForGroup(null)); return ldapEntryManager.findEntries(group, sizeLimit); } | /**
* Search groups by attributes present in object
*
* @param group
* @param sizeLimit
* @return
*/ | Search groups by attributes present in object | findGroups | {
"repo_name": "madumlao/oxTrust",
"path": "server/src/main/java/org/gluu/oxtrust/ldap/service/GroupService.java",
"license": "mit",
"size": 9552
} | [
"java.util.List",
"org.gluu.oxtrust.model.GluuGroup"
] | import java.util.List; import org.gluu.oxtrust.model.GluuGroup; | import java.util.*; import org.gluu.oxtrust.model.*; | [
"java.util",
"org.gluu.oxtrust"
] | java.util; org.gluu.oxtrust; | 527,168 |
public Enumeration<Test> tests() {
return fTests.elements();
} | Enumeration<Test> function() { return fTests.elements(); } | /**
* Returns the tests as an enumeration
*/ | Returns the tests as an enumeration | tests | {
"repo_name": "nathanchen/JUnitCodeReading",
"path": "src/main/java/junit/framework/TestSuite.java",
"license": "epl-1.0",
"size": 9381
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 2,306,125 |
private void createTreeControl(Composite parent) {
dirTree = new Tree(parent, SWT.SINGLE | SWT.BORDER);
dirTree.setToolTipText(TexlipsePlugin.getResourceString("projectWizardDirTreeTooltip"));
dirTree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
r... | void function(Composite parent) { dirTree = new Tree(parent, SWT.SINGLE SWT.BORDER); dirTree.setToolTipText(TexlipsePlugin.getResourceString(STR)); dirTree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL GridData.FILL_VERTICAL)); recreateSubTree(); } | /**
* Create a directory tree settings box.
* @param parent the parent container
*/ | Create a directory tree settings box | createTreeControl | {
"repo_name": "rondiplomatico/texlipse",
"path": "source/net/sourceforge/texlipse/wizards/TexlipseProjectFilesWizardPage.java",
"license": "epl-1.0",
"size": 16893
} | [
"net.sourceforge.texlipse.TexlipsePlugin",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Tree"
] | import net.sourceforge.texlipse.TexlipsePlugin; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Tree; | import net.sourceforge.texlipse.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; | [
"net.sourceforge.texlipse",
"org.eclipse.swt"
] | net.sourceforge.texlipse; org.eclipse.swt; | 2,432,195 |
@Column(name = "display_name")
public String getDisplayName() {
return displayName;
}
| @Column(name = STR) String function() { return displayName; } | /**
* Gets the display name.
*
* @return the display name
*/ | Gets the display name | getDisplayName | {
"repo_name": "aholake/hiringviet",
"path": "src/main/java/vn/com/hiringviet/model/Skill.java",
"license": "apache-2.0",
"size": 2036
} | [
"javax.persistence.Column"
] | import javax.persistence.Column; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 554,465 |
EList<ScxmlInitialType> getInitial(); | EList<ScxmlInitialType> getInitial(); | /**
* Returns the value of the '<em><b>Initial</b></em>' containment reference list.
* The list contents are of type {@link org.w3._2005._07.scxml.ScxmlInitialType}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Initial</em>' containment reference list isn't clear,
* there really should be mo... | Returns the value of the 'Initial' containment reference list. The list contents are of type <code>org.w3._2005._07.scxml.ScxmlInitialType</code>. If the meaning of the 'Initial' containment reference list isn't clear, there really should be more of a description here... | getInitial | {
"repo_name": "glefur/scxml-designer",
"path": "plugins/org.w3c.scxml/src-gen/org/w3/_2005/_07/scxml/ScxmlStateType.java",
"license": "epl-1.0",
"size": 13905
} | [
"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; | 2,034,804 |
protected void viewChange(Event event) throws InterruptedException {
logger.debug("View Change event: {}", event);
// do nothing
} | void function(Event event) throws InterruptedException { logger.debug(STR, event); } | /**
* Handle a {@link EventType#VIEW_CHANGE} event.
*
* @param event the database change data event to be processed; may not be null
* @throws InterruptedException if this thread is interrupted while blocking
*/ | Handle a <code>EventType#VIEW_CHANGE</code> event | viewChange | {
"repo_name": "DuncanSands/debezium",
"path": "debezium-connector-mysql/src/main/java/io/debezium/connector/mysql/BinlogReader.java",
"license": "apache-2.0",
"size": 35367
} | [
"com.github.shyiko.mysql.binlog.event.Event"
] | import com.github.shyiko.mysql.binlog.event.Event; | import com.github.shyiko.mysql.binlog.event.*; | [
"com.github.shyiko"
] | com.github.shyiko; | 2,598,732 |
public static Color getSecondary3()
{
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControl());
} | static Color function() { return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControl()); } | /**
* Get Secondary 3
* @return secondary 3
*/ | Get Secondary 3 | getSecondary3 | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-legacy/org/adempiere/plaf/AdempierePLAF.java",
"license": "gpl-2.0",
"size": 18734
} | [
"java.awt.Color",
"javax.swing.plaf.metal.MetalLookAndFeel",
"org.compiere.swing.ColorBlind"
] | import java.awt.Color; import javax.swing.plaf.metal.MetalLookAndFeel; import org.compiere.swing.ColorBlind; | import java.awt.*; import javax.swing.plaf.metal.*; import org.compiere.swing.*; | [
"java.awt",
"javax.swing",
"org.compiere.swing"
] | java.awt; javax.swing; org.compiere.swing; | 2,559,290 |
private void ensureAsyncFetchStorePrimaryRecency(RoutingAllocation allocation) {
DiscoveryNodes nodes = allocation.nodes();
if (hasNewNodes(nodes)) {
final Set<String> newEphemeralIds = StreamSupport.stream(nodes.getDataNodes().spliterator(), false)
.map(node -> node.valu... | void function(RoutingAllocation allocation) { DiscoveryNodes nodes = allocation.nodes(); if (hasNewNodes(nodes)) { final Set<String> newEphemeralIds = StreamSupport.stream(nodes.getDataNodes().spliterator(), false) .map(node -> node.value.getEphemeralId()).collect(Collectors.toSet()); logger.trace(() -> new Parameteriz... | /**
* Clear the fetched data for the primary to ensure we do not cancel recoveries based on excessively stale data.
*/ | Clear the fetched data for the primary to ensure we do not cancel recoveries based on excessively stale data | ensureAsyncFetchStorePrimaryRecency | {
"repo_name": "ern/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/gateway/GatewayAllocator.java",
"license": "apache-2.0",
"size": 14288
} | [
"java.util.Set",
"java.util.stream.Collectors",
"java.util.stream.StreamSupport",
"org.apache.logging.log4j.message.ParameterizedMessage",
"org.elasticsearch.cluster.node.DiscoveryNodes",
"org.elasticsearch.cluster.routing.allocation.RoutingAllocation",
"org.elasticsearch.common.util.set.Sets"
] | import java.util.Set; import java.util.stream.Collectors; import java.util.stream.StreamSupport; import org.apache.logging.log4j.message.ParameterizedMessage; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; import org.elasticsearch.common.util... | import java.util.*; import java.util.stream.*; import org.apache.logging.log4j.message.*; import org.elasticsearch.cluster.node.*; import org.elasticsearch.cluster.routing.allocation.*; import org.elasticsearch.common.util.set.*; | [
"java.util",
"org.apache.logging",
"org.elasticsearch.cluster",
"org.elasticsearch.common"
] | java.util; org.apache.logging; org.elasticsearch.cluster; org.elasticsearch.common; | 1,393,941 |
private void openPokemonGoApp() {
Intent i = getPackageManager().getLaunchIntentForPackage("com.nianticlabs.pokemongo");
if (i != null) {
startActivity(i);
}
} | void function() { Intent i = getPackageManager().getLaunchIntentForPackage(STR); if (i != null) { startActivity(i); } } | /**
* Runs a launch intent for Pokemon GO.
*/ | Runs a launch intent for Pokemon GO | openPokemonGoApp | {
"repo_name": "NightMadness/GoIV",
"path": "app/src/main/java/com/kamron/pogoiv/MainActivity.java",
"license": "gpl-3.0",
"size": 23709
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 628,708 |
private PieData generateDataPie(int cnt) {
ArrayList<PieEntry> entries = new ArrayList<PieEntry>();
for (int i = 0; i < 4; i++) {
entries.add(new PieEntry((float) ((Math.random() * 70) + 30), "Quarter " + (i+1)));
}
PieDataSet d = new PieDataSet(entries, "");
... | PieData function(int cnt) { ArrayList<PieEntry> entries = new ArrayList<PieEntry>(); for (int i = 0; i < 4; i++) { entries.add(new PieEntry((float) ((Math.random() * 70) + 30), STR + (i+1))); } PieDataSet d = new PieDataSet(entries, ""); d.setSliceSpace(2f); d.setColors(ColorTemplate.VORDIPLOM_COLORS); PieData cd = new... | /**
* generates a random ChartData object with just one DataSet
*
* @return
*/ | generates a random ChartData object with just one DataSet | generateDataPie | {
"repo_name": "xsingHu/xs-android-architecture",
"path": "study-view/xs-MPAndroidChartDemo/MPChartExample/src/com/xxmassdeveloper/mpchartexample/ListViewMultiChartActivity.java",
"license": "apache-2.0",
"size": 5848
} | [
"com.github.mikephil.charting.data.PieData",
"com.github.mikephil.charting.data.PieDataSet",
"com.github.mikephil.charting.data.PieEntry",
"com.github.mikephil.charting.utils.ColorTemplate",
"java.util.ArrayList"
] | import com.github.mikephil.charting.data.PieData; import com.github.mikephil.charting.data.PieDataSet; import com.github.mikephil.charting.data.PieEntry; import com.github.mikephil.charting.utils.ColorTemplate; import java.util.ArrayList; | import com.github.mikephil.charting.data.*; import com.github.mikephil.charting.utils.*; import java.util.*; | [
"com.github.mikephil",
"java.util"
] | com.github.mikephil; java.util; | 1,622,125 |
public BusinessEventLogFinderOutDto find(BusinessEventLogFinderInDto input) throws FrameworkException, ApplicationExceptions; | BusinessEventLogFinderOutDto function(BusinessEventLogFinderInDto input) throws FrameworkException, ApplicationExceptions; | /** Searches for BusinessEventLog objects.
* @param input The criteria based on which the search will be performed.
* @throws ApplicationExceptions This will be thrown if the criteria contains invalid data.
* @throws FrameworkException Indicates some system error
* @return The search results.
*... | Searches for BusinessEventLog objects | find | {
"repo_name": "snavaneethan1/jaffa-framework",
"path": "jaffa-components-messaging/source/java/org/jaffa/modules/messaging/components/businesseventlogfinder/IBusinessEventLogFinder.java",
"license": "gpl-3.0",
"size": 1596
} | [
"org.jaffa.exceptions.ApplicationExceptions",
"org.jaffa.exceptions.FrameworkException",
"org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderInDto",
"org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderOutDto"
] | import org.jaffa.exceptions.ApplicationExceptions; import org.jaffa.exceptions.FrameworkException; import org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderInDto; import org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderOutDto; | import org.jaffa.exceptions.*; import org.jaffa.modules.messaging.components.businesseventlogfinder.dto.*; | [
"org.jaffa.exceptions",
"org.jaffa.modules"
] | org.jaffa.exceptions; org.jaffa.modules; | 2,150,625 |
private static MeterJsonArrayMatcher hasMeter(Meter meter) {
return new MeterJsonArrayMatcher(meter);
} | static MeterJsonArrayMatcher function(Meter meter) { return new MeterJsonArrayMatcher(meter); } | /**
* Factory to allocate a meter array matcher.
*
* @param meter meter object we are looking for
* @return matcher
*/ | Factory to allocate a meter array matcher | hasMeter | {
"repo_name": "LorenzReinhart/ONOSnew",
"path": "web/api/src/test/java/org/onosproject/rest/resources/MetersResourceTest.java",
"license": "apache-2.0",
"size": 18341
} | [
"org.onosproject.net.meter.Meter"
] | import org.onosproject.net.meter.Meter; | import org.onosproject.net.meter.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 2,340,733 |
protected void checkInputs(Function<Double, Double> function, Double x1, Double x2) {
ArgChecker.notNull(function, "function");
ArgChecker.notNull(x1, "x1");
ArgChecker.notNull(x2, "x2");
ArgChecker.isTrue(x1 <= x2, "x1 must be less or equal to x2");
ArgChecker.isTrue(function.apply(x1) * functio... | void function(Function<Double, Double> function, Double x1, Double x2) { ArgChecker.notNull(function, STR); ArgChecker.notNull(x1, "x1"); ArgChecker.notNull(x2, "x2"); ArgChecker.isTrue(x1 <= x2, STR); ArgChecker.isTrue(function.apply(x1) * function.apply(x2) <= 0, STR); } | /**
* Tests that the inputs to the root-finder are not null, and that a root is bracketed by the bounding values.
*
* @param function The function, not null
* @param x1 The first bound, not null
* @param x2 The second bound, not null, must be greater than x1
* @throws IllegalArgumentException if x1 a... | Tests that the inputs to the root-finder are not null, and that a root is bracketed by the bounding values | checkInputs | {
"repo_name": "OpenGamma/Strata",
"path": "modules/math/src/main/java/com/opengamma/strata/math/impl/rootfinding/RealSingleRootFinder.java",
"license": "apache-2.0",
"size": 2406
} | [
"com.opengamma.strata.collect.ArgChecker",
"java.util.function.Function"
] | import com.opengamma.strata.collect.ArgChecker; import java.util.function.Function; | import com.opengamma.strata.collect.*; import java.util.function.*; | [
"com.opengamma.strata",
"java.util"
] | com.opengamma.strata; java.util; | 2,145,858 |
@POST(PATIENT_CHECKINS_PATH)
public Checkin createCheckin(@Path(PATIENT_ID) Long patientId, @Body Checkin checkin); | @POST(PATIENT_CHECKINS_PATH) Checkin function(@Path(PATIENT_ID) Long patientId, @Body Checkin checkin); | /**
* This method creates a new Patient's check-in information. Only Patients can call this method.
*
* @param patientId a Long with database patient Id
* @param checkin a Checkin object with Checkin data and the CheckinMedication list information associated to Checkin
* @return the same Check... | This method creates a new Patient's check-in information. Only Patients can call this method | createCheckin | {
"repo_name": "estebanluengo/symptommanagment",
"path": "Symptom/src/org/coursera/symptom/client/SymptomSvcApi.java",
"license": "apache-2.0",
"size": 10921
} | [
"org.coursera.symptom.orm.Checkin"
] | import org.coursera.symptom.orm.Checkin; | import org.coursera.symptom.orm.*; | [
"org.coursera.symptom"
] | org.coursera.symptom; | 2,423,787 |
public Observable<ServiceResponse<CheckNameAvailabilityOutputInner>> checkNameAvailabilityWithServiceResponseAsync(String name) {
if (this.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
}
if (name == null... | Observable<ServiceResponse<CheckNameAvailabilityOutputInner>> function(String name) { if (this.apiVersion() == null) { throw new IllegalArgumentException(STR); } if (name == null) { throw new IllegalArgumentException(STR); } | /**
* Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint.
*
* @param name The resource name to validate.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckNa... | Check the availability of a resource name. This is needed for resources where name is globally unique, such as a CDN endpoint | checkNameAvailabilityWithServiceResponseAsync | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-cdn/src/main/java/com/microsoft/azure/management/cdn/implementation/CdnManagementClientImpl.java",
"license": "mit",
"size": 39516
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,312,562 |
public static File getFile(URL resourceUrl) throws FileNotFoundException {
return getFile(resourceUrl, "URL");
} | static File function(URL resourceUrl) throws FileNotFoundException { return getFile(resourceUrl, "URL"); } | /**
* Resolve the given resource URL to a {@code java.io.File},
* i.e. to a file in the file system.
*
* @param resourceUrl the resource URL to resolve
*
* @return a corresponding File object
*
* @throws FileNotFoundException if the URL cannot be resolved to
* ... | Resolve the given resource URL to a java.io.File, i.e. to a file in the file system | getFile | {
"repo_name": "proliming/commons",
"path": "commons-utils/src/main/java/com/proliming/commons/utils/ResourceUtils.java",
"license": "apache-2.0",
"size": 15232
} | [
"java.io.File",
"java.io.FileNotFoundException"
] | import java.io.File; import java.io.FileNotFoundException; | import java.io.*; | [
"java.io"
] | java.io; | 1,673,365 |
if (getProjectOfExecutionEvent(event) != null) {
executeCommand("eu.scasefp7.eclipse.servicecomposition.commands.exportAllToOntology");
return null;
} else {
throw new ExecutionException("No project selected");
}
}
| if (getProjectOfExecutionEvent(event) != null) { executeCommand(STR); return null; } else { throw new ExecutionException(STR); } } | /**
* This function is called when the user selects the menu item. It populates the linked ontology.
*
* @param event the event containing the information about which file was selected.
* @return the result of the execution which must be {@code null}.
*/ | This function is called when the user selects the menu item. It populates the linked ontology | execute | {
"repo_name": "s-case/s-case-core",
"path": "eu.scasefp7.eclipse.core/src/eu/scasefp7/eclipse/core/handlers/CompileServiceCompositionsHandler.java",
"license": "apache-2.0",
"size": 954
} | [
"org.eclipse.core.commands.ExecutionException"
] | import org.eclipse.core.commands.ExecutionException; | import org.eclipse.core.commands.*; | [
"org.eclipse.core"
] | org.eclipse.core; | 1,885,649 |
public void command(String command) {
Util.nullpo(command);
if (thread != null && thread.isAlive()) {
try {
if (command.equalsIgnoreCase(stopcmd)) allowrestart = false;
if (process != null && process.isAlive()) {
this.command.write(comm... | void function(String command) { Util.nullpo(command); if (thread != null && thread.isAlive()) { try { if (command.equalsIgnoreCase(stopcmd)) allowrestart = false; if (process != null && process.isAlive()) { this.command.write(command); this.command.newLine(); this.command.flush(); } } catch (IOException e) { host.log.e... | /**
* Commands the Server
*
* @param command Command to Send
*/ | Commands the Server | command | {
"repo_name": "ME1312/SubServers-2",
"path": "SubServers.Host/src/net/ME1312/SubServers/Host/Executable/SubServerImpl.java",
"license": "apache-2.0",
"size": 10523
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,398,311 |
private void checkFlush(boolean force) {
if ((force && sb.length() > 0) || sb.length() > 2048) {
sendBuffer(ByteBuffer.wrap(sb.toString().getBytes()));
// clear our internal buffer
sb.setLength(0);
}
} | void function(boolean force) { if ((force && sb.length() > 0) sb.length() > 2048) { sendBuffer(ByteBuffer.wrap(sb.toString().getBytes())); sb.setLength(0); } } | /**
* Check if we are ready to send another chunk.
* @param force force sending, even if not a full chunk
*/ | Check if we are ready to send another chunk | checkFlush | {
"repo_name": "pedrohrf/ZookeeperQuasarFibers",
"path": "src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java",
"license": "apache-2.0",
"size": 17212
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,766,929 |
public void setElementTimeout(int timeout, TimeUnit timeUnit) {
this.currentElementTimeout = timeout;
driver.manage().timeouts().implicitlyWait(timeout, timeUnit);
} | void function(int timeout, TimeUnit timeUnit) { this.currentElementTimeout = timeout; driver.manage().timeouts().implicitlyWait(timeout, timeUnit); } | /**
* Method to set the element timeout
* @param timeout - timeout with which to set the element timeout
* @param timeUnit
* @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html
* @see https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebDriver.Timeouts.html#imp... | Method to set the element timeout | setElementTimeout | {
"repo_name": "Orasi/Xeeva",
"path": "src/main/java/com/orasi/utils/OrasiDriver.java",
"license": "bsd-3-clause",
"size": 52445
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,061,812 |
@Test
public void testExtractCauseUncheckedUncheckedException() {
RuntimeException rex = new RuntimeException("Test");
try {
ConcurrentUtils.extractCauseUnchecked(new ExecutionException(rex));
fail("Runtime exception not thrown!");
} catch (RuntimeException r) {
... | void function() { RuntimeException rex = new RuntimeException("Test"); try { ConcurrentUtils.extractCauseUnchecked(new ExecutionException(rex)); fail(STR); } catch (RuntimeException r) { assertEquals(STR, rex, r); } } | /**
* Tests extractCauseUnchecked() if the cause is an unchecked exception.
*/ | Tests extractCauseUnchecked() if the cause is an unchecked exception | testExtractCauseUncheckedUncheckedException | {
"repo_name": "Shoreray/CommonsLang",
"path": "src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java",
"license": "apache-2.0",
"size": 18910
} | [
"java.util.concurrent.ExecutionException",
"org.junit.Assert",
"org.junit.Test"
] | import java.util.concurrent.ExecutionException; import org.junit.Assert; import org.junit.Test; | import java.util.concurrent.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,152,457 |
private NodeState checkNodeState(OpenstackNode node) {
checkNotNull(node, "Node cannot be null");
if (checkIntegrationBridge(node) && checkTunnelInterface(node)) {
return NodeState.COMPLETE;
} else if (checkIntegrationBridge(node)) {
return NodeState.BRIDGE_CREATED;
... | NodeState function(OpenstackNode node) { checkNotNull(node, STR); if (checkIntegrationBridge(node) && checkTunnelInterface(node)) { return NodeState.COMPLETE; } else if (checkIntegrationBridge(node)) { return NodeState.BRIDGE_CREATED; } else if (getOvsdbConnectionState(node)) { return NodeState.OVSDB_CONNECTED; } else ... | /**
* Checks current state of a given openstack node and returns it.
*
* @param node openstack node
* @return node state
*/ | Checks current state of a given openstack node and returns it | checkNodeState | {
"repo_name": "maheshraju-Huawei/actn",
"path": "apps/openstacknode/src/main/java/org/onosproject/openstacknode/OpenstackNodeManager.java",
"license": "apache-2.0",
"size": 23464
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 76,042 |
public static SequencingHome createSequencingHome(DatabaseSessionImpl ownerSession) {
SequencingHome home = null;
if (!ownerSession.isBroker()) {
home = new SequencingManager(ownerSession);
}
return home;
}
| static SequencingHome function(DatabaseSessionImpl ownerSession) { SequencingHome home = null; if (!ownerSession.isBroker()) { home = new SequencingManager(ownerSession); } return home; } | /**
* INTERNAL:
* Takes a potential owner - a DatabaseSession, returns SequencingHome object.
* Only DatabaseSession and ServerSession should be passed (not SessionBroker).
*/ | Takes a potential owner - a DatabaseSession, returns SequencingHome object. Only DatabaseSession and ServerSession should be passed (not SessionBroker) | createSequencingHome | {
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sequencing/SequencingFactory.java",
"license": "epl-1.0",
"size": 3236
} | [
"org.eclipse.persistence.internal.sessions.DatabaseSessionImpl"
] | import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl; | import org.eclipse.persistence.internal.sessions.*; | [
"org.eclipse.persistence"
] | org.eclipse.persistence; | 94,358 |
@Override
protected AmazonDynamoDBClient createClient(final ProcessContext context, final AWSCredentials credentials, final ClientConfiguration config) {
getLogger().debug("Creating client with aws credentials");
final AmazonDynamoDBClient client = new AmazonDynamoDBClient(credentials, config);... | AmazonDynamoDBClient function(final ProcessContext context, final AWSCredentials credentials, final ClientConfiguration config) { getLogger().debug(STR); final AmazonDynamoDBClient client = new AmazonDynamoDBClient(credentials, config); return client; } | /**
* Create client using AWSCredentials
*
* @deprecated use {@link #createClient(ProcessContext, AWSCredentialsProvider, ClientConfiguration)} instead
*/ | Create client using AWSCredentials | createClient | {
"repo_name": "dlukyanov/nifi",
"path": "nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/src/main/java/org/apache/nifi/processors/aws/dynamodb/AbstractDynamoDBProcessor.java",
"license": "apache-2.0",
"size": 16446
} | [
"com.amazonaws.ClientConfiguration",
"com.amazonaws.auth.AWSCredentials",
"com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient",
"org.apache.nifi.processor.ProcessContext"
] | import com.amazonaws.ClientConfiguration; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; import org.apache.nifi.processor.ProcessContext; | import com.amazonaws.*; import com.amazonaws.auth.*; import com.amazonaws.services.dynamodbv2.*; import org.apache.nifi.processor.*; | [
"com.amazonaws",
"com.amazonaws.auth",
"com.amazonaws.services",
"org.apache.nifi"
] | com.amazonaws; com.amazonaws.auth; com.amazonaws.services; org.apache.nifi; | 1,735,654 |
public static MenuScroller setScrollerFor(JMenu menu, int scrollCount,
int interval, int topFixedCount, int bottomFixedCount) {
return new MenuScroller(menu, scrollCount, interval, topFixedCount,
bottomFixedCount);
}
| static MenuScroller function(JMenu menu, int scrollCount, int interval, int topFixedCount, int bottomFixedCount) { return new MenuScroller(menu, scrollCount, interval, topFixedCount, bottomFixedCount); } | /**
* Registers a menu to be scrolled, with the specified number of items to
* display in the scrolling region, the specified scrolling interval, and
* the specified numbers of items fixed at the top and bottom of the menu.
*
* @param menu
* the menu
* @param scroll... | Registers a menu to be scrolled, with the specified number of items to display in the scrolling region, the specified scrolling interval, and the specified numbers of items fixed at the top and bottom of the menu | setScrollerFor | {
"repo_name": "botelhojp/apache-jmeter-2.10",
"path": "src/jorphan/org/apache/jorphan/gui/MenuScroller.java",
"license": "apache-2.0",
"size": 24354
} | [
"javax.swing.JMenu"
] | import javax.swing.JMenu; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,671,896 |
public KeyInfoReference itemKeyInfoReference(int i) throws XMLSecurityException {
Element e =
XMLUtils.selectDs11Node(
this.constructionElement.getFirstChild(), Constants._TAG_KEYINFOREFERENCE, i);
if (e != null) {
return new KeyInfoReference(e, this.baseURI)... | KeyInfoReference function(int i) throws XMLSecurityException { Element e = XMLUtils.selectDs11Node( this.constructionElement.getFirstChild(), Constants._TAG_KEYINFOREFERENCE, i); if (e != null) { return new KeyInfoReference(e, this.baseURI); } return null; } | /**
* Method itemKeyInfoReference
*
* @param i
* @return the asked KeyInfoReference element, null if the index is too big
* @throws XMLSecurityException
*/ | Method itemKeyInfoReference | itemKeyInfoReference | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xml/internal/security/keys/KeyInfo.java",
"license": "apache-2.0",
"size": 40883
} | [
"com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException",
"com.sun.org.apache.xml.internal.security.keys.content.KeyInfoReference",
"com.sun.org.apache.xml.internal.security.utils.Constants",
"com.sun.org.apache.xml.internal.security.utils.XMLUtils",
"org.w3c.dom.Element"
] | import com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException; import com.sun.org.apache.xml.internal.security.keys.content.KeyInfoReference; import com.sun.org.apache.xml.internal.security.utils.Constants; import com.sun.org.apache.xml.internal.security.utils.XMLUtils; import org.w3c.dom.Element; | import com.sun.org.apache.xml.internal.security.exceptions.*; import com.sun.org.apache.xml.internal.security.keys.content.*; import com.sun.org.apache.xml.internal.security.utils.*; import org.w3c.dom.*; | [
"com.sun.org",
"org.w3c.dom"
] | com.sun.org; org.w3c.dom; | 187,587 |
public static boolean renameTo(final Path self, URI newPathName) {
try {
Files.move(self, Paths.get(newPathName));
return true;
} catch (IOException e) {
return false;
}
} | static boolean function(final Path self, URI newPathName) { try { Files.move(self, Paths.get(newPathName)); return true; } catch (IOException e) { return false; } } | /**
* Renames a file.
*
* @param self a Path
* @param newPathName The new target path specified as a URI object
* @return <code>true</code> if and only if the renaming succeeded;
* <code>false</code> otherwise
* @since 2.3.0
*/ | Renames a file | renameTo | {
"repo_name": "avafanasiev/groovy",
"path": "subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java",
"license": "apache-2.0",
"size": 88390
} | [
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Path",
"java.nio.file.Paths",
"org.codehaus.groovy.runtime.DefaultGroovyMethods"
] | import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.codehaus.groovy.runtime.DefaultGroovyMethods; | import java.io.*; import java.nio.file.*; import org.codehaus.groovy.runtime.*; | [
"java.io",
"java.nio",
"org.codehaus.groovy"
] | java.io; java.nio; org.codehaus.groovy; | 1,293,375 |
@Test
public void testCreateParser() throws Exception {
RequestParser<?> result = Whitebox.invokeMethod(target, "createParser");
assertThat(result, is(notNullValue()));
Object state = Whitebox.getInternalState(result, "headState");
assertThat(state, is(notNullValue()));
} | void function() throws Exception { RequestParser<?> result = Whitebox.invokeMethod(target, STR); assertThat(result, is(notNullValue())); Object state = Whitebox.getInternalState(result, STR); assertThat(state, is(notNullValue())); } | /**
* Test method for {@link org.o3project.odenos.component.federator.Federator#createParser()}.
* @throws Exception throws Exception in targets
*/ | Test method for <code>org.o3project.odenos.component.federator.Federator#createParser()</code> | testCreateParser | {
"repo_name": "haizawa/odenos",
"path": "src/test/java/org/o3project/odenos/component/federator/FederatorTest.java",
"license": "apache-2.0",
"size": 77248
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.o3project.odenos.remoteobject.RequestParser",
"org.powermock.reflect.Whitebox"
] | import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.o3project.odenos.remoteobject.RequestParser; import org.powermock.reflect.Whitebox; | import org.hamcrest.*; import org.junit.*; import org.o3project.odenos.remoteobject.*; import org.powermock.reflect.*; | [
"org.hamcrest",
"org.junit",
"org.o3project.odenos",
"org.powermock.reflect"
] | org.hamcrest; org.junit; org.o3project.odenos; org.powermock.reflect; | 2,784,448 |
public static final SingleNumericalValue parseSingleNumericValue (final String value) {
// decimal constant
final Matcher decimalMatcher = DECIMAL_CONSTANT_PATTERN.matcher(value);
if (decimalMatcher.matches()) return new SingleNumericalValue(parseDecimalConstantString(value));
//... | static final SingleNumericalValue function (final String value) { final Matcher decimalMatcher = DECIMAL_CONSTANT_PATTERN.matcher(value); if (decimalMatcher.matches()) return new SingleNumericalValue(parseDecimalConstantString(value)); final Matcher hexMatcher = HEX_CONSTANT_PATTERN.matcher(value); if (hexMatcher.match... | /**
* Parses a {@link SingleNumericalValue} from a {@link String}. The parameter must contain an integer value in
* decimal, hexadecimal, or Base64 format. If it does not, <code>null</code> will be returned.
*
* @param value the {@link String} to parse
* @return a {@link SingleNumericalVa... | Parses a <code>SingleNumericalValue</code> from a <code>String</code>. The parameter must contain an integer value in decimal, hexadecimal, or Base64 format. If it does not, <code>null</code> will be returned | parseSingleNumericValue | {
"repo_name": "andrewgaul/jSCSI",
"path": "bundles/target/src/main/java/org/jscsi/target/settings/SingleNumericalValue.java",
"license": "bsd-3-clause",
"size": 5637
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,530,760 |
requireNonNullElements(blocks);
return Stream.of(blocks)
.collect(joining(separator));
} | requireNonNullElements(blocks); return Stream.of(blocks) .collect(joining(separator)); } | /**
* Returns a string consisting of the specified blocks concatenated
* and separated by the specified separator.
*
* @param separator The separator.
* @param blocks All the blocks.
* @return The concatenated string.
*/ | Returns a string consisting of the specified blocks concatenated and separated by the specified separator | separate | {
"repo_name": "speedment/fika",
"path": "codegen/src/main/java/com/speedment/fika/codegen/internal/util/Formatting.java",
"license": "apache-2.0",
"size": 10656
} | [
"java.util.stream.Stream"
] | import java.util.stream.Stream; | import java.util.stream.*; | [
"java.util"
] | java.util; | 1,454,606 |
public ActionForward cancelNotification(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
SubAwardForm subAwardForm = (SubAwardForm) form;
subAwardForm.getNotificationHelper().setNotificationContext(null);
r... | ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { SubAwardForm subAwardForm = (SubAwardForm) form; subAwardForm.getNotificationHelper().setNotificationContext(null); return mapping.findForward(Constants.MAPPING_AWARD_ACTIONS_PAGE)... | /**
* Cancels a Notification.
*
* @param mapping the action mapping
* @param form the action form
* @param request the request
* @param response the response
* @return the action forward
* @throws Exception
*/ | Cancels a Notification | cancelNotification | {
"repo_name": "sanjupolus/KC6.oLatest",
"path": "coeus-impl/src/main/java/org/kuali/kra/subaward/web/struts/action/SubAwardNotificationEditorAction.java",
"license": "agpl-3.0",
"size": 6252
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.apache.struts.action.ActionForm",
"org.apache.struts.action.ActionForward",
"org.apache.struts.action.ActionMapping",
"org.kuali.kra.infrastructure.Constants",
"org.kuali.kra.subaward.SubAwardForm"
] | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kra.infrastructure.Constants; import org.kuali.kra.subaward.SubAwardForm... | import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.kra.infrastructure.*; import org.kuali.kra.subaward.*; | [
"javax.servlet",
"org.apache.struts",
"org.kuali.kra"
] | javax.servlet; org.apache.struts; org.kuali.kra; | 2,826,160 |
@Override
public ImmutableList<Object> elements() {
return ImmutableList.of(first, second);
} | ImmutableList<Object> function() { return ImmutableList.of(first, second); } | /**
* Gets the elements from this pair as a list.
* <p>
* The list returns each element in the pair in order.
*
* @return the elements as an immutable list
*/ | Gets the elements from this pair as a list. The list returns each element in the pair in order | elements | {
"repo_name": "OpenGamma/Strata",
"path": "modules/collect/src/main/java/com/opengamma/strata/collect/tuple/DoublesPair.java",
"license": "apache-2.0",
"size": 11774
} | [
"com.google.common.collect.ImmutableList"
] | import com.google.common.collect.ImmutableList; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,070,379 |
public Collection<LineSegment2D> edges() {
int nPoints = this.vertices.size();
ArrayList<LineSegment2D> edges = new ArrayList<LineSegment2D>(nPoints);
if (nPoints == 0)
return edges;
for (int i = 0; i < nPoints - 1; i++)
edges.add(new LineSegment2D... | Collection<LineSegment2D> function() { int nPoints = this.vertices.size(); ArrayList<LineSegment2D> edges = new ArrayList<LineSegment2D>(nPoints); if (nPoints == 0) return edges; for (int i = 0; i < nPoints - 1; i++) edges.add(new LineSegment2D(vertices.get(i), vertices.get(i + 1))); edges.add(new LineSegment2D(vertice... | /**
* Returns the set of edges, as a collection of LineSegment2D.
*/ | Returns the set of edges, as a collection of LineSegment2D | edges | {
"repo_name": "pokowaka/android-geom",
"path": "geom/src/main/java/math/geom2d/polygon/SimplePolygon2D.java",
"license": "lgpl-2.1",
"size": 18458
} | [
"java.util.ArrayList",
"java.util.Collection",
"math.geom2d.line.LineSegment2D"
] | import java.util.ArrayList; import java.util.Collection; import math.geom2d.line.LineSegment2D; | import java.util.*; import math.geom2d.line.*; | [
"java.util",
"math.geom2d.line"
] | java.util; math.geom2d.line; | 2,143,046 |
public static boolean verifyStoragePermissions(AppCompatActivity activity) {
// Check if we have write permission
int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (permission != PackageManager.PERMISSION_GRANTED) {
// ... | static boolean function(AppCompatActivity activity) { int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE); if (permission != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions( activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE ); return fal... | /**
* Checks if the app has permission to write to device storage
*
* If the app does not has permission then the user will be prompted to grant permissions
*
* @param activity
*
* @return Whether we have permission to write to external storage
* @see <a href="https://stackoverfl... | Checks if the app has permission to write to device storage If the app does not has permission then the user will be prompted to grant permissions | verifyStoragePermissions | {
"repo_name": "ayraz/TrainingApp",
"path": "app/src/main/java/cz/nudz/www/trainingapp/data/DataExporter.java",
"license": "mit",
"size": 6798
} | [
"android.content.pm.PackageManager",
"android.os.AsyncTask",
"android.support.v4.app.ActivityCompat",
"android.support.v7.app.AppCompatActivity"
] | import android.content.pm.PackageManager; import android.os.AsyncTask; import android.support.v4.app.ActivityCompat; import android.support.v7.app.AppCompatActivity; | import android.content.pm.*; import android.os.*; import android.support.v4.app.*; import android.support.v7.app.*; | [
"android.content",
"android.os",
"android.support"
] | android.content; android.os; android.support; | 2,794,917 |
@Override
public Object call() throws IOException, MojoExecutionException {
synchronized (log) {
String fileType = (this instanceof ProcessCSSFilesTask) ? "CSS" : "JavaScript";
log.info("Starting " + fileType + " task:");
if (!files.isEmpty() && (targetDir.exis... | Object function() throws IOException, MojoExecutionException { synchronized (log) { String fileType = (this instanceof ProcessCSSFilesTask) ? "CSS" : STR; log.info(STR + fileType + STR); if (!files.isEmpty() && (targetDir.exists() targetDir.mkdirs())) { if (skipMerge) { log.info(STR); String sourceBasePath = sourceDir.... | /**
* Method executed by the thread.
*
* @throws IOException when the merge or minify steps fail
* @throws org.apache.maven.plugin.MojoExecutionException
*/ | Method executed by the thread | call | {
"repo_name": "a1martin/minifier-maven-plugin",
"path": "src/main/java/com/mg/maven/minifier/plugin/ProcessFilesTask.java",
"license": "apache-2.0",
"size": 19914
} | [
"java.io.File",
"java.io.IOException",
"org.apache.maven.plugin.MojoExecutionException"
] | import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; | import java.io.*; import org.apache.maven.plugin.*; | [
"java.io",
"org.apache.maven"
] | java.io; org.apache.maven; | 1,922,370 |
public static double mouseY() {
synchronized (mouseLock) {
return mouseY;
}
}
@Override
public void mouseClicked(MouseEvent e) { } | static double function() { synchronized (mouseLock) { return mouseY; } } public void mouseClicked(MouseEvent e) { } | /**
* Returns the <em>y</em>-coordinate of the mouse.
*
* @return <em>y</em>-coordinate of the mouse
*/ | Returns the y-coordinate of the mouse | mouseY | {
"repo_name": "gjgj821/fortress",
"path": "src/main/java/stdlib/StdDraw.java",
"license": "mit",
"size": 70938
} | [
"java.awt.event.MouseEvent"
] | import java.awt.event.MouseEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 2,184,496 |
@Deprecated
public static boolean definesAndroidResources(AttributeMap attributes) {
for (String attribute : RESOURCES_ATTRIBUTES) {
if (attributes.isAttributeValueExplicitlySpecified(attribute)) {
return true;
}
}
return false;
}
/**
* Checks validity of a RuleContext to pro... | static boolean function(AttributeMap attributes) { for (String attribute : RESOURCES_ATTRIBUTES) { if (attributes.isAttributeValueExplicitlySpecified(attribute)) { return true; } } return false; } /** * Checks validity of a RuleContext to produce Android resources, assets, and manifests. * * @throws RuleErrorException ... | /**
* Determines if the attributes contain resource and asset attributes.
*
* @deprecated We are moving towards processing Android assets, resources, and manifests
* separately. Use a separate method that just checks the attributes you need.
*/ | Determines if the attributes contain resource and asset attributes | definesAndroidResources | {
"repo_name": "cushon/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/android/AndroidResources.java",
"license": "apache-2.0",
"size": 17576
} | [
"com.google.devtools.build.lib.analysis.RuleContext",
"com.google.devtools.build.lib.packages.AttributeMap",
"com.google.devtools.build.lib.packages.RuleClass"
] | import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.packages.AttributeMap; import com.google.devtools.build.lib.packages.RuleClass; | import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.packages.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,899,218 |
public static double getFreeMemoryAsDouble(){
long t = Runtime.getRuntime().totalMemory();
long m = Runtime.getRuntime().maxMemory();
long f = Runtime.getRuntime().freeMemory();
return (m-t+f)/(double)m;
}
private static HashMap<Class<? extends Object>, ArrayList<Object>> classLookupTable = new Has... | static double function(){ long t = Runtime.getRuntime().totalMemory(); long m = Runtime.getRuntime().maxMemory(); long f = Runtime.getRuntime().freeMemory(); return (m-t+f)/(double)m; } private static HashMap<Class<? extends Object>, ArrayList<Object>> classLookupTable = new HashMap<Class<? extends Object>, ArrayList<O... | /**
* Returns the total free memory as double between 1.0 and 0.0.
* 0.0 means that there is no free memory available.
* 1.0 means that the memory is completely free.
* Note that this function also takes the memory into account that the VM will allocate, if more memory is required.
* @return the free mem... | Returns the total free memory as double between 1.0 and 0.0. 0.0 means that there is no free memory available. 1.0 means that the memory is completely free. Note that this function also takes the memory into account that the VM will allocate, if more memory is required | getFreeMemoryAsDouble | {
"repo_name": "ichichich22/CONRAD",
"path": "src/edu/stanford/rsl/conrad/utils/CONRAD.java",
"license": "gpl-3.0",
"size": 12051
} | [
"java.util.ArrayList",
"java.util.HashMap"
] | import java.util.ArrayList; import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,607,334 |
@Path("cluster")
public StorageClusterVersionResource getClusterVersionResource()
throws IOException {
return new StorageClusterVersionResource();
} | @Path(STR) StorageClusterVersionResource function() throws IOException { return new StorageClusterVersionResource(); } | /**
* Dispatch to StorageClusterVersionResource
*/ | Dispatch to StorageClusterVersionResource | getClusterVersionResource | {
"repo_name": "Eshcar/hbase",
"path": "hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/VersionResource.java",
"license": "apache-2.0",
"size": 3072
} | [
"java.io.IOException",
"javax.ws.rs.Path"
] | import java.io.IOException; import javax.ws.rs.Path; | import java.io.*; import javax.ws.rs.*; | [
"java.io",
"javax.ws"
] | java.io; javax.ws; | 2,588,129 |
private void loadDatabase(File fileToLoad) {
try {
// Create the input stream
FileInputStream stream = new FileInputStream(fileToLoad);
// Create the necessary JAXB equipment to load the file
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
// And unmarshall it into the list
ICE... | void function(File fileToLoad) { try { FileInputStream stream = new FileInputStream(fileToLoad); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); ICEList<Material> rawList = (ICEList<Material>) jaxbUnmarshaller .unmarshal(stream); materialsMap = new Hashtable<String, Material>(); for (Material material... | /**
* This operation loads the database that is in the provided file.
*
* @param streamToLoad
* the file that contains a materials database in XML and which
* should be loaded.
*/ | This operation loads the database that is in the provided file | loadDatabase | {
"repo_name": "eclipse/ice",
"path": "org.eclipse.ice.materials/src/org/eclipse/ice/materials/XMLMaterialsDatabase.java",
"license": "epl-1.0",
"size": 10640
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.util.Hashtable",
"javax.xml.bind.JAXBException",
"javax.xml.bind.Unmarshaller",
"org.eclipse.ice.datastructures.ICEObject",
"org.eclipse.ice.datastructures.form.Material"
] | import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.Hashtable; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import org.eclipse.ice.datastructures.ICEObject; import org.eclipse.ice.datastructures.form.Material; | import java.io.*; import java.util.*; import javax.xml.bind.*; import org.eclipse.ice.datastructures.*; import org.eclipse.ice.datastructures.form.*; | [
"java.io",
"java.util",
"javax.xml",
"org.eclipse.ice"
] | java.io; java.util; javax.xml; org.eclipse.ice; | 1,046,601 |
// TODO: Add Unit Tests!
@Override
public boolean equals(final Object object) {
if(object == this) {
return true;
} else if(!(object instanceof Rectangle3D)) {
return false;
} else if(!Objects.equals(this.a, Rectangle3D.class.cast(object).a)) {
return false;
} else if(!Objects.equals(this.b, Rectan... | boolean function(final Object object) { if(object == this) { return true; } else if(!(object instanceof Rectangle3D)) { return false; } else if(!Objects.equals(this.a, Rectangle3D.class.cast(object).a)) { return false; } else if(!Objects.equals(this.b, Rectangle3D.class.cast(object).b)) { return false; } else if(!Objec... | /**
* Compares {@code object} to this {@code Rectangle3D} instance for equality.
* <p>
* Returns {@code true} if, and only if, {@code object} is an instance of {@code Rectangle3D}, and their respective values are equal, {@code false} otherwise.
*
* @param object the {@code Object} to compare to this {@code R... | Compares object to this Rectangle3D instance for equality. Returns true if, and only if, object is an instance of Rectangle3D, and their respective values are equal, false otherwise | equals | {
"repo_name": "macroing/Dayflower",
"path": "src/main/java/org/dayflower/geometry/shape/Rectangle3D.java",
"license": "lgpl-3.0",
"size": 19789
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 2,860,888 |
@Override
public void mergeAndOutputTransformationMetadata(Iterator<DistinctValue> values, String outputDir, int colID, FileSystem fs, TfUtils agents) throws IOException {
HashMap<String, Long> map = new HashMap<String,Long>();
DistinctValue d = new DistinctValue();
String word = null;
Long count = null,... | void function(Iterator<DistinctValue> values, String outputDir, int colID, FileSystem fs, TfUtils agents) throws IOException { HashMap<String, Long> map = new HashMap<String,Long>(); DistinctValue d = new DistinctValue(); String word = null; Long count = null, val = null; while(values.hasNext()) { d.reset(); d = values... | /**
* Method to merge map output transformation metadata.
*
* @param values
* @return
* @throws IOException
*/ | Method to merge map output transformation metadata | mergeAndOutputTransformationMetadata | {
"repo_name": "Myasuka/systemml",
"path": "system-ml/src/main/java/com/ibm/bi/dml/runtime/transform/RecodeAgent.java",
"license": "apache-2.0",
"size": 13804
} | [
"java.io.IOException",
"java.util.HashMap",
"java.util.Iterator",
"org.apache.hadoop.fs.FileSystem"
] | import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import org.apache.hadoop.fs.FileSystem; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 1,444,351 |
@Nullable
static <S, I, O> ReplacementResult<S, I, O> computeParentExtension(final MealyMachine<S, I, ?, O> hypothesis,
final Alphabet<I> inputs,
final ADTNode<S, I, O> n... | static <S, I, O> ReplacementResult<S, I, O> computeParentExtension(final MealyMachine<S, I, ?, O> hypothesis, final Alphabet<I> inputs, final ADTNode<S, I, O> node, final Set<S> targetStates, final ADSCalculator adsCalculator) { final ADTNode<S, I, O> parentReset = node.getParent(); assert ADTUtil.isResetNode(parentRes... | /**
* Try to compute a replacement for a ADT sub-tree that extends the parent ADS.
*
* @param hypothesis
* the hypothesis for determining the system behavior
* @param inputs
* the input symbols to consider
* @param node
* the root node of the sub-ADT
... | Try to compute a replacement for a ADT sub-tree that extends the parent ADS | computeParentExtension | {
"repo_name": "LearnLib/learnlib",
"path": "algorithms/active/adt/src/main/java/de/learnlib/algorithms/adt/config/model/replacer/SingleReplacer.java",
"license": "apache-2.0",
"size": 6488
} | [
"de.learnlib.algorithms.adt.adt.ADTNode",
"de.learnlib.algorithms.adt.config.model.ADSCalculator",
"de.learnlib.algorithms.adt.model.ReplacementResult",
"de.learnlib.algorithms.adt.util.ADTUtil",
"java.util.HashMap",
"java.util.Map",
"java.util.Optional",
"java.util.Set",
"net.automatalib.automata.t... | import de.learnlib.algorithms.adt.adt.ADTNode; import de.learnlib.algorithms.adt.config.model.ADSCalculator; import de.learnlib.algorithms.adt.model.ReplacementResult; import de.learnlib.algorithms.adt.util.ADTUtil; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.Set; import ... | import de.learnlib.algorithms.adt.adt.*; import de.learnlib.algorithms.adt.config.model.*; import de.learnlib.algorithms.adt.model.*; import de.learnlib.algorithms.adt.util.*; import java.util.*; import net.automatalib.automata.transducers.*; import net.automatalib.commons.smartcollections.*; import net.automatalib.wor... | [
"de.learnlib.algorithms",
"java.util",
"net.automatalib.automata",
"net.automatalib.commons",
"net.automatalib.words"
] | de.learnlib.algorithms; java.util; net.automatalib.automata; net.automatalib.commons; net.automatalib.words; | 2,648,326 |
public static boolean loadBooleanFromSharedPreferences(String name, Context context) {
if (context == null)
return false;
// Access the default SharedPreferences
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(context);
// loa... | static boolean function(String name, Context context) { if (context == null) return false; SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); return preferences.getBoolean(name, false); } | /**
* Boolean aus den SharedPreferences auslesen
*
* @param name Name der Einstellungen
* @param context Ohne Context geht es nicht
* @return gespeicherter boolean-Wert
*/ | Boolean aus den SharedPreferences auslesen | loadBooleanFromSharedPreferences | {
"repo_name": "LightSnowDev/VPlanPRS",
"path": "mobile/src/main/java/com/lightSnowDev/VPlanPRS2/helper/StorageHelper.java",
"license": "gpl-3.0",
"size": 8277
} | [
"android.content.Context",
"android.content.SharedPreferences",
"android.preference.PreferenceManager"
] | import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; | import android.content.*; import android.preference.*; | [
"android.content",
"android.preference"
] | android.content; android.preference; | 768,458 |
log.debug("Initiating embedded Kafka cluster startup");
log.debug("Starting a ZooKeeper instance");
zookeeper = new EmbeddedZookeeper();
log.debug("ZooKeeper instance is running at {}", zKConnectString());
zkUtils = ZkUtils.apply(
zKConnectString(),
30000,
... | log.debug(STR); log.debug(STR); zookeeper = new EmbeddedZookeeper(); log.debug(STR, zKConnectString()); zkUtils = ZkUtils.apply( zKConnectString(), 30000, 30000, JaasUtils.isZkSecurityEnabled()); brokerConfig.put(KafkaConfig$.MODULE$.ZkConnectProp(), zKConnectString()); brokerConfig.put(KafkaConfig$.MODULE$.PortProp(),... | /**
* Creates and starts a Kafka cluster.
*/ | Creates and starts a Kafka cluster | start | {
"repo_name": "themarkypantz/kafka",
"path": "streams/src/test/java/org/apache/kafka/streams/integration/utils/EmbeddedKafkaCluster.java",
"license": "apache-2.0",
"size": 12537
} | [
"org.apache.kafka.common.security.JaasUtils"
] | import org.apache.kafka.common.security.JaasUtils; | import org.apache.kafka.common.security.*; | [
"org.apache.kafka"
] | org.apache.kafka; | 346,684 |
public synchronized List getRequiredHandlers() {
List list = new ArrayList();
for (int i = 0; i < m_requiredHandlers.size(); i++) {
RequiredHandler req = (RequiredHandler) m_requiredHandlers.get(i);
list.add(req.getFullName());
}
return list;
}
| synchronized List function() { List list = new ArrayList(); for (int i = 0; i < m_requiredHandlers.size(); i++) { RequiredHandler req = (RequiredHandler) m_requiredHandlers.get(i); list.add(req.getFullName()); } return list; } | /**
* Gets the list of required handlers.
* This method is synchronized to avoid the concurrent modification
* of the required handlers.
* @return the list of required handlers.
* @see org.apache.felix.ipojo.Factory#getRequiredHandlers()
*/ | Gets the list of required handlers. This method is synchronized to avoid the concurrent modification of the required handlers | getRequiredHandlers | {
"repo_name": "boneman1231/org.apache.felix",
"path": "trunk/ipojo/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java",
"license": "apache-2.0",
"size": 39355
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,101,451 |
public List<String> getIdentityFields() {
return getMigrationConfiguration().getDestinationIdentityFields();
} | List<String> function() { return getMigrationConfiguration().getDestinationIdentityFields(); } | /**
* Override this to change how identity fields are retrieved
*/ | Override this to change how identity fields are retrieved | getIdentityFields | {
"repo_name": "jewzaam/lightblue-migrator",
"path": "migrator/src/main/java/com/redhat/lightblue/migrator/Migrator.java",
"license": "gpl-3.0",
"size": 14098
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 62,144 |
Collection<PartitionOwner> generateChangedPartitionOwners(
Collection<PartitionStats> allPartitionStatsList,
Collection<WorkerInfo> availableWorkers,
int maxWorkers,
long superstep); | Collection<PartitionOwner> generateChangedPartitionOwners( Collection<PartitionStats> allPartitionStatsList, Collection<WorkerInfo> availableWorkers, int maxWorkers, long superstep); | /**
* After the worker stats have been merged to a single list, the master can
* use this information to send commands to the workers for any
* {@link Partition} changes. This protocol is specific to the
* {@link GraphPartitioner} implementation.
*
* @param allPartitionStatsList All partit... | After the worker stats have been merged to a single list, the master can use this information to send commands to the workers for any <code>Partition</code> changes. This protocol is specific to the <code>GraphPartitioner</code> implementation | generateChangedPartitionOwners | {
"repo_name": "sscdotopen/giraph-compensations",
"path": "src/main/java/org/apache/giraph/graph/partition/MasterGraphPartitioner.java",
"license": "apache-2.0",
"size": 3238
} | [
"java.util.Collection",
"org.apache.giraph.graph.WorkerInfo"
] | import java.util.Collection; import org.apache.giraph.graph.WorkerInfo; | import java.util.*; import org.apache.giraph.graph.*; | [
"java.util",
"org.apache.giraph"
] | java.util; org.apache.giraph; | 616,464 |
@Deprecated
public StepMeta findPrevStep( String stepname, int nr, boolean info ) {
return findPrevStep( findStep( stepname ), nr, info );
} | StepMeta function( String stepname, int nr, boolean info ) { return findPrevStep( findStep( stepname ), nr, info ); } | /**
* Find the previous step on a certain location taking into account the steps being informational or not.
*
* @param stepname
* The name of the step
* @param nr
* The index into the step list
* @param info
* true if only the informational steps are desired, false ot... | Find the previous step on a certain location taking into account the steps being informational or not | findPrevStep | {
"repo_name": "TatsianaKasiankova/pentaho-kettle",
"path": "engine/src/main/java/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 220790
} | [
"org.pentaho.di.trans.step.StepMeta"
] | import org.pentaho.di.trans.step.StepMeta; | import org.pentaho.di.trans.step.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,295,911 |
public void removeExperimenter(ExperimenterData exp, long groupID)
{
if (exp == null)
throw new IllegalArgumentException("Experimenter cannot be null.");
TreeImageDisplay node = null;
if (groupID >= 0) {
ExperimenterVisitor v = new ExperimenterVisitor(this, groupID);
accept(v);
List<TreeImageDispl... | void function(ExperimenterData exp, long groupID) { if (exp == null) throw new IllegalArgumentException(STR); TreeImageDisplay node = null; if (groupID >= 0) { ExperimenterVisitor v = new ExperimenterVisitor(this, groupID); accept(v); List<TreeImageDisplay> nodes = v.getNodes(); if (nodes.size() == 1) node = nodes.get(... | /**
* Implemented as specified by the {@link Browser} interface.
* @see Browser#removeExperimenter(ExperimenterData, GroupData)
*/ | Implemented as specified by the <code>Browser</code> interface | removeExperimenter | {
"repo_name": "tp81/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserComponent.java",
"license": "gpl-2.0",
"size": 78666
} | [
"java.util.List",
"org.openmicroscopy.shoola.agents.treeviewer.cmd.ExperimenterVisitor",
"org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay"
] | import java.util.List; import org.openmicroscopy.shoola.agents.treeviewer.cmd.ExperimenterVisitor; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay; | import java.util.*; import org.openmicroscopy.shoola.agents.treeviewer.cmd.*; import org.openmicroscopy.shoola.agents.util.browser.*; | [
"java.util",
"org.openmicroscopy.shoola"
] | java.util; org.openmicroscopy.shoola; | 1,749,643 |
static ParquetMetadata mergeFooters(Path root, List<Footer> footers, KeyValueMetadataMergeStrategy keyValueMergeStrategy) {
String rootPath = root.toUri().getPath();
GlobalMetaData fileMetaData = null;
List<BlockMetaData> blocks = new ArrayList<BlockMetaData>();
for (Footer footer : ... | static ParquetMetadata mergeFooters(Path root, List<Footer> footers, KeyValueMetadataMergeStrategy keyValueMergeStrategy) { String rootPath = root.toUri().getPath(); GlobalMetaData fileMetaData = null; List<BlockMetaData> blocks = new ArrayList<BlockMetaData>(); for (Footer footer : footers) { String footerPath = foote... | /**
* Will merge the metadata of all the footers together
* @param root the directory containing all footers
* @param footers the list files footers to merge
* @param keyValueMergeStrategy strategy to merge values for a given key (if there are multiple values)
* @return the global meta data for... | Will merge the metadata of all the footers together | mergeFooters | {
"repo_name": "apache/drill",
"path": "exec/java-exec/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java",
"license": "apache-2.0",
"size": 72877
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.fs.Path",
"org.apache.parquet.hadoop.metadata.BlockMetaData",
"org.apache.parquet.hadoop.metadata.GlobalMetaData",
"org.apache.parquet.hadoop.metadata.KeyValueMetadataMergeStrategy",
"org.apache.parquet.hadoop.metadata.ParquetMetadata",
"org.... | import java.util.ArrayList; import java.util.List; import org.apache.hadoop.fs.Path; import org.apache.parquet.hadoop.metadata.BlockMetaData; import org.apache.parquet.hadoop.metadata.GlobalMetaData; import org.apache.parquet.hadoop.metadata.KeyValueMetadataMergeStrategy; import org.apache.parquet.hadoop.metadata.Parqu... | import java.util.*; import org.apache.hadoop.fs.*; import org.apache.parquet.hadoop.metadata.*; import org.apache.parquet.io.*; | [
"java.util",
"org.apache.hadoop",
"org.apache.parquet"
] | java.util; org.apache.hadoop; org.apache.parquet; | 2,107,399 |
private static String checkFile(String property, String dir, String subdir)
{
try
{
File f = new File(dir);
if (!f.exists())
return null;
if (subdir != null)
f = new File(f, subdir);
f = new File(f, "orb.properties");
if (!f.exists())
... | static String function(String property, String dir, String subdir) { try { File f = new File(dir); if (!f.exists()) return null; if (subdir != null) f = new File(f, subdir); f = new File(f, STR); if (!f.exists()) return null; Properties p = new Properties(); p.load(new BufferedInputStream(new FileInputStream(f))); retu... | /**
* Check if the property is defined in the existsting file orb.properties.
*
* @param property the property
* @param dir the system property, defining the folder where the
* file could be expected.
* @param subdir subfolder where to look for the file.
*
* @return the property value, null if n... | Check if the property is defined in the existsting file orb.properties | checkFile | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/org/omg/CORBA/ORB.java",
"license": "gpl-2.0",
"size": 41719
} | [
"java.io.BufferedInputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.util.Properties"
] | import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 495,473 |
FormattedItemValue safeFormat(@Nullable Object value) {
if (value == null) {
return FormattedItemValue.NULL_VALUES;
}
return format(value);
} | FormattedItemValue safeFormat(@Nullable Object value) { if (value == null) { return FormattedItemValue.NULL_VALUES; } return format(value); } | /**
* Safe version of {@link Type#format(Object)}, which checks for null input value and if so
* returns a {@link FormattedItemValue} with null value properties.
*
* @see #format(Object)
*/ | Safe version of <code>Type#format(Object)</code>, which checks for null input value and if so returns a <code>FormattedItemValue</code> with null value properties | safeFormat | {
"repo_name": "josauder/AOP_incubator_beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/display/DisplayData.java",
"license": "apache-2.0",
"size": 31876
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,312,234 |
@Nonnull
public static JetInstance newJetClient(@Nonnull ClientConfig config) {
Preconditions.checkNotNull(config, "config");
return getJetClientInstance(HazelcastClient.newHazelcastClient(config));
}
/**
* Creates a Jet client with cluster failover capability. Client will try to c... | static JetInstance function(@Nonnull ClientConfig config) { Preconditions.checkNotNull(config, STR); return getJetClientInstance(HazelcastClient.newHazelcastClient(config)); } /** * Creates a Jet client with cluster failover capability. Client will try to connect * to alternative clusters according to the supplied {@li... | /**
* Creates a Jet client with the given Hazelcast client configuration.
* <p>
* {@link JetClientConfig} may be used to create a configuration with the
* default group name for Jet.
*/ | Creates a Jet client with the given Hazelcast client configuration. <code>JetClientConfig</code> may be used to create a configuration with the default group name for Jet | newJetClient | {
"repo_name": "gurbuzali/hazelcast-jet",
"path": "hazelcast-jet-core/src/main/java/com/hazelcast/jet/Jet.java",
"license": "apache-2.0",
"size": 15942
} | [
"com.hazelcast.client.HazelcastClient",
"com.hazelcast.client.config.ClientConfig",
"com.hazelcast.client.config.ClientFailoverConfig",
"com.hazelcast.internal.util.Preconditions",
"javax.annotation.Nonnull"
] | import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; import com.hazelcast.client.config.ClientFailoverConfig; import com.hazelcast.internal.util.Preconditions; import javax.annotation.Nonnull; | import com.hazelcast.client.*; import com.hazelcast.client.config.*; import com.hazelcast.internal.util.*; import javax.annotation.*; | [
"com.hazelcast.client",
"com.hazelcast.internal",
"javax.annotation"
] | com.hazelcast.client; com.hazelcast.internal; javax.annotation; | 2,788,436 |
private void basicHandleRemoteLocalRegionDestroyOrClose(InternalDistributedMember sender,
int topSerial, Map subregionSerialNumbers, boolean subregion, boolean regionDestroyed) {
// use topSerial unless this region is in subregionSerialNumbers map
int serialForThisRegion = topSerial;
if (subregion... | void function(InternalDistributedMember sender, int topSerial, Map subregionSerialNumbers, boolean subregion, boolean regionDestroyed) { int serialForThisRegion = topSerial; if (subregion) { Integer serialNumber = (Integer) subregionSerialNumbers.get(getFullPath()); if (serialNumber == null) { return; } else { serialFo... | /**
* Does the core work for handleRemoteLocalRegionDestroyOrClose.
*
* @param sender the id of the member that did the remote operation
* @param topSerial the remote serialNumber for the top region (maybe root)
* @param subregionSerialNumbers remote map of subregions to serialNumbers
* @since GemFire... | Does the core work for handleRemoteLocalRegionDestroyOrClose | basicHandleRemoteLocalRegionDestroyOrClose | {
"repo_name": "charliemblack/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java",
"license": "apache-2.0",
"size": 428144
} | [
"java.util.Map",
"org.apache.geode.distributed.internal.membership.InternalDistributedMember"
] | import java.util.Map; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; | import java.util.*; import org.apache.geode.distributed.internal.membership.*; | [
"java.util",
"org.apache.geode"
] | java.util; org.apache.geode; | 1,883,741 |
private JSONObject lookupNode(final NodeRef nodeRef, final String postUserId, final JSONObject jo) throws JSONException
{
String name = "";
if (! jo.isNull(JSON_NAME))
{
name = jo.getString(JSON_NAME);
}
NodeRef parentNodeRef = null;
... | JSONObject function(final NodeRef nodeRef, final String postUserId, final JSONObject jo) throws JSONException { String name = STRSTRSTRSTRSTR/" + name; } jo.put(JSON_NAME, name); jo.put(JSON_NODEREF, nodeRef.toString()); jo.put(JSON_TYPEQNAME, typeQName); jo.put(JSON_PARENT_NODEREF, (parentNodeRef != null ? parentNodeR... | /**
* Generic node lookup - note: not currently used (see ActivityService.postActivity when activityData is not supplied)
*/ | Generic node lookup - note: not currently used (see ActivityService.postActivity when activityData is not supplied) | lookupNode | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/activities/post/lookup/PostLookup.java",
"license": "lgpl-3.0",
"size": 34325
} | [
"java.util.concurrent.atomic.AtomicBoolean",
"org.alfresco.repo.lock.JobLockService",
"org.alfresco.service.cmr.repository.NodeRef",
"org.json.JSONException",
"org.json.JSONObject"
] | import java.util.concurrent.atomic.AtomicBoolean; import org.alfresco.repo.lock.JobLockService; import org.alfresco.service.cmr.repository.NodeRef; import org.json.JSONException; import org.json.JSONObject; | import java.util.concurrent.atomic.*; import org.alfresco.repo.lock.*; import org.alfresco.service.cmr.repository.*; import org.json.*; | [
"java.util",
"org.alfresco.repo",
"org.alfresco.service",
"org.json"
] | java.util; org.alfresco.repo; org.alfresco.service; org.json; | 1,725,968 |
public void waitFor(Supplier<Boolean> check, int checkEveryMillis,
int logInterval) throws InterruptedException {
Preconditions.checkNotNull(check, "check should not be null");
Preconditions.checkArgument(checkEveryMillis >= 0,
"checkEveryMillis should be positive value");
Preconditions.chec... | void function(Supplier<Boolean> check, int checkEveryMillis, int logInterval) throws InterruptedException { Preconditions.checkNotNull(check, STR); Preconditions.checkArgument(checkEveryMillis >= 0, STR); Preconditions.checkArgument(logInterval >= 0, STR); int loggingCounter = logInterval; do { if (LOG.isDebugEnabled()... | /**
* Wait for <code>check</code> to return true for each
* <code>checkEveryMillis</code> ms. In the main loop, this method will log
* the message "waiting in main loop" for each <code>logInterval</code> times
* iteration to confirm the thread is alive.
* @param check user defined checker
* @param che... | Wait for <code>check</code> to return true for each <code>checkEveryMillis</code> ms. In the main loop, this method will log the message "waiting in main loop" for each <code>logInterval</code> times iteration to confirm the thread is alive | waitFor | {
"repo_name": "tecknowledgeable/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/AMRMClient.java",
"license": "apache-2.0",
"size": 17422
} | [
"com.google.common.base.Preconditions",
"com.google.common.base.Supplier"
] | import com.google.common.base.Preconditions; import com.google.common.base.Supplier; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,933,986 |
protected void mkdirs(Path path) throws IOException {
assertTrue("Failed to mkdir " + path, fileSystem.mkdirs(path));
} | void function(Path path) throws IOException { assertTrue(STR + path, fileSystem.mkdirs(path)); } | /**
* Assert that a file exists and whose {@link FileStatus} entry
* declares that this is a file and not a symlink or directory.
*
* @throws IOException IO problems during file operations
*/ | Assert that a file exists and whose <code>FileStatus</code> entry declares that this is a file and not a symlink or directory | mkdirs | {
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractFSContractTestBase.java",
"license": "apache-2.0",
"size": 11954
} | [
"java.io.IOException",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 153,142 |
public TestCaseDO addTestCase(ProjectDO project, TestCaseDO testCase) {
return addTestCase(project.getId(), testCase);
} | TestCaseDO function(ProjectDO project, TestCaseDO testCase) { return addTestCase(project.getId(), testCase); } | /**
* Add a test case to the project.
*
* @param project
* @param testCase
* @return
*/ | Add a test case to the project | addTestCase | {
"repo_name": "epri-dev/PT2",
"path": "src/main/java/org/epri/pt2/controller/TestCaseController.java",
"license": "bsd-3-clause",
"size": 7845
} | [
"org.epri.pt2.DO"
] | import org.epri.pt2.DO; | import org.epri.pt2.*; | [
"org.epri.pt2"
] | org.epri.pt2; | 1,662,011 |
void registerMBean(final String datanodeUuid) {
// We wrap to bypass standard mbean naming convetion.
// This wraping can be removed in java 6 as it is more flexible in
// package naming for mbeans and their impl.
try {
StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class);
mb... | void registerMBean(final String datanodeUuid) { try { StandardMBean bean = new StandardMBean(this,FSDatasetMBean.class); mbeanName = MBeans.register(STR, STR + datanodeUuid, bean); } catch (NotCompliantMBeanException e) { LOG.warn(STR, e); } LOG.info(STR); } | /**
* Register the FSDataset MBean using the name
* "hadoop:service=DataNode,name=FSDatasetState-<datanodeUuid>"
*/ | Register the FSDataset MBean using the name "hadoop:service=DataNode,name=FSDatasetState-" | registerMBean | {
"repo_name": "songweijia/fffs",
"path": "sources/hadoop-2.4.1-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/MemDatasetImpl.java",
"license": "apache-2.0",
"size": 40841
} | [
"javax.management.NotCompliantMBeanException",
"javax.management.StandardMBean",
"org.apache.hadoop.hdfs.server.datanode.metrics.FSDatasetMBean",
"org.apache.hadoop.metrics2.util.MBeans"
] | import javax.management.NotCompliantMBeanException; import javax.management.StandardMBean; import org.apache.hadoop.hdfs.server.datanode.metrics.FSDatasetMBean; import org.apache.hadoop.metrics2.util.MBeans; | import javax.management.*; import org.apache.hadoop.hdfs.server.datanode.metrics.*; import org.apache.hadoop.metrics2.util.*; | [
"javax.management",
"org.apache.hadoop"
] | javax.management; org.apache.hadoop; | 951,662 |
@Override
public Path schemeWalk(String userPath,
Map<String,Object> newAttributes,
String newPath, int offset)
{
throw new UnsupportedOperationException();
} | Path function(String userPath, Map<String,Object> newAttributes, String newPath, int offset) { throw new UnsupportedOperationException(); } | /**
* Path-specific lookup. Path implementations will override this.
*
* @param userPath the user's lookup() path.
* @param newAttributes the attributes for the new path.
* @param newPath the lookup() path
* @param offset offset into newPath to start lookup.
*
* @return the found path
*/ | Path-specific lookup. Path implementations will override this | schemeWalk | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/vfs/ConfigPath.java",
"license": "gpl-2.0",
"size": 3224
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,429,526 |
protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
if (borderItemEditPart instanceof ExclusiveMergeNameEditPart) {
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(-5, -5));
... | void function(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof ExclusiveMergeNameEditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-5, -5)); borderItemContainer.add(bo... | /**
* borderItemOffset set to -5,-5 instead of default -20,-20
* @generated NOT
*/ | borderItemOffset set to -5,-5 instead of default -20,-20 | addBorderItem | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/process/ui/com.odcgroup.process.editor.diagram/src/generated/java/com/odcgroup/process/diagram/edit/parts/ExclusiveMergeEditPart.java",
"license": "epl-1.0",
"size": 5376
} | [
"org.eclipse.draw2d.IFigure",
"org.eclipse.draw2d.PositionConstants",
"org.eclipse.draw2d.geometry.Dimension",
"org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart",
"org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator"
] | import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.PositionConstants; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator; | import org.eclipse.draw2d.*; import org.eclipse.draw2d.geometry.*; import org.eclipse.gmf.runtime.diagram.ui.editparts.*; import org.eclipse.gmf.runtime.diagram.ui.figures.*; | [
"org.eclipse.draw2d",
"org.eclipse.gmf"
] | org.eclipse.draw2d; org.eclipse.gmf; | 1,039,282 |
void setProperties(Map<Symbol, Object> properties); | void setProperties(Map<Symbol, Object> properties); | /**
* Sets the local link properties, to be conveyed to the peer via the Attach frame when
* attaching the link to the session.
*
* Must be called during link setup, i.e. before calling the {@link #open()} method.
*/ | Sets the local link properties, to be conveyed to the peer via the Attach frame when attaching the link to the session. Must be called during link setup, i.e. before calling the <code>#open()</code> method | setProperties | {
"repo_name": "prestona/qpid-proton",
"path": "proton-j/src/main/java/org/apache/qpid/proton/engine/Link.java",
"license": "apache-2.0",
"size": 6839
} | [
"java.util.Map",
"org.apache.qpid.proton.amqp.Symbol"
] | import java.util.Map; import org.apache.qpid.proton.amqp.Symbol; | import java.util.*; import org.apache.qpid.proton.amqp.*; | [
"java.util",
"org.apache.qpid"
] | java.util; org.apache.qpid; | 1,004,926 |
public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) {
final PatchSetCreatedEvent event = new PatchSetCreatedEvent();
final AccountState uploader = accountCache.get(patchSet.getUploader());
event.change = eventFactory.asChangeAttribute(change);
event.patch... | void function(final Change change, final PatchSet patchSet) { final PatchSetCreatedEvent event = new PatchSetCreatedEvent(); final AccountState uploader = accountCache.get(patchSet.getUploader()); event.change = eventFactory.asChangeAttribute(change); event.patchSet = eventFactory.asPatchSetAttribute(patchSet); event.u... | /**
* Fire the Patchset Created Hook.
*
* @param change The change itself.
* @param patchSet The Patchset that was created.
*/ | Fire the Patchset Created Hook | doPatchsetCreatedHook | {
"repo_name": "Andproject/tools_gerrit",
"path": "gerrit-server/src/main/java/com/google/gerrit/common/ChangeHookRunner.java",
"license": "apache-2.0",
"size": 17471
} | [
"com.google.gerrit.reviewdb.Change",
"com.google.gerrit.reviewdb.PatchSet",
"com.google.gerrit.server.account.AccountState",
"com.google.gerrit.server.events.PatchSetCreatedEvent",
"java.util.ArrayList",
"java.util.List"
] | import com.google.gerrit.reviewdb.Change; import com.google.gerrit.reviewdb.PatchSet; import com.google.gerrit.server.account.AccountState; import com.google.gerrit.server.events.PatchSetCreatedEvent; import java.util.ArrayList; import java.util.List; | import com.google.gerrit.reviewdb.*; import com.google.gerrit.server.account.*; import com.google.gerrit.server.events.*; import java.util.*; | [
"com.google.gerrit",
"java.util"
] | com.google.gerrit; java.util; | 1,092,580 |
public static OrderByExpression createByCheckIfExpressionSortOrderDesc(Expression expression, boolean isNullsLast, boolean isAscending) {
if(expression.getSortOrder() == SortOrder.DESC) {
isAscending = !isAscending;
}
return new OrderByExpression(expression, isNullsLast, isAscend... | static OrderByExpression function(Expression expression, boolean isNullsLast, boolean isAscending) { if(expression.getSortOrder() == SortOrder.DESC) { isAscending = !isAscending; } return new OrderByExpression(expression, isNullsLast, isAscending); } /** * If orderByReverse is true, reverse the isNullsLast and isAscend... | /**
* If {@link Expression#getSortOrder()} is {@link SortOrder#DESC},reverse the isAscending,but isNullsLast is untouched.
* A typical case is in {@link OrderByCompiler#compile} to get the compiled {@link OrderByExpression} to used for {@link OrderedResultIterator}.
* @param expression
* @param isNu... | If <code>Expression#getSortOrder()</code> is <code>SortOrder#DESC</code>,reverse the isAscending,but isNullsLast is untouched. A typical case is in <code>OrderByCompiler#compile</code> to get the compiled <code>OrderByExpression</code> to used for <code>OrderedResultIterator</code> | createByCheckIfExpressionSortOrderDesc | {
"repo_name": "growingio/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/expression/OrderByExpression.java",
"license": "apache-2.0",
"size": 7338
} | [
"org.apache.phoenix.execute.AggregatePlan",
"org.apache.phoenix.schema.SortOrder"
] | import org.apache.phoenix.execute.AggregatePlan; import org.apache.phoenix.schema.SortOrder; | import org.apache.phoenix.execute.*; import org.apache.phoenix.schema.*; | [
"org.apache.phoenix"
] | org.apache.phoenix; | 1,650,900 |
private void testDescendingOrder(int numRows, int numCols, boolean compact, boolean testArray ) {
SimpleMatrix U,W,V;
int minLength = Math.min(numRows,numCols);
double singularValues[] = new double[minLength];
if( compact ) {
U = SimpleMatrix.wrap(RandomMatrices_DDRM.or... | void function(int numRows, int numCols, boolean compact, boolean testArray ) { SimpleMatrix U,W,V; int minLength = Math.min(numRows,numCols); double singularValues[] = new double[minLength]; if( compact ) { U = SimpleMatrix.wrap(RandomMatrices_DDRM.orthogonal(numRows,minLength,rand)); W = SimpleMatrix.wrap(RandomMatric... | /**
* Creates a random SVD that is highly unlikely to be in the correct order. Adjust its order
* and see if it produces the same matrix.
*/ | Creates a random SVD that is highly unlikely to be in the correct order. Adjust its order and see if it produces the same matrix | testDescendingOrder | {
"repo_name": "lessthanoptimal/ejml",
"path": "main/ejml-ddense/test/org/ejml/dense/row/TestSingularOps_DDRM.java",
"license": "apache-2.0",
"size": 17882
} | [
"org.ejml.UtilEjml",
"org.ejml.simple.SimpleMatrix",
"org.junit.jupiter.api.Assertions"
] | import org.ejml.UtilEjml; import org.ejml.simple.SimpleMatrix; import org.junit.jupiter.api.Assertions; | import org.ejml.*; import org.ejml.simple.*; import org.junit.jupiter.api.*; | [
"org.ejml",
"org.ejml.simple",
"org.junit.jupiter"
] | org.ejml; org.ejml.simple; org.junit.jupiter; | 426,365 |
List<T> getAssignedWorkflowItems(Long userId, List<Long> owners);
| List<T> getAssignedWorkflowItems(Long userId, List<Long> owners); | /**
* Returns a list of workflow items that are assigned to the given position where the workflow
* has not ended.
* @param owners the owner
* @param userId the user id
* @return the assigned workflow items
*/ | Returns a list of workflow items that are assigned to the given position where the workflow has not ended | getAssignedWorkflowItems | {
"repo_name": "egovernments/egov-playground",
"path": "eGov/egov/egov-egi/src/main/java/org/egov/infra/workflow/inbox/InboxRenderService.java",
"license": "gpl-3.0",
"size": 2575
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,891,361 |
public Slider setValues(ArrayItemOptions<IntegerItemOptions> values)
{
this.options.put("values", values);
return this;
} | Slider function(ArrayItemOptions<IntegerItemOptions> values) { this.options.put(STR, values); return this; } | /**
* This option can be used to specify multiple handles. If range is set to true, the
* length of 'values' should be 2.
*
* @param values
* @return instance of the current component
*/ | This option can be used to specify multiple handles. If range is set to true, the length of 'values' should be 2 | setValues | {
"repo_name": "WiQuery/wiquery",
"path": "wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/Slider.java",
"license": "mit",
"size": 16007
} | [
"org.odlabs.wiquery.core.options.ArrayItemOptions",
"org.odlabs.wiquery.core.options.IntegerItemOptions"
] | import org.odlabs.wiquery.core.options.ArrayItemOptions; import org.odlabs.wiquery.core.options.IntegerItemOptions; | import org.odlabs.wiquery.core.options.*; | [
"org.odlabs.wiquery"
] | org.odlabs.wiquery; | 194,819 |
public void setShowNavigationArrows(boolean showNavigationArrows) {
this.showNavigationArrows = showNavigationArrows;
if (showNavigationArrows) {
leftArrowButton.setVisibility(View.VISIBLE);
rightArrowButton.setVisibility(View.VISIBLE);
} else {
leftArrowB... | void function(boolean showNavigationArrows) { this.showNavigationArrows = showNavigationArrows; if (showNavigationArrows) { leftArrowButton.setVisibility(View.VISIBLE); rightArrowButton.setVisibility(View.VISIBLE); } else { leftArrowButton.setVisibility(View.INVISIBLE); rightArrowButton.setVisibility(View.INVISIBLE); }... | /**
* Show or hide the navigation arrows
*
* @param showNavigationArrows
*/ | Show or hide the navigation arrows | setShowNavigationArrows | {
"repo_name": "benoitletondor/EasyBudget",
"path": "Android/EasyBudget/caldroid/src/main/java/com/roomorama/caldroid/CaldroidFragment.java",
"license": "apache-2.0",
"size": 52037
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 732,167 |
public String get_attribution_source_string() throws SQLException {
return hasAttributions() ? attributions.get_attribution_source_string()
: null;
} | String function() throws SQLException { return hasAttributions() ? attributions.get_attribution_source_string() : null; } | /**
* Retrieves attribution sources as delimited string
*
* @return Attribution sources for this gene as a semicolon (";") delimited
* string, or <code>null</code> if no attributions for this gene
* @throws SQLException when can't lazily load community for attribution
*/ | Retrieves attribution sources as delimited string | get_attribution_source_string | {
"repo_name": "tair/tairwebapp",
"path": "src/org/tair/search/GeneSummary.java",
"license": "gpl-3.0",
"size": 28679
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,949,377 |
public void execute(Map<String,Object> transientVars, Map<String,String> args, PersistentVars persistentVars) throws WorkflowException; | void function(Map<String,Object> transientVars, Map<String,String> args, PersistentVars persistentVars) throws WorkflowException; | /**
* Execute this function
* @param transientVars Variables that will not be persisted. These include inputs
* given in the Workflow#initializeand Workflow#doAction method calls.
* There are a number of special variable names:
* <ul>
* <li><code>pi</code>: (object type: {@link org.inform... | Execute this function | execute | {
"repo_name": "will-gilbert/OSWf-OSWorkflow-fork",
"path": "oswf/core/src/main/java/org/informagen/oswf/FunctionProvider.java",
"license": "mit",
"size": 2437
} | [
"java.util.Map",
"org.informagen.oswf.PersistentVars",
"org.informagen.oswf.exceptions.WorkflowException"
] | import java.util.Map; import org.informagen.oswf.PersistentVars; import org.informagen.oswf.exceptions.WorkflowException; | import java.util.*; import org.informagen.oswf.*; import org.informagen.oswf.exceptions.*; | [
"java.util",
"org.informagen.oswf"
] | java.util; org.informagen.oswf; | 1,132,127 |
@Test
public void testDanglingSymlinks() throws Exception {
MockGenruleSupport.setup(mockToolsConfig);
write("test/BUILD",
"genrule(name='test_ln', srcs=[], outs=['test.out']," +
" cmd='/bin/ln -sf wrong.out $(@D)/test.out')\n");
addOptions("--keep_going");
BuildFailedException ... | void function() throws Exception { MockGenruleSupport.setup(mockToolsConfig); write(STR, STR + STR); addOptions(STR); BuildFailedException e = assertThrows(BuildFailedException.class, () -> buildTarget(STRoutput 'test/test.out' is a dangling symbolic linkSTRExecuting genrule } | /**
* Regression test for bug 823903 about symlink to non-existent target
* breaking DependencyChecker.
*/ | Regression test for bug 823903 about symlink to non-existent target breaking DependencyChecker | testDanglingSymlinks | {
"repo_name": "meteorcloudy/bazel",
"path": "src/test/java/com/google/devtools/build/lib/buildtool/DanglingSymlinkTest.java",
"license": "apache-2.0",
"size": 4478
} | [
"com.google.devtools.build.lib.actions.BuildFailedException",
"com.google.devtools.build.lib.packages.util.MockGenruleSupport",
"org.junit.Assert"
] | import com.google.devtools.build.lib.actions.BuildFailedException; import com.google.devtools.build.lib.packages.util.MockGenruleSupport; import org.junit.Assert; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.packages.util.*; import org.junit.*; | [
"com.google.devtools",
"org.junit"
] | com.google.devtools; org.junit; | 1,253,626 |
public int upload_file(String my_file_id, String group_name, long file_size,
UploadCallback callback, String file_ext_name) throws IOException, MyException
{
KeyInfo keyInfo = new KeyInfo(this.fdhtNamespace, my_file_id, MY_CLIENT_FILE_ID_KEY_NAME);
if (!this.check_fdfs_file_id_not_exist(keyInfo))
{
... | int function(String my_file_id, String group_name, long file_size, UploadCallback callback, String file_ext_name) throws IOException, MyException { KeyInfo keyInfo = new KeyInfo(this.fdhtNamespace, my_file_id, MY_CLIENT_FILE_ID_KEY_NAME); if (!this.check_fdfs_file_id_not_exist(keyInfo)) { return this.status; } String f... | /**
* upload file to storage server (by callback object)
* @param my_file_id the file id specified by application
* @param group_name the group name to upload file to, can be empty
* @param file_size the file size
* @param callback the write data callback object
* @param file_ext_name file ext name, do not inclu... | upload file to storage server (by callback object) | upload_file | {
"repo_name": "funfly/files",
"path": "FastDFS/my-fastdfs-client_v1.01/my-fastdfs-client/java/src/org/csource/myfastdfs/MyFastDFSClient.java",
"license": "gpl-2.0",
"size": 25916
} | [
"java.io.IOException",
"org.csource.common.MyException",
"org.csource.fastdfs.UploadCallback",
"org.csource.fastdht.KeyInfo"
] | import java.io.IOException; import org.csource.common.MyException; import org.csource.fastdfs.UploadCallback; import org.csource.fastdht.KeyInfo; | import java.io.*; import org.csource.common.*; import org.csource.fastdfs.*; import org.csource.fastdht.*; | [
"java.io",
"org.csource.common",
"org.csource.fastdfs",
"org.csource.fastdht"
] | java.io; org.csource.common; org.csource.fastdfs; org.csource.fastdht; | 388,244 |
public void mergeRecord(OnmsAssetRecord newRecord) {
if (!this.equals(newRecord)) {
return;
}
//this works because all asset properties are strings
//if the model dependencies ever change to not include spring, this will break
BeanWrapper currentBean = PropertyA... | void function(OnmsAssetRecord newRecord) { if (!this.equals(newRecord)) { return; } BeanWrapper currentBean = PropertyAccessorFactory.forBeanPropertyAccess(this); BeanWrapper newBean = PropertyAccessorFactory.forBeanPropertyAccess(newRecord); PropertyDescriptor[] pds = newBean.getPropertyDescriptors(); for (PropertyDes... | /**
* Used to merge the contents of one asset record to another. If equals implementation
* returns false, the merge is aborted.
*
* @param newRecord a {@link org.opennms.netmgt.model.OnmsAssetRecord} object.
*/ | Used to merge the contents of one asset record to another. If equals implementation returns false, the merge is aborted | mergeRecord | {
"repo_name": "dzonekl/oss2nms",
"path": "plugins/com.netxforge.oss2.model/src/com/netxforge/oss2/model/OnmsAssetRecord.java",
"license": "gpl-3.0",
"size": 47523
} | [
"java.beans.PropertyDescriptor",
"org.springframework.beans.BeanWrapper",
"org.springframework.beans.PropertyAccessorFactory"
] | import java.beans.PropertyDescriptor; import org.springframework.beans.BeanWrapper; import org.springframework.beans.PropertyAccessorFactory; | import java.beans.*; import org.springframework.beans.*; | [
"java.beans",
"org.springframework.beans"
] | java.beans; org.springframework.beans; | 331,548 |
private void clipViewOnTheRight(Rect curViewBound, float curViewWidth,
int right) {
curViewBound.right = (int) (right - mClipPadding);
curViewBound.left = (int) (curViewBound.right - curViewWidth);
} | void function(Rect curViewBound, float curViewWidth, int right) { curViewBound.right = (int) (right - mClipPadding); curViewBound.left = (int) (curViewBound.right - curViewWidth); } | /**
* Set bounds for the right textView including clip padding.
*
* @param curViewBound
* current bounds.
* @param curViewWidth
* width of the view.
*/ | Set bounds for the right textView including clip padding | clipViewOnTheRight | {
"repo_name": "z1986s8x11/androidLib",
"path": "app/src/main/java/com/zsx/widget/viewpager/indicator/Lib_ViewPager_TitlePageIndicator.java",
"license": "epl-1.0",
"size": 25675
} | [
"android.graphics.Rect"
] | import android.graphics.Rect; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,459,662 |
public static RequestPostProcessor testSecurityContext() {
return new TestSecurityContextHolderPostProcessor();
} | static RequestPostProcessor function() { return new TestSecurityContextHolderPostProcessor(); } | /**
* Creates a {@link RequestPostProcessor} that can be used to ensure that the
* resulting request is ran with the user in the {@link TestSecurityContextHolder}.
*
* @return the {@link RequestPostProcessor} to sue
*/ | Creates a <code>RequestPostProcessor</code> that can be used to ensure that the resulting request is ran with the user in the <code>TestSecurityContextHolder</code> | testSecurityContext | {
"repo_name": "zhaoqin102/spring-security",
"path": "test/src/main/java/org/springframework/security/test/web/servlet/request/SecurityMockMvcRequestPostProcessors.java",
"license": "apache-2.0",
"size": 29306
} | [
"org.springframework.test.web.servlet.request.RequestPostProcessor"
] | import org.springframework.test.web.servlet.request.RequestPostProcessor; | import org.springframework.test.web.servlet.request.*; | [
"org.springframework.test"
] | org.springframework.test; | 200,630 |
public final void invokeLater(@NotNull Runnable task) {
if (canInvoke(task)) {
count.incrementAndGet();
offer(() -> invokeSafely(task));
}
} | final void function(@NotNull Runnable task) { if (canInvoke(task)) { count.incrementAndGet(); offer(() -> invokeSafely(task)); } } | /**
* Invokes the specified task asynchronously on the valid thread.
* Even if this method is called from the valid thread
* the specified task will still be deferred
* until all pending events have been processed.
*
* @param task a task to execute asynchronously on the valid thread
*/ | Invokes the specified task asynchronously on the valid thread. Even if this method is called from the valid thread the specified task will still be deferred until all pending events have been processed | invokeLater | {
"repo_name": "youdonghai/intellij-community",
"path": "platform/platform-impl/src/com/intellij/ui/tree/Invoker.java",
"license": "apache-2.0",
"size": 6168
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 424,432 |
protected void readReplyDss() throws DRDAProtocolException
{
ensureALayerDataInBuffer (6);
// read out the DSS length
dssLength = ((buffer[pos++] & 0xff) << 8) +
((buffer[pos++] & 0xff) << 0);
// check for the continuation bit and update length as needed.
... | void function() throws DRDAProtocolException { ensureALayerDataInBuffer (6); dssLength = ((buffer[pos++] & 0xff) << 8) + ((buffer[pos++] & 0xff) << 0); if ((dssLength & DssConstants.CONTINUATION_BIT) == DssConstants.CONTINUATION_BIT) { dssLength = DssConstants.MAX_DSS_LENGTH; dssIsContinued = true; } else { dssIsContin... | /**
* Read Reply DSS
* This is used in testing the protocol. We shouldn't see a reply
* DSS when we are servicing DRDA commands
*
* @exception DRDAProtocolException if a protocol error is detected
*/ | Read Reply DSS This is used in testing the protocol. We shouldn't see a reply DSS when we are servicing DRDA commands | readReplyDss | {
"repo_name": "trejkaz/derby",
"path": "java/drda/org/apache/derby/impl/drda/DDMReader.java",
"license": "apache-2.0",
"size": 66289
} | [
"org.apache.derby.shared.common.sanity.SanityManager"
] | import org.apache.derby.shared.common.sanity.SanityManager; | import org.apache.derby.shared.common.sanity.*; | [
"org.apache.derby"
] | org.apache.derby; | 2,739,180 |
public static FastDateFormat getDateTimeInstance(final int dateStyle, final int timeStyle, final Locale locale) {
return cache.getDateTimeInstance(dateStyle, timeStyle, null, locale);
} | static FastDateFormat function(final int dateStyle, final int timeStyle, final Locale locale) { return cache.getDateTimeInstance(dateStyle, timeStyle, null, locale); } | /**
* <p>Gets a date/time formatter instance using the specified style and
* locale in the default time zone.</p>
*
* @param dateStyle date style: FULL, LONG, MEDIUM, or SHORT
* @param timeStyle time style: FULL, LONG, MEDIUM, or SHORT
* @param locale optional locale, overrides system l... | Gets a date/time formatter instance using the specified style and locale in the default time zone | getDateTimeInstance | {
"repo_name": "apache/logging-log4j2",
"path": "log4j-core/src/main/java/org/apache/logging/log4j/core/util/datetime/FastDateFormat.java",
"license": "apache-2.0",
"size": 22412
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 1,720,874 |
public boolean checkType(Item item) {
Node realNode = null;
int type = item.getType();
if (type == Type.NODE) {
realNode = ((NodeValue) item).getNode();
type = realNode.getNodeType();
}
if (!Type.subTypeOf(type, primaryType)) {
return false... | boolean function(Item item) { Node realNode = null; int type = item.getType(); if (type == Type.NODE) { realNode = ((NodeValue) item).getNode(); type = realNode.getNodeType(); } if (!Type.subTypeOf(type, primaryType)) { return false; } if (nodeName != null) { final NodeValue nvItem = (NodeValue) item; QName realName = ... | /**
* Check a single item against this SequenceType.
*
* @param item the item to check
* @return true, if item is a subtype of primaryType
*/ | Check a single item against this SequenceType | checkType | {
"repo_name": "dizzzz/exist",
"path": "exist-core/src/main/java/org/exist/xquery/value/SequenceType.java",
"license": "lgpl-2.1",
"size": 8215
} | [
"org.exist.dom.QName",
"org.w3c.dom.Document",
"org.w3c.dom.Element",
"org.w3c.dom.Node"
] | import org.exist.dom.QName; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; | import org.exist.dom.*; import org.w3c.dom.*; | [
"org.exist.dom",
"org.w3c.dom"
] | org.exist.dom; org.w3c.dom; | 2,841,959 |
@Override
public DecodeQualification getDecodeQualification(Object input) {
final File file = SeadasProductReader.getInputFile(input);
if (file == null) {
return DecodeQualification.UNABLE;
}
if (!file.exists()) {
if (DEBUG) {
System.out.pr... | DecodeQualification function(Object input) { final File file = SeadasProductReader.getInputFile(input); if (file == null) { return DecodeQualification.UNABLE; } if (!file.exists()) { if (DEBUG) { System.out.println(STR + file); } return DecodeQualification.UNABLE; } if (!file.isFile()) { if (DEBUG) { System.out.println... | /**
* Checks whether the given object is an acceptable input for this product reader and if so, the method checks if it
* is capable of decoding the input's content.
*/ | Checks whether the given object is an acceptable input for this product reader and if so, the method checks if it is capable of decoding the input's content | getDecodeQualification | {
"repo_name": "bcdev/beam",
"path": "seadas-reader/src/main/java/gov/nasa/gsfc/seadas/dataio/L2ProductReaderPlugIn.java",
"license": "gpl-3.0",
"size": 9049
} | [
"java.io.File",
"java.io.IOException",
"org.esa.beam.dataio.netcdf.util.NetcdfFileOpener",
"org.esa.beam.framework.dataio.DecodeQualification"
] | import java.io.File; import java.io.IOException; import org.esa.beam.dataio.netcdf.util.NetcdfFileOpener; import org.esa.beam.framework.dataio.DecodeQualification; | import java.io.*; import org.esa.beam.dataio.netcdf.util.*; import org.esa.beam.framework.dataio.*; | [
"java.io",
"org.esa.beam"
] | java.io; org.esa.beam; | 735,670 |
public void setLineWidth(float lineWidth) throws IOException {
if (inTextMode) {
throw new IOException("Error: setLineWidth is not allowed within a text block.");
}
appendRawCommands(lineWidth);
appendRawCommands(SPACE);
appendRawCommands(LINE_WIDTH);
} | void function(float lineWidth) throws IOException { if (inTextMode) { throw new IOException(STR); } appendRawCommands(lineWidth); appendRawCommands(SPACE); appendRawCommands(LINE_WIDTH); } | /**
* Set linewidth to the given value.
*
* @param lineWidth The width which is used for drwaing.
* @throws IOException If there is an error while drawing on the screen.
*/ | Set linewidth to the given value | setLineWidth | {
"repo_name": "sencko/NALB",
"path": "nalb2013/src/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java",
"license": "gpl-2.0",
"size": 48071
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 957,915 |
public static void validateSyncExtrasBundle(Bundle extras) {
try {
for (String key : extras.keySet()) {
Object value = extras.get(key);
if (value == null) continue;
if (value instanceof Long) continue;
if (value instanceof Integer) ... | static void function(Bundle extras) { try { for (String key : extras.keySet()) { Object value = extras.get(key); if (value == null) continue; if (value instanceof Long) continue; if (value instanceof Integer) continue; if (value instanceof Boolean) continue; if (value instanceof Float) continue; if (value instanceof Do... | /**
* Check that only values of the following types are in the Bundle:
* <ul>
* <li>Integer</li>
* <li>Long</li>
* <li>Boolean</li>
* <li>Float</li>
* <li>Double</li>
* <li>String</li>
* <li>Account</li>
* <li>null</li>
* </ul>
* @param extras the Bundle to ch... | Check that only values of the following types are in the Bundle: Integer Long Boolean Float Double String Account null | validateSyncExtrasBundle | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/android/content/ContentResolver.java",
"license": "apache-2.0",
"size": 82308
} | [
"android.accounts.Account",
"android.net.Uri",
"android.os.Bundle"
] | import android.accounts.Account; import android.net.Uri; import android.os.Bundle; | import android.accounts.*; import android.net.*; import android.os.*; | [
"android.accounts",
"android.net",
"android.os"
] | android.accounts; android.net; android.os; | 428,844 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.