method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public void addSpriteTo(JLabel c, int archive, int file)
{
getSpriteAsync(archive, file, img ->
{
SwingUtilities.invokeLater(() ->
{
c.setIcon(new ImageIcon(img));
});
});
} | void function(JLabel c, int archive, int file) { getSpriteAsync(archive, file, img -> { SwingUtilities.invokeLater(() -> { c.setIcon(new ImageIcon(img)); }); }); } | /**
* Calls setIcon on c, ensuring it is repainted when this changes
*/ | Calls setIcon on c, ensuring it is repainted when this changes | addSpriteTo | {
"repo_name": "runelite/runelite",
"path": "runelite-client/src/main/java/net/runelite/client/game/SpriteManager.java",
"license": "bsd-2-clause",
"size": 5146
} | [
"javax.swing.ImageIcon",
"javax.swing.JLabel",
"javax.swing.SwingUtilities"
] | import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.SwingUtilities; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,613,298 |
public Result deleteMTXProcess(@PathParam("time") Integer time, Context context)
{
if (time == null)
return Results.redirect(context.getContextPath() + "/admin/mtxs");
if (time == -1)
{ // all entries will be deleted
MailTransaction.deleteTxInPeriod(null);
... | Result function(@PathParam("time") Integer time, Context context) { if (time == null) return Results.redirect(context.getContextPath() + STR); if (time == -1) { MailTransaction.deleteTxInPeriod(null); } else { DateTime dt = DateTime.now().minusDays(time); MailTransaction.deleteTxInPeriod(dt.getMillis()); } return Resul... | /**
* Delete a time-specified number of mail-transactions.
*
* @param time
* the time in days (all before will be deleted)
* @return mail-transactions overview page
*/ | Delete a time-specified number of mail-transactions | deleteMTXProcess | {
"repo_name": "Xceptance/XCMailr",
"path": "xcmailr-webapp/src/main/java/controllers/AdminHandler.java",
"license": "apache-2.0",
"size": 23975
} | [
"ninja.params.PathParam",
"org.joda.time.DateTime"
] | import ninja.params.PathParam; import org.joda.time.DateTime; | import ninja.params.*; import org.joda.time.*; | [
"ninja.params",
"org.joda.time"
] | ninja.params; org.joda.time; | 516,843 |
void setBuckets(ApplicationId appId, DeviceId deviceId, int groupId,
List<GroupBucket> buckets, boolean install); | void setBuckets(ApplicationId appId, DeviceId deviceId, int groupId, List<GroupBucket> buckets, boolean install); | /**
* Configures buckets to the existing group.
* With install flag true, this method will add buckets to existing buckets,
* while with install flag false, this method will remove buckets from
* existing buckets.
*
* @param appId application ID
* @param deviceId device I... | Configures buckets to the existing group. With install flag true, this method will add buckets to existing buckets, while with install flag false, this method will remove buckets from existing buckets | setBuckets | {
"repo_name": "opennetworkinglab/onos",
"path": "apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/api/OpenstackGroupRuleService.java",
"license": "apache-2.0",
"size": 2743
} | [
"java.util.List",
"org.onosproject.core.ApplicationId",
"org.onosproject.net.DeviceId",
"org.onosproject.net.group.GroupBucket"
] | import java.util.List; import org.onosproject.core.ApplicationId; import org.onosproject.net.DeviceId; import org.onosproject.net.group.GroupBucket; | import java.util.*; import org.onosproject.core.*; import org.onosproject.net.*; import org.onosproject.net.group.*; | [
"java.util",
"org.onosproject.core",
"org.onosproject.net"
] | java.util; org.onosproject.core; org.onosproject.net; | 2,832,962 |
@Test
public void testProductUsageReportWithInvalidMonth() throws Exception {
request.setParameter("lang", Locale.getDefault().toString());
CustomerRankReportForm form = new CustomerRankReportForm();
form.setReportMonth("month");
form.setReportYear("2013");
BindingResult result = validate(form)... | void function() throws Exception { request.setParameter("lang", Locale.getDefault().toString()); CustomerRankReportForm form = new CustomerRankReportForm(); form.setReportMonth("month"); form.setReportYear("2013"); BindingResult result = validate(form); String resultString = reportController.productUsage(map, request, ... | /**
* Author: vinayv Description: Test to generate and validate Product Usage Report with Invalid Month.
*/ | Author: vinayv Description: Test to generate and validate Product Usage Report with Invalid Month | testProductUsageReportWithInvalidMonth | {
"repo_name": "backbrainer/cpbm-customization",
"path": "citrix.cpbm.custom.portal/src/test/java/fragment/web/AbstractReportControllerTest.java",
"license": "bsd-2-clause",
"size": 35433
} | [
"com.vmops.model.Report",
"com.vmops.web.forms.CustomerRankReportForm",
"java.util.Locale",
"org.junit.Assert",
"org.springframework.validation.BindingResult"
] | import com.vmops.model.Report; import com.vmops.web.forms.CustomerRankReportForm; import java.util.Locale; import org.junit.Assert; import org.springframework.validation.BindingResult; | import com.vmops.model.*; import com.vmops.web.forms.*; import java.util.*; import org.junit.*; import org.springframework.validation.*; | [
"com.vmops.model",
"com.vmops.web",
"java.util",
"org.junit",
"org.springframework.validation"
] | com.vmops.model; com.vmops.web; java.util; org.junit; org.springframework.validation; | 882,065 |
private static boolean isVirtualModuleName(String moduleName) {
return "exports".equals(moduleName) || "require".equals(moduleName) ||
"module".equals(moduleName);
}
private class TransformAMDModulesCallback extends AbstractPostOrderCallback { | static boolean function(String moduleName) { return STR.equals(moduleName) STR.equals(moduleName) STR.equals(moduleName); } private class TransformAMDModulesCallback extends AbstractPostOrderCallback { | /**
* The modules "exports", "require" and "module" are virtual in terms of
* existing implicitly in CommonJS.
*/ | The modules "exports", "require" and "module" are virtual in terms of existing implicitly in CommonJS | isVirtualModuleName | {
"repo_name": "thurday/closure-compiler",
"path": "src/com/google/javascript/jscomp/TransformAMDToCJSModule.java",
"license": "apache-2.0",
"size": 10624
} | [
"com.google.javascript.jscomp.NodeTraversal"
] | import com.google.javascript.jscomp.NodeTraversal; | import com.google.javascript.jscomp.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,968,713 |
private synchronized void failMap(TaskInProgress tip) {
if (nonRunningMapCache == null) {
LOG.warn("Non-running cache for maps missing!! "
+ "Job details are missing.");
return;
}
// 1. Its added everywhere since other nodes (having this split local)
// might have remove... | synchronized void function(TaskInProgress tip) { if (nonRunningMapCache == null) { LOG.warn(STR + STR); return; } String[] splitLocations = tip.getSplitLocations(); if (splitLocations.length == 0) { nonLocalMaps.add(0, tip); return; } for(String host: splitLocations) { Node node = jobtracker.getNode(host); for (int j =... | /**
* Adds the failed TIP in the front of the list for non-running maps
* @param tip the tip that needs to be failed
*/ | Adds the failed TIP in the front of the list for non-running maps | failMap | {
"repo_name": "submergerock/avatar-hadoop",
"path": "src/mapred/org/apache/hadoop/mapred/JobInProgress.java",
"license": "apache-2.0",
"size": 98981
} | [
"java.util.LinkedList",
"java.util.List",
"org.apache.hadoop.net.Node"
] | import java.util.LinkedList; import java.util.List; import org.apache.hadoop.net.Node; | import java.util.*; import org.apache.hadoop.net.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,100,136 |
public static boolean isJobDirValid(Path jobDirPath, FileSystem fs)
throws IOException {
FileStatus[] contents = fs.listStatus(jobDirPath);
int matchCount = 0;
if (contents != null && contents.length >=3) {
for (FileStatus status : contents) {
if ("job.xml".equals(status.getPath().getName... | static boolean function(Path jobDirPath, FileSystem fs) throws IOException { FileStatus[] contents = fs.listStatus(jobDirPath); int matchCount = 0; if (contents != null && contents.length >=3) { for (FileStatus status : contents) { if (STR.equals(status.getPath().getName())) { ++matchCount; } if (STR.equals(status.getP... | /**
* Checks if the job directory is clean and has all the required components
* for (re) starting the job
*/ | Checks if the job directory is clean and has all the required components for (re) starting the job | isJobDirValid | {
"repo_name": "toddlipcon/hadoop",
"path": "src/mapred/org/apache/hadoop/mapred/JobClient.java",
"license": "apache-2.0",
"size": 64290
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.io.BytesWritable",
"org.apache.hadoop.io.Writable"
] | import java.io.IOException; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.BytesWritable; import org.apache.hadoop.io.Writable; | import java.io.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.io.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 464,349 |
@DoesServiceRequest
public void uploadMetadata() throws StorageException {
this.uploadMetadata(null , null , null );
} | void function() throws StorageException { this.uploadMetadata(null , null , null ); } | /**
* Uploads the container's metadata.
*
* @throws StorageException
* If a storage service error occurred.
*/ | Uploads the container's metadata | uploadMetadata | {
"repo_name": "risezhang/azure-storage-cli",
"path": "src/main/java/com/microsoft/azure/storage/blob/CloudBlobContainer.java",
"license": "mit",
"size": 103627
} | [
"com.microsoft.azure.storage.StorageException"
] | import com.microsoft.azure.storage.StorageException; | import com.microsoft.azure.storage.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,870,331 |
// Create request queues
copyQueue = new RequestQueue<DataOperation>();
safeQueue = new RequestQueue<DataOperation>();
if (DEBUG) {
LOGGER.debug("Initializing GAT");
}
pool = new ThreadPool(GAT_POOL_SIZE, POOL_NAME, new Dispatcher(copyQueue));
try {
... | copyQueue = new RequestQueue<DataOperation>(); safeQueue = new RequestQueue<DataOperation>(); if (DEBUG) { LOGGER.debug(STR); } pool = new ThreadPool(GAT_POOL_SIZE, POOL_NAME, new Dispatcher(copyQueue)); try { pool.startThreads(); } catch (Exception e) { ErrorManager.error(THREAD_POOL_ERR, e); } safePool = new ThreadPo... | /**
* Starts the GAT Adaptor.
*/ | Starts the GAT Adaptor | init | {
"repo_name": "mF2C/COMPSs",
"path": "compss/runtime/adaptors/gat/master/src/main/java/es/bsc/compss/gat/master/GATAdaptor.java",
"license": "apache-2.0",
"size": 7971
} | [
"es.bsc.compss.COMPSsConstants",
"es.bsc.compss.comm.Dispatcher",
"es.bsc.compss.types.data.operation.DataOperation",
"es.bsc.compss.util.ErrorManager",
"es.bsc.compss.util.RequestQueue",
"es.bsc.compss.util.ThreadPool",
"org.gridlab.gat.GATContext"
] | import es.bsc.compss.COMPSsConstants; import es.bsc.compss.comm.Dispatcher; import es.bsc.compss.types.data.operation.DataOperation; import es.bsc.compss.util.ErrorManager; import es.bsc.compss.util.RequestQueue; import es.bsc.compss.util.ThreadPool; import org.gridlab.gat.GATContext; | import es.bsc.compss.*; import es.bsc.compss.comm.*; import es.bsc.compss.types.data.operation.*; import es.bsc.compss.util.*; import org.gridlab.gat.*; | [
"es.bsc.compss",
"org.gridlab.gat"
] | es.bsc.compss; org.gridlab.gat; | 1,627,224 |
public GlobalData getGlobalData() {
return globalData;
} | GlobalData function() { return globalData; } | /**
* Retrieves GlobalData object which handles all global tags and points
*
* @return GlobalData object
*/ | Retrieves GlobalData object which handles all global tags and points | getGlobalData | {
"repo_name": "Co0sh/BetonQuest",
"path": "src/main/java/org/betonquest/betonquest/BetonQuest.java",
"license": "gpl-3.0",
"size": 61199
} | [
"org.betonquest.betonquest.database.GlobalData"
] | import org.betonquest.betonquest.database.GlobalData; | import org.betonquest.betonquest.database.*; | [
"org.betonquest.betonquest"
] | org.betonquest.betonquest; | 631,070 |
@Test
public void testSet() {
ParticleVector vector1 = new ParticleVector();
Assert.assertEquals(new ParticleVector(), vector1);
vector1.set(10, 10);
Assert.assertEquals(new ParticleVector(10, 10), vector1);
} | void function() { ParticleVector vector1 = new ParticleVector(); Assert.assertEquals(new ParticleVector(), vector1); vector1.set(10, 10); Assert.assertEquals(new ParticleVector(10, 10), vector1); } | /**
* Test reassigning the particle vector values.
*/ | Test reassigning the particle vector values | testSet | {
"repo_name": "UQdeco2800/farmsim",
"path": "farmsim/src/test/java/farmsim/particle/ParticleVectorTest.java",
"license": "mit",
"size": 2002
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,186,139 |
@Test void nonEquiAntiJoin() {
tester(false, new HrSchema())
.withRel(
// Retrieve employees with the top salary in their department. Equivalent SQL:
// SELECT e.name, e.salary FROM emps e
// WHERE NOT EXISTS (
// SELECT 1 FROM emps e2
//... | @Test void nonEquiAntiJoin() { tester(false, new HrSchema()) .withRel( builder -> builder .scan("s", "emps").as("e") .scan("s", "emps").as("e2") .antiJoin( builder.and( builder.equals( builder.field(2, "e", STR), builder.field(2, "e2", STR)), builder.call( SqlStdOperatorTable.GREATER_THAN, builder.field(2, "e2", STR), ... | /** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-2968">[CALCITE-2968]
* New AntiJoin relational expression</a>. */ | Test case for [CALCITE-2968] | nonEquiAntiJoin | {
"repo_name": "apache/calcite",
"path": "core/src/test/java/org/apache/calcite/test/enumerable/EnumerableJoinTest.java",
"license": "apache-2.0",
"size": 16036
} | [
"org.apache.calcite.sql.fun.SqlStdOperatorTable",
"org.apache.calcite.test.schemata.hr.HrSchema",
"org.junit.jupiter.api.Test"
] | import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.test.schemata.hr.HrSchema; import org.junit.jupiter.api.Test; | import org.apache.calcite.sql.fun.*; import org.apache.calcite.test.schemata.hr.*; import org.junit.jupiter.api.*; | [
"org.apache.calcite",
"org.junit.jupiter"
] | org.apache.calcite; org.junit.jupiter; | 1,515,282 |
public void commitJob(JobContext context) throws IOException {
// delete the _temporary folder
cleanupJob(context);
// check if the o/p dir should be marked
if (shouldMarkOutputDir(context.getConfiguration())) {
// create a _success file in the o/p folder
markOutputDirSuccessful(context);
... | void function(JobContext context) throws IOException { cleanupJob(context); if (shouldMarkOutputDir(context.getConfiguration())) { markOutputDirSuccessful(context); } } | /**
* Delete the temporary directory, including all of the work directories.
* This is called for all jobs whose final run state is SUCCEEDED
* @param context the job's context.
*/ | Delete the temporary directory, including all of the work directories. This is called for all jobs whose final run state is SUCCEEDED | commitJob | {
"repo_name": "karahiyo/hanoi-hadoop-2.0.0-cdh",
"path": "src/mapred/org/apache/hadoop/mapreduce/lib/output/FileOutputCommitter.java",
"license": "apache-2.0",
"size": 9820
} | [
"java.io.IOException",
"org.apache.hadoop.mapreduce.JobContext"
] | import java.io.IOException; import org.apache.hadoop.mapreduce.JobContext; | import java.io.*; import org.apache.hadoop.mapreduce.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 980,199 |
@Override
public String getText(Object object) {
String label = ((MaterialType)object).getId();
return label == null || label.length() == 0 ?
getString("_UI_MaterialType_type") :
getString("_UI_MaterialType_type") + " " + label;
} | String function(Object object) { String label = ((MaterialType)object).getId(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/citygml/texturedsurface/provider/MaterialTypeItemProvider.java",
"license": "apache-2.0",
"size": 10416
} | [
"net.opengis.citygml.texturedsurface.MaterialType"
] | import net.opengis.citygml.texturedsurface.MaterialType; | import net.opengis.citygml.texturedsurface.*; | [
"net.opengis.citygml"
] | net.opengis.citygml; | 362,677 |
public ServiceCall<Void> paramDatetimeRfc1123Async(String scenario, final ServiceCallback<Void> serviceCallback) {
if (scenario == null) {
throw new IllegalArgumentException("Parameter scenario is required and cannot be null.");
}
final DateTime value = null;
DateTimeRfc1... | ServiceCall<Void> function(String scenario, final ServiceCallback<Void> serviceCallback) { if (scenario == null) { throw new IllegalArgumentException(STR); } final DateTime value = null; DateTimeRfc1123 valueConverted = null; if (value != null) { valueConverted = new DateTimeRfc1123(value); } | /**
* Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT".
*
* @param scenario Send a post request with header values "scenario": "valid" or "min"
* @param serviceCallback the async Servic... | Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT" | paramDatetimeRfc1123Async | {
"repo_name": "yaqiyang/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/implementation/HeadersImpl.java",
"license": "mit",
"size": 106421
} | [
"com.microsoft.rest.DateTimeRfc1123",
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"org.joda.time.DateTime"
] | import com.microsoft.rest.DateTimeRfc1123; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import org.joda.time.DateTime; | import com.microsoft.rest.*; import org.joda.time.*; | [
"com.microsoft.rest",
"org.joda.time"
] | com.microsoft.rest; org.joda.time; | 1,340,066 |
protected boolean excPattern(String text) {
this.USEFILE = true;
boolean exc = false;
for (Pattern excludePattern : this.EXCPATTERNS) {
if (JMeterUtils.getMatcher().contains(text, excludePattern)) {
exc = true;
this.USEFILE = false;
... | boolean function(String text) { this.USEFILE = true; boolean exc = false; for (Pattern excludePattern : this.EXCPATTERNS) { if (JMeterUtils.getMatcher().contains(text, excludePattern)) { exc = true; this.USEFILE = false; break; } } return exc; } | /**
* The method assumes by default the text is not excluded. If the text
* matches the pattern, it will then return true.
*
* @param text text to be checked
* @return <code>true</code> if text is excluded
*/ | The method assumes by default the text is not excluded. If the text matches the pattern, it will then return true | excPattern | {
"repo_name": "johrstrom/cloud-meter",
"path": "cloud-meter-protocols/src/main/java/org/apache/jmeter/protocol/http/util/accesslog/LogFilter.java",
"license": "apache-2.0",
"size": 15290
} | [
"org.apache.jmeter.util.JMeterUtils",
"org.apache.oro.text.regex.Pattern"
] | import org.apache.jmeter.util.JMeterUtils; import org.apache.oro.text.regex.Pattern; | import org.apache.jmeter.util.*; import org.apache.oro.text.regex.*; | [
"org.apache.jmeter",
"org.apache.oro"
] | org.apache.jmeter; org.apache.oro; | 908,794 |
public static RelNode createFilter(RelNode child,
Iterable<? extends RexNode> conditions,
RelFactories.FilterFactory filterFactory) {
final RelOptCluster cluster = child.getCluster();
final RexNode condition =
RexUtil.composeConjunction(cluster.getRexBuilder(), conditions, true);
if (c... | static RelNode function(RelNode child, Iterable<? extends RexNode> conditions, RelFactories.FilterFactory filterFactory) { final RelOptCluster cluster = child.getCluster(); final RexNode condition = RexUtil.composeConjunction(cluster.getRexBuilder(), conditions, true); if (condition == null) { return child; } else { re... | /** Creates a filter using the default factory,
* or returns the original relational expression if the
* condition is trivial. */ | Creates a filter using the default factory, or returns the original relational expression if the | createFilter | {
"repo_name": "minji-kim/calcite",
"path": "core/src/main/java/org/apache/calcite/plan/RelOptUtil.java",
"license": "apache-2.0",
"size": 131877
} | [
"org.apache.calcite.rel.RelNode",
"org.apache.calcite.rel.core.RelFactories",
"org.apache.calcite.rex.RexNode",
"org.apache.calcite.rex.RexUtil"
] | import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexUtil; | import org.apache.calcite.rel.*; import org.apache.calcite.rel.core.*; import org.apache.calcite.rex.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,539,140 |
ArrayList<T> result=new ArrayList<>();
try {
Document query = null;
List<Document> data = databaseManager.find(databaseName, collectionName, query);
Gson gson = new Gson();
for (Document doc : data){
result.add(gson.fromJson(doc.toJson(), this.type... | ArrayList<T> result=new ArrayList<>(); try { Document query = null; List<Document> data = databaseManager.find(databaseName, collectionName, query); Gson gson = new Gson(); for (Document doc : data){ result.add(gson.fromJson(doc.toJson(), this.typeParameterClass)); } } catch (JsonSyntaxException ex) { LogUtil.log(ex.to... | /**
* Fetches all elements from query
*
* @param databaseName databaseName name of mongo database to fetch data from
* @param collectionName name of collection
* @return List all of entities from collection in database
*/ | Fetches all elements from query | getDataByTag | {
"repo_name": "matkovd/search-system",
"path": "src/main/java/org/search/system/tools/MongoNullQuery.java",
"license": "mit",
"size": 2659
} | [
"com.google.gson.Gson",
"com.google.gson.JsonSyntaxException",
"java.util.ArrayList",
"java.util.List",
"org.bson.Document",
"org.search.system.utils.LogUtil"
] | import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; import java.util.ArrayList; import java.util.List; import org.bson.Document; import org.search.system.utils.LogUtil; | import com.google.gson.*; import java.util.*; import org.bson.*; import org.search.system.utils.*; | [
"com.google.gson",
"java.util",
"org.bson",
"org.search.system"
] | com.google.gson; java.util; org.bson; org.search.system; | 247,505 |
private static final int lcm(int a, int b)
{
BigInteger A = BigInteger.valueOf(a * 1L);
BigInteger B = BigInteger.valueOf(b * 1L);
return A.multiply(B).divide(A.gcd(B)).abs().intValue();
} | static final int function(int a, int b) { BigInteger A = BigInteger.valueOf(a * 1L); BigInteger B = BigInteger.valueOf(b * 1L); return A.multiply(B).divide(A.gcd(B)).abs().intValue(); } | /**
* Returns the Least Common Multiple of two integers.
*
* @param a the first integer.
* @param b the second integer.
* @return the LCM of <code>abs(a)</code> and <code>abs(b)</code>.
*/ | Returns the Least Common Multiple of two integers | lcm | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/gnu/javax/crypto/assembly/Cascade.java",
"license": "bsd-3-clause",
"size": 12451
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 823,761 |
public void auth(String username, Iterable<AuthMethod> methods)
throws UserAuthException, TransportException {
checkConnected();
final Deque<UserAuthException> savedEx = new LinkedList<UserAuthException>();
for (AuthMethod method: methods) {
try {
if (... | void function(String username, Iterable<AuthMethod> methods) throws UserAuthException, TransportException { checkConnected(); final Deque<UserAuthException> savedEx = new LinkedList<UserAuthException>(); for (AuthMethod method: methods) { try { if (auth.authenticate(username, (Service) conn, method, trans.getTimeoutMs(... | /**
* Authenticate {@code username} using the supplied {@code methods}.
*
* @param username user to authenticate
* @param methods one or more authentication method
*
* @throws UserAuthException in case of authentication failure
* @throws TransportException if there was a transport-l... | Authenticate username using the supplied methods | auth | {
"repo_name": "Juraldinio/sshj",
"path": "src/main/java/net/schmizz/sshj/SSHClient.java",
"license": "apache-2.0",
"size": 29607
} | [
"java.util.Deque",
"java.util.LinkedList",
"net.schmizz.sshj.transport.TransportException",
"net.schmizz.sshj.userauth.UserAuthException",
"net.schmizz.sshj.userauth.method.AuthMethod"
] | import java.util.Deque; import java.util.LinkedList; import net.schmizz.sshj.transport.TransportException; import net.schmizz.sshj.userauth.UserAuthException; import net.schmizz.sshj.userauth.method.AuthMethod; | import java.util.*; import net.schmizz.sshj.transport.*; import net.schmizz.sshj.userauth.*; import net.schmizz.sshj.userauth.method.*; | [
"java.util",
"net.schmizz.sshj"
] | java.util; net.schmizz.sshj; | 2,716,174 |
public void arrayMethod(String [] arg) throws AxisFault {
throw new AxisFault("You shouldn't have called me!");
}
class TestFault extends Exception {
TestFault(String msg) throws Exception {
super(msg);
if (msg == null) throw new Exception("default value");
... | void function(String [] arg) throws AxisFault { throw new AxisFault(STR); } class TestFault extends Exception { TestFault(String msg) throws Exception { super(msg); if (msg == null) throw new Exception(STR); } } | /**
* Echo a string array (this is for testing that String->String[]
* conversions do NOT happen when using encoded arrays)
*/ | Echo a string array (this is for testing that String->String[] conversions do NOT happen when using encoded arrays) | arrayMethod | {
"repo_name": "hugosato/apache-axis",
"path": "test/RPCDispatch/Service.java",
"license": "apache-2.0",
"size": 4039
} | [
"org.apache.axis.AxisFault"
] | import org.apache.axis.AxisFault; | import org.apache.axis.*; | [
"org.apache.axis"
] | org.apache.axis; | 907,216 |
if (cannotResumeWhenAccountsExist || cannotResumeWhenNoAccountsExist) {
final Account account = FirefoxAccounts.getFirefoxAccount(this);
if (cannotResumeWhenAccountsExist && account != null) {
redirectToActivity(FxAccountStatusActivity.class);
return;
}
if (cannotResumeWhenNoAcco... | if (cannotResumeWhenAccountsExist cannotResumeWhenNoAccountsExist) { final Account account = FirefoxAccounts.getFirefoxAccount(this); if (cannotResumeWhenAccountsExist && account != null) { redirectToActivity(FxAccountStatusActivity.class); return; } if (cannotResumeWhenNoAccountsExist && account == null) { redirectToA... | /**
* Many Firefox Accounts activities shouldn't display if an account already
* exists or if account creation is locked out due to an age verification
* check failing (getting started, create account, sign in). This function
* redirects as appropriate.
*/ | Many Firefox Accounts activities shouldn't display if an account already exists or if account creation is locked out due to an age verification check failing (getting started, create account, sign in). This function redirects as appropriate | redirectIfAppropriate | {
"repo_name": "jrconlin/mc_backup",
"path": "base/fxa/activities/FxAccountAbstractActivity.java",
"license": "mpl-2.0",
"size": 5198
} | [
"android.accounts.Account",
"android.os.SystemClock",
"org.mozilla.gecko.background.fxa.FxAccountAgeLockoutHelper",
"org.mozilla.gecko.fxa.FirefoxAccounts"
] | import android.accounts.Account; import android.os.SystemClock; import org.mozilla.gecko.background.fxa.FxAccountAgeLockoutHelper; import org.mozilla.gecko.fxa.FirefoxAccounts; | import android.accounts.*; import android.os.*; import org.mozilla.gecko.background.fxa.*; import org.mozilla.gecko.fxa.*; | [
"android.accounts",
"android.os",
"org.mozilla.gecko"
] | android.accounts; android.os; org.mozilla.gecko; | 2,511,057 |
public void assertHasLineCount(AssertionInfo info, CharSequence actual, int expectedLineCount) {
assertNotNull(info, actual);
LineNumberReader reader = new LineNumberReader(new StringReader(actual.toString()));
try {
while (reader.readLine() != null);
} catch (IOException e) {
throw new In... | void function(AssertionInfo info, CharSequence actual, int expectedLineCount) { assertNotNull(info, actual); LineNumberReader reader = new LineNumberReader(new StringReader(actual.toString())); try { while (reader.readLine() != null); } catch (IOException e) { throw new InputStreamsException(format(STR, actual), e); } ... | /**
* Asserts that the line count of the given {@code CharSequence} is equal to the expected one.
*
* @param info contains information about the assertion.
* @param actual the given {@code CharSequence}.
* @param expectedLineCount the expected line count of {@code actual}.
* @throws AssertionError if ... | Asserts that the line count of the given CharSequence is equal to the expected one | assertHasLineCount | {
"repo_name": "michal-lipski/assertj-core",
"path": "src/main/java/org/assertj/core/internal/Strings.java",
"license": "apache-2.0",
"size": 29060
} | [
"java.io.IOException",
"java.io.LineNumberReader",
"java.io.StringReader",
"org.assertj.core.api.AssertionInfo",
"org.assertj.core.internal.CommonValidations"
] | import java.io.IOException; import java.io.LineNumberReader; import java.io.StringReader; import org.assertj.core.api.AssertionInfo; import org.assertj.core.internal.CommonValidations; | import java.io.*; import org.assertj.core.api.*; import org.assertj.core.internal.*; | [
"java.io",
"org.assertj.core"
] | java.io; org.assertj.core; | 1,302,812 |
public InputStream getBlockInputStream(Block b, long seekOffset)
throws IOException; | InputStream function(Block b, long seekOffset) throws IOException; | /**
* Returns an input stream at specified offset of the specified block
* @param b
* @param seekOffset
* @return an input stream to read the contents of the specified block,
* starting at the offset
* @throws IOException
*/ | Returns an input stream at specified offset of the specified block | getBlockInputStream | {
"repo_name": "simplegeo/hadoop",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetInterface.java",
"license": "apache-2.0",
"size": 9446
} | [
"java.io.IOException",
"java.io.InputStream",
"org.apache.hadoop.hdfs.protocol.Block"
] | import java.io.IOException; import java.io.InputStream; import org.apache.hadoop.hdfs.protocol.Block; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,085,897 |
long accountId = WidgetManager.loadAccountIdPref(mContext, mWidgetId);
long mailboxId = WidgetManager.loadMailboxIdPref(mContext, mWidgetId);
// Legacy support; if preferences haven't been saved for this widget, load something
if (accountId == Account.NO_ACCOUNT) {
accountId = Accoun... | long accountId = WidgetManager.loadAccountIdPref(mContext, mWidgetId); long mailboxId = WidgetManager.loadMailboxIdPref(mContext, mWidgetId); if (accountId == Account.NO_ACCOUNT) { accountId = Account.ACCOUNT_ID_COMBINED_VIEW; mailboxId = Mailbox.QUERY_ALL_INBOXES; } mAccountId = accountId; mLoader.load(mAccountId, mai... | /**
* Start loading the data. At this point nothing on the widget changes -- the current view
* will remain valid until the loader loads the latest data.
*/ | Start loading the data. At this point nothing on the widget changes -- the current view will remain valid until the loader loads the latest data | start | {
"repo_name": "craigacgomez/android_email_policy_patch",
"path": "packages/apps/Email/src/com/android/email/widget/EmailWidget.java",
"license": "apache-2.0",
"size": 22205
} | [
"com.android.emailcommon.provider.Account",
"com.android.emailcommon.provider.Mailbox"
] | import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.Mailbox; | import com.android.emailcommon.provider.*; | [
"com.android.emailcommon"
] | com.android.emailcommon; | 2,276,262 |
@XmlElement
@XmlJavaTypeAdapter(DoubleAdapter.class)
public Double getMax() {
return max;
} | @XmlJavaTypeAdapter(DoubleAdapter.class) Double function() { return max; } | /**
* Gets the maximum value.
*
* @return the maximum value
*/ | Gets the maximum value | getMax | {
"repo_name": "tdefilip/opennms",
"path": "opennms-rrd/opennms-rrd-model/src/main/java/org/opennms/netmgt/rrd/model/AbstractDS.java",
"license": "agpl-3.0",
"size": 5964
} | [
"javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter"
] | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | import javax.xml.bind.annotation.adapters.*; | [
"javax.xml"
] | javax.xml; | 508,431 |
public ServiceFuture<SignalRKeysInner> beginRegenerateKeyAsync(String resourceGroupName, String resourceName, final ServiceCallback<SignalRKeysInner> serviceCallback) {
return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback);
} | ServiceFuture<SignalRKeysInner> function(String resourceGroupName, String resourceName, final ServiceCallback<SignalRKeysInner> serviceCallback) { return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, resourceName), serviceCallback); } | /**
* Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param resourceName ... | Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time | beginRegenerateKeyAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/signalr/mgmt-v2018_10_01/src/main/java/com/microsoft/azure/management/signalr/v2018_10_01/implementation/SignalRsInner.java",
"license": "mit",
"size": 135948
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,304,944 |
private DiscoveryResult get(ThingUID thingUID) {
if (thingUID != null) {
for (DiscoveryResult discoveryResult : this.entries) {
if (discoveryResult.getThingUID().equals(thingUID)) {
return discoveryResult;
}
}
}
ret... | DiscoveryResult function(ThingUID thingUID) { if (thingUID != null) { for (DiscoveryResult discoveryResult : this.entries) { if (discoveryResult.getThingUID().equals(thingUID)) { return discoveryResult; } } } return null; } | /**
* Returns the {@link DiscoveryResult} in this {@link Inbox} associated with
* the specified {@code Thing} ID, or {@code null}, if no
* {@link DiscoveryResult} could be found.
*
* @param thingId
* the Thing ID to which the discovery result should be returned
*
* @... | Returns the <code>DiscoveryResult</code> in this <code>Inbox</code> associated with the specified Thing ID, or null, if no <code>DiscoveryResult</code> could be found | get | {
"repo_name": "dnobel/smarthome",
"path": "bundles/config/org.eclipse.smarthome.config.discovery/src/main/java/org/eclipse/smarthome/config/discovery/internal/PersistentInbox.java",
"license": "epl-1.0",
"size": 11747
} | [
"org.eclipse.smarthome.config.discovery.DiscoveryResult",
"org.eclipse.smarthome.core.thing.ThingUID"
] | import org.eclipse.smarthome.config.discovery.DiscoveryResult; import org.eclipse.smarthome.core.thing.ThingUID; | import org.eclipse.smarthome.config.discovery.*; import org.eclipse.smarthome.core.thing.*; | [
"org.eclipse.smarthome"
] | org.eclipse.smarthome; | 880,943 |
public JSONArray put(Collection<Object> value)
{
this.put(new JSONArray(value));
return this;
} | JSONArray function(Collection<Object> value) { this.put(new JSONArray(value)); return this; } | /**
* Put a value in the JSONArray, where the value will be a JSONArray which
* is produced from a Collection.
*
* @param value A Collection value.
* @return this.
*/ | Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection | put | {
"repo_name": "gmt2001/PhantomBot",
"path": "src/org/json/JSONArray.java",
"license": "gpl-3.0",
"size": 31648
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,809,371 |
protected NamespaceEntity createNamespaceEntity()
{
return createNamespaceEntity("NamespaceTest" + getRandomSuffix());
} | NamespaceEntity function() { return createNamespaceEntity(STR + getRandomSuffix()); } | /**
* Creates and persists a new namespace entity.
*
* @return the newly created namespace entity.
*/ | Creates and persists a new namespace entity | createNamespaceEntity | {
"repo_name": "seoj/herd",
"path": "herd-code/herd-dao/src/test/java/org/finra/herd/dao/AbstractDaoTest.java",
"license": "apache-2.0",
"size": 127305
} | [
"org.finra.herd.model.jpa.NamespaceEntity"
] | import org.finra.herd.model.jpa.NamespaceEntity; | import org.finra.herd.model.jpa.*; | [
"org.finra.herd"
] | org.finra.herd; | 1,538,459 |
@Test(expected=QueryNodeException.class)
public void testWrongArrayQuery5()
throws QueryNodeException {
this.parse(null, "a AND [ c , d ]");
} | @Test(expected=QueryNodeException.class) void function() throws QueryNodeException { this.parse(null, STR); } | /**
* An array query is only possible inside a Twig query
*/ | An array query is only possible inside a Twig query | testWrongArrayQuery5 | {
"repo_name": "rdelbru/SIREn",
"path": "siren-qparser/src/test/java/org/sindice/siren/qparser/keyword/KeywordQueryParserTest.java",
"license": "apache-2.0",
"size": 64273
} | [
"org.apache.lucene.queryparser.flexible.core.QueryNodeException",
"org.junit.Test"
] | import org.apache.lucene.queryparser.flexible.core.QueryNodeException; import org.junit.Test; | import org.apache.lucene.queryparser.flexible.core.*; import org.junit.*; | [
"org.apache.lucene",
"org.junit"
] | org.apache.lucene; org.junit; | 1,695,026 |
protected Node nextSibling(Node n, Node root) {
while (true) {
if (n == root) {
return null;
}
Node result = n.getNextSibling();
if (result == null) {
result = n.getParentNode();
if (result == null || result == r... | Node function(Node n, Node root) { while (true) { if (n == root) { return null; } Node result = n.getNextSibling(); if (result == null) { result = n.getParentNode(); if (result == null result == root) { return null; } if (acceptNode(result) == NodeFilter.FILTER_SKIP) { n = result; continue; } return null; } switch (acc... | /**
* Returns the next sibling of the given node.
*/ | Returns the next sibling of the given node | nextSibling | {
"repo_name": "Squeegee/batik",
"path": "sources/org/apache/batik/dom/traversal/DOMTreeWalker.java",
"license": "apache-2.0",
"size": 10667
} | [
"org.w3c.dom.Node",
"org.w3c.dom.traversal.NodeFilter"
] | import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeFilter; | import org.w3c.dom.*; import org.w3c.dom.traversal.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 122,878 |
public boolean joinOutboundEndpoint(HopConfig cfg) {
if (_log.shouldLog(Log.INFO))
_log.info("Joining as OBEP: " + cfg);
TunnelId recvId = cfg.getReceiveTunnel();
OutboundTunnelEndpoint endpoint = new OutboundTunnelEndpoint(_context, cfg, new HopProcessor(_context, cfg, _validato... | boolean function(HopConfig cfg) { if (_log.shouldLog(Log.INFO)) _log.info(STR + cfg); TunnelId recvId = cfg.getReceiveTunnel(); OutboundTunnelEndpoint endpoint = new OutboundTunnelEndpoint(_context, cfg, new HopProcessor(_context, cfg, _validator)); synchronized (_joinParticipantLock) { if (_participatingConfig.putIfAb... | /**
* We are the outbound endpoint in this tunnel, and did not create it
*
* @return success; false if Tunnel ID is a duplicate
*/ | We are the outbound endpoint in this tunnel, and did not create it | joinOutboundEndpoint | {
"repo_name": "NoYouShutup/CryptMeme",
"path": "CryptMeme/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java",
"license": "mit",
"size": 50781
} | [
"net.i2p.data.TunnelId",
"net.i2p.util.Log"
] | import net.i2p.data.TunnelId; import net.i2p.util.Log; | import net.i2p.data.*; import net.i2p.util.*; | [
"net.i2p.data",
"net.i2p.util"
] | net.i2p.data; net.i2p.util; | 649,100 |
List<E> getCoefficients(); | List<E> getCoefficients(); | /**
* Returns the list of coefficients representing
* this polynomial.
*
* @return the list of coefficients representing
* this polynomial.
* @since 1.0.0
*/ | Returns the list of coefficients representing this polynomial | getCoefficients | {
"repo_name": "Bysmyyr/cpabe",
"path": "jpbc/jpbc-api/src/main/java/it/unisa/dia/gas/jpbc/Polynomial.java",
"license": "gpl-2.0",
"size": 915
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 895,344 |
public static void doesNotContain(@Nullable String textToSearch, String substring, String message)
{
if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring)
&& textToSearch.contains(substring)) {
throw new IllegalArgumentException(message);
}
} | static void function(@Nullable String textToSearch, String substring, String message) { if (StringUtils.hasLength(textToSearch) && StringUtils.hasLength(substring) && textToSearch.contains(substring)) { throw new IllegalArgumentException(message); } } | /**
* Assert that the given text does not contain the given substring.
*
* <pre class="code">
* Assert.doesNotContain(name, "rod", "Name must not contain 'rod'");
* </pre>
*
* @param textToSearch the text to search
* @param substring the substring to find within the text
* @param message the... | Assert that the given text does not contain the given substring. Assert.doesNotContain(name, "rod", "Name must not contain 'rod'"); </code> | doesNotContain | {
"repo_name": "emacslisp/Java",
"path": "SpringFrameworkReading/src/org/springframework/util/Assert.java",
"license": "mit",
"size": 29412
} | [
"org.springframework.lang.Nullable"
] | import org.springframework.lang.Nullable; | import org.springframework.lang.*; | [
"org.springframework.lang"
] | org.springframework.lang; | 192,147 |
public String executeCommandSave(ActionContext context) {
Connection db = null;
int resultCount = 0;
boolean recordInserted = false;
try {
db = this.getConnection(context);
// Verify the user has access to the project
String projectId = context.getRequest().getParameter("pid");
... | String function(ActionContext context) { Connection db = null; int resultCount = 0; boolean recordInserted = false; try { db = this.getConnection(context); String projectId = context.getRequest().getParameter("pid"); Project thisProject = retrieveAuthorizedProject(Integer.parseInt(projectId), context); if (!hasProjectA... | /**
* Action to insert a new list item
*
* @param context Description of the Parameter
* @return Description of the Return Value
*/ | Action to insert a new list item | executeCommandSave | {
"repo_name": "Concursive/concourseconnect-community",
"path": "src/main/java/com/concursive/connect/web/modules/lists/actions/ProjectManagementLists.java",
"license": "agpl-3.0",
"size": 27103
} | [
"com.concursive.commons.web.mvc.actions.ActionContext",
"com.concursive.connect.web.modules.lists.dao.Task",
"com.concursive.connect.web.modules.lists.dao.TaskCategoryList",
"com.concursive.connect.web.modules.profile.dao.Project",
"java.sql.Connection"
] | import com.concursive.commons.web.mvc.actions.ActionContext; import com.concursive.connect.web.modules.lists.dao.Task; import com.concursive.connect.web.modules.lists.dao.TaskCategoryList; import com.concursive.connect.web.modules.profile.dao.Project; import java.sql.Connection; | import com.concursive.commons.web.mvc.actions.*; import com.concursive.connect.web.modules.lists.dao.*; import com.concursive.connect.web.modules.profile.dao.*; import java.sql.*; | [
"com.concursive.commons",
"com.concursive.connect",
"java.sql"
] | com.concursive.commons; com.concursive.connect; java.sql; | 1,913,475 |
public ClientNetworkConfig setOutboundPorts(final Collection<Integer> outboundPorts) {
this.outboundPorts = outboundPorts;
return this;
} | ClientNetworkConfig function(final Collection<Integer> outboundPorts) { this.outboundPorts = outboundPorts; return this; } | /**
* Set outbond ports
*
* @param outboundPorts outbound ports
* @return ClientNetworkConfig
*/ | Set outbond ports | setOutboundPorts | {
"repo_name": "Donnerbart/hazelcast",
"path": "hazelcast-client/src/main/java/com/hazelcast/client/config/ClientNetworkConfig.java",
"license": "apache-2.0",
"size": 15112
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 987,030 |
ILinkedDataFragmentRequest parseIntoFragmentRequest(
final HttpServletRequest httpRequest,
final ConfigReader config )
throws IllegalArgumentException; | ILinkedDataFragmentRequest parseIntoFragmentRequest( final HttpServletRequest httpRequest, final ConfigReader config ) throws IllegalArgumentException; | /**
* Parses the given HTTP request into a specific
* {@link ILinkedDataFragmentRequest}.
*
* @param httpRequest
* @param config
* @return
* @throws IllegalArgumentException
* If the given HTTP request cannot be interpreted (perhaps due to
* missing request ... | Parses the given HTTP request into a specific <code>ILinkedDataFragmentRequest</code> | parseIntoFragmentRequest | {
"repo_name": "LinkedDataFragments/Server.Java",
"path": "src/main/java/org/linkeddatafragments/fragments/IFragmentRequestParser.java",
"license": "mit",
"size": 879
} | [
"javax.servlet.http.HttpServletRequest",
"org.linkeddatafragments.config.ConfigReader"
] | import javax.servlet.http.HttpServletRequest; import org.linkeddatafragments.config.ConfigReader; | import javax.servlet.http.*; import org.linkeddatafragments.config.*; | [
"javax.servlet",
"org.linkeddatafragments.config"
] | javax.servlet; org.linkeddatafragments.config; | 875,220 |
@Override
public TextureData newTextureData(final GLProfile glp, final InputStream stream, final int internalFormat,
final int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException {
return null;
} | TextureData function(final GLProfile glp, final InputStream stream, final int internalFormat, final int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException { return null; } | /**
* Method newTextureData()
*
* @see com.jogamp.opengl.util.texture.spi.TextureProvider#newTextureData(com.jogamp.opengl.GLProfile,
* java.io.InputStream, int, int, boolean, java.lang.String)
*/ | Method newTextureData() | newTextureData | {
"repo_name": "gama-platform/gama.cloud",
"path": "ummisco.gama.opengl_web/modern_src/ummisco/gama/opengl/scene/PGMTextureProvider.java",
"license": "agpl-3.0",
"size": 3180
} | [
"com.jogamp.opengl.GLProfile",
"com.jogamp.opengl.util.texture.TextureData",
"java.io.IOException",
"java.io.InputStream"
] | import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.texture.TextureData; import java.io.IOException; import java.io.InputStream; | import com.jogamp.opengl.*; import com.jogamp.opengl.util.texture.*; import java.io.*; | [
"com.jogamp.opengl",
"java.io"
] | com.jogamp.opengl; java.io; | 1,953,239 |
public DataSource getDataSource()
{
return super.getDataSource();
} | DataSource function() { return super.getDataSource(); } | /**
* Exposing the data source property.
*
* @return The <CODE>DataSource</CODE> to use to connect to the database.
*/ | Exposing the data source property | getDataSource | {
"repo_name": "ControlSystemStudio/org.csstudio.sns",
"path": "plugins/org.csstudio.mps.sns/src/org/csstudio/mps/sns/apps/dbexport/DBExport.java",
"license": "epl-1.0",
"size": 8203
} | [
"javax.sql.DataSource"
] | import javax.sql.DataSource; | import javax.sql.*; | [
"javax.sql"
] | javax.sql; | 2,737,837 |
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), String.valueOf(getA_Asset_Group_Acct_ID()));
} | KeyNamePair function() { return new KeyNamePair(get_ID(), String.valueOf(getA_Asset_Group_Acct_ID())); } | /** Get Record ID/ColumnName
@return ID/ColumnName pair
*/ | Get Record ID/ColumnName | getKeyNamePair | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/X_A_Asset_Group_Acct.java",
"license": "gpl-2.0",
"size": 23569
} | [
"org.compiere.util.KeyNamePair"
] | import org.compiere.util.KeyNamePair; | import org.compiere.util.*; | [
"org.compiere.util"
] | org.compiere.util; | 1,171,182 |
public static byte[] byteArray2bytes(byte[][] pathComponents) {
if (pathComponents.length == 0) {
return EMPTY_BYTES;
} else if (pathComponents.length == 1
&& (pathComponents[0] == null || pathComponents[0].length == 0)) {
return new byte[]{(byte) Path.SEPARATOR_CHAR};
}
int length... | static byte[] function(byte[][] pathComponents) { if (pathComponents.length == 0) { return EMPTY_BYTES; } else if (pathComponents.length == 1 && (pathComponents[0] == null pathComponents[0].length == 0)) { return new byte[]{(byte) Path.SEPARATOR_CHAR}; } int length = 0; for (int i = 0; i < pathComponents.length; i++) {... | /**
* Given a list of path components returns a byte array
*/ | Given a list of path components returns a byte array | byteArray2bytes | {
"repo_name": "an3m0na/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java",
"license": "apache-2.0",
"size": 70338
} | [
"org.apache.hadoop.fs.Path"
] | import org.apache.hadoop.fs.Path; | import org.apache.hadoop.fs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 927,441 |
//------------------------- PUBLIC API METHODS -------------------------//
public static SCXML read(final String scxmlPath)
throws IOException, ModelException, XMLStreamException {
return read(scxmlPath, new Configuration());
} | static SCXML function(final String scxmlPath) throws IOException, ModelException, XMLStreamException { return read(scxmlPath, new Configuration()); } | /**
* Parse the SCXML document at the supplied path.
*
* @param scxmlPath The real path to the SCXML document.
*
* @return The parsed output, the Commons SCXML object model corresponding to the SCXML document.
*
* @throws IOException An IO error during parsing.
* @throws ModelExc... | Parse the SCXML document at the supplied path | read | {
"repo_name": "wmudge/commons-scxml",
"path": "src/main/java/org/apache/commons/scxml2/io/SCXMLReader.java",
"license": "apache-2.0",
"size": 138470
} | [
"java.io.IOException",
"javax.xml.stream.XMLStreamException",
"org.apache.commons.scxml2.model.ModelException"
] | import java.io.IOException; import javax.xml.stream.XMLStreamException; import org.apache.commons.scxml2.model.ModelException; | import java.io.*; import javax.xml.stream.*; import org.apache.commons.scxml2.model.*; | [
"java.io",
"javax.xml",
"org.apache.commons"
] | java.io; javax.xml; org.apache.commons; | 1,684,673 |
@NotNull
@ObjectiveCName("signUpCommandWithName:WithSex:withAvatar:")
public Command<AuthState> signUp(String name, Sex sex, String avatarPath) {
return modules.getAuthModule().signUp(name, ApiSex.UNKNOWN, avatarPath);
} | @ObjectiveCName(STR) Command<AuthState> function(String name, Sex sex, String avatarPath) { return modules.getAuthModule().signUp(name, ApiSex.UNKNOWN, avatarPath); } | /**
* Perform signup
*
* @param name Name of User
* @param sex user sex
* @param avatarPath File descriptor of avatar (may be null if not set)
* @return Comand for execution
*/ | Perform signup | signUp | {
"repo_name": "luoxiaoshenghustedu/actor-platform",
"path": "actor-apps/core/src/main/java/im/actor/core/Messenger.java",
"license": "mit",
"size": 52564
} | [
"com.google.j2objc.annotations.ObjectiveCName",
"im.actor.core.api.ApiSex",
"im.actor.core.entity.Sex",
"im.actor.core.viewmodel.Command"
] | import com.google.j2objc.annotations.ObjectiveCName; import im.actor.core.api.ApiSex; import im.actor.core.entity.Sex; import im.actor.core.viewmodel.Command; | import com.google.j2objc.annotations.*; import im.actor.core.api.*; import im.actor.core.entity.*; import im.actor.core.viewmodel.*; | [
"com.google.j2objc",
"im.actor.core"
] | com.google.j2objc; im.actor.core; | 48,064 |
return m_globalInfo;
}
public Classifier() {
setLayout(new BorderLayout());
add(m_visual, BorderLayout.CENTER);
setClassifierTemplate(m_ClassifierTemplate);
// setupFileChooser();
} | return m_globalInfo; } public Classifier() { setLayout(new BorderLayout()); add(m_visual, BorderLayout.CENTER); setClassifierTemplate(m_ClassifierTemplate); } | /**
* Global info (if it exists) for the wrapped classifier
*
* @return the global info
*/ | Global info (if it exists) for the wrapped classifier | globalInfo | {
"repo_name": "goddesss/DataModeling",
"path": "src/weka/gui/beans/Classifier.java",
"license": "gpl-2.0",
"size": 71678
} | [
"java.awt.BorderLayout"
] | import java.awt.BorderLayout; | import java.awt.*; | [
"java.awt"
] | java.awt; | 877,697 |
public void addPendingDelete(Index index, IndexSettings settings) {
PendingDelete pendingDelete = new PendingDelete(index, settings);
addPendingDelete(index, pendingDelete);
} | void function(Index index, IndexSettings settings) { PendingDelete pendingDelete = new PendingDelete(index, settings); addPendingDelete(index, pendingDelete); } | /**
* Adds a pending delete for the given index.
*/ | Adds a pending delete for the given index | addPendingDelete | {
"repo_name": "jpountz/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/IndicesService.java",
"license": "apache-2.0",
"size": 34964
} | [
"org.elasticsearch.index.Index",
"org.elasticsearch.index.IndexSettings"
] | import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexSettings; | import org.elasticsearch.index.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 823,366 |
public CustomJSONWriter value(long l) throws JSONException {
return this.append(Long.toString(l));
} | CustomJSONWriter function(long l) throws JSONException { return this.append(Long.toString(l)); } | /**
* Append a long value.
* @param l A long.
* @return this
* @throws JSONException
*/ | Append a long value | value | {
"repo_name": "fastcat-co/fastcatsearch",
"path": "server/src/main/java/org/fastcatsearch/util/CustomJSONWriter.java",
"license": "apache-2.0",
"size": 12081
} | [
"org.json.JSONException"
] | import org.json.JSONException; | import org.json.*; | [
"org.json"
] | org.json; | 2,479,141 |
public boolean isCharging() {
// Check battery and charging status
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = getApplicationContext().registerReceiver(null,
ifilter);
// Are we charging / charged?
int status = batteryStatus.getIntExtra(BatteryManager... | boolean function() { IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); Intent batteryStatus = getApplicationContext().registerReceiver(null, ifilter); int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING stat... | /**
* Check charge state for preferences.
*
*/ | Check charge state for preferences | isCharging | {
"repo_name": "Cbsoftware/PressureNet-SDK",
"path": "src/ca/cumulonimbus/pressurenetsdk/CbService.java",
"license": "mit",
"size": 67493
} | [
"android.content.Intent",
"android.content.IntentFilter",
"android.os.BatteryManager"
] | import android.content.Intent; import android.content.IntentFilter; import android.os.BatteryManager; | import android.content.*; import android.os.*; | [
"android.content",
"android.os"
] | android.content; android.os; | 1,655,210 |
void smoothScrollTo(int x, int y, int velocity) {
if (getChildCount() == 0) {
// Nothing to do.
setScrollingCacheEnabled(false);
return;
}
int sx = getScrollX();
int sy = getScrollY();
int dx = x - sx;
int dy = y - sy;
if (dx == 0 && dy == 0) {
completeScroll(false);
populate();
setSc... | void smoothScrollTo(int x, int y, int velocity) { if (getChildCount() == 0) { setScrollingCacheEnabled(false); return; } int sx = getScrollX(); int sy = getScrollY(); int dx = x - sx; int dy = y - sy; if (dx == 0 && dy == 0) { completeScroll(false); populate(); setScrollState(SCROLL_STATE_IDLE); return; } setScrollingC... | /**
* Like {@link View#scrollBy}, but scroll smoothly instead of immediately.
*
* @param x
* the number of pixels to scroll by on the X axis
* @param y
* the number of pixels to scroll by on the Y axis
* @param velocity
* the velocity associated with a fling, if applicab... | Like <code>View#scrollBy</code>, but scroll smoothly instead of immediately | smoothScrollTo | {
"repo_name": "fengshihao/WebPager",
"path": "webpager/src/main/java/com/fengshihao/webpager/CustomViewPager.java",
"license": "mit",
"size": 95337
} | [
"android.support.v4.view.ViewCompat"
] | import android.support.v4.view.ViewCompat; | import android.support.v4.view.*; | [
"android.support"
] | android.support; | 785,659 |
@Override
public void modifyTestElement(TestElement el) {
configureTestElement(el);
SizeAssertion assertion = (SizeAssertion) el;
if (responseHeadersButton.isSelected()) {
assertion.setTestFieldResponseHeaders();
} else if (responseBodyButton.isSelecte... | void function(TestElement el) { configureTestElement(el); SizeAssertion assertion = (SizeAssertion) el; if (responseHeadersButton.isSelected()) { assertion.setTestFieldResponseHeaders(); } else if (responseBodyButton.isSelected()) { assertion.setTestFieldResponseBody(); } else if (responseCodeButton.isSelected()) { ass... | /**
* Modifies a given TestElement to mirror the data in the gui components.
*
* @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)
*/ | Modifies a given TestElement to mirror the data in the gui components | modifyTestElement | {
"repo_name": "botelhojp/apache-jmeter-2.10",
"path": "src/components/org/apache/jmeter/assertions/gui/SizeAssertionGui.java",
"license": "apache-2.0",
"size": 10632
} | [
"org.apache.jmeter.assertions.SizeAssertion",
"org.apache.jmeter.testelement.TestElement"
] | import org.apache.jmeter.assertions.SizeAssertion; import org.apache.jmeter.testelement.TestElement; | import org.apache.jmeter.assertions.*; import org.apache.jmeter.testelement.*; | [
"org.apache.jmeter"
] | org.apache.jmeter; | 762,762 |
private Locale addDatePickerWithLocale(JComponent comp, Locale uk) {
Locale old = setLocale(uk);
JXDatePicker datePicker = new JXDatePicker();
comp.add(new JLabel(uk.getDisplayName()));
comp.add(datePicker);
return old;
} | Locale function(JComponent comp, Locale uk) { Locale old = setLocale(uk); JXDatePicker datePicker = new JXDatePicker(); comp.add(new JLabel(uk.getDisplayName())); comp.add(datePicker); return old; } | /**
* Sets the default Locale to the given, instantiates a JXDatePicker with
* default Locale and adds it to the given component. Returns the previous
* default Locale.
*
* @param comp the container to add the picker to
* @param uk the new default Locale
*
* @return the prev... | Sets the default Locale to the given, instantiates a JXDatePicker with default Locale and adds it to the given component. Returns the previous default Locale | addDatePickerWithLocale | {
"repo_name": "syncer/swingx",
"path": "swingx-core/src/test/java/org/jdesktop/swingx/JXDatePickerVisualCheck.java",
"license": "lgpl-2.1",
"size": 51161
} | [
"java.util.Locale",
"javax.swing.JComponent",
"javax.swing.JLabel"
] | import java.util.Locale; import javax.swing.JComponent; import javax.swing.JLabel; | import java.util.*; import javax.swing.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 627,991 |
@Nullable
public static <T> T getCapability(@Nullable ICapabilityProvider provider, Capability<T> capability, @Nullable EnumFacing facing) {
return provider != null && provider.hasCapability(capability, facing) ? provider.getCapability(capability, facing) : null;
} | static <T> T function(@Nullable ICapabilityProvider provider, Capability<T> capability, @Nullable EnumFacing facing) { return provider != null && provider.hasCapability(capability, facing) ? provider.getCapability(capability, facing) : null; } | /**
* Get a capability handler from an {@link ICapabilityProvider} if it exists.
*
* @param provider The provider
* @param capability The capability
* @param facing The facing
* @param <T> The handler type
* @return The handler, if any.
*/ | Get a capability handler from an <code>ICapabilityProvider</code> if it exists | getCapability | {
"repo_name": "talandar/ManaFluidics",
"path": "src/main/java/derpatiel/manafluidics/block/MFTileBlock.java",
"license": "mit",
"size": 2447
} | [
"javax.annotation.Nullable",
"net.minecraft.util.EnumFacing",
"net.minecraftforge.common.capabilities.Capability",
"net.minecraftforge.common.capabilities.ICapabilityProvider"
] | import javax.annotation.Nullable; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; | import javax.annotation.*; import net.minecraft.util.*; import net.minecraftforge.common.capabilities.*; | [
"javax.annotation",
"net.minecraft.util",
"net.minecraftforge.common"
] | javax.annotation; net.minecraft.util; net.minecraftforge.common; | 2,149,277 |
@Override
public void run() {
InternalDistributedSystem ids = cache.getInternalDistributedSystem();
DistributionManager dm = ids.getDistributionManager();
try { // ensure exit message is printed
// Long waitTime = Long.getLong(QUEUE_REMOVAL_WAIT_TIME, 1000);
for (;;) {
... | void function() { InternalDistributedSystem ids = cache.getInternalDistributedSystem(); DistributionManager dm = ids.getDistributionManager(); try { for (;;) { try { if (checkCancelled()) { break; } boolean interrupted = Thread.interrupted(); try { synchronized (this) { this.wait(1000 * (long) messageSyncInterval); } }... | /**
* The thread will check the dispatchedMessages map for messages that have been dispatched. It
* will create a new {@code QueueRemovalMessage} and send it to the other nodes
*/ | The thread will check the dispatchedMessages map for messages that have been dispatched. It will create a new QueueRemovalMessage and send it to the other nodes | run | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java",
"license": "apache-2.0",
"size": 150325
} | [
"java.util.LinkedList",
"java.util.List",
"org.apache.geode.CancelException",
"org.apache.geode.SystemFailure",
"org.apache.geode.cache.server.CacheServer",
"org.apache.geode.distributed.DistributedMember",
"org.apache.geode.distributed.internal.DistributionManager",
"org.apache.geode.distributed.inte... | import java.util.LinkedList; import java.util.List; import org.apache.geode.CancelException; import org.apache.geode.SystemFailure; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.internal.DistributionManager; import org.apache... | import java.util.*; import org.apache.geode.*; import org.apache.geode.cache.server.*; import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.*; import org.apache.geode.internal.cache.*; | [
"java.util",
"org.apache.geode"
] | java.util; org.apache.geode; | 1,851,836 |
private void handleIncomingResponseMessage(SerialMessage incomingMessage) throws ZWaveSerialMessageException {
logger.trace("Incoming Message type = RESPONSE");
ZWaveCommandProcessor processor = ZWaveCommandProcessor.getMessageDispatcher(incomingMessage.getMessageClass());
if (processor == ... | void function(SerialMessage incomingMessage) throws ZWaveSerialMessageException { logger.trace(STR); ZWaveCommandProcessor processor = ZWaveCommandProcessor.getMessageDispatcher(incomingMessage.getMessageClass()); if (processor == null) { logger.warn(String.format(STR, incomingMessage.getMessageClass().getLabel(), inco... | /**
* Handles an incoming response message. An incoming response message is a
* response, based one of our own requests.
*
* @param incomingMessage
* the response message to process.
*/ | Handles an incoming response message. An incoming response message is a response, based one of our own requests | handleIncomingResponseMessage | {
"repo_name": "mickey4u/new_mart",
"path": "addons/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveController.java",
"license": "epl-1.0",
"size": 56021
} | [
"org.openhab.binding.zwave.internal.protocol.event.ZWaveNetworkStateEvent",
"org.openhab.binding.zwave.internal.protocol.event.ZWaveTransactionCompletedEvent",
"org.openhab.binding.zwave.internal.protocol.serialmessage.EnableSucMessageClass",
"org.openhab.binding.zwave.internal.protocol.serialmessage.GetContr... | import org.openhab.binding.zwave.internal.protocol.event.ZWaveNetworkStateEvent; import org.openhab.binding.zwave.internal.protocol.event.ZWaveTransactionCompletedEvent; import org.openhab.binding.zwave.internal.protocol.serialmessage.EnableSucMessageClass; import org.openhab.binding.zwave.internal.protocol.serialmessa... | import org.openhab.binding.zwave.internal.protocol.event.*; import org.openhab.binding.zwave.internal.protocol.serialmessage.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 238,585 |
public void run(Configuration configuration, InjectableStepsFactory stepsFactory, Story story, MetaFilter filter,
State beforeStories) throws Throwable {
RunContext context = new RunContext(configuration, stepsFactory, story.getPath(), filter);
if (beforeStories != null) {
co... | void function(Configuration configuration, InjectableStepsFactory stepsFactory, Story story, MetaFilter filter, State beforeStories) throws Throwable { RunContext context = new RunContext(configuration, stepsFactory, story.getPath(), filter); if (beforeStories != null) { context.stateIs(beforeStories); } Map<String, St... | /**
* Runs a Story with the given steps factory, applying the given meta
* filter, and staring from given state.
*
* @param configuration the Configuration used to run story
* @param stepsFactory the InjectableStepsFactory used to created the
* candidate steps methods
* @p... | Runs a Story with the given steps factory, applying the given meta filter, and staring from given state | run | {
"repo_name": "skundrik/jbehave-core",
"path": "jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java",
"license": "bsd-3-clause",
"size": 29887
} | [
"java.util.HashMap",
"java.util.Map",
"org.jbehave.core.configuration.Configuration",
"org.jbehave.core.model.Story",
"org.jbehave.core.steps.InjectableStepsFactory"
] | import java.util.HashMap; import java.util.Map; import org.jbehave.core.configuration.Configuration; import org.jbehave.core.model.Story; import org.jbehave.core.steps.InjectableStepsFactory; | import java.util.*; import org.jbehave.core.configuration.*; import org.jbehave.core.model.*; import org.jbehave.core.steps.*; | [
"java.util",
"org.jbehave.core"
] | java.util; org.jbehave.core; | 2,488,201 |
@Test
public void testBroadcastDecommissioning()
{
final ForeverBroadcastDistributionRule rule =
new ForeverBroadcastDistributionRule(ImmutableList.of("large_source"));
CoordinatorStats stats = rule.run(
null,
makeCoordinartorRuntimeParams(
secondCluster,
s... | void function() { final ForeverBroadcastDistributionRule rule = new ForeverBroadcastDistributionRule(ImmutableList.of(STR)); CoordinatorStats stats = rule.run( null, makeCoordinartorRuntimeParams( secondCluster, smallSegment, largeSegments.get(0), largeSegments.get(1) ), smallSegment ); Assert.assertEquals(1L, stats.ge... | /**
* Servers:
* name | segments
* -----------------+--------------
* active | large segment
* decommissioning1 | small segment
* decommissioning2 | large segment
* <p>
* After running the rule for the small segment:
* active | large & small segments
* decom... | Servers: name | segments -----------------+-------------- active | large segment decommissioning1 | small segment decommissioning2 | large segment After running the rule for the small segment: active | large & small segments decommissioning1 | decommissionint2 | large segment | testBroadcastDecommissioning | {
"repo_name": "Fokko/druid",
"path": "server/src/test/java/org/apache/druid/server/coordinator/rules/BroadcastDistributionRuleTest.java",
"license": "apache-2.0",
"size": 12664
} | [
"com.google.common.collect.ImmutableList",
"org.apache.druid.server.coordinator.CoordinatorStats",
"org.junit.Assert"
] | import com.google.common.collect.ImmutableList; import org.apache.druid.server.coordinator.CoordinatorStats; import org.junit.Assert; | import com.google.common.collect.*; import org.apache.druid.server.coordinator.*; import org.junit.*; | [
"com.google.common",
"org.apache.druid",
"org.junit"
] | com.google.common; org.apache.druid; org.junit; | 2,634,873 |
public static CharSequence readTo(Reader in, char... limit) throws IOException {
StringBuilder result = new StringBuilder();
int c;
outer: while ((c = in.read()) != -1) {
for (int i = 0; i < limit.length; i++)
if (c == limit[i])
break outer;
result.append((char) c);
if (maxChars != -1... | static CharSequence function(Reader in, char... limit) throws IOException { StringBuilder result = new StringBuilder(); int c; outer: while ((c = in.read()) != -1) { for (int i = 0; i < limit.length; i++) if (c == limit[i]) break outer; result.append((char) c); if (maxChars != -1 && result.length() > maxChars) break; }... | /**
* Reads to a specific character, returns the text in between
*
* @throws IOException
*/ | Reads to a specific character, returns the text in between | readTo | {
"repo_name": "thomasrebele/casie",
"path": "src/main/java/javatools/filehandlers/FileLines.java",
"license": "mpl-2.0",
"size": 12099
} | [
"java.io.IOException",
"java.io.Reader"
] | import java.io.IOException; import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 1,153,432 |
protected int[] doBatchUpdate(String command, List<String> batch, List<List<Object>> batchArgs)
throws SQLException {
closeResults();
if ((F.isEmpty(command) || F.isEmpty(batchArgs)) && F.isEmpty(batch))
throw new SQLException("Batch is empty.");
Ignite ignite = conn.i... | int[] function(String command, List<String> batch, List<List<Object>> batchArgs) throws SQLException { closeResults(); if ((F.isEmpty(command) F.isEmpty(batchArgs)) && F.isEmpty(batch)) throw new SQLException(STR); Ignite ignite = conn.ignite(); UUID nodeId = conn.nodeId(); boolean loc = nodeId == null; if (!conn.isDml... | /**
* Runs batch of update commands.
*
* @param command SQL command.
* @param batch Batch of SQL commands.
* @param batchArgs Batch of SQL parameters.
* @return Number of affected rows.
* @throws SQLException If failed.
*/ | Runs batch of update commands | doBatchUpdate | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcStatement.java",
"license": "apache-2.0",
"size": 19314
} | [
"java.sql.SQLException",
"java.util.Collections",
"java.util.List",
"org.apache.ignite.Ignite",
"org.apache.ignite.internal.jdbc2.JdbcUtils",
"org.apache.ignite.internal.util.typedef.F"
] | import java.sql.SQLException; import java.util.Collections; import java.util.List; import org.apache.ignite.Ignite; import org.apache.ignite.internal.jdbc2.JdbcUtils; import org.apache.ignite.internal.util.typedef.F; | import java.sql.*; import java.util.*; import org.apache.ignite.*; import org.apache.ignite.internal.jdbc2.*; import org.apache.ignite.internal.util.typedef.*; | [
"java.sql",
"java.util",
"org.apache.ignite"
] | java.sql; java.util; org.apache.ignite; | 2,789,192 |
private JDialog createPropertyDialog() {
Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this);
JDialog dialog = new JDialog(frame, "Plot Properties", true);
Action okAction = new PropertyDialogOKAction(dialog);
Action cancelAction = new PropertyDialogCancelActi... | JDialog function() { Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, this); JDialog dialog = new JDialog(frame, STR, true); Action okAction = new PropertyDialogOKAction(dialog); Action cancelAction = new PropertyDialogCancelAction(dialog); JButton okButton = new JButton(okAction); JButton cancelBut... | /**
* Creates the property dialog.
* @return the property dialog.
*/ | Creates the property dialog | createPropertyDialog | {
"repo_name": "dublinio/smile",
"path": "SmilePlot/src/main/java/smile/plot/PlotCanvas.java",
"license": "apache-2.0",
"size": 71375
} | [
"java.awt.BorderLayout",
"java.awt.FlowLayout",
"java.awt.Frame",
"javax.swing.AbstractAction",
"javax.swing.Action",
"javax.swing.ActionMap",
"javax.swing.BorderFactory",
"javax.swing.InputMap",
"javax.swing.JButton",
"javax.swing.JComponent",
"javax.swing.JDialog",
"javax.swing.JPanel",
"j... | import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.Frame; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.BorderFactory; import javax.swing.InputMap; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JDialo... | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,116,890 |
public static Event getLast() {
if (Event.lastEvent == null) {
final Criteria crit = BaseEntity.getCriteria(Event.class);
crit.addOrder(Order.desc("id"));
crit.setMaxResults(1);
Event.lastEvent = (Event) crit.uniqueResult();
}
return Event.lastEvent;
} | static Event function() { if (Event.lastEvent == null) { final Criteria crit = BaseEntity.getCriteria(Event.class); crit.addOrder(Order.desc("id")); crit.setMaxResults(1); Event.lastEvent = (Event) crit.uniqueResult(); } return Event.lastEvent; } | /**
* Get the last event on the timeline.
*
* @return The event.
*/ | Get the last event on the timeline | getLast | {
"repo_name": "triceo/SchedVis",
"path": "src/main/java/cz/muni/fi/spc/SchedVis/model/entities/Event.java",
"license": "gpl-3.0",
"size": 7833
} | [
"cz.muni.fi.spc.SchedVis",
"org.hibernate.Criteria",
"org.hibernate.criterion.Order"
] | import cz.muni.fi.spc.SchedVis; import org.hibernate.Criteria; import org.hibernate.criterion.Order; | import cz.muni.fi.spc.*; import org.hibernate.*; import org.hibernate.criterion.*; | [
"cz.muni.fi",
"org.hibernate",
"org.hibernate.criterion"
] | cz.muni.fi; org.hibernate; org.hibernate.criterion; | 2,334,113 |
public static String[] getNames(JSONObject jo) {
int length = jo.length();
if (length == 0) {
return null;
}
Iterator iterator = jo.keys();
String[] names = new String[length];
int i = 0;
while (iterator.hasNext()) {
names[i] = (String)... | static String[] function(JSONObject jo) { int length = jo.length(); if (length == 0) { return null; } Iterator iterator = jo.keys(); String[] names = new String[length]; int i = 0; while (iterator.hasNext()) { names[i] = (String)iterator.next(); i += 1; } return names; } | /**
* Get an array of field names from a JSONObject.
*
* @param jo
* @return An array of field names, or null if there are no names.
*/ | Get an array of field names from a JSONObject | getNames | {
"repo_name": "rcongiu/Hive-JSON-Serde",
"path": "json/src/main/java/org/openx/data/jsonserde/json/JSONObject.java",
"license": "bsd-3-clause",
"size": 55616
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,742,774 |
public void diff_cleanupEfficiency(LinkedList<Diff> diffs) {
if (diffs.isEmpty()) {
return;
}
boolean changes = false;
Stack<Diff> equalities = new Stack<Diff>(); // Stack of equalities.
String lastequality = null; // Always equal to equalities.lastElement().text
ListIterator<Diff> poin... | void function(LinkedList<Diff> diffs) { if (diffs.isEmpty()) { return; } boolean changes = false; Stack<Diff> equalities = new Stack<Diff>(); String lastequality = null; ListIterator<Diff> pointer = diffs.listIterator(); boolean pre_ins = false; boolean pre_del = false; boolean post_ins = false; boolean post_del = fals... | /**
* Reduce the number of edits by eliminating operationally trivial equalities.
* @param diffs LinkedList of Diff objects.
*/ | Reduce the number of edits by eliminating operationally trivial equalities | diff_cleanupEfficiency | {
"repo_name": "xjyaikj/OnlinePreparation",
"path": "src/main/java/com/xjy/op/util/DiffMatchPatch.java",
"license": "mit",
"size": 89008
} | [
"java.util.LinkedList",
"java.util.ListIterator",
"java.util.Stack"
] | import java.util.LinkedList; import java.util.ListIterator; import java.util.Stack; | import java.util.*; | [
"java.util"
] | java.util; | 718,784 |
@SuppressWarnings("unchecked")
private Set<Cell> newInstanceOfSet() {
Set<Cell> result = null;
try {
// We don't know what implementation of the Set interface is being
// used (e.g. a HashSet class), so we derive it from the Set that is
// used in the existin... | @SuppressWarnings(STR) Set<Cell> function() { Set<Cell> result = null; try { result = (Set<Cell>) life.getLiveCells().getClass().newInstance(); } catch (InstantiationException e) { throw new FailedEvolutionException(e); } catch (IllegalAccessException e) { throw new FailedEvolutionException(e); } return result; } | /**
* Creates a new instance of Set<Cell>, based on what type of
* Set<Cell> is used already in the existing Life to store the set of
* live cells.
*
* @return a new, empty Set<Cell>
*/ | Creates a new instance of Set<Cell>, based on what type of Set<Cell> is used already in the existing Life to store the set of live cells | newInstanceOfSet | {
"repo_name": "JoshTumath/bbcgradscheme-gameoflife",
"path": "src/bbc/gameoflifestub/Game.java",
"license": "mit",
"size": 3129
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,476,870 |
private static Double[] findDomainValues(XYZDataset dataset, int series, double y) {
List<Double> xs = new ArrayList<Double>();
for (int i = 0; i < dataset.getItemCount(series); i++) {
Double yy = dataset.getYValue(series, i);
if (yy.doubleValue() == y) {
xs.add(dataset.getXValue(series... | static Double[] function(XYZDataset dataset, int series, double y) { List<Double> xs = new ArrayList<Double>(); for (int i = 0; i < dataset.getItemCount(series); i++) { Double yy = dataset.getYValue(series, i); if (yy.doubleValue() == y) { xs.add(dataset.getXValue(series, i)); } } return xs.toArray(new Double[xs.size()... | /**
* Finds domain values (x-axis) corresponding to the given y value
*
* @param dataset
* @param series
* @param y
* @return
*/ | Finds domain values (x-axis) corresponding to the given y value | findDomainValues | {
"repo_name": "intelligentautomation/proteus",
"path": "plugins/com.iai.proteus/src/com/iai/proteus/plot/ContourPlotUtils.java",
"license": "lgpl-3.0",
"size": 19314
} | [
"java.util.ArrayList",
"java.util.List",
"org.jfree.data.xy.XYZDataset"
] | import java.util.ArrayList; import java.util.List; import org.jfree.data.xy.XYZDataset; | import java.util.*; import org.jfree.data.xy.*; | [
"java.util",
"org.jfree.data"
] | java.util; org.jfree.data; | 2,762,336 |
public Index createIndex(boolean remotelyOriginated, IndexType indexType, String indexName,
String indexedExpression, String fromClause, String imports, boolean loadEntries)
throws ForceReattemptException, IndexCreationException, IndexNameConflictException,
IndexExistsException {
return createIn... | Index function(boolean remotelyOriginated, IndexType indexType, String indexName, String indexedExpression, String fromClause, String imports, boolean loadEntries) throws ForceReattemptException, IndexCreationException, IndexNameConflictException, IndexExistsException { return createIndex(remotelyOriginated, indexType,... | /**
* Creates the actual index on this partitioned regions.
*
* @param remotelyOriginated true if the index is created because of a remote index creation call
* @param indexType the type of index created.
* @param indexName the name for the index to be created
* @param indexedExpression expression for... | Creates the actual index on this partitioned regions | createIndex | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java",
"license": "apache-2.0",
"size": 379988
} | [
"org.apache.geode.cache.query.Index",
"org.apache.geode.cache.query.IndexCreationException",
"org.apache.geode.cache.query.IndexExistsException",
"org.apache.geode.cache.query.IndexNameConflictException",
"org.apache.geode.cache.query.IndexType"
] | import org.apache.geode.cache.query.Index; import org.apache.geode.cache.query.IndexCreationException; import org.apache.geode.cache.query.IndexExistsException; import org.apache.geode.cache.query.IndexNameConflictException; import org.apache.geode.cache.query.IndexType; | import org.apache.geode.cache.query.*; | [
"org.apache.geode"
] | org.apache.geode; | 782,219 |
public static Category getLocalizedCategory(Context context,
StorageAccessManagerEx sam, String category) {
final String dons = "http://yarta.gforge.inria.fr/ontologies/donations.rdf";
String categoryId = null;
if (category.equals(context.getString(R.string.category_kitchen))) {
categoryId = dons ... | static Category function(Context context, StorageAccessManagerEx sam, String category) { final String dons = STR#KitchenSTR#FurnitureSTR#GamesSTR#LeisureSTR#AnimalsSTR#GardeningSTR#Misc"; } if (categoryId != null) { return new CategoryImpl(sam, new MSEResource(categoryId, Category.typeURI)); } return null; } | /**
* Returns the Category instance associated with this localized category
* string.
*
* @param sam
* @param category
* @return
*/ | Returns the Category instance associated with this localized category string | getLocalizedCategory | {
"repo_name": "grosca/yarta",
"path": "samples/android/INRIADonations/src/fr/inria/arles/giveaway/Common.java",
"license": "lgpl-3.0",
"size": 5083
} | [
"android.content.Context",
"fr.inria.arles.giveaway.msemanagement.StorageAccessManagerEx",
"fr.inria.arles.giveaway.resources.Category",
"fr.inria.arles.giveaway.resources.CategoryImpl",
"fr.inria.arles.yarta.knowledgebase.MSEResource"
] | import android.content.Context; import fr.inria.arles.giveaway.msemanagement.StorageAccessManagerEx; import fr.inria.arles.giveaway.resources.Category; import fr.inria.arles.giveaway.resources.CategoryImpl; import fr.inria.arles.yarta.knowledgebase.MSEResource; | import android.content.*; import fr.inria.arles.giveaway.msemanagement.*; import fr.inria.arles.giveaway.resources.*; import fr.inria.arles.yarta.knowledgebase.*; | [
"android.content",
"fr.inria.arles"
] | android.content; fr.inria.arles; | 2,378,645 |
public YangSchemaRegistry getYangSchemaRegistry() {
return registry;
} | YangSchemaRegistry function() { return registry; } | /**
* Returns the YANG schema registry of Ydt.
* This method will be used by ytb.
*
* @return YANG schema registry
*/ | Returns the YANG schema registry of Ydt. This method will be used by ytb | getYangSchemaRegistry | {
"repo_name": "LorenzReinhart/ONOSnew",
"path": "apps/yms/app/src/main/java/org/onosproject/yms/app/ydt/YangRequestWorkBench.java",
"license": "apache-2.0",
"size": 28549
} | [
"org.onosproject.yms.app.ysr.YangSchemaRegistry"
] | import org.onosproject.yms.app.ysr.YangSchemaRegistry; | import org.onosproject.yms.app.ysr.*; | [
"org.onosproject.yms"
] | org.onosproject.yms; | 1,502,901 |
@Override
public Element createXML() throws MCRException {
Element elm = super.createXML();
elm.setAttribute("classid", getClassId());
elm.setAttribute("categid", getCategId());
return elm;
}
/**
* Creates the JSON representation. Extends the {@link MCRMetaDefault#... | Element function() throws MCRException { Element elm = super.createXML(); elm.setAttribute(STR, getClassId()); elm.setAttribute(STR, getCategId()); return elm; } /** * Creates the JSON representation. Extends the {@link MCRMetaDefault#createJSON()} method * with the following data. * * <pre> * { * classid: STR, * categ... | /**
* This method create a XML stream for all data in this class, defined by
* the MyCoRe XML MCRMetaClassification definition for the given subtag.
*
* @exception MCRException
* if the content of this class is not valid
* @return a JDOM Element with the XML MCRClassificati... | This method create a XML stream for all data in this class, defined by the MyCoRe XML MCRMetaClassification definition for the given subtag | createXML | {
"repo_name": "MyCoRe-Org/mycore",
"path": "mycore-base/src/main/java/org/mycore/datamodel/metadata/MCRMetaClassification.java",
"license": "gpl-3.0",
"size": 8101
} | [
"org.jdom2.Element",
"org.mycore.common.MCRException"
] | import org.jdom2.Element; import org.mycore.common.MCRException; | import org.jdom2.*; import org.mycore.common.*; | [
"org.jdom2",
"org.mycore.common"
] | org.jdom2; org.mycore.common; | 2,874,188 |
private void addComment(AbstractBuild<?, ?> build, String id, String comment) throws IOException {
JiraSession session = getJiraSession(build);
session.addCommentWithoutConstrains(id, comment);
} | void function(AbstractBuild<?, ?> build, String id, String comment) throws IOException { JiraSession session = getJiraSession(build); session.addCommentWithoutConstrains(id, comment); } | /**
* Adds a comment to the existing issue.
*
* @param build
* @param id
* @param comment
* @throws IOException
*/ | Adds a comment to the existing issue | addComment | {
"repo_name": "deki/jira-plugin",
"path": "src/main/java/hudson/plugins/jira/JiraCreateIssueNotifier.java",
"license": "mit",
"size": 15894
} | [
"hudson.model.AbstractBuild",
"java.io.IOException"
] | import hudson.model.AbstractBuild; import java.io.IOException; | import hudson.model.*; import java.io.*; | [
"hudson.model",
"java.io"
] | hudson.model; java.io; | 1,290,178 |
public static Collection getFiles(String workingDir, String pattern)
{
ArrayList result = new ArrayList();
// check if we have a non patterned file name
// check if we have an absolute file
File res = new File(pattern);
if (res.exists() && res.isAbsolute())
{
result.add(res);
return r... | static Collection function(String workingDir, String pattern) { ArrayList result = new ArrayList(); File res = new File(pattern); if (res.exists() && res.isAbsolute()) { result.add(res); return result; } if (!res.isAbsolute()) { res = new File(workingDir, pattern); if (res.exists()) { result.add(res); return result; } ... | /**
* Gets the files.
*
* @param workingDir
* the working dir
* @param pattern
* the pattern
*
* @return the files
*/ | Gets the files | getFiles | {
"repo_name": "mv2a/yajsw",
"path": "src/yajsw/src/main/java/org/rzo/yajsw/os/ms/win/w32/FileUtils.java",
"license": "apache-2.0",
"size": 7848
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.Collection"
] | import java.io.File; import java.util.ArrayList; import java.util.Collection; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 200,059 |
public void setExtensionProfile(ExtensionProfile v) {
this.extProfile = v;
}
protected final MetadataRegistry metadataRegistry; | void function(ExtensionProfile v) { this.extProfile = v; } protected final MetadataRegistry metadataRegistry; | /**
* Sets the {@link ExtensionProfile} that defines any expected extensions to
* the base RSS/Atom content model.
*/ | Sets the <code>ExtensionProfile</code> that defines any expected extensions to the base RSS/Atom content model | setExtensionProfile | {
"repo_name": "simonrrr/gdata-java-client",
"path": "java/src/com/google/gdata/client/Service.java",
"license": "apache-2.0",
"size": 83027
} | [
"com.google.gdata.data.ExtensionProfile",
"com.google.gdata.model.MetadataRegistry"
] | import com.google.gdata.data.ExtensionProfile; import com.google.gdata.model.MetadataRegistry; | import com.google.gdata.data.*; import com.google.gdata.model.*; | [
"com.google.gdata"
] | com.google.gdata; | 491,274 |
public static void formatNameNode(Configuration conf) throws IOException {
String clusterId = StartupOption.FORMAT.getClusterId();
if(clusterId == null || clusterId.isEmpty())
StartupOption.FORMAT.setClusterId("testClusterID");
// Use a copy of conf as it can be altered by namenode during format.
... | static void function(Configuration conf) throws IOException { String clusterId = StartupOption.FORMAT.getClusterId(); if(clusterId == null clusterId.isEmpty()) StartupOption.FORMAT.setClusterId(STR); NameNode.format(new Configuration(conf)); } | /**
* when formatting a namenode - we must provide clusterid.
* @param conf
* @throws IOException
*/ | when formatting a namenode - we must provide clusterid | formatNameNode | {
"repo_name": "apurtell/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/DFSTestUtil.java",
"license": "apache-2.0",
"size": 97746
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.server.common.HdfsServerConstants",
"org.apache.hadoop.hdfs.server.namenode.NameNode"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; import org.apache.hadoop.hdfs.server.namenode.NameNode; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 108,788 |
public List<String> getAllReachableModulesFilenames(); | List<String> function(); | /**
* Return the list of all relative filenames included from this MODULE.
*/ | Return the list of all relative filenames included from this MODULE | getAllReachableModulesFilenames | {
"repo_name": "AlloyTools/org.alloytools.alloy",
"path": "org.alloytools.alloy.core/src/main/java/edu/mit/csail/sdg/ast/Module.java",
"license": "apache-2.0",
"size": 4045
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 687,932 |
@SuppressWarnings("unchecked")
public <T> T getTransactionCacheUserObject(String prefix, NodeRef nodeRef) {
String user = AuthenticationUtil.getRunAsUser();
return (T) AlfrescoTransactionSupport.getResource(prefix + String.valueOf(nodeRef) + user);
} | @SuppressWarnings(STR) <T> T function(String prefix, NodeRef nodeRef) { String user = AuthenticationUtil.getRunAsUser(); return (T) AlfrescoTransactionSupport.getResource(prefix + String.valueOf(nodeRef) + user); } | /**
* Gets the transaction cache object specific for user.
*
* @param <T>
* the generic type
* @param prefix
* the prefix
* @param nodeRef
* the node ref
* @return the transaction cache object
*/ | Gets the transaction cache object specific for user | getTransactionCacheUserObject | {
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sep-alfresco/alfresco-emf-integration/alfresco-cmf/src/main/java/com/sirma/itt/cmf/integration/webscript/BaseAlfrescoScript.java",
"license": "lgpl-3.0",
"size": 26195
} | [
"org.alfresco.repo.security.authentication.AuthenticationUtil",
"org.alfresco.repo.transaction.AlfrescoTransactionSupport",
"org.alfresco.service.cmr.repository.NodeRef"
] | import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.transaction.AlfrescoTransactionSupport; import org.alfresco.service.cmr.repository.NodeRef; | import org.alfresco.repo.security.authentication.*; import org.alfresco.repo.transaction.*; import org.alfresco.service.cmr.repository.*; | [
"org.alfresco.repo",
"org.alfresco.service"
] | org.alfresco.repo; org.alfresco.service; | 1,561,779 |
@Override
public void relocate(final int oldPosition, final int newPosition, final ByteBuffer oldBuf, final ByteBuffer newBuf)
{
HllSketch sketch = sketchCache.get(oldBuf).get(oldPosition);
final WritableMemory oldMem = getMemory(oldBuf).writableRegion(oldPosition, size);
if (sketch.isSameResource(old... | void function(final int oldPosition, final int newPosition, final ByteBuffer oldBuf, final ByteBuffer newBuf) { HllSketch sketch = sketchCache.get(oldBuf).get(oldPosition); final WritableMemory oldMem = getMemory(oldBuf).writableRegion(oldPosition, size); if (sketch.isSameResource(oldMem)) { final WritableMemory newMem... | /**
* In very rare cases sketches can exceed given memory, request on-heap memory and move there.
* We need to identify such sketches and reuse the same objects as opposed to wrapping new memory regions.
*/ | In very rare cases sketches can exceed given memory, request on-heap memory and move there. We need to identify such sketches and reuse the same objects as opposed to wrapping new memory regions | relocate | {
"repo_name": "deltaprojects/druid",
"path": "extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java",
"license": "apache-2.0",
"size": 7462
} | [
"com.yahoo.memory.WritableMemory",
"com.yahoo.sketches.hll.HllSketch",
"java.nio.ByteBuffer"
] | import com.yahoo.memory.WritableMemory; import com.yahoo.sketches.hll.HllSketch; import java.nio.ByteBuffer; | import com.yahoo.memory.*; import com.yahoo.sketches.hll.*; import java.nio.*; | [
"com.yahoo.memory",
"com.yahoo.sketches",
"java.nio"
] | com.yahoo.memory; com.yahoo.sketches; java.nio; | 2,391,427 |
@GuardedBy("Segment.this")
void recordWrite(ReferenceEntry<K, V> entry, int weight, long now) {
// we are already under lock, so drain the recency queue immediately
drainRecencyQueue();
totalWeight += weight;
if (map.recordsAccess()) {
entry.setAccessTime(now);
}
if ... | @GuardedBy(STR) void recordWrite(ReferenceEntry<K, V> entry, int weight, long now) { drainRecencyQueue(); totalWeight += weight; if (map.recordsAccess()) { entry.setAccessTime(now); } if (map.recordsWrite()) { entry.setWriteTime(now); } accessQueue.add(entry); writeQueue.add(entry); } | /**
* Updates eviction metadata that {@code entry} was just written. This currently amounts to
* adding {@code entry} to relevant eviction lists.
*/ | Updates eviction metadata that entry was just written. This currently amounts to adding entry to relevant eviction lists | recordWrite | {
"repo_name": "hceylan/guava",
"path": "guava/src/com/google/common/cache/LocalCache.java",
"license": "apache-2.0",
"size": 144823
} | [
"javax.annotation.concurrent.GuardedBy"
] | import javax.annotation.concurrent.GuardedBy; | import javax.annotation.concurrent.*; | [
"javax.annotation"
] | javax.annotation; | 1,583,668 |
@ApiModelProperty(required = true, value = "")
public V1ThanosRulerSpecScaleIOSecretRef getSecretRef() {
return secretRef;
} | @ApiModelProperty(required = true, value = "") V1ThanosRulerSpecScaleIOSecretRef function() { return secretRef; } | /**
* Get secretRef
*
* @return secretRef
*/ | Get secretRef | getSecretRef | {
"repo_name": "kubernetes-client/java",
"path": "client-java-contrib/prometheus-operator/src/main/java/com/coreos/monitoring/models/V1ThanosRulerSpecScaleIO.java",
"license": "apache-2.0",
"size": 10770
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 146,388 |
@GET
@Path("comp/costtype")
@Produces(SCUtils.MIME_TYPES)
public Response getAllComponentCostTypes() throws StockControlException
{
EnumSet<UnitType> set = EnumSet.allOf(UnitType.class);
return Response.ok().entity(new CostTypeDAO(set)).build();
}
| @Path(STR) @Produces(SCUtils.MIME_TYPES) Response function() throws StockControlException { EnumSet<UnitType> set = EnumSet.allOf(UnitType.class); return Response.ok().entity(new CostTypeDAO(set)).build(); } | /**
* This method provides a set of all the different Cost types available in the system
* @return list<String>
* @throws StockControlException
*/ | This method provides a set of all the different Cost types available in the system | getAllComponentCostTypes | {
"repo_name": "mmckenzie70/stockcontrol",
"path": "src/main/java/stockcontrol/services/ComponentBatchService.java",
"license": "agpl-3.0",
"size": 16499
} | [
"java.util.EnumSet",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.Response"
] | import java.util.EnumSet; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; | import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; | [
"java.util",
"javax.ws"
] | java.util; javax.ws; | 109,978 |
public void setReceiverGroup(IReceiverGroup receiverGroup){
mSuperContainer.setReceiverGroup(receiverGroup);
} | void function(IReceiverGroup receiverGroup){ mSuperContainer.setReceiverGroup(receiverGroup); } | /**
* if you set receiver group , you need self handle receivers event ,
* example if you set a controller cover ,you need self handle seek event etc.
* @param receiverGroup
*/ | if you set receiver group , you need self handle receivers event , example if you set a controller cover ,you need self handle seek event etc | setReceiverGroup | {
"repo_name": "jiajunhui/PlayerBase",
"path": "playerbase/src/main/java/com/kk/taurus/playerbase/widget/BaseVideoView.java",
"license": "apache-2.0",
"size": 20837
} | [
"com.kk.taurus.playerbase.receiver.IReceiverGroup"
] | import com.kk.taurus.playerbase.receiver.IReceiverGroup; | import com.kk.taurus.playerbase.receiver.*; | [
"com.kk.taurus"
] | com.kk.taurus; | 176,440 |
public final String getLanguange() {
try {
URL url = new URL("https://api.twitch.tv/kraken/streams/" + channel.substring(1));
URLConnection conn = url.openConnection();
conn.setRequestProperty("Client-ID", bot.getClientID());
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStr... | final String function() { try { URL url = new URL(STRClient-IDSTRstreamSTRchannelSTRlanguage").asString(); return str; } catch (IOException ex) { return null; } } | /**
* Get the language the streamer is streaming
*
* @return the language in the streamer is streaming
*/ | Get the language the streamer is streaming | getLanguange | {
"repo_name": "CavariuX/TwitchIRC",
"path": "src/com/cavariux/twitchirc/Chat/Channel.java",
"license": "mit",
"size": 13363
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,857,234 |
public static QName getQNameProperty(String key, Properties props)
{
String s = props.getProperty(key);
if (null != s)
return QName.getQNameFromString(s);
else
return null;
}
| static QName function(String key, Properties props) { String s = props.getProperty(key); if (null != s) return QName.getQNameFromString(s); else return null; } | /**
* Searches for the qname property with the specified key in the property list.
* If the key is not found in this property list, the default property list,
* and its defaults, recursively, are then checked. The method returns
* <code>null</code> if the property is not found.
*
* @param key ... | Searches for the qname property with the specified key in the property list. If the key is not found in this property list, the default property list, and its defaults, recursively, are then checked. The method returns <code>null</code> if the property is not found | getQNameProperty | {
"repo_name": "kcsl/immutability-benchmark",
"path": "benchmark-applications/reiminfer-oopsla-2012/source/Xalan/src/org/apache/xalan/templates/OutputProperties.java",
"license": "mit",
"size": 23302
} | [
"java.util.Properties",
"org.apache.xml.utils.QName"
] | import java.util.Properties; import org.apache.xml.utils.QName; | import java.util.*; import org.apache.xml.utils.*; | [
"java.util",
"org.apache.xml"
] | java.util; org.apache.xml; | 1,029,590 |
private synchronized boolean saveProperties() {
if (file == null) {
Log.error("Unable to save XML properties; no file specified");
return false;
}
// Write data out to a temporary file first.
final Path tempFile = file.getParent().resolve(file.getFileName() +... | synchronized boolean function() { if (file == null) { Log.error(STR); return false; } final Path tempFile = file.getParent().resolve(file.getFileName() + ".tmp"); try (final Writer writer = Files.newBufferedWriter(tempFile, StandardCharsets.UTF_8)) { OutputFormat prettyPrinter = OutputFormat.createPrettyPrint(); XMLWri... | /**
* Saves the properties to disk as an XML document. A temporary file is
* used during the writing process for maximum safety.
*
* @return false if the file could not be saved, otherwise true
*/ | Saves the properties to disk as an XML document. A temporary file is used during the writing process for maximum safety | saveProperties | {
"repo_name": "speedy01/Openfire",
"path": "xmppserver/src/main/java/org/jivesoftware/util/XMLProperties.java",
"license": "apache-2.0",
"size": 32492
} | [
"java.io.IOException",
"java.io.Writer",
"java.nio.charset.StandardCharsets",
"java.nio.file.Files",
"java.nio.file.Path",
"java.nio.file.StandardCopyOption",
"org.dom4j.io.OutputFormat"
] | import java.io.IOException; import java.io.Writer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import org.dom4j.io.OutputFormat; | import java.io.*; import java.nio.charset.*; import java.nio.file.*; import org.dom4j.io.*; | [
"java.io",
"java.nio",
"org.dom4j.io"
] | java.io; java.nio; org.dom4j.io; | 1,745,499 |
public static String getTotp(String secret) {
Objects.requireNonNull(secret, Required.SECRET.toString());
String value = null;
try {
TOTP builder = TOTP.key(secret.getBytes(StandardCharsets.US_ASCII.name()))
.timeStep(TimeUnit.SECONDS.toMillis(PERIOD)... | static String function(String secret) { Objects.requireNonNull(secret, Required.SECRET.toString()); String value = null; try { TOTP builder = TOTP.key(secret.getBytes(StandardCharsets.US_ASCII.name())) .timeStep(TimeUnit.SECONDS.toMillis(PERIOD)) .digits(DIGITS) .hmacSha(ALGORITHM) .build(); value = builder.value(); } ... | /**
* Creates the current TOTP based on the following default values:
* SHA512 algorithm, 6 digits, 30 seconds time period
*
* @param secret The secret to use
*
* @return The totp value or null if generation failed
*/ | Creates the current TOTP based on the following default values: SHA512 algorithm, 6 digits, 30 seconds time period | getTotp | {
"repo_name": "svenkubiak/mangooio",
"path": "mangooio-core/src/main/java/io/mangoo/utils/TotpUtils.java",
"license": "apache-2.0",
"size": 7797
} | [
"io.mangoo.crypto.totp.TOTP",
"io.mangoo.enums.Required",
"java.io.UnsupportedEncodingException",
"java.nio.charset.StandardCharsets",
"java.util.Objects",
"java.util.concurrent.TimeUnit"
] | import io.mangoo.crypto.totp.TOTP; import io.mangoo.enums.Required; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.util.Objects; import java.util.concurrent.TimeUnit; | import io.mangoo.crypto.totp.*; import io.mangoo.enums.*; import java.io.*; import java.nio.charset.*; import java.util.*; import java.util.concurrent.*; | [
"io.mangoo.crypto",
"io.mangoo.enums",
"java.io",
"java.nio",
"java.util"
] | io.mangoo.crypto; io.mangoo.enums; java.io; java.nio; java.util; | 998,438 |
// access to low level API
public Length getContainedItem(){
return item;
}
//getters giving LLAPI object
| Length function(){ return item; } | /**
* Return encapsulated object
*/ | Return encapsulated object | getContainedItem | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/lists/hlapi/LengthHLAPI.java",
"license": "epl-1.0",
"size": 108262
} | [
"fr.lip6.move.pnml.hlpn.lists.Length"
] | import fr.lip6.move.pnml.hlpn.lists.Length; | import fr.lip6.move.pnml.hlpn.lists.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 379,202 |
public RexLiteral makeBinaryLiteral(ByteString byteString) {
return makeLiteral(
byteString,
typeFactory.createSqlType(SqlTypeName.BINARY, byteString.length()),
SqlTypeName.BINARY);
} | RexLiteral function(ByteString byteString) { return makeLiteral( byteString, typeFactory.createSqlType(SqlTypeName.BINARY, byteString.length()), SqlTypeName.BINARY); } | /**
* Creates a byte array literal.
*/ | Creates a byte array literal | makeBinaryLiteral | {
"repo_name": "mehant/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/rex/RexBuilder.java",
"license": "apache-2.0",
"size": 42908
} | [
"org.apache.calcite.avatica.util.ByteString",
"org.apache.calcite.sql.type.SqlTypeName"
] | import org.apache.calcite.avatica.util.ByteString; import org.apache.calcite.sql.type.SqlTypeName; | import org.apache.calcite.avatica.util.*; import org.apache.calcite.sql.type.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 1,643,917 |
@SuppressLint("NewApi")
private void postAnimationInvalidate() {
if (mScroller.computeScrollOffset()) {
final int oldX = (int) mOffsetPixels;
final int x = mScroller.getCurrX();
if (x != oldX) setOffsetPixels(x);
if (x != mScroller.getFinalX()) {
... | @SuppressLint(STR) void function() { if (mScroller.computeScrollOffset()) { final int oldX = (int) mOffsetPixels; final int x = mScroller.getCurrX(); if (x != oldX) setOffsetPixels(x); if (x != mScroller.getFinalX()) { postOnAnimation(mDragRunnable); return; } } completeAnimation(); } | /**
* Callback when each frame in the drawer animation should be drawn.
*/ | Callback when each frame in the drawer animation should be drawn | postAnimationInvalidate | {
"repo_name": "glustful/AFramework",
"path": "menudrawer/src/net/simonvt/menudrawer/DraggableDrawer.java",
"license": "apache-2.0",
"size": 19846
} | [
"android.annotation.SuppressLint"
] | import android.annotation.SuppressLint; | import android.annotation.*; | [
"android.annotation"
] | android.annotation; | 769,634 |
public BeaconObj getBeaconAt(Location location) {
if (location == null) {
return null;
}
Point2D point = new Point2D.Double(location.getBlockX(),location.getBlockZ());
//getLogger().info("DEBUG: " + point);
return baseBlocks.get(point);
} | BeaconObj function(Location location) { if (location == null) { return null; } Point2D point = new Point2D.Double(location.getBlockX(),location.getBlockZ()); return baseBlocks.get(point); } | /**
* Get the beacon associated with this location. World and Y coord is ignored.
* @param point
* @return beacon or null if it doesn't exist
*/ | Get the beacon associated with this location. World and Y coord is ignored | getBeaconAt | {
"repo_name": "ebaldino/beaconz",
"path": "src/main/java/com/wasteofplastic/beaconz/Register.java",
"license": "mit",
"size": 49817
} | [
"java.awt.geom.Point2D",
"org.bukkit.Location"
] | import java.awt.geom.Point2D; import org.bukkit.Location; | import java.awt.geom.*; import org.bukkit.*; | [
"java.awt",
"org.bukkit"
] | java.awt; org.bukkit; | 1,948,271 |
public void testMethodDeclaration05() throws CoreException { // was testMethodDeclarationInHierarchyScope2
IType type = getCompilationUnit("JSSearch", "src", "p", "X.js").getType("X");
IFunction method = type.getFunction("foo", new String[] {"I", "QString;", "QX;"});
search(
method,
DECLARATIONS,
SearchEngin... | void function() throws CoreException { IType type = getCompilationUnit(STR, "src", "p", "X.js").getType("X"); IFunction method = type.getFunction("foo", new String[] {"I", STR, "QX;"}); search( method, DECLARATIONS, SearchEngine.createHierarchyScope(type), this.resultCollector); assertSearchResults( STR + STR, this.res... | /**
* Method declaration in hierarchy that contains elements in external jar.
* (regression test for PR #1G2E4F1)
*/ | Method declaration in hierarchy that contains elements in external jar. (regression test for PR #1G2E4F1) | testMethodDeclaration05 | {
"repo_name": "echoes-tech/eclipse.jsdt.core",
"path": "org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaSearchTests.java",
"license": "epl-1.0",
"size": 120852
} | [
"org.eclipse.core.runtime.CoreException",
"org.eclipse.wst.jsdt.core.IFunction",
"org.eclipse.wst.jsdt.core.IType",
"org.eclipse.wst.jsdt.core.search.SearchEngine"
] | import org.eclipse.core.runtime.CoreException; import org.eclipse.wst.jsdt.core.IFunction; import org.eclipse.wst.jsdt.core.IType; import org.eclipse.wst.jsdt.core.search.SearchEngine; | import org.eclipse.core.runtime.*; import org.eclipse.wst.jsdt.core.*; import org.eclipse.wst.jsdt.core.search.*; | [
"org.eclipse.core",
"org.eclipse.wst"
] | org.eclipse.core; org.eclipse.wst; | 326,415 |
@Before
public void setUp() throws Exception {
dataFile = new File(hiveConf.get("test.data.files"), "kv1.txt");
client = miniHS2.getServiceClient();
sessionHandle = setupSession();
} | void function() throws Exception { dataFile = new File(hiveConf.get(STR), STR); client = miniHS2.getServiceClient(); sessionHandle = setupSession(); } | /**
* Open a session, and create a table for cases usage
*
* @throws Exception
*/ | Open a session, and create a table for cases usage | setUp | {
"repo_name": "alanfgates/hive",
"path": "itests/hive-unit/src/test/java/org/apache/hive/service/cli/operation/TestOperationLoggingLayout.java",
"license": "apache-2.0",
"size": 12060
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,426,086 |
@Override
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
SessionInfo info = (SessionInfo) o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getSessionId(), dataOut);
} | void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { SessionInfo info = (SessionInfo) o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, info.getSessionId(), dataOut); } | /**
* Write the booleans that this object uses to a BooleanStream
*/ | Write the booleans that this object uses to a BooleanStream | looseMarshal | {
"repo_name": "apache/activemq-openwire",
"path": "openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v7/SessionInfoMarshaller.java",
"license": "apache-2.0",
"size": 4222
} | [
"java.io.DataOutput",
"java.io.IOException",
"org.apache.activemq.openwire.codec.OpenWireFormat",
"org.apache.activemq.openwire.commands.SessionInfo"
] | import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.codec.OpenWireFormat; import org.apache.activemq.openwire.commands.SessionInfo; | import java.io.*; import org.apache.activemq.openwire.codec.*; import org.apache.activemq.openwire.commands.*; | [
"java.io",
"org.apache.activemq"
] | java.io; org.apache.activemq; | 406,658 |
@Test void testColumnNullability() {
final String sql = "select \"employee_id\", \"position_id\"\n"
+ "from \"foodmart\".\"employee\" limit 10";
CalciteAssert.model(FoodmartSchema.FOODMART_MODEL)
.query(sql)
.runs()
.returnsCount(10)
.typeIs("[employee_id INTEGER NOT NU... | @Test void testColumnNullability() { final String sql = STRemployee_id\STRposition_id\"\n" + STRfoodmart\".\"employee\STR; CalciteAssert.model(FoodmartSchema.FOODMART_MODEL) .query(sql) .runs() .returnsCount(10) .typeIs(STR); } | /** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-1572">[CALCITE-1572]
* JdbcSchema throws exception when detecting nullable columns</a>. */ | Test case for [CALCITE-1572] | testColumnNullability | {
"repo_name": "apache/calcite",
"path": "core/src/test/java/org/apache/calcite/test/JdbcAdapterTest.java",
"license": "apache-2.0",
"size": 51215
} | [
"org.apache.calcite.test.schemata.foodmart.FoodmartSchema",
"org.junit.jupiter.api.Test"
] | import org.apache.calcite.test.schemata.foodmart.FoodmartSchema; import org.junit.jupiter.api.Test; | import org.apache.calcite.test.schemata.foodmart.*; import org.junit.jupiter.api.*; | [
"org.apache.calcite",
"org.junit.jupiter"
] | org.apache.calcite; org.junit.jupiter; | 2,343,727 |
MatcherAssert.assertThat(
new FkRegex("/h[a-z]{2}", new TkEmpty()).route(
new RqFake("GET", "/hel?a=1")
).has(),
Matchers.is(true)
);
MatcherAssert.assertThat(
new FkRegex("/", new TkEmpty()).route(
new RqFake("PUT", "/?test... | MatcherAssert.assertThat( new FkRegex(STR, new TkEmpty()).route( new RqFake("GET", STR) ).has(), Matchers.is(true) ); MatcherAssert.assertThat( new FkRegex("/", new TkEmpty()).route( new RqFake("PUT", STR) ).has(), Matchers.is(true) ); } | /**
* FkRegex can match by regular expression.
* @throws IOException If some problem inside
*/ | FkRegex can match by regular expression | matchesByRegularExpression | {
"repo_name": "dalifreire/takes",
"path": "src/test/java/org/takes/facets/fork/FkRegexTest.java",
"license": "mit",
"size": 2499
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.takes.rq.RqFake",
"org.takes.tk.TkEmpty"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.takes.rq.RqFake; import org.takes.tk.TkEmpty; | import org.hamcrest.*; import org.takes.rq.*; import org.takes.tk.*; | [
"org.hamcrest",
"org.takes.rq",
"org.takes.tk"
] | org.hamcrest; org.takes.rq; org.takes.tk; | 2,335,435 |
public static List<DeepTokenRange> getSplitsBySize(
CassandraDeepJobConfig config) {
IPartitioner p = getPartitioner(config);
AbstractType tokenValidator = p.getTokenValidator();
Pair<Session, String> sessionWithHost = CassandraClientProvider
.getSession(config.... | static List<DeepTokenRange> function( CassandraDeepJobConfig config) { IPartitioner p = getPartitioner(config); AbstractType tokenValidator = p.getTokenValidator(); Pair<Session, String> sessionWithHost = CassandraClientProvider .getSession(config.getHost(), config, false); String query = new StringBuilder(STR) .append... | /**
* Returns the token ranges that will be mapped to Spark partitions.
*
* @param config the Deep configuration object.
* @return the list of computed token ranges.
*/ | Returns the token ranges that will be mapped to Spark partitions | getSplitsBySize | {
"repo_name": "Stratio/deep-spark",
"path": "deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java",
"license": "apache-2.0",
"size": 15922
} | [
"com.datastax.driver.core.ResultSet",
"com.datastax.driver.core.Row",
"com.datastax.driver.core.Session",
"com.stratio.deep.cassandra.config.CassandraDeepJobConfig",
"com.stratio.deep.commons.rdd.DeepTokenRange",
"com.stratio.deep.commons.utils.Pair",
"java.net.InetAddress",
"java.util.ArrayList",
"... | import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Row; import com.datastax.driver.core.Session; import com.stratio.deep.cassandra.config.CassandraDeepJobConfig; import com.stratio.deep.commons.rdd.DeepTokenRange; import com.stratio.deep.commons.utils.Pair; import java.net.InetAddress; import ja... | import com.datastax.driver.core.*; import com.stratio.deep.cassandra.config.*; import com.stratio.deep.commons.rdd.*; import com.stratio.deep.commons.utils.*; import java.net.*; import java.util.*; import org.apache.cassandra.db.marshal.*; import org.apache.cassandra.dht.*; | [
"com.datastax.driver",
"com.stratio.deep",
"java.net",
"java.util",
"org.apache.cassandra"
] | com.datastax.driver; com.stratio.deep; java.net; java.util; org.apache.cassandra; | 405,884 |
@Test
public void testSFRemoteInterface_get_set_boolean() throws Exception {
boolean originalValue = fejb1.getBooleanValue();
fejb1.setBooleanValue(!originalValue);
assertTrue("Set value test was unexpected value", fejb1.getBooleanValue() == !originalValue);
fejb1.setBooleanValue... | void function() throws Exception { boolean originalValue = fejb1.getBooleanValue(); fejb1.setBooleanValue(!originalValue); assertTrue(STR, fejb1.getBooleanValue() == !originalValue); fejb1.setBooleanValue(originalValue); assertTrue(STR, fejb1.getBooleanValue() == originalValue); } | /**
* (bmg01) Test Stateful remote get/set methods for boolean value.
*/ | (bmg01) Test Stateful remote get/set methods for boolean value | testSFRemoteInterface_get_set_boolean | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.ejbcontainer.legacy_fat/test-applications/EJB2XRemoteSpecWeb.war/src/com/ibm/ejb2x/base/spec/sfr/web/SFRemoteInterfaceMethodServlet.java",
"license": "epl-1.0",
"size": 13304
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,310,716 |
String getColumnText(MetricData data, int i);
| String getColumnText(MetricData data, int i); | /**
* Get the text of a column.
*
* @param data
* object storing the metrics data
* @param i
* which column's text to get
* @return text of that column.
*/ | Get the text of a column | getColumnText | {
"repo_name": "alovassy/titan.EclipsePlug-ins",
"path": "org.eclipse.titanium/src/org/eclipse/titanium/metrics/view/INode.java",
"license": "epl-1.0",
"size": 1370
} | [
"org.eclipse.titanium.metrics.MetricData"
] | import org.eclipse.titanium.metrics.MetricData; | import org.eclipse.titanium.metrics.*; | [
"org.eclipse.titanium"
] | org.eclipse.titanium; | 55,452 |
private String getText(SToken currNode) {
List<DataSourceSequence> sSequences = currNode.getGraph()
.getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION);
// only support one text for spanns
if (sSequences == null || sSequences.size() != 1) {
log.error("rst suppo... | String function(SToken currNode) { List<DataSourceSequence> sSequences = currNode.getGraph() .getOverlappedDataSourceSequence(currNode, SALT_TYPE.STEXT_OVERLAPPING_RELATION); if (sSequences == null sSequences.size() != 1) { log.error(STR); return null; } log.debug(STR, sSequences.toString()); if (sSequences.get(0).getD... | /**
* Gets the overlapping token as string from a node, which are direct dominated by this node.
*
* @param currNode
* @return is null, if there is no relation to a token, or there is more then one STEXT is
* overlapped by this node
*/ | Gets the overlapping token as string from a node, which are direct dominated by this node | getText | {
"repo_name": "korpling/ANNIS",
"path": "src/main/java/org/corpus_tools/annis/gui/visualizers/component/rst/RSTImpl.java",
"license": "apache-2.0",
"size": 23338
} | [
"java.util.List",
"org.corpus_tools.salt.common.STextualDS",
"org.corpus_tools.salt.common.SToken",
"org.corpus_tools.salt.util.DataSourceSequence"
] | import java.util.List; import org.corpus_tools.salt.common.STextualDS; import org.corpus_tools.salt.common.SToken; import org.corpus_tools.salt.util.DataSourceSequence; | import java.util.*; import org.corpus_tools.salt.common.*; import org.corpus_tools.salt.util.*; | [
"java.util",
"org.corpus_tools.salt"
] | java.util; org.corpus_tools.salt; | 762,379 |
protected void addTableNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_IndexExistsType_tableName_feature"),
getString("_UI_PropertyDescr... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getIndexExistsType_TableName(), true, false, false, ItemPropertyDesc... | /**
* This adds a property descriptor for the Table Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Table Name feature. | addTableNamePropertyDescriptor | {
"repo_name": "dzonekl/LiquibaseEditor",
"path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/IndexExistsTypeItemProvider.java",
"license": "mit",
"size": 8091
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.liquibase.xml.ns.dbchangelog.DbchangelogPackage"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage; | import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*; | [
"org.eclipse.emf",
"org.liquibase.xml"
] | org.eclipse.emf; org.liquibase.xml; | 1,397,064 |
public Method getSetter() {
return this.setter;
} | Method function() { return this.setter; } | /**
* Get the setter method associated with this field.
*
* @return field property setter method, or null if this field is a sub-field of a complex field
*/ | Get the setter method associated with this field | getSetter | {
"repo_name": "mmayorivera/jsimpledb",
"path": "src/java/org/jsimpledb/JSimpleField.java",
"license": "apache-2.0",
"size": 8329
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,024,877 |
public void write(DataOutput out) throws IOException {
// We don't care whether this bag was sorted or distinct because
// using the iterator to write it will guarantee those things come
// correctly. And on the other end there'll be no reason to waste
// time re-sorting or re-apply... | void function(DataOutput out) throws IOException { out.writeLong(size()); Iterator<Tuple> it = iterator(); while (it.hasNext()) { Tuple item = it.next(); item.write(out); } } | /**
* Write a bag's contents to disk.
* @param out DataOutput to write data to.
* @throws IOException (passes it on from underlying calls).
*/ | Write a bag's contents to disk | write | {
"repo_name": "kaituo/sedge",
"path": "trunk/src/org/apache/pig/data/NonSpillableDataBag.java",
"license": "mit",
"size": 8247
} | [
"java.io.DataOutput",
"java.io.IOException",
"java.util.Iterator"
] | import java.io.DataOutput; import java.io.IOException; import java.util.Iterator; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,556,741 |
public void fireStateChanged() {
ChangeEvent e = new ChangeEvent(this);
for (ChangeListener listener : listeners) {
listener.stateChanged(e);
}
}
| void function() { ChangeEvent e = new ChangeEvent(this); for (ChangeListener listener : listeners) { listener.stateChanged(e); } } | /**
* should be called whenever a field was updated
*/ | should be called whenever a field was updated | fireStateChanged | {
"repo_name": "aborg0/RapidMiner-Unuk",
"path": "src/com/rapidminer/gui/tools/dialogs/wizards/WizardStep.java",
"license": "agpl-3.0",
"size": 3620
} | [
"javax.swing.event.ChangeEvent",
"javax.swing.event.ChangeListener"
] | import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 158,448 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.