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 List<AppdefResourceValue> buildAppdefResources(int sessionId, AppdefBoss boss, AppdefEntityID[] entities) throws ObjectNotFoundException, RemoteException, SessionTimeoutException, SessionNotFoundException, PermissionExc...
static List<AppdefResourceValue> function(int sessionId, AppdefBoss boss, AppdefEntityID[] entities) throws ObjectNotFoundException, RemoteException, SessionTimeoutException, SessionNotFoundException, PermissionException { if (entities == null) return new ArrayList(); return boss.findByIds(sessionId, entities, PageCont...
/** * This method builds a list of AppdefResourceValue objects * from a list of AppdefEntityID. * * This function should be moved into bizapp layer if possible * later. I am leaving it until I have an api which provides * similar functionality. * * @return a list of Appde...
This method builds a list of AppdefResourceValue objects from a list of AppdefEntityID. This function should be moved into bizapp layer if possible later. I am leaving it until I have an api which provides similar functionality
buildAppdefResources
{ "repo_name": "cc14514/hq6", "path": "hq-web/src/main/java/org/hyperic/hq/ui/util/BizappUtils.java", "license": "unlicense", "size": 45701 }
[ "java.rmi.RemoteException", "java.util.ArrayList", "java.util.List", "org.hyperic.hq.appdef.shared.AppdefEntityID", "org.hyperic.hq.appdef.shared.AppdefResourceValue", "org.hyperic.hq.auth.shared.SessionNotFoundException", "org.hyperic.hq.auth.shared.SessionTimeoutException", "org.hyperic.hq.authz.sha...
import java.rmi.RemoteException; import java.util.ArrayList; import java.util.List; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.AppdefResourceValue; import org.hyperic.hq.auth.shared.SessionNotFoundException; import org.hyperic.hq.auth.shared.SessionTimeoutException; import o...
import java.rmi.*; import java.util.*; import org.hyperic.hq.appdef.shared.*; import org.hyperic.hq.auth.shared.*; import org.hyperic.hq.authz.shared.*; import org.hyperic.hq.bizapp.shared.*; import org.hyperic.hq.common.*; import org.hyperic.util.pager.*;
[ "java.rmi", "java.util", "org.hyperic.hq", "org.hyperic.util" ]
java.rmi; java.util; org.hyperic.hq; org.hyperic.util;
2,666,466
protected void validationFailed(TableForm form, Object object) { logger.debug("Form validation failed"); }
void function(TableForm form, Object object) { logger.debug(STR); }
/** * Invoked when form validation fails. */
Invoked when form validation fails
validationFailed
{ "repo_name": "OldShatterhand77/Portofino", "path": "portofino-pageactions/src/main/java/com/manydesigns/portofino/pageactions/form/TableFormAction.java", "license": "lgpl-3.0", "size": 6504 }
[ "com.manydesigns.elements.forms.TableForm" ]
import com.manydesigns.elements.forms.TableForm;
import com.manydesigns.elements.forms.*;
[ "com.manydesigns.elements" ]
com.manydesigns.elements;
4,402
private static double transform( double value ) { return toDegrees(atan(value)); } /** * Estimate the gradient (p=f_{x}^{2}+f_{y}^{2}) with a finite difference formula: * * <pre> * p=&radic{f<sub>x</sub>&sup2;+f<sub>y</sub>&sup2;}
static double function( double value ) { return toDegrees(atan(value)); } /** * Estimate the gradient (p=f_{x}^{2}+f_{y}^{2}) with a finite difference formula: * * <pre> * p=&radic{f<sub>x</sub>&sup2;+f<sub>y</sub>&sup2;}
/** * Transform the gradient value into degrees. * * @param value the radiant based gradient. * @return the degree gradient. */
Transform the gradient value into degrees
transform
{ "repo_name": "silviafranceschi/jgrasstools", "path": "hortonmachine/src/main/java/org/jgrasstools/hortonmachine/modules/geomorphology/gradient/OmsGradient.java", "license": "gpl-3.0", "size": 13846 }
[ "java.lang.Math" ]
import java.lang.Math;
import java.lang.*;
[ "java.lang" ]
java.lang;
1,792,077
private static List<TypeDescriptor> getAcceptedTypeCombinations(List<List<TypeDescriptor>> acceptedLists) { List<List<TypeDescriptor>> typeLists = combinations(acceptedLists); List<TypeDescriptor> combinedTypes = Lists.newArrayList(); for (List<TypeDescriptor> types : typeLists) { // XXX need an...
static List<TypeDescriptor> function(List<List<TypeDescriptor>> acceptedLists) { List<List<TypeDescriptor>> typeLists = combinations(acceptedLists); List<TypeDescriptor> combinedTypes = Lists.newArrayList(); for (List<TypeDescriptor> types : typeLists) { StringBuilder tag = new StringBuilder(); StringBuilder descriptio...
/** * Get a list of accepted types given lists of types accepted for * each of a set of parameters. * @param acceptedLists * @return */
Get a list of accepted types given lists of types accepted for each of a set of parameters
getAcceptedTypeCombinations
{ "repo_name": "martinisgroup/jlabrad", "path": "JLabrad/src/org/labrad/SettingHandlers.java", "license": "gpl-2.0", "size": 16219 }
[ "com.google.common.collect.Lists", "java.util.List", "org.labrad.types.TypeDescriptor" ]
import com.google.common.collect.Lists; import java.util.List; import org.labrad.types.TypeDescriptor;
import com.google.common.collect.*; import java.util.*; import org.labrad.types.*;
[ "com.google.common", "java.util", "org.labrad.types" ]
com.google.common; java.util; org.labrad.types;
2,277,961
EClass getCorner();
EClass getCorner();
/** * Returns the meta object for class '{@link org.xtext.rollercoaster.dsl.coaster.Corner <em>Corner</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Corner</em>'. * @see org.xtext.rollercoaster.dsl.coaster.Corner * @generated */
Returns the meta object for class '<code>org.xtext.rollercoaster.dsl.coaster.Corner Corner</code>'.
getCorner
{ "repo_name": "bettsmatt/roller-coaster-dsl", "path": "org.xtext.rollercoaster.dsl/src-gen/org/xtext/rollercoaster/dsl/coaster/CoasterPackage.java", "license": "mit", "size": 28313 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
754,969
CriteriaBuilder getCriteriaBuilder();
CriteriaBuilder getCriteriaBuilder();
/** * Get a criteria builder for querying Permissions. * * @return the CriteriaBuilder. */
Get a criteria builder for querying Permissions
getCriteriaBuilder
{ "repo_name": "IISH/delivery", "path": "src/main/java/org/socialhistoryservices/delivery/permission/dao/PermissionDAO.java", "license": "gpl-3.0", "size": 2606 }
[ "javax.persistence.criteria.CriteriaBuilder" ]
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.*;
[ "javax.persistence" ]
javax.persistence;
2,215,080
@SuppressWarnings("deprecation") @Test public void testExpectedResultsInTableStateForBatchPuts() throws Exception { long ts = state.ts; // build up a list of puts to make, all on the same row Put p1 = new Put(row, ts); p1.add(family, qual, Bytes.toBytes("v1")); Put p2 = new Put(row, ts + 1); ...
@SuppressWarnings(STR) void function() throws Exception { long ts = state.ts; Put p1 = new Put(row, ts); p1.add(family, qual, Bytes.toBytes("v1")); Put p2 = new Put(row, ts + 1); p2.add(family, qual, Bytes.toBytes("v2")); final List<Cell> allKvs = new ArrayList<Cell>(2); allKvs.addAll(p2.getFamilyCellMap().get(family))...
/** * Similar to {@link #testExpectedResultsInTableStateForSinglePut()}, but against batches of puts. * Previous implementations managed batches by playing current state against each element in the * batch, rather than combining all the per-row updates into a single mutation for the batch. This * test ensur...
Similar to <code>#testExpectedResultsInTableStateForSinglePut()</code>, but against batches of puts. Previous implementations managed batches by playing current state against each element in the batch, rather than combining all the per-row updates into a single mutation for the batch. This test ensures that we see the ...
testExpectedResultsInTableStateForBatchPuts
{ "repo_name": "cloudera-labs/phoenix", "path": "phoenix-core/src/it/java/org/apache/phoenix/hbase/index/covered/EndToEndCoveredColumnsIndexBuilderIT.java", "license": "apache-2.0", "size": 12536 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.Collections", "java.util.List", "org.apache.hadoop.hbase.Cell", "org.apache.hadoop.hbase.client.HTable", "org.apache.hadoop.hbase.client.Put", "org.apache.hadoop.hbase.util.Bytes", "org.apache.phoenix.hbase.index.covered.update.ColumnReference" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.hbase.index.covered...
import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; import org.apache.phoenix.hbase.index.covered.update.*;
[ "java.util", "org.apache.hadoop", "org.apache.phoenix" ]
java.util; org.apache.hadoop; org.apache.phoenix;
739,349
@Basic( optional = false ) @Column( name = "modified_time", nullable = false ) public Date getModifiedTime() { return this.modifiedTime; }
@Basic( optional = false ) @Column( name = STR, nullable = false ) Date function() { return this.modifiedTime; }
/** * Return the value associated with the column: modifiedTime. * @return A Date object (this.modifiedTime) */
Return the value associated with the column: modifiedTime
getModifiedTime
{ "repo_name": "rpgm/mi15", "path": "rpgm/modules/repository/src/main/java/org/yarlithub/yschool/repository/model/obj/yschool/User.java", "license": "apache-2.0", "size": 9631 }
[ "java.util.Date", "javax.persistence.Basic", "javax.persistence.Column" ]
import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column;
import java.util.*; import javax.persistence.*;
[ "java.util", "javax.persistence" ]
java.util; javax.persistence;
153,239
public Observable<Host> hostByIp(boolean history, boolean minify, String ip) { if (ip == null || ip.isEmpty()) { throw new IllegalArgumentException("Ip can't be null or empty"); } return apiService.hostByIp(ip, apiKey, history, minify); }
Observable<Host> function(boolean history, boolean minify, String ip) { if (ip == null ip.isEmpty()) { throw new IllegalArgumentException(STR); } return apiService.hostByIp(ip, apiKey, history, minify); }
/** * Returns all services that have been found on the given host IP. If the minify param is true * this method returns only the list of ports and the general host information, no banners. If the * history param is true and minify also, then the history not takes effect * * @param history True ...
Returns all services that have been found on the given host IP. If the minify param is true this method returns only the list of ports and the general host information, no banners. If the history param is true and minify also, then the history not takes effect
hostByIp
{ "repo_name": "fooock/jshodan", "path": "src/main/java/com/fooock/shodan/ShodanRestApi.java", "license": "mit", "size": 17938 }
[ "com.fooock.shodan.model.host.Host", "io.reactivex.Observable" ]
import com.fooock.shodan.model.host.Host; import io.reactivex.Observable;
import com.fooock.shodan.model.host.*; import io.reactivex.*;
[ "com.fooock.shodan", "io.reactivex" ]
com.fooock.shodan; io.reactivex;
2,133,791
protected void addTransportVFSMoveAfterFailurePropertyDescriptor(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_InboundEndpoint_transportVFSMoveAfterFailure_feature"), ...
void function(Object object) { itemPropertyDescriptors.add(createItemPropertyDescriptor( ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.INBOUND_ENDPOINT__TRANSPORT_VFS_MOVE_AFTER_FAILURE, true, false, false, ItemP...
/** * This adds a property descriptor for the Transport VFS Move After Failure * feature. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated NOT */
This adds a property descriptor for the Transport VFS Move After Failure feature.
addTransportVFSMoveAfterFailurePropertyDescriptor
{ "repo_name": "nwnpallewela/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/InboundEndpointItemProvider.java", "license": "apache-2.0", "size": 165854 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*;
[ "org.eclipse.emf", "org.wso2.developerstudio" ]
org.eclipse.emf; org.wso2.developerstudio;
2,530,735
public Configuration addRule(final Rule rule) { Assert.assertNotNull("rule can not be null", rule); Assert.assertNotNull("rule id can not be null", rule.getId()); final String id = rule.getId(); Assert.assertFalse("rule id must not be empty", id.equals("")); fina...
Configuration function(final Rule rule) { Assert.assertNotNull(STR, rule); Assert.assertNotNull(STR, rule.getId()); final String id = rule.getId(); Assert.assertFalse(STR, id.equals(STRrule packages can not be nullSTRrule packages must not be emptySTRrule violations must not be emptySTRfailed to add Rule %s to Configur...
/** * <p>Add a new <code>Rule</code> to {@link #rules}</p> * * @param rule Rule to add * @return Configuration this <code>Configuration</code> to allow for method chaining. */
Add a new <code>Rule</code> to <code>#rules</code>
addRule
{ "repo_name": "AndyScherzinger/architecturerules", "path": "architecture-rules/src/main/java/org/architecturerules/configuration/Configuration.java", "license": "apache-2.0", "size": 13357 }
[ "junit.framework.Assert", "org.architecturerules.domain.Rule" ]
import junit.framework.Assert; import org.architecturerules.domain.Rule;
import junit.framework.*; import org.architecturerules.domain.*;
[ "junit.framework", "org.architecturerules.domain" ]
junit.framework; org.architecturerules.domain;
576,748
public void trainClassifier(Classifier classificationModel, File trainingSetFileName, File classifierSaveFile) throws Exception { try { if(trainingSet == null) { loadDataSetFromFile(trainingSetFileName); if(trainingSetFileName == null){ writeLog("No trainning file loaded."); throw new Ex...
void function(Classifier classificationModel, File trainingSetFileName, File classifierSaveFile) throws Exception { try { if(trainingSet == null) { loadDataSetFromFile(trainingSetFileName); if(trainingSetFileName == null){ writeLog(STR); throw new Exception(STR); } } trainingSet.setClassIndex(trainingSet.numAttributes(...
/** * Train a classifier object given a training data set, and save the classifier to a file * in disk. * @param classificationModel, the model to be used to train the classifier. * @param trainingSetFileName, the name of the file containing the training set. * @param classifierSaveFileName, the name of...
Train a classifier object given a training data set, and save the classifier to a file in disk
trainClassifier
{ "repo_name": "cjortegon/Fresificator", "path": "Next_Fruit/src/co/edu/icesi/nextfruit/modules/machinelearning/WekaClassifier.java", "license": "mit", "size": 9422 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
552,528
public static <T> T readFromFile(Path path, Type typeOfSrc, T clazz) throws IOException { JsonReader reader = reader(path); clazz = gson.fromJson(reader, typeOfSrc); reader.close(); return clazz; }
static <T> T function(Path path, Type typeOfSrc, T clazz) throws IOException { JsonReader reader = reader(path); clazz = gson.fromJson(reader, typeOfSrc); reader.close(); return clazz; }
/** * Read from file. * * @param <T> the type parameter * @param path the path * @param typeOfSrc the type of src * @param clazz the clazz * @return the t * @throws java.io.IOException the iO exception */
Read from file
readFromFile
{ "repo_name": "Relicum/Ipsum", "path": "src/main/java/com/relicum/ipsum/io/GsonRaw.java", "license": "gpl-3.0", "size": 3299 }
[ "java.io.IOException", "java.lang.reflect.Type", "java.nio.file.Path", "org.bukkit.craftbukkit.libs.com.google.gson.stream.JsonReader" ]
import java.io.IOException; import java.lang.reflect.Type; import java.nio.file.Path; import org.bukkit.craftbukkit.libs.com.google.gson.stream.JsonReader;
import java.io.*; import java.lang.reflect.*; import java.nio.file.*; import org.bukkit.craftbukkit.libs.com.google.gson.stream.*;
[ "java.io", "java.lang", "java.nio", "org.bukkit.craftbukkit" ]
java.io; java.lang; java.nio; org.bukkit.craftbukkit;
2,776,112
public void startElement(String namespace, String name, String qName, Attributes atts) throws SAXException { // Make sure is correct file type if (count == 0) if (!name.equals("classifications_file")&&!qName.equals("classifications_file")) throw new SAXException("\n\nIt is in reality of the type ...
void function(String namespace, String name, String qName, Attributes atts) throws SAXException { if (count == 0) if (!name.equals(STR)&&!qName.equals(STR)) throw new SAXException(STR + name + "."); count++; tag_identifier = 0; if (name.equals(STR) qName.equals(STR)) { current_root_classification = new SegmentedClassif...
/** * This method is called when the start of an XML element * is encountered. Instantiates new objects when necessary * and lets the characters method know what kind of action * to take. * * @param name Name of the element that is encountered. * @param atts The attributes encountered. * @th...
This method is called when the start of an XML element is encountered. Instantiates new objects when necessary and lets the characters method know what kind of action to take
startElement
{ "repo_name": "dmcennis/jAudioGIT", "path": "src/jAudioFeatureExtractor/ACE/XMLParsers/ParseClassificationsFileHandler.java", "license": "lgpl-2.1", "size": 9314 }
[ "java.util.LinkedList", "org.xml.sax.Attributes", "org.xml.sax.SAXException" ]
import java.util.LinkedList; import org.xml.sax.Attributes; import org.xml.sax.SAXException;
import java.util.*; import org.xml.sax.*;
[ "java.util", "org.xml.sax" ]
java.util; org.xml.sax;
1,240,601
public void testLoad() throws Exception { // Use simple insert statements to insert data. // currently only this form of load is present, once we have // different implementations, the loading mechanism will need // to be configurable taking an option from the command line ...
void function() throws Exception { DataSource ds = JDBCDataSource.getDataSource(); Load loader = new ThreadInsert(ds); loader.setupLoad(getConnection(), scale); if (loaderThreads > 0) loader.setThreadCount(loaderThreads); loader.populateAllTables(); }
/** * test the initial database load * * @throws Exception */
test the initial database load
testLoad
{ "repo_name": "lpxz/grail-derby104", "path": "java/testing/org/apache/derbyTesting/system/oe/run/Populate.java", "license": "apache-2.0", "size": 7635 }
[ "javax.sql.DataSource", "org.apache.derbyTesting.junit.JDBCDataSource", "org.apache.derbyTesting.system.oe.client.Load", "org.apache.derbyTesting.system.oe.load.ThreadInsert" ]
import javax.sql.DataSource; import org.apache.derbyTesting.junit.JDBCDataSource; import org.apache.derbyTesting.system.oe.client.Load; import org.apache.derbyTesting.system.oe.load.ThreadInsert;
import javax.sql.*; import org.apache.*;
[ "javax.sql", "org.apache" ]
javax.sql; org.apache;
968,886
public void onActionBugReport(MenuItem item) { sendBugReport(); }
void function(MenuItem item) { sendBugReport(); }
/** * User clicked "Bug Report" menu option * * @param item the menu item */
User clicked "Bug Report" menu option
onActionBugReport
{ "repo_name": "rapidpro/surveyor", "path": "app/src/main/java/io/rapidpro/surveyor/activity/BaseActivity.java", "license": "isc", "size": 8729 }
[ "android.view.MenuItem" ]
import android.view.MenuItem;
import android.view.*;
[ "android.view" ]
android.view;
145,329
protected boolean isValidClass(Class<?> type) { // should skip non public classes if (!Modifier.isPublic(type.getModifiers())) { return false; } if (!Modifier.isAbstract(type.getModifiers()) && !type.isInterface()) { return true; } return fals...
boolean function(Class<?> type) { if (!Modifier.isPublic(type.getModifiers())) { return false; } if (!Modifier.isAbstract(type.getModifiers()) && !type.isInterface()) { return true; } return false; }
/** * Returns <tt>true</tt>if the class is a public, non-abstract class */
Returns trueif the class is a public, non-abstract class
isValidClass
{ "repo_name": "kevinearls/camel", "path": "components/camel-spring/src/main/java/org/apache/camel/spring/PackageScanRouteBuilderFinder.java", "license": "apache-2.0", "size": 4598 }
[ "java.lang.reflect.Modifier" ]
import java.lang.reflect.Modifier;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,918,529
protected void addBox(Box box) { super.addBox(box); updateAveragesForBox(box); }
void function(Box box) { super.addBox(box); updateAveragesForBox(box); }
/** * Adds a new box to the area and updates the area bounds. * @param box the new box to add */
Adds a new box to the area and updates the area bounds
addBox
{ "repo_name": "Michal27/dp_vips_fitlayout", "path": "src/main/java/org/fit/segm/grouping/AreaImpl.java", "license": "lgpl-3.0", "size": 29870 }
[ "org.fit.layout.model.Box" ]
import org.fit.layout.model.Box;
import org.fit.layout.model.*;
[ "org.fit.layout" ]
org.fit.layout;
1,488,069
@Override public void onClick(View view) { ImageView image = (ImageView) view; image.startAnimation(animFadein); presenter.onImageViewClicked(Integer.parseInt(view.getTag().toString())); }
void function(View view) { ImageView image = (ImageView) view; image.startAnimation(animFadein); presenter.onImageViewClicked(Integer.parseInt(view.getTag().toString())); }
/** * Imageview event click listeners * * @param view Imageview that was clicked */
Imageview event click listeners
onClick
{ "repo_name": "snappy46/GuitarixDroid", "path": "app/src/main/java/com/marcel/guitarixdroid/view/MainActivity.java", "license": "gpl-3.0", "size": 15901 }
[ "android.view.View", "android.widget.ImageView" ]
import android.view.View; import android.widget.ImageView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,317,957
// Always use the cache, if possible. if (cachedLocation != null) { return cachedLocation; } // We're using geo location by IP, because many headless Android devices don't return anything // useful through the usual location APIs. String response = Network.get(GEO_IP_URL); if (response ==...
if (cachedLocation != null) { return cachedLocation; } String response = Network.get(GEO_IP_URL); if (response == null) { Log.e(TAG, STR); return null; } try { JSONObject responseJson = new JSONObject(response); double latitude = responseJson.getDouble("lat"); double longitude = responseJson.getDouble("lon"); Location ...
/** * Makes a request to the geo location API and returns the current location or {@code null} on * error. Uses an in memory cache after the first request. */
Makes a request to the geo location API and returns the current location or null on error. Uses an in memory cache after the first request
getLocation
{ "repo_name": "maxbbraun/mirror", "path": "app/src/main/java/net/maxbraun/mirror/GeoLocation.java", "license": "apache-2.0", "size": 1790 }
[ "android.location.Location", "android.util.Log", "org.json.JSONObject" ]
import android.location.Location; import android.util.Log; import org.json.JSONObject;
import android.location.*; import android.util.*; import org.json.*;
[ "android.location", "android.util", "org.json" ]
android.location; android.util; org.json;
571,874
public void sendNewSurveyAction(HttpServletRequest request) { String action = request.getParameter("Action"); if ("SendNewSurvey".equals(action)) { String title = request.getParameter("title"); String description = request.getParameter("description"); String beginDate = request.getParameter(...
void function(HttpServletRequest request) { String action = request.getParameter(STR); if (STR.equals(action)) { String title = request.getParameter("title"); String description = request.getParameter(STR); String beginDate = request.getParameter(STR); String endDate = request.getParameter(STR); String nbQuestions = re...
/** * Refactoring : get code from view JSP and add it inside controller * * @param request the HttpServletRequest which contains all the request parameter */
Refactoring : get code from view JSP and add it inside controller
sendNewSurveyAction
{ "repo_name": "CecileBONIN/Silverpeas-Components", "path": "survey/survey-war/src/main/java/com/stratelia/webactiv/survey/control/SurveySessionController.java", "license": "agpl-3.0", "size": 54356 }
[ "com.silverpeas.util.StringUtil", "com.stratelia.silverpeas.silvertrace.SilverTrace", "com.stratelia.webactiv.util.DateUtil", "com.stratelia.webactiv.util.questionContainer.model.QuestionContainerDetail", "com.stratelia.webactiv.util.questionContainer.model.QuestionContainerHeader", "java.text.ParseExcept...
import com.silverpeas.util.StringUtil; import com.stratelia.silverpeas.silvertrace.SilverTrace; import com.stratelia.webactiv.util.DateUtil; import com.stratelia.webactiv.util.questionContainer.model.QuestionContainerDetail; import com.stratelia.webactiv.util.questionContainer.model.QuestionContainerHeader; import java...
import com.silverpeas.util.*; import com.stratelia.silverpeas.silvertrace.*; import com.stratelia.webactiv.util.*; import java.text.*; import javax.servlet.http.*;
[ "com.silverpeas.util", "com.stratelia.silverpeas", "com.stratelia.webactiv", "java.text", "javax.servlet" ]
com.silverpeas.util; com.stratelia.silverpeas; com.stratelia.webactiv; java.text; javax.servlet;
1,857,732
public void queueCommand(Command<M> command) { BlockingQueue<Command<M>> executionQueue = waitForCommandQueue(); executionQueue.add(command); }
void function(Command<M> command) { BlockingQueue<Command<M>> executionQueue = waitForCommandQueue(); executionQueue.add(command); }
/** * Adds the command to the execution queue, possibly waiting for the queue * to become available. * * @param command */
Adds the command to the execution queue, possibly waiting for the queue to become available
queueCommand
{ "repo_name": "VHAINNOVATIONS/Telepathology", "path": "Source/Java/ImagingCommon/main/src/java/gov/va/med/interactive/CommandProcessor.java", "license": "apache-2.0", "size": 6438 }
[ "java.util.concurrent.BlockingQueue" ]
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,042,619
public List<JobLog> findByJobTimerId(String jobTimerId) { return (List<JobLog>) this .getEntityManager() .createQuery( "select e from JobLog e where e.clientId = :clientId and e.jobTimer.id = :jobTimerId", JobLog.class) .setParameter("clientId", Session.user.get().getClient().getId())...
List<JobLog> function(String jobTimerId) { return (List<JobLog>) this .getEntityManager() .createQuery( STR, JobLog.class) .setParameter(STR, Session.user.get().getClient().getId()) .setParameter(STR, jobTimerId).getResultList(); }
/** * Find by ID of reference: jobTimer.id */
Find by ID of reference: jobTimer.id
findByJobTimerId
{ "repo_name": "seava/seava.mod.ad", "path": "seava.mod.ad.business/src/main/java/seava/ad/business/impl/scheduler/JobLog_Service.java", "license": "apache-2.0", "size": 2906 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
92,981
@Override public ClusterSearchShardsRequest indices(String... indices) { Objects.requireNonNull(indices, "indices must not be null"); for (int i = 0; i < indices.length; i++) { Objects.requireNonNull(indices[i], "indices[" + i + "] must not be null"); } this.indices =...
ClusterSearchShardsRequest function(String... indices) { Objects.requireNonNull(indices, STR); for (int i = 0; i < indices.length; i++) { Objects.requireNonNull(indices[i], STR + i + STR); } this.indices = indices; return this; }
/** * Sets the indices the search will be executed on. */
Sets the indices the search will be executed on
indices
{ "repo_name": "GlenRSmith/elasticsearch", "path": "server/src/main/java/org/elasticsearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java", "license": "apache-2.0", "size": 4127 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
20,796
void requestMac(IpAddress ip);
void requestMac(IpAddress ip);
/** * Requests the host service to resolve the MAC address for the given IP * address. This will trigger a notification to the host listeners if the MAC * address is found. * * @param ip IP address to find the MAC address for */
Requests the host service to resolve the MAC address for the given IP address. This will trigger a notification to the host listeners if the MAC address is found
requestMac
{ "repo_name": "sdnwiselab/onos", "path": "core/api/src/main/java/org/onosproject/net/host/HostService.java", "license": "apache-2.0", "size": 3707 }
[ "org.onlab.packet.IpAddress" ]
import org.onlab.packet.IpAddress;
import org.onlab.packet.*;
[ "org.onlab.packet" ]
org.onlab.packet;
1,763,835
private static Duration extractStepFromUri(String uriString) { try { Uri uri = Uri.create(uriString, Uri.RELAXED); return uri.query() .get("step") .map(Strings$.MODULE$::parseDuration) .orElse(DEFAULT_STEP); } catch (Exception e) { return DEFAULT_STEP; } }
static Duration function(String uriString) { try { Uri uri = Uri.create(uriString, Uri.RELAXED); return uri.query() .get("step") .map(Strings$.MODULE$::parseDuration) .orElse(DEFAULT_STEP); } catch (Exception e) { return DEFAULT_STEP; } }
/** * Try to extract the step size based on the URI query parameter. If this fails for any * reason or the parameter is not present, then use the default of 1 minute. */
Try to extract the step size based on the URI query parameter. If this fails for any reason or the parameter is not present, then use the default of 1 minute
extractStepFromUri
{ "repo_name": "brharrington/atlas", "path": "atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/Evaluator.java", "license": "apache-2.0", "size": 17479 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
341,901
private boolean isMonitorReady() { return (state == MonitorStateEnum.RUNNING || state == MonitorStateEnum.NEW); }
boolean function() { return (state == MonitorStateEnum.RUNNING state == MonitorStateEnum.NEW); }
/** * Checks if is monitor ready. * * @return true, if is monitor is ready */
Checks if is monitor ready
isMonitorReady
{ "repo_name": "R-daneel-olivaw/gcRadar", "path": "src/com/gcr/monitors/SimpleObjectMonitor.java", "license": "lgpl-3.0", "size": 10594 }
[ "com.gcr.monitors.modules.monitoring.structs.MonitorStateEnum" ]
import com.gcr.monitors.modules.monitoring.structs.MonitorStateEnum;
import com.gcr.monitors.modules.monitoring.structs.*;
[ "com.gcr.monitors" ]
com.gcr.monitors;
1,764,782
@Override public BigInteger getAsBigInteger() { if (elements.size() == 1) { return elements.get(0).getAsBigInteger(); } throw new IllegalStateException(); }
BigInteger function() { if (elements.size() == 1) { return elements.get(0).getAsBigInteger(); } throw new IllegalStateException(); }
/** * convenience method to get this array as a {@link BigInteger} if it contains a single element. * * @return get this element as a {@link BigInteger} if it is single element array. * @throws ClassCastException if the element in the array is of not a {@link JsonPrimitive}. * @throws NumberFormatExcepti...
convenience method to get this array as a <code>BigInteger</code> if it contains a single element
getAsBigInteger
{ "repo_name": "oloflarsson/minecraft-ancient-gates", "path": "src/org/mcteam/ancientgates/gson/JsonArray.java", "license": "gpl-3.0", "size": 9803 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
2,869,403
public AuditEvent getAuditEvent() { return this.auditEvent; }
AuditEvent function() { return this.auditEvent; }
/** * Get the audit event. * @return the audit event */
Get the audit event
getAuditEvent
{ "repo_name": "mdeinum/spring-boot", "path": "spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/listener/AuditApplicationEvent.java", "license": "apache-2.0", "size": 2822 }
[ "org.springframework.boot.actuate.audit.AuditEvent" ]
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.actuate.audit.*;
[ "org.springframework.boot" ]
org.springframework.boot;
2,773,105
public static boolean getBoolean(String name, Map values, boolean defaultValue) { final Object raw = values.get( name ); final Boolean value = toBoolean( raw, defaultValue ); if ( value == null ) { throw new ConfigurationException( "Could not determine how to handle configuration raw [name=" + name + ...
static boolean function(String name, Map values, boolean defaultValue) { final Object raw = values.get( name ); final Boolean value = toBoolean( raw, defaultValue ); if ( value == null ) { throw new ConfigurationException( STR + name + STR + raw + STR ); } return value; }
/** * Get the config value as a boolean. * * @param name The config setting name. * @param values The map of config values * @param defaultValue The default value to use if not found * * @return The value. */
Get the config value as a boolean
getBoolean
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/hibernate-core/org/hibernate/internal/util/config/ConfigurationHelper.java", "license": "gpl-2.0", "size": 14400 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,073,555
@Override public void testUnknownField() throws IOException { try { parseQuery("{ \"" + WrapperQueryBuilder.NAME + "\" : {\"bogusField\" : \"someValue\"} }"); fail("ParsingException expected."); } catch (ParsingException e) { assertTrue(e.getMessage().contains...
void function() throws IOException { try { parseQuery(STRSTR\STRbogusField\STRsomeValue\STR); fail(STR); } catch (ParsingException e) { assertTrue(e.getMessage().contains(STR)); } }
/** * Replace the generic test from superclass, wrapper query only expects * to find `query` field with nested query and should throw exception for * anything else. */
Replace the generic test from superclass, wrapper query only expects to find `query` field with nested query and should throw exception for anything else
testUnknownField
{ "repo_name": "rhoml/elasticsearch", "path": "core/src/test/java/org/elasticsearch/index/query/WrapperQueryBuilderTests.java", "license": "apache-2.0", "size": 4967 }
[ "java.io.IOException", "org.elasticsearch.common.ParsingException" ]
import java.io.IOException; import org.elasticsearch.common.ParsingException;
import java.io.*; import org.elasticsearch.common.*;
[ "java.io", "org.elasticsearch.common" ]
java.io; org.elasticsearch.common;
750,296
@Override protected void createIdResolver() { if (resolver != null && resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next())) { return; } else { if (resolver == null) { if (clsCol.size() > 1) { resolver = new IdResolver()...
void function() { if (resolver != null && resolver.hasTaxonAndClassName(taxonId, this.clsCol.iterator().next())) { return; } else { if (resolver == null) { if (clsCol.size() > 1) { resolver = new IdResolver(); } else { resolver = new IdResolver(clsCol.iterator().next()); } } } try { boolean isCachedIdResolverRestored =...
/** * Build an IdResolver from Toxoplasma Gene toxoplasmagondii file * @return an IdResolver for Toxoplasma Gene */
Build an IdResolver from Toxoplasma Gene toxoplasmagondii file
createIdResolver
{ "repo_name": "drhee/toxoMine", "path": "bio/core/main/src/org/intermine/bio/dataconversion/ToxoIdentifiersResolverFactory.java", "license": "lgpl-2.1", "size": 4387 }
[ "java.io.File", "org.apache.commons.lang.StringUtils", "org.intermine.util.PropertiesUtil" ]
import java.io.File; import org.apache.commons.lang.StringUtils; import org.intermine.util.PropertiesUtil;
import java.io.*; import org.apache.commons.lang.*; import org.intermine.util.*;
[ "java.io", "org.apache.commons", "org.intermine.util" ]
java.io; org.apache.commons; org.intermine.util;
819,897
@Override public int getNbHtmlObjectsDisplayed(FieldTemplate template, PagesContext pagesContext) { return 2; }
int function(FieldTemplate template, PagesContext pagesContext) { return 2; }
/** * Method declaration * * @return */
Method declaration
getNbHtmlObjectsDisplayed
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "lib-core/src/main/java/com/silverpeas/form/displayers/ImageFieldDisplayer.java", "license": "agpl-3.0", "size": 10617 }
[ "com.silverpeas.form.FieldTemplate", "com.silverpeas.form.PagesContext" ]
import com.silverpeas.form.FieldTemplate; import com.silverpeas.form.PagesContext;
import com.silverpeas.form.*;
[ "com.silverpeas.form" ]
com.silverpeas.form;
1,840,082
if (currentOffset < dataLength) { byte[] t = new byte[Math.min((int) (Integer.MAX_VALUE & (dataLength - currentOffset)), 32 * 1024)]; while (currentOffset < dataLength) { int n = read(t, 0, t.length); if (0 == n) { throw new EOFException("Could not validate checksum"); ...
if (currentOffset < dataLength) { byte[] t = new byte[Math.min((int) (Integer.MAX_VALUE & (dataLength - currentOffset)), 32 * 1024)]; while (currentOffset < dataLength) { int n = read(t, 0, t.length); if (0 == n) { throw new EOFException(STR); } } } in.close(); }
/** * Close the input stream. Note that we need to read to the end of the * stream to validate the checksum. */
Close the input stream. Note that we need to read to the end of the stream to validate the checksum
close
{ "repo_name": "rekhajoshm/mapreduce-fork", "path": "src/java/org/apache/hadoop/mapred/IFileInputStream.java", "license": "apache-2.0", "size": 5908 }
[ "java.io.EOFException" ]
import java.io.EOFException;
import java.io.*;
[ "java.io" ]
java.io;
2,146,963
private Map<String, String> constructRootRelativePathsMap() { Map<String, String> rootRelativePathsMap = Maps.newLinkedHashMap(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); Preconditions.checkState(colonIndex > 0); String execPath = mapString.subs...
Map<String, String> function() { Map<String, String> rootRelativePathsMap = Maps.newLinkedHashMap(); for (String mapString : config.manifestMaps) { int colonIndex = mapString.indexOf(':'); Preconditions.checkState(colonIndex > 0); String execPath = mapString.substring(0, colonIndex); String rootRelativePath = mapString...
/** * Construct and return the input root path map. The key is the exec path of * each input file, and the value is the corresponding root relative path. */
Construct and return the input root path map. The key is the exec path of each input file, and the value is the corresponding root relative path
constructRootRelativePathsMap
{ "repo_name": "PengXing/closure-compiler", "path": "src/com/google/javascript/jscomp/AbstractCommandLineRunner.java", "license": "apache-2.0", "size": 66786 }
[ "com.google.common.base.Preconditions", "com.google.common.collect.Maps", "java.util.List", "java.util.Map" ]
import com.google.common.base.Preconditions; import com.google.common.collect.Maps; import java.util.List; import java.util.Map;
import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
568,077
private static int loadShader( int shaderType, String shaderName, String shaderSource) { int shaderProg = GLES20.glCreateShader(shaderType); GLES20.glShaderSource(shaderProg, shaderSource); GLES20.glCompileShader(shaderProg); // Check for errors int[] status = ne...
static int function( int shaderType, String shaderName, String shaderSource) { int shaderProg = GLES20.glCreateShader(shaderType); GLES20.glShaderSource(shaderProg, shaderSource); GLES20.glCompileShader(shaderProg); int[] status = new int[1]; GLES20.glGetShaderiv(shaderProg, GLES20.GL_COMPILE_STATUS, status, 0); if (st...
/** * Loads a GLSL shader. * @return Returns the GLES shader handle */
Loads a GLSL shader
loadShader
{ "repo_name": "ykulbashian/LiquidSurface", "path": "liquidview/src/main/java/com/google/fpl/liquidfunpaint/shader/ShaderProgram.java", "license": "apache-2.0", "size": 9425 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
2,076,951
protected static String getLocation(Target target, boolean relative) { Location location = target.getLocation(); return relative ? location.print(target.getPackage().getPackageDirectory().asFragment(), target.getPackage().getNameFragment()) : location.print(); }
static String function(Target target, boolean relative) { Location location = target.getLocation(); return relative ? location.print(target.getPackage().getPackageDirectory().asFragment(), target.getPackage().getNameFragment()) : location.print(); }
/** * Returns the target location, eventually stripping out the workspace path to obtain a relative * target (stable across machines / workspaces). * * @param target The target to extract location from. * @param relative Whether to return a relative path or not. * @return the target location */
Returns the target location, eventually stripping out the workspace path to obtain a relative target (stable across machines / workspaces)
getLocation
{ "repo_name": "dhootha/bazel", "path": "src/main/java/com/google/devtools/build/lib/query2/output/OutputFormatter.java", "license": "apache-2.0", "size": 18761 }
[ "com.google.devtools.build.lib.events.Location", "com.google.devtools.build.lib.packages.Target" ]
import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.packages.*;
[ "com.google.devtools" ]
com.google.devtools;
2,768,493
@Override() public java.lang.Class getJavaClass( ) { return net.sourceforge.gpstools.gpx.GpxExtensions.class; }
@Override() java.lang.Class function( ) { return net.sourceforge.gpstools.gpx.GpxExtensions.class; }
/** * Method getJavaClass. * * @return the Java class represented by this descriptor. */
Method getJavaClass
getJavaClass
{ "repo_name": "Emergya/gofleet", "path": "core/src/main/java/net/sourceforge/gpstools/gpx/descriptors/GpxExtensionsDescriptor.java", "license": "gpl-2.0", "size": 3671 }
[ "net.sourceforge.gpstools.gpx.GpxExtensions" ]
import net.sourceforge.gpstools.gpx.GpxExtensions;
import net.sourceforge.gpstools.gpx.*;
[ "net.sourceforge.gpstools" ]
net.sourceforge.gpstools;
1,529,071
private static boolean canJumpOffTop(final Material blockType) { // TODO: Test if this can be removed! return BlockProperties.isGround(blockType) || BlockProperties.isSolid(blockType); }
static boolean function(final Material blockType) { return BlockProperties.isGround(blockType) BlockProperties.isSolid(blockType); }
/** * Used for a workaround that resets the set-back for the case of jumping on just placed blocks. * @param id * @return */
Used for a workaround that resets the set-back for the case of jumping on just placed blocks
canJumpOffTop
{ "repo_name": "MyPictures/NoCheatPlus", "path": "NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java", "license": "gpl-3.0", "size": 63675 }
[ "fr.neatmonster.nocheatplus.utilities.BlockProperties", "org.bukkit.Material" ]
import fr.neatmonster.nocheatplus.utilities.BlockProperties; import org.bukkit.Material;
import fr.neatmonster.nocheatplus.utilities.*; import org.bukkit.*;
[ "fr.neatmonster.nocheatplus", "org.bukkit" ]
fr.neatmonster.nocheatplus; org.bukkit;
2,080,947
@Override public String getBeginTimeString() { //return DateTimeFormat.getShortDateFormat().format(beginTime); DefaultDateTimeFormatInfo info = new DefaultDateTimeFormatInfo(); DateTimeFormat dateTimeFormat = new DateTimeFormat("MM/dd/yyyy", info) {}; return dateTimeFormat.format...
String function() { DefaultDateTimeFormatInfo info = new DefaultDateTimeFormatInfo(); DateTimeFormat dateTimeFormat = new DateTimeFormat(STR, info) {}; return dateTimeFormat.format(beginTime); }
/** * Returns a string representation of the start of this Appointment. * @return A string representation of the start of this Appointment. */
Returns a string representation of the start of this Appointment
getBeginTimeString
{ "repo_name": "epaulson10/CS510J", "path": "apptbook-gwt/src/main/java/edu/pdx/cs410J/erik/client/Appointment.java", "license": "mit", "size": 5637 }
[ "com.google.gwt.i18n.shared.DateTimeFormat", "com.google.gwt.i18n.shared.DefaultDateTimeFormatInfo" ]
import com.google.gwt.i18n.shared.DateTimeFormat; import com.google.gwt.i18n.shared.DefaultDateTimeFormatInfo;
import com.google.gwt.i18n.shared.*;
[ "com.google.gwt" ]
com.google.gwt;
1,125,724
private void showNotification() { // The PendingIntent to launch our activity if the user selects this notification PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MeetingsList.class), 0); Notification.Builder builder = new Notification.Builder(NotifyServi...
void function() { PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, MeetingsList.class), 0); Notification.Builder builder = new Notification.Builder(NotifyService.this); builder.setAutoCancel(true); builder.setContentTitle(getString(R.string.notification_title)); builder.setContentText(n...
/** * Creates a notification and shows it in the OS drag-down status bar */
Creates a notification and shows it in the OS drag-down status bar
showNotification
{ "repo_name": "LucasBousselet/Uniteam", "path": "app/src/main/java/unidev/uniteam/NotifyService.java", "license": "mit", "size": 2964 }
[ "android.app.Notification", "android.app.PendingIntent", "android.content.Intent", "android.graphics.Bitmap", "android.graphics.BitmapFactory" ]
import android.app.Notification; import android.app.PendingIntent; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory;
import android.app.*; import android.content.*; import android.graphics.*;
[ "android.app", "android.content", "android.graphics" ]
android.app; android.content; android.graphics;
222,867
public List<CompilerInput> getInputs() { return inputs; }
List<CompilerInput> function() { return inputs; }
/** * Gets this module's list of source code inputs. * * @return A list that may be empty but not null */
Gets this module's list of source code inputs
getInputs
{ "repo_name": "shantanusharma/closure-compiler", "path": "src/com/google/javascript/jscomp/JSModule.java", "license": "apache-2.0", "size": 9920 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
110,363
@OnWebSocketMessage public void streamMe(InputStream stream) { }
void function(InputStream stream) { }
/** * Second method */
Second method
streamMe
{ "repo_name": "sdw2330976/Research-jetty-9.2.5", "path": "jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/annotations/BadDuplicateBinarySocket.java", "license": "apache-2.0", "size": 1440 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,567,423
public static boolean isInManagedReadableStore(String topic) { for (ManagedZone zone : EnumSet.allOf(ManagedZone.class)) { if (topic.startsWith(zone.getTopicPrefix()) && zone.getPermission().isReadable()) { return true; } } return false; }
static boolean function(String topic) { for (ManagedZone zone : EnumSet.allOf(ManagedZone.class)) { if (topic.startsWith(zone.getTopicPrefix()) && zone.getPermission().isReadable()) { return true; } } return false; }
/** * Is topic identifier in a readable managed store area? * * @param topic String * @return true if topic is in readable managed store area */
Is topic identifier in a readable managed store area
isInManagedReadableStore
{ "repo_name": "lants1/moquette", "path": "fce/src/main/java/io/moquette/fce/common/util/ManagedZoneUtil.java", "license": "apache-2.0", "size": 3897 }
[ "io.moquette.fce.model.common.ManagedZone", "java.util.EnumSet" ]
import io.moquette.fce.model.common.ManagedZone; import java.util.EnumSet;
import io.moquette.fce.model.common.*; import java.util.*;
[ "io.moquette.fce", "java.util" ]
io.moquette.fce; java.util;
2,127,680
@Override public HttpRequestBase getFeatureInfoPost(String wmsUrl, String format, String layer, String srs, double westBoundLongitude, double southBoundLatitude, double eastBoundLongitude, double northBoundLatitude, int width, int height, double pointLng, double pointLat, int pointX, int pointY, String styles, ...
HttpRequestBase function(String wmsUrl, String format, String layer, String srs, double westBoundLongitude, double southBoundLatitude, double eastBoundLongitude, double northBoundLatitude, int width, int height, double pointLng, double pointLat, int pointX, int pointY, String styles, String sldBody, String feature_coun...
/** * Generates a WMS request for downloading information about a user click on a particular * GetMap request via the post method. * * @param wmsUrl The WMS endpoint (will have any existing query parameters preserved) * @param format The desired mime type of the response ...
Generates a WMS request for downloading information about a user click on a particular * GetMap request via the post method
getFeatureInfoPost
{ "repo_name": "GeoscienceAustralia/Auscope-portal-core", "path": "src/main/java/org/auscope/portal/core/services/methodmakers/WMSMethodMaker.java", "license": "lgpl-3.0", "size": 25790 }
[ "java.io.UnsupportedEncodingException", "java.net.URISyntaxException", "java.util.List", "org.apache.http.NameValuePair", "org.apache.http.client.entity.UrlEncodedFormEntity", "org.apache.http.client.methods.HttpPost", "org.apache.http.client.methods.HttpRequestBase", "org.apache.http.message.BasicNam...
import java.io.UnsupportedEncodingException; import java.net.URISyntaxException; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apach...
import java.io.*; import java.net.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.entity.*; import org.apache.http.client.methods.*; import org.apache.http.message.*;
[ "java.io", "java.net", "java.util", "org.apache.http" ]
java.io; java.net; java.util; org.apache.http;
2,458,467
private void copyClangReportsOutOfGeneratedSubFolder( FilePath reportsFolder, BuildListener listener ){ try{ List<FilePath> subFolders = reportsFolder.listDirectories(); if( subFolders.isEmpty() ){ listener.getLogger().println( "Could not locate a unique scan-build output folder in: " + reportsFolder ); ...
void function( FilePath reportsFolder, BuildListener listener ){ try{ List<FilePath> subFolders = reportsFolder.listDirectories(); if( subFolders.isEmpty() ){ listener.getLogger().println( STR + reportsFolder ); return; } FilePath clangDateFolder = subFolders.get( 0 ); clangDateFolder.copyRecursiveTo( reportsFolder ); ...
/** * Clang always creates a subfolder within the specified output folder that has a unique name. * This method locates the first subfolder of the output folder and copies its contents * to the build archive folder. */
Clang always creates a subfolder within the specified output folder that has a unique name. This method locates the first subfolder of the output folder and copies its contents to the build archive folder
copyClangReportsOutOfGeneratedSubFolder
{ "repo_name": "jkennedy1980/clang-scanbuild-plugin", "path": "src/main/java/jenkins/plugins/clangscanbuild/publisher/ClangScanBuildPublisher.java", "license": "mit", "size": 10473 }
[ "hudson.model.BuildListener", "java.util.List" ]
import hudson.model.BuildListener; import java.util.List;
import hudson.model.*; import java.util.*;
[ "hudson.model", "java.util" ]
hudson.model; java.util;
2,388,097
private void setupProblem() { try { Class<?> problemClass = Class .forName(params.getProperty("problem")); this.problem = (Problem) problemClass.newInstance(); } catch (Exception e) { logger.fatal(e); System.exit(1); } }
void function() { try { Class<?> problemClass = Class .forName(params.getProperty(STR)); this.problem = (Problem) problemClass.newInstance(); } catch (Exception e) { logger.fatal(e); System.exit(1); } }
/** * Convenience method to setup the problem from the config file. */
Convenience method to setup the problem from the config file
setupProblem
{ "repo_name": "burks-pub/gecco2015", "path": "src/main/java/ec/research/gp/simple/util/Config.java", "license": "bsd-2-clause", "size": 34172 }
[ "ec.research.gp.simple.problem.Problem" ]
import ec.research.gp.simple.problem.Problem;
import ec.research.gp.simple.problem.*;
[ "ec.research.gp" ]
ec.research.gp;
1,054,422
public int avio_get_str16le(Pointer<AVIOContext > pb, int maxlen, Pointer<Byte > buf, int buflen) { return avio_get_str16le(Pointer.getPeer(pb), maxlen, Pointer.getPeer(buf), buflen); }
int function(Pointer<AVIOContext > pb, int maxlen, Pointer<Byte > buf, int buflen) { return avio_get_str16le(Pointer.getPeer(pb), maxlen, Pointer.getPeer(buf), buflen); }
/** * Read a UTF-16 string from pb and convert it to UTF-8.<br> * The reading will terminate when either a null or invalid character was<br> * encountered or maxlen bytes have been read.<br> * @return number of bytes read (is always <= maxlen)<br> * Original signature : <code>int avio_get_str16...
Read a UTF-16 string from pb and convert it to UTF-8. The reading will terminate when either a null or invalid character was encountered or maxlen bytes have been read
avio_get_str16le
{ "repo_name": "mutars/java_libav", "path": "wrapper/src/main/java/com/mutar/libav/bridge/avformat/AvformatLibrary.java", "license": "gpl-2.0", "size": 136321 }
[ "org.bridj.Pointer" ]
import org.bridj.Pointer;
import org.bridj.*;
[ "org.bridj" ]
org.bridj;
1,917,264
List<String> devices = new ArrayList<String>(); try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { List<InetAddress> addrs = Collections.list(intf.getInetAddresses()); ...
List<String> devices = new ArrayList<String>(); try { List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface intf : interfaces) { List<InetAddress> addrs = Collections.list(intf.getInetAddresses()); for (InetAddress addr : addrs) { if (!addr.isLoopbackAddres...
/** * Get IP address from first non-localhost interface * * @param useIPv4 true=return ipv4, false=return ipv6 * @return address or empty string */
Get IP address from first non-localhost interface
getIpAddress
{ "repo_name": "Sefford/Kor-Sample", "path": "src/main/java/com/sefford/kor/samples/utils/NetworkUtils.java", "license": "apache-2.0", "size": 4353 }
[ "java.net.InetAddress", "java.net.NetworkInterface", "java.net.SocketException", "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.apache.http.conn.util.InetAddressUtils" ]
import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.http.conn.util.InetAddressUtils;
import java.net.*; import java.util.*; import org.apache.http.conn.util.*;
[ "java.net", "java.util", "org.apache.http" ]
java.net; java.util; org.apache.http;
1,049,366
@ApiModelProperty(value = "Maximum purchase amount that can be requested by the customer.") @Valid public LedgerAmount getMaxAmount() { return maxAmount; }
@ApiModelProperty(value = STR) LedgerAmount function() { return maxAmount; }
/** * Maximum purchase amount that can be requested by the customer. * * @return maxAmount **/
Maximum purchase amount that can be requested by the customer
getMaxAmount
{ "repo_name": "electrumpayments/prepaidutility-service-interface", "path": "src/main/java/io/electrum/prepaidutility/model/MeterLookupResponse.java", "license": "apache-2.0", "size": 6392 }
[ "io.electrum.vas.model.LedgerAmount", "io.swagger.annotations.ApiModelProperty" ]
import io.electrum.vas.model.LedgerAmount; import io.swagger.annotations.ApiModelProperty;
import io.electrum.vas.model.*; import io.swagger.annotations.*;
[ "io.electrum.vas", "io.swagger.annotations" ]
io.electrum.vas; io.swagger.annotations;
387,134
@ServiceMethod(returns = ReturnType.SINGLE) Mono<LegalHoldInner> clearLegalHoldAsync( String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<LegalHoldInner> clearLegalHoldAsync( String resourceGroupName, String accountName, String containerName, LegalHoldInner legalHold);
/** * Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold * clears out only the specified tags in the request. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensit...
Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request
clearLegalHoldAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java", "license": "mit", "size": 104918 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.storage.fluent.models.LegalHoldInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storage.fluent.models.LegalHoldInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
32,778
public void encryptPayload(ConfidentialityAlgorithm confidentialityAlgorithm) throws InvalidKeyException { encryptedPayload = confidentialityAlgorithm.encrypt(getPayloadData()); }
void function(ConfidentialityAlgorithm confidentialityAlgorithm) throws InvalidKeyException { encryptedPayload = confidentialityAlgorithm.encrypt(getPayloadData()); }
/** * Encrypts {@link #getPayloadData()}. * * @param confidentialityAlgorithm * {@link ConfidentialityAlgorithm} to be used to encrypt payload * data. * @throws InvalidKeyException * - when confidentiality algorithm fails. * @see IpmiPayload#getEncryptedPayload...
Encrypts <code>#getPayloadData()</code>
encryptPayload
{ "repo_name": "fbacchella/ipmilib", "path": "src/main/java/com/veraxsystems/vxipmi/coding/payload/IpmiPayload.java", "license": "gpl-3.0", "size": 1923 }
[ "com.veraxsystems.vxipmi.coding.security.ConfidentialityAlgorithm", "java.security.InvalidKeyException" ]
import com.veraxsystems.vxipmi.coding.security.ConfidentialityAlgorithm; import java.security.InvalidKeyException;
import com.veraxsystems.vxipmi.coding.security.*; import java.security.*;
[ "com.veraxsystems.vxipmi", "java.security" ]
com.veraxsystems.vxipmi; java.security;
1,405,356
public static <T> T doWithStopwatch(String name, Callable<T> callable) throws Exception { try (Split split = SimonManager.getStopwatch(name).start()) { return callable.call(); } }
static <T> T function(String name, Callable<T> callable) throws Exception { try (Split split = SimonManager.getStopwatch(name).start()) { return callable.call(); } }
/** * Calls a block of code with stopwatch around and returns result. * * @param name name of the Stopwatch * @param callable callable block of code * @param <T> return type * @return whatever block of code returns * @throws Exception whatever block of code throws * @since 3.0 */
Calls a block of code with stopwatch around and returns result
doWithStopwatch
{ "repo_name": "ferstl/javasimon", "path": "core/src/main/java/org/javasimon/utils/SimonUtils.java", "license": "bsd-3-clause", "size": 16823 }
[ "java.util.concurrent.Callable", "org.javasimon.SimonManager", "org.javasimon.Split" ]
import java.util.concurrent.Callable; import org.javasimon.SimonManager; import org.javasimon.Split;
import java.util.concurrent.*; import org.javasimon.*;
[ "java.util", "org.javasimon" ]
java.util; org.javasimon;
445,331
public void toggleSpeaker() { // TODO: Turning on the speaker seems to enable the mic // whether or not the "mute" feature is active! // Not sure if this is an feature of the telephony API // that I need to handle specially, or just a bug. boolean newSpeakerState = !Phone...
void function() { boolean newSpeakerState = !PhoneUtils.isSpeakerOn(this); log(STR + newSpeakerState); if (newSpeakerState && isBluetoothAvailable() && isBluetoothAudioConnected()) { disconnectBluetoothAudio(); } PhoneUtils.turnOnSpeaker(this, newSpeakerState, true); updateInCallTouchUi(); if (FeatureOption.MTK_VT3G324...
/** * Toggles in-call audio between speaker and the built-in earpiece (or * wired headset.) */
Toggles in-call audio between speaker and the built-in earpiece (or wired headset.)
toggleSpeaker
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Phone/src/com/android/phone/InCallScreen.java", "license": "gpl-2.0", "size": 367799 }
[ "com.mediatek.phone.PhoneFeatureConstants" ]
import com.mediatek.phone.PhoneFeatureConstants;
import com.mediatek.phone.*;
[ "com.mediatek.phone" ]
com.mediatek.phone;
249,918
public static <A> CollUpdateClause<A> update(Path<A> path, Iterable<A> col) { return new CollUpdateClause<A>(path, col); } private CollQueryFactory() { }
static <A> CollUpdateClause<A> function(Path<A> path, Iterable<A> col) { return new CollUpdateClause<A>(path, col); } private CollQueryFactory() { }
/** * Create a new update clause * * @param path source expression * @param col source collection * @return query */
Create a new update clause
update
{ "repo_name": "lpandzic/querydsl", "path": "querydsl-collections/src/main/java/com/querydsl/collections/CollQueryFactory.java", "license": "apache-2.0", "size": 2535 }
[ "com.querydsl.core.types.Path" ]
import com.querydsl.core.types.Path;
import com.querydsl.core.types.*;
[ "com.querydsl.core" ]
com.querydsl.core;
2,782,070
@Override public int getLevel() { return logLevels[LogCategory.ALL.getId()].getId(); }
int function() { return logLevels[LogCategory.ALL.getId()].getId(); }
/** * Get the logging level for the default logging category. * @return level Current logging level for default the default logging category. */
Get the logging level for the default logging category
getLevel
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.extension/src/org/eclipse/persistence/logging/slf4j/SLF4JLogger.java", "license": "epl-1.0", "size": 11218 }
[ "org.eclipse.persistence.logging.LogCategory" ]
import org.eclipse.persistence.logging.LogCategory;
import org.eclipse.persistence.logging.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,750,149
public CBookmark getBookmark(final IAddress address) { Preconditions.checkNotNull(address, "IE00384: Bookmark address can not be null"); for (final CBookmark bookmark : m_bookmarks) { if (bookmark.getAddress().equals(address)) { return bookmark; } } return null; }
CBookmark function(final IAddress address) { Preconditions.checkNotNull(address, STR); for (final CBookmark bookmark : m_bookmarks) { if (bookmark.getAddress().equals(address)) { return bookmark; } } return null; }
/** * Returns the bookmark at the given address. * * @param address The address of the bookmark to search for. * * @return The bookmark at the given address or null if there is no such bookmark. */
Returns the bookmark at the given address
getBookmark
{ "repo_name": "chubbymaggie/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/models/Bookmarks/memory/BookmarkManager.java", "license": "apache-2.0", "size": 4426 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.zylib.disassembly.IAddress" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.zylib.disassembly.IAddress;
import com.google.common.base.*; import com.google.security.zynamics.zylib.disassembly.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
2,241,529
private Object getFieldValue(Object object, GraphQLOutputType outputType) { try { Field field = object.getClass().getField(fieldName); return field.get(object); } catch (NoSuchFieldException e) { return null; } catch (IllegalAccessException e) { ...
Object function(Object object, GraphQLOutputType outputType) { try { Field field = object.getClass().getField(fieldName); return field.get(object); } catch (NoSuchFieldException e) { return null; } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
/** * Uses introspection to get the field value. * * @param object The object being acted on. * @param outputType The output type; ignored in this case. * @return An object, or null. */
Uses introspection to get the field value
getFieldValue
{ "repo_name": "fderose/graphql-java", "path": "src/main/java/graphql/schema/FieldDataFetcher.java", "license": "mit", "size": 1377 }
[ "java.lang.reflect.Field" ]
import java.lang.reflect.Field;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,279,016
@JsonCreator public static IsmRecordCoder<?> of( @JsonProperty(PropertyNames.NUM_SHARD_CODERS) int numberOfShardCoders, @JsonProperty(PropertyNames.NUM_METADATA_SHARD_CODERS) int numberOfMetadataShardCoders, @JsonProperty(PropertyNames.COMPONENT_ENCODINGS) List<Coder<?>> components) { ...
static IsmRecordCoder<?> function( @JsonProperty(PropertyNames.NUM_SHARD_CODERS) int numberOfShardCoders, @JsonProperty(PropertyNames.NUM_METADATA_SHARD_CODERS) int numberOfMetadataShardCoders, @JsonProperty(PropertyNames.COMPONENT_ENCODINGS) List<Coder<?>> components) { checkArgument(components.size() >= 2, STR + comp...
/** * Returns an IsmRecordCoder with the specified coders. Note that this method is not meant * to be called by users but used by Jackson when decoding this coder. */
Returns an IsmRecordCoder with the specified coders. Note that this method is not meant to be called by users but used by Jackson when decoding this coder
of
{ "repo_name": "yafengguo/Apache-beam", "path": "runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/internal/IsmFormat.java", "license": "apache-2.0", "size": 30162 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "com.google.common.base.Preconditions", "java.util.List", "org.apache.beam.sdk.coders.Coder", "org.apache.beam.sdk.util.PropertyNames" ]
import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import java.util.List; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.util.PropertyNames;
import com.fasterxml.jackson.annotation.*; import com.google.common.base.*; import java.util.*; import org.apache.beam.sdk.coders.*; import org.apache.beam.sdk.util.*;
[ "com.fasterxml.jackson", "com.google.common", "java.util", "org.apache.beam" ]
com.fasterxml.jackson; com.google.common; java.util; org.apache.beam;
328,147
public PDRange getDecodeForParameter(int paramNum) { PDRange retval = null; COSArray decodeValues = getDecodeValues(); if (decodeValues != null && decodeValues.size() >= paramNum * 2 + 1) { retval = new PDRange(decodeValues, paramNum); } return retval;...
PDRange function(int paramNum) { PDRange retval = null; COSArray decodeValues = getDecodeValues(); if (decodeValues != null && decodeValues.size() >= paramNum * 2 + 1) { retval = new PDRange(decodeValues, paramNum); } return retval; }
/** * Get the decode for the input parameter. * * @param paramNum the function parameter number * @return the decode parameter range or null if none is set */
Get the decode for the input parameter
getDecodeForParameter
{ "repo_name": "TomRoush/PdfBox-Android", "path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/graphics/shading/PDTriangleBasedShadingType.java", "license": "apache-2.0", "size": 3565 }
[ "com.tom_roush.pdfbox.cos.COSArray", "com.tom_roush.pdfbox.pdmodel.common.PDRange" ]
import com.tom_roush.pdfbox.cos.COSArray; import com.tom_roush.pdfbox.pdmodel.common.PDRange;
import com.tom_roush.pdfbox.cos.*; import com.tom_roush.pdfbox.pdmodel.common.*;
[ "com.tom_roush.pdfbox" ]
com.tom_roush.pdfbox;
58,142
public IgniteH2Indexing indexing();
IgniteH2Indexing function();
/** * Gets indexing. * * @return indexing. */
Gets indexing
indexing
{ "repo_name": "pperalta/ignite", "path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2RowDescriptor.java", "license": "apache-2.0", "size": 5071 }
[ "org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing" ]
import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
import org.apache.ignite.internal.processors.query.h2.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,723,257
public Builder listNumericInMap(Map<String, List<Integer>> listNumericInMap) { this.listNumericInMap = listNumericInMap; return this; }
Builder function(Map<String, List<Integer>> listNumericInMap) { this.listNumericInMap = listNumericInMap; return this; }
/** * Sets the listNumericInMap. * @param listNumericInMap the new value * @return this, for chaining, not null */
Sets the listNumericInMap
listNumericInMap
{ "repo_name": "JodaOrg/joda-beans", "path": "src/test/java/org/joda/beans/sample/SimpleJson.java", "license": "apache-2.0", "size": 64387 }
[ "java.util.List", "java.util.Map" ]
import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,727,055
private VisitScheduleItem loadVisitScheduleItemFromVisitScheduleItemOutVO(VisitScheduleItemOutVO visitScheduleItemOutVO) { VisitScheduleItem visitScheduleItem = this.load(visitScheduleItemOutVO.getId()); if (visitScheduleItem == null) { visitScheduleItem = VisitScheduleItem.Factory.newInstance(); } return...
VisitScheduleItem function(VisitScheduleItemOutVO visitScheduleItemOutVO) { VisitScheduleItem visitScheduleItem = this.load(visitScheduleItemOutVO.getId()); if (visitScheduleItem == null) { visitScheduleItem = VisitScheduleItem.Factory.newInstance(); } return visitScheduleItem; }
/** * Retrieves the entity object that is associated with the specified value object * from the object store. If no such entity object exists in the object store, * a new, blank entity is created */
Retrieves the entity object that is associated with the specified value object from the object store. If no such entity object exists in the object store, a new, blank entity is created
loadVisitScheduleItemFromVisitScheduleItemOutVO
{ "repo_name": "phoenixctms/ctsms", "path": "core/src/main/java/org/phoenixctms/ctsms/domain/VisitScheduleItemDaoImpl.java", "license": "lgpl-2.1", "size": 51461 }
[ "org.phoenixctms.ctsms.vo.VisitScheduleItemOutVO" ]
import org.phoenixctms.ctsms.vo.VisitScheduleItemOutVO;
import org.phoenixctms.ctsms.vo.*;
[ "org.phoenixctms.ctsms" ]
org.phoenixctms.ctsms;
1,574,041
protected URL createPingUrl(String app, String version, long id, Map<String, String> extras) throws UnsupportedEncodingException, MalformedURLException { String osName = URLEncoder.encode(getOsName(), "UTF-8"); //$NON-NLS-1$ String osArch = URLEncoder.encode(getOsArch(), "UTF-8"); ...
URL function(String app, String version, long id, Map<String, String> extras) throws UnsupportedEncodingException, MalformedURLException { String osName = URLEncoder.encode(getOsName(), "UTF-8"); String osArch = URLEncoder.encode(getOsArch(), "UTF-8"); String jvmArch = URLEncoder.encode(getJvmInfo(), "UTF-8"); String e...
/** * Compute the ping URL to send the data to the server. * * @param app The application name that reports the ping (e.g. "emulator" or "ddms".) * Valid characters are a-zA-Z0-9 only. * @param version The version string already formatted as a 4 dotted group (e.g. "1.2.3.4".) * @p...
Compute the ping URL to send the data to the server
createPingUrl
{ "repo_name": "rex-xxx/mt6572_x201", "path": "sdk/sdkstats/src/com/android/sdkstats/SdkStatsService.java", "license": "gpl-2.0", "size": 21746 }
[ "java.io.UnsupportedEncodingException", "java.net.MalformedURLException", "java.net.URLEncoder", "java.util.Map" ]
import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URLEncoder; import java.util.Map;
import java.io.*; import java.net.*; import java.util.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
921,419
public void setSerialNumber(BigInteger serialNumber) { this.serialNumber = serialNumber; }
void function(BigInteger serialNumber) { this.serialNumber = serialNumber; }
/** * Sets the serial number the attribute certificate must have. If * <code>null</code> is given any will do. * * @param serialNumber The serialNumber to set. */
Sets the serial number the attribute certificate must have. If <code>null</code> is given any will do
setSerialNumber
{ "repo_name": "Skywalker-11/spongycastle", "path": "prov/src/main/java/org/spongycastle/x509/X509AttributeCertStoreSelector.java", "license": "mit", "size": 14996 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
390,006
public static void runEventLogService(InetSocketAddress adbSockAddr, Device device, LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException { runLogService(adbSockAddr, device, "events", rcvr); //$NON-NLS-1$ }
static void function(InetSocketAddress adbSockAddr, Device device, LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException { runLogService(adbSockAddr, device, STR, rcvr); }
/** * Runs the Event log service on the {@link Device}, and provides its output to the * {@link LogReceiver}. * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true. * @param adbSockAddr the socket address to connect to adb * @param device the Device on which to run th...
Runs the Event log service on the <code>Device</code>, and provides its output to the <code>LogReceiver</code>. This call is blocking until <code>LogReceiver#isCancelled()</code> returns true
runEventLogService
{ "repo_name": "consulo/consulo-android", "path": "tools-base/ddmlib/src/main/java/com/android/ddmlib/AdbHelper.java", "license": "apache-2.0", "size": 35214 }
[ "com.android.ddmlib.log.LogReceiver", "java.io.IOException", "java.net.InetSocketAddress" ]
import com.android.ddmlib.log.LogReceiver; import java.io.IOException; import java.net.InetSocketAddress;
import com.android.ddmlib.log.*; import java.io.*; import java.net.*;
[ "com.android.ddmlib", "java.io", "java.net" ]
com.android.ddmlib; java.io; java.net;
1,265,486
private List<String> getCorrespondingParts(String inputString, List<String> templateParts) { List<String> stringParts = new ArrayList<String>(); int counter = 0; while (StringUtils.isNotBlank(inputString) && counter < templateParts.size()) { String currentTemp...
List<String> function(String inputString, List<String> templateParts) { List<String> stringParts = new ArrayList<String>(); int counter = 0; while (StringUtils.isNotBlank(inputString) && counter < templateParts.size()) { String currentTemplatePart = templateParts.get(counter); int length = Math.min(getPatternsEffective...
/** * Divides a string into corresponding parts for the template to carry out comparison. * templateParts = [/data/cas/, ${YEAR}, /, ${MONTH}, /, ${DAY}] * inputString = /data/cas/2014/09/09 * returns [/data/cas/, 2014, /, 09, /, 09] * @param inputString normal string repres...
Divides a string into corresponding parts for the template to carry out comparison. templateParts = [/data/cas/, ${YEAR}, /, ${MONTH}, /, ${DAY}] inputString = /data/cas/2014/09/09 returns [/data/cas/, 2014, /, 09, /, 09]
getCorrespondingParts
{ "repo_name": "sriksun/falcon", "path": "common/src/main/java/org/apache/falcon/util/FalconRadixUtils.java", "license": "apache-2.0", "size": 13636 }
[ "java.util.ArrayList", "java.util.List", "org.apache.commons.lang3.StringUtils" ]
import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,117,281
EAttribute getILabResult_Date();
EAttribute getILabResult_Date();
/** * Returns the meta object for the attribute '{@link ch.elexis.core.model.ILabResult#getDate <em>Date</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Date</em>'. * @see ch.elexis.core.model.ILabResult#getDate() * @see #getILabResult() * @genera...
Returns the meta object for the attribute '<code>ch.elexis.core.model.ILabResult#getDate Date</code>'.
getILabResult_Date
{ "repo_name": "sazgin/elexis-3-core", "path": "ch.elexis.core/src-gen/ch/elexis/core/model/ModelPackage.java", "license": "epl-1.0", "size": 108231 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,368,566
public Collection<Validator<?>> newValidators(ValidateModel validateModel) { Collection<Validator<?>> validators = null; if (validateModel instanceof JavaValidateModel) { JavaValidateModel javaValidateModel = JavaValidateModel.class.cast(validateModel); String bean = javaVa...
Collection<Validator<?>> function(ValidateModel validateModel) { Collection<Validator<?>> validators = null; if (validateModel instanceof JavaValidateModel) { JavaValidateModel javaValidateModel = JavaValidateModel.class.cast(validateModel); String bean = javaValidateModel.getBean(); if (bean != null) { BeanManager bea...
/** * Create a Collection of {@link Validator} instances from the supplied {@link ValidateModel} instance. * @param validateModel The ValidateModel instance. * @return The Validator instance. */
Create a Collection of <code>Validator</code> instances from the supplied <code>ValidateModel</code> instance
newValidators
{ "repo_name": "cunningt/switchyard", "path": "core/validate/src/main/java/org/switchyard/validate/internal/ValidatorRegistryLoader.java", "license": "apache-2.0", "size": 9603 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.Set", "javax.enterprise.context.spi.CreationalContext", "javax.enterprise.inject.spi.Bean", "javax.enterprise.inject.spi.BeanManager", "org.switchyard.common.cdi.CDIUtil", "org.switchyard.common.type.Classes", "org.switchyard.config.model.val...
import java.util.ArrayList; import java.util.Collection; import java.util.Set; import javax.enterprise.context.spi.CreationalContext; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import org.switchyard.common.cdi.CDIUtil; import org.switchyard.common.type.Classes; import org.s...
import java.util.*; import javax.enterprise.context.spi.*; import javax.enterprise.inject.spi.*; import org.switchyard.common.cdi.*; import org.switchyard.common.type.*; import org.switchyard.config.model.validate.*; import org.switchyard.validate.*; import org.switchyard.validate.config.model.*;
[ "java.util", "javax.enterprise", "org.switchyard.common", "org.switchyard.config", "org.switchyard.validate" ]
java.util; javax.enterprise; org.switchyard.common; org.switchyard.config; org.switchyard.validate;
605,467
public List<KickstartIpRange> listIpRanges(User user) { return KickstartFactory.lookupRangeByOrg(user.getOrg()); }
List<KickstartIpRange> function(User user) { return KickstartFactory.lookupRangeByOrg(user.getOrg()); }
/** * returns a list of IP ranges accessible to the * user * @param user the current user needed for org information * @return the the list of ip ranges accessible to the user. */
returns a list of IP ranges accessible to the user
listIpRanges
{ "repo_name": "colloquium/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java", "license": "gpl-2.0", "size": 9043 }
[ "com.redhat.rhn.domain.kickstart.KickstartFactory", "com.redhat.rhn.domain.kickstart.KickstartIpRange", "com.redhat.rhn.domain.user.User", "java.util.List" ]
import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartIpRange; import com.redhat.rhn.domain.user.User; import java.util.List;
import com.redhat.rhn.domain.kickstart.*; import com.redhat.rhn.domain.user.*; import java.util.*;
[ "com.redhat.rhn", "java.util" ]
com.redhat.rhn; java.util;
2,822,102
public InetSocketAddress getXferAddress() { return streamingAddr; }
InetSocketAddress function() { return streamingAddr; }
/** * NB: The datanode can perform data transfer on the streaming * address however clients are given the IPC IP address for data * transfer, and that may be a different address. * * @return socket address for data transfer */
address however clients are given the IPC IP address for data transfer, and that may be a different address
getXferAddress
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java", "license": "apache-2.0", "size": 119397 }
[ "java.net.InetSocketAddress" ]
import java.net.InetSocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
479,663
public static UTC parse(String text, String pattern) throws ParseException { Guardian.assertNotNullOrEmpty("text", text); Guardian.assertNotNullOrEmpty("pattern", pattern); final int dotPos = text.lastIndexOf("."); String noFractionString = text; long...
static UTC function(String text, String pattern) throws ParseException { Guardian.assertNotNullOrEmpty("text", text); Guardian.assertNotNullOrEmpty(STR, pattern); final int dotPos = text.lastIndexOf("."); String noFractionString = text; long micros = 0; if (dotPos > 0) { noFractionString = text.substring(0, dotPos); fi...
/** * Parses a UTC value given as text. The method also considers an optional * mircoseconds fraction at the end of the text string. The mircoseconds fraction * is a dot '.' followed by a maximum of 6 digits. * * @param text a UTC value given as text * @param pat...
Parses a UTC value given as text. The method also considers an optional mircoseconds fraction at the end of the text string. The mircoseconds fraction is a dot '.' followed by a maximum of 6 digits
parse
{ "repo_name": "seadas/beam", "path": "beam-core/src/main/java/org/esa/beam/framework/datamodel/ProductData.java", "license": "gpl-3.0", "size": 100346 }
[ "java.text.DateFormat", "java.text.ParseException", "java.util.Date", "org.esa.beam.util.Guardian" ]
import java.text.DateFormat; import java.text.ParseException; import java.util.Date; import org.esa.beam.util.Guardian;
import java.text.*; import java.util.*; import org.esa.beam.util.*;
[ "java.text", "java.util", "org.esa.beam" ]
java.text; java.util; org.esa.beam;
2,682,753
GetRouteTableForSubnetResponse getRouteTableForSubnet(String vnetName, String subnetName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
GetRouteTableForSubnetResponse getRouteTableForSubnet(String vnetName, String subnetName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
/** * Get the specified route table for the provided subnet in the provided * virtual network in this subscription. * * @param vnetName Required. The name of the virtual network that contains * the provided subnet. * @param subnetName Required. The name of the subnet. * @throws IOException S...
Get the specified route table for the provided subnet in the provided virtual network in this subscription
getRouteTableForSubnet
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-network/src/main/java/com/microsoft/windowsazure/management/network/RouteOperations.java", "license": "apache-2.0", "size": 37653 }
[ "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.management.network.models.GetRouteTableForSubnetResponse", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.network.models.GetRouteTableForSubnetResponse; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.network.models.*; import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "com.microsoft.windowsazure", "java.io", "javax.xml", "org.xml.sax" ]
com.microsoft.windowsazure; java.io; javax.xml; org.xml.sax;
1,324,670
private void updateCheckedFilesCopyAuthorization() { if(!hasCheckedFiles()) return; boolean allReadable = true; for(FileDto file : checkedFiles) { if(!allReadable) break; allReadable = file.getReadable(); } if(allReadable) { getView().getFileCopyAuthorizer().authorized(); } ...
void function() { if(!hasCheckedFiles()) return; boolean allReadable = true; for(FileDto file : checkedFiles) { if(!allReadable) break; allReadable = file.getReadable(); } if(allReadable) { getView().getFileCopyAuthorizer().authorized(); } else { getView().getFileCopyAuthorizer().unauthorized(); } }
/** * Authorize copy if all that is selected can be downloaded. */
Authorize copy if all that is selected can be downloaded
updateCheckedFilesCopyAuthorization
{ "repo_name": "apruden/opal", "path": "opal-gwt-client/src/main/java/org/obiba/opal/web/gwt/app/client/fs/presenter/FileExplorerPresenter.java", "license": "gpl-3.0", "size": 13607 }
[ "org.obiba.opal.web.model.client.opal.FileDto" ]
import org.obiba.opal.web.model.client.opal.FileDto;
import org.obiba.opal.web.model.client.opal.*;
[ "org.obiba.opal" ]
org.obiba.opal;
1,079,638
public static void cargar(final MenuCarga menuCarga) throws NumberFormatException, IOException { int elementosCargados = 0; // Items setNoItem(ImageIO.read(new File("recursos//noItem.png"))); setMochila(ImageIO.read(new File("recursos//mochila.png"))); setMenu(Ima...
static void function(final MenuCarga menuCarga) throws NumberFormatException, IOException { int elementosCargados = 0; setNoItem(ImageIO.read(new File(STRrecursos setMenu(ImageIO.read(new File(STRrecursos spriteHumano = new SpriteSheet( CargadorImagen.cargarImagen(STR)); actualizarBarraDeCarga(++elementosCargados, menu...
/** * Carga todos los recursos del juego. * <p> * <i><u>Nota</u>: Carga todos los recursos al empezar el juego. </i><br> * * @param menuCarga * Menú de carga. <br> * @throws NumberFormatException * Cantidad de objetos existentes diferente. <br> * @thro...
Carga todos los recursos del juego. Nota: Carga todos los recursos al empezar el juego.
cargar
{ "repo_name": "JavaATR/jrpg-2017b-cliente", "path": "src/main/resources/recursos/Recursos.java", "license": "mit", "size": 38422 }
[ "java.awt.image.BufferedImage", "java.io.File", "java.io.IOException", "javax.imageio.ImageIO" ]
import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;
import java.awt.image.*; import java.io.*; import javax.imageio.*;
[ "java.awt", "java.io", "javax.imageio" ]
java.awt; java.io; javax.imageio;
2,158,698
public static Resource H_invDB_locus() { return ResourceFactory.createResource("http://www.h-invitational.jp/hinv/spsoup/locus_view?hix_id="); }
static Resource function() { return ResourceFactory.createResource("http: }
/** * Returns the link-out URI for objects of "H-invitational Database". */
Returns the link-out URI for objects of "H-invitational Database"
H_invDB_locus
{ "repo_name": "BioInterchange/BioInterchange", "path": "supplemental/java/biointerchange/src/main/java/org/biointerchange/vocabulary/GOXRef.java", "license": "mit", "size": 41277 }
[ "com.hp.hpl.jena.rdf.model.Resource", "com.hp.hpl.jena.rdf.model.ResourceFactory" ]
import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.rdf.model.ResourceFactory;
import com.hp.hpl.jena.rdf.model.*;
[ "com.hp.hpl" ]
com.hp.hpl;
2,193,379
protected void validateCovarianceData(double[][] x, double[][] covariance) { if (x.length != covariance.length) throw new CardinalityException(x.length, covariance.length); if (covariance.length > 0 && covariance.length != covariance[0].length) throw new NonSquareMatrixExcept...
void function(double[][] x, double[][] covariance) { if (x.length != covariance.length) throw new CardinalityException(x.length, covariance.length); if (covariance.length > 0 && covariance.length != covariance[0].length) throw new NonSquareMatrixException(covariance.length, covariance[0].length); } /** * {@inheritDoc}
/** * Validates that the x data and covariance matrix have the same * number of rows and that the covariance matrix is square. * * @param x the [n,k] array representing the x sample * @param covariance the [n,n] array representing the covariance matrix * @throws CardinalityException if the...
Validates that the x data and covariance matrix have the same number of rows and that the covariance matrix is square
validateCovarianceData
{ "repo_name": "a1vanov/ignite", "path": "modules/ml/src/main/java/org/apache/ignite/ml/regressions/AbstractMultipleLinearRegression.java", "license": "apache-2.0", "size": 13024 }
[ "org.apache.ignite.ml.math.exceptions.CardinalityException", "org.apache.ignite.ml.math.exceptions.NonSquareMatrixException" ]
import org.apache.ignite.ml.math.exceptions.CardinalityException; import org.apache.ignite.ml.math.exceptions.NonSquareMatrixException;
import org.apache.ignite.ml.math.exceptions.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,415,336
@GET @Produces(MediaType.APPLICATION_JSON) public Response getComponentConfigs() { ComponentConfigService service = get(ComponentConfigService.class); Set<String> components = service.getComponentNames(); ObjectNode root = mapper().createObjectNode(); components.forEach(c -> ...
@Produces(MediaType.APPLICATION_JSON) Response function() { ComponentConfigService service = get(ComponentConfigService.class); Set<String> components = service.getComponentNames(); ObjectNode root = mapper().createObjectNode(); components.forEach(c -> encodeConfigs(c, service.getProperties(c), root)); return ok(root)....
/** * Gets all component configurations. * Returns collection of all registered component configurations. * * @return 200 OK with a collection of component configurations */
Gets all component configurations. Returns collection of all registered component configurations
getComponentConfigs
{ "repo_name": "donNewtonAlpha/onos", "path": "web/api/src/main/java/org/onosproject/rest/resources/ComponentConfigWebResource.java", "license": "apache-2.0", "size": 5075 }
[ "com.fasterxml.jackson.databind.node.ObjectNode", "java.util.Set", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.onosproject.cfg.ComponentConfigService" ]
import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.Set; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.onosproject.cfg.ComponentConfigService;
import com.fasterxml.jackson.databind.node.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.onosproject.cfg.*;
[ "com.fasterxml.jackson", "java.util", "javax.ws", "org.onosproject.cfg" ]
com.fasterxml.jackson; java.util; javax.ws; org.onosproject.cfg;
1,541,561
public StringType getNetworkDisplayName(int networkIndex) throws DeviceNotFoundException;
StringType function(int networkIndex) throws DeviceNotFoundException;
/** * The description of the network. On some platforms, this is identical to the name. * * @param networkIndex - the index of the network * @throws DeviceNotFoundException */
The description of the network. On some platforms, this is identical to the name
getNetworkDisplayName
{ "repo_name": "ebisso/openhab2", "path": "addons/binding/org.openhab.binding.systeminfo/src/main/java/org/openhab/binding/systeminfo/model/SysteminfoInterface.java", "license": "epl-1.0", "size": 12415 }
[ "org.eclipse.smarthome.core.library.types.StringType" ]
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.library.types.*;
[ "org.eclipse.smarthome" ]
org.eclipse.smarthome;
775,993
public Properties getNotificationAddress(int aNotificationAddressId, int aUserId) throws NotificationManagerException { NotifSchema schema = null; Properties p = null; try { schema = new NotifSchema(); NotificationParameters params = new NotificationParameters(); params.iMediaTyp...
Properties function(int aNotificationAddressId, int aUserId) throws NotificationManagerException { NotifSchema schema = null; Properties p = null; try { schema = new NotifSchema(); NotificationParameters params = new NotificationParameters(); params.iMediaType = aNotificationAddressId; p = notifAddressRowToProperties(g...
/** * Method declaration * @param aNotificationAddressId * @return * @throws NotificationManagerException * @see */
Method declaration
getNotificationAddress
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-library/src/main/java/org/silverpeas/core/notification/user/client/NotificationManager.java", "license": "agpl-3.0", "size": 63926 }
[ "java.util.Properties", "org.silverpeas.core.exception.SilverpeasException", "org.silverpeas.core.exception.UtilException", "org.silverpeas.core.notification.user.client.model.NotifSchema" ]
import java.util.Properties; import org.silverpeas.core.exception.SilverpeasException; import org.silverpeas.core.exception.UtilException; import org.silverpeas.core.notification.user.client.model.NotifSchema;
import java.util.*; import org.silverpeas.core.exception.*; import org.silverpeas.core.notification.user.client.model.*;
[ "java.util", "org.silverpeas.core" ]
java.util; org.silverpeas.core;
1,213,970
public OnCompletionDefinition onCompletion() { // is only allowed at the top currently if (!getRouteCollection().getRoutes().isEmpty()) { throw new IllegalArgumentException("onCompletion must be defined before any routes in the RouteBuilder"); } getRouteCollection().setCa...
OnCompletionDefinition function() { if (!getRouteCollection().getRoutes().isEmpty()) { throw new IllegalArgumentException(STR); } getRouteCollection().setCamelContext(getContext()); return getRouteCollection().onCompletion(); }
/** * <a href="http://camel.apache.org/oncompletion.html">On completion</a> * callback for doing custom routing when the {@link org.apache.camel.Exchange} is complete. * * @return the builder */
On completion callback for doing custom routing when the <code>org.apache.camel.Exchange</code> is complete
onCompletion
{ "repo_name": "koscejev/camel", "path": "camel-core/src/main/java/org/apache/camel/builder/RouteBuilder.java", "license": "apache-2.0", "size": 17049 }
[ "org.apache.camel.model.OnCompletionDefinition" ]
import org.apache.camel.model.OnCompletionDefinition;
import org.apache.camel.model.*;
[ "org.apache.camel" ]
org.apache.camel;
2,098,274
void onSourceInfoRefreshed(long durationUs, boolean isSeekable, boolean isLive); } private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10_000; private static final Map<String, String> ICY_METADATA_HEADERS = createIcyMetadataHeaders(); private static final Format ICY_FORMAT = new Format.B...
void onSourceInfoRefreshed(long durationUs, boolean isSeekable, boolean isLive); } private static final long DEFAULT_LAST_SAMPLE_DURATION_US = 10_000; private static final Map<String, String> ICY_METADATA_HEADERS = createIcyMetadataHeaders(); private static final Format ICY_FORMAT = new Format.Builder().setId("icy").se...
/** * Called when the duration, the ability to seek within the period, or the categorization as * live stream changes. * * @param durationUs The duration of the period, or {@link C#TIME_UNSET}. * @param isSeekable Whether the period is seekable. * @param isLive Whether the period is live. ...
Called when the duration, the ability to seek within the period, or the categorization as live stream changes
onSourceInfoRefreshed
{ "repo_name": "amzn/exoplayer-amazon-port", "path": "library/core/src/main/java/com/google/android/exoplayer2/source/ProgressiveMediaPeriod.java", "license": "apache-2.0", "size": 43199 }
[ "android.net.Uri", "android.os.Handler", "androidx.annotation.Nullable", "com.google.android.exoplayer2.Format", "com.google.android.exoplayer2.drm.DrmSessionEventListener", "com.google.android.exoplayer2.drm.DrmSessionManager", "com.google.android.exoplayer2.extractor.ExtractorsFactory", "com.google....
import android.net.Uri; import android.os.Handler; import androidx.annotation.Nullable; import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.drm.DrmSessionEventListener; import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.extractor.ExtractorsFact...
import android.net.*; import android.os.*; import androidx.annotation.*; import com.google.android.exoplayer2.*; import com.google.android.exoplayer2.drm.*; import com.google.android.exoplayer2.extractor.*; import com.google.android.exoplayer2.metadata.icy.*; import com.google.android.exoplayer2.upstream.*; import com....
[ "android.net", "android.os", "androidx.annotation", "com.google.android", "java.util", "org.checkerframework.checker" ]
android.net; android.os; androidx.annotation; com.google.android; java.util; org.checkerframework.checker;
1,540,964
public void updateTransferDetails(Session session, Map<String, String> transferMetaData1, Map<String, String> metadata) { // Updating the target_file in monitor_transfer table if (System.getProperty("os.name").contains("Linux")) { session.execute("update monitor_transfer set target_file='" + transf...
void function(Session session, Map<String, String> transferMetaData1, Map<String, String> metadata) { if (System.getProperty(STR).contains("Linux")) { session.execute(STR + transferMetaData1.get(STR).replace("\\", "/") + STR + STR + transferMetaData1.get(STR) + "';"); } else if (System.getProperty(STR).contains(STR)) {...
/** * This method updates the target file and transfer status values in monitor * transfer table based on transfer id * * @param session * @param transferMetaData1 * @param metadata */
This method updates the target file and transfer status values in monitor transfer table based on transfer id
updateTransferDetails
{ "repo_name": "MithunThadi/OFTE", "path": "SourceCode/TaskScheduler & CronJob code/com.ofte.services/CassandraInteracter.java", "license": "gpl-3.0", "size": 26612 }
[ "com.datastax.driver.core.Session", "java.util.Map" ]
import com.datastax.driver.core.Session; import java.util.Map;
import com.datastax.driver.core.*; import java.util.*;
[ "com.datastax.driver", "java.util" ]
com.datastax.driver; java.util;
1,160,196
@JavascriptInterface public SourceEditor setMarkdown(final boolean markdown) { this.markdown = markdown; return this; } /** * Bind content to current {@link WebView}
SourceEditor function(final boolean markdown) { this.markdown = markdown; return this; } /** * Bind content to current {@link WebView}
/** * Sets whether the content is a markdown file * * @param markdown * @return this editor */
Sets whether the content is a markdown file
setMarkdown
{ "repo_name": "lyghlqlxx/-git-osc-android", "path": "gitoscandroid/src/main/java/net/oschina/gitapp/util/SourceEditor.java", "license": "gpl-2.0", "size": 5248 }
[ "android.webkit.WebView" ]
import android.webkit.WebView;
import android.webkit.*;
[ "android.webkit" ]
android.webkit;
1,584,511
public static @NotNull DfType longRange(LongRangeSet range) { if (range.equals(LongRangeSet.all())) return LONG; if (range.isEmpty()) return DfType.BOTTOM; Long value = range.getConstantValue(); if (value != null) { return longValue(value); } return new DfLongRangeType(range, null); }
static @NotNull DfType function(LongRangeSet range) { if (range.equals(LongRangeSet.all())) return LONG; if (range.isEmpty()) return DfType.BOTTOM; Long value = range.getConstantValue(); if (value != null) { return longValue(value); } return new DfLongRangeType(range, null); }
/** * Creates a type that represents a subset of long values. * * @param range range of values. * @return resulting type. Might be {@link DfType#BOTTOM} if range is empty. */
Creates a type that represents a subset of long values
longRange
{ "repo_name": "smmribeiro/intellij-community", "path": "java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/types/DfTypes.java", "license": "apache-2.0", "size": 17430 }
[ "com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet", "org.jetbrains.annotations.NotNull" ]
import com.intellij.codeInspection.dataFlow.rangeSet.LongRangeSet; import org.jetbrains.annotations.NotNull;
import com.intellij.*; import org.jetbrains.annotations.*;
[ "com.intellij", "org.jetbrains.annotations" ]
com.intellij; org.jetbrains.annotations;
1,041,433
private static void initCopyContext (SessionState state) { logger.debug("ResourcesAction.initCopyContext()"); state.setAttribute (STATE_COPIED_IDS, new ArrayList ()); state.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString()); } // initCopyContent
static void function (SessionState state) { logger.debug(STR); state.setAttribute (STATE_COPIED_IDS, new ArrayList ()); state.setAttribute (STATE_COPY_FLAG, Boolean.FALSE.toString()); }
/** * initialize the copy context */
initialize the copy context
initCopyContext
{ "repo_name": "noondaysun/sakai", "path": "content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java", "license": "apache-2.0", "size": 337685 }
[ "java.util.ArrayList", "org.sakaiproject.event.api.SessionState" ]
import java.util.ArrayList; import org.sakaiproject.event.api.SessionState;
import java.util.*; import org.sakaiproject.event.api.*;
[ "java.util", "org.sakaiproject.event" ]
java.util; org.sakaiproject.event;
2,312,224
Locale getDefaultLocale();
Locale getDefaultLocale();
/** * Gets the current default locale in the LocaleGroup. */
Gets the current default locale in the LocaleGroup
getDefaultLocale
{ "repo_name": "Guronzan/Apache-XmlGraphics", "path": "src/main/java/org/apache/xmlgraphics/util/i18n/ExtendedLocalizable.java", "license": "apache-2.0", "size": 2032 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,500,728
public String generatExperimentId(){ return UUID.randomUUID().toString(); }
String function(){ return UUID.randomUUID().toString(); }
/** * Create a unique experiment Id.<br /> * <i><b>Note:</b> This will not be set as the experiment Id for the experiment. Users should use the * function </i><code><b>setCustomExperimentId(...)</b></code><i> to do so. * @return A string representing a unique id. */
Create a unique experiment Id. Note: This will not be set as the experiment Id for the experiment. Users should use the function <code>setCustomExperimentId(...)</code> to do so
generatExperimentId
{ "repo_name": "glahiru/airavata", "path": "modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExperimentAdvanceOptions.java", "license": "apache-2.0", "size": 5224 }
[ "java.util.UUID" ]
import java.util.UUID;
import java.util.*;
[ "java.util" ]
java.util;
279,972
private void addContributors(Document doc, Element oaiDc, GenericItem item) { for(ItemContributor itemContributor : item.getContributors()) { if(itemContributor.getContributor() == null ) { throw new IllegalStateException("contributor null"); } if( itemContributor.getContributor()...
void function(Document doc, Element oaiDc, GenericItem item) { for(ItemContributor itemContributor : item.getContributors()) { if(itemContributor.getContributor() == null ) { throw new IllegalStateException(STR); } if( itemContributor.getContributor().getContributorType() == null ) { throw new IllegalStateException(STR...
/** * Add contributor information. * * @param doc * @param oaiDc * @param item */
Add contributor information
addContributors
{ "repo_name": "nate-rcl/irplus", "path": "ir_service/src/edu/ur/ir/oai/metadata/provider/service/DefaultQualifiedDublinCoreMetadataProvider.java", "license": "apache-2.0", "size": 23750 }
[ "edu.ur.ir.item.GenericItem", "edu.ur.ir.item.ItemContributor", "edu.ur.ir.item.metadata.dc.ContributorTypeDublinCoreMapping", "edu.ur.ir.oai.OaiUtil", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Text" ]
import edu.ur.ir.item.GenericItem; import edu.ur.ir.item.ItemContributor; import edu.ur.ir.item.metadata.dc.ContributorTypeDublinCoreMapping; import edu.ur.ir.oai.OaiUtil; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Text;
import edu.ur.ir.item.*; import edu.ur.ir.item.metadata.dc.*; import edu.ur.ir.oai.*; import org.w3c.dom.*;
[ "edu.ur.ir", "org.w3c.dom" ]
edu.ur.ir; org.w3c.dom;
47,053
@Override public World rename(Name name) { return new World(name, null); }
World function(Name name) { return new World(name, null); }
/** * Rename this table */
Rename this table
rename
{ "repo_name": "steveklabnik/FrameworkBenchmarks", "path": "frameworks/Java/play2-java/play2-java-jooq-hikaricp/app/models/tables/World.java", "license": "bsd-3-clause", "size": 3797 }
[ "org.jooq.Name" ]
import org.jooq.Name;
import org.jooq.*;
[ "org.jooq" ]
org.jooq;
394,725
static RenderedImage createRenderedImageWithRGBA() { // create a 4x4 image BufferedImage ri = new BufferedImage(4, 4, BufferedImage.TYPE_4BYTE_ABGR); for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { Color c = new Color(128, 128, 128, 128); ...
static RenderedImage createRenderedImageWithRGBA() { BufferedImage ri = new BufferedImage(4, 4, BufferedImage.TYPE_4BYTE_ABGR); for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { Color c = new Color(128, 128, 128, 128); ri.setRGB(x, y, c.getRGB()); } } return ri; }
/** * creates a semi transparent 4x4 image in ABGR color space * * @return RenderedImage */
creates a semi transparent 4x4 image in ABGR color space
createRenderedImageWithRGBA
{ "repo_name": "chunlinyao/fop", "path": "fop-core/src/test/java/org/apache/fop/render/pdf/ImageRenderedAdapterTestCase.java", "license": "apache-2.0", "size": 7139 }
[ "java.awt.Color", "java.awt.image.BufferedImage", "java.awt.image.RenderedImage" ]
import java.awt.Color; import java.awt.image.BufferedImage; import java.awt.image.RenderedImage;
import java.awt.*; import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,849,623
CassandraKeyspaceGetResults.DefinitionStages.Blank defineCassandraKeyspace(String name);
CassandraKeyspaceGetResults.DefinitionStages.Blank defineCassandraKeyspace(String name);
/** * Begins definition for a new CassandraKeyspace resource. * @param name resource name. * @return the first stage of the new CassandraKeyspace definition. */
Begins definition for a new CassandraKeyspace resource
defineCassandraKeyspace
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/cosmosdb/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01/CassandraResources.java", "license": "mit", "size": 7202 }
[ "com.microsoft.azure.management.cosmosdb.v2019_08_01.CassandraKeyspaceGetResults" ]
import com.microsoft.azure.management.cosmosdb.v2019_08_01.CassandraKeyspaceGetResults;
import com.microsoft.azure.management.cosmosdb.v2019_08_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,689,053
public static YangJavaEnumeration getYangEnumerationNode(GeneratedLanguage targetLanguage) { switch (targetLanguage) { case JAVA_GENERATION: { return new YangJavaEnumeration(); } default: { throw new TranslatorException("Only YANG to Java i...
static YangJavaEnumeration function(GeneratedLanguage targetLanguage) { switch (targetLanguage) { case JAVA_GENERATION: { return new YangJavaEnumeration(); } default: { throw new TranslatorException(STR); } } }
/** * Returns based on the target language generate the inherited data model node. * * @param targetLanguage target language in which YANG mapping needs to be * generated * @return the corresponding inherited node based on the target language */
Returns based on the target language generate the inherited data model node
getYangEnumerationNode
{ "repo_name": "paradisecr/ONOS-OXP", "path": "utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/YangDataModelFactory.java", "license": "apache-2.0", "size": 15453 }
[ "org.onosproject.yangutils.datamodel.utils.GeneratedLanguage", "org.onosproject.yangutils.translator.exception.TranslatorException", "org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration" ]
import org.onosproject.yangutils.datamodel.utils.GeneratedLanguage; import org.onosproject.yangutils.translator.exception.TranslatorException; import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
import org.onosproject.yangutils.datamodel.utils.*; import org.onosproject.yangutils.translator.exception.*; import org.onosproject.yangutils.translator.tojava.javamodel.*;
[ "org.onosproject.yangutils" ]
org.onosproject.yangutils;
1,754,047
void resumeTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException;
void resumeTriggers(GroupMatcher<TriggerKey> matcher) throws SchedulerException;
/** * Resume (un-pause) all of the <code>{@link Trigger}s</code> in matching groups. * * <p> * If any <code>Trigger</code> missed one or more fire-times, then the * <code>Trigger</code>'s misfire instruction will be applied. * </p> * * @param matcher The matcher to evaluate again...
Resume (un-pause) all of the <code><code>Trigger</code>s</code> in matching groups. If any <code>Trigger</code> missed one or more fire-times, then the <code>Trigger</code>'s misfire instruction will be applied.
resumeTriggers
{ "repo_name": "AsuraTeam/asura", "path": "asura-quartz/src/main/java/org/quartz/Scheduler.java", "license": "apache-2.0", "size": 36373 }
[ "org.quartz.impl.matchers.GroupMatcher" ]
import org.quartz.impl.matchers.GroupMatcher;
import org.quartz.impl.matchers.*;
[ "org.quartz.impl" ]
org.quartz.impl;
2,562,324
public boolean supportsOuterJoins() throws SQLException { return true; }
boolean function() throws SQLException { return true; }
/** * Retrieves whether this database supports some form of outer join. <p> * * <!-- start release-specific documentation --> * <div class="ReleaseSpecificDocumentation"> * <h3>HSQLDB-Specific Information:</h3> <p> * * HSQLDB supports outer joins; this method always returns * <co...
Retrieves whether this database supports some form of outer join. HSQLDB-Specific Information: HSQLDB supports outer joins; this method always returns <code>true</code>.
supportsOuterJoins
{ "repo_name": "minghao7896321/canyin", "path": "hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java", "license": "apache-2.0", "size": 237705 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,608,152
InputStream openResource() throws IOException; }
InputStream openResource() throws IOException; }
/** * Returns the byte contents of the current item. * @return the input stream for obtaining the contents of the current item * @throws IOException if failed to open the resource */
Returns the byte contents of the current item
openResource
{ "repo_name": "cocoatomo/asakusafw", "path": "mapreduce/compiler/core/src/main/java/com/asakusafw/compiler/batch/ResourceRepository.java", "license": "apache-2.0", "size": 1969 }
[ "java.io.IOException", "java.io.InputStream" ]
import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
595,016
protected Set<Event> resolveEventViaPrincipalAttribute(final Principal principal, final Collection<String> attributeNames, final RegisteredService service, ...
Set<Event> function(final Principal principal, final Collection<String> attributeNames, final RegisteredService service, final RequestContext context, final Collection<MultifactorAuthenticationProvider> providers, final Predicate<String> predicate) { if (attributeNames.isEmpty()) { LOGGER.debug(STR, getName()); return ...
/** * Resolve event via principal attribute set. * * @param principal the principal * @param attributeNames the attribute name * @param service the service * @param context the context * @param providers the providers * @param predicate the predicate ...
Resolve event via principal attribute set
resolveEventViaPrincipalAttribute
{ "repo_name": "frett/cas", "path": "core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/resolver/impl/AbstractCasMultifactorAuthenticationWebflowEventResolver.java", "license": "apache-2.0", "size": 15343 }
[ "java.util.Collection", "java.util.Set", "java.util.function.Predicate", "org.apereo.cas.authentication.MultifactorAuthenticationProvider", "org.apereo.cas.authentication.principal.Principal", "org.apereo.cas.services.RegisteredService", "org.springframework.webflow.execution.Event", "org.springframew...
import java.util.Collection; import java.util.Set; import java.util.function.Predicate; import org.apereo.cas.authentication.MultifactorAuthenticationProvider; import org.apereo.cas.authentication.principal.Principal; import org.apereo.cas.services.RegisteredService; import org.springframework.webflow.execution.Event; ...
import java.util.*; import java.util.function.*; import org.apereo.cas.authentication.*; import org.apereo.cas.authentication.principal.*; import org.apereo.cas.services.*; import org.springframework.webflow.execution.*;
[ "java.util", "org.apereo.cas", "org.springframework.webflow" ]
java.util; org.apereo.cas; org.springframework.webflow;
206,982
private String rhsNodeName(ResultSet rs) throws SQLException, SQLObjectException { List<String> colNames = new ArrayList<String>(); for (int i = 0; i < project.getSourceTableIndex().getChildCount(); i++) { colNames.add("CURRENT_CANDIDATE_2"+i); } return nodeName(rs, colNa...
String function(ResultSet rs) throws SQLException, SQLObjectException { List<String> colNames = new ArrayList<String>(); for (int i = 0; i < project.getSourceTableIndex().getChildCount(); i++) { colNames.add(STR+i); } return nodeName(rs, colNames); }
/** * Calls nodeName() with the correct parameters to get the unique identifier * values of the right-hand-side record. */
Calls nodeName() with the correct parameters to get the unique identifier values of the right-hand-side record
rhsNodeName
{ "repo_name": "SQLPower/power-matchmaker", "path": "src/ca/sqlpower/matchmaker/graph/MatchPoolDotExport.java", "license": "gpl-3.0", "size": 12497 }
[ "ca.sqlpower.sqlobject.SQLObjectException", "java.sql.ResultSet", "java.sql.SQLException", "java.util.ArrayList", "java.util.List" ]
import ca.sqlpower.sqlobject.SQLObjectException; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List;
import ca.sqlpower.sqlobject.*; import java.sql.*; import java.util.*;
[ "ca.sqlpower.sqlobject", "java.sql", "java.util" ]
ca.sqlpower.sqlobject; java.sql; java.util;
596,767
public static SchemaLocation getSchemaLocationForSWE101() { return SCHEMA_LOCATION_SWE_101; }
static SchemaLocation function() { return SCHEMA_LOCATION_SWE_101; }
/** * SWECommon 1.0.1 schema location * * @return QName of schema location */
SWECommon 1.0.1 schema location
getSchemaLocationForSWE101
{ "repo_name": "nuest/SOS", "path": "core/api/src/main/java/org/n52/sos/util/N52XmlHelper.java", "license": "gpl-2.0", "size": 11340 }
[ "org.n52.sos.w3c.SchemaLocation" ]
import org.n52.sos.w3c.SchemaLocation;
import org.n52.sos.w3c.*;
[ "org.n52.sos" ]
org.n52.sos;
1,050,083
public boolean serviceStart() { if (GAEProxyService.isServiceStarted()) { try { stopService(new Intent(this, GAEProxyService.class)); } catch (Exception e) { // Nothing } return false; } SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(this); proxyType = ...
boolean function() { if (GAEProxyService.isServiceStarted()) { try { stopService(new Intent(this, GAEProxyService.class)); } catch (Exception e) { } return false; } SharedPreferences settings = PreferenceManager .getDefaultSharedPreferences(this); proxyType = settings.getString(STR, STR); proxy = settings.getString("pr...
/** * Called when connect button is clicked. * * @throws Exception */
Called when connect button is clicked
serviceStart
{ "repo_name": "miumok98/gaeproxy", "path": "src/org/gaeproxy/GAEProxy.java", "license": "gpl-3.0", "size": 25333 }
[ "android.content.Intent", "android.content.SharedPreferences", "android.preference.PreferenceManager", "android.text.SpannableString", "android.text.method.LinkMovementMethod", "android.text.util.Linkify", "android.widget.TextView" ]
import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.util.Linkify; import android.widget.TextView;
import android.content.*; import android.preference.*; import android.text.*; import android.text.method.*; import android.text.util.*; import android.widget.*;
[ "android.content", "android.preference", "android.text", "android.widget" ]
android.content; android.preference; android.text; android.widget;
2,331,436