method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static Map<FlightControlType, Double> doubletSeries(Map<FlightControlType, Double> controls, double t) {
// Update controls with an aileron doublet
controls = makeDoublet(controls,
t,
10.0,
0.5,
0.035,
FlightControlType.A... | static Map<FlightControlType, Double> function(Map<FlightControlType, Double> controls, double t) { controls = makeDoublet(controls, t, 10.0, 0.5, 0.035, FlightControlType.AILERON); controls = makeDoublet(controls, t, 13.0, 0.5, 0.035, FlightControlType.RUDDER); controls = makeDoublet(controls, t, 50.0, 0.5, 0.035, Fli... | /**
* Creates a series of doublets (aileron, rudder and then elevator) using the makeDoublet methods. It is used
* when the simulation is set to {@link Options#ANALYSIS_MODE} to examine the transient dynamic response of
* the aircraft in the simulation
*
* @param controls
* @param t
*... | Creates a series of doublets (aileron, rudder and then elevator) using the makeDoublet methods. It is used when the simulation is set to <code>Options#ANALYSIS_MODE</code> to examine the transient dynamic response of the aircraft in the simulation | doubletSeries | {
"repo_name": "hervegirod/j6dof-flight-sim",
"path": "src/flightsim/com/chrisali/javaflightsim/simulation/controls/FlightControlsUtilities.java",
"license": "gpl-3.0",
"size": 6392
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 181,295 |
protected void drawCornerTextItems(Graphics2D g2, Rectangle2D area) {
if (this.cornerTextItems.isEmpty()) {
return;
}
g2.setColor(Color.black);
double width = 0.0;
double height = 0.0;
for (Iterator it = this.cornerTextItems.iterator(); it.hasNext();) {
... | void function(Graphics2D g2, Rectangle2D area) { if (this.cornerTextItems.isEmpty()) { return; } g2.setColor(Color.black); double width = 0.0; double height = 0.0; for (Iterator it = this.cornerTextItems.iterator(); it.hasNext();) { String msg = (String) it.next(); FontMetrics fm = g2.getFontMetrics(); Rectangle2D boun... | /**
* Draws the corner text items.
*
* @param g2 the drawing surface.
* @param area the area.
*/ | Draws the corner text items | drawCornerTextItems | {
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/plot/PolarPlot.java",
"license": "lgpl-3.0",
"size": 71134
} | [
"java.awt.Color",
"java.awt.FontMetrics",
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"java.util.Iterator",
"org.jfree.text.TextUtilities"
] | import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import java.util.Iterator; import org.jfree.text.TextUtilities; | import java.awt.*; import java.awt.geom.*; import java.util.*; import org.jfree.text.*; | [
"java.awt",
"java.util",
"org.jfree.text"
] | java.awt; java.util; org.jfree.text; | 800,555 |
public void setBook(Book book) {
this.book = book;
}
| void function(Book book) { this.book = book; } | /**
* setBook is the setter method of the field book
* TODO document the method
* @param book the book to set
*/ | setBook is the setter method of the field book TODO document the method | setBook | {
"repo_name": "entrofi/jeetutorials",
"path": "jsfwithjpa/src/main/java/net/entrofi/tutorials/jee/jsfwithjpa/BookManagedBean.java",
"license": "apache-2.0",
"size": 2564
} | [
"net.entrofi.tutorials.jee.jsfwithjpa.persistence.Book"
] | import net.entrofi.tutorials.jee.jsfwithjpa.persistence.Book; | import net.entrofi.tutorials.jee.jsfwithjpa.persistence.*; | [
"net.entrofi.tutorials"
] | net.entrofi.tutorials; | 2,097,639 |
protected JobDetail createJob(String content, Event event, boolean isStartEvent) {
String jobIdentity = event.getICalUID() + (isStartEvent ? "_start" : "_end");
if (StringUtils.isBlank(content)) {
logger.debug("content of job '{}' is empty -> no task will be created!", jobIdentity);
... | JobDetail function(String content, Event event, boolean isStartEvent) { String jobIdentity = event.getICalUID() + (isStartEvent ? STR : "_end"); if (StringUtils.isBlank(content)) { logger.debug(STR, jobIdentity); return null; } JobDetail job = newJob(ExecuteCommandJob.class).usingJobData(ExecuteCommandJob.JOB_DATA_CONT... | /**
* Creates a new quartz-job with jobData <code>content</code> in the scheduler
* group <code>GCAL_SCHEDULER_GROUP</code> if <code>content</code> is not
* blank.
*
* @param content the set of commands to be executed by the
* {@link ExecuteCommandJob} later on
* @param eve... | Creates a new quartz-job with jobData <code>content</code> in the scheduler group <code>GCAL_SCHEDULER_GROUP</code> if <code>content</code> is not blank | createJob | {
"repo_name": "gerrieg/openhab",
"path": "bundles/io/org.openhab.io.gcal/src/main/java/org/openhab/io/gcal/internal/GCalEventDownloader.java",
"license": "epl-1.0",
"size": 22767
} | [
"com.google.api.services.calendar.model.Event",
"javax.annotation.meta.When",
"org.apache.commons.lang.StringUtils",
"org.openhab.io.gcal.internal.util.ExecuteCommandJob",
"org.quartz.JobBuilder",
"org.quartz.JobDetail"
] | import com.google.api.services.calendar.model.Event; import javax.annotation.meta.When; import org.apache.commons.lang.StringUtils; import org.openhab.io.gcal.internal.util.ExecuteCommandJob; import org.quartz.JobBuilder; import org.quartz.JobDetail; | import com.google.api.services.calendar.model.*; import javax.annotation.meta.*; import org.apache.commons.lang.*; import org.openhab.io.gcal.internal.util.*; import org.quartz.*; | [
"com.google.api",
"javax.annotation",
"org.apache.commons",
"org.openhab.io",
"org.quartz"
] | com.google.api; javax.annotation; org.apache.commons; org.openhab.io; org.quartz; | 1,067,338 |
public final List<Tag> getTags() {
return tags;
} | final List<Tag> function() { return tags; } | /**
* {@link Tag}s associated with this aggregation.
*
* <p>Note: The returned list is unmodifiable, attempts to update it will throw an
* UnsupportedOperationException.
*/ | <code>Tag</code>s associated with this aggregation. Note: The returned list is unmodifiable, attempts to update it will throw an UnsupportedOperationException | getTags | {
"repo_name": "ubschmidt2/instrumentation-java",
"path": "core/src/main/java/io/opencensus/stats/IntervalAggregate.java",
"license": "apache-2.0",
"size": 2807
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 678,546 |
public void createToast(final String message) {
if (message == null) {
LogIt.e(TAG, "Failed to create toast, as the message was passed null");
return;
}
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() { | void function(final String message) { if (message == null) { LogIt.e(TAG, STR); return; } Handler handler = new Handler(Looper.getMainLooper()); handler.post(new Runnable() { | /**
* Simply creates a toast message
* @param message - The message to be shown on the toast.
*/ | Simply creates a toast message | createToast | {
"repo_name": "Hardik4560/Prototypes",
"path": "ADroidUtils/src/com/hardy/utils/ToastMaker.java",
"license": "apache-2.0",
"size": 3109
} | [
"android.os.Handler",
"android.os.Looper",
"com.hardy.logging.LogIt"
] | import android.os.Handler; import android.os.Looper; import com.hardy.logging.LogIt; | import android.os.*; import com.hardy.logging.*; | [
"android.os",
"com.hardy.logging"
] | android.os; com.hardy.logging; | 803,121 |
public void setGeogig(@Nullable GeoGIG geogig) {
this.geogig = geogig;
} | void function(@Nullable GeoGIG geogig) { this.geogig = geogig; } | /**
* Gives the command line interface a GeoGIG facade to use.
*
* @param geogig
*/ | Gives the command line interface a GeoGIG facade to use | setGeogig | {
"repo_name": "mtCarto/geogig",
"path": "src/cli/src/main/java/org/locationtech/geogig/cli/GeogigCLI.java",
"license": "bsd-3-clause",
"size": 30155
} | [
"org.eclipse.jdt.annotation.Nullable",
"org.locationtech.geogig.repository.impl.GeoGIG"
] | import org.eclipse.jdt.annotation.Nullable; import org.locationtech.geogig.repository.impl.GeoGIG; | import org.eclipse.jdt.annotation.*; import org.locationtech.geogig.repository.impl.*; | [
"org.eclipse.jdt",
"org.locationtech.geogig"
] | org.eclipse.jdt; org.locationtech.geogig; | 2,018,461 |
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<BackupShortTermRetentionPolicyInner> listByDatabase(
String resourceGroupName, String serverName, String databaseName); | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<BackupShortTermRetentionPolicyInner> listByDatabase( String resourceGroupName, String serverName, String databaseName); | /**
* Gets a database's short term retention policy.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serverName The name of the server.
* @param databaseName ... | Gets a database's short term retention policy | listByDatabase | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/BackupShortTermRetentionPoliciesClient.java",
"license": "mit",
"size": 29597
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.resourcemanager.sql.fluent.models.BackupShortTermRetentionPolicyInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.sql.fluent.models.BackupShortTermRetentionPolicyInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.sql.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,566,961 |
public static TaskoSchedule lookupScheduleById(Long scheduleId) {
Map params = new HashMap();
params.put("schedule_id", scheduleId);
return (TaskoSchedule) singleton.lookupObjectByNamedQuery(
"TaskoSchedule.lookupById", params);
} | static TaskoSchedule function(Long scheduleId) { Map params = new HashMap(); params.put(STR, scheduleId); return (TaskoSchedule) singleton.lookupObjectByNamedQuery( STR, params); } | /**
* lookup schedule by id
* @param scheduleId schedule id
* @return schedule
*/ | lookup schedule by id | lookupScheduleById | {
"repo_name": "colloquium/spacewalk",
"path": "java/code/src/com/redhat/rhn/taskomatic/TaskoFactory.java",
"license": "gpl-2.0",
"size": 14633
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,014,634 |
@Test
@Ignore
public void uploadMetadataAsync() {
final Schema schema = new Schema(Collections.singletonList(Field.nullable("a", new ArrowType.Int(32, true))));
test((allocator, client) -> {
try (final VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator)) {
final FlightDescript... | void function() { final Schema schema = new Schema(Collections.singletonList(Field.nullable("a", new ArrowType.Int(32, true)))); test((allocator, client) -> { try (final VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator)) { final FlightDescriptor descriptor = FlightDescriptor.path("test"); final PutList... | /**
* Ensure that a client can send metadata to the server.
*/ | Ensure that a client can send metadata to the server | uploadMetadataAsync | {
"repo_name": "laurentgo/arrow",
"path": "java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestApplicationMetadata.java",
"license": "apache-2.0",
"size": 13072
} | [
"java.util.Collections",
"org.apache.arrow.flight.FlightClient",
"org.apache.arrow.vector.VectorSchemaRoot",
"org.apache.arrow.vector.types.pojo.ArrowType",
"org.apache.arrow.vector.types.pojo.Field",
"org.apache.arrow.vector.types.pojo.Schema"
] | import java.util.Collections; import org.apache.arrow.flight.FlightClient; import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.types.pojo.ArrowType; import org.apache.arrow.vector.types.pojo.Field; import org.apache.arrow.vector.types.pojo.Schema; | import java.util.*; import org.apache.arrow.flight.*; import org.apache.arrow.vector.*; import org.apache.arrow.vector.types.pojo.*; | [
"java.util",
"org.apache.arrow"
] | java.util; org.apache.arrow; | 1,698,132 |
public void fine(
String sourceClass,
String sourceMethod,
String msg,
Object[] params
)
{
logp(Level.FINE, sourceClass, sourceMethod, msg, params);
} | void function( String sourceClass, String sourceMethod, String msg, Object[] params ) { logp(Level.FINE, sourceClass, sourceMethod, msg, params); } | /**
* Log a FINE message, with an array of object arguments.
* <p>
* The message is forwarded to appropriate Java Logger objects.
* <p>
* @param sourceClass the name of the class that issued the logging request
* @param sourceMethod the name of the method that issued the logging request... | Log a FINE message, with an array of object arguments. The message is forwarded to appropriate Java Logger objects. | fine | {
"repo_name": "kulinski/myfaces",
"path": "impl/src/main/java/org/apache/myfaces/logging/MyfacesLogger.java",
"license": "apache-2.0",
"size": 63180
} | [
"java.util.logging.Level"
] | import java.util.logging.Level; | import java.util.logging.*; | [
"java.util"
] | java.util; | 144,970 |
public Restriction mergeWith(Restriction otherRestriction) throws InvalidRequestException; | Restriction function(Restriction otherRestriction) throws InvalidRequestException; | /**
* Merges this restriction with the specified one.
*
* <p>Restriction are immutable. Therefore merging two restrictions result in a new one.
* The reason behind this choice is that it allow a great flexibility in the way the merging can done while
* preventing any side effect.</p>
*
... | Merges this restriction with the specified one. Restriction are immutable. Therefore merging two restrictions result in a new one. The reason behind this choice is that it allow a great flexibility in the way the merging can done while preventing any side effect | mergeWith | {
"repo_name": "mourao666/cassandra-sim",
"path": "src/java/org/apache/cassandra/cql3/restrictions/Restriction.java",
"license": "apache-2.0",
"size": 5493
} | [
"org.apache.cassandra.exceptions.InvalidRequestException"
] | import org.apache.cassandra.exceptions.InvalidRequestException; | import org.apache.cassandra.exceptions.*; | [
"org.apache.cassandra"
] | org.apache.cassandra; | 1,548,554 |
public static DataResult channelManagement(User user, PageControl pc) {
SelectMode m = ModeFactory.getMode("Channel_queries", "user_manage_perms");
Map<String, Object> params = new HashMap<String, Object>();
params.put("org_id", user.getOrg().getId());
params.put("user_id", user.getI... | static DataResult function(User user, PageControl pc) { SelectMode m = ModeFactory.getMode(STR, STR); Map<String, Object> params = new HashMap<String, Object>(); params.put(STR, user.getOrg().getId()); params.put(STR, user.getId()); return makeDataResult(params, new HashMap(), pc, m); } | /**
* Retrieve the list of Channels the user can manage
* @param user The user who's channels to search for.
* @param pc The details of which results to return.
* @return A list containing the specified number of channels.
*/ | Retrieve the list of Channels the user can manage | channelManagement | {
"repo_name": "xkollar/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/user/UserManager.java",
"license": "gpl-2.0",
"size": 42980
} | [
"com.redhat.rhn.common.db.datasource.DataResult",
"com.redhat.rhn.common.db.datasource.ModeFactory",
"com.redhat.rhn.common.db.datasource.SelectMode",
"com.redhat.rhn.domain.user.User",
"com.redhat.rhn.frontend.listview.PageControl",
"java.util.HashMap",
"java.util.Map"
] | import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.listview.PageControl; import java.util.HashMap; import java.util.Map; | import com.redhat.rhn.common.db.datasource.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.listview.*; import java.util.*; | [
"com.redhat.rhn",
"java.util"
] | com.redhat.rhn; java.util; | 287,006 |
public void setDefaultProperties(Map<String, Object> defaultProperties) {
this.defaultProperties = defaultProperties;
}
/**
* Convenient alternative to {@link #setDefaultProperties(Map)}.
* @param defaultProperties some {@link Properties} | void function(Map<String, Object> defaultProperties) { this.defaultProperties = defaultProperties; } /** * Convenient alternative to {@link #setDefaultProperties(Map)}. * @param defaultProperties some {@link Properties} | /**
* Set default environment properties which will be used in addition to those in the
* existing {@link Environment}.
* @param defaultProperties the additional properties to set
*/ | Set default environment properties which will be used in addition to those in the existing <code>Environment</code> | setDefaultProperties | {
"repo_name": "jayarampradhan/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/SpringApplication.java",
"license": "apache-2.0",
"size": 49877
} | [
"java.util.Map",
"java.util.Properties"
] | import java.util.Map; import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 406,207 |
List<PetType> findPetTypes() throws DataAccessException; | List<PetType> findPetTypes() throws DataAccessException; | /**
* Retrieve all <code>PetType</code>s from the data store.
*
* @return a <code>Collection</code> of <code>PetType</code>s
*/ | Retrieve all <code>PetType</code>s from the data store | findPetTypes | {
"repo_name": "osanchezhuerta/hospitalbooklet-app",
"path": "hospitalbooklet/hospitalbooklet-soa/hospitalbooklet-soa-persistence/src/main/java/org/osanchezhuerta/hospitalbooklet/soa/persistence/dao/PetRepository.java",
"license": "apache-2.0",
"size": 2020
} | [
"java.util.List",
"org.osanchezhuerta.hospitalbooklet.soa.model.PetType",
"org.springframework.dao.DataAccessException"
] | import java.util.List; import org.osanchezhuerta.hospitalbooklet.soa.model.PetType; import org.springframework.dao.DataAccessException; | import java.util.*; import org.osanchezhuerta.hospitalbooklet.soa.model.*; import org.springframework.dao.*; | [
"java.util",
"org.osanchezhuerta.hospitalbooklet",
"org.springframework.dao"
] | java.util; org.osanchezhuerta.hospitalbooklet; org.springframework.dao; | 771,470 |
public EncoderTestSuiteBuilder validSuite() {
int cardinality = _encoded.cardinality() + _invalid.cardinality() + _valid.cardinality();
if (cardinality != Character.MAX_CODE_POINT + 1) {
throw new AssertionError("incomplete coverage: "+cardinality+" != "+(Character.MAX_CODE_POINT+1));
... | EncoderTestSuiteBuilder function() { int cardinality = _encoded.cardinality() + _invalid.cardinality() + _valid.cardinality(); if (cardinality != Character.MAX_CODE_POINT + 1) { throw new AssertionError(STR+cardinality+STR+(Character.MAX_CODE_POINT+1)); } TestSuite suite = new TestSuite("valid"); int min = _valid.nextS... | /**
* Creates and adds a test suite of valid, unescaped characters, to
* the test suite. Must be called after telling the builder which
* characters are valid, invalid, and encoded.
*
* @return this.
*/ | Creates and adds a test suite of valid, unescaped characters, to the test suite. Must be called after telling the builder which characters are valid, invalid, and encoded | validSuite | {
"repo_name": "sillysachin/owasp-java-encoder",
"path": "core/src/test/java/org/owasp/encoder/EncoderTestSuiteBuilder.java",
"license": "bsd-3-clause",
"size": 20520
} | [
"junit.framework.TestSuite"
] | import junit.framework.TestSuite; | import junit.framework.*; | [
"junit.framework"
] | junit.framework; | 702,999 |
public void clearXmlData()
{
ScriptBuffer script = new ScriptBuffer();
script.appendCall(getContextPath() + "clearXmlData");
ScriptSessions.addScript(script);
} | void function() { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + STR); ScriptSessions.addScript(script); } | /**
* Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF
document.
*/ | Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF | clearXmlData | {
"repo_name": "burris/dwr",
"path": "ui/gi/generated/java/jsx3/gui/Tree.java",
"license": "apache-2.0",
"size": 87147
} | [
"org.directwebremoting.ScriptBuffer",
"org.directwebremoting.ScriptSessions"
] | import org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSessions; | import org.directwebremoting.*; | [
"org.directwebremoting"
] | org.directwebremoting; | 1,788,911 |
Set<RegisteredProject> doImport(
Set<? extends NewProjectConfig> projectConfigs,
boolean rewrite,
BiConsumer<String, String> consumer)
throws ServerException, ForbiddenException, UnauthorizedException, ConflictException,
NotFoundException, BadRequestException; | Set<RegisteredProject> doImport( Set<? extends NewProjectConfig> projectConfigs, boolean rewrite, BiConsumer<String, String> consumer) throws ServerException, ForbiddenException, UnauthorizedException, ConflictException, NotFoundException, BadRequestException; | /**
* Import all projects with specified configurations
*
* @param projectConfigs project configurations
* @param rewrite rewrite on import project marker
* @param consumer json rpc message transmitter
* @return
* @throws ServerException
* @throws ForbiddenException
* @throws UnauthorizedExce... | Import all projects with specified configurations | doImport | {
"repo_name": "akervern/che",
"path": "wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/ProjectManager.java",
"license": "epl-1.0",
"size": 13671
} | [
"java.util.Set",
"java.util.function.BiConsumer",
"org.eclipse.che.api.core.BadRequestException",
"org.eclipse.che.api.core.ConflictException",
"org.eclipse.che.api.core.ForbiddenException",
"org.eclipse.che.api.core.NotFoundException",
"org.eclipse.che.api.core.ServerException",
"org.eclipse.che.api.... | import java.util.Set; import java.util.function.BiConsumer; import org.eclipse.che.api.core.BadRequestException; import org.eclipse.che.api.core.ConflictException; import org.eclipse.che.api.core.ForbiddenException; import org.eclipse.che.api.core.NotFoundException; import org.eclipse.che.api.core.ServerException; impo... | import java.util.*; import java.util.function.*; import org.eclipse.che.api.core.*; import org.eclipse.che.api.project.shared.*; | [
"java.util",
"org.eclipse.che"
] | java.util; org.eclipse.che; | 2,229,702 |
public Widget getDefaultWidget(Class<? extends Item> itemType, String itemName);
| Widget function(Class<? extends Item> itemType, String itemName); | /**
* Provides a default widget for a given item (class). This is used whenever
* the UI needs to be created dynamically and there is no other source
* of information about the widgets.
*
* @param itemType the class of the item
* @param itemName the item name to get the default widge... | Provides a default widget for a given item (class). This is used whenever the UI needs to be created dynamically and there is no other source of information about the widgets | getDefaultWidget | {
"repo_name": "computergeek1507/openhab",
"path": "bundles/api/org.openhab.core1/src/main/java/org/openhab/ui/items/ItemUIProvider.java",
"license": "epl-1.0",
"size": 2824
} | [
"org.openhab.core.items.Item",
"org.openhab.model.sitemap.Widget"
] | import org.openhab.core.items.Item; import org.openhab.model.sitemap.Widget; | import org.openhab.core.items.*; import org.openhab.model.sitemap.*; | [
"org.openhab.core",
"org.openhab.model"
] | org.openhab.core; org.openhab.model; | 1,766,432 |
private Component makeLabelPanel() {
JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
ButtonGroup bg = new ButtonGroup();
bg.add(generateButton);
generateButton.addActionListener(this);
labelPanel.add(generateButton);
return labelPanel;
} | Component function() { JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); ButtonGroup bg = new ButtonGroup(); bg.add(generateButton); generateButton.addActionListener(this); labelPanel.add(generateButton); return labelPanel; } | /**
* Create a panel containing the title label for the table.
*
* @return a panel containing the title label
*/ | Create a panel containing the title label for the table | makeLabelPanel | {
"repo_name": "vherilier/jmeter",
"path": "test/src/org/apache/jmeter/visualizers/GenerateTreeGui.java",
"license": "apache-2.0",
"size": 8887
} | [
"java.awt.Component",
"java.awt.FlowLayout",
"javax.swing.ButtonGroup",
"javax.swing.JPanel"
] | import java.awt.Component; import java.awt.FlowLayout; import javax.swing.ButtonGroup; import javax.swing.JPanel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,906,371 |
public SendDocument setNewDocument(File file) {
Objects.requireNonNull(file, "documentName cannot be null!");
this.isNewDocument = true;
this.newDocumentFile = file;
return this;
} | SendDocument function(File file) { Objects.requireNonNull(file, STR); this.isNewDocument = true; this.newDocumentFile = file; return this; } | /**
* Use this method to set the document to a new file
*
* @param file New document file
*/ | Use this method to set the document to a new file | setNewDocument | {
"repo_name": "agentlab/CoffeeNow",
"path": "plugins/org.telegram.telegrambots/src/org/telegram/telegrambots/api/methods/send/SendDocument.java",
"license": "epl-1.0",
"size": 7080
} | [
"java.io.File",
"java.util.Objects"
] | import java.io.File; import java.util.Objects; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,493,613 |
public DrawerBuilder withStickyFooter(@LayoutRes int stickyFooterRes) {
if (mActivity == null) {
throw new RuntimeException("please pass an activity first to use this call");
}
if (stickyFooterRes != -1) {
//i know there should be a root, bit i got none here
... | DrawerBuilder function(@LayoutRes int stickyFooterRes) { if (mActivity == null) { throw new RuntimeException(STR); } if (stickyFooterRes != -1) { this.mStickyFooterView = (ViewGroup) mActivity.getLayoutInflater().inflate(stickyFooterRes, null, false); } return this; } | /**
* Add a sticky footer below the DrawerBuilder ListView defined by a resource.
*
* @param stickyFooterRes
* @return
*/ | Add a sticky footer below the DrawerBuilder ListView defined by a resource | withStickyFooter | {
"repo_name": "amithub/Material-Drawer-Sample",
"path": "library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java",
"license": "apache-2.0",
"size": 62341
} | [
"android.support.annotation.LayoutRes",
"android.view.ViewGroup"
] | import android.support.annotation.LayoutRes; import android.view.ViewGroup; | import android.support.annotation.*; import android.view.*; | [
"android.support",
"android.view"
] | android.support; android.view; | 1,908,584 |
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
// for very easy animations. If available, use these APIs to fade-in
// the progress spinner.
if (Build.VERSION.SDK... | @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) void function(final boolean show) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); | /**
* Shows the progress UI and hides the login form.
*/ | Shows the progress UI and hides the login form | showProgress | {
"repo_name": "kblauer/cs-outreach",
"path": "app/src/main/java/com/example/ajeyadav/cstutorialapplication/LoginActivity.java",
"license": "mit",
"size": 13624
} | [
"android.annotation.TargetApi",
"android.os.Build"
] | import android.annotation.TargetApi; import android.os.Build; | import android.annotation.*; import android.os.*; | [
"android.annotation",
"android.os"
] | android.annotation; android.os; | 1,076,819 |
public void xMinYMin() throws ParseException {
align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN;
} | void function() throws ParseException { align = SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMINYMIN; } | /**
* Invoked when 'xMinYMin' has been parsed.
* @exception ParseException if an error occured while processing
* the transform
*/ | Invoked when 'xMinYMin' has been parsed | xMinYMin | {
"repo_name": "git-moss/Push2Display",
"path": "lib/batik-1.8/sources/org/apache/batik/bridge/ViewBox.java",
"license": "lgpl-3.0",
"size": 27281
} | [
"org.apache.batik.parser.ParseException",
"org.w3c.dom.svg.SVGPreserveAspectRatio"
] | import org.apache.batik.parser.ParseException; import org.w3c.dom.svg.SVGPreserveAspectRatio; | import org.apache.batik.parser.*; import org.w3c.dom.svg.*; | [
"org.apache.batik",
"org.w3c.dom"
] | org.apache.batik; org.w3c.dom; | 572,416 |
@Override
public DatabaseMap getDatabaseMap()
{
return this.dbMap;
} | DatabaseMap function() { return this.dbMap; } | /**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/ | Gets the databasemap this map builder built | getDatabaseMap | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/map/TEffortTypeMapBuilder.java",
"license": "gpl-3.0",
"size": 5351
} | [
"org.apache.torque.map.DatabaseMap"
] | import org.apache.torque.map.DatabaseMap; | import org.apache.torque.map.*; | [
"org.apache.torque"
] | org.apache.torque; | 2,301,600 |
public void saveInfo(int fileNum, String info){
try {
String path = ".\\data\\users\\info\\" + fileNum + ".user";
File file = new File(path);
// if file doesnt exists, then create it
if (!file.exists()) {
file.createNewFile();
}
FileWriter writer = new FileWriter(file.getAbsoluteFile(... | void function(int fileNum, String info){ try { String path = STR + fileNum + ".user"; File file = new File(path); if (!file.exists()) { file.createNewFile(); } FileWriter writer = new FileWriter(file.getAbsoluteFile()); writer.write(info); writer.close(); } catch (IOException e) { e.printStackTrace(); } } | /**
* Writes the info to the log file [fileNum].user
* @param user
* @param info
*/ | Writes the info to the log file [fileNum].user | saveInfo | {
"repo_name": "vialab/TandemTable",
"path": "src/TandemTable/Sketch.java",
"license": "gpl-3.0",
"size": 17832
} | [
"java.io.File",
"java.io.FileWriter",
"java.io.IOException"
] | import java.io.File; import java.io.FileWriter; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,670,767 |
public void putProperty(String name, String value) {
if (name == null) {
throw new IllegalArgumentException("The property name must not be null");
}
if (properties == null) {
properties = new TreeMap<>();
}
properties.put(name, value);
} | void function(String name, String value) { if (name == null) { throw new IllegalArgumentException(STR); } if (properties == null) { properties = new TreeMap<>(); } properties.put(name, value); } | /**
* Adds or updates a property value
* <p/>
* If a property exists with the specified name, replaces its value; else adds a new entry.
*
* @param name a String declaring the name of the property to put
* @param value a String containing the value of the property to put
*/ | Adds or updates a property value If a property exists with the specified name, replaces its value; else adds a new entry | putProperty | {
"repo_name": "sekikn/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/KerberosDescriptor.java",
"license": "apache-2.0",
"size": 16005
} | [
"java.util.TreeMap"
] | import java.util.TreeMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,060,631 |
void addPartitions(List<Partition> partitions); | void addPartitions(List<Partition> partitions); | /**
* Add a list of partitions.
* @param partitions partitions to add
*/ | Add a list of partitions | addPartitions | {
"repo_name": "wwjiang007/alluxio",
"path": "table/server/master/src/main/java/alluxio/master/table/PartitionScheme.java",
"license": "apache-2.0",
"size": 1845
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,038,795 |
public static SuperInterfacesIterable ofThisOnly(TClass clazz) {
return new SuperInterfacesIterable(clazz, true);
}
static class SuperInterfacesIterator implements Iterator<TInterface> {
private TClass currClass = null;
private TClass currClassAtLastNextInvocation = null;
private TInterface ne... | static SuperInterfacesIterable function(TClass clazz) { return new SuperInterfacesIterable(clazz, true); } static class SuperInterfacesIterator implements Iterator<TInterface> { private TClass currClass = null; private TClass currClassAtLastNextInvocation = null; private TInterface next = null; private final RecursionG... | /**
* Creates iterable of all directly(!) implemented interfaces of the given class <em>and</em> all their extended
* interfaces.
* <p>
* Difference to method {@link #of(TClassifier)} is that in this case the interfaces implemented by super-classes of
* 'clazz' are <b>NOT</b> included.
*/ | Creates iterable of all directly(!) implemented interfaces of the given class and all their extended interfaces. Difference to method <code>#of(TClassifier)</code> is that in this case the interfaces implemented by super-classes of 'clazz' are NOT included | ofThisOnly | {
"repo_name": "lbeurerkellner/n4js",
"path": "plugins/org.eclipse.n4js.ts.model/src/org/eclipse/n4js/ts/types/util/SuperInterfacesIterable.java",
"license": "epl-1.0",
"size": 7906
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef",
"org.eclipse.n4js.ts.types.TClass",
"org.eclipse.n4js.ts.types.TClassifier",
"org.eclipse.n4js.ts.types.TInterface",
"org.eclipse.n4js.utils.RecursionGuard"
] | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef; import org.eclipse.n4js.ts.types.TClass; import org.eclipse.n4js.ts.types.TClassifier; import org.eclipse.n4js.ts.types.TInterface; import org.eclipse.n4js.utils.RecursionGuard; | import java.util.*; import org.eclipse.n4js.ts.*; import org.eclipse.n4js.ts.types.*; import org.eclipse.n4js.utils.*; | [
"java.util",
"org.eclipse.n4js"
] | java.util; org.eclipse.n4js; | 1,928,755 |
public T castor() {
return dataFormat(new CastorDataFormat());
} | T function() { return dataFormat(new CastorDataFormat()); } | /**
* Uses the Castor data format
*/ | Uses the Castor data format | castor | {
"repo_name": "YMartsynkevych/camel",
"path": "camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java",
"license": "apache-2.0",
"size": 27884
} | [
"org.apache.camel.model.dataformat.CastorDataFormat"
] | import org.apache.camel.model.dataformat.CastorDataFormat; | import org.apache.camel.model.dataformat.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,435,826 |
public RealInterval create(double i_lo, double i_hi) {
return new RealInterval(i_lo, i_hi);
}
private static final RealInterval m_ZERO = new RealInterval(0.0);
private static final RealInterval m_UNIT = new RealInterval(1.0); | RealInterval function(double i_lo, double i_hi) { return new RealInterval(i_lo, i_hi); } private static final RealInterval m_ZERO = new RealInterval(0.0); private static final RealInterval m_UNIT = new RealInterval(1.0); | /** Returns an object of RealInterval whose value is [i_lo, i_hi].
* @param i_l0
* @param i_hi
* @return RealInterval(i_lo, i_hi)
*/ | Returns an object of RealInterval whose value is [i_lo, i_hi] | create | {
"repo_name": "uniker9/JAutoDiff",
"path": "JAutoDiff/src/nilgiri/math/ia/IA_RealIntervalFactory.java",
"license": "mit",
"size": 1465
} | [
"net.sourceforge.interval.ia_math.RealInterval"
] | import net.sourceforge.interval.ia_math.RealInterval; | import net.sourceforge.interval.ia_math.*; | [
"net.sourceforge.interval"
] | net.sourceforge.interval; | 1,118,248 |
public static synchronized IAuthNetworkController getAuthNetworkController() {
return AuthNetworkController.getInstance();
} | static synchronized IAuthNetworkController function() { return AuthNetworkController.getInstance(); } | /**
* Get the AuthNetworkController instance.
*
* @return the AuthNetworkController instance.
*/ | Get the AuthNetworkController instance | getAuthNetworkController | {
"repo_name": "InstaList/instalist-synch",
"path": "src/main/java/org/noorganization/instalistsynch/controller/network/AuthNetworkControllerFactory.java",
"license": "apache-2.0",
"size": 2220
} | [
"org.noorganization.instalistsynch.controller.network.IAuthNetworkController",
"org.noorganization.instalistsynch.controller.network.impl.AuthNetworkController"
] | import org.noorganization.instalistsynch.controller.network.IAuthNetworkController; import org.noorganization.instalistsynch.controller.network.impl.AuthNetworkController; | import org.noorganization.instalistsynch.controller.network.*; import org.noorganization.instalistsynch.controller.network.impl.*; | [
"org.noorganization.instalistsynch"
] | org.noorganization.instalistsynch; | 1,311,316 |
public void testSetCogxelFactory()
{
CogxelVectorConverter instance = new CogxelVectorConverter();
assertSame(instance.getCogxelFactory(), DefaultCogxelFactory.INSTANCE);
CogxelFactory factory = new DefaultCogxelFactory();
instance.setCogxelFactory(factory);
asse... | void function() { CogxelVectorConverter instance = new CogxelVectorConverter(); assertSame(instance.getCogxelFactory(), DefaultCogxelFactory.INSTANCE); CogxelFactory factory = new DefaultCogxelFactory(); instance.setCogxelFactory(factory); assertSame(instance.getCogxelFactory(), factory); instance.setCogxelFactory(null... | /**
* Test of setCogxelFactory method, of class gov.sandia.cognition.framework.learning.CogxelVectorConverter.
*/ | Test of setCogxelFactory method, of class gov.sandia.cognition.framework.learning.CogxelVectorConverter | testSetCogxelFactory | {
"repo_name": "codeaudit/Foundry",
"path": "Components/FrameworkLearning/Test/gov/sandia/cognition/framework/learning/CogxelVectorConverterTest.java",
"license": "bsd-3-clause",
"size": 20909
} | [
"gov.sandia.cognition.framework.CogxelFactory",
"gov.sandia.cognition.framework.DefaultCogxelFactory",
"gov.sandia.cognition.framework.learning.converter.CogxelVectorConverter"
] | import gov.sandia.cognition.framework.CogxelFactory; import gov.sandia.cognition.framework.DefaultCogxelFactory; import gov.sandia.cognition.framework.learning.converter.CogxelVectorConverter; | import gov.sandia.cognition.framework.*; import gov.sandia.cognition.framework.learning.converter.*; | [
"gov.sandia.cognition"
] | gov.sandia.cognition; | 1,902,874 |
public synchronized List<FileObject> getAssetList() {
return new LinkedList<FileObject>(assetList);
} | synchronized List<FileObject> function() { return new LinkedList<FileObject>(assetList); } | /**
* Gets a list of FileObjects that represent all files that have been loaded
* along this asset. This includes textures for models as well as materials
* and other files.
*
* @return
*/ | Gets a list of FileObjects that represent all files that have been loaded along this asset. This includes textures for models as well as materials and other files | getAssetList | {
"repo_name": "jMonkeyEngine/sdk",
"path": "jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java",
"license": "bsd-3-clause",
"size": 16125
} | [
"java.util.LinkedList",
"java.util.List",
"org.openide.filesystems.FileObject"
] | import java.util.LinkedList; import java.util.List; import org.openide.filesystems.FileObject; | import java.util.*; import org.openide.filesystems.*; | [
"java.util",
"org.openide.filesystems"
] | java.util; org.openide.filesystems; | 1,347,420 |
SystemData systemData(); | SystemData systemData(); | /**
* Gets the systemData property: Top level metadata
* https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-contracts.md#system-metadata-for-all-azure-resources.
*
* @return the systemData value.
*/ | Gets the systemData property: Top level metadata HREF | systemData | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/models/Extension.java",
"license": "mit",
"size": 4501
} | [
"com.azure.core.management.SystemData"
] | import com.azure.core.management.SystemData; | import com.azure.core.management.*; | [
"com.azure.core"
] | com.azure.core; | 1,223,107 |
public E peek() throws NoSuchElementException
{
if (isEmpty())
{
throw new NoSuchElementException("Queue is empty");
}
moveItemsIfNecessary();
return remStack.peek();
}
| E function() throws NoSuchElementException { if (isEmpty()) { throw new NoSuchElementException(STR); } moveItemsIfNecessary(); return remStack.peek(); } | /**
* Retrieves the object at the top of the queue without removing it
*
* @return The object at the top of this queue
* @throws NoSuchElementException if the queue contains no items
*
* @time <i>O(1+)</i>
* @space <i>O(1+)</i>
* <br> Amortized complexity depends if resize is required
**/ | Retrieves the object at the top of the queue without removing it | peek | {
"repo_name": "murick/Algorithms",
"path": "Java/src/main/java/collection/queue/api/stack/Solution1.java",
"license": "apache-2.0",
"size": 3753
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 332,052 |
Observable<Map<String, String>> getObservableBalances(); | Observable<Map<String, String>> getObservableBalances(); | /**
* Subscribe-able version of getBalances.
*/ | Subscribe-able version of getBalances | getObservableBalances | {
"repo_name": "EMAXio/heimdal",
"path": "cosigner-api/src/main/java/io/emax/cosigner/api/currency/Monitor.java",
"license": "mpl-2.0",
"size": 1363
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,009,190 |
@Override
public void setReportOutputDirectory( File reportOutputDirectory )
{
updateReportOutputDirectory( reportOutputDirectory, destDir );
}
| void function( File reportOutputDirectory ) { updateReportOutputDirectory( reportOutputDirectory, destDir ); } | /**
* Method to set the directory where the generated reports will be put
*
* @param reportOutputDirectory the directory file to be set
*/ | Method to set the directory where the generated reports will be put | setReportOutputDirectory | {
"repo_name": "mcculls/maven-plugins",
"path": "maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/TestJavadocReport.java",
"license": "apache-2.0",
"size": 12334
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,831,188 |
private String toCookieStr(Cookie[] cookies) {
String cookieStr = "";
for (Cookie c : cookies) {
cookieStr += c.getName() + "=" + c.getValue() + " ;\n";
}
return cookieStr;
} | String function(Cookie[] cookies) { String cookieStr = STR=STR ;\n"; } return cookieStr; } | /**
* Convert cookie array to human readable cookie string
* @param cookies Cookie Array
* @return String containing all the cookies separated by a newline character.
* Each cookie is of the format [key]=[value]
*/ | Convert cookie array to human readable cookie string | toCookieStr | {
"repo_name": "vergilchiu/hive",
"path": "service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java",
"license": "apache-2.0",
"size": 22716
} | [
"javax.servlet.http.Cookie"
] | import javax.servlet.http.Cookie; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 260,032 |
public void initializeOutput(ExtractorOutput output, int trackId) throws ParserException {
String mimeType;
int maxInputSize = Format.NO_VALUE;
@C.PcmEncoding int pcmEncoding = Format.NO_VALUE;
List<byte[]> initializationData = null;
switch (codecId) {
case CODEC_ID_VP8:
... | void function(ExtractorOutput output, int trackId) throws ParserException { String mimeType; int maxInputSize = Format.NO_VALUE; @C.PcmEncoding int pcmEncoding = Format.NO_VALUE; List<byte[]> initializationData = null; switch (codecId) { case CODEC_ID_VP8: mimeType = MimeTypes.VIDEO_VP8; break; case CODEC_ID_VP9: mimeT... | /**
* Initializes the track with an output.
*/ | Initializes the track with an output | initializeOutput | {
"repo_name": "profosure/porogram",
"path": "TMessagesProj/src/main/java/com/porogram/profosure1/messenger/exoplayer2/extractor/mkv/MatroskaExtractor.java",
"license": "gpl-2.0",
"size": 65805
} | [
"com.porogram.profosure1.messenger.exoplayer2.Format",
"com.porogram.profosure1.messenger.exoplayer2.ParserException",
"com.porogram.profosure1.messenger.exoplayer2.extractor.ExtractorOutput",
"com.porogram.profosure1.messenger.exoplayer2.util.MimeTypes",
"com.porogram.profosure1.messenger.exoplayer2.util.P... | import com.porogram.profosure1.messenger.exoplayer2.Format; import com.porogram.profosure1.messenger.exoplayer2.ParserException; import com.porogram.profosure1.messenger.exoplayer2.extractor.ExtractorOutput; import com.porogram.profosure1.messenger.exoplayer2.util.MimeTypes; import com.porogram.profosure1.messenger.exo... | import com.porogram.profosure1.messenger.exoplayer2.*; import com.porogram.profosure1.messenger.exoplayer2.extractor.*; import com.porogram.profosure1.messenger.exoplayer2.util.*; import com.porogram.profosure1.messenger.exoplayer2.video.*; import java.nio.*; import java.util.*; | [
"com.porogram.profosure1",
"java.nio",
"java.util"
] | com.porogram.profosure1; java.nio; java.util; | 532,152 |
FileCollection getFiles(); | FileCollection getFiles(); | /**
* Returns the files attached to this dependency.
*
* @since 3.3
*/ | Returns the files attached to this dependency | getFiles | {
"repo_name": "gradle/gradle",
"path": "subprojects/core-api/src/main/java/org/gradle/api/artifacts/FileCollectionDependency.java",
"license": "apache-2.0",
"size": 1041
} | [
"org.gradle.api.file.FileCollection"
] | import org.gradle.api.file.FileCollection; | import org.gradle.api.file.*; | [
"org.gradle.api"
] | org.gradle.api; | 1,877,485 |
public boolean doesAllowProject(ProjectView project) {
return !filteredOutProjectNames.contains(project.getName());
} | boolean function(ProjectView project) { return !filteredOutProjectNames.contains(project.getName()); } | /**
* Determines if the specified project should be allowed or not.
*
* @param project the project in question
* @return true to allow it, false not to.
*/ | Determines if the specified project should be allowed or not | doesAllowProject | {
"repo_name": "cams7/gradle-samples",
"path": "plugin/ui/src/main/java/org/gradle/gradleplugin/foundation/filters/BasicProjectAndTaskFilter.java",
"license": "gpl-2.0",
"size": 7294
} | [
"org.gradle.foundation.ProjectView"
] | import org.gradle.foundation.ProjectView; | import org.gradle.foundation.*; | [
"org.gradle.foundation"
] | org.gradle.foundation; | 2,737,452 |
@Test
public void doFilterDefaultRequireCsrfProtectionMatcherAllowedMethodsCaseSensitive()
throws Exception {
this.filter = new CsrfFilter(this.tokenRepository);
this.filter.setAccessDeniedHandler(this.deniedHandler);
for (String method : Arrays.asList("get", "TrAcE", "oPTIOnS", "hEaD")) {
resetRequest... | void function() throws Exception { this.filter = new CsrfFilter(this.tokenRepository); this.filter.setAccessDeniedHandler(this.deniedHandler); for (String method : Arrays.asList("get", "TrAcE", STR, "hEaD")) { resetRequestResponse(); when(this.tokenRepository.loadToken(this.request)).thenReturn(this.token); this.reques... | /**
* SEC-2292 Should not allow other cases through since spec states HTTP method is case
* sensitive http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
* @throws Exception if an error occurs
*
*/ | SEC-2292 Should not allow other cases through since spec states HTTP method is case sensitive HREF | doFilterDefaultRequireCsrfProtectionMatcherAllowedMethodsCaseSensitive | {
"repo_name": "thomasdarimont/spring-security",
"path": "web/src/test/java/org/springframework/security/web/csrf/CsrfFilterTests.java",
"license": "apache-2.0",
"size": 15742
} | [
"java.util.Arrays",
"org.mockito.Matchers",
"org.mockito.Mockito"
] | import java.util.Arrays; import org.mockito.Matchers; import org.mockito.Mockito; | import java.util.*; import org.mockito.*; | [
"java.util",
"org.mockito"
] | java.util; org.mockito; | 1,916,459 |
public void testSearchEngineRegexReplaceAllWithCapturedGroups() throws BadLocationException {
SearchContext context = new SearchContext();
context.setRegularExpression(true);
// A single captured group.
context.setSearchFor("r(o+)t");
textArea.setText("root roOt root");
String expected = "oo oO oo";
... | void function() throws BadLocationException { SearchContext context = new SearchContext(); context.setRegularExpression(true); context.setSearchFor(STR); textArea.setText(STR); String expected = STR; context.setMatchCase(false); context.setWholeWord(false); context.setReplaceWith("$1"); int count = replaceAllImpl(conte... | /**
* Tests <code>SearchEngine.replaceAll()</code> when the replacement string
* has captured groups.
*/ | Tests <code>SearchEngine.replaceAll()</code> when the replacement string has captured groups | testSearchEngineRegexReplaceAllWithCapturedGroups | {
"repo_name": "reqT/reqT-syntax",
"path": "test/org/fife/ui/rtextarea/SearchEngineTest.java",
"license": "bsd-3-clause",
"size": 30306
} | [
"javax.swing.text.BadLocationException"
] | import javax.swing.text.BadLocationException; | import javax.swing.text.*; | [
"javax.swing"
] | javax.swing; | 2,852,845 |
public ServiceCall getDictionaryEmptyAsync(final ServiceCallback<List<Map<String, String>>> serviceCallback) throws IllegalArgumentException {
if (serviceCallback == null) {
throw new IllegalArgumentException("ServiceCallback is required for async calls.");
}
| ServiceCall function(final ServiceCallback<List<Map<String, String>>> serviceCallback) throws IllegalArgumentException { if (serviceCallback == null) { throw new IllegalArgumentException(STR); } | /**
* Get an array of Dictionaries of type <string, string> with value [].
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link Call} object
*/ | Get an array of Dictionaries of type <string, string> with value [] | getDictionaryEmptyAsync | {
"repo_name": "stankovski/AutoRest",
"path": "AutoRest/Generators/Java/Java.Tests/src/main/java/fixtures/bodyarray/ArrayOperationsImpl.java",
"license": "mit",
"size": 167174
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"java.util.List",
"java.util.Map"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import java.util.List; import java.util.Map; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 2,042,015 |
public void determineDefaultPool() {
if (!isClient()) {
throw new UnsupportedOperationException();
}
Pool pool = null;
// create the pool if it does not already exist
if (this.clientpf == null) {
Map<String, Pool> pools = PoolManager.getAll();
if (pools.isEmpty()) {
this.... | void function() { if (!isClient()) { throw new UnsupportedOperationException(); } Pool pool = null; if (this.clientpf == null) { Map<String, Pool> pools = PoolManager.getAll(); if (pools.isEmpty()) { this.clientpf = createDefaultPF(); } else if (pools.size() == 1) { pool = pools.values().iterator().next(); } else { if ... | /**
* Used to set the default pool on a new GemFireCache.
*/ | Used to set the default pool on a new GemFireCache | determineDefaultPool | {
"repo_name": "ameybarve15/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GemFireCacheImpl.java",
"license": "apache-2.0",
"size": 179530
} | [
"com.gemstone.gemfire.cache.client.Pool",
"com.gemstone.gemfire.cache.client.PoolManager",
"com.gemstone.gemfire.cache.client.internal.PoolImpl",
"com.gemstone.gemfire.cache.server.CacheServer",
"com.gemstone.gemfire.internal.SocketCreator",
"java.net.UnknownHostException",
"java.util.Map"
] | import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.internal.SocketCreator; import java.net.UnknownHostException; import java.uti... | import com.gemstone.gemfire.cache.client.*; import com.gemstone.gemfire.cache.client.internal.*; import com.gemstone.gemfire.cache.server.*; import com.gemstone.gemfire.internal.*; import java.net.*; import java.util.*; | [
"com.gemstone.gemfire",
"java.net",
"java.util"
] | com.gemstone.gemfire; java.net; java.util; | 538,613 |
void ensureQuorumPresent(Operation op) {
if (!isQuorumNeeded(op)) {
return;
}
ensureQuorumPresent();
} | void ensureQuorumPresent(Operation op) { if (!isQuorumNeeded(op)) { return; } ensureQuorumPresent(); } | /**
* Ensures that the quorum is present for the given operation. First checks if the quorum type defined by the configuration
* covers this operation and checks if the quorum is present. Dispatches an event under the {@link #quorumName} topic
* if membership changed after determining the quorum presence... | Ensures that the quorum is present for the given operation. First checks if the quorum type defined by the configuration covers this operation and checks if the quorum is present. Dispatches an event under the <code>#quorumName</code> topic if membership changed after determining the quorum presence | ensureQuorumPresent | {
"repo_name": "tufangorel/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/quorum/impl/QuorumImpl.java",
"license": "apache-2.0",
"size": 10350
} | [
"com.hazelcast.spi.Operation"
] | import com.hazelcast.spi.Operation; | import com.hazelcast.spi.*; | [
"com.hazelcast.spi"
] | com.hazelcast.spi; | 156,343 |
public static boolean networkObjectExists(URL repositoryURL, ObjectId objectId) {
HttpURLConnection connection = null;
boolean exists = false;
try {
String internalIp = InetAddress.getLocalHost().getHostName();
String expanded = repositoryURL.toString() + "/repo/exist... | static boolean function(URL repositoryURL, ObjectId objectId) { HttpURLConnection connection = null; boolean exists = false; try { String internalIp = InetAddress.getLocalHost().getHostName(); String expanded = repositoryURL.toString() + STR + objectId.toString() + STR + internalIp; connection = connect(expanded); Inpu... | /**
* Determines whether or not an object with the given {@link ObjectId} exists in the remote
* repository.
*
* @param repositoryURL the URL of the repository
* @param objectId the id to check for
* @return true if the object existed, false otherwise
*/ | Determines whether or not an object with the given <code>ObjectId</code> exists in the remote repository | networkObjectExists | {
"repo_name": "msieger/geogig",
"path": "src/core/src/main/java/org/locationtech/geogig/remote/HttpUtils.java",
"license": "bsd-3-clause",
"size": 23575
} | [
"com.google.common.base.Preconditions",
"com.google.common.base.Throwables",
"java.io.BufferedReader",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.net.HttpURLConnection",
"java.net.InetAddress",
"org.locationtech.geogig.api.ObjectId"
] | import com.google.common.base.Preconditions; import com.google.common.base.Throwables; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.InetAddress; import org.locationtech.geogig.api.ObjectId; | import com.google.common.base.*; import java.io.*; import java.net.*; import org.locationtech.geogig.api.*; | [
"com.google.common",
"java.io",
"java.net",
"org.locationtech.geogig"
] | com.google.common; java.io; java.net; org.locationtech.geogig; | 671,799 |
public void hideChild(ViewGroup parent, View child) {
removeChild(parent, child);
} | void function(ViewGroup parent, View child) { removeChild(parent, child); } | /**
* This method is called by ViewGroup when a child view is about to be removed from the
* container. This callback starts the process of a transition; we grab the starting
* values, listen for changes to all of the children of the container, and start appropriate
* animations.
*
* @para... | This method is called by ViewGroup when a child view is about to be removed from the container. This callback starts the process of a transition; we grab the starting values, listen for changes to all of the children of the container, and start appropriate animations | hideChild | {
"repo_name": "mateor/pdroid",
"path": "android-4.0.3_r1/trunk/frameworks/base/core/java/android/animation/LayoutTransition.java",
"license": "gpl-3.0",
"size": 52949
} | [
"android.view.View",
"android.view.ViewGroup"
] | import android.view.View; import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 2,491,775 |
public void getAngularVelocity(Vector3f vec) {
Converter.convert(rBody.getAngularVelocity(tempVec), vec);
} | void function(Vector3f vec) { Converter.convert(rBody.getAngularVelocity(tempVec), vec); } | /**
* Get the current angular velocity of this PhysicsRigidBody
* @param vec the vector to store the velocity in
*/ | Get the current angular velocity of this PhysicsRigidBody | getAngularVelocity | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "external/jmonkeyengine/engine/src/jbullet/com/jme3/bullet/objects/PhysicsRigidBody.java",
"license": "gpl-2.0",
"size": 24782
} | [
"com.jme3.bullet.util.Converter",
"com.jme3.math.Vector3f"
] | import com.jme3.bullet.util.Converter; import com.jme3.math.Vector3f; | import com.jme3.bullet.util.*; import com.jme3.math.*; | [
"com.jme3.bullet",
"com.jme3.math"
] | com.jme3.bullet; com.jme3.math; | 2,530,891 |
public InterviewParameters getInterviewParameters(); | InterviewParameters function(); | /**
* Returns InterviewParameters object, most likely the same object
* as getParamaters()
*
* According to the original idea there should not be such method in
* this interface, getParameters() should be enough. But JavaTest is not
* ready yet to not use InterviewParameters.
*
*... | Returns InterviewParameters object, most likely the same object as getParamaters() According to the original idea there should not be such method in this interface, getParameters() should be enough. But JavaTest is not ready yet to not use InterviewParameters | getInterviewParameters | {
"repo_name": "otmarjr/jtreg-fork",
"path": "dist-with-aspectj/jtreg/lib/javatest/com/sun/javatest/exec/SessionExt.java",
"license": "gpl-2.0",
"size": 2641
} | [
"com.sun.javatest.InterviewParameters"
] | import com.sun.javatest.InterviewParameters; | import com.sun.javatest.*; | [
"com.sun.javatest"
] | com.sun.javatest; | 2,516,449 |
private void updateUDPCache(PingData pd) {
if (setPingData == null && !warningLogged) {
findPingDataMethod();
}
if (setPingData != null) {
try {
setPingData.invoke(transport, new Object[] {pd});
} catch (InvocationTargetException | IllegalAccessException e) {
if (!warning... | void function(PingData pd) { if (setPingData == null && !warningLogged) { findPingDataMethod(); } if (setPingData != null) { try { setPingData.invoke(transport, new Object[] {pd}); } catch (InvocationTargetException IllegalAccessException e) { if (!warningLogged) { log.warn(STR, e); warningLogged = true; } } } } | /**
* update the logical->physical address cache in UDP, which doesn't seem to be updated by UDP when
* processing responses from FIND_MBRS
*
* @param pd
*/ | update the logical->physical address cache in UDP, which doesn't seem to be updated by UDP when processing responses from FIND_MBRS | updateUDPCache | {
"repo_name": "charliemblack/geode",
"path": "geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/AddressManager.java",
"license": "apache-2.0",
"size": 3934
} | [
"java.lang.reflect.InvocationTargetException",
"org.jgroups.protocols.PingData"
] | import java.lang.reflect.InvocationTargetException; import org.jgroups.protocols.PingData; | import java.lang.reflect.*; import org.jgroups.protocols.*; | [
"java.lang",
"org.jgroups.protocols"
] | java.lang; org.jgroups.protocols; | 1,624,109 |
public void setVersion(Number value)
{
setAttributeInternal(VERSION, value);
} | void function(Number value) { setAttributeInternal(VERSION, value); } | /**
*
* Sets <code>value</code> as attribute value for VERSION using the alias name Version
*/ | Sets <code>value</code> as attribute value for VERSION using the alias name Version | setVersion | {
"repo_name": "CBIIT/cadsr-util",
"path": "cadsrutil/src/java/gov/nih/nci/ncicb/cadsr/common/persistence/bc4j/ModulesForAFormViewRowImpl.java",
"license": "bsd-3-clause",
"size": 11301
} | [
"oracle.jbo.domain.Number"
] | import oracle.jbo.domain.Number; | import oracle.jbo.domain.*; | [
"oracle.jbo.domain"
] | oracle.jbo.domain; | 2,022,897 |
public FeatureResultSet queryFeatures(GeometryEnvelope envelope,
String where) {
return queryFeatures(false, envelope, where);
} | FeatureResultSet function(GeometryEnvelope envelope, String where) { return queryFeatures(false, envelope, where); } | /**
* Query for features within the geometry envelope
*
* @param envelope
* geometry envelope
* @param where
* where clause
* @return feature results
* @since 3.4.0
*/ | Query for features within the geometry envelope | queryFeatures | {
"repo_name": "ngageoint/geopackage-java",
"path": "src/main/java/mil/nga/geopackage/extension/rtree/RTreeIndexTableDao.java",
"license": "mit",
"size": 349361
} | [
"mil.nga.geopackage.features.user.FeatureResultSet",
"mil.nga.sf.GeometryEnvelope"
] | import mil.nga.geopackage.features.user.FeatureResultSet; import mil.nga.sf.GeometryEnvelope; | import mil.nga.geopackage.features.user.*; import mil.nga.sf.*; | [
"mil.nga.geopackage",
"mil.nga.sf"
] | mil.nga.geopackage; mil.nga.sf; | 1,962,371 |
public CertificateOperation createCertificate(CreateCertificateRequest createCertificateRequest)
throws KeyVaultErrorException, IOException, IllegalArgumentException {
return innerKeyVaultClient.createCertificate(
createCertificateRequest.vaultBaseUrl(),
createC... | CertificateOperation function(CreateCertificateRequest createCertificateRequest) throws KeyVaultErrorException, IOException, IllegalArgumentException { return innerKeyVaultClient.createCertificate( createCertificateRequest.vaultBaseUrl(), createCertificateRequest.certificateName(), createCertificateRequest.certificateP... | /**
* Creates a new certificate version. If this is the first version, the certificate resource is created.
*
* @param createCertificateRequest the grouped properties for creating a certificate request
*
* @throws KeyVaultErrorException exception thrown from REST call
* @throws IOExceptio... | Creates a new certificate version. If this is the first version, the certificate resource is created | createCertificate | {
"repo_name": "herveyw/azure-sdk-for-java",
"path": "azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClient.java",
"license": "mit",
"size": 97117
} | [
"com.microsoft.azure.keyvault.models.CertificateOperation",
"com.microsoft.azure.keyvault.models.KeyVaultErrorException",
"com.microsoft.azure.keyvault.requests.CreateCertificateRequest",
"java.io.IOException"
] | import com.microsoft.azure.keyvault.models.CertificateOperation; import com.microsoft.azure.keyvault.models.KeyVaultErrorException; import com.microsoft.azure.keyvault.requests.CreateCertificateRequest; import java.io.IOException; | import com.microsoft.azure.keyvault.models.*; import com.microsoft.azure.keyvault.requests.*; import java.io.*; | [
"com.microsoft.azure",
"java.io"
] | com.microsoft.azure; java.io; | 2,439,986 |
private void processHarvestInfoFile(File crawlDir,
Throwable crawlException)
throws IOFailure {
log.debug("Post-processing files in '"
+ crawlDir.getAbsolutePath() + "'");
if (!PersistentJobData.existsIn(crawlDir)) {
thr... | void function(File crawlDir, Throwable crawlException) throws IOFailure { log.debug(STR + crawlDir.getAbsolutePath() + "'"); if (!PersistentJobData.existsIn(crawlDir)) { throw new IOFailure(STR + crawlDir.getAbsolutePath()); } PersistentJobData harvestInfo = new PersistentJobData(crawlDir); Long jobID = harvestInfo.get... | /**
* Processes an existing harvestInfoFile:</br>
* 1. Retrieve jobID, and crawlDir from the harvestInfoFile
* using class PersistentJobData</br>
* 2. finds JobId and arcsdir</br>
* 3. calls storeArcFiles</br>
* 4. moves harvestdir to oldjobs and deletes crawl.log and
* other su... | Processes an existing harvestInfoFile: 1. Retrieve jobID, and crawlDir from the harvestInfoFile using class PersistentJobData 2. finds JobId and arcsdir 3. calls storeArcFiles 4. moves harvestdir to oldjobs and deletes crawl.log and other superfluous files | processHarvestInfoFile | {
"repo_name": "netarchivesuite/netarchivesuite-svngit-migration",
"path": "src/dk/netarkivet/harvester/harvesting/distribute/HarvestControllerServer.java",
"license": "lgpl-2.1",
"size": 38269
} | [
"dk.netarkivet.common.exceptions.IOFailure",
"dk.netarkivet.common.utils.NotificationType",
"dk.netarkivet.common.utils.NotificationsFactory",
"dk.netarkivet.common.utils.Settings",
"dk.netarkivet.harvester.HarvesterSettings",
"dk.netarkivet.harvester.datamodel.Job",
"dk.netarkivet.harvester.datamodel.J... | import dk.netarkivet.common.exceptions.IOFailure; import dk.netarkivet.common.utils.NotificationType; import dk.netarkivet.common.utils.NotificationsFactory; import dk.netarkivet.common.utils.Settings; import dk.netarkivet.harvester.HarvesterSettings; import dk.netarkivet.harvester.datamodel.Job; import dk.netarkivet.h... | import dk.netarkivet.common.exceptions.*; import dk.netarkivet.common.utils.*; import dk.netarkivet.harvester.*; import dk.netarkivet.harvester.datamodel.*; import dk.netarkivet.harvester.harvesting.*; import dk.netarkivet.harvester.harvesting.metadata.*; import dk.netarkivet.harvester.harvesting.report.*; import java.... | [
"dk.netarkivet.common",
"dk.netarkivet.harvester",
"java.io",
"java.util"
] | dk.netarkivet.common; dk.netarkivet.harvester; java.io; java.util; | 2,256,758 |
public static PathFilter getInputPathFilter(JobConf conf) {
Class<? extends PathFilter> filterClass = conf.getClass("mapred.input.pathFilter.class",
null, PathFilter.class);
return (filterClass != null) ? ReflectionUtils.newInstance(filterClass, conf) : null;
} | static PathFilter function(JobConf conf) { Class<? extends PathFilter> filterClass = conf.getClass(STR, null, PathFilter.class); return (filterClass != null) ? ReflectionUtils.newInstance(filterClass, conf) : null; } | /**
* Get a PathFilter instance of the filter set for the input paths.
*
* @return the PathFilter instance set for the job, NULL if none has been
* set.
*/ | Get a PathFilter instance of the filter set for the input paths | getInputPathFilter | {
"repo_name": "mahaucsb/pss",
"path": "src/main/java/edu/ucsb/cs/hadoop/CustomFileInputFormat.java",
"license": "apache-2.0",
"size": 19638
} | [
"org.apache.hadoop.fs.PathFilter",
"org.apache.hadoop.mapred.JobConf",
"org.apache.hadoop.util.ReflectionUtils"
] | import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.util.ReflectionUtils; | import org.apache.hadoop.fs.*; import org.apache.hadoop.mapred.*; import org.apache.hadoop.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,770,123 |
public Map<DataSet, Boolean> getAffectedDatasets() {
return affectedDatasets;
} | Map<DataSet, Boolean> function() { return affectedDatasets; } | /**
* Get the {@link DataSet}s that will be affected by the current edit action,
* along with a flag specifying whether each {@link DataSet} can be
* recalculated once the edit is complete.
*
* @return The affected {@link DataSet}s.
*/ | Get the <code>DataSet</code>s that will be affected by the current edit action, along with a flag specifying whether each <code>DataSet</code> can be recalculated once the edit is complete | getAffectedDatasets | {
"repo_name": "BjerknesClimateDataCentre/QuinCe",
"path": "WebApp/src/uk/ac/exeter/QuinCe/web/Instrument/CalibrationBean.java",
"license": "gpl-3.0",
"size": 31562
} | [
"java.util.Map",
"uk.ac.exeter.QuinCe"
] | import java.util.Map; import uk.ac.exeter.QuinCe; | import java.util.*; import uk.ac.exeter.*; | [
"java.util",
"uk.ac.exeter"
] | java.util; uk.ac.exeter; | 1,243,870 |
public String getTitle(HttpServletRequest request) {
if (request != null && request.getParameter("title") != null) {
return request.getParameter("title");
}
Element layoutE = getUniqueDescendant(config.getFirstChild(), "layout");
return getUniqueDescendant(layoutE, "title").getTextContent();
} | String function(HttpServletRequest request) { if (request != null && request.getParameter("title") != null) { return request.getParameter("title"); } Element layoutE = getUniqueDescendant(config.getFirstChild(), STR); return getUniqueDescendant(layoutE, "title").getTextContent(); } | /**
* The title of the AjaxGUI. This will appear many places in the pages and
* emails generated. Typically it is just a short string like "City
* Browser", "Shape Game", "Family Dialogue", etc.
*/ | The title of the AjaxGUI. This will appear many places in the pages and emails generated. Typically it is just a short string like "City Browser", "Shape Game", "Family Dialogue", etc | getTitle | {
"repo_name": "ananthvelu/wami",
"path": "src/edu/mit/csail/sls/wami/WamiConfig.java",
"license": "mit",
"size": 39472
} | [
"javax.servlet.http.HttpServletRequest",
"org.w3c.dom.Element"
] | import javax.servlet.http.HttpServletRequest; import org.w3c.dom.Element; | import javax.servlet.http.*; import org.w3c.dom.*; | [
"javax.servlet",
"org.w3c.dom"
] | javax.servlet; org.w3c.dom; | 2,102,427 |
@PublicEvolving
public void write_as_text(String path, WriteMode mode) {
stream.writeAsText(path, mode);
} | void function(String path, WriteMode mode) { stream.writeAsText(path, mode); } | /**
* A thin wrapper layer over {@link DataStream#writeAsText(java.lang.String, WriteMode)}.
*
* @param path
* The path pointing to the location the text file is written to
* @param mode
* Controls the behavior for existing files. Options are
* NO_OVERWRITE and OVERWRITE.
... | A thin wrapper layer over <code>DataStream#writeAsText(java.lang.String, WriteMode)</code> | write_as_text | {
"repo_name": "zohar-mizrahi/flink",
"path": "flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/datastream/PythonDataStream.java",
"license": "apache-2.0",
"size": 10590
} | [
"org.apache.flink.core.fs.FileSystem"
] | import org.apache.flink.core.fs.FileSystem; | import org.apache.flink.core.fs.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,488,102 |
public Long obtenerCantidadRegistros(TipoSelAlm tipoSelAlmDet){
return GdeDAOFactory.getSelAlmDetDAO().getTotalBySelAlmDeudaTipoSelAlmDet(this, tipoSelAlmDet);
}
| Long function(TipoSelAlm tipoSelAlmDet){ return GdeDAOFactory.getSelAlmDetDAO().getTotalBySelAlmDeudaTipoSelAlmDet(this, tipoSelAlmDet); } | /**
* Obtiene la cantidad total de Detalles de la Seleccion Almacenada para el tipo de SelAlmDet.
* @param tipoSelAlmDet
* @return Long
*/ | Obtiene la cantidad total de Detalles de la Seleccion Almacenada para el tipo de SelAlmDet | obtenerCantidadRegistros | {
"repo_name": "avdata99/SIAT",
"path": "siat-1.0-SOURCE/src/buss/src/ar/gov/rosario/siat/gde/buss/bean/SelAlmDeuda.java",
"license": "gpl-3.0",
"size": 8960
} | [
"ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory"
] | import ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory; | import ar.gov.rosario.siat.gde.buss.dao.*; | [
"ar.gov.rosario"
] | ar.gov.rosario; | 175,729 |
private PopupMenu getContextMenu() {
PopupMenu popup = new PopupMenu();
MenuItem showItem = new MenuItem(this.bundle.getString("trayShow"));
showItem.addActionListener(this.showListener);
popup.add(showItem);
MenuItem closeItem = new MenuItem(this.bundle.getString("trayExit"));
closeItem.addActionListe... | PopupMenu function() { PopupMenu popup = new PopupMenu(); MenuItem showItem = new MenuItem(this.bundle.getString(STR)); showItem.addActionListener(this.showListener); popup.add(showItem); MenuItem closeItem = new MenuItem(this.bundle.getString(STR)); closeItem.addActionListener(this.closeListener); popup.add(closeItem)... | /**
* Get the context menu
*
* @return
*/ | Get the context menu | getContextMenu | {
"repo_name": "danielkueffer/filehosting-tool-desktop-client",
"path": "src/com/danielkueffer/filehosting/desktop/Main.java",
"license": "mit",
"size": 18026
} | [
"java.awt.MenuItem",
"java.awt.PopupMenu"
] | import java.awt.MenuItem; import java.awt.PopupMenu; | import java.awt.*; | [
"java.awt"
] | java.awt; | 670,290 |
protected Collection<String> filterIdentifiers(Collection<String> identifiers) {
// Obtain enough space for a full copy of the given identifiers
Collection<String> validIdentifiers = new ArrayList<String>(identifiers.size());
// Add only valid identifiers to the copy
for (String id... | Collection<String> function(Collection<String> identifiers) { Collection<String> validIdentifiers = new ArrayList<String>(identifiers.size()); for (String identifier : identifiers) { if (isValidIdentifier(identifier)) validIdentifiers.add(identifier); } return validIdentifiers; } | /**
* Filters the given collection of strings, returning a new collection
* containing only those strings which are valid identifiers. If no strings
* within the collection are valid identifiers, the returned collection will
* simply be empty.
*
* @param identifiers
* The collecti... | Filters the given collection of strings, returning a new collection containing only those strings which are valid identifiers. If no strings within the collection are valid identifiers, the returned collection will simply be empty | filterIdentifiers | {
"repo_name": "mike-jumper/incubator-guacamole-client",
"path": "extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java",
"license": "apache-2.0",
"size": 18684
} | [
"java.util.ArrayList",
"java.util.Collection"
] | import java.util.ArrayList; import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,523,998 |
public Nodeid getFirstParent() {
assert wcp1 != null;
return wcp1;
}
| Nodeid function() { assert wcp1 != null; return wcp1; } | /**
* It's possible for a repository to be in a 'merging' state (@see {@link #isMerging()} without any
* conflict to resolve (no merge state information file).
*
* @return first parent of the working copy, never <code>null</code>
*/ | It's possible for a repository to be in a 'merging' state (@see <code>#isMerging()</code> without any conflict to resolve (no merge state information file) | getFirstParent | {
"repo_name": "CharlieKuharski/hg4j",
"path": "src/org/tmatesoft/hg/repo/HgMergeState.java",
"license": "gpl-2.0",
"size": 8091
} | [
"org.tmatesoft.hg.core.Nodeid"
] | import org.tmatesoft.hg.core.Nodeid; | import org.tmatesoft.hg.core.*; | [
"org.tmatesoft.hg"
] | org.tmatesoft.hg; | 2,742,852 |
public String getThrottlePolicyForGlobalLevel(GlobalPolicy policy) throws APITemplateException {
StringWriter writer = new StringWriter();
if (log.isDebugEnabled()) {
log.debug("Generating policy for global level :" + policy.toString());
}
try {
VelocityEngin... | String function(GlobalPolicy policy) throws APITemplateException { StringWriter writer = new StringWriter(); if (log.isDebugEnabled()) { log.debug(STR + policy.toString()); } try { VelocityEngine velocityengine = new VelocityEngine(); velocityengine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, CommonsLogLo... | /**
* Generate policy for global level
*
* @param policy policy with level 'global'. Multiple pipelines are not allowed. Can define more than one condition
* as set of conditions. all these conditions should be passed as a single pipeline
* @return the generated execution plan for... | Generate policy for global level | getThrottlePolicyForGlobalLevel | {
"repo_name": "tharikaGitHub/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.throttle.policy.deployer/src/main/java/org/wso2/carbon/apimgt/throttle/policy/deployer/utils/ThrottlePolicyTemplateBuilder.java",
"license": "apache-2.0",
"size": 26032
} | [
"java.io.StringWriter",
"org.apache.velocity.Template",
"org.apache.velocity.VelocityContext",
"org.apache.velocity.app.VelocityEngine",
"org.apache.velocity.exception.VelocityException",
"org.apache.velocity.runtime.RuntimeConstants",
"org.apache.velocity.runtime.log.CommonsLogLogChute",
"org.apache.... | import java.io.StringWriter; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.exception.VelocityException; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.log.CommonsLogLogCh... | import java.io.*; import org.apache.velocity.*; import org.apache.velocity.app.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.*; import org.apache.velocity.runtime.log.*; import org.apache.velocity.runtime.resource.loader.*; import org.wso2.carbon.apimgt.impl.template.*; import org.wso2.c... | [
"java.io",
"org.apache.velocity",
"org.wso2.carbon"
] | java.io; org.apache.velocity; org.wso2.carbon; | 2,723,718 |
public static Criterion matchTcpDst(TpPort tcpPort) {
return new TcpPortCriterion(tcpPort, Type.TCP_DST);
} | static Criterion function(TpPort tcpPort) { return new TcpPortCriterion(tcpPort, Type.TCP_DST); } | /**
* Creates a match on TCP destination port field using the specified value.
*
* @param tcpPort TCP destination port
* @return match criterion
*/ | Creates a match on TCP destination port field using the specified value | matchTcpDst | {
"repo_name": "donNewtonAlpha/onos",
"path": "core/api/src/main/java/org/onosproject/net/flow/criteria/Criteria.java",
"license": "apache-2.0",
"size": 17514
} | [
"org.onlab.packet.TpPort",
"org.onosproject.net.flow.criteria.Criterion"
] | import org.onlab.packet.TpPort; import org.onosproject.net.flow.criteria.Criterion; | import org.onlab.packet.*; import org.onosproject.net.flow.criteria.*; | [
"org.onlab.packet",
"org.onosproject.net"
] | org.onlab.packet; org.onosproject.net; | 36,846 |
protected DoublyIndexedTable getTraitInformationTable() {
return xmlTraitInformation;
} | DoublyIndexedTable function() { return xmlTraitInformation; } | /**
* Returns the table of TraitInformation objects for this element.
*/ | Returns the table of TraitInformation objects for this element | getTraitInformationTable | {
"repo_name": "Squeegee/batik",
"path": "sources/org/apache/batik/dom/svg/SVGOMFontElement.java",
"license": "apache-2.0",
"size": 4337
} | [
"org.apache.batik.util.DoublyIndexedTable"
] | import org.apache.batik.util.DoublyIndexedTable; | import org.apache.batik.util.*; | [
"org.apache.batik"
] | org.apache.batik; | 2,639,341 |
public void connect(boolean waitForConnection) throws RemoteException {
binder.connect(browserId, waitForConnection);
} | void function(boolean waitForConnection) throws RemoteException { binder.connect(browserId, waitForConnection); } | /**
* Connect to the given media browser service.
*
* @param waitForConnection true if the remote browser needs to wait for the connection, false
* otherwise.
*/ | Connect to the given media browser service | connect | {
"repo_name": "androidx/media",
"path": "libraries/test_session_current/src/main/java/androidx/media3/session/RemoteMediaBrowserCompat.java",
"license": "apache-2.0",
"size": 6621
} | [
"android.os.RemoteException"
] | import android.os.RemoteException; | import android.os.*; | [
"android.os"
] | android.os; | 1,636,837 |
@Transactional
public List<PoDetail> findWhereDiscountEquals(float discount) throws PoDetailDaoException
{
try {
return jdbcTemplate.query("SELECT id, ponumber, productcode, qty, producttype, unitprice, amount, ppn, poremarks, currencyCode, warranty, termpayment, termdelivery, discount, pph, total FROM " + ge... | List<PoDetail> function(float discount) throws PoDetailDaoException { try { return jdbcTemplate.query(STR + getTableName() + STR, this,discount); } catch (Exception e) { throw new PoDetailDaoException(STR, e); } } | /**
* Returns all rows from the po_detail table that match the criteria 'discount = :discount'.
*/ | Returns all rows from the po_detail table that match the criteria 'discount = :discount' | findWhereDiscountEquals | {
"repo_name": "rmage/gnvc-ims",
"path": "src/java/com/app/wms/engine/db/dao/spring/PoDetailDaoImpl.java",
"license": "lgpl-3.0",
"size": 19698
} | [
"com.app.wms.engine.db.dto.PoDetail",
"com.app.wms.engine.db.exceptions.PoDetailDaoException",
"java.util.List"
] | import com.app.wms.engine.db.dto.PoDetail; import com.app.wms.engine.db.exceptions.PoDetailDaoException; import java.util.List; | import com.app.wms.engine.db.dto.*; import com.app.wms.engine.db.exceptions.*; import java.util.*; | [
"com.app.wms",
"java.util"
] | com.app.wms; java.util; | 996,365 |
Field createField(EntityValueSource valueSource, String property); | Field createField(EntityValueSource valueSource, String property); | /**
* Generates component for {@link DataGrid} editor.
*
* @param valueSource editing item value source
* @param property editing item property
* @return generated component
* @throws IllegalStateException if created component doesn't implement the {@link Field} interface
*/ | Generates component for <code>DataGrid</code> editor | createField | {
"repo_name": "cuba-platform/cuba",
"path": "modules/gui/src/com/haulmont/cuba/gui/components/DataGridEditorFieldFactory.java",
"license": "apache-2.0",
"size": 1800
} | [
"com.haulmont.cuba.gui.components.data.meta.EntityValueSource"
] | import com.haulmont.cuba.gui.components.data.meta.EntityValueSource; | import com.haulmont.cuba.gui.components.data.meta.*; | [
"com.haulmont.cuba"
] | com.haulmont.cuba; | 740,977 |
public FacesConfigVersionType getVersion()
{
return FacesConfigVersionType.getFromStringValue(childNode.getAttribute("version"));
} | FacesConfigVersionType function() { return FacesConfigVersionType.getFromStringValue(childNode.getAttribute(STR)); } | /**
* Returns the <code>version</code> attribute
* @return the value defined for the attribute <code>version</code>
*/ | Returns the <code>version</code> attribute | getVersion | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig21/FacesConfigTypeImpl.java",
"license": "epl-1.0",
"size": 40579
} | [
"org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigVersionType"
] | import org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigVersionType; | import org.jboss.shrinkwrap.descriptor.api.facesconfig20.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 266,054 |
public synchronized void add(MediaType type, T obj)
{
classCache.clear();
type = new MediaType(type.getType().toLowerCase(), type.getSubtype().toLowerCase(), type.getParameters());
Entry<T> entry = new Entry<T>(type, obj);
List<Entry<T>> newall = new ArrayList<Entry<T>>(all.size() + 1... | synchronized void function(MediaType type, T obj) { classCache.clear(); type = new MediaType(type.getType().toLowerCase(), type.getSubtype().toLowerCase(), type.getParameters()); Entry<T> entry = new Entry<T>(type, obj); List<Entry<T>> newall = new ArrayList<Entry<T>>(all.size() + 1); newall.addAll(all); newall.add(ent... | /**
* Add an object to the media type map. This is synchronized to serialize adds.
*
* @param type
* @param obj
*/ | Add an object to the media type map. This is synchronized to serialize adds | add | {
"repo_name": "rankinc/Resteasy",
"path": "resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/MediaTypeMap.java",
"license": "apache-2.0",
"size": 14350
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"javax.ws.rs.core.MediaType"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.ws.rs.core.MediaType; | import java.util.*; import javax.ws.rs.core.*; | [
"java.util",
"javax.ws"
] | java.util; javax.ws; | 716,811 |
public static Set<Event.Record> next(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException,
Types.SessionNotRegistered,
Types.EventsLost {
String method_call = "event.next";
String session = c.getSessionReference();
Object[] method_params... | static Set<Event.Record> function(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException, Types.SessionNotRegistered, Types.EventsLost { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session)}; Map response = c.dispatch(method_call, ... | /**
* Blocking call which returns a (possibly empty) batch of events
*
* @return the batch of events
*/ | Blocking call which returns a (possibly empty) batch of events | next | {
"repo_name": "cinderella/incubator-cloudstack",
"path": "deps/XenServerJava/com/xensource/xenapi/Event.java",
"license": "apache-2.0",
"size": 8198
} | [
"com.xensource.xenapi.Types",
"java.util.Map",
"java.util.Set",
"org.apache.xmlrpc.XmlRpcException"
] | import com.xensource.xenapi.Types; import java.util.Map; import java.util.Set; import org.apache.xmlrpc.XmlRpcException; | import com.xensource.xenapi.*; import java.util.*; import org.apache.xmlrpc.*; | [
"com.xensource.xenapi",
"java.util",
"org.apache.xmlrpc"
] | com.xensource.xenapi; java.util; org.apache.xmlrpc; | 1,644,029 |
protected void linkSessionsByCall(String callID, SessionCtx session,
String destinationSessionId, String originChannel, String destChannel) throws OperationException {
// No op.
} | void function(String callID, SessionCtx session, String destinationSessionId, String originChannel, String destChannel) throws OperationException { } | /**
* Link two sessions in a call. The responsibility to get <b>callID</b> and call this method is
* on the service handler implementation.
* <br/>
* <br/>
* <b>No implemented, needs to implement on {@link AmiServiceHandler} implementation.</b>
* <br/>
* <b>No safe to use getSessionCt... | Link two sessions in a call. The responsibility to get callID and call this method is on the service handler implementation. No implemented, needs to implement on <code>AmiServiceHandler</code> implementation. No safe to use getSessionCtx() | linkSessionsByCall | {
"repo_name": "dayler/AsteriskInterface",
"path": "src/me/dayler/ai/ami/service/AmiServiceHandler.java",
"license": "mit",
"size": 12146
} | [
"me.dayler.ai.ami.service.context.SessionCtx",
"me.dayler.common.exception.OperationException"
] | import me.dayler.ai.ami.service.context.SessionCtx; import me.dayler.common.exception.OperationException; | import me.dayler.ai.ami.service.context.*; import me.dayler.common.exception.*; | [
"me.dayler.ai",
"me.dayler.common"
] | me.dayler.ai; me.dayler.common; | 2,745,646 |
EAttribute getEvent_Name(); | EAttribute getEvent_Name(); | /**
* Returns the meta object for the attribute '{@link org.eclipse.vorto.core.api.model.functionblock.Event#getName <em>Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Name</em>'.
* @see org.eclipse.vorto.core.api.model.functionblock.Event#getNa... | Returns the meta object for the attribute '<code>org.eclipse.vorto.core.api.model.functionblock.Event#getName Name</code>'. | getEvent_Name | {
"repo_name": "erlemantos/eclipse-vorto",
"path": "bundles/org.eclipse.vorto.core/src/org/eclipse/vorto/core/api/model/functionblock/FunctionblockPackage.java",
"license": "epl-1.0",
"size": 46007
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 892,299 |
public static void usageDetailsListFilterByTagLegacy(
com.azure.resourcemanager.consumption.ConsumptionManager manager) {
manager
.usageDetails()
.list(
"subscriptions/00000000-0000-0000-0000-000000000000",
null,
"tags eq '... | static void function( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() .list( STR, null, STR, null, null, null, Context.NONE); } | /**
* Sample code: UsageDetailsListFilterByTag-Legacy.
*
* @param manager Entry point to ConsumptionManager.
*/ | Sample code: UsageDetailsListFilterByTag-Legacy | usageDetailsListFilterByTagLegacy | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java",
"license": "mit",
"size": 13308
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,672,563 |
public static void viewToViewTransition(View transitingView, View targetView, float transitionProgress, int scrollY) {
float scaleChangeX = transitionProgress * ((float) targetView.getWidth() / transitingView.getWidth() - 1f);
float scaleChangeY = transitionProgress * ((float) targetView.getHeig... | static void function(View transitingView, View targetView, float transitionProgress, int scrollY) { float scaleChangeX = transitionProgress * ((float) targetView.getWidth() / transitingView.getWidth() - 1f); float scaleChangeY = transitionProgress * ((float) targetView.getHeight() / transitingView.getHeight() - 1f); tr... | /**
* Make transition for a view to a target view
*
* @param transitionProgress A value between 0f and 1f
* @param scrollY if content is scrolling, scroll amount added to the Y translation. If its not give zero
*/ | Make transition for a view to a target view | viewToViewTransition | {
"repo_name": "DorukBen/Bookie",
"path": "app/src/main/java/com/karambit/bookie/helper/LayoutUtils.java",
"license": "apache-2.0",
"size": 6568
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 2,492,544 |
public void updateEntry(String formName, Entry entry) throws Exception {
Form f = getForm(formName);
if (f!= null) {
FormFieldResolver resolver = FormFieldResolverFactory.getResolver(f);
Database db = DatabaseFactory.createInstance(f, resolver);
db.updateEntry(entry, entry.getValues());
} else {
... | void function(String formName, Entry entry) throws Exception { Form f = getForm(formName); if (f!= null) { FormFieldResolver resolver = FormFieldResolverFactory.getResolver(f); Database db = DatabaseFactory.createInstance(f, resolver); db.updateEntry(entry, entry.getValues()); } else { throw new IllegalArgumentExceptio... | /**
* Updates the existing entry
* @param formName Form name
* @param entry Entry contains valid id
* @throws Exception
*/ | Updates the existing entry | updateEntry | {
"repo_name": "sinnlabs/dbvim",
"path": "src/org/sinnlabs/dbvim/script/ScriptApi.java",
"license": "lgpl-3.0",
"size": 7759
} | [
"org.sinnlabs.dbvim.db.Database",
"org.sinnlabs.dbvim.db.DatabaseFactory",
"org.sinnlabs.dbvim.db.Entry",
"org.sinnlabs.dbvim.form.FormFieldResolver",
"org.sinnlabs.dbvim.form.FormFieldResolverFactory",
"org.sinnlabs.dbvim.model.Form"
] | import org.sinnlabs.dbvim.db.Database; import org.sinnlabs.dbvim.db.DatabaseFactory; import org.sinnlabs.dbvim.db.Entry; import org.sinnlabs.dbvim.form.FormFieldResolver; import org.sinnlabs.dbvim.form.FormFieldResolverFactory; import org.sinnlabs.dbvim.model.Form; | import org.sinnlabs.dbvim.db.*; import org.sinnlabs.dbvim.form.*; import org.sinnlabs.dbvim.model.*; | [
"org.sinnlabs.dbvim"
] | org.sinnlabs.dbvim; | 1,580,854 |
@RequiresSession
public List<AlertCurrentEntity> findCurrentByDefinitionId(long definitionId) {
TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery(
"AlertCurrentEntity.findByDefinitionId", AlertCurrentEntity.class);
query.setParameter("definitionId", Long.valueOf(... | List<AlertCurrentEntity> function(long definitionId) { TypedQuery<AlertCurrentEntity> query = m_entityManagerProvider.get().createNamedQuery( STR, AlertCurrentEntity.class); query.setParameter(STR, Long.valueOf(definitionId)); return m_daoUtils.selectList(query); } | /**
* Gets the current alerts for the specified definition ID.
*
* @param definitionId
* the ID of the definition to retrieve current alerts for.
* @return the current alerts for the definition or an empty list if none
* exist (never {@code null}).
*/ | Gets the current alerts for the specified definition ID | findCurrentByDefinitionId | {
"repo_name": "zouzhberk/ambaridemo",
"path": "demo-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java",
"license": "apache-2.0",
"size": 33168
} | [
"java.util.List",
"javax.persistence.TypedQuery",
"org.apache.ambari.server.orm.entities.AlertCurrentEntity"
] | import java.util.List; import javax.persistence.TypedQuery; import org.apache.ambari.server.orm.entities.AlertCurrentEntity; | import java.util.*; import javax.persistence.*; import org.apache.ambari.server.orm.entities.*; | [
"java.util",
"javax.persistence",
"org.apache.ambari"
] | java.util; javax.persistence; org.apache.ambari; | 441,731 |
public Point getPoint(int x, int y) {
Point p = new Point();
int rotation = getRotation();
switch (rotation) {
case 90:
p.x = y;
p.y = getPageWidth() - x;
break;
case 180:
p.x = getPageWidth() - x;
p.y = getPageHeigh... | Point function(int x, int y) { Point p = new Point(); int rotation = getRotation(); switch (rotation) { case 90: p.x = y; p.y = getPageWidth() - x; break; case 180: p.x = getPageWidth() - x; p.y = getPageHeight() - y; break; case 270: p.x = getPageHeight() - y; p.y = x; break; default: p.x = x; p.y = y; break; } return... | /**
* Returns a point on the current page, taking the current painting state
* into account.
*
* @param x
* the X-coordinate
* @param y
* the Y-coordinate
* @return a point on the current page
*/ | Returns a point on the current page, taking the current painting state into account | getPoint | {
"repo_name": "apache/fop",
"path": "fop-core/src/main/java/org/apache/fop/afp/AFPPaintingState.java",
"license": "apache-2.0",
"size": 21351
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 316,516 |
public void waitUntilAllRegionsAssigned(final TableName tableName) throws IOException {
waitUntilAllRegionsAssigned(tableName, 60000);
} | void function(final TableName tableName) throws IOException { waitUntilAllRegionsAssigned(tableName, 60000); } | /**
* Wait until all regions for a table in hbase:meta have a non-empty
* info:server, up to 60 seconds. This means all regions have been deployed,
* master has been informed and updated hbase:meta with the regions deployed
* server.
* @param tableName the table name
* @throws IOException
*/ | Wait until all regions for a table in hbase:meta have a non-empty info:server, up to 60 seconds. This means all regions have been deployed, master has been informed and updated hbase:meta with the regions deployed server | waitUntilAllRegionsAssigned | {
"repo_name": "juwi/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 151512
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 95,179 |
public boolean removePage(long pageAddr, long dataPageId) {
assert dataPageId != 0;
int cnt = getCount(pageAddr);
for (int i = 0; i < cnt; i++) {
if (PageIdUtils.maskPartitionId(getAt(pageAddr, i)) == PageIdUtils.maskPartitionId(dataPageId)) {
if (i != cnt - 1)
... | boolean function(long pageAddr, long dataPageId) { assert dataPageId != 0; int cnt = getCount(pageAddr); for (int i = 0; i < cnt; i++) { if (PageIdUtils.maskPartitionId(getAt(pageAddr, i)) == PageIdUtils.maskPartitionId(dataPageId)) { if (i != cnt - 1) copyMemory(pageAddr, offset(i + 1), pageAddr, offset(i), 8 * (cnt -... | /**
* Removes the given page ID from the pages list.
*
* @param pageAddr Page address.
* @param dataPageId Page ID to remove.
* @return {@code true} if page was in the list and was removed, {@code false} otherwise.
*/ | Removes the given page ID from the pages list | removePage | {
"repo_name": "irudyak/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/io/PagesListNodeIO.java",
"license": "apache-2.0",
"size": 7206
} | [
"org.apache.ignite.internal.pagemem.PageIdUtils",
"org.apache.ignite.internal.processors.cache.persistence.tree.util.PageHandler"
] | import org.apache.ignite.internal.pagemem.PageIdUtils; import org.apache.ignite.internal.processors.cache.persistence.tree.util.PageHandler; | import org.apache.ignite.internal.pagemem.*; import org.apache.ignite.internal.processors.cache.persistence.tree.util.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,903,200 |
protected void validateDnsUrl(URL url) throws MalformedURLException {
String path = url.getPath();
path = StringUtils.removeStart(path, "/");
path = StringUtils.removeEnd(path, "/");
if (path == null || StringUtils.countMatches(path, "/") > 1) {
throw new MalformedURLExce... | void function(URL url) throws MalformedURLException { String path = url.getPath(); path = StringUtils.removeStart(path, "/"); path = StringUtils.removeEnd(path, "/"); if (path == null StringUtils.countMatches(path, "/") > 1) { throw new MalformedURLException(STR+url); } final String query = url.getQuery(); if ((query !... | /**
* Validate the format is:
* dns://<host>/<zone>/?expression=<regex>
*
* there should be only one arguement in the path
* there should only be one query parameter
*
* @param url a {@link java.net.URL} object.
* @throws java.net.MalformedURLException if any.
*/ | Validate the format is: dns:////?expression= there should be only one arguement in the path there should only be one query parameter | validateDnsUrl | {
"repo_name": "jeffgdotorg/opennms",
"path": "opennms-provision/opennms-requisition-dns/src/main/java/org/opennms/netmgt/provision/service/dns/DnsRequisitionUrlConnection.java",
"license": "gpl-2.0",
"size": 12403
} | [
"java.net.MalformedURLException",
"org.apache.commons.lang.StringUtils"
] | import java.net.MalformedURLException; import org.apache.commons.lang.StringUtils; | import java.net.*; import org.apache.commons.lang.*; | [
"java.net",
"org.apache.commons"
] | java.net; org.apache.commons; | 2,538,660 |
public void removeAspect(AppAspect aspect) throws DataException {
if (!exists()) {
throw notFoundExc;
}
String category = aspect.getCategory();
try {
Connection conn = Data.getInstance().getAppData().openConnection();
PreparedStatement ps = conn.prepareStatement("DELETE FROM Aspects " + "WHERE id... | void function(AppAspect aspect) throws DataException { if (!exists()) { throw notFoundExc; } String category = aspect.getCategory(); try { Connection conn = Data.getInstance().getAppData().openConnection(); PreparedStatement ps = conn.prepareStatement(STR + STR); ps.setInt(1, aspect.getId()); ps.executeUpdate(); if (ge... | /**
* Remove the given aspect from the database.
*
* @param aspect
* the aspect
*
* @throws DataException
* If an error occurs while removing the aspect
*/ | Remove the given aspect from the database | removeAspect | {
"repo_name": "googol42/revager",
"path": "src/org/revager/app/model/appdata/AppCatalog.java",
"license": "gpl-3.0",
"size": 35459
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"org.revager.app.model.Data",
"org.revager.app.model.DataException"
] | import java.sql.Connection; import java.sql.PreparedStatement; import org.revager.app.model.Data; import org.revager.app.model.DataException; | import java.sql.*; import org.revager.app.model.*; | [
"java.sql",
"org.revager.app"
] | java.sql; org.revager.app; | 348,001 |
public void importFromIRI(IRI iri) throws Exception{
Session session = null;
DBQueryUtils hbUtil = new DBQueryUtils(this.sessionFactory);
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(iri);
IRI ontologyIRI = ontolo... | void function(IRI iri) throws Exception{ Session session = null; DBQueryUtils hbUtil = new DBQueryUtils(this.sessionFactory); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntologyFromOntologyDocument(iri); IRI ontologyIRI = ontology.getOntologyID().getOntologyIR... | /**
* Import vocabulary concepts from RDF file
* @throws Exception
*/ | Import vocabulary concepts from RDF file | importFromIRI | {
"repo_name": "jcvthibault/biosio-vocab",
"path": "biosio-api/src/main/java/edu/utah/bmi/biosio/rdf/RdfToDbImporter.java",
"license": "gpl-3.0",
"size": 10809
} | [
"edu.utah.bmi.biosio.DBQueryUtils",
"edu.utah.bmi.biosio.model.Citation",
"edu.utah.bmi.biosio.model.Concept",
"edu.utah.bmi.biosio.model.Description",
"edu.utah.bmi.biosio.model.ExternalOntology",
"edu.utah.bmi.biosio.model.Relationship",
"edu.utah.bmi.biosio.model.Synonym",
"java.util.HashMap",
"j... | import edu.utah.bmi.biosio.DBQueryUtils; import edu.utah.bmi.biosio.model.Citation; import edu.utah.bmi.biosio.model.Concept; import edu.utah.bmi.biosio.model.Description; import edu.utah.bmi.biosio.model.ExternalOntology; import edu.utah.bmi.biosio.model.Relationship; import edu.utah.bmi.biosio.model.Synonym; import j... | import edu.utah.bmi.biosio.*; import edu.utah.bmi.biosio.model.*; import java.util.*; import org.hibernate.*; import org.semanticweb.owlapi.apibinding.*; import org.semanticweb.owlapi.model.*; import org.semanticweb.owlapi.vocab.*; | [
"edu.utah.bmi",
"java.util",
"org.hibernate",
"org.semanticweb.owlapi"
] | edu.utah.bmi; java.util; org.hibernate; org.semanticweb.owlapi; | 814,217 |
private void writeName (String uri, String localName,
String qName, boolean isElement)
throws IOException
{
write(qName);
}
////////////////////////////////////////////////////////////////////
// Constants.
////////////////////////////////////////... | void function (String uri, String localName, String qName, boolean isElement) throws IOException { write(qName); } private final Attributes EMPTY_ATTS = new AttributesImpl(); private boolean inCDATA = false; private int elementLevel = 0; private Writer output; private String encoding; private boolean writeXmlDecl = tru... | /**
* Write an element or attribute name.
*
* @param uri The Namespace URI.
* @param localName The local name.
* @param qName The prefixed name, if available, or the empty string.
* @param isElement true if this is an element name, false if it
* is an attribute name.
*/ | Write an element or attribute name | writeName | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jaxws/src/share/jaxws_classes/com/sun/xml/internal/txw2/output/XMLWriter.java",
"license": "mit",
"size": 34960
} | [
"java.io.IOException",
"java.io.Writer",
"org.xml.sax.Attributes",
"org.xml.sax.helpers.AttributesImpl"
] | import java.io.IOException; import java.io.Writer; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; | import java.io.*; import org.xml.sax.*; import org.xml.sax.helpers.*; | [
"java.io",
"org.xml.sax"
] | java.io; org.xml.sax; | 2,399,391 |
public void processPlayerAbilities(C13PacketPlayerAbilities packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
this.playerEntity.capabilities.isFlying = packetIn.isFlying() && this.playerEntity.capabilities.allowFlying;
} | void function(C13PacketPlayerAbilities packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer()); this.playerEntity.capabilities.isFlying = packetIn.isFlying() && this.playerEntity.capabilities.allowFlying; } | /**
* Processes a player starting/stopping flying
*/ | Processes a player starting/stopping flying | processPlayerAbilities | {
"repo_name": "kelthalorn/ConquestCraft",
"path": "build/tmp/recompSrc/net/minecraft/network/NetHandlerPlayServer.java",
"license": "lgpl-2.1",
"size": 68065
} | [
"net.minecraft.network.play.client.C13PacketPlayerAbilities"
] | import net.minecraft.network.play.client.C13PacketPlayerAbilities; | import net.minecraft.network.play.client.*; | [
"net.minecraft.network"
] | net.minecraft.network; | 2,345,301 |
private LocalResource findNextResource() {
synchronized (pending) {
for (Iterator<LocalizerResourceRequestEvent> i = pending.iterator();
i.hasNext();) {
LocalizerResourceRequestEvent evt = i.next();
LocalizedResource nRsrc = evt.getResource();
// Resource downloa... | LocalResource function() { synchronized (pending) { for (Iterator<LocalizerResourceRequestEvent> i = pending.iterator(); i.hasNext();) { LocalizerResourceRequestEvent evt = i.next(); LocalizedResource nRsrc = evt.getResource(); if (!ResourceState.DOWNLOADING.equals(nRsrc.getState())) { i.remove(); continue; } if (nRsrc... | /**
* Find next resource to be given to a spawned localizer.
*
* @return the next resource to be localized
*/ | Find next resource to be given to a spawned localizer | findNextResource | {
"repo_name": "Reidddddd/mo-hadoop2.6.0",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/ResourceLocalizationService.java",
"license": "apache-2.0",
"size": 57679
} | [
"java.util.Iterator",
"org.apache.hadoop.yarn.api.records.LocalResource",
"org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.event.LocalizerResourceRequestEvent",
"org.apache.hadoop.yarn.util.ConverterUtils"
] | import java.util.Iterator; import org.apache.hadoop.yarn.api.records.LocalResource; import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.event.LocalizerResourceRequestEvent; import org.apache.hadoop.yarn.util.ConverterUtils; | import java.util.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.event.*; import org.apache.hadoop.yarn.util.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,827,314 |
InputStream getStream(String imageUri, Object extra) throws IOException;
public enum Scheme {
HTTP("http"), HTTPS("https"), FILE("file"), CONTENT("content"), ASSETS("assets"), DRAWABLE("drawable"), UNKNOWN("");
private String scheme;
private String uriPrefix;
Scheme(String scheme) {
this.scheme = sc... | InputStream getStream(String imageUri, Object extra) throws IOException; public enum Scheme { HTTP("http"), HTTPS("https"), FILE("file"), CONTENT(STR), ASSETS(STR), DRAWABLE(STR), UNKNOWN(STR: } | /**
* Retrieves {@link InputStream} of image by URI.
*
* @param imageUri Image URI
* @param extra Auxiliary object which was passed to {@link DisplayImageOptions.Builder#extraForDownloader(Object)
* DisplayImageOptions.extraForDownloader(Object)}; can be null
* @return {@link InputStream}... | Retrieves <code>InputStream</code> of image by URI | getStream | {
"repo_name": "Zhangsongsong/GraduationPro",
"path": "毕业设计/code/android/QLBundle/src/com/nostra13/universalimageloader/core/download/ImageDownloader.java",
"license": "apache-2.0",
"size": 3020
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 867,758 |
public void testInterfaces001() {
String thisTestName = "testInterfaces001";
logWriter.println("==> " + thisTestName + " for " + thisCommandName + ": START...");
synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY);
String checkedClassSignature = "Lorg/apache/harmon... | void function() { String thisTestName = STR; logWriter.println(STR + thisTestName + STR + thisCommandName + STR); synchronizer.receiveMessage(JPDADebuggeeSynchronizer.SGNL_READY); String checkedClassSignature = STR; long refTypeID = getClassIDBySignature(checkedClassSignature); logWriter.println(STR + getDebuggeeClassN... | /**
* This testcase exercises ReferenceType.Interfaces command.
* <BR>The test starts InterfacesDebuggee class, requests referenceTypeId
* for this class by VirtualMachine.ClassesBySignature command, then
* performs ReferenceType.Interfaces command and checks that returned
* list of interf... | This testcase exercises ReferenceType.Interfaces command. The test starts InterfacesDebuggee class, requests referenceTypeId for this class by VirtualMachine.ClassesBySignature command, then performs ReferenceType.Interfaces command and checks that returned list of interfaces corresponds to expected list | testInterfaces001 | {
"repo_name": "skyHALud/codenameone",
"path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/jdktools/modules/jpda/src/test/java/org/apache/harmony/jpda/tests/jdwp/ReferenceType/InterfacesTest.java",
"license": "gpl-2.0",
"size": 7244
} | [
"org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket",
"org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands",
"org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket",
"org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer"
] | import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket; import org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands; import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket; import org.apache.harmony.jpda.tests.share.JPDADebuggeeSynchronizer; | import org.apache.harmony.jpda.tests.framework.jdwp.*; import org.apache.harmony.jpda.tests.share.*; | [
"org.apache.harmony"
] | org.apache.harmony; | 751,886 |
private Node rewriteCallExpression(Node call, DecompositionState state) {
checkArgument(call.isCall(), call);
Node first = call.getFirstChild();
checkArgument(NodeUtil.isGet(first), first);
// Find the type of (fn expression).call
JSType fnType = first.getJSType();
JSType fnCallType = null;
... | Node function(Node call, DecompositionState state) { checkArgument(call.isCall(), call); Node first = call.getFirstChild(); checkArgument(NodeUtil.isGet(first), first); JSType fnType = first.getJSType(); JSType fnCallType = null; if (fnType != null) { fnCallType = fnType.isFunctionType() ? fnType.toMaybeFunctionType().... | /**
* Rewrite the call so "this" is preserved.
*
* <pre>a.b(c);</pre>
*
* becomes:
*
* <pre>
* var temp1 = a; var temp0 = temp1.b;
* temp0.call(temp1,c);
* </pre>
*
* @return The replacement node.
*/ | Rewrite the call so "this" is preserved. <code>a.b(c);</code> becomes: <code> var temp1 = a; var temp0 = temp1.b; temp0.call(temp1,c); </code> | rewriteCallExpression | {
"repo_name": "Yannic/closure-compiler",
"path": "src/com/google/javascript/jscomp/ExpressionDecomposer.java",
"license": "apache-2.0",
"size": 41829
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.jscomp.Es6ToEs3Util",
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.jstype.JSType"
] | import com.google.common.base.Preconditions; import com.google.javascript.jscomp.Es6ToEs3Util; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType; | import com.google.common.base.*; import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 2,905,655 |
@Test
public void testRenderAsPackedIntStrideRegion() throws Exception {
File f = File.createTempFile("testRenderAsPackedIntStrideRegion", "."
+ OME_FORMAT);
XMLMockObjects xml = new XMLMockObjects();
XMLWriter writer = new XMLWriter();
writer.writeFile(f, xml.cre... | void function() throws Exception { File f = File.createTempFile(STR, "." + OME_FORMAT); XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(f, xml.createImage(), true); List<Pixels> pixels = null; try { pixels = importFile(f, OME_FORMAT); } catch (Throwable e) { throw new Exc... | /**
* Tests to render a plane using the stride parameter, not all pixels will
* be rendered. The method uses the <code>renderAsPackedInt</code> method.
*
* @throws Exception
* Thrown if an error occurred.
*/ | Tests to render a plane using the stride parameter, not all pixels will be rendered. The method uses the <code>renderAsPackedInt</code> method | testRenderAsPackedIntStrideRegion | {
"repo_name": "simleo/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/RenderingEngineTest.java",
"license": "gpl-2.0",
"size": 131741
} | [
"java.awt.image.BufferedImage",
"java.io.File",
"java.util.List",
"org.testng.Assert"
] | import java.awt.image.BufferedImage; import java.io.File; import java.util.List; import org.testng.Assert; | import java.awt.image.*; import java.io.*; import java.util.*; import org.testng.*; | [
"java.awt",
"java.io",
"java.util",
"org.testng"
] | java.awt; java.io; java.util; org.testng; | 2,844,745 |
public void write(SAML11AttributeType attributeType) throws ProcessingException {
StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.ATTRIBUTE.get(), ns);
writeAttributeTypeWithoutRootTag(attributeType);
StaxUtil.writeEndElement(writer);
StaxUtil.flush(writer);... | void function(SAML11AttributeType attributeType) throws ProcessingException { StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.ATTRIBUTE.get(), ns); writeAttributeTypeWithoutRootTag(attributeType); StaxUtil.writeEndElement(writer); StaxUtil.flush(writer); } | /**
* Write an {@code AttributeType} to stream
*
* @param attributeType
* @param out
*
* @throws ProcessingException
*/ | Write an AttributeType to stream | write | {
"repo_name": "anaerobic/keycloak",
"path": "saml/saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v1/writers/SAML11AssertionWriter.java",
"license": "apache-2.0",
"size": 19194
} | [
"org.keycloak.dom.saml.v1.assertion.SAML11AttributeType",
"org.keycloak.saml.common.constants.JBossSAMLConstants",
"org.keycloak.saml.common.exceptions.ProcessingException",
"org.keycloak.saml.common.util.StaxUtil"
] | import org.keycloak.dom.saml.v1.assertion.SAML11AttributeType; import org.keycloak.saml.common.constants.JBossSAMLConstants; import org.keycloak.saml.common.exceptions.ProcessingException; import org.keycloak.saml.common.util.StaxUtil; | import org.keycloak.dom.saml.v1.assertion.*; import org.keycloak.saml.common.constants.*; import org.keycloak.saml.common.exceptions.*; import org.keycloak.saml.common.util.*; | [
"org.keycloak.dom",
"org.keycloak.saml"
] | org.keycloak.dom; org.keycloak.saml; | 2,353,343 |
public static LostEdgeData createLostEdgeData(final DDiagramElement diagramElement) {
Option<? extends RepresentationElementMapping> mapping = new DDiagramElementQuery(diagramElement).getMapping();
final LostEdgeData data = new LostEdgeData();
data.setTarget(diagramElement.getTarget());
... | static LostEdgeData function(final DDiagramElement diagramElement) { Option<? extends RepresentationElementMapping> mapping = new DDiagramElementQuery(diagramElement).getMapping(); final LostEdgeData data = new LostEdgeData(); data.setTarget(diagramElement.getTarget()); data.setMapping(mapping.get()); final EdgeTarget ... | /**
* Create lost edge data from diagram element.
*
* @param diagramElement
* Diagram element.
* @return Lost edge data.
*/ | Create lost edge data from diagram element | createLostEdgeData | {
"repo_name": "FTSRG/iq-sirius-integration",
"path": "host/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostElementFactory.java",
"license": "epl-1.0",
"size": 4732
} | [
"org.eclipse.sirius.diagram.DDiagramElement",
"org.eclipse.sirius.diagram.DEdge",
"org.eclipse.sirius.diagram.EdgeTarget",
"org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery",
"org.eclipse.sirius.ext.base.Option",
"org.eclipse.sirius.viewpoint.description.RepresentationElementMapping"
] | import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.description.RepresentationEl... | import org.eclipse.sirius.diagram.*; import org.eclipse.sirius.diagram.business.api.query.*; import org.eclipse.sirius.ext.base.*; import org.eclipse.sirius.viewpoint.description.*; | [
"org.eclipse.sirius"
] | org.eclipse.sirius; | 2,631,037 |
private static List<PortDescription> parseFujitsuT100Ports(HierarchicalConfiguration cfg) {
AtomicInteger counter = new AtomicInteger(1);
List<PortDescription> portDescriptions = Lists.newArrayList();
List<HierarchicalConfiguration> subtrees =
cfg.configurationsAt("data.inter... | static List<PortDescription> function(HierarchicalConfiguration cfg) { AtomicInteger counter = new AtomicInteger(1); List<PortDescription> portDescriptions = Lists.newArrayList(); List<HierarchicalConfiguration> subtrees = cfg.configurationsAt(STR); for (HierarchicalConfiguration portConfig : subtrees) { if (!portConfi... | /**
* Parses a configuration and returns a set of ports for the fujitsu T100.
*
* @param cfg a hierarchical configuration
* @return a list of port descriptions
*/ | Parses a configuration and returns a set of ports for the fujitsu T100 | parseFujitsuT100Ports | {
"repo_name": "gkatsikas/onos",
"path": "drivers/fujitsu/src/main/java/org/onosproject/drivers/fujitsu/FujitsuT100DeviceDescription.java",
"license": "apache-2.0",
"size": 6786
} | [
"com.google.common.collect.Lists",
"java.util.List",
"java.util.concurrent.atomic.AtomicInteger",
"org.apache.commons.configuration.HierarchicalConfiguration",
"org.onosproject.net.device.PortDescription"
] | import com.google.common.collect.Lists; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.configuration.HierarchicalConfiguration; import org.onosproject.net.device.PortDescription; | import com.google.common.collect.*; import java.util.*; import java.util.concurrent.atomic.*; import org.apache.commons.configuration.*; import org.onosproject.net.device.*; | [
"com.google.common",
"java.util",
"org.apache.commons",
"org.onosproject.net"
] | com.google.common; java.util; org.apache.commons; org.onosproject.net; | 2,749,633 |
public static List<Object> getArgumentsForNameStyle(String name, FacebookNameStyle style) throws IllegalArgumentException {
if (style == null) {
throw new IllegalArgumentException("Parameters style cannot be null");
}
switch (style) {
case EXACT:
retur... | static List<Object> function(String name, FacebookNameStyle style) throws IllegalArgumentException { if (style == null) { throw new IllegalArgumentException(STR); } switch (style) { case EXACT: return getArguments(name); case GET: return getArguments(convertToGetMethod(name)); case SEARCH: return getArguments(convertTo... | /**
* Gets argument types and names for all overloaded methods with the given short form name.
*
* @param name method name, may be a short form
* @param style name style
* @return list of arguments of the form Class type1, String name1, Class type2, String name2,...
*/ | Gets argument types and names for all overloaded methods with the given short form name | getArgumentsForNameStyle | {
"repo_name": "nikhilvibhav/camel",
"path": "components/camel-facebook/src/main/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelper.java",
"license": "apache-2.0",
"size": 15572
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"org.apache.camel.component.facebook.config.FacebookNameStyle"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.camel.component.facebook.config.FacebookNameStyle; | import java.util.*; import org.apache.camel.component.facebook.config.*; | [
"java.util",
"org.apache.camel"
] | java.util; org.apache.camel; | 2,520,507 |
protected void onBindSubheaderView(@NonNull Object viewHolder, int position) {
final NavigationItem item = getItem(position);
if (viewHolder instanceof TextView) {
final TextView subheaderView = (TextView) viewHolder;
subheaderView.setText(item.getTitle());
if (item.hasTitleTextColor()) {
subheaderV... | void function(@NonNull Object viewHolder, int position) { final NavigationItem item = getItem(position); if (viewHolder instanceof TextView) { final TextView subheaderView = (TextView) viewHolder; subheaderView.setText(item.getTitle()); if (item.hasTitleTextColor()) { subheaderView.setTextColor(item.getTitleTextColor()... | /**
* Invoked from {@link #onBindViewHolder(Object, int)} to bind the specified <var>viewHolder</var> as
* <b>navigation subheader</b>.
* <p>
* This implementation sets to the specified view holder casted to {@link TextView} (if possible)
* <b>title text</b> and <b>title text color</b> provided by the Navigat... | Invoked from <code>#onBindViewHolder(Object, int)</code> to bind the specified viewHolder as navigation subheader. This implementation sets to the specified view holder casted to <code>TextView</code> (if possible) title text and title text color provided by the NavigationItem at the specified position | onBindSubheaderView | {
"repo_name": "android-libraries/android_ui",
"path": "library/src/navigation/java/com/albedinsky/android/ui/navigation/BaseNavigationAdapter.java",
"license": "apache-2.0",
"size": 17395
} | [
"android.support.annotation.NonNull",
"android.widget.TextView"
] | import android.support.annotation.NonNull; import android.widget.TextView; | import android.support.annotation.*; import android.widget.*; | [
"android.support",
"android.widget"
] | android.support; android.widget; | 1,976,646 |
@Test
public void freeException() throws Exception {
AlluxioURI file = new AlluxioURI("/file");
FreeOptions freeOptions = FreeOptions.defaults().setRecursive(true);
doThrow(EXCEPTION).when(mFileSystemMasterClient).free(file, freeOptions);
try {
mFileSystem.free(file, freeOptions);
fail(S... | void function() throws Exception { AlluxioURI file = new AlluxioURI("/file"); FreeOptions freeOptions = FreeOptions.defaults().setRecursive(true); doThrow(EXCEPTION).when(mFileSystemMasterClient).free(file, freeOptions); try { mFileSystem.free(file, freeOptions); fail(SHOULD_HAVE_PROPAGATED_MESSAGE); } catch (Exception... | /**
* Ensures that an exception is propagated correctly when freeing a file.
*/ | Ensures that an exception is propagated correctly when freeing a file | freeException | {
"repo_name": "Reidddddd/alluxio",
"path": "core/client/fs/src/test/java/alluxio/client/file/BaseFileSystemTest.java",
"license": "apache-2.0",
"size": 21383
} | [
"org.junit.Assert",
"org.mockito.Mockito"
] | import org.junit.Assert; import org.mockito.Mockito; | import org.junit.*; import org.mockito.*; | [
"org.junit",
"org.mockito"
] | org.junit; org.mockito; | 536,346 |
private void setMonotonicity(ARXConfiguration config) {
setAnonymityPropertyPredictable(config.getMonotonicityOfPrivacy() == Monotonicity.FULL);
} | void function(ARXConfiguration config) { setAnonymityPropertyPredictable(config.getMonotonicityOfPrivacy() == Monotonicity.FULL); } | /**
* Sets the monotonicity of the anonymity property
* @param config
*/ | Sets the monotonicity of the anonymity property | setMonotonicity | {
"repo_name": "kentoa/arx",
"path": "src/main/org/deidentifier/arx/framework/lattice/SolutionSpace.java",
"license": "apache-2.0",
"size": 16578
} | [
"org.deidentifier.arx.ARXConfiguration"
] | import org.deidentifier.arx.ARXConfiguration; | import org.deidentifier.arx.*; | [
"org.deidentifier.arx"
] | org.deidentifier.arx; | 1,562,888 |
public Builder setDrmLicenseRequestHeaders(
@Nullable Map<String, String> licenseRequestHeaders) {
this.drmLicenseRequestHeaders =
licenseRequestHeaders != null && !licenseRequestHeaders.isEmpty()
? Collections.unmodifiableMap(new HashMap<>(licenseRequestHeaders))
... | Builder function( @Nullable Map<String, String> licenseRequestHeaders) { this.drmLicenseRequestHeaders = licenseRequestHeaders != null && !licenseRequestHeaders.isEmpty() ? Collections.unmodifiableMap(new HashMap<>(licenseRequestHeaders)) : Collections.emptyMap(); return this; } | /**
* Sets the optional request headers attached to the drm license request.
*
* <p>{@code null} or an empty {@link Map} can be used for a reset.
*
* <p>If no valid drm configuration is specified, the drm license request headers are ignored.
*/ | Sets the optional request headers attached to the drm license request. null or an empty <code>Map</code> can be used for a reset. If no valid drm configuration is specified, the drm license request headers are ignored | setDrmLicenseRequestHeaders | {
"repo_name": "stari4ek/ExoPlayer",
"path": "library/common/src/main/java/com/google/android/exoplayer2/MediaItem.java",
"license": "apache-2.0",
"size": 30360
} | [
"androidx.annotation.Nullable",
"java.util.Collections",
"java.util.HashMap",
"java.util.Map"
] | import androidx.annotation.Nullable; import java.util.Collections; import java.util.HashMap; import java.util.Map; | import androidx.annotation.*; import java.util.*; | [
"androidx.annotation",
"java.util"
] | androidx.annotation; java.util; | 1,021,432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.