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 setConnectionValues(Alfresco alfresco, ConnectionValues values)
{
try
{
Person currentUser = alfresco.getCurrentUser();
values.setDisplayName(currentUser.getFirstName() + " " + currentUser.getLastName());
values.setProviderUserId(currentUser.getId(... | void function(Alfresco alfresco, ConnectionValues values) { try { Person currentUser = alfresco.getCurrentUser(); values.setDisplayName(currentUser.getFirstName() + " " + currentUser.getLastName()); values.setProviderUserId(currentUser.getId()); } catch (JsonParseException e) { throw new AlfrescoException(e.getMessage(... | /**
* Set connection values DisplayName, ProviderUserId
*
* @param alfresco - Alfresco Api client interface
* @param values - Spring Social Connection Values
*/ | Set connection values DisplayName, ProviderUserId | setConnectionValues | {
"repo_name": "Alfresco/spring-social-alfresco",
"path": "src/main/java/org/springframework/social/alfresco/connect/AlfrescoAdapter.java",
"license": "apache-2.0",
"size": 4806
} | [
"java.io.IOException",
"org.codehaus.jackson.JsonParseException",
"org.codehaus.jackson.map.JsonMappingException",
"org.springframework.social.alfresco.api.Alfresco",
"org.springframework.social.alfresco.api.entities.Person",
"org.springframework.social.alfresco.connect.exception.AlfrescoException",
"or... | import java.io.IOException; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.springframework.social.alfresco.api.Alfresco; import org.springframework.social.alfresco.api.entities.Person; import org.springframework.social.alfresco.connect.exception.Alfresco... | import java.io.*; import org.codehaus.jackson.*; import org.codehaus.jackson.map.*; import org.springframework.social.alfresco.api.*; import org.springframework.social.alfresco.api.entities.*; import org.springframework.social.alfresco.connect.exception.*; import org.springframework.social.connect.*; | [
"java.io",
"org.codehaus.jackson",
"org.springframework.social"
] | java.io; org.codehaus.jackson; org.springframework.social; | 996,664 |
if(event.getPlayer() == null || event.getMessage() == null
|| !configHandler.hashQuickMessage || event.isCancelled()) {
return;
} else if(event.getPlayer().getWorld() == null) {
return;
}
if(event.getMessage().charAt(0) != '#') {
return;... | if(event.getPlayer() == null event.getMessage() == null !configHandler.hashQuickMessage event.isCancelled()) { return; } else if(event.getPlayer().getWorld() == null) { return; } if(event.getMessage().charAt(0) != '#') { return; } boolean ours = false; Channel target = null; final String userTag = event.getMessage().sp... | /**
* Handle hashtag quick message events
*
* @param event
* - AsyncPlayerChatEvent that occurred
*/ | Handle hashtag quick message events | hashMessage | {
"repo_name": "Mitsugaru/WorldChannels",
"path": "src/com/mitsugaru/worldchannels/events/WChatListener.java",
"license": "gpl-3.0",
"size": 11765
} | [
"com.mitsugaru.worldchannels.chat.Channel"
] | import com.mitsugaru.worldchannels.chat.Channel; | import com.mitsugaru.worldchannels.chat.*; | [
"com.mitsugaru.worldchannels"
] | com.mitsugaru.worldchannels; | 1,857,687 |
protected ResourceLocation getEntityTexture(Entity p_110775_1_)
{
return this.getEntityTexture((EntityWolf)p_110775_1_);
} | ResourceLocation function(Entity p_110775_1_) { return this.getEntityTexture((EntityWolf)p_110775_1_); } | /**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/ | Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture | getEntityTexture | {
"repo_name": "Hexeption/Youtube-Hacked-Client-1.8",
"path": "minecraft/net/minecraft/client/renderer/entity/RenderWolf.java",
"license": "mit",
"size": 4772
} | [
"net.minecraft.entity.Entity",
"net.minecraft.entity.passive.EntityWolf",
"net.minecraft.util.ResourceLocation"
] | import net.minecraft.entity.Entity; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.ResourceLocation; | import net.minecraft.entity.*; import net.minecraft.entity.passive.*; import net.minecraft.util.*; | [
"net.minecraft.entity",
"net.minecraft.util"
] | net.minecraft.entity; net.minecraft.util; | 1,914,338 |
EAttribute getRedefineType_SchemaLocation(); | EAttribute getRedefineType_SchemaLocation(); | /**
* Returns the meta object for the attribute '{@link org.w3._2001.schema.RedefineType#getSchemaLocation <em>Schema Location</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Schema Location</em>'.
* @see org.w3._2001.schema.RedefineType#getSchemaLoca... | Returns the meta object for the attribute '<code>org.w3._2001.schema.RedefineType#getSchemaLocation Schema Location</code>'. | getRedefineType_SchemaLocation | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wps/src/org/w3/_2001/schema/SchemaPackage.java",
"license": "lgpl-2.1",
"size": 433240
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,878,556 |
public LinkedList<RCSNode> getBadList() {
RCSNode node;
int maxMalus;
int maxLatencyWeight;
int idOfMax;
LinkedList<RCSNode> badList = new LinkedList<RCSNode>();
for (int i = 0; i < nodeMap.size(); i++) {
maxMalus = 0;
maxLatencyWeight = 0;
idOfMax = -1;
for (Integer id : nodeMap.keySet()) {
... | LinkedList<RCSNode> function() { RCSNode node; int maxMalus; int maxLatencyWeight; int idOfMax; LinkedList<RCSNode> badList = new LinkedList<RCSNode>(); for (int i = 0; i < nodeMap.size(); i++) { maxMalus = 0; maxLatencyWeight = 0; idOfMax = -1; for (Integer id : nodeMap.keySet()) { node = nodeMap.get(id); if (!badList... | /**
* Returns the badlist. This list includes all nodes in order of their malus
*
* @return badlist
*/ | Returns the badlist. This list includes all nodes in order of their malus | getBadList | {
"repo_name": "r-kober/ReCaLys",
"path": "ReCaLys/src/de/upb/recalys/model/RCSGraph.java",
"license": "mit",
"size": 16858
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 964,261 |
public void sendClanChannelFull (ClanChannelEventContext packet);
| void function (ClanChannelEventContext packet); | /**
* Sends a full packet representing a clan chat channel
* @param packet The packet to send
*/ | Sends a full packet representing a clan chat channel | sendClanChannelFull | {
"repo_name": "itsgreco/VirtueRS3",
"path": "src/org/virtue/game/content/chat/SocialUser.java",
"license": "mit",
"size": 5578
} | [
"org.virtue.network.event.context.impl.out.ClanChannelEventContext"
] | import org.virtue.network.event.context.impl.out.ClanChannelEventContext; | import org.virtue.network.event.context.impl.out.*; | [
"org.virtue.network"
] | org.virtue.network; | 1,527,716 |
final IOService ioService = new IOService();
assertTrue(ioService.isNumber(new ByteArrayInputStream("1234567891234567891234567890".getBytes())));
} | final IOService ioService = new IOService(); assertTrue(ioService.isNumber(new ByteArrayInputStream(STR.getBytes()))); } | /**
* Test for the isNumber method, when stream contains an even number.
* @throws IOException - input/output exceptions.
*/ | Test for the isNumber method, when stream contains an even number | whenIsNumberGetsStreamWhichContainsAnEvenNumberThenReturnsTrue | {
"repo_name": "IvanBelyaev/ibelyaev",
"path": "chapter_005/src/test/java/ru/job4j/io/IOServiceTest.java",
"license": "apache-2.0",
"size": 2752
} | [
"java.io.ByteArrayInputStream",
"junit.framework.TestCase"
] | import java.io.ByteArrayInputStream; import junit.framework.TestCase; | import java.io.*; import junit.framework.*; | [
"java.io",
"junit.framework"
] | java.io; junit.framework; | 1,760,652 |
@Test
public void testDenseStaticTable() throws Throwable
{
createTable("CREATE TABLE %s (userid uuid PRIMARY KEY, firstname text, lastname text, age int) WITH COMPACT STORAGE");
UUID id1 = UUID.fromString("550e8400-e29b-41d4-a716-446655440000");
UUID id2 = UUID.fromString("f47... | void function() throws Throwable { createTable(STR); UUID id1 = UUID.fromString(STR); UUID id2 = UUID.fromString(STR); execute(STR, id1, "Frodo", STR, 32); execute(STR, STR, STR, 33, id2); assertRows(execute(STR, id1), row("Frodo", STR)); assertRows(execute(STR, id1), row(id1, 32, "Frodo", STR)); assertRows(execute(STR... | /**
* /**
* Creation and basic operations on a static table with compact storage,
* migrated from cql_tests.py:TestCQL.noncomposite_static_cf_test()
*/ | Creation and basic operations on a static table with compact storage, migrated from cql_tests.py:TestCQL.noncomposite_static_cf_test() | testDenseStaticTable | {
"repo_name": "driftx/cassandra",
"path": "test/unit/org/apache/cassandra/cql3/validation/operations/CompactStorageTest.java",
"license": "apache-2.0",
"size": 254767
} | [
"java.util.UUID"
] | import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 1,042,973 |
public void ensureNotClosed() throws SQLException {
if (closed)
throw new SQLException("Connection is closed.", SqlStateCode.CONNECTION_CLOSED);
} | void function() throws SQLException { if (closed) throw new SQLException(STR, SqlStateCode.CONNECTION_CLOSED); } | /**
* Ensures that connection is not closed.
*
* @throws SQLException If connection is closed.
*/ | Ensures that connection is not closed | ensureNotClosed | {
"repo_name": "shroman/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java",
"license": "apache-2.0",
"size": 56179
} | [
"java.sql.SQLException",
"org.apache.ignite.internal.processors.odbc.SqlStateCode"
] | import java.sql.SQLException; import org.apache.ignite.internal.processors.odbc.SqlStateCode; | import java.sql.*; import org.apache.ignite.internal.processors.odbc.*; | [
"java.sql",
"org.apache.ignite"
] | java.sql; org.apache.ignite; | 2,804,405 |
private void showAuthentication(PrintWriter pw, String identity, String email) {
pw.print("<html><body><h1>Identity</h1><p>");
pw.print(identity);
pw.print("</p><h1>Email</h1><p>");
pw.print(email==null ? "(null)" : email);
pw.print("</p></body></html>");
pw.flush();
} | void function(PrintWriter pw, String identity, String email) { pw.print(STR); pw.print(identity); pw.print(STR); pw.print(email==null ? STR : email); pw.print(STR); pw.flush(); } | /**
* Taken from org.expressme.openid.MainServlet
*/ | Taken from org.expressme.openid.MainServlet | showAuthentication | {
"repo_name": "GeoinformationSystems/geoportal-server",
"path": "geoportal/src/com/esri/gpt/framework/security/identity/open/OpenidConsumerServlet.java",
"license": "apache-2.0",
"size": 15453
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 1,794,506 |
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
VariantsPackage theVariantsPackage = (VariantsPackage)EPackage.Registry.INSTANCE.getEPackag... | void function() { if (isInitialized) return; isInitialized = true; setName(eNAME); setNsPrefix(eNS_PREFIX); setNsURI(eNS_URI); VariantsPackage theVariantsPackage = (VariantsPackage)EPackage.Registry.INSTANCE.getEPackage(VariantsPackage.eNS_URI); FlowcontrolPackage theFlowcontrolPackage = (FlowcontrolPackage)EPackage.Re... | /**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Complete the initialization of the package and its meta-model. This method is guarded to have no affect on any invocation but its first. | initializePackageContents | {
"repo_name": "jesusc/bento",
"path": "plugins/bento.language.bentocomp/src-gen/bento/language/bentocomp/core/impl/CorePackageImpl.java",
"license": "epl-1.0",
"size": 30674
} | [
"org.eclipse.emf.ecore.EPackage"
] | import org.eclipse.emf.ecore.EPackage; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,279,890 |
@SimpleProperty(category = PropertyCategory.BEHAVIOR)
public YailList Elements() {
return items;
} | @SimpleProperty(category = PropertyCategory.BEHAVIOR) YailList function() { return items; } | /**
* Elements property getter method
*
* @return a YailList representing the list of strings to be picked from
*/ | Elements property getter method | Elements | {
"repo_name": "E-Hon/appinventor-sources",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/ListView.java",
"license": "apache-2.0",
"size": 17689
} | [
"com.google.appinventor.components.annotations.PropertyCategory",
"com.google.appinventor.components.annotations.SimpleProperty",
"com.google.appinventor.components.runtime.util.YailList"
] | import com.google.appinventor.components.annotations.PropertyCategory; import com.google.appinventor.components.annotations.SimpleProperty; import com.google.appinventor.components.runtime.util.YailList; | import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.runtime.util.*; | [
"com.google.appinventor"
] | com.google.appinventor; | 1,951,398 |
public boolean post(Message message) {
return GSTBUS_API.gst_bus_post(this, message);
} | boolean function(Message message) { return GSTBUS_API.gst_bus_post(this, message); } | /**
* Posts a {@link Message} on this Bus.
*
* @param message the message to post.
* @return <tt>true</tt> if the message could be posted, <tt>false</tt> if
* the bus is flushing.
*/ | Posts a <code>Message</code> on this Bus | post | {
"repo_name": "gstreamer-java/gst1-java-core",
"path": "src/org/freedesktop/gstreamer/Bus.java",
"license": "lgpl-3.0",
"size": 34401
} | [
"org.freedesktop.gstreamer.message.Message"
] | import org.freedesktop.gstreamer.message.Message; | import org.freedesktop.gstreamer.message.*; | [
"org.freedesktop.gstreamer"
] | org.freedesktop.gstreamer; | 79,252 |
public void testCloning() {
Task t1 = new Task("T", new Date(1), new Date(2));
Task t2 = null;
try {
t2 = (Task) t1.clone();
}
catch (CloneNotSupportedException e) {
System.err.println("Failed to clone.");
}
assertTrue(t1 != t2);
... | void function() { Task t1 = new Task("T", new Date(1), new Date(2)); Task t2 = null; try { t2 = (Task) t1.clone(); } catch (CloneNotSupportedException e) { System.err.println(STR); } assertTrue(t1 != t2); assertTrue(t1.getClass() == t2.getClass()); assertTrue(t1.equals(t2)); } | /**
* Confirm that cloning works.
*/ | Confirm that cloning works | testCloning | {
"repo_name": "simeshev/parabuild-ci",
"path": "3rdparty/jfreechart0921/source/org/jfree/data/gantt/junit/TaskTests.java",
"license": "lgpl-3.0",
"size": 4441
} | [
"java.util.Date",
"org.jfree.data.gantt.Task"
] | import java.util.Date; import org.jfree.data.gantt.Task; | import java.util.*; import org.jfree.data.gantt.*; | [
"java.util",
"org.jfree.data"
] | java.util; org.jfree.data; | 469,869 |
public static <T> void verifyRequest(ApiResource.RequestMethod method, String path)
throws StripeException {
verifyRequest(method, path, null, null);
} | static <T> void function(ApiResource.RequestMethod method, String path) throws StripeException { verifyRequest(method, path, null, null); } | /**
* {@code params} and {@code options} defaults to {@code null}.
*
* @see BaseStripeTest#verifyRequest(ApiResource.RequestMethod, String, Map, RequestOptions)
*/ | params and options defaults to null | verifyRequest | {
"repo_name": "stripe/stripe-java",
"path": "src/test/java/com/stripe/BaseStripeTest.java",
"license": "mit",
"size": 18995
} | [
"com.stripe.exception.StripeException",
"com.stripe.net.ApiResource"
] | import com.stripe.exception.StripeException; import com.stripe.net.ApiResource; | import com.stripe.exception.*; import com.stripe.net.*; | [
"com.stripe.exception",
"com.stripe.net"
] | com.stripe.exception; com.stripe.net; | 340,453 |
@WXComponentProp(name = Constants.Name.MAXLENGTH)
@Deprecated
public void setMaxlength(int maxLength) {
setMaxLength(maxLength);
} | @WXComponentProp(name = Constants.Name.MAXLENGTH) void function(int maxLength) { setMaxLength(maxLength); } | /**
* Compatible with both 'max-length' and 'maxlength'
* @param maxLength
*/ | Compatible with both 'max-length' and 'maxlength' | setMaxlength | {
"repo_name": "acton393/weex",
"path": "android/sdk/src/main/java/com/taobao/weex/ui/component/AbstractEditComponent.java",
"license": "apache-2.0",
"size": 32692
} | [
"com.taobao.weex.common.Constants"
] | import com.taobao.weex.common.Constants; | import com.taobao.weex.common.*; | [
"com.taobao.weex"
] | com.taobao.weex; | 1,693,001 |
public static void removeAllNames(Model model,
org.ontoware.rdf2go.model.node.Resource instanceResource) {
Base.removeAll(model, instanceResource, NAME);
} | static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource) { Base.removeAll(model, instanceResource, NAME); } | /**
* Removes all values of property Name * @param model an RDF2Go model
*
* @param resource an RDF2Go resource [Generated from RDFReactor template
* rule #removeall1static]
*/ | Removes all values of property Name | removeAllNames | {
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java",
"license": "mit",
"size": 274766
} | [
"org.ontoware.rdf2go.model.Model",
"org.ontoware.rdfreactor.runtime.Base"
] | import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base; | import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*; | [
"org.ontoware.rdf2go",
"org.ontoware.rdfreactor"
] | org.ontoware.rdf2go; org.ontoware.rdfreactor; | 2,809,997 |
@Test(timeout = 100000)
public void testDecimalColumns() throws Exception {
Schema schema = createSchemaWithDecimalColumns();
syncClient.createTable(tableName, schema, createTableOptions());
KuduSession session = syncClient.newSession();
KuduTable table = syncClient.openTable(tableName);
// Ve... | @Test(timeout = 100000) void function() throws Exception { Schema schema = createSchemaWithDecimalColumns(); syncClient.createTable(tableName, schema, createTableOptions()); KuduSession session = syncClient.newSession(); KuduTable table = syncClient.openTable(tableName); assertEquals(DecimalUtil.MAX_DECIMAL128_PRECISIO... | /**
* Test inserting and retrieving decimal columns.
*/ | Test inserting and retrieving decimal columns | testDecimalColumns | {
"repo_name": "andrwng/kudu",
"path": "java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java",
"license": "apache-2.0",
"size": 49196
} | [
"java.math.BigDecimal",
"java.util.List",
"org.apache.kudu.Schema",
"org.apache.kudu.util.DecimalUtil",
"org.junit.Assert",
"org.junit.Test"
] | import java.math.BigDecimal; import java.util.List; import org.apache.kudu.Schema; import org.apache.kudu.util.DecimalUtil; import org.junit.Assert; import org.junit.Test; | import java.math.*; import java.util.*; import org.apache.kudu.*; import org.apache.kudu.util.*; import org.junit.*; | [
"java.math",
"java.util",
"org.apache.kudu",
"org.junit"
] | java.math; java.util; org.apache.kudu; org.junit; | 2,615,015 |
@ApiModelProperty(value = "Requested disk size in gigabytes (GB)")
public Double getDiskGb() {
return diskGb;
} | @ApiModelProperty(value = STR) Double function() { return diskGb; } | /**
* Requested disk size in gigabytes (GB)
* @return diskGb
**/ | Requested disk size in gigabytes (GB) | getDiskGb | {
"repo_name": "nextflow-io/nextflow",
"path": "plugins/nf-ga4gh/src/main/nextflow/ga4gh/tes/client/model/TesResources.java",
"license": "apache-2.0",
"size": 5589
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 426,275 |
public static List<String> left(final String str, final int n) {
List<String> result = new ArrayList<String>();
String [] rawLines = str.split("\n");
for (int i = 0; i < rawLines.length; i++) {
StringBuilder line = new StringBuilder();
StringBuilder word = n... | static List<String> function(final String str, final int n) { List<String> result = new ArrayList<String>(); String [] rawLines = str.split("\n"); for (int i = 0; i < rawLines.length; i++) { StringBuilder line = new StringBuilder(); StringBuilder word = new StringBuilder(); boolean inWord = false; for (int j = 0; j < r... | /**
* Left-justify a string into a list of lines.
*
* @param str the string
* @param n the maximum number of characters in a line
* @return the list of lines
*/ | Left-justify a string into a list of lines | left | {
"repo_name": "klamonte/jexer",
"path": "src/jexer/bits/StringUtils.java",
"license": "mit",
"size": 27559
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,190,653 |
public static void put(Writer writer, Character value) throws IOException {
if (value == null) {
writer.write("null");
} else {
writer.write("\"");
writer.write(sanitize(value));
writer.write("\"");
}
} | static void function(Writer writer, Character value) throws IOException { if (value == null) { writer.write("null"); } else { writer.write("\"STR\""); } } | /**
* Writes the given value with the given writer, sanitizing with {@link #sanitize(String)} as a valid JSON-formatted data.
* @param writer
* @param value
* @throws IOException
* @author vvakame
*/ | Writes the given value with the given writer, sanitizing with <code>#sanitize(String)</code> as a valid JSON-formatted data | put | {
"repo_name": "vvakame/JsonPullParser",
"path": "jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonUtil.java",
"license": "apache-2.0",
"size": 15827
} | [
"java.io.IOException",
"java.io.Writer"
] | import java.io.IOException; import java.io.Writer; | import java.io.*; | [
"java.io"
] | java.io; | 315,887 |
@Test
public void testPoolSizeInitializationOnEmptyPool() throws CloudPoolException {
// set up mocked responses
when(this.driverMock.listMachines()).thenReturn(machines());
// run test
this.cloudPool.configure(poolConfig(OLDEST_INSTANCE, 0));
this.cloudPool.start();
... | void function() throws CloudPoolException { when(this.driverMock.listMachines()).thenReturn(machines()); this.cloudPool.configure(poolConfig(OLDEST_INSTANCE, 0)); this.cloudPool.start(); assertThat(this.cloudPool.getPoolSize().getDesiredSize(), is(0)); } | /**
* Verify that the initial pool size is correctly determined on an empty
* cloud pool.
*/ | Verify that the initial pool size is correctly determined on an empty cloud pool | testPoolSizeInitializationOnEmptyPool | {
"repo_name": "Eeemil/scale.cloudpool",
"path": "commons/src/test/java/com/elastisys/scale/cloudpool/commons/basepool/TestBaseCloudPoolOperation.java",
"license": "apache-2.0",
"size": 66833
} | [
"com.elastisys.scale.cloudpool.api.CloudPoolException",
"org.hamcrest.CoreMatchers",
"org.junit.Assert",
"org.mockito.Mockito"
] | import com.elastisys.scale.cloudpool.api.CloudPoolException; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.mockito.Mockito; | import com.elastisys.scale.cloudpool.api.*; import org.hamcrest.*; import org.junit.*; import org.mockito.*; | [
"com.elastisys.scale",
"org.hamcrest",
"org.junit",
"org.mockito"
] | com.elastisys.scale; org.hamcrest; org.junit; org.mockito; | 862,364 |
public Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) {
if (this.client.subscriptionId() == null) {
... | Observable<ServiceResponse<ThroughputSettingsGetResultsInner>> function(String resourceGroupName, String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null... | /**
* Update RUs per second of the an Azure Cosmos DB MongoDB database.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Cosmos DB database account name.
* @param databaseName Cosmos DB database name.
* @param updateThroughputParameters The RUs per second ... | Update RUs per second of the an Azure Cosmos DB MongoDB database | beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/MongoDBResourcesInner.java",
"license": "mit",
"size": 123637
} | [
"com.microsoft.azure.management.cosmosdb.v2019_12_12.ThroughputSettingsUpdateParameters",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.management.cosmosdb.v2019_12_12.ThroughputSettingsUpdateParameters; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.management.cosmosdb.v2019_12_12.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,268,000 |
private void createDrf(OplogFile prevOlf) throws IOException {
File f = new File(this.diskFile.getPath() + DRF_FILE_EXT);
this.drf.f = f;
if (logger.isDebugEnabled()) {
logger.debug("Creating operation log file {}", f);
}
preblow(this.drf, getMaxDrfSize());
this.drf.raf = new Uninterrupt... | void function(OplogFile prevOlf) throws IOException { File f = new File(this.diskFile.getPath() + DRF_FILE_EXT); this.drf.f = f; if (logger.isDebugEnabled()) { logger.debug(STR, f); } preblow(this.drf, getMaxDrfSize()); this.drf.raf = new UninterruptibleRandomAccessFile(f, SYNC_WRITES ? "rwd" : "rw"); this.drf.RAFClose... | /**
* Creates the drf oplog file
*/ | Creates the drf oplog file | createDrf | {
"repo_name": "masaki-yamakawa/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/Oplog.java",
"license": "apache-2.0",
"size": 283772
} | [
"java.io.File",
"java.io.IOException",
"org.apache.geode.internal.cache.persistence.UninterruptibleRandomAccessFile"
] | import java.io.File; import java.io.IOException; import org.apache.geode.internal.cache.persistence.UninterruptibleRandomAccessFile; | import java.io.*; import org.apache.geode.internal.cache.persistence.*; | [
"java.io",
"org.apache.geode"
] | java.io; org.apache.geode; | 2,278,770 |
@JsonProperty("contracts")
public void setContracts(final Set<Contract> contracts) {
this.contracts = contracts;
} | @JsonProperty(STR) void function(final Set<Contract> contracts) { this.contracts = contracts; } | /**
* Contracts
* <p>
* Information from the contract creation phase of the procurement process.
*
* @param contracts
* The contracts
*/ | Contracts Information from the contract creation phase of the procurement process | setContracts | {
"repo_name": "devgateway/ocvn",
"path": "persistence-mongodb/src/main/java/org/devgateway/ocds/persistence/mongo/Release.java",
"license": "mit",
"size": 18384
} | [
"com.fasterxml.jackson.annotation.JsonProperty",
"java.util.Set"
] | import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Set; | import com.fasterxml.jackson.annotation.*; import java.util.*; | [
"com.fasterxml.jackson",
"java.util"
] | com.fasterxml.jackson; java.util; | 1,309,753 |
private static native void setErrUnsecure(PrintStream err);
| static native void function(PrintStream err); | /**
* Sets the value of <code>err</code> field without any security checks
*/ | Sets the value of <code>err</code> field without any security checks | setErrUnsecure | {
"repo_name": "shannah/cn1",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/drlvm/vm/vmcore/src/kernel_classes/javasrc/java/lang/System.java",
"license": "gpl-2.0",
"size": 12667
} | [
"java.io.PrintStream"
] | import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,974,665 |
@DesugarSupportedApi
public static DoubleStream stream(double[] array, int startInclusive, int endExclusive) {
return StreamSupport.doubleStream(spliterator(array, startInclusive, endExclusive), false);
}
// Comparison methods
// Compare boolean | static DoubleStream function(double[] array, int startInclusive, int endExclusive) { return StreamSupport.doubleStream(spliterator(array, startInclusive, endExclusive), false); } | /**
* Returns a sequential {@link DoubleStream} with the specified range of the
* specified array as its source.
*
* @param array the array, assumed to be unmodified during use
* @param startInclusive the first index to cover, inclusive
* @param endExclusive index immediately past the last... | Returns a sequential <code>DoubleStream</code> with the specified range of the specified array as its source | stream | {
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/java.base/share/classes/java/util/Arrays.java",
"license": "gpl-2.0",
"size": 403169
} | [
"java.util.stream.DoubleStream",
"java.util.stream.StreamSupport"
] | import java.util.stream.DoubleStream; import java.util.stream.StreamSupport; | import java.util.stream.*; | [
"java.util"
] | java.util; | 18,881 |
public long getNonHeapMemMax() {
return ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getMax();
} | long function() { return ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage().getMax(); } | /**
* Method description
*
*
* @return a value of <code>long</code>
*/ | Method description | getNonHeapMemMax | {
"repo_name": "amikey/tigase-server",
"path": "src/main/java/tigase/sys/TigaseRuntime.java",
"license": "agpl-3.0",
"size": 10230
} | [
"java.lang.management.ManagementFactory"
] | import java.lang.management.ManagementFactory; | import java.lang.management.*; | [
"java.lang"
] | java.lang; | 2,505,214 |
protected TypeParameter handleParameterDeclaration(String parameterString) {
String[] paramComponents = parameterString.split("\\s+");
if(paramComponents.length == 1) {
return new TypeParameter(StringUtils.trim(parameterString), TypeParameter.TypeParameterConstraint.NONE, null);
... | TypeParameter function(String parameterString) { String[] paramComponents = parameterString.split("\\s+"); if(paramComponents.length == 1) { return new TypeParameter(StringUtils.trim(parameterString), TypeParameter.TypeParameterConstraint.NONE, null); } else if(paramComponents.length == 3) { if(paramComponents[1].equal... | /**
* Method handles a generic parameter declaration such as T, or T extends MyType.
*
* @param parameterString
* @return Type parameter for this parameter for this string declaration.
*/ | Method handles a generic parameter declaration such as T, or T extends MyType | handleParameterDeclaration | {
"repo_name": "cqframework/clinical_quality_language",
"path": "Src/java/model/src/main/java/org/hl7/cql/model/GenericClassSignatureParser.java",
"license": "apache-2.0",
"size": 14070
} | [
"org.apache.commons.lang3.StringUtils"
] | import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 114,741 |
public Set<String> getCodes() {
Set<String> result;
result = new HashSet<>();
for (final Transaction t: this) {
result.addAll(t.keys());
}
return result;
} | Set<String> function() { Set<String> result; result = new HashSet<>(); for (final Transaction t: this) { result.addAll(t.keys()); } return result; } | /**
* Returns the codes from all transactions.
*
* @return the codes
*/ | Returns the codes from all transactions | getCodes | {
"repo_name": "fracpete/quicken4j",
"path": "src/main/java/com/github/fracpete/quicken4j/Transactions.java",
"license": "gpl-3.0",
"size": 1762
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 355,586 |
@Override
public void setPackageReadable(@NonNull final String packageId, boolean readable) {
packagesRepository.setPackageReadable(packageId, readable);
loadPackages();
} | void function(@NonNull final String packageId, boolean readable) { packagesRepository.setPackageReadable(packageId, readable); loadPackages(); } | /**
* Set a specific package's read-status, readable or unreadable,
* which means the data is or not brand new.
* @param packageId The package number.
* @param readable Readable or unreadable(New or dated).
*/ | Set a specific package's read-status, readable or unreadable, which means the data is or not brand new | setPackageReadable | {
"repo_name": "TonnyL/Espresso",
"path": "app/src/main/java/io/github/marktony/espresso/mvp/packages/PackagesPresenter.java",
"license": "apache-2.0",
"size": 10462
} | [
"android.support.annotation.NonNull"
] | import android.support.annotation.NonNull; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 1,002,875 |
@SafeVarargs
public static <E> NonEmptyList<E> of(E firstElement, E ... remainingElements) {
return of(firstElement, asList(remainingElements));
} | static <E> NonEmptyList<E> function(E firstElement, E ... remainingElements) { return of(firstElement, asList(remainingElements)); } | /**
* Construct a non-empty list containing a specific object as its
* first element, and any provided remaining elements.
*
* @param <E> the type of the elements
* @param firstElement the first element to include
* @param remainingElements the remaining elements to include
*
* @... | Construct a non-empty list containing a specific object as its first element, and any provided remaining elements | of | {
"repo_name": "digipost/digg",
"path": "src/main/java/no/digipost/collection/NonEmptyList.java",
"license": "apache-2.0",
"size": 11239
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 530,522 |
@Override
public Views getViews() {
return SiteStatusViewsFactory.getConfig().getViews();
} | Views function() { return SiteStatusViewsFactory.getConfig().getViews(); } | /**
* Use this method to get the generated Views class generated by the XSD.
*
* @return a {@link org.opennms.netmgt.config.siteStatusViews.Views} object.
*/ | Use this method to get the generated Views class generated by the XSD | getViews | {
"repo_name": "tdefilip/opennms",
"path": "opennms-dao/src/main/java/org/opennms/netmgt/dao/castor/DefaultSiteStatusViewConfigDao.java",
"license": "agpl-3.0",
"size": 4318
} | [
"org.opennms.netmgt.config.siteStatusViews.Views"
] | import org.opennms.netmgt.config.siteStatusViews.Views; | import org.opennms.netmgt.config.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 1,541,898 |
public Person generatePerson()
{
Person person = new PersonJpaImpl();
//person.setPartyType(partyTypeCache.getPersonType());
PersonNameUtil nameUtil = PersonNameUtil.getInstance();
int lastRandom = new Random().nextInt(nameUtil.getLastNames().size());
person.setL... | Person function() { Person person = new PersonJpaImpl(); PersonNameUtil nameUtil = PersonNameUtil.getInstance(); int lastRandom = new Random().nextInt(nameUtil.getLastNames().size()); person.setLastName((String)nameUtil.getLastNames().get(lastRandom)); if (new Random().nextInt(1) > 0) { int femaleRandom = new Random().... | /**
* generate person
*
* @return
*/ | generate person | generatePerson | {
"repo_name": "christopher-worley/common-app",
"path": "object-mock/src/main/java/core/test/server/mock/party/PartyMock.java",
"license": "lgpl-3.0",
"size": 3916
} | [
"java.util.Random"
] | import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 51,467 |
@RolesAllowed(value = {"ROLE_ADMIN", "ROLE_USER", "ROLE_ADMINISTRATIVE"})
@RequestMapping(value = "/search", method = RequestMethod.GET)
public void getSearchMedical(String filter, String sort, Integer limit, Integer start, Model model) {
List<Medical> lmedical;
ExtjsStore aux = new ExtjsSt... | @RolesAllowed(value = {STR, STR, STR}) @RequestMapping(value = STR, method = RequestMethod.GET) void function(String filter, String sort, Integer limit, Integer start, Model model) { List<Medical> lmedical; ExtjsStore aux = new ExtjsStore(); try { GridRequest grequest = GridRequestFactory.parse(sort, start, limit, filt... | /**
* Search a list of users by params
*
* @param filter Filter conditions of results. Set in JSON by an array of
* FilterRequestPriv
* @param sort Order of results. Set in JSON by an array of OrderByRequest
* @param limit Set the limit of the results. Use it for pagination
* @param s... | Search a list of users by params | getSearchMedical | {
"repo_name": "abada-investigacion/cleia",
"path": "cleia/cleia-rest/src/main/java/com/abada/cleia/rest/medical/MedicalController.java",
"license": "gpl-3.0",
"size": 12065
} | [
"com.abada.cleia.entity.user.Medical",
"com.abada.cleia.entity.user.Views",
"com.abada.extjs.ExtjsStore",
"com.abada.springframework.web.servlet.command.extjs.gridpanel.GridRequest",
"com.abada.springframework.web.servlet.command.extjs.gridpanel.factory.GridRequestFactory",
"com.abada.springframework.web.... | import com.abada.cleia.entity.user.Medical; import com.abada.cleia.entity.user.Views; import com.abada.extjs.ExtjsStore; import com.abada.springframework.web.servlet.command.extjs.gridpanel.GridRequest; import com.abada.springframework.web.servlet.command.extjs.gridpanel.factory.GridRequestFactory; import com.abada.spr... | import com.abada.cleia.entity.user.*; import com.abada.extjs.*; import com.abada.springframework.web.servlet.command.extjs.gridpanel.*; import com.abada.springframework.web.servlet.command.extjs.gridpanel.factory.*; import com.abada.springframework.web.servlet.view.*; import java.util.*; import javax.annotation.securit... | [
"com.abada.cleia",
"com.abada.extjs",
"com.abada.springframework",
"java.util",
"javax.annotation",
"org.springframework.ui",
"org.springframework.web"
] | com.abada.cleia; com.abada.extjs; com.abada.springframework; java.util; javax.annotation; org.springframework.ui; org.springframework.web; | 665,999 |
public static double sum(@NotNull Number n1, @NotNull Number n2) {
return n1.doubleValue() + n2.doubleValue();
} | static double function(@NotNull Number n1, @NotNull Number n2) { return n1.doubleValue() + n2.doubleValue(); } | /**
* Get the sum of two {@link Number}.
* @param n1 {@link Number} instance.
* @param n2 {@link Number} instance.
* @return {@link Double} value.
*/ | Get the sum of two <code>Number</code> | sum | {
"repo_name": "protoman92/JavaUtilities",
"path": "src/main/java/org/swiften/javautilities/number/HNumbers.java",
"license": "apache-2.0",
"size": 3448
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,245,857 |
@Method(selector = "createPullQueue:description:completionBlock:")
public native void createPullQueue(String queueName, String queueDescription, @Block App42ResponseBlock completionBlock);
| @Method(selector = STR) native void function(String queueName, String queueDescription, @Block App42ResponseBlock completionBlock); | /**
* Creates a type Pull Queue
*
* @param queueName
* - The name of the queue which has to be created
* @param queueDescription
* - The description of the queue
*
* @return Queue object containing queue name which has been created
*
*/ | Creates a type Pull Queue | createPullQueue | {
"repo_name": "mariamKh/robovm-ios-bindings",
"path": "app42/src/org/robovm/bindings/app42/QueueService.java",
"license": "apache-2.0",
"size": 5228
} | [
"org.robovm.objc.annotation.Block",
"org.robovm.objc.annotation.Method"
] | import org.robovm.objc.annotation.Block; import org.robovm.objc.annotation.Method; | import org.robovm.objc.annotation.*; | [
"org.robovm.objc"
] | org.robovm.objc; | 1,632,590 |
public void testStrutsCookbookViewSource() throws Exception {
WebClient webClient = new WebClient();
URL url = new URL("http://localhost:"
+ port + "/struts-cookbook-" + version + "/source.jsp"
+ "?src=/WEB-INF/src/java/examples/SuccessAction.java");
HtmlPage ... | void function() throws Exception { WebClient webClient = new WebClient(); URL url = new URL(STR/struts-cookbook-STR/source.jspSTR?src=/WEB-INF/src/java/examples/SuccessAction.javaSTRView Source", page.getTitleText()); } | /**
* Verify that the view source function is working
* in the Struts Cookbook app.
*/ | Verify that the view source function is working in the Struts Cookbook app | testStrutsCookbookViewSource | {
"repo_name": "shuliangtao/struts-1.3.10",
"path": "src/integration/apps-it/src/test/java/org/apache/struts/apps/AppsTest.java",
"license": "apache-2.0",
"size": 5912
} | [
"com.gargoylesoftware.htmlunit.WebClient"
] | import com.gargoylesoftware.htmlunit.WebClient; | import com.gargoylesoftware.htmlunit.*; | [
"com.gargoylesoftware.htmlunit"
] | com.gargoylesoftware.htmlunit; | 523,771 |
public Result ifContainsNot(String pattern)
{
return isFalse("pattern '" + pattern + "' found",
getLastResponseAsString().matches("(?s).*" + pattern + ".*"));
}
/**
* assert the model of {@link ListView} use expectedList
*
* @param path
* path to {@link ListView} component
* @param expe... | Result function(String pattern) { return isFalse(STR + pattern + STR, getLastResponseAsString().matches(STR + pattern + ".*")); } /** * assert the model of {@link ListView} use expectedList * * @param path * path to {@link ListView} component * @param expectedList * expected list in the model of {@link ListView} | /**
* assert the content of last rendered page contains(matches) regex pattern.
*
* @param pattern
* reqex pattern to match
* @return a <code>Result</code>
*/ | assert the content of last rendered page contains(matches) regex pattern | ifContainsNot | {
"repo_name": "selckin/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java",
"license": "apache-2.0",
"size": 86041
} | [
"org.apache.wicket.markup.html.list.ListView"
] | import org.apache.wicket.markup.html.list.ListView; | import org.apache.wicket.markup.html.list.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 1,070,841 |
private double query(double quantile) {
if (samples.isEmpty()) {
throw new IllegalStateException("no data in estimator");
}
int rankMin = 0;
int desired = (int) (quantile * count);
ListIterator<SampleItem> it = samples.listIterator();
SampleItem next = ... | double function(double quantile) { if (samples.isEmpty()) { throw new IllegalStateException(STR); } int rankMin = 0; int desired = (int) (quantile * count); ListIterator<SampleItem> it = samples.listIterator(); SampleItem next = it.next(); for (int i = 1; i < samples.size(); i++) { final SampleItem prev = next; next = ... | /**
* Get the estimated value at the specified quantile.
*
* @param quantile Queried quantile, e.g. 0.50 or 0.99.
* @return Estimated value at that quantile.
*/ | Get the estimated value at the specified quantile | query | {
"repo_name": "udoprog/heroic",
"path": "aggregation/simple/src/main/java/com/spotify/heroic/aggregation/simple/QuantileBucket.java",
"license": "apache-2.0",
"size": 8359
} | [
"java.util.ListIterator"
] | import java.util.ListIterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,111,232 |
public static final Point2D getOrthoLeft(final Point2D a) {
return new Point2D.Double(-a.getY(), a.getX());
} | static final Point2D function(final Point2D a) { return new Point2D.Double(-a.getY(), a.getX()); } | /**
* Generates a vector that forms an angle of {@code 90} degrees with the
* given vector.
*
* @param a
* The given vector.
* @return The orthogonal vector of the left side.
*/ | Generates a vector that forms an angle of 90 degrees with the given vector | getOrthoLeft | {
"repo_name": "Caleydo/caleydo",
"path": "org.caleydo.util.bubblesets/src/setvis/VecUtil.java",
"license": "bsd-3-clause",
"size": 7287
} | [
"java.awt.geom.Point2D"
] | import java.awt.geom.Point2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 812,778 |
public static ims.clinical.domain.objects.SummaryClinicalInformation extractSummaryClinicalInformation(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.SummaryClinicalInformationVo valueObject)
{
return extractSummaryClinicalInformation(domainFactory, valueObject, new HashMap());
}
| static ims.clinical.domain.objects.SummaryClinicalInformation function(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.SummaryClinicalInformationVo valueObject) { return extractSummaryClinicalInformation(domainFactory, valueObject, new HashMap()); } | /**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/ | Create the domain object from the value object | extractSummaryClinicalInformation | {
"repo_name": "IMS-MAXIMS/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/SummaryClinicalInformationVoAssembler.java",
"license": "agpl-3.0",
"size": 20354
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,704,842 |
public static boolean isEditableRequest(ServletRequest req) {
boolean result = true;
if (CmsHistoryResourceHandler.isHistoryRequest(req) || CmsJspTagEditable.isDirectEditDisabled(req)) {
// don't display direct edit buttons on an historical resource
result = false;
}... | static boolean function(ServletRequest req) { boolean result = true; if (CmsHistoryResourceHandler.isHistoryRequest(req) CmsJspTagEditable.isDirectEditDisabled(req)) { result = false; } else { CmsFlexController controller = CmsFlexController.getController(req); CmsObject cms = controller.getCmsObject(); result = !cms.g... | /**
* Checks if the current request should be direct edit enabled.
* Online-, history-requests and temporary files will not be editable.
*
* @param req the servlet request
*
* @return <code>true</code> if the current request should be direct edit enabled
*/ | Checks if the current request should be direct edit enabled. Online-, history-requests and temporary files will not be editable | isEditableRequest | {
"repo_name": "it-tavis/opencms-core",
"path": "src/org/opencms/jsp/CmsJspTagEditable.java",
"license": "lgpl-2.1",
"size": 21156
} | [
"javax.servlet.ServletRequest",
"org.opencms.file.CmsObject",
"org.opencms.file.CmsResource",
"org.opencms.file.history.CmsHistoryResourceHandler",
"org.opencms.flex.CmsFlexController"
] | import javax.servlet.ServletRequest; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.file.history.CmsHistoryResourceHandler; import org.opencms.flex.CmsFlexController; | import javax.servlet.*; import org.opencms.file.*; import org.opencms.file.history.*; import org.opencms.flex.*; | [
"javax.servlet",
"org.opencms.file",
"org.opencms.flex"
] | javax.servlet; org.opencms.file; org.opencms.flex; | 1,398,475 |
public ServiceCall getBooleanInvalidStringAsync(final ServiceCallback<Map<String, Boolean>> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
} | ServiceCall function(final ServiceCallback<Map<String, Boolean>> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException(STR); } | /**
* Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/ | Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}' | getBooleanInvalidStringAsync | {
"repo_name": "John-Hart/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java",
"license": "mit",
"size": 172079
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"java.util.Map"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import java.util.Map; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 2,322,836 |
public static byte[] readBytes(DataInputStream stream, int size) throws IOException {
byte[] buf = new byte[size];
int toRead = size;
int done = 0;
while (toRead > 0) {
int read = stream.read(buf, done, toRead);
if (read == -1) {
throw new IOException();
... | static byte[] function(DataInputStream stream, int size) throws IOException { byte[] buf = new byte[size]; int toRead = size; int done = 0; while (toRead > 0) { int read = stream.read(buf, done, toRead); if (read == -1) { throw new IOException(); } done += read; toRead -= read; } return buf; } | /**
* Read a number of bytes or throw.
*
* @param size The number of bytes read
* @return The array of bytes read.
* @throws IOException
*/ | Read a number of bytes or throw | readBytes | {
"repo_name": "kryptohash/kryptohash-android",
"path": "app/src/main/java/com/github/kryptohash/kryptohashj/core/BitUtils.java",
"license": "gpl-3.0",
"size": 6956
} | [
"java.io.DataInputStream",
"java.io.IOException"
] | import java.io.DataInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,822,500 |
@Test
public void assertThatInterfacesWorks() throws Exception {
final PrepareForTestExtractorImpl tested = new PrepareForTestExtractorImpl();
final Set<String> hashSet = new HashSet<String>();
Whitebox.invokeMethod(tested, "addClassHierarchy", hashSet, Serializable.class);
... | void function() throws Exception { final PrepareForTestExtractorImpl tested = new PrepareForTestExtractorImpl(); final Set<String> hashSet = new HashSet<String>(); Whitebox.invokeMethod(tested, STR, hashSet, Serializable.class); assertEquals(1, hashSet.size()); assertEquals(Serializable.class.getName(), hashSet.iterato... | /**
* Makes sure that issue <a
* href="http://code.google.com/p/powermock/issues/detail?id=81">81</a> is
* solved.
*/ | Makes sure that issue 81 is solved | assertThatInterfacesWorks | {
"repo_name": "573196010/powermock",
"path": "core/src/test/java/org/powermock/tests/utils/impl/PrepareForTestExtractorImplTest.java",
"license": "apache-2.0",
"size": 3440
} | [
"java.io.Serializable",
"java.util.HashSet",
"java.util.Set",
"org.junit.Assert",
"org.powermock.reflect.Whitebox"
] | import java.io.Serializable; import java.util.HashSet; import java.util.Set; import org.junit.Assert; import org.powermock.reflect.Whitebox; | import java.io.*; import java.util.*; import org.junit.*; import org.powermock.reflect.*; | [
"java.io",
"java.util",
"org.junit",
"org.powermock.reflect"
] | java.io; java.util; org.junit; org.powermock.reflect; | 2,670,179 |
public static LocalLogSession newSession(@NonNull final Context context,
@NonNull final Uri authority,
@NonNull final String key, @NonNull final String name) {
final Uri uri = authority.buildUpon()
.appendEncodedPath(LogContract.Session.SESSION_CONTENT_DIRECTORY)
.appendEncodedPath(... | static LocalLogSession function(@NonNull final Context context, @NonNull final Uri authority, @NonNull final String key, @NonNull final String name) { final Uri uri = authority.buildUpon() .appendEncodedPath(LogContract.Session.SESSION_CONTENT_DIRECTORY) .appendEncodedPath(LogContract.Session.KEY_CONTENT_DIRECTORY) .ap... | /**
* Creates new logger session. Must be created before appending log entries.
* If the nRF Logger application is not installed the method will return <code>null</code>.
*
* @param context
* the context (activity, service or application)
* @param authority
* the {@link LocalLogCont... | Creates new logger session. Must be created before appending log entries. If the nRF Logger application is not installed the method will return <code>null</code> | newSession | {
"repo_name": "NordicSemiconductor/nRF-Logger-API",
"path": "log/src/main/java/no/nordicsemi/android/log/LocalLogSession.java",
"license": "bsd-3-clause",
"size": 4849
} | [
"android.content.ContentValues",
"android.content.Context",
"android.net.Uri",
"android.util.Log",
"androidx.annotation.NonNull"
] | import android.content.ContentValues; import android.content.Context; import android.net.Uri; import android.util.Log; import androidx.annotation.NonNull; | import android.content.*; import android.net.*; import android.util.*; import androidx.annotation.*; | [
"android.content",
"android.net",
"android.util",
"androidx.annotation"
] | android.content; android.net; android.util; androidx.annotation; | 1,272,251 |
ConcurrentMap<? extends Object, ? extends Object> getCache(String containerName, String cacheName); | ConcurrentMap<? extends Object, ? extends Object> getCache(String containerName, String cacheName); | /**
* Method that will retrieve and return the handle to modify a
* data structire distributed via clustering services. The
* datastructure shall already have been created else a null
* reference will be returned.
*
* @param containerName Container to which the datastructure is associated
... | Method that will retrieve and return the handle to modify a data structire distributed via clustering services. The datastructure shall already have been created else a null reference will be returned | getCache | {
"repo_name": "aryantaheri/controller",
"path": "opendaylight/clustering/services/src/main/java/org/opendaylight/controller/clustering/services/IClusterServices.java",
"license": "epl-1.0",
"size": 11088
} | [
"java.util.concurrent.ConcurrentMap"
] | import java.util.concurrent.ConcurrentMap; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,819,490 |
public static void applyDialogFont(Control control) {
if (control == null || dialogFontIsDefault()) {
return;
}
Font dialogFont = JFaceResources.getDialogFont();
applyDialogFont(control, dialogFont);
} | static void function(Control control) { if (control == null dialogFontIsDefault()) { return; } Font dialogFont = JFaceResources.getDialogFont(); applyDialogFont(control, dialogFont); } | /**
* Applies the dialog font to all controls that currently have the default
* font.
*
* @param control
* the control to apply the font to. Font will also be applied to
* its children. If the control is <code>null</code> nothing
* happens.
*/ | Applies the dialog font to all controls that currently have the default font | applyDialogFont | {
"repo_name": "ControlSystemStudio/org.csstudio.iter",
"path": "plugins/org.eclipse.jface/src/org/eclipse/jface/dialogs/Dialog.java",
"license": "epl-1.0",
"size": 41148
} | [
"org.eclipse.jface.resource.JFaceResources",
"org.eclipse.swt.graphics.Font",
"org.eclipse.swt.widgets.Control"
] | import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.widgets.Control; | import org.eclipse.jface.resource.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.jface",
"org.eclipse.swt"
] | org.eclipse.jface; org.eclipse.swt; | 435,602 |
public String getOriginatingQueryString(HttpServletRequest request) {
String queryString = (String) request.getAttribute(WebUtils.FORWARD_QUERY_STRING_ATTRIBUTE);
if (queryString == null) {
queryString = request.getQueryString();
}
return queryString;
}
| String function(HttpServletRequest request) { String queryString = (String) request.getAttribute(WebUtils.FORWARD_QUERY_STRING_ATTRIBUTE); if (queryString == null) { queryString = request.getQueryString(); } return queryString; } | /**
* Return the request URI for root of the given request. If this is a forwarded request,
* correctly resolves to the request URI of the original request.
* <p>Relies on the Servlet 2.4 'forward' attributes. These attributes may be set by
* other components when running in a Servlet 2.3 environment.
* ... | Return the request URI for root of the given request. If this is a forwarded request, correctly resolves to the request URI of the original request. Relies on the Servlet 2.4 'forward' attributes. These attributes may be set by other components when running in a Servlet 2.3 environment | getOriginatingQueryString | {
"repo_name": "codeApeFromChina/resource",
"path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/web/util/UrlPathHelper.java",
"license": "unlicense",
"size": 13938
} | [
"javax.servlet.http.HttpServletRequest"
] | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 1,927,192 |
private static Cursor queryOne(long id) throws SQLiteException {
Log.d(TAG, "queryOne");
if (dbHelper == null)
throw new SQLiteException("DbHelper instance is not set");
SQLiteQueryBuilder query = new SQLiteQueryBuilder();
query.setTables(DbConsts.TABLE);
String whereClause = DbConsts.Colu... | static Cursor function(long id) throws SQLiteException { Log.d(TAG, STR); if (dbHelper == null) throw new SQLiteException(STR); SQLiteQueryBuilder query = new SQLiteQueryBuilder(); query.setTables(DbConsts.TABLE); String whereClause = DbConsts.Column.ID + "=" + id; query.appendWhere(whereClause); SQLiteDatabase db = db... | /**
* Helper method to retrieve a local task record by id by querying the sql database directly.
*
* @param id The id of the local task. Please not that this is NOT the remote task id, since they
* serve for different purposes.
* @return A database cursor.
* @throws SQLiteException Thrown when ... | Helper method to retrieve a local task record by id by querying the sql database directly | queryOne | {
"repo_name": "gwutama/MAD-Todo",
"path": "src/com/utama/madtodo/models/LocalTodo.java",
"license": "mit",
"size": 12621
} | [
"android.database.Cursor",
"android.database.sqlite.SQLiteDatabase",
"android.database.sqlite.SQLiteException",
"android.database.sqlite.SQLiteQueryBuilder",
"android.util.Log"
] | import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import android.database.sqlite.SQLiteQueryBuilder; import android.util.Log; | import android.database.*; import android.database.sqlite.*; import android.util.*; | [
"android.database",
"android.util"
] | android.database; android.util; | 897,406 |
static public PermissionValue buildPermissionValue(PermissionRoleRel prr) {
PermissionValue pv = new PermissionValue();
pv.setPermissionId(prr.getPermissionId());
pv.setResourceName(prr.getPermissionResource());
pv.setActionGroup(prr.getActionGroup());
pv.setPermRelationshipI... | static PermissionValue function(PermissionRoleRel prr) { PermissionValue pv = new PermissionValue(); pv.setPermissionId(prr.getPermissionId()); pv.setResourceName(prr.getPermissionResource()); pv.setActionGroup(prr.getActionGroup()); pv.setPermRelationshipId(prr.getHjid().toString()); return pv; } | /**
* Builds the permission value.
*
* @param prr the prr
* @return the permission value
*/ | Builds the permission value | buildPermissionValue | {
"repo_name": "cherryhill/collectionspace-services",
"path": "services/common/src/main/java/org/collectionspace/services/common/authorization_mgt/AuthorizationRoleRel.java",
"license": "apache-2.0",
"size": 2211
} | [
"org.collectionspace.services.authorization.PermissionRoleRel",
"org.collectionspace.services.authorization.PermissionValue"
] | import org.collectionspace.services.authorization.PermissionRoleRel; import org.collectionspace.services.authorization.PermissionValue; | import org.collectionspace.services.authorization.*; | [
"org.collectionspace.services"
] | org.collectionspace.services; | 56,513 |
long run() throws Exception {
long elapsedTime;
setUp();
long startTime = System.currentTimeMillis();
try {
for (int i = 0; i < totalRows; i++) {
if (i > 0 && i % getReportingPeriod() == 0) {
LOG.info("Processed " + i + " rows.");
}
doRow(i);... | long run() throws Exception { long elapsedTime; setUp(); long startTime = System.currentTimeMillis(); try { for (int i = 0; i < totalRows; i++) { if (i > 0 && i % getReportingPeriod() == 0) { LOG.info(STR + i + STR); } doRow(i); } elapsedTime = System.currentTimeMillis() - startTime; } finally { tearDown(); } return el... | /**
* Run benchmark
* @return elapsed time.
* @throws Exception
*/ | Run benchmark | run | {
"repo_name": "centiteo/hbase",
"path": "src/test/java/org/apache/hadoop/hbase/HFilePerformanceEvaluation.java",
"license": "apache-2.0",
"size": 10496
} | [
"java.util.Random",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.io.hfile.HFile"
] | import java.util.Random; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.io.hfile.HFile; | import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.io.hfile.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,001,340 |
public void setSeriesOutlinePaint(Paint paint) {
this.seriesOutlinePaint = paint;
notifyListeners(new PlotChangeEvent(this));
} | void function(Paint paint) { this.seriesOutlinePaint = paint; notifyListeners(new PlotChangeEvent(this)); } | /**
* Sets the outline paint for ALL series in the plot. If this is set to
* </code> null</code>, then a list of paints is used instead (to allow
* different colors to be used for each series).
*
* @param paint the paint (<code>null</code> permitted).
*/ | Sets the outline paint for ALL series in the plot. If this is set to </code> null</code>, then a list of paints is used instead (to allow different colors to be used for each series) | setSeriesOutlinePaint | {
"repo_name": "ibestvina/multithread-centiscape",
"path": "CentiScaPe2.1/src/main/java/org/jfree/chart/plot/SpiderWebPlot.java",
"license": "mit",
"size": 54986
} | [
"java.awt.Paint",
"org.jfree.chart.event.PlotChangeEvent"
] | import java.awt.Paint; import org.jfree.chart.event.PlotChangeEvent; | import java.awt.*; import org.jfree.chart.event.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 346,235 |
RelayEmailNotificationWithBLOBs selectByPrimaryKey(Integer id); | RelayEmailNotificationWithBLOBs selectByPrimaryKey(Integer id); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table s_relay_email_notification
*
* @mbggenerated Mon Sep 21 13:52:03 ICT 2015
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table s_relay_email_notification | selectByPrimaryKey | {
"repo_name": "maduhu/mycollab",
"path": "mycollab-services/src/main/java/com/esofthead/mycollab/common/dao/RelayEmailNotificationMapper.java",
"license": "agpl-3.0",
"size": 5245
} | [
"com.esofthead.mycollab.common.domain.RelayEmailNotificationWithBLOBs"
] | import com.esofthead.mycollab.common.domain.RelayEmailNotificationWithBLOBs; | import com.esofthead.mycollab.common.domain.*; | [
"com.esofthead.mycollab"
] | com.esofthead.mycollab; | 1,620,501 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
String resourceGroupName, String clusterName, String extensionName) {
Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, extension... | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<Void>, Void> function( String resourceGroupName, String clusterName, String extensionName) { Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, extensionName); return this .client .<Void, Void>... | /**
* Deletes the specified extension for HDInsight cluster.
*
* @param resourceGroupName The name of the resource group.
* @param clusterName The name of the cluster.
* @param extensionName The name of the cluster extension.
* @throws IllegalArgumentException thrown if parameters fail the... | Deletes the specified extension for HDInsight cluster | beginDeleteAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/implementation/ExtensionsClientImpl.java",
"license": "mit",
"size": 117529
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.PollerFlux",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
] | com.azure.core; java.nio; | 381,454 |
public void restoreState(IMemento memento) {
fMemberFilterActionGroup.restoreState(memento);
getControl().setRedraw(false);
refresh();
getControl().setRedraw(true);
boolean showInherited= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue();
showInheritedMethods(showInherited);
boolea... | void function(IMemento memento) { fMemberFilterActionGroup.restoreState(memento); getControl().setRedraw(false); refresh(); getControl().setRedraw(true); boolean showInherited= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue(); showInheritedMethods(showInherited); boolean showDefiningTypes= Boolean.v... | /**
* Restores the state of the filter actions
* @param memento the memento
*/ | Restores the state of the filter actions | restoreState | {
"repo_name": "brunyuriy/quick-fix-scout",
"path": "org.eclipse.jdt.ui_3.7.1.r371_v20110824-0800/src/org/eclipse/jdt/internal/ui/typehierarchy/MethodsViewer.java",
"license": "mit",
"size": 10045
} | [
"org.eclipse.swt.widgets.ScrollBar",
"org.eclipse.ui.IMemento"
] | import org.eclipse.swt.widgets.ScrollBar; import org.eclipse.ui.IMemento; | import org.eclipse.swt.widgets.*; import org.eclipse.ui.*; | [
"org.eclipse.swt",
"org.eclipse.ui"
] | org.eclipse.swt; org.eclipse.ui; | 1,819,375 |
public List<Person> list();
| List<Person> function(); | /**
* Returns all persons in the data base.
* all related entities.
*
* @author dd
*/ | Returns all persons in the data base. all related entities | list | {
"repo_name": "CodeSphere/termitaria",
"path": "TermitariaOM/JavaSource/ro/cs/om/model/dao/IDaoPerson.java",
"license": "agpl-3.0",
"size": 11283
} | [
"java.util.List",
"ro.cs.om.entity.Person"
] | import java.util.List; import ro.cs.om.entity.Person; | import java.util.*; import ro.cs.om.entity.*; | [
"java.util",
"ro.cs.om"
] | java.util; ro.cs.om; | 2,491,934 |
public void setItemLabelFont(Font font, boolean notify) {
this.itemLabelFont = font;
if (notify) {
notifyListeners(new RendererChangeEvent(this));
}
} | void function(Font font, boolean notify) { this.itemLabelFont = font; if (notify) { notifyListeners(new RendererChangeEvent(this)); } } | /**
* Sets the item label font for ALL series and, if requested, sends a
* {@link RendererChangeEvent} to all registered listeners.
*
* @param font the font (<code>null</code> permitted).
* @param notify a flag that controls whether or not listeners are
* notified.
... | Sets the item label font for ALL series and, if requested, sends a <code>RendererChangeEvent</code> to all registered listeners | setItemLabelFont | {
"repo_name": "opensim-org/opensim-gui",
"path": "Gui/opensim/jfreechart/src/org/jfree/chart/renderer/AbstractRenderer.java",
"license": "apache-2.0",
"size": 98153
} | [
"java.awt.Font",
"org.jfree.chart.event.RendererChangeEvent"
] | import java.awt.Font; import org.jfree.chart.event.RendererChangeEvent; | import java.awt.*; import org.jfree.chart.event.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 1,950,243 |
private Name readQName() throws IOException {
if (version >= BundleBinding.VERSION_3) {
return readName();
}
String uri = binding.nsIndex.indexToString(in.readInt());
String local = in.readUTF();
return NameFactoryImpl.getInstance().create(uri, local);
} | Name function() throws IOException { if (version >= BundleBinding.VERSION_3) { return readName(); } String uri = binding.nsIndex.indexToString(in.readInt()); String local = in.readUTF(); return NameFactoryImpl.getInstance().create(uri, local); } | /**
* Deserializes a Name
*
* @return the qname
* @throws IOException in an I/O error occurs.
*/ | Deserializes a Name | readQName | {
"repo_name": "apache/jackrabbit",
"path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/BundleReader.java",
"license": "apache-2.0",
"size": 23167
} | [
"java.io.IOException",
"org.apache.jackrabbit.spi.Name",
"org.apache.jackrabbit.spi.commons.name.NameFactoryImpl"
] | import java.io.IOException; import org.apache.jackrabbit.spi.Name; import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl; | import java.io.*; import org.apache.jackrabbit.spi.*; import org.apache.jackrabbit.spi.commons.name.*; | [
"java.io",
"org.apache.jackrabbit"
] | java.io; org.apache.jackrabbit; | 2,089,388 |
private void writeSortedFile(boolean isLastFile) {
final ShuffleWriteMetrics writeMetricsToUse;
if (isLastFile) {
// We're writing the final non-spill file, so we _do_ want to count this as shuffle bytes.
writeMetricsToUse = writeMetrics;
} else {
// We're spilling, so bytes written sh... | void function(boolean isLastFile) { final ShuffleWriteMetrics writeMetricsToUse; if (isLastFile) { writeMetricsToUse = writeMetrics; } else { writeMetricsToUse = new ShuffleWriteMetrics(); } final ShuffleInMemorySorter.ShuffleSorterIterator sortedRecords = inMemSorter.getSortedIterator(); final byte[] writeBuffer = new... | /**
* Sorts the in-memory records and writes the sorted records to an on-disk file.
* This method does not free the sort data structures.
*
* @param isLastFile if true, this indicates that we're writing the final output file and that the
* bytes written should be counted towards shuffle... | Sorts the in-memory records and writes the sorted records to an on-disk file. This method does not free the sort data structures | writeSortedFile | {
"repo_name": "brad-kaiser/spark",
"path": "core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java",
"license": "apache-2.0",
"size": 17711
} | [
"java.io.File",
"org.apache.spark.executor.ShuffleWriteMetrics",
"org.apache.spark.serializer.DummySerializerInstance",
"org.apache.spark.serializer.SerializerInstance",
"org.apache.spark.storage.DiskBlockObjectWriter",
"org.apache.spark.storage.FileSegment",
"org.apache.spark.storage.TempShuffleBlockId... | import java.io.File; import org.apache.spark.executor.ShuffleWriteMetrics; import org.apache.spark.serializer.DummySerializerInstance; import org.apache.spark.serializer.SerializerInstance; import org.apache.spark.storage.DiskBlockObjectWriter; import org.apache.spark.storage.FileSegment; import org.apache.spark.storag... | import java.io.*; import org.apache.spark.executor.*; import org.apache.spark.serializer.*; import org.apache.spark.storage.*; import org.apache.spark.unsafe.*; | [
"java.io",
"org.apache.spark"
] | java.io; org.apache.spark; | 2,681,207 |
protected void preventCaching(final HttpServletResponse response) {
response.setHeader("Pragma", NO_CACHE);
response.setDateHeader("Expires", 1L);
response.setHeader(CACHE_CONTROL, NO_CACHE);
response.addHeader(CACHE_CONTROL, "no-store");
} | void function(final HttpServletResponse response) { response.setHeader(STR, NO_CACHE); response.setDateHeader(STR, 1L); response.setHeader(CACHE_CONTROL, NO_CACHE); response.addHeader(CACHE_CONTROL, STR); } | /**
* Prevent caching by adding the appropriate headers.
* Copied from the {@code preventCaching} method in the
* {@link org.springframework.web.servlet.support.WebContentGenerator} class.
*
* @param response the HTTP response.
*/ | Prevent caching by adding the appropriate headers. Copied from the preventCaching method in the <code>org.springframework.web.servlet.support.WebContentGenerator</code> class | preventCaching | {
"repo_name": "dodok1/cas",
"path": "support/cas-server-support-actions/src/main/java/org/apereo/cas/web/flow/logout/AbstractLogoutAction.java",
"license": "apache-2.0",
"size": 2105
} | [
"javax.servlet.http.HttpServletResponse"
] | import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 2,520,211 |
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(BusinessEntity.class)) {
case DomainmetamodelPackage.BUSINESS_ENTITY__NAME:
case DomainmetamodelPackage.BUSINESS_ENTITY__IS_AUTHENTICABLE:
fireNotifyChanged(new ViewerNotif... | void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(BusinessEntity.class)) { case DomainmetamodelPackage.BUSINESS_ENTITY__NAME: case DomainmetamodelPackage.BUSINESS_ENTITY__IS_AUTHENTICABLE: fireNotifyChanged(new ViewerNotification(notification, notification.getNot... | /**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>. | notifyChanged | {
"repo_name": "unicesi/QD-SPL",
"path": "ToolSupport/co.edu.icesi.shift.domainmodel.edit/src/domainmetamodel/provider/BusinessEntityItemProvider.java",
"license": "lgpl-3.0",
"size": 9381
} | [
"org.eclipse.emf.common.notify.Notification",
"org.eclipse.emf.edit.provider.ViewerNotification"
] | import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; | import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,515,599 |
public void setPerUserDefaultTransactionIsolation(String username,
Integer value) {
assertInitializationAllowed();
if (perUserDefaultTransactionIsolation == null) {
perUserDefaultTransactionIsolation = new HashMap<>();
}
perUserDefaultTransactionIsolation.put(... | void function(String username, Integer value) { assertInitializationAllowed(); if (perUserDefaultTransactionIsolation == null) { perUserDefaultTransactionIsolation = new HashMap<>(); } perUserDefaultTransactionIsolation.put(username, value); } | /**
* Sets a user specific default value for
* {@link Connection#setTransactionIsolation(int)} for the specified user's pool.
*/ | Sets a user specific default value for <code>Connection#setTransactionIsolation(int)</code> for the specified user's pool | setPerUserDefaultTransactionIsolation | {
"repo_name": "kmiku7/apache-commons-dbcp-annotated",
"path": "src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java",
"license": "apache-2.0",
"size": 37891
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 215,961 |
@Override
protected ActionForward executeAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception
{
Map dynamicEventMap= new HashMap();
request.setAttribute(Constants.EVENT_PARAMETERS_LIST, new SPPBizLogic().getAllSPPEventFormNames(dyna... | ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Map dynamicEventMap= new HashMap(); request.setAttribute(Constants.EVENT_PARAMETERS_LIST, new SPPBizLogic().getAllSPPEventFormNames(dynamicEventMap)); request.setAttribute(Constant... | /**
* Overrides the execute method of Action class.
* Sets the various fields in QuickEvents webpage.
* @param mapping object of ActionMapping
* @param form object of ActionForm
* @param request object of HttpServletRequest
* @param response object of HttpServletResponse
* @throws Exception generic... | Overrides the execute method of Action class. Sets the various fields in QuickEvents webpage | executeAction | {
"repo_name": "NCIP/catissue-core",
"path": "software/caTissue/modules/core/src/main/java/edu/wustl/catissuecore/action/QuickEventsAction.java",
"license": "bsd-3-clause",
"size": 3883
} | [
"edu.wustl.catissuecore.bizlogic.SPPBizLogic",
"edu.wustl.catissuecore.util.global.Constants",
"java.util.HashMap",
"java.util.Map",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"javax.servlet.http.HttpSession",
"org.apache.struts.action.ActionForm",
"org.apache... | import edu.wustl.catissuecore.bizlogic.SPPBizLogic; import edu.wustl.catissuecore.util.global.Constants; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Act... | import edu.wustl.catissuecore.bizlogic.*; import edu.wustl.catissuecore.util.global.*; import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; | [
"edu.wustl.catissuecore",
"java.util",
"javax.servlet",
"org.apache.struts"
] | edu.wustl.catissuecore; java.util; javax.servlet; org.apache.struts; | 2,623,481 |
public static int[] getPixels(BufferedImage img,
int x, int y, int w, int h, int[] pixels) {
if (w == 0 || h == 0) {
return new int[0];
}
if (pixels == null) {
pixels = new int[w * h];
} else if (pixels.length < w * h) {
... | static int[] function(BufferedImage img, int x, int y, int w, int h, int[] pixels) { if (w == 0 h == 0) { return new int[0]; } if (pixels == null) { pixels = new int[w * h]; } else if (pixels.length < w * h) { throw new IllegalArgumentException(STR + STR); } int imageType = img.getType(); if (imageType == BufferedImage... | /**
* <p>Returns an array of pixels, stored as integers, from a
* <code>BufferedImage</code>. The pixels are grabbed from a rectangular
* area defined by a location and two dimensions. Calling this method on
* an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code>
* and <code>... | Returns an array of pixels, stored as integers, from a <code>BufferedImage</code>. The pixels are grabbed from a rectangular area defined by a location and two dimensions. Calling this method on an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code> and <code>BufferedImage.TYPE_INT_RGB</code> will unm... | getPixels | {
"repo_name": "szabob94/vedes4",
"path": "jxmap_osm/src/main/java/org/jxmapviewer/util/GraphicsUtilities.java",
"license": "gpl-3.0",
"size": 36241
} | [
"java.awt.image.BufferedImage",
"java.awt.image.Raster"
] | import java.awt.image.BufferedImage; import java.awt.image.Raster; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 2,470,647 |
EAttribute getExactNumber_ExactUnlimited();
| EAttribute getExactNumber_ExactUnlimited(); | /**
* Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ExactNumber#isExactUnlimited <em>Exact Unlimited</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Exact Unlimited</em>'.
*... | Returns the meta object for the attribute '<code>hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ExactNumber#isExactUnlimited Exact Unlimited</code>'. | getExactNumber_ExactUnlimited | {
"repo_name": "viatra/VIATRA-Generator",
"path": "Application/hu.bme.mit.inf.dslreasoner.application/src-gen/hu/bme/mit/inf/dslreasoner/application/applicationConfiguration/ApplicationConfigurationPackage.java",
"license": "epl-1.0",
"size": 236178
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,261,764 |
ServiceCall loginUserAsync(final ServiceCallback<String> serviceCallback) throws IllegalArgumentException;
ServiceResponse<String> loginUser(String username, String password) throws ServiceException, IOException; | ServiceCall loginUserAsync(final ServiceCallback<String> serviceCallback) throws IllegalArgumentException; ServiceResponse<String> loginUser(String username, String password) throws ServiceException, IOException; | /**
* Logs user into the system.
*
* @param username The user name for login
* @param password The password for login in clear text
* @throws ServiceException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the String... | Logs user into the system | loginUser | {
"repo_name": "xingwu1/autorest",
"path": "Samples/petstore/Java/SwaggerPetstore.java",
"license": "mit",
"size": 35698
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceException",
"com.microsoft.rest.ServiceResponse",
"java.io.IOException"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceException; import com.microsoft.rest.ServiceResponse; import java.io.IOException; | import com.microsoft.rest.*; import java.io.*; | [
"com.microsoft.rest",
"java.io"
] | com.microsoft.rest; java.io; | 1,510,998 |
private void sendInitPackets () {
if (initQueue.isEmpty()) {
return;
}
ClanChannelEventContext.User[] entries;
synchronized (users) {
for (SocialUser user : initQueue) {
ClanChannelUser u = new ClanChannelUser(user);
u.rank = clanData.getRank(u.userHash).getID();
u.isAffined = user... | void function () { if (initQueue.isEmpty()) { return; } ClanChannelEventContext.User[] entries; synchronized (users) { for (SocialUser user : initQueue) { ClanChannelUser u = new ClanChannelUser(user); u.rank = clanData.getRank(u.userHash).getID(); u.isAffined = user.getAffinedClanHash() == clanData.getClanHash(); user... | /**
* Sends any queued initialisation packets
*/ | Sends any queued initialisation packets | sendInitPackets | {
"repo_name": "itsgreco/VirtueRS3",
"path": "src/org/virtue/game/content/clans/ClanChannel.java",
"license": "mit",
"size": 10715
} | [
"org.virtue.game.content.chat.SocialUser",
"org.virtue.network.event.context.impl.out.ClanChannelEventContext"
] | import org.virtue.game.content.chat.SocialUser; import org.virtue.network.event.context.impl.out.ClanChannelEventContext; | import org.virtue.game.content.chat.*; import org.virtue.network.event.context.impl.out.*; | [
"org.virtue.game",
"org.virtue.network"
] | org.virtue.game; org.virtue.network; | 1,020,313 |
@FIXVersion(introduced="4.4")
@TagNumRef(tagNum=TagNum.SubscriptionRequestType)
public SubscriptionRequestType getSubscriptionRequestType() {
return subscriptionRequestType;
} | @FIXVersion(introduced="4.4") @TagNumRef(tagNum=TagNum.SubscriptionRequestType) SubscriptionRequestType function() { return subscriptionRequestType; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getSubscriptionRequestType | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/PositionReportMsg.java",
"license": "gpl-3.0",
"size": 55957
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.SubscriptionRequestType",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.SubscriptionRequestType; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 2,061,655 |
public Concept getMasterSetConcept(String category) {
Integer conceptId = masterSetConcepts.get(category);
return conceptId != null ? Context.getConceptService().getConcept(conceptId) : null;
} | Concept function(String category) { Integer conceptId = masterSetConcepts.get(category); return conceptId != null ? Context.getConceptService().getConcept(conceptId) : null; } | /**
* Gets the master set concept for the given category
* @param category the category, e.g. "ARV"
* @return the concept
*/ | Gets the master set concept for the given category | getMasterSetConcept | {
"repo_name": "hispindia/his-tb-emr",
"path": "api/src/main/java/org/openmrs/module/kenyaemr/regimen/RegimenManager.java",
"license": "gpl-3.0",
"size": 9668
} | [
"org.openmrs.Concept",
"org.openmrs.api.context.Context"
] | import org.openmrs.Concept; import org.openmrs.api.context.Context; | import org.openmrs.*; import org.openmrs.api.context.*; | [
"org.openmrs",
"org.openmrs.api"
] | org.openmrs; org.openmrs.api; | 891,856 |
void removeFaction(Faction faction) {
// Remove:
if(loadedFactions.remove(faction.getId()) == null){
SagaLogger.severe(getClass(), "tried to remove a non-existing " + faction + " faction from the list");
return;
}
// Remove from siege manager:
SiegeManager.manager().wipeFaction(faction.getId()... | void removeFaction(Faction faction) { if(loadedFactions.remove(faction.getId()) == null){ SagaLogger.severe(getClass(), STR + faction + STR); return; } SiegeManager.manager().wipeFaction(faction.getId()); } | /**
* Removes a faction.
*
* @param faction
*/ | Removes a faction | removeFaction | {
"repo_name": "andfRa/Saga",
"path": "src/org/saga/factions/FactionManager.java",
"license": "gpl-3.0",
"size": 6178
} | [
"org.saga.SagaLogger"
] | import org.saga.SagaLogger; | import org.saga.*; | [
"org.saga"
] | org.saga; | 1,438,482 |
public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
mViewPagerPageChangeListener = listener;
} | void function(ViewPager.OnPageChangeListener listener) { mViewPagerPageChangeListener = listener; } | /**
* Set the {@link ViewPager.OnPageChangeListener}. When using {@link SlidingTabLayout} you are
* required to set any {@link ViewPager.OnPageChangeListener} through this method. This is so
* that the layout can update it's scroll position correctly.
*
* @see ViewPager#setOnPageChangeListener(... | Set the <code>ViewPager.OnPageChangeListener</code>. When using <code>SlidingTabLayout</code> you are required to set any <code>ViewPager.OnPageChangeListener</code> through this method. This is so that the layout can update it's scroll position correctly | setOnPageChangeListener | {
"repo_name": "damson/Bright",
"path": "sample/src/main/java/com/devddagnet/bright/sample/widget/SlidingTabLayout.java",
"license": "apache-2.0",
"size": 10934
} | [
"android.support.v4.view.ViewPager"
] | import android.support.v4.view.ViewPager; | import android.support.v4.view.*; | [
"android.support"
] | android.support; | 2,863,102 |
private void inlineAmpExtensionCall(Node n, Node expr) {
if (expr == null || !expr.isExprResult()) {
return;
}
Node func = getAmpExtensionCallback(n);
func.detachFromParent();
Node arg1 = IR.getprop(IR.name("self"), IR.string("AMP"));
arg1.setLength("self.AMP".length());
arg1.useSour... | void function(Node n, Node expr) { if (expr == null !expr.isExprResult()) { return; } Node func = getAmpExtensionCallback(n); func.detachFromParent(); Node arg1 = IR.getprop(IR.name("self"), IR.string("AMP")); arg1.setLength(STR.length()); arg1.useSourceInfoIfMissingFromForTree(func); Node newcall = IR.call(func); newc... | /**
* This operation should be guarded stringently by `isAmpExtensionCall`
* predicate.
*
* AMP.extension('some-name', '0.1', function(AMP) {
* // BODY...
* });
*
* is turned into:
* (function(AMP) {
* // BODY...
* })(self.AMP);
*/ | This operation should be guarded stringently by `isAmpExtensionCall` predicate. AMP.extension('some-name', '0.1', function(AMP) { BODY... }); is turned into: (function(AMP) { BODY... })(self.AMP) | inlineAmpExtensionCall | {
"repo_name": "widespace-os/amphtml",
"path": "build-system/runner/src/org/ampproject/AmpPass.java",
"license": "apache-2.0",
"size": 12038
} | [
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node"
] | import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; | import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 2,144,425 |
public void setupMenuItems(Menu menu) {
if (!isInflated()) {
return;
}
mVTInCallScreen.setupMenuItems(menu);
} | void function(Menu menu) { if (!isInflated()) { return; } mVTInCallScreen.setupMenuItems(menu); } | /**
* The function called when setup option menu
* @param menu the menu for setup
*/ | The function called when setup option menu | setupMenuItems | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Phone/src/com/mediatek/phone/vt/VTInCallScreenProxy.java",
"license": "gpl-2.0",
"size": 12483
} | [
"android.view.Menu"
] | import android.view.Menu; | import android.view.*; | [
"android.view"
] | android.view; | 1,240,365 |
@Override
public void run() {
Request request;
while (true) {
do {
CacheServiceProvider.clearAllThreadCaches();
request = null;
synchronized (requestList) {
if (!requestList.isEmpty()) {
request = requestList.remove(0);
queueSemaphore.... | void function() { Request request; while (true) { do { CacheServiceProvider.clearAllThreadCaches(); request = null; synchronized (requestList) { if (!requestList.isEmpty()) { request = requestList.remove(0); queueSemaphore.release(); } } if (request != null) { try { request.process(indexManager); } catch (Exception e) ... | /**
* Process all the requests. When the queue is empty : sends an optimize query to the
* indexManager. This method should be private but is already declared public in the base class
* Thread.
*/ | Process all the requests. When the queue is empty : sends an optimize query to the indexManager. This method should be private but is already declared public in the base class Thread | run | {
"repo_name": "auroreallibe/Silverpeas-Core",
"path": "core-library/src/main/java/org/silverpeas/core/index/indexing/model/IndexerThread.java",
"license": "agpl-3.0",
"size": 6989
} | [
"java.util.ArrayList",
"java.util.List",
"org.silverpeas.core.cache.service.CacheServiceProvider",
"org.silverpeas.core.util.logging.SilverLogger"
] | import java.util.ArrayList; import java.util.List; import org.silverpeas.core.cache.service.CacheServiceProvider; import org.silverpeas.core.util.logging.SilverLogger; | import java.util.*; import org.silverpeas.core.cache.service.*; import org.silverpeas.core.util.logging.*; | [
"java.util",
"org.silverpeas.core"
] | java.util; org.silverpeas.core; | 1,379,044 |
@Override
public Object getValue(int index)
{ // Check state
checkValid(index);
// Special check for NO_VALUE
if (fields[index] == ObjectUtils.NO_VALUE)
throw new FieldValueNotFetchedException(getColumn(index));
// Return field value
return fields[index... | Object function(int index) { checkValid(index); if (fields[index] == ObjectUtils.NO_VALUE) throw new FieldValueNotFetchedException(getColumn(index)); return fields[index]; } /** * Returns whether a field value is provided i.e. the value is not DBRowSet.NO_VALUE<BR> * This function is only useful in cases where records ... | /**
* Returns the value for the given column or null if either the index is out of range or the value is not valid (see {@link DBRecordBase#isValueValid(int)})
* @return the index value
*/ | Returns the value for the given column or null if either the index is out of range or the value is not valid (see <code>DBRecordBase#isValueValid(int)</code>) | getValue | {
"repo_name": "apache/empire-db",
"path": "empire-db/src/main/java/org/apache/empire/db/DBRecordBase.java",
"license": "apache-2.0",
"size": 38173
} | [
"org.apache.empire.commons.ObjectUtils",
"org.apache.empire.db.exceptions.FieldValueNotFetchedException"
] | import org.apache.empire.commons.ObjectUtils; import org.apache.empire.db.exceptions.FieldValueNotFetchedException; | import org.apache.empire.commons.*; import org.apache.empire.db.exceptions.*; | [
"org.apache.empire"
] | org.apache.empire; | 282,991 |
public void setContexts(Object handle, Collection c) {
if (handle instanceof MSignal) {
((MSignal) handle).setContexts(c);
return;
}
throw new IllegalArgumentException("handle: " + handle);
} | void function(Object handle, Collection c) { if (handle instanceof MSignal) { ((MSignal) handle).setContexts(c); return; } throw new IllegalArgumentException(STR + handle); } | /**
* Sets the contexts for a Signal.
*
* @param handle the Signal
* @param c the collection of contexts
*/ | Sets the contexts for a Signal | setContexts | {
"repo_name": "carvalhomb/tsmells",
"path": "sample/argouml/argouml/org/argouml/model/uml/CommonBehaviorHelperImpl.java",
"license": "gpl-2.0",
"size": 21931
} | [
"java.util.Collection",
"ru.novosoft.uml.behavior.common_behavior.MSignal"
] | import java.util.Collection; import ru.novosoft.uml.behavior.common_behavior.MSignal; | import java.util.*; import ru.novosoft.uml.behavior.common_behavior.*; | [
"java.util",
"ru.novosoft.uml"
] | java.util; ru.novosoft.uml; | 983,232 |
public ResultStatusCode getResultStatusCode() {
return this.ResultStatusCode;
} | ResultStatusCode function() { return this.ResultStatusCode; } | /**
* Gets the result status code.
*
* @return the result status code
*/ | Gets the result status code | getResultStatusCode | {
"repo_name": "OBHITA/Consent2Share",
"path": "DS4P/consent2share/domain/src/main/java/gov/samhsa/consent2share/domain/clinicaldata/ResultObservation.java",
"license": "bsd-3-clause",
"size": 8262
} | [
"gov.samhsa.consent2share.domain.reference.ResultStatusCode"
] | import gov.samhsa.consent2share.domain.reference.ResultStatusCode; | import gov.samhsa.consent2share.domain.reference.*; | [
"gov.samhsa.consent2share"
] | gov.samhsa.consent2share; | 2,164,042 |
protected static Object getProxy(Object node) {
if (node instanceof HasJsProxy) {
Proxy proxy = ((HasJsProxy) node).getJsProxy();
if (proxy == null) {
proxy = new Proxy((SNode) node, new SListProxyHandler());
((HasJsProxy) node).setJsProxy(proxy);
}
return proxy;
} else... | static Object function(Object node) { if (node instanceof HasJsProxy) { Proxy proxy = ((HasJsProxy) node).getJsProxy(); if (proxy == null) { proxy = new Proxy((SNode) node, new SListProxyHandler()); ((HasJsProxy) node).setJsProxy(proxy); } return proxy; } else { return node; } } | /**
* Returns the proxy or primitive value
*
* @param node
* @return
*/ | Returns the proxy or primitive value | getProxy | {
"repo_name": "P2Pvalue/swellrt",
"path": "wave/src/main/java/org/swellrt/beta/model/js/SListProxyHandler.java",
"license": "apache-2.0",
"size": 7536
} | [
"org.swellrt.beta.model.SNode"
] | import org.swellrt.beta.model.SNode; | import org.swellrt.beta.model.*; | [
"org.swellrt.beta"
] | org.swellrt.beta; | 681,115 |
public Timestamp getUpdated();
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; | Timestamp function(); public static final String COLUMNNAME_UpdatedBy = STR; | /** Get Updated.
* Date this record was updated
*/ | Get Updated. Date this record was updated | getUpdated | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/I_M_CostElement.java",
"license": "gpl-2.0",
"size": 5480
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 238,700 |
@Generated
@Selector("predicate")
public native MPSPredicate predicate(); | @Selector(STR) native MPSPredicate function(); | /**
* [@property] predicate
* <p>
* A GPU predicate object. Default: nil.
*/ | [@property] predicate A GPU predicate object. Default: nil | predicate | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/metalperformanceshaders/MPSCommandBuffer.java",
"license": "apache-2.0",
"size": 20154
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,689,874 |
public static final void addSearchPath(String libraryName, String path) {
synchronized (searchPaths) {
List customPaths = (List) searchPaths.get(libraryName);
if (customPaths == null) {
customPaths = Collections.synchronizedList(new LinkedList());
sear... | static final void function(String libraryName, String path) { synchronized (searchPaths) { List customPaths = (List) searchPaths.get(libraryName); if (customPaths == null) { customPaths = Collections.synchronizedList(new LinkedList()); searchPaths.put(libraryName, customPaths); } customPaths.add(path); } } | /**
* Add a path to search for the specified library, ahead of any system
* paths.
*
* @param libraryName The name of the library to use the path for
* @param path The path to use when trying to load the library
*/ | Add a path to search for the specified library, ahead of any system paths | addSearchPath | {
"repo_name": "netjunki/jna-android",
"path": "src/com/sun/jna/NativeLibrary.java",
"license": "lgpl-2.1",
"size": 26512
} | [
"java.util.Collections",
"java.util.LinkedList",
"java.util.List"
] | import java.util.Collections; import java.util.LinkedList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 225,531 |
public Object[] listAssignedSystemGroups(String sessionKey, String login)
throws FaultException {
User loggedInUser = getLoggedInUser(sessionKey);
User target = XmlRpcUserHelper.getInstance().lookupTargetUser(
loggedInUser, login);
List groups = ServerGroupFactor... | Object[] function(String sessionKey, String login) throws FaultException { User loggedInUser = getLoggedInUser(sessionKey); User target = XmlRpcUserHelper.getInstance().lookupTargetUser( loggedInUser, login); List groups = ServerGroupFactory.listAdministeredServerGroups(target); return groups.toArray(); } | /**
* Returns the ServerGroups that the user can administer.
* @param sessionKey The sessionKey for the session containing the logged
* in user.
* @param login The login for the user whose ServerGroups are sought.
* @return the ServerGroups that the user can administer.
* @throws FaultExce... | Returns the ServerGroups that the user can administer | listAssignedSystemGroups | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/user/UserHandler.java",
"license": "gpl-2.0",
"size": 47630
} | [
"com.redhat.rhn.FaultException",
"com.redhat.rhn.domain.server.ServerGroupFactory",
"com.redhat.rhn.domain.user.User",
"java.util.List"
] | import com.redhat.rhn.FaultException; import com.redhat.rhn.domain.server.ServerGroupFactory; import com.redhat.rhn.domain.user.User; import java.util.List; | import com.redhat.rhn.*; import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.user.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 231,097 |
public GalleryPropertiesProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
} | GalleryPropertiesProvisioningState function() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } | /**
* Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears
* in the response.
*
* @return the provisioningState value.
*/ | Get the provisioningState property: The current state of the gallery. The provisioning state, which only appears in the response | provisioningState | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/models/GalleryInner.java",
"license": "mit",
"size": 3823
} | [
"com.azure.resourcemanager.compute.models.GalleryPropertiesProvisioningState"
] | import com.azure.resourcemanager.compute.models.GalleryPropertiesProvisioningState; | import com.azure.resourcemanager.compute.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 815,893 |
// MTK-START
public void handleIccFull() {
// broadcast SIM_FULL intent
Intent intent = new Intent(Intents.SIM_FULL_ACTION);
// MTK-START
intent.putExtra(PhoneConstants.GEMINI_SIM_ID_KEY, mPhone.getMySimId());
// MTK-END
mWakeLock.acquire(WAKE_LOCK_TIMEOUT);
... | void function() { Intent intent = new Intent(Intents.SIM_FULL_ACTION); intent.putExtra(PhoneConstants.GEMINI_SIM_ID_KEY, mPhone.getMySimId()); mWakeLock.acquire(WAKE_LOCK_TIMEOUT); mContext.sendBroadcast(intent, SMSDispatcher.RECEIVE_SMS_PERMISSION); } | /**
* Called when SIM_FULL message is received from the RIL. Notifies interested
* parties that SIM storage for SMS messages is full.
*/ | Called when SIM_FULL message is received from the RIL. Notifies interested parties that SIM storage for SMS messages is full | handleIccFull | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/opt/telephony/src/java/com/android/internal/telephony/SmsStorageMonitor.java",
"license": "gpl-2.0",
"size": 7519
} | [
"android.content.Intent",
"android.provider.Telephony",
"com.android.internal.telephony.PhoneConstants"
] | import android.content.Intent; import android.provider.Telephony; import com.android.internal.telephony.PhoneConstants; | import android.content.*; import android.provider.*; import com.android.internal.telephony.*; | [
"android.content",
"android.provider",
"com.android.internal"
] | android.content; android.provider; com.android.internal; | 425,855 |
@Deprecated
void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException; | void createQueue(String address, String queueName, String filter, boolean durable) throws ActiveMQException; | /**
* Creates a <em>non-temporary</em>queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
* @param durable whether the queue is durable or not
* @param filter only messages which match this filter will be put in the queue
* @throw... | Creates a non-temporaryqueue | createQueue | {
"repo_name": "iweiss/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java",
"license": "apache-2.0",
"size": 50872
} | [
"org.apache.activemq.artemis.api.core.ActiveMQException"
] | import org.apache.activemq.artemis.api.core.ActiveMQException; | import org.apache.activemq.artemis.api.core.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 585,910 |
@Test(expected = ParserException.class)
public void processDuplicateCaseInChoice() throws IOException, ParserException {
YangNode node = manager.getDataModel("src/test/resources/DuplicateCaseInChoice.yang");
} | @Test(expected = ParserException.class) void function() throws IOException, ParserException { YangNode node = manager.getDataModel(STR); } | /**
* Checks duplicate case in choice.
*/ | Checks duplicate case in choice | processDuplicateCaseInChoice | {
"repo_name": "Phaneendra-Huawei/demo",
"path": "utils/yangutils/src/test/java/org/onosproject/yangutils/parser/impl/listeners/CaseListenerTest.java",
"license": "apache-2.0",
"size": 7975
} | [
"java.io.IOException",
"org.junit.Test",
"org.onosproject.yangutils.datamodel.YangNode",
"org.onosproject.yangutils.parser.exceptions.ParserException"
] | import java.io.IOException; import org.junit.Test; import org.onosproject.yangutils.datamodel.YangNode; import org.onosproject.yangutils.parser.exceptions.ParserException; | import java.io.*; import org.junit.*; import org.onosproject.yangutils.datamodel.*; import org.onosproject.yangutils.parser.exceptions.*; | [
"java.io",
"org.junit",
"org.onosproject.yangutils"
] | java.io; org.junit; org.onosproject.yangutils; | 2,091,797 |
private void checkRowOrder() {
if (!sorted) {
Collections.sort(rows, new RowSeq.RowSeqComparator());
sorted = true;
}
} | void function() { if (!sorted) { Collections.sort(rows, new RowSeq.RowSeqComparator()); sorted = true; } } | /**
* Checks the sorted flag and sorts the rows if necessary. Should be called
* by any iteration method.
* Since 2.0
*/ | Checks the sorted flag and sorts the rows if necessary. Should be called by any iteration method. Since 2.0 | checkRowOrder | {
"repo_name": "pepperdata/opentsdb-deprecated",
"path": "src/core/Span.java",
"license": "gpl-3.0",
"size": 14225
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 2,638,057 |
public ActionForward cancelModuleEdit(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
GenericDynaFormBean moduleEditForm = (GenericDynaFormBean) form;
Form crf = (Form)getSessionObject(request,CRF);
... | ActionForward function( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { GenericDynaFormBean moduleEditForm = (GenericDynaFormBean) form; Form crf = (Form)getSessionObject(request,CRF); Module module = (Module)getSessionObject(reque... | /**
* Cancel Edit and back to Search results
*
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
*
* @return
... | Cancel Edit and back to Search results | cancelModuleEdit | {
"repo_name": "NCIP/cadsr-formbuilder",
"path": "software/formbuilder/src/java/gov/nih/nci/ncicb/cadsr/formbuilder/struts/actions/FormModuleEditAction.java",
"license": "bsd-3-clause",
"size": 76104
} | [
"gov.nih.nci.ncicb.cadsr.common.resource.Form",
"gov.nih.nci.ncicb.cadsr.common.resource.Module",
"gov.nih.nci.ncicb.cadsr.common.struts.formbeans.GenericDynaFormBean",
"java.io.IOException",
"java.util.List",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.ht... | import gov.nih.nci.ncicb.cadsr.common.resource.Form; import gov.nih.nci.ncicb.cadsr.common.resource.Module; import gov.nih.nci.ncicb.cadsr.common.struts.formbeans.GenericDynaFormBean; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; ... | import gov.nih.nci.ncicb.cadsr.common.resource.*; import gov.nih.nci.ncicb.cadsr.common.struts.formbeans.*; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; | [
"gov.nih.nci",
"java.io",
"java.util",
"javax.servlet",
"org.apache.struts"
] | gov.nih.nci; java.io; java.util; javax.servlet; org.apache.struts; | 1,539,583 |
private void doFeat(final OutputStream output) throws IOException {
println(output, "211 No features.");
} | void function(final OutputStream output) throws IOException { println(output, STR); } | /**
* Sends response to FEAT (features) control command.
*
* @param output output to write response
* @throws IOException socket IO exception
*/ | Sends response to FEAT (features) control command | doFeat | {
"repo_name": "kokorin/Jaffree",
"path": "src/main/java/com/github/kokorin/jaffree/net/FtpServer.java",
"license": "apache-2.0",
"size": 14169
} | [
"java.io.IOException",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,519,138 |
public final Database getPartDatabase() {
return partDb;
} | final Database function() { return partDb; } | /**
* Return the part storage container.
*/ | Return the part storage container | getPartDatabase | {
"repo_name": "mollstam/UnrealPy",
"path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/db-4.7.25.0/examples_java/src/collections/ship/tuple/SampleDatabase.java",
"license": "mit",
"size": 11795
} | [
"com.sleepycat.db.Database"
] | import com.sleepycat.db.Database; | import com.sleepycat.db.*; | [
"com.sleepycat.db"
] | com.sleepycat.db; | 1,289,231 |
@Override
public void warning(final Marker marker, final String message, final Throwable throwable) {
logWrapper.logIfEnabled(loggerName, Level.WARN, marker, message, throwable);
} | void function(final Marker marker, final String message, final Throwable throwable) { logWrapper.logIfEnabled(loggerName, Level.WARN, marker, message, throwable); } | /**
* Logs a message at the {@code Level.WARN} level including the stack trace of the
* {@link Throwable} {@code throwable} passed as parameter.
*
* @param marker the marker data specific to this log statement
* @param message the message to log.
* @param throwable the exception to log, including its ... | Logs a message at the Level.WARN level including the stack trace of the <code>Throwable</code> throwable passed as parameter | warning | {
"repo_name": "PurelyApplied/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogWriterLogger.java",
"license": "apache-2.0",
"size": 56907
} | [
"org.apache.logging.log4j.Level",
"org.apache.logging.log4j.Marker"
] | import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Marker; | import org.apache.logging.log4j.*; | [
"org.apache.logging"
] | org.apache.logging; | 2,215,555 |
public void toFile(String filename) throws IOException {
PrintWriter out =
new PrintWriter(new BufferedWriter(new FileWriter(filename)));
for (int i=0; i<partition.length; i++) {
out.println(magnitude * partition[i]);
}
out.flush();
out.close();
} | void function(String filename) throws IOException { PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(filename))); for (int i=0; i<partition.length; i++) { out.println(magnitude * partition[i]); } out.flush(); out.close(); } | /** Write the parameters alpha_i to the specified file, one
* per line
*/ | Write the parameters alpha_i to the specified file, one per line | toFile | {
"repo_name": "cmoen/mallet",
"path": "src/cc/mallet/types/Dirichlet.java",
"license": "epl-1.0",
"size": 44607
} | [
"java.io.BufferedWriter",
"java.io.FileWriter",
"java.io.IOException",
"java.io.PrintWriter"
] | import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 2,721,951 |
EReference getMappingRelation_SoftwareElements(); | EReference getMappingRelation_SoftwareElements(); | /**
* Returns the meta object for the reference list '{@link ch.hilbri.assist.model.MappingRelation#getSoftwareElements <em>Software Elements</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Software Elements</em>'.
* @see ch.hilbri... | Returns the meta object for the reference list '<code>ch.hilbri.assist.model.MappingRelation#getSoftwareElements Software Elements</code>'. | getMappingRelation_SoftwareElements | {
"repo_name": "RobertHilbrich/assist",
"path": "ch.hilbri.assist.model/src-gen/ch/hilbri/assist/model/ModelPackage.java",
"license": "gpl-2.0",
"size": 419306
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 304,229 |
public void setMonitoringScouts(Set monitoringScoutsIn) {
this.monitoringScouts = monitoringScoutsIn;
} | void function(Set monitoringScoutsIn) { this.monitoringScouts = monitoringScoutsIn; } | /**
* Sets the monitoring Scouts for this Org.
* @param monitoringScoutsIn the new set of Monitoring scouts
*/ | Sets the monitoring Scouts for this Org | setMonitoringScouts | {
"repo_name": "colloquium/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/org/Org.java",
"license": "gpl-2.0",
"size": 20150
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 530,018 |
protected String resolveGrammarURI(Document document, String publicId, String systemId)
{
return systemId;
}
| String function(Document document, String publicId, String systemId) { return systemId; } | /**
* This method should be specialized in order to implement specialized uri resolution
*/ | This method should be specialized in order to implement specialized uri resolution | resolveGrammarURI | {
"repo_name": "ttimbul/eclipse.wst",
"path": "bundles/org.eclipse.wst.xml.core/src-contentmodel/org/eclipse/wst/xml/core/internal/contentmodel/modelqueryimpl/XMLAssociationProvider.java",
"license": "epl-1.0",
"size": 20286
} | [
"org.w3c.dom.Document"
] | import org.w3c.dom.Document; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 101,814 |
public List<ArmTemplateParameterProperties> parameters() {
return this.parameters;
} | List<ArmTemplateParameterProperties> function() { return this.parameters; } | /**
* Get the parameters of the Azure Resource Manager template.
*
* @return the parameters value
*/ | Get the parameters of the Azure Resource Manager template | parameters | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/devtestlabs/mgmt-v2018_09_15/src/main/java/com/microsoft/azure/management/devtestlabs/v2018_09_15/EnvironmentDeploymentProperties.java",
"license": "mit",
"size": 1984
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,199,619 |
public static String getFile(String uri, String ingesterName, String userAgent) {
int id = uri.hashCode();
if (id < 0) {
id *= -1;
}
String rssString = "rss_" + id + ".rss";
String fullPath = RSS_VTL_PATH + rssString;
try {
java.io.File file;
file = new java.io.File(fullPath);
boole... | static String function(String uri, String ingesterName, String userAgent) { int id = uri.hashCode(); if (id < 0) { id *= -1; } String rssString = "rss_" + id + ".rss"; String fullPath = RSS_VTL_PATH + rssString; try { java.io.File file; file = new java.io.File(fullPath); boolean requireWriteFile = false; if (!file.exis... | /**
* Get the full path of the cached rss feed file in dotcms from a specific uri.
* @param uri String with rss feed uri
* @param ingesterName String
* @param userAgent String with a specific user agent. Specify when the rss feed site is filtering the user agent request header. Example: "Mozilla/4.0 (compat... | Get the full path of the cached rss feed file in dotcms from a specific uri | getFile | {
"repo_name": "wisdom-garden/dotcms",
"path": "src/com/dotmarketing/viewtools/RSSWebAPI.java",
"license": "gpl-3.0",
"size": 15355
} | [
"com.dotmarketing.util.Logger",
"java.io.File",
"java.util.Calendar",
"java.util.Date",
"java.util.GregorianCalendar"
] | import com.dotmarketing.util.Logger; import java.io.File; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; | import com.dotmarketing.util.*; import java.io.*; import java.util.*; | [
"com.dotmarketing.util",
"java.io",
"java.util"
] | com.dotmarketing.util; java.io; java.util; | 582,387 |
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("<TABLE border=2>");
sb.append("<tr><th colspan=2 bgcolor=grey>");
sb.append("CGIEnvironment Info</th></tr>");
sb.append("<tr><td>Debug Level</td><td>");
sb.appe... | String function() { StringBuffer sb = new StringBuffer(); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(STR); sb.append(debug); sb.append(STR); sb.append(STR); sb.append(isValid()); sb.append(STR); if (isValid()) { Enumeration envk = env.keys(); while (envk.hasMoreElements()) { String s = (String) envk.next... | /**
* Print important CGI environment information in a easy-to-read HTML
* table
*
* @return HTML string containing CGI environment info
*
*/ | Print important CGI environment information in a easy-to-read HTML table | toString | {
"repo_name": "devjin24/howtomcatworks",
"path": "bookrefer/jakarta-tomcat-5.0.18-src/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java",
"license": "apache-2.0",
"size": 68242
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 1,219,756 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.