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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
protected Collection<ExtensionComponent<T>> load(ExtensionComponentSet delta) {
return delta.find(extensionType);
} | Collection<ExtensionComponent<T>> function(ExtensionComponentSet delta) { return delta.find(extensionType); } | /**
* Picks up extensions that we care from the given list.
*/ | Picks up extensions that we care from the given list | load | {
"repo_name": "MadsNielsen/jtemp",
"path": "core/src/main/java/hudson/ExtensionList.java",
"license": "mit",
"size": 12157
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,608,898 |
public static Set<String> getTenantDomainsByState(String state) throws UserStoreException {
boolean isActive = state.equalsIgnoreCase(APIConstants.TENANT_STATE_ACTIVE);
if (isActive) {
return getActiveTenantDomains();
}
Tenant[] tenants = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager().getAllTenants();
Set<String> tenantDomains = new HashSet<>();
for (Tenant tenant : tenants) {
if (!tenant.isActive()) {
tenantDomains.add(tenant.getDomain());
}
}
return tenantDomains;
} | static Set<String> function(String state) throws UserStoreException { boolean isActive = state.equalsIgnoreCase(APIConstants.TENANT_STATE_ACTIVE); if (isActive) { return getActiveTenantDomains(); } Tenant[] tenants = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager().getAllTenants(); Set<String> tenantDomains = new HashSet<>(); for (Tenant tenant : tenants) { if (!tenant.isActive()) { tenantDomains.add(tenant.getDomain()); } } return tenantDomains; } | /**
* Get tenants by state
*
* @param state state of the tenant
* @return set of tenants
* @throws UserStoreException
*/ | Get tenants by state | getTenantDomainsByState | {
"repo_name": "ruks/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java",
"license": "apache-2.0",
"size": 564037
} | [
"java.util.HashSet",
"java.util.Set",
"org.wso2.carbon.apimgt.impl.APIConstants",
"org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder",
"org.wso2.carbon.user.api.Tenant",
"org.wso2.carbon.user.api.UserStoreException"
] | import java.util.HashSet; import java.util.Set; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder; import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; | import java.util.*; import org.wso2.carbon.apimgt.impl.*; import org.wso2.carbon.apimgt.impl.internal.*; import org.wso2.carbon.user.api.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 889,322 |
public long deleteListSelAlmDet(DeudaExcProMasEliminarSearchPage deudaExcProMasEliminarSearchPageVO) throws Exception {
//TODO FACTORIZAR LAS VALIDACIONES con las de la busqueda de deuda a excluir
// Validaciones de negocio
SelAlmLog selAlmLog = new SelAlmLog();
selAlmLog.setAccionLog(AccionLog.getById(AccionLog.ID_ELIMINAR_MASIVO));
selAlmLog.setDetalleLog(deudaExcProMasEliminarSearchPageVO.getDetalleLog());
selAlmLog = this.getSelAlmExc().createSelAlmLog(selAlmLog);
if (selAlmLog.hasError()){
selAlmLog.passErrorMessages(this);
return 0;
}
return GdeDAOFactory.getSelAlmDetDAO().deleteListSelAlmDet(deudaExcProMasEliminarSearchPageVO);
} | long function(DeudaExcProMasEliminarSearchPage deudaExcProMasEliminarSearchPageVO) throws Exception { SelAlmLog selAlmLog = new SelAlmLog(); selAlmLog.setAccionLog(AccionLog.getById(AccionLog.ID_ELIMINAR_MASIVO)); selAlmLog.setDetalleLog(deudaExcProMasEliminarSearchPageVO.getDetalleLog()); selAlmLog = this.getSelAlmExc().createSelAlmLog(selAlmLog); if (selAlmLog.hasError()){ selAlmLog.passErrorMessages(this); return 0; } return GdeDAOFactory.getSelAlmDetDAO().deleteListSelAlmDet(deudaExcProMasEliminarSearchPageVO); } | /**
* Borra la lista de SelAlmDet de la seleccion almanacenda excluida del envio judicial acuerdo a los filtros cargados en el SearchPage
* @param deudaExcProMasEliminarSearchPageVO
* @throws Exception
*/ | Borra la lista de SelAlmDet de la seleccion almanacenda excluida del envio judicial acuerdo a los filtros cargados en el SearchPage | deleteListSelAlmDet | {
"repo_name": "avdata99/SIAT",
"path": "siat-1.0-SOURCE/src/buss/src/ar/gov/rosario/siat/gde/buss/bean/ProcesoMasivo.java",
"license": "gpl-3.0",
"size": 173904
} | [
"ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory",
"ar.gov.rosario.siat.gde.iface.model.DeudaExcProMasEliminarSearchPage"
] | import ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory; import ar.gov.rosario.siat.gde.iface.model.DeudaExcProMasEliminarSearchPage; | import ar.gov.rosario.siat.gde.buss.dao.*; import ar.gov.rosario.siat.gde.iface.model.*; | [
"ar.gov.rosario"
] | ar.gov.rosario; | 2,778,249 |
Map<String, ItemDef> getItemDefs() throws Exception; | Map<String, ItemDef> getItemDefs() throws Exception; | /**
* Returns the model that was generated as a result of the conversion.
* <p/>
*
* @return < object name , object >
*/ | Returns the model that was generated as a result of the conversion. | getItemDefs | {
"repo_name": "documaster/noark-extraction-validator",
"path": "noark-extraction-validator/src/main/java/com/documaster/validator/converters/Converter.java",
"license": "agpl-3.0",
"size": 1402
} | [
"com.documaster.validator.storage.model.ItemDef",
"java.util.Map"
] | import com.documaster.validator.storage.model.ItemDef; import java.util.Map; | import com.documaster.validator.storage.model.*; import java.util.*; | [
"com.documaster.validator",
"java.util"
] | com.documaster.validator; java.util; | 1,760,052 |
public List<VPMBuilder> getVPMBuilders(); | List<VPMBuilder> function(); | /**
* Get the list of available variation point model builders.
*
* @return The list of builders.
*/ | Get the list of available variation point model builders | getVPMBuilders | {
"repo_name": "kopl/SPLevo",
"path": "VPMBuilder/org.splevo.vpm.builder/src/org/splevo/vpm/builder/VPMBuilderService.java",
"license": "epl-1.0",
"size": 1987
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,880,331 |
DD: See InquiryCollectionDefinition.java
JSTL: The inquiryCollection element is a Map with the following keys:
* name (String)
* dataObjectClass (String)
* numberOfColumns (String)
* inquiryFields (Map)
* inquiryCollections (Map, optional)
* summaryTitle (String)
* summaryFields (Map, optional)
*/
public void setInquiryCollections(Map inquiryCollections) {
this.inquiryCollections = inquiryCollections;
}
| DD: See InquiryCollectionDefinition.java JSTL: The inquiryCollection element is a Map with the following keys: * name (String) * dataObjectClass (String) * numberOfColumns (String) * inquiryFields (Map) * inquiryCollections (Map, optional) * summaryTitle (String) * summaryFields (Map, optional) */ void function(Map inquiryCollections) { this.inquiryCollections = inquiryCollections; } | /**
The inquiryCollection defines a collection within the Business Object which contains
data that should be displayed with the BO when the inquiry is performed.
Each inquiryCollection defines a set of data fields, nested inquiryCollections
and summaryFields. The summaryFields will be reported in the header of
this inquiryCollection, .
DD: See InquiryCollectionDefinition.java
JSTL: The inquiryCollection element is a Map with the following keys:
* name (String)
* dataObjectClass (String)
* numberOfColumns (String)
* inquiryFields (Map)
* inquiryCollections (Map, optional)
* summaryTitle (String)
* summaryFields (Map, optional)
*/ | name (String) dataObjectClass (String) numberOfColumns (String) inquiryFields (Map) inquiryCollections (Map, optional) summaryTitle (String) summaryFields (Map, optional) | setInquiryCollections | {
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/datadictionary/InquirySectionDefinition.java",
"license": "apache-2.0",
"size": 8564
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 394,559 |
@Override
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
{
//this.parentBody = (par1NBTTagCompound.get("parentBody"));
} | void function(NBTTagCompound par1NBTTagCompound) { } | /**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/ | (abstract) Protected helper method to read subclass entity data from NBT | readEntityFromNBT | {
"repo_name": "KILLER-CHIEF/Halocraft-KCWM",
"path": "java/net/killerchief/halocraft/entities/vehicles/EntityPassengerSeat.java",
"license": "gpl-2.0",
"size": 5355
} | [
"net.minecraft.nbt.NBTTagCompound"
] | import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.nbt.*; | [
"net.minecraft.nbt"
] | net.minecraft.nbt; | 1,011,197 |
@Generated
@Selector("maximumDistanceFuel")
public native NSMeasurement<NSUnitLength> maximumDistanceFuel(); | @Selector(STR) native NSMeasurement<NSUnitLength> function(); | /**
* The maximum distance a vehicle can travel with full resources. As the vehicle drives, this value can change over time as a result of driving characteristics.
*/ | The maximum distance a vehicle can travel with full resources. As the vehicle drives, this value can change over time as a result of driving characteristics | maximumDistanceFuel | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/intents/INGetCarPowerLevelStatusIntentResponse.java",
"license": "apache-2.0",
"size": 16664
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,250,448 |
public void setMenuName( String menuName ) {
if (menuName != null) {
parameters.put(Names.menuName, menuName );
}
}
| void function( String menuName ) { if (menuName != null) { parameters.put(Names.menuName, menuName ); } } | /**
* Sets a menuName which is displayed representing this submenu item
*
* @param menuName
* String which will be displayed representing this submenu item
*/ | Sets a menuName which is displayed representing this submenu item | setMenuName | {
"repo_name": "Luxoft/SDLP2",
"path": "SDL_Android/SmartDeviceLinkProxyAndroid/src/com/smartdevicelink/proxy/rpc/AddSubMenu.java",
"license": "lgpl-2.1",
"size": 3644
} | [
"com.smartdevicelink.proxy.constants.Names"
] | import com.smartdevicelink.proxy.constants.Names; | import com.smartdevicelink.proxy.constants.*; | [
"com.smartdevicelink.proxy"
] | com.smartdevicelink.proxy; | 183,929 |
public BufferedImage renderImage(int pageIndex, float scale) throws IOException
{
return renderImage(pageIndex, scale, ImageType.RGB);
} | BufferedImage function(int pageIndex, float scale) throws IOException { return renderImage(pageIndex, scale, ImageType.RGB); } | /**
* Returns the given page as an RGB image at the given scale.
* A scale of 1 will render at 72 DPI.
* @param pageIndex the zero-based index of the page to be converted
* @param scale the scaling factor, where 1 = 72 DPI
* @return the rendered page image
* @throws IOException if the PDF cannot be read
*/ | Returns the given page as an RGB image at the given scale. A scale of 1 will render at 72 DPI | renderImage | {
"repo_name": "benmccann/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/rendering/PDFRenderer.java",
"license": "apache-2.0",
"size": 7929
} | [
"java.awt.image.BufferedImage",
"java.io.IOException"
] | import java.awt.image.BufferedImage; import java.io.IOException; | import java.awt.image.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 627,725 |
@Nonnull
IJSExpression gt (@Nonnull BigDecimal aValue); | IJSExpression gt (@Nonnull BigDecimal aValue); | /**
* Greater than '>'.
*
* @param aValue
* value
* @return [this] > value
*/ | Greater than '>' | gt | {
"repo_name": "phax/ph-oton",
"path": "ph-oton-jscode/src/main/java/com/helger/html/jscode/IJSExpression.java",
"license": "apache-2.0",
"size": 26099
} | [
"java.math.BigDecimal",
"javax.annotation.Nonnull"
] | import java.math.BigDecimal; import javax.annotation.Nonnull; | import java.math.*; import javax.annotation.*; | [
"java.math",
"javax.annotation"
] | java.math; javax.annotation; | 641,173 |
public IntWritable evaluate(TimestampWritable dateTimeStamp) {
if (dateTimeStamp == null) {
return null;
}
calendar.setTime(dateTimeStamp.getTimestamp());
int month = calendar.get(Calendar.MONTH) + 1;
result = getQuarter(month);
return result;
} | IntWritable function(TimestampWritable dateTimeStamp) { if (dateTimeStamp == null) { return null; } calendar.setTime(dateTimeStamp.getTimestamp()); int month = calendar.get(Calendar.MONTH) + 1; result = getQuarter(month); return result; } | /**
* Get the quarter of the year from a date Timestamp.
*
* @param dateTimeStamp
* the dateTimeStamp in the format of "yyyy-MM-dd HH:mm:ss" or
* "yyyy-MM-dd".
* @return an IntWritable from 1 to 4. null if the dateTimeStamp is not a valid date
* TimeStamp.
*/ | Get the quarter of the year from a date Timestamp | evaluate | {
"repo_name": "livingsocial/HiveSwarm",
"path": "src/main/java/com/livingsocial/hive/udf/UDFQuarter.java",
"license": "gpl-3.0",
"size": 2666
} | [
"java.util.Calendar",
"org.apache.hadoop.hive.serde2.io.TimestampWritable",
"org.apache.hadoop.io.IntWritable"
] | import java.util.Calendar; import org.apache.hadoop.hive.serde2.io.TimestampWritable; import org.apache.hadoop.io.IntWritable; | import java.util.*; import org.apache.hadoop.hive.serde2.io.*; import org.apache.hadoop.io.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,534,020 |
if(fecha == null){
fecha = new Date();
}
SimpleDateFormat formatoDF = new SimpleDateFormat(formato);
return formatoDF.format(fecha);
}
| if(fecha == null){ fecha = new Date(); } SimpleDateFormat formatoDF = new SimpleDateFormat(formato); return formatoDF.format(fecha); } | /**
* Genera un String a partir de un Date de acuerdo al fomrato enviado, si fecha es NULL toma la fecha actual.
* @param fecha
* @param formato
* @return
*/ | Genera un String a partir de un Date de acuerdo al fomrato enviado, si fecha es NULL toma la fecha actual | getDateToString | {
"repo_name": "HenRogTR/Evaluacion",
"path": "Evaluacion/src/main/java/pe/edu/unu/evaluacion/util/UtilFecha.java",
"license": "cc0-1.0",
"size": 1229
} | [
"java.text.SimpleDateFormat",
"java.util.Date"
] | import java.text.SimpleDateFormat; import java.util.Date; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 1,271,240 |
protected CharSequence getItemDescription(int day) {
mTempCalendar.set(mYear, mMonth, day);
final CharSequence date = DateFormat.format(DATE_FORMAT,
mTempCalendar.getTimeInMillis());
if (day == mSelectedDay) {
return getContext().getString(R.string.mdtp_item_is_selected, date);
}
return date;
}
} | CharSequence function(int day) { mTempCalendar.set(mYear, mMonth, day); final CharSequence date = DateFormat.format(DATE_FORMAT, mTempCalendar.getTimeInMillis()); if (day == mSelectedDay) { return getContext().getString(R.string.mdtp_item_is_selected, date); } return date; } } | /**
* Generates a description for a given time object. Since this
* description will be spoken, the components are ordered by descending
* specificity as DAY MONTH YEAR.
*
* @param day The day to generate a description for
* @return A description of the time object
*/ | Generates a description for a given time object. Since this description will be spoken, the components are ordered by descending specificity as DAY MONTH YEAR | getItemDescription | {
"repo_name": "ruizhang81/MyLibaryStorehouse",
"path": "lib_dateselect/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java",
"license": "apache-2.0",
"size": 31054
} | [
"android.text.format.DateFormat"
] | import android.text.format.DateFormat; | import android.text.format.*; | [
"android.text"
] | android.text; | 2,086,507 |
protected Coordinate forwardPointRaw (double lon, double lat, Coordinate storage) {
storage.x = _k0 * _a * GeometryUtils.wrap_longitude(lon - _lambda0) * _spq;
double sinPhi = StrictMath.sin(lat);
if (sinPhi == 1.0) {
storage.y = (lat > 0) ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY;
} else {
storage.y = _k0 * ((_a / 2.0) * StrictMath.log(((1 + sinPhi) / (1 - sinPhi)) * StrictMath.pow((1 - (_e * sinPhi)) / (1 + (_e * sinPhi)), _e))) * _spq;
}
return storage;
} | Coordinate function (double lon, double lat, Coordinate storage) { storage.x = _k0 * _a * GeometryUtils.wrap_longitude(lon - _lambda0) * _spq; double sinPhi = StrictMath.sin(lat); if (sinPhi == 1.0) { storage.y = (lat > 0) ? Float.POSITIVE_INFINITY : Float.NEGATIVE_INFINITY; } else { storage.y = _k0 * ((_a / 2.0) * StrictMath.log(((1 + sinPhi) / (1 - sinPhi)) * StrictMath.pow((1 - (_e * sinPhi)) / (1 + (_e * sinPhi)), _e))) * _spq; } return storage; } | /**
* Forward projects a point.
* @param lat the latitude of the point to project, in RADIANS
* @param lat the longitude of the point to project, in RADIANS
* @param storage a place to store the result
* @return The projected point. Same object as <code>storage</code>
*/ | Forward projects a point | forwardPointRaw | {
"repo_name": "reuven/modelingcommons",
"path": "public/extensions/gis/src/org/myworldgis/projection/Mercator.java",
"license": "agpl-3.0",
"size": 8207
} | [
"com.vividsolutions.jts.geom.Coordinate",
"org.myworldgis.util.GeometryUtils"
] | import com.vividsolutions.jts.geom.Coordinate; import org.myworldgis.util.GeometryUtils; | import com.vividsolutions.jts.geom.*; import org.myworldgis.util.*; | [
"com.vividsolutions.jts",
"org.myworldgis.util"
] | com.vividsolutions.jts; org.myworldgis.util; | 2,205,535 |
private void separaODorme(
final Pedra pedra1,
final Pedra pedra2,
final Pedra pedra3,
final Pedra pedra4) {
this.dorme.add(pedra1);
this.dorme.add(pedra2);
this.dorme.add(pedra3);
this.dorme.add(pedra4);
this.eventListener.dormeDefinido(pedra1,pedra2,pedra3,pedra4);
} | void function( final Pedra pedra1, final Pedra pedra2, final Pedra pedra3, final Pedra pedra4) { this.dorme.add(pedra1); this.dorme.add(pedra2); this.dorme.add(pedra3); this.dorme.add(pedra4); this.eventListener.dormeDefinido(pedra1,pedra2,pedra3,pedra4); } | /**
* Adiciona 4 {@linkplain Pedra pedras} ao {@linkplain #getDorme() dorme} e
* {@linkplain OmniscientDominoEventListener#dormeDefinido(Pedra,Pedra,
* Pedra,Pedra) anuncia o evento correspondente}.
*
* @param pedra1 A primeira {@linkplain Pedra pedra} do dorme.
* @param pedra2 A segunda {@linkplain Pedra pedra} do dorme.
* @param pedra3 A terceira {@linkplain Pedra pedra} do dorme.
* @param pedra4 A última {@linkplain Pedra pedra} do dorme.
*/ | Adiciona 4 Pedra pedras ao #getDorme() dorme e OmniscientDominoEventListener#dormeDefinido(Pedra,Pedra, Pedra,Pedra) anuncia o evento correspondente | separaODorme | {
"repo_name": "brunoabdon/domino",
"path": "src/main/java/com/github/abdonia/domino/motor/MesaImpl.java",
"license": "gpl-3.0",
"size": 14160
} | [
"com.github.abdonia.domino.Pedra"
] | import com.github.abdonia.domino.Pedra; | import com.github.abdonia.domino.*; | [
"com.github.abdonia"
] | com.github.abdonia; | 2,516,561 |
public void writeSnapshot(OutputStream os) throws Exception {
writeSnapshot(new DataOutputStream(os));
} | void function(OutputStream os) throws Exception { writeSnapshot(new DataOutputStream(os)); } | /**
* Write a snapshot to the specified stream.
*/ | Write a snapshot to the specified stream | writeSnapshot | {
"repo_name": "Netflix/zeno",
"path": "src/main/java/com/netflix/zeno/fastblob/io/FastBlobWriter.java",
"license": "apache-2.0",
"size": 10978
} | [
"java.io.DataOutputStream",
"java.io.OutputStream"
] | import java.io.DataOutputStream; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,514,243 |
@Override
public void addCompletedChild(
ParseContext context,
String namespaceURI,
String localName,
Object child
)
{
if (child instanceof StyleNode)
{
if (_styles == null)
_styles = new Vector<StyleNode>();
_styles.addElement((StyleNode)child);
}
} | void function( ParseContext context, String namespaceURI, String localName, Object child ) { if (child instanceof StyleNode) { if (_styles == null) _styles = new Vector<StyleNode>(); _styles.addElement((StyleNode)child); } } | /**
* Implementation of NodeParser.addCompletedChild().
*/ | Implementation of NodeParser.addCompletedChild() | addCompletedChild | {
"repo_name": "adamrduffy/trinidad-1.0.x",
"path": "trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/StyleSheetNodeParser.java",
"license": "apache-2.0",
"size": 9451
} | [
"java.util.Vector",
"org.apache.myfaces.trinidadinternal.share.xml.ParseContext"
] | import java.util.Vector; import org.apache.myfaces.trinidadinternal.share.xml.ParseContext; | import java.util.*; import org.apache.myfaces.trinidadinternal.share.xml.*; | [
"java.util",
"org.apache.myfaces"
] | java.util; org.apache.myfaces; | 191,088 |
public DataResponse getData(MediaType mediaType) throws IOException, JSONException {
return getData(mediaType, false);
}
| DataResponse function(MediaType mediaType) throws IOException, JSONException { return getData(mediaType, false); } | /**
* Gets getData from server and returns String. There is one request to
* server.
*
* @param mediaType MediaType of the string.
* @return An String object.
* @throws java.io.IOException
* @throws org.json.JSONException
*/ | Gets getData from server and returns String. There is one request to server | getData | {
"repo_name": "valdasraps/resthub",
"path": "clients/java/src/main/java/lt/emasina/resthub/model/QueryManager.java",
"license": "lgpl-3.0",
"size": 12678
} | [
"java.io.IOException",
"org.json.JSONException",
"org.restlet.data.MediaType"
] | import java.io.IOException; import org.json.JSONException; import org.restlet.data.MediaType; | import java.io.*; import org.json.*; import org.restlet.data.*; | [
"java.io",
"org.json",
"org.restlet.data"
] | java.io; org.json; org.restlet.data; | 1,545,072 |
public NamingEnumeration search(String name, Attributes matchingAttributes)
throws NamingException {
throw new OperationNotSupportedException();
} | NamingEnumeration function(String name, Attributes matchingAttributes) throws NamingException { throw new OperationNotSupportedException(); } | /**
* Searches in a single context for objects that contain a specified set
* of attributes. This method returns all the attributes of such objects.
* It is equivalent to supplying null as the atributesToReturn parameter
* to the method search(Name, Attributes, String[]).
*
* @param name the name of the context to search
* @param matchingAttributes the attributes to search for. If empty or
* null, all objects in the target context are returned.
* @return a non-null enumeration of SearchResult objects. Each
* SearchResult contains the attributes identified by attributesToReturn
* and the name of the corresponding object, named relative to the
* context named by name.
* @exception NamingException if a naming exception is encountered
*/ | Searches in a single context for objects that contain a specified set of attributes. This method returns all the attributes of such objects. It is equivalent to supplying null as the atributesToReturn parameter to the method search(Name, Attributes, String[]) | search | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/WARDirContext.java",
"license": "mit",
"size": 34755
} | [
"javax.naming.NamingEnumeration",
"javax.naming.NamingException",
"javax.naming.OperationNotSupportedException",
"javax.naming.directory.Attributes"
] | import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.OperationNotSupportedException; import javax.naming.directory.Attributes; | import javax.naming.*; import javax.naming.directory.*; | [
"javax.naming"
] | javax.naming; | 2,797,091 |
public void init(MessageDigest md, PRNG rng) {
this.md = md;
this.rng = rng;
mdSize = md.getDigestLength();
// sealLength must be (for security reasons) at least as much as the
// length of the message digest in byzes
if (this.sealLength < mdSize)
this.sealLength = mdSize;
initialized = true;
}
| void function(MessageDigest md, PRNG rng) { this.md = md; this.rng = rng; mdSize = md.getDigestLength(); if (this.sealLength < mdSize) this.sealLength = mdSize; initialized = true; } | /**
* Initializes the OTS.
*
* @param md
* the hash function for the OTS
* @param rng
* the name of the PRNG used for key pair generation
*/ | Initializes the OTS | init | {
"repo_name": "besom/bbossgroups-mvn",
"path": "bboss_security/src/main/java/de/flexiprovider/pqc/hbc/ots/BiBaOTS.java",
"license": "apache-2.0",
"size": 15230
} | [
"de.flexiprovider.api.MessageDigest"
] | import de.flexiprovider.api.MessageDigest; | import de.flexiprovider.api.*; | [
"de.flexiprovider.api"
] | de.flexiprovider.api; | 866,656 |
public void setField(Field field) {
this.field = field;
}
| void function(Field field) { this.field = field; } | /**
* Set the POJO field
*
* @param field
*/ | Set the POJO field | setField | {
"repo_name": "uaraven/nano",
"path": "src/main/java/com/leansoft/nano/annotation/schema/AttributeSchema.java",
"license": "apache-2.0",
"size": 772
} | [
"java.lang.reflect.Field"
] | import java.lang.reflect.Field; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 2,438,092 |
@Generated
@Selector("setReferrerURL:")
public native void setReferrerURL(NSURL value); | @Selector(STR) native void function(NSURL value); | /**
* The URL of the webpage that referred (linked to) webpageURL.
*/ | The URL of the webpage that referred (linked to) webpageURL | setReferrerURL | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/foundation/NSUserActivity.java",
"license": "apache-2.0",
"size": 25953
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,113,115 |
@SuppressWarnings("AssertEqualsBetweenInconvertibleTypes")
public void testAffinityProcessor() throws Exception {
Random rnd = new Random();
final IgniteKernal grid1 = (IgniteKernal)grid(rnd.nextInt(NODES_CNT)); // With cache.
IgniteKernal grid2 = (IgniteKernal)grid(NODES_CNT + rnd.nextInt(NODES_CNT)); // Without cache.
assertEquals(NODES_CNT * 2, grid1.cluster().nodes().size());
assertEquals(NODES_CNT * 2, grid2.cluster().nodes().size());
IgniteCache<Integer, Integer> cache = grid2.cache(CACHE_NAME);
assertNotNull(cache);
GridAffinityProcessor affPrc1 = grid1.context().affinity();
GridAffinityProcessor affPrc2 = grid2.context().affinity();
// Create keys collection.
Collection<Integer> keys = new ArrayList<>(1000);
for (int i = 0; i < 1000; i++)
keys.add(i);
//
// Validate affinity functions collection updated on first call.
//
Map<ClusterNode, Collection<Integer>> node1Map = affPrc1.mapKeysToNodes(CACHE_NAME, keys);
Map<ClusterNode, Collection<Integer>> node2Map = affPrc2.mapKeysToNodes(CACHE_NAME, keys);
Map<ClusterNode, Collection<Integer>> cacheMap = affinity(cache).mapKeysToNodes(keys);
assertEquals(cacheMap.size(), node1Map.size());
assertEquals(cacheMap.size(), node2Map.size());
for (Map.Entry<ClusterNode, Collection<Integer>> entry : cacheMap.entrySet()) {
ClusterNode node = entry.getKey();
Collection<Integer> mappedKeys = entry.getValue();
Collection<Integer> mapped1 = node1Map.get(node);
Collection<Integer> mapped2 = node2Map.get(node);
assertTrue(mappedKeys.containsAll(mapped1) && mapped1.containsAll(mappedKeys));
assertTrue(mappedKeys.containsAll(mapped2) && mapped2.containsAll(mappedKeys));
}
} | @SuppressWarnings(STR) void function() throws Exception { Random rnd = new Random(); final IgniteKernal grid1 = (IgniteKernal)grid(rnd.nextInt(NODES_CNT)); IgniteKernal grid2 = (IgniteKernal)grid(NODES_CNT + rnd.nextInt(NODES_CNT)); assertEquals(NODES_CNT * 2, grid1.cluster().nodes().size()); assertEquals(NODES_CNT * 2, grid2.cluster().nodes().size()); IgniteCache<Integer, Integer> cache = grid2.cache(CACHE_NAME); assertNotNull(cache); GridAffinityProcessor affPrc1 = grid1.context().affinity(); GridAffinityProcessor affPrc2 = grid2.context().affinity(); Collection<Integer> keys = new ArrayList<>(1000); for (int i = 0; i < 1000; i++) keys.add(i); Map<ClusterNode, Collection<Integer>> node1Map = affPrc1.mapKeysToNodes(CACHE_NAME, keys); Map<ClusterNode, Collection<Integer>> node2Map = affPrc2.mapKeysToNodes(CACHE_NAME, keys); Map<ClusterNode, Collection<Integer>> cacheMap = affinity(cache).mapKeysToNodes(keys); assertEquals(cacheMap.size(), node1Map.size()); assertEquals(cacheMap.size(), node2Map.size()); for (Map.Entry<ClusterNode, Collection<Integer>> entry : cacheMap.entrySet()) { ClusterNode node = entry.getKey(); Collection<Integer> mappedKeys = entry.getValue(); Collection<Integer> mapped1 = node1Map.get(node); Collection<Integer> mapped2 = node2Map.get(node); assertTrue(mappedKeys.containsAll(mapped1) && mapped1.containsAll(mappedKeys)); assertTrue(mappedKeys.containsAll(mapped2) && mapped2.containsAll(mappedKeys)); } } | /**
* Test affinity functions caching and clean up.
*
* @throws Exception In case of any exception.
*/ | Test affinity functions caching and clean up | testAffinityProcessor | {
"repo_name": "nivanov/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/affinity/GridAffinityProcessorAbstractSelfTest.java",
"license": "apache-2.0",
"size": 6679
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.Map",
"java.util.Random",
"org.apache.ignite.IgniteCache",
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.IgniteKernal"
] | import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.Random; import org.apache.ignite.IgniteCache; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.IgniteKernal; | import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cluster.*; import org.apache.ignite.internal.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 2,346,497 |
public void setBundlesType(String resourceType) {
// Set the extension for resources and bundles
this.resourceType = resourceType;
this.fileExtension = "." + resourceType.toLowerCase();
this.resourceTypePreprocessorChainFactory = new BasicGlobalPreprocessorChainFactory();
this.resourceTypePostprocessorChainFactory = new BasicGlobalPostprocessorChainFactory();
// Create the chain factory.
if ("js".equals(resourceType))
this.chainFactory = new JSPostProcessorChainFactory();
else
this.chainFactory = new CSSPostProcessorChainFactory();
} | void function(String resourceType) { this.resourceType = resourceType; this.fileExtension = "." + resourceType.toLowerCase(); this.resourceTypePreprocessorChainFactory = new BasicGlobalPreprocessorChainFactory(); this.resourceTypePostprocessorChainFactory = new BasicGlobalPostprocessorChainFactory(); if ("js".equals(resourceType)) this.chainFactory = new JSPostProcessorChainFactory(); else this.chainFactory = new CSSPostProcessorChainFactory(); } | /**
* Set the type of bundle (js or css) to use for this factory.
*
* @param resourceType
* the resource type
*/ | Set the type of bundle (js or css) to use for this factory | setBundlesType | {
"repo_name": "davidwebster48/jawr-main-repo",
"path": "jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java",
"license": "apache-2.0",
"size": 37490
} | [
"net.jawr.web.resource.bundle.factory.global.postprocessor.BasicGlobalPostprocessorChainFactory",
"net.jawr.web.resource.bundle.factory.global.preprocessor.BasicGlobalPreprocessorChainFactory",
"net.jawr.web.resource.bundle.factory.postprocessor.CSSPostProcessorChainFactory",
"net.jawr.web.resource.bundle.factory.postprocessor.JSPostProcessorChainFactory"
] | import net.jawr.web.resource.bundle.factory.global.postprocessor.BasicGlobalPostprocessorChainFactory; import net.jawr.web.resource.bundle.factory.global.preprocessor.BasicGlobalPreprocessorChainFactory; import net.jawr.web.resource.bundle.factory.postprocessor.CSSPostProcessorChainFactory; import net.jawr.web.resource.bundle.factory.postprocessor.JSPostProcessorChainFactory; | import net.jawr.web.resource.bundle.factory.global.postprocessor.*; import net.jawr.web.resource.bundle.factory.global.preprocessor.*; import net.jawr.web.resource.bundle.factory.postprocessor.*; | [
"net.jawr.web"
] | net.jawr.web; | 1,735,558 |
protected String getMatrixValueTypeString(Matrix.ValueType t) {
if (t.equals(Matrix.ValueType.Double))
return "Double";
if (t.equals(Matrix.ValueType.Integer))
return "Integer";
throw new PackageRuntimeException("Unknown matrix value type");
} | String function(Matrix.ValueType t) { if (t.equals(Matrix.ValueType.Double)) return STR; if (t.equals(Matrix.ValueType.Integer)) return STR; throw new PackageRuntimeException(STR); } | /**
* Get string representation of matrix value type
*
* @param t
* @return
*/ | Get string representation of matrix value type | getMatrixValueTypeString | {
"repo_name": "Myasuka/systemml",
"path": "src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java",
"license": "apache-2.0",
"size": 36240
} | [
"org.apache.sysml.parser.Expression",
"org.apache.sysml.udf.Matrix",
"org.apache.sysml.udf.PackageRuntimeException"
] | import org.apache.sysml.parser.Expression; import org.apache.sysml.udf.Matrix; import org.apache.sysml.udf.PackageRuntimeException; | import org.apache.sysml.parser.*; import org.apache.sysml.udf.*; | [
"org.apache.sysml"
] | org.apache.sysml; | 1,037,777 |
public final void decRef() throws IOException {
ensureOpen();
final int rc = refCount.decrementAndGet();
if (rc == 0) {
boolean success = false;
try {
doClose();
closed = true;
success = true;
} finally {
if (!success) {
// Put reference back on failure
refCount.incrementAndGet();
}
}
} else if (rc < 0) {
throw new IllegalStateException("too many decRef calls: refCount is " + rc + " after decrement");
}
} | final void function() throws IOException { ensureOpen(); final int rc = refCount.decrementAndGet(); if (rc == 0) { boolean success = false; try { doClose(); closed = true; success = true; } finally { if (!success) { refCount.incrementAndGet(); } } } else if (rc < 0) { throw new IllegalStateException(STR + rc + STR); } } | /**
* Expert: decreases the refCount of this TaxonomyReader instance. If the
* refCount drops to 0 this taxonomy reader is closed.
*/ | Expert: decreases the refCount of this TaxonomyReader instance. If the refCount drops to 0 this taxonomy reader is closed | decRef | {
"repo_name": "pkarmstr/NYBC",
"path": "solr-4.2.1/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/TaxonomyReader.java",
"license": "apache-2.0",
"size": 8765
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,325,612 |
public TibcoInstallation getTibcoInstallation() {
for (TibcoInstallation i : getDescriptor().getTibcoInstallations()) {
if (getName() != null && getName().equals(i.getName()))
return i;
}
return null;
}
| TibcoInstallation function() { for (TibcoInstallation i : getDescriptor().getTibcoInstallations()) { if (getName() != null && getName().equals(i.getName())) return i; } return null; } | /**
* Gets the Tibco installation for name.
*/ | Gets the Tibco installation for name | getTibcoInstallation | {
"repo_name": "federicopastore/TibcoBuilder",
"path": "src/main/java/org/jenkinsci/plugins/tibco/StudioToolsBuilder.java",
"license": "mit",
"size": 9500
} | [
"org.jenkinsci.plugins.tibco.installation.TibcoInstallation"
] | import org.jenkinsci.plugins.tibco.installation.TibcoInstallation; | import org.jenkinsci.plugins.tibco.installation.*; | [
"org.jenkinsci.plugins"
] | org.jenkinsci.plugins; | 480,165 |
void split(SplitTransition<?> splitTransition); | void split(SplitTransition<?> splitTransition); | /**
* Accepts the given split transition. The implementation decides how to turn this into
* actual configurations.
*/ | Accepts the given split transition. The implementation decides how to turn this into actual configurations | split | {
"repo_name": "rohitsaboo/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java",
"license": "apache-2.0",
"size": 95388
} | [
"com.google.devtools.build.lib.packages.Attribute"
] | import com.google.devtools.build.lib.packages.Attribute; | import com.google.devtools.build.lib.packages.*; | [
"com.google.devtools"
] | com.google.devtools; | 1,940,437 |
public void setFunction(String
function) {
this.function = function;
}
private String nxNomenclature;
@Column(name = "NXNOMENCLATURE", length = EntityWithId.COLUMNLENGTH)
| void function(String function) { this.function = function; } private String nxNomenclature; @Column(name = STR, length = EntityWithId.COLUMNLENGTH) | /**
* Sets the value of function attribute.
* @param function .
**/ | Sets the value of function attribute | setFunction | {
"repo_name": "NCIP/calims",
"path": "calims2-model/src/java/gov/nih/nci/calims2/domain/inventory/Lipid.java",
"license": "bsd-3-clause",
"size": 5227
} | [
"gov.nih.nci.calims2.domain.interfaces.EntityWithId",
"javax.persistence.Column"
] | import gov.nih.nci.calims2.domain.interfaces.EntityWithId; import javax.persistence.Column; | import gov.nih.nci.calims2.domain.interfaces.*; import javax.persistence.*; | [
"gov.nih.nci",
"javax.persistence"
] | gov.nih.nci; javax.persistence; | 1,347,410 |
String getIndexRoots() {
String roots = StringUtil.getList(getIndexRootsArray(), " ", "");
StringBuffer s = new StringBuffer(roots);
s.append(' ');
s.append(identitySequence.peek());
return s.toString();
} | String getIndexRoots() { String roots = StringUtil.getList(getIndexRootsArray(), " ", ""); StringBuffer s = new StringBuffer(roots); s.append(' '); s.append(identitySequence.peek()); return s.toString(); } | /**
* Returns the string consisting of file pointers to roots of indexes
* plus the next identity value (hidden or user defined). This is used
* with CACHED tables.
*/ | Returns the string consisting of file pointers to roots of indexes plus the next identity value (hidden or user defined). This is used with CACHED tables | getIndexRoots | {
"repo_name": "Yashi100/rhodes3.3.2",
"path": "platform/bb/Hsqldb/src/org/hsqldb/Table.java",
"license": "mit",
"size": 110377
} | [
"org.hsqldb.lib.StringUtil"
] | import org.hsqldb.lib.StringUtil; | import org.hsqldb.lib.*; | [
"org.hsqldb.lib"
] | org.hsqldb.lib; | 980,010 |
public String getValue (String name)
{
return getValue(names.indexOf(name));
}
////////////////////////////////////////////////////////////////////
// Internal state.
////////////////////////////////////////////////////////////////////
Vector names = new Vector();
Vector types = new Vector();
Vector values = new Vector();
} | String function (String name) { return getValue(names.indexOf(name)); } Vector names = new Vector(); Vector types = new Vector(); Vector values = new Vector(); } | /**
* Get the value of an attribute (by name).
*
* @param name The attribute name.
* @return the named attribute's value or null, if the attribute does not
* exist.
* @see org.xml.sax.AttributeList#getValue(java.lang.String)
*/ | Get the value of an attribute (by name) | getValue | {
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java",
"license": "apache-2.0",
"size": 8953
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 66,388 |
void getModifyResourceModelAddOn( Map<String, Object> model, String strResourceType, int nResourceId ); | void getModifyResourceModelAddOn( Map<String, Object> model, String strResourceType, int nResourceId ); | /**
* Add datas to the modify document model use in the template
*
* @param model
* the map use in the template
* @param strResourceType
* the resource type
* @param nResourceId
* the resource id
*/ | Add datas to the modify document model use in the template | getModifyResourceModelAddOn | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/java/fr/paris/lutece/portal/business/resourceenhancer/IResourceManager.java",
"license": "bsd-3-clause",
"size": 3939
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,861,382 |
public void setFile(PsiFile file){
myFile=file;
myRootElement = createRootElement();
} | void function(PsiFile file){ myFile=file; myRootElement = createRootElement(); } | /**
* Sets {@code file} for which the structure is built. Alter this method is invoked caches should
* be validated.
*/ | Sets file for which the structure is built. Alter this method is invoked caches should be validated | setFile | {
"repo_name": "goodwinnk/intellij-community",
"path": "platform/lang-impl/src/com/intellij/ide/todo/CurrentFileTodosTreeStructure.java",
"license": "apache-2.0",
"size": 3402
} | [
"com.intellij.psi.PsiFile"
] | import com.intellij.psi.PsiFile; | import com.intellij.psi.*; | [
"com.intellij.psi"
] | com.intellij.psi; | 1,173,535 |
private static ObjectStreamField[] getSerialFields(Class<?> cl)
throws InvalidClassException
{
ObjectStreamField[] fields;
if (Serializable.class.isAssignableFrom(cl) &&
!Externalizable.class.isAssignableFrom(cl) &&
!Proxy.isProxyClass(cl) &&
!cl.isInterface())
{
if ((fields = getDeclaredSerialFields(cl)) == null) {
fields = getDefaultSerialFields(cl);
}
Arrays.sort(fields);
} else {
fields = NO_FIELDS;
}
return fields;
} | static ObjectStreamField[] function(Class<?> cl) throws InvalidClassException { ObjectStreamField[] fields; if (Serializable.class.isAssignableFrom(cl) && !Externalizable.class.isAssignableFrom(cl) && !Proxy.isProxyClass(cl) && !cl.isInterface()) { if ((fields = getDeclaredSerialFields(cl)) == null) { fields = getDefaultSerialFields(cl); } Arrays.sort(fields); } else { fields = NO_FIELDS; } return fields; } | /**
* Returns ObjectStreamField array describing the serializable fields of
* the given class. Serializable fields backed by an actual field of the
* class are represented by ObjectStreamFields with corresponding non-null
* Field objects. Throws InvalidClassException if the (explicitly
* declared) serializable fields are invalid.
*/ | Returns ObjectStreamField array describing the serializable fields of the given class. Serializable fields backed by an actual field of the class are represented by ObjectStreamFields with corresponding non-null Field objects. Throws InvalidClassException if the (explicitly declared) serializable fields are invalid | getSerialFields | {
"repo_name": "isaacl/openjdk-jdk",
"path": "src/share/classes/java/io/ObjectStreamClass.java",
"license": "gpl-2.0",
"size": 88024
} | [
"java.lang.reflect.Proxy",
"java.util.Arrays"
] | import java.lang.reflect.Proxy; import java.util.Arrays; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,268,190 |
@Test
public void test152SeachFirst50Accounts() throws Exception {
final String TEST_NAME = "test152SeachFirst50Accounts";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectQuery query = ObjectQueryUtil.createResourceAndObjectClassQuery(getResourceOid(), getAccountObjectClass(), prismContext);
ObjectPaging paging = ObjectPaging.createEmptyPaging();
paging.setMaxSize(50);
query.setPaging(paging);
SearchResultList<PrismObject<ShadowType>> searchResultList = doSearch(TEST_NAME, query, 50, task, result);
assertConnectorOperationIncrement(1, 51);
assertCounterIncrement(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT, 0);
SearchResultMetadata metadata = searchResultList.getMetadata();
if (metadata != null) {
assertFalse(metadata.isPartialResults());
}
assertLdapConnectorInstances(1, 2);
}
| void function() throws Exception { final String TEST_NAME = STR; TestUtil.displayTestTile(this, TEST_NAME); Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME); OperationResult result = task.getResult(); ObjectQuery query = ObjectQueryUtil.createResourceAndObjectClassQuery(getResourceOid(), getAccountObjectClass(), prismContext); ObjectPaging paging = ObjectPaging.createEmptyPaging(); paging.setMaxSize(50); query.setPaging(paging); SearchResultList<PrismObject<ShadowType>> searchResultList = doSearch(TEST_NAME, query, 50, task, result); assertConnectorOperationIncrement(1, 51); assertCounterIncrement(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT, 0); SearchResultMetadata metadata = searchResultList.getMetadata(); if (metadata != null) { assertFalse(metadata.isPartialResults()); } assertLdapConnectorInstances(1, 2); } | /**
* Blocksize is 100, so this is in one block.
*/ | Blocksize is 100, so this is in one block | test152SeachFirst50Accounts | {
"repo_name": "Pardus-Engerek/engerek",
"path": "testing/conntest/src/test/java/com/evolveum/midpoint/testing/conntest/AbstractLdapConnTest.java",
"license": "apache-2.0",
"size": 58840
} | [
"com.evolveum.midpoint.prism.PrismObject",
"com.evolveum.midpoint.prism.query.ObjectPaging",
"com.evolveum.midpoint.prism.query.ObjectQuery",
"com.evolveum.midpoint.schema.SearchResultList",
"com.evolveum.midpoint.schema.SearchResultMetadata",
"com.evolveum.midpoint.schema.internals.InternalCounters",
"com.evolveum.midpoint.schema.result.OperationResult",
"com.evolveum.midpoint.schema.util.ObjectQueryUtil",
"com.evolveum.midpoint.task.api.Task",
"com.evolveum.midpoint.test.util.TestUtil",
"com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType",
"org.testng.AssertJUnit"
] | import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.query.ObjectPaging; import com.evolveum.midpoint.prism.query.ObjectQuery; import com.evolveum.midpoint.schema.SearchResultList; import com.evolveum.midpoint.schema.SearchResultMetadata; import com.evolveum.midpoint.schema.internals.InternalCounters; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectQueryUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import org.testng.AssertJUnit; | import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.query.*; import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.schema.internals.*; import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.schema.util.*; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.test.util.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import org.testng.*; | [
"com.evolveum.midpoint",
"org.testng"
] | com.evolveum.midpoint; org.testng; | 1,774,563 |
@Test
public void embeddedId() throws Exception {
scanClasses(JpaEntity.class);
assertThat(applyConcept("jpa2:EmbeddedId").getStatus(), equalTo(SUCCESS));
store.beginTransaction();
List<Object> members = query("MATCH (e:Jpa:EmbeddedId) RETURN e").getColumn("e");
assertThat(members, hasItem(fieldDescriptor(JpaEntity.class, "id")));
assertThat(members, hasItem(methodDescriptor(JpaEntity.class, "getId")));
store.commitTransaction();
} | void function() throws Exception { scanClasses(JpaEntity.class); assertThat(applyConcept(STR).getStatus(), equalTo(SUCCESS)); store.beginTransaction(); List<Object> members = query(STR).getColumn("e"); assertThat(members, hasItem(fieldDescriptor(JpaEntity.class, "id"))); assertThat(members, hasItem(methodDescriptor(JpaEntity.class, "getId"))); store.commitTransaction(); } | /**
* Verifies the concept "jpa2:EmbeddedId".
*
* @throws java.io.IOException
* If the test fails.
* @throws com.buschmais.jqassistant.core.analysis.api.AnalysisException
* If the test fails.
*/ | Verifies the concept "jpa2:EmbeddedId" | embeddedId | {
"repo_name": "SMB-TEC/jqassistant",
"path": "plugin/jpa2/src/test/java/com/buschmais/jqassistant/plugin/jpa2/test/Jpa2IT.java",
"license": "gpl-3.0",
"size": 13386
} | [
"com.buschmais.jqassistant.plugin.jpa2.test.set.entity.JpaEntity",
"java.util.List",
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] | import com.buschmais.jqassistant.plugin.jpa2.test.set.entity.JpaEntity; import java.util.List; import org.hamcrest.CoreMatchers; import org.junit.Assert; | import com.buschmais.jqassistant.plugin.jpa2.test.set.entity.*; import java.util.*; import org.hamcrest.*; import org.junit.*; | [
"com.buschmais.jqassistant",
"java.util",
"org.hamcrest",
"org.junit"
] | com.buschmais.jqassistant; java.util; org.hamcrest; org.junit; | 1,200,959 |
public static void writeObjectToStream(OutputStream stream, Object target) throws IOException {
ObjectOutputStream oos = new ObjectOutputStream(stream);
oos.writeObject(target);
oos.flush();
IOHelper.close(oos);
} | static void function(OutputStream stream, Object target) throws IOException { ObjectOutputStream oos = new ObjectOutputStream(stream); oos.writeObject(target); oos.flush(); IOHelper.close(oos); } | /**
* Writes the given object as response body to the output stream
*
* @param stream output stream
* @param target object to write
* @throws IOException is thrown if error writing
*/ | Writes the given object as response body to the output stream | writeObjectToStream | {
"repo_name": "NetNow/camel",
"path": "components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java",
"license": "apache-2.0",
"size": 20115
} | [
"java.io.IOException",
"java.io.ObjectOutputStream",
"java.io.OutputStream",
"org.apache.camel.util.IOHelper"
] | import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream; import org.apache.camel.util.IOHelper; | import java.io.*; import org.apache.camel.util.*; | [
"java.io",
"org.apache.camel"
] | java.io; org.apache.camel; | 73,549 |
public static Set<String> convertCsvToSet(String s) {
List<String> stringList = convertCsvToList(s);
Set<String> set = new HashSet<String>();
for (String list : stringList) {
set.add(list);
}
return set;
}
| static Set<String> function(String s) { List<String> stringList = convertCsvToList(s); Set<String> set = new HashSet<String>(); for (String list : stringList) { set.add(list); } return set; } | /**
* Converts a comma separated String into a set
* @param s String containing the comma separated values
* @return Set<String> containing the values
*/ | Converts a comma separated String into a set | convertCsvToSet | {
"repo_name": "rupakc/jOMDB",
"path": "jOMDB/src/main/java/org/jomdb/utils/CommonUtils.java",
"license": "mit",
"size": 6226
} | [
"java.util.HashSet",
"java.util.List",
"java.util.Set"
] | import java.util.HashSet; import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 925,432 |
public static ByteBuffer getData(String itemPath) {
return getData(null, null, itemPath, false);
} | static ByteBuffer function(String itemPath) { return getData(null, null, itemPath, false); } | /**
* Loads an ICU binary data file and returns it as a ByteBuffer.
* The buffer contents is normally read-only, but its position etc. can be modified.
*
* @param itemPath Relative ICU data item path, for example "root.res" or "coll/ucadata.icu".
* @return The data as a read-only ByteBuffer,
* or null if the resource could not be found.
*/ | Loads an ICU binary data file and returns it as a ByteBuffer. The buffer contents is normally read-only, but its position etc. can be modified | getData | {
"repo_name": "andreynovikov/maptrek",
"path": "app/src/main/java/com/ibm/icu/impl/ICUBinary.java",
"license": "gpl-3.0",
"size": 31121
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 2,423,382 |
public static DataNode instantiateDataNode(String args[],
Configuration conf,
SecureResources resources) throws IOException {
if (conf == null)
conf = new Configuration();
if (!parseArguments(args, conf)) {
printUsage();
return null;
}
if (conf.get("dfs.network.script") != null) {
LOG.error("This configuration for rack identification is not supported" +
" anymore. RackID resolution is handled by the NameNode.");
System.exit(-1);
}
String[] dataDirs = conf.getTrimmedStrings(DATA_DIR_KEY);
dnThreadName = "DataNode: [" +
StringUtils.arrayToString(dataDirs) + "]";
return makeInstance(dataDirs, conf, resources);
} | static DataNode function(String args[], Configuration conf, SecureResources resources) throws IOException { if (conf == null) conf = new Configuration(); if (!parseArguments(args, conf)) { printUsage(); return null; } if (conf.get(STR) != null) { LOG.error(STR + STR); System.exit(-1); } String[] dataDirs = conf.getTrimmedStrings(DATA_DIR_KEY); dnThreadName = STR + StringUtils.arrayToString(dataDirs) + "]"; return makeInstance(dataDirs, conf, resources); } | /** Instantiate a single datanode object. This must be run by invoking
* {@link DataNode#runDatanodeDaemon(DataNode)} subsequently.
* @param resources Secure resources needed to run under Kerberos
*/ | Instantiate a single datanode object. This must be run by invoking <code>DataNode#runDatanodeDaemon(DataNode)</code> subsequently | instantiateDataNode | {
"repo_name": "YuMatsuzawa/HadoopEclipseProject",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java",
"license": "apache-2.0",
"size": 85752
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter",
"org.apache.hadoop.util.StringUtils"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.server.datanode.SecureDataNodeStarter; import org.apache.hadoop.util.StringUtils; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.server.datanode.*; import org.apache.hadoop.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 415,126 |
public DerInputStream subStream(int len, boolean do_skip)
throws IOException {
DerInputBuffer newbuf = buffer.dup();
newbuf.truncate(len);
if (do_skip) {
buffer.skip(len);
}
return new DerInputStream(newbuf);
} | DerInputStream function(int len, boolean do_skip) throws IOException { DerInputBuffer newbuf = buffer.dup(); newbuf.truncate(len); if (do_skip) { buffer.skip(len); } return new DerInputStream(newbuf); } | /**
* Creates a new DER input stream from part of this input stream.
*
* @param len how long a chunk of the current input stream to use,
* starting at the current position.
* @param do_skip true if the existing data in the input stream should
* be skipped. If this value is false, the next data read
* on this stream and the newly created stream will be the
* same.
*/ | Creates a new DER input stream from part of this input stream | subStream | {
"repo_name": "google/desugar_jdk_libs",
"path": "jdk11/src/libcore/ojluni/src/main/java/sun/security/util/DerInputStream.java",
"license": "gpl-2.0",
"size": 24599
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,352,546 |
public void initFromArtInfo(final AlboFlaecheSearch.ArtInfo artInfo) {
this.bean = new Bean();
if (artInfo != null) {
new SwingWorker<CidsBean, Void>() { | void function(final AlboFlaecheSearch.ArtInfo artInfo) { this.bean = new Bean(); if (artInfo != null) { new SwingWorker<CidsBean, Void>() { | /**
* DOCUMENT ME!
*
* @param artInfo DOCUMENT ME!
*/ | DOCUMENT ME | initFromArtInfo | {
"repo_name": "cismet/cids-custom-wuppertal",
"path": "src/main/java/de/cismet/cids/custom/wunda_blau/AlboFlaecheArtSearchPanel.java",
"license": "lgpl-3.0",
"size": 48944
} | [
"de.cismet.cids.custom.wunda_blau.search.server.AlboFlaecheSearch",
"de.cismet.cids.dynamics.CidsBean",
"javax.swing.SwingWorker"
] | import de.cismet.cids.custom.wunda_blau.search.server.AlboFlaecheSearch; import de.cismet.cids.dynamics.CidsBean; import javax.swing.SwingWorker; | import de.cismet.cids.custom.wunda_blau.search.server.*; import de.cismet.cids.dynamics.*; import javax.swing.*; | [
"de.cismet.cids",
"javax.swing"
] | de.cismet.cids; javax.swing; | 2,514,197 |
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context); | @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String virtualHubName, String routeTableName, Context context); | /**
* Deletes a VirtualHubRouteTableV2.
*
* @param resourceGroupName The resource group name of the VirtualHubRouteTableV2.
* @param virtualHubName The name of the VirtualHub.
* @param routeTableName The name of the VirtualHubRouteTableV2.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.network.models.ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/ | Deletes a VirtualHubRouteTableV2 | delete | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VirtualHubRouteTableV2SClient.java",
"license": "mit",
"size": 19901
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; | import com.azure.core.annotation.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 393,197 |
@Override
public void onResume() {
super.onResume();
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} | void function() { super.onResume(); getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } | /**
* Overrides the <code>Fragment.onResume()</code> method of
* the Android API.
*
* Called when the activity will start interacting with the user.
*/ | Overrides the <code>Fragment.onResume()</code> method of the Android API. Called when the activity will start interacting with the user | onResume | {
"repo_name": "montimaj/Remouse",
"path": "app/src/main/java/project/android/MouseFragment.java",
"license": "gpl-3.0",
"size": 8625
} | [
"android.content.pm.ActivityInfo"
] | import android.content.pm.ActivityInfo; | import android.content.pm.*; | [
"android.content"
] | android.content; | 617,424 |
@Test
public void testLs() throws IOException {
String cwdPrefix = IO.absolutePath(new File("")) + "/";
Predicate<String> absolute = s -> s.startsWith(cwdPrefix);
try (Processor p = new Processor()) {
Macro macro = p.getReplacer();
List<String> a = Strings.split(macro.process("${lsr;test/test;*.java}"));
assertThat(a).contains("MacroTest.java", "ManifestTest.java")
.doesNotContain("bnd.info", "com.acme")
.noneMatch(absolute);
List<String> b = Strings.split(macro.process("${lsr;test/test}"));
assertThat(b).contains("MacroTest.java", "ManifestTest.java", "bnd.info", "com.acme")
.noneMatch(absolute);
List<String> c = Strings.split(macro.process("${lsa;test/test;*.java}"));
assertThat(c)
.contains(IO.absolutePath(new File("test/test/MacroTest.java")),
IO.absolutePath(new File("test/test/ManifestTest.java")))
.doesNotContain(IO.absolutePath(new File("test/test/bnd.info")),
IO.absolutePath(new File("test/test/com.acme")))
.allMatch(absolute);
List<String> d = Strings.split(macro.process("${lsa;test/test}"));
assertThat(d)
.contains(IO.absolutePath(new File("test/test/MacroTest.java")),
IO.absolutePath(new File("test/test/ManifestTest.java")),
IO.absolutePath(new File("test/test/bnd.info")), IO.absolutePath(new File("test/test/com.acme")))
.allMatch(absolute);
}
} | void function() throws IOException { String cwdPrefix = IO.absolutePath(new File(STR/STR${lsr;test/test;*.java}STRMacroTest.javaSTRManifestTest.javaSTRbnd.infoSTRcom.acmeSTR${lsr;test/test}STRMacroTest.javaSTRManifestTest.javaSTRbnd.infoSTRcom.acmeSTR${lsa;test/test;*.java}STRtest/test/MacroTest.javaSTRtest/test/ManifestTest.javaSTRtest/test/bnd.infoSTRtest/test/com.acmeSTR${lsa;test/test}STRtest/test/MacroTest.javaSTRtest/test/ManifestTest.javaSTRtest/test/bnd.infoSTRtest/test/com.acme"))) .allMatch(absolute); } } | /**
* Test the lsa/lsr macros
*/ | Test the lsa/lsr macros | testLs | {
"repo_name": "psoreide/bnd",
"path": "biz.aQute.bndlib.tests/test/test/MacroTest.java",
"license": "apache-2.0",
"size": 62632
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,811,216 |
public int generateAlertHashCode(@NonNull AlertParams params) {
int hashCode = 0;
String title = params.getTitle();
hashCode += title != null ? title.hashCode() : 0;
SparseArray<String> textMap = params.getTextMap();
for (int i = 0; i < textMap.size(); i++) {
String text = textMap.valueAt(i);
hashCode += text.hashCode();
}
List<Button> buttonList = params.getButtons();
for (Button button : buttonList) {
hashCode += button.hashCode();
}
Button closeButton = params.getCloseButton();
hashCode += closeButton != null ? closeButton.hashCode() : 0;
hashCode += params.getType().ordinal();
hashCode += params.getState() != null ? params.getState() : 0;
return hashCode;
} | int function(@NonNull AlertParams params) { int hashCode = 0; String title = params.getTitle(); hashCode += title != null ? title.hashCode() : 0; SparseArray<String> textMap = params.getTextMap(); for (int i = 0; i < textMap.size(); i++) { String text = textMap.valueAt(i); hashCode += text.hashCode(); } List<Button> buttonList = params.getButtons(); for (Button button : buttonList) { hashCode += button.hashCode(); } Button closeButton = params.getCloseButton(); hashCode += closeButton != null ? closeButton.hashCode() : 0; hashCode += params.getType().ordinal(); hashCode += params.getState() != null ? params.getState() : 0; return hashCode; } | /**
* Generates and returns a hashcode for the given alert params object. The hashcode is generated
* by using the given title, text elements, attached buttons, close button, type and state.
*
* @param params params object which is used to generate the hashcode
* @return an Int
* @since 1.0.0
*/ | Generates and returns a hashcode for the given alert params object. The hashcode is generated by using the given title, text elements, attached buttons, close button, type and state | generateAlertHashCode | {
"repo_name": "Mordag/hitogo",
"path": "core/src/main/java/org/hitogo/core/HitogoHelper.java",
"license": "apache-2.0",
"size": 3176
} | [
"android.util.SparseArray",
"androidx.annotation.NonNull",
"java.util.List",
"org.hitogo.alert.core.AlertParams",
"org.hitogo.button.core.Button"
] | import android.util.SparseArray; import androidx.annotation.NonNull; import java.util.List; import org.hitogo.alert.core.AlertParams; import org.hitogo.button.core.Button; | import android.util.*; import androidx.annotation.*; import java.util.*; import org.hitogo.alert.core.*; import org.hitogo.button.core.*; | [
"android.util",
"androidx.annotation",
"java.util",
"org.hitogo.alert",
"org.hitogo.button"
] | android.util; androidx.annotation; java.util; org.hitogo.alert; org.hitogo.button; | 243,776 |
public void writeToFile() throws IOException {
FileOutputStream fos = new FileOutputStream(new File(this.hashFunctionFile));
store(fos);
fos.close();
} | void function() throws IOException { FileOutputStream fos = new FileOutputStream(new File(this.hashFunctionFile)); store(fos); fos.close(); } | /**
* Writes the hash function, represented as tuples (range, filename) into the file that is linked with the
* HashFunction. The content of the file is overwritten.
*
* @throws IOException
*/ | Writes the hash function, represented as tuples (range, filename) into the file that is linked with the HashFunction. The content of the file is overwritten | writeToFile | {
"repo_name": "mgledi/DRUMS",
"path": "src/main/java/com/unister/semweb/drums/bucket/hashfunction/RangeHashFunction.java",
"license": "gpl-2.0",
"size": 16163
} | [
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException"
] | import java.io.File; import java.io.FileOutputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,390,400 |
public ImmutableDict serializeFrom(final JSONObject aFrom)
throws Exception {
Iterator<String> it = aFrom.keys();
List<Map.Entry<String, Atom>> entryList =
new ArrayList<Map.Entry<String, Atom>>();
while (it.hasNext()) {
String key = it.next();
Object value = aFrom.get(key);
if (value instanceof Boolean) {
Boolean booleanValue = (Boolean) value;
entryList.add(new Pair<String, Atom>(key,
BoolAtom.newAtom(booleanValue)));
}
else if (value instanceof JSONArray) {
ImmutableList list = serializeFromList((JSONArray) value);
entryList.add(new Pair<String, Atom>(key, list));
}
else if (value instanceof JSONObject) {
ImmutableDict dictionary = serializeFrom((JSONObject) value);
entryList.add(new Pair<String, Atom>(key, dictionary));
}
else if (value instanceof Number) {
Number numberValue = (Number) value;
if (value instanceof Integer) {
entryList.add(new Pair<String, Atom>(key,
IntAtom.newAtom(numberValue.intValue())));
}
else {
entryList.add(new Pair<String, Atom>(key,
RealAtom.newAtom(numberValue.doubleValue())));
}
}
else if (value instanceof String) {
String stringValue = (String) value;
entryList.add(new Pair<String, Atom>(key,
StringAtom.newAtom(stringValue)));
}
}
ImmutableDict dict = ImmutableDict.newAtom(entryList);
return dict;
} | ImmutableDict function(final JSONObject aFrom) throws Exception { Iterator<String> it = aFrom.keys(); List<Map.Entry<String, Atom>> entryList = new ArrayList<Map.Entry<String, Atom>>(); while (it.hasNext()) { String key = it.next(); Object value = aFrom.get(key); if (value instanceof Boolean) { Boolean booleanValue = (Boolean) value; entryList.add(new Pair<String, Atom>(key, BoolAtom.newAtom(booleanValue))); } else if (value instanceof JSONArray) { ImmutableList list = serializeFromList((JSONArray) value); entryList.add(new Pair<String, Atom>(key, list)); } else if (value instanceof JSONObject) { ImmutableDict dictionary = serializeFrom((JSONObject) value); entryList.add(new Pair<String, Atom>(key, dictionary)); } else if (value instanceof Number) { Number numberValue = (Number) value; if (value instanceof Integer) { entryList.add(new Pair<String, Atom>(key, IntAtom.newAtom(numberValue.intValue()))); } else { entryList.add(new Pair<String, Atom>(key, RealAtom.newAtom(numberValue.doubleValue()))); } } else if (value instanceof String) { String stringValue = (String) value; entryList.add(new Pair<String, Atom>(key, StringAtom.newAtom(stringValue))); } } ImmutableDict dict = ImmutableDict.newAtom(entryList); return dict; } | /**
* This method converts the given JSONObject into a dictionary object
* containing the same data.
* @param aFrom The JSONObject to serialize data from.
* @return A Dictionary containing the same data as the JSONObject.
* @throws Exception If a serialization problem occurs, this method
* throws an exception.
*/ | This method converts the given JSONObject into a dictionary object containing the same data | serializeFrom | {
"repo_name": "jarney/snackbot",
"path": "src/main/java/org/ensor/data/atom/json/JSONSerializer.java",
"license": "mit",
"size": 10801
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"org.ensor.data.atom.Atom",
"org.ensor.data.atom.BoolAtom",
"org.ensor.data.atom.ImmutableDict",
"org.ensor.data.atom.ImmutableList",
"org.ensor.data.atom.IntAtom",
"org.ensor.data.atom.Pair",
"org.ensor.data.atom.RealAtom",
"org.ensor.data.atom.StringAtom",
"org.json.JSONArray",
"org.json.JSONObject"
] | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import org.ensor.data.atom.Atom; import org.ensor.data.atom.BoolAtom; import org.ensor.data.atom.ImmutableDict; import org.ensor.data.atom.ImmutableList; import org.ensor.data.atom.IntAtom; import org.ensor.data.atom.Pair; import org.ensor.data.atom.RealAtom; import org.ensor.data.atom.StringAtom; import org.json.JSONArray; import org.json.JSONObject; | import java.util.*; import org.ensor.data.atom.*; import org.json.*; | [
"java.util",
"org.ensor.data",
"org.json"
] | java.util; org.ensor.data; org.json; | 1,044,146 |
public ExpressRouteCrossConnectionInner withServiceProviderProvisioningState(ServiceProviderProvisioningState serviceProviderProvisioningState) {
this.serviceProviderProvisioningState = serviceProviderProvisioningState;
return this;
} | ExpressRouteCrossConnectionInner function(ServiceProviderProvisioningState serviceProviderProvisioningState) { this.serviceProviderProvisioningState = serviceProviderProvisioningState; return this; } | /**
* Set the provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'.
*
* @param serviceProviderProvisioningState the serviceProviderProvisioningState value to set
* @return the ExpressRouteCrossConnectionInner object itself.
*/ | Set the provisioning state of the circuit in the connectivity provider system. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' | withServiceProviderProvisioningState | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/network/v2019_06_01/implementation/ExpressRouteCrossConnectionInner.java",
"license": "mit",
"size": 8594
} | [
"com.microsoft.azure.management.network.v2019_06_01.ServiceProviderProvisioningState"
] | import com.microsoft.azure.management.network.v2019_06_01.ServiceProviderProvisioningState; | import com.microsoft.azure.management.network.v2019_06_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,343,535 |
@SuppressWarnings("deprecation")
public void setStatusBarTintDrawable(Drawable drawable) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundDrawable(drawable);
}
} | @SuppressWarnings(STR) void function(Drawable drawable) { if (mStatusBarAvailable) { mStatusBarTintView.setBackgroundDrawable(drawable); } } | /**
* Apply the specified drawable to the system status bar.
*
* @param drawable The drawable to use as the background, or null to remove it.
*/ | Apply the specified drawable to the system status bar | setStatusBarTintDrawable | {
"repo_name": "msaadq/AerO2",
"path": "AerO2_Android/app/src/main/java/com/aero2/android/DefaultClasses/SystemBarTintManager.java",
"license": "gpl-2.0",
"size": 19438
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 2,105,726 |
public static boolean validatePassword(String pass) {
Matcher match = pattern.matcher(pass);
return match.matches();
} | static boolean function(String pass) { Matcher match = pattern.matcher(pass); return match.matches(); } | /**
* Validate password. The password must follow the following structure:
* Minimum length: 8 Must contain at least: 1 upper case 1 lower case 1
* number 1 special character
*
* @param pass the pass
* @return true, if successful
*/ | Validate password. The password must follow the following structure: Minimum length: 8 Must contain at least: 1 upper case 1 lower case 1 number 1 special character | validatePassword | {
"repo_name": "DDoS/Bomberman",
"path": "src/main/java/ecse321/fall2014/group3/bomberman/App.java",
"license": "mit",
"size": 7210
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,459,937 |
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, displayMetrics);
} | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dip, displayMetrics); } | /**
* Convert a value from dip to pixel.
*
* @param displayMetrics the {@link android.util.DisplayMetrics} used to convert.
* @param dip the value in dip to convert.
* @return a value in pixel.
*/ | Convert a value from dip to pixel | dipToPx | {
"repo_name": "0359xiaodong/CameraColorPicker",
"path": "CameraColorPicker/app/src/main/java/fr/tvbarthel/apps/cameracolorpicker/utils/Views.java",
"license": "apache-2.0",
"size": 678
} | [
"android.util.TypedValue"
] | import android.util.TypedValue; | import android.util.*; | [
"android.util"
] | android.util; | 2,785,980 |
public NClob getNClob(int columnIndex) throws SQLException {
String fieldEncoding = this.fields[columnIndex - 1].getCharacterSet();
if (fieldEncoding == null || !fieldEncoding.equals("UTF-8")) {
throw new SQLException(
"Can not call getNClob() when field's charset isn't UTF-8");
}
if (!this.isBinaryEncoded) {
String asString = getStringForNClob(columnIndex);
if (asString == null) {
return null;
}
return new com.mysql.jdbc.JDBC4NClob(asString, getExceptionInterceptor());
}
return getNativeNClob(columnIndex);
}
| NClob function(int columnIndex) throws SQLException { String fieldEncoding = this.fields[columnIndex - 1].getCharacterSet(); if (fieldEncoding == null !fieldEncoding.equals("UTF-8")) { throw new SQLException( STR); } if (!this.isBinaryEncoded) { String asString = getStringForNClob(columnIndex); if (asString == null) { return null; } return new com.mysql.jdbc.JDBC4NClob(asString, getExceptionInterceptor()); } return getNativeNClob(columnIndex); } | /**
* JDBC 4.0 Get a NCLOB column.
*
* @param i the first column is 1, the second is 2, ...
*
* @return an object representing a NCLOB
*
* @throws SQLException if an error occurs
*/ | JDBC 4.0 Get a NCLOB column | getNClob | {
"repo_name": "devoof/jPrinterAdmin",
"path": "mysql-connector-java-5.1.23/src/com/mysql/jdbc/JDBC4UpdatableResultSet.java",
"license": "gpl-2.0",
"size": 21430
} | [
"java.sql.NClob",
"java.sql.SQLException"
] | import java.sql.NClob; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,741,768 |
@Override
public long spill(long size, MemoryConsumer trigger) throws IOException {
if (trigger != this || inMemSorter == null || inMemSorter.numRecords() == 0) {
return 0L;
}
logger.info("Thread {} spilling sort data of {} to disk ({} {} so far)",
Thread.currentThread().getId(),
Utils.bytesToString(getMemoryUsage()),
spills.size(),
spills.size() > 1 ? " times" : " time");
writeSortedFile(false);
final long spillSize = freeMemory();
inMemSorter.reset();
// Reset the in-memory sorter's pointer array only after freeing up the memory pages holding the
// records. Otherwise, if the task is over allocated memory, then without freeing the memory
// pages, we might not be able to get memory for the pointer array.
taskContext.taskMetrics().incMemoryBytesSpilled(spillSize);
return spillSize;
} | long function(long size, MemoryConsumer trigger) throws IOException { if (trigger != this inMemSorter == null inMemSorter.numRecords() == 0) { return 0L; } logger.info(STR, Thread.currentThread().getId(), Utils.bytesToString(getMemoryUsage()), spills.size(), spills.size() > 1 ? STR : STR); writeSortedFile(false); final long spillSize = freeMemory(); inMemSorter.reset(); taskContext.taskMetrics().incMemoryBytesSpilled(spillSize); return spillSize; } | /**
* Sort and spill the current records in response to memory pressure.
*/ | Sort and spill the current records in response to memory pressure | spill | {
"repo_name": "michalsenkyr/spark",
"path": "core/src/main/java/org/apache/spark/shuffle/sort/ShuffleExternalSorter.java",
"license": "apache-2.0",
"size": 17926
} | [
"java.io.IOException",
"org.apache.spark.memory.MemoryConsumer",
"org.apache.spark.util.Utils"
] | import java.io.IOException; import org.apache.spark.memory.MemoryConsumer; import org.apache.spark.util.Utils; | import java.io.*; import org.apache.spark.memory.*; import org.apache.spark.util.*; | [
"java.io",
"org.apache.spark"
] | java.io; org.apache.spark; | 1,373,732 |
public static boolean isYesterday(Calendar cal) {
Calendar yesterday = adjustDate(Calendar.getInstance(), -1);
return yesterday.get(Calendar.YEAR) == cal.get(Calendar.YEAR) && yesterday.get(Calendar.DAY_OF_YEAR) == cal.get(Calendar.DAY_OF_YEAR);
} | static boolean function(Calendar cal) { Calendar yesterday = adjustDate(Calendar.getInstance(), -1); return yesterday.get(Calendar.YEAR) == cal.get(Calendar.YEAR) && yesterday.get(Calendar.DAY_OF_YEAR) == cal.get(Calendar.DAY_OF_YEAR); } | /**
* Checks if the calendar object is same date as yesterday.
*
* @param cal the calendar object
* @return true if the calendar object is the same date as yesterday.
*/ | Checks if the calendar object is same date as yesterday | isYesterday | {
"repo_name": "clementvillanueva/SimpleHDR",
"path": "src/com/jidesoft/utils/DateUtils.java",
"license": "gpl-3.0",
"size": 15914
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 484,860 |
public void testEmptyCommentIsProhitibed() throws Throwable {
View createMenu = view(R.id.m_apply);
assertFalse(createMenu.isEnabled());
final EditText comment = editText(R.id.et_comment);
focus(comment);
send("a");
assertTrue(createMenu.isEnabled());
sendKeys(KEYCODE_DEL);
assertFalse(createMenu.isEnabled());
} | void function() throws Throwable { View createMenu = view(R.id.m_apply); assertFalse(createMenu.isEnabled()); final EditText comment = editText(R.id.et_comment); focus(comment); send("a"); assertTrue(createMenu.isEnabled()); sendKeys(KEYCODE_DEL); assertFalse(createMenu.isEnabled()); } | /**
* Verify empty comment can't be created
*
* @throws Throwable
*/ | Verify empty comment can't be created | testEmptyCommentIsProhitibed | {
"repo_name": "DeLaSalleUniversity-Manila/forkhub-Janelaaa",
"path": "app/src/androidTest/java/com/janela/mobile/tests/commit/CreateCommentActivityTest.java",
"license": "apache-2.0",
"size": 2013
} | [
"android.view.View",
"android.widget.EditText"
] | import android.view.View; import android.widget.EditText; | import android.view.*; import android.widget.*; | [
"android.view",
"android.widget"
] | android.view; android.widget; | 1,264,659 |
protected FinishApplicationMasterResponse finishApplicationMaster(
final int appId, final FinalApplicationStatus status)
throws Exception, YarnException, IOException {
final ApplicationUserInfo ugi = getApplicationUserInfo(appId); | FinishApplicationMasterResponse function( final int appId, final FinalApplicationStatus status) throws Exception, YarnException, IOException { final ApplicationUserInfo ugi = getApplicationUserInfo(appId); | /**
* Unregisters the application master for specified application id
*
* @param appId
* @param status
* @return
* @throws Exception
* @throws YarnException
* @throws IOException
*/ | Unregisters the application master for specified application id | finishApplicationMaster | {
"repo_name": "leechoongyon/HadoopSourceAnalyze",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/amrmproxy/BaseAMRMProxyTest.java",
"license": "apache-2.0",
"size": 23196
} | [
"java.io.IOException",
"org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse",
"org.apache.hadoop.yarn.api.records.FinalApplicationStatus",
"org.apache.hadoop.yarn.exceptions.YarnException"
] | import java.io.IOException; import org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse; import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.exceptions.YarnException; | import java.io.*; import org.apache.hadoop.yarn.api.protocolrecords.*; import org.apache.hadoop.yarn.api.records.*; import org.apache.hadoop.yarn.exceptions.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,816,256 |
public static List<ContentSourceFilter> lookupContentSourceFiltersById(Long id) {
Map params = new HashMap();
params.put("source_id", id);
return singleton.listObjectsByNamedQuery(
"ContentSourceFilter.findBySourceId", params);
} | static List<ContentSourceFilter> function(Long id) { Map params = new HashMap(); params.put(STR, id); return singleton.listObjectsByNamedQuery( STR, params); } | /**
* Lookup a content source's filters by id
* @param id source id
* @return the ContentSourceFilters
*/ | Lookup a content source's filters by id | lookupContentSourceFiltersById | {
"repo_name": "dmacvicar/spacewalk",
"path": "java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java",
"license": "gpl-2.0",
"size": 41646
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map"
] | import java.util.HashMap; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,514,979 |
public void setSize(int size) {
if (size != MaterialProgressDrawable.LARGE && size != MaterialProgressDrawable.DEFAULT) {
return;
}
final DisplayMetrics metrics = getResources().getDisplayMetrics();
if (size == MaterialProgressDrawable.LARGE) {
mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER_LARGE * metrics.density);
} else {
mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density);
}
// force the bounds of the progress circle inside the circle view to
// update by setting it to null before updating its size and then
// re-setting it
mCircleView.setImageDrawable(null);
mProgress.updateSizes(size);
mCircleView.setImageDrawable(mProgress);
}
public SwipeRefreshLayout(Context context) {
this(context, null);
}
public SwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMediumAnimationDuration = getResources().getInteger(
android.R.integer.config_mediumAnimTime);
setWillNotDraw(false);
mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
setEnabled(a.getBoolean(0, true));
a.recycle();
final TypedArray a2 = context.obtainStyledAttributes(attrs, R.styleable.SwipeRefreshLayout);
SwipeMode mode
= SwipeMode.getFromInt(a2.getInt(R.styleable.SwipeRefreshLayout_mode, 0));
if (mode != SwipeMode.BOTH) {
mDirection = mode;
mBothDirection = false;
} else {
mDirection = SwipeMode.TOP;
mBothDirection = true;
}
a2.recycle();
final DisplayMetrics metrics = getResources().getDisplayMetrics();
mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density);
mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density);
createProgressView();
ViewCompat.setChildrenDrawingOrderEnabled(this, true);
// the absolute offset has to take into account that the circle starts at an offset
mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density;
} | void function(int size) { if (size != MaterialProgressDrawable.LARGE && size != MaterialProgressDrawable.DEFAULT) { return; } final DisplayMetrics metrics = getResources().getDisplayMetrics(); if (size == MaterialProgressDrawable.LARGE) { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER_LARGE * metrics.density); } else { mCircleHeight = mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); } mCircleView.setImageDrawable(null); mProgress.updateSizes(size); mCircleView.setImageDrawable(mProgress); } public SwipeRefreshLayout(Context context) { this(context, null); } public SwipeRefreshLayout(Context context, AttributeSet attrs) { super(context, attrs); mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); mMediumAnimationDuration = getResources().getInteger( android.R.integer.config_mediumAnimTime); setWillNotDraw(false); mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR); final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS); setEnabled(a.getBoolean(0, true)); a.recycle(); final TypedArray a2 = context.obtainStyledAttributes(attrs, R.styleable.SwipeRefreshLayout); SwipeMode mode = SwipeMode.getFromInt(a2.getInt(R.styleable.SwipeRefreshLayout_mode, 0)); if (mode != SwipeMode.BOTH) { mDirection = mode; mBothDirection = false; } else { mDirection = SwipeMode.TOP; mBothDirection = true; } a2.recycle(); final DisplayMetrics metrics = getResources().getDisplayMetrics(); mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density); mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density); createProgressView(); ViewCompat.setChildrenDrawingOrderEnabled(this, true); mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density; } | /**
* One of DEFAULT, or LARGE.
*/ | One of DEFAULT, or LARGE | setSize | {
"repo_name": "oeager/BaisinceManager",
"path": "bison/src/main/java/com/bison/app/ui/refresh/SwipeRefreshLayout.java",
"license": "apache-2.0",
"size": 44593
} | [
"android.content.Context",
"android.content.res.TypedArray",
"android.support.v4.view.ViewCompat",
"android.util.AttributeSet",
"android.util.DisplayMetrics",
"android.view.ViewConfiguration",
"android.view.animation.DecelerateInterpolator"
] | import android.content.Context; import android.content.res.TypedArray; import android.support.v4.view.ViewCompat; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.ViewConfiguration; import android.view.animation.DecelerateInterpolator; | import android.content.*; import android.content.res.*; import android.support.v4.view.*; import android.util.*; import android.view.*; import android.view.animation.*; | [
"android.content",
"android.support",
"android.util",
"android.view"
] | android.content; android.support; android.util; android.view; | 225,972 |
public String firstMatch(String pattern, int group) {
Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr);
Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout);
if (stderrMatcher.find()) {
return stderrMatcher.group(group);
}
if (stdoutMatcher.find()) {
return stdoutMatcher.group(group);
}
return null;
} | String function(String pattern, int group) { Matcher stderrMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stderr); Matcher stdoutMatcher = Pattern.compile(pattern, Pattern.MULTILINE).matcher(stdout); if (stderrMatcher.find()) { return stderrMatcher.group(group); } if (stdoutMatcher.find()) { return stdoutMatcher.group(group); } return null; } | /**
* Get the captured group of the first string matching the pattern.
* stderr is searched before stdout.
*
* @param pattern The multi-line pattern to match
* @param group The group to capture
* @return The matched string or null if no match was found
*/ | Get the captured group of the first string matching the pattern. stderr is searched before stdout | firstMatch | {
"repo_name": "gaoxiaojun/dync",
"path": "test/testlibrary/jdk/test/lib/OutputAnalyzer.java",
"license": "gpl-2.0",
"size": 13470
} | [
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import java.util.regex.Matcher; import java.util.regex.Pattern; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,459,119 |
@Override
public int hashCode() {
return Arrays.hashCode(standardTransitions) ^
Arrays.hashCode(standardOffsets) ^
Arrays.hashCode(savingsInstantTransitions) ^
Arrays.hashCode(wallOffsets) ^
Arrays.hashCode(lastRules);
} | int function() { return Arrays.hashCode(standardTransitions) ^ Arrays.hashCode(standardOffsets) ^ Arrays.hashCode(savingsInstantTransitions) ^ Arrays.hashCode(wallOffsets) ^ Arrays.hashCode(lastRules); } | /**
* Returns a suitable hash code given the definition of {@code #equals}.
*
* @return the hash code
*/ | Returns a suitable hash code given the definition of #equals | hashCode | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/java/time/zone/ZoneRules.java",
"license": "apache-2.0",
"size": 43366
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,471,736 |
if (value != null && value instanceof Integer)
return new ValidationResult.ValidationPassed();
else
return new ValidationResult.ValidationFailed("Value \"" + value + "\" is not a valid number!");
} | if (value != null && value instanceof Integer) return new ValidationResult.ValidationPassed(); else return new ValidationResult.ValidationFailed(STRSTR\STR); } | /**
* Validates: Object is not null and of type Integer.
*
*
* @param value The object to check
* @return validation result
*/ | Validates: Object is not null and of type Integer | validate | {
"repo_name": "Graylog2/graylog2-server",
"path": "graylog2-server/src/main/java/org/graylog2/database/validators/IntegerValidator.java",
"license": "gpl-3.0",
"size": 1389
} | [
"org.graylog2.plugin.database.validators.ValidationResult"
] | import org.graylog2.plugin.database.validators.ValidationResult; | import org.graylog2.plugin.database.validators.*; | [
"org.graylog2.plugin"
] | org.graylog2.plugin; | 236,702 |
public CmsObject getCms() {
return m_cms;
} | CmsObject function() { return m_cms; } | /**
* Returns the cms.<p>
*
* @return the cms
*/ | Returns the cms | getCms | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/jsp/decorator/CmsDecoratorConfiguration.java",
"license": "lgpl-2.1",
"size": 16013
} | [
"org.opencms.file.CmsObject"
] | import org.opencms.file.CmsObject; | import org.opencms.file.*; | [
"org.opencms.file"
] | org.opencms.file; | 2,352,626 |
public void testGetTags() {
Set<String> tags = null;
tags = entityBroker.getTags(TestData.REF1);
assertNotNull(tags);
assertEquals(2, tags.size());
assertTrue(tags.contains("test"));
assertTrue(tags.contains("aaronz"));
tags = entityBroker.getTags(TestData.REF1_1);
assertNotNull(tags);
assertEquals(0, tags.size());
} | void function() { Set<String> tags = null; tags = entityBroker.getTags(TestData.REF1); assertNotNull(tags); assertEquals(2, tags.size()); assertTrue(tags.contains("test")); assertTrue(tags.contains(STR)); tags = entityBroker.getTags(TestData.REF1_1); assertNotNull(tags); assertEquals(0, tags.size()); } | /**
* Test method for {@link org.sakaiproject.entitybroker.impl.EntityBrokerImpl#getTags(java.lang.String)}.
*/ | Test method for <code>org.sakaiproject.entitybroker.impl.EntityBrokerImpl#getTags(java.lang.String)</code> | testGetTags | {
"repo_name": "harfalm/Sakai-10.1",
"path": "entitybroker/impl/src/test/org/sakaiproject/entitybroker/impl/EntityBrokerTransactionalTest.java",
"license": "apache-2.0",
"size": 25232
} | [
"java.util.Set",
"org.sakaiproject.entitybroker.mocks.data.TestData"
] | import java.util.Set; import org.sakaiproject.entitybroker.mocks.data.TestData; | import java.util.*; import org.sakaiproject.entitybroker.mocks.data.*; | [
"java.util",
"org.sakaiproject.entitybroker"
] | java.util; org.sakaiproject.entitybroker; | 2,293,763 |
public void submitJob(com.google.cloud.dataproc.v1.SubmitJobRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.dataproc.v1.Job> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_SUBMIT_JOB, getCallOptions()), request, responseObserver);
} | void function(com.google.cloud.dataproc.v1.SubmitJobRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dataproc.v1.Job> responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_SUBMIT_JOB, getCallOptions()), request, responseObserver); } | /**
* <pre>
* Submits a job to a cluster.
* </pre>
*/ | <code> Submits a job to a cluster. </code> | submitJob | {
"repo_name": "speedycontrol/googleapis",
"path": "output/com/google/cloud/dataproc/v1/JobControllerGrpc.java",
"license": "apache-2.0",
"size": 20203
} | [
"io.grpc.stub.ClientCalls",
"io.grpc.stub.ServerCalls"
] | import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 1,574,138 |
public void dispose() {
if (!disposed) {
disposed = true;
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunchListener(this.launchListener);
} catch (Throwable e1) {
Log.log(e1);
}
if (this.webServer != null) {
try {
this.webServer.shutdown();
} catch (Throwable e) {
//Ignore anything here
}
this.webServer = null;
}
for (IPyUnitServerListener listener : this.listeners) {
listener.notifyDispose();
}
this.listeners.clear();
}
} | void function() { if (!disposed) { disposed = true; try { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchManager.removeLaunchListener(this.launchListener); } catch (Throwable e1) { Log.log(e1); } if (this.webServer != null) { try { this.webServer.shutdown(); } catch (Throwable e) { } this.webServer = null; } for (IPyUnitServerListener listener : this.listeners) { listener.notifyDispose(); } this.listeners.clear(); } } | /**
* Disposes of the pyunit server. When the launch is terminated or removed from the launch manager, it's
* automatically disposed.
*/ | Disposes of the pyunit server. When the launch is terminated or removed from the launch manager, it's automatically disposed | dispose | {
"repo_name": "rgom/Pydev",
"path": "plugins/org.python.pydev.debug/src/org/python/pydev/debug/pyunit/PyUnitServer.java",
"license": "epl-1.0",
"size": 13206
} | [
"org.eclipse.debug.core.DebugPlugin",
"org.eclipse.debug.core.ILaunchManager",
"org.python.pydev.core.log.Log"
] | import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchManager; import org.python.pydev.core.log.Log; | import org.eclipse.debug.core.*; import org.python.pydev.core.log.*; | [
"org.eclipse.debug",
"org.python.pydev"
] | org.eclipse.debug; org.python.pydev; | 515,036 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux<PollResult<WorkloadNetworkDnsZoneInner>, WorkloadNetworkDnsZoneInner> beginCreateDnsZoneAsync(
String resourceGroupName,
String privateCloudName,
String dnsZoneId,
WorkloadNetworkDnsZoneInner workloadNetworkDnsZone,
Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono =
createDnsZoneWithResponseAsync(
resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context);
return this
.client
.<WorkloadNetworkDnsZoneInner, WorkloadNetworkDnsZoneInner>getLroResult(
mono,
this.client.getHttpPipeline(),
WorkloadNetworkDnsZoneInner.class,
WorkloadNetworkDnsZoneInner.class,
context);
} | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<WorkloadNetworkDnsZoneInner>, WorkloadNetworkDnsZoneInner> function( String resourceGroupName, String privateCloudName, String dnsZoneId, WorkloadNetworkDnsZoneInner workloadNetworkDnsZone, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffer>>> mono = createDnsZoneWithResponseAsync( resourceGroupName, privateCloudName, dnsZoneId, workloadNetworkDnsZone, context); return this .client .<WorkloadNetworkDnsZoneInner, WorkloadNetworkDnsZoneInner>getLroResult( mono, this.client.getHttpPipeline(), WorkloadNetworkDnsZoneInner.class, WorkloadNetworkDnsZoneInner.class, context); } | /**
* Create a DNS zone by id in a private cloud workload network.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param privateCloudName Name of the private cloud.
* @param dnsZoneId NSX DNS Zone identifier. Generally the same as the DNS Zone's display name.
* @param workloadNetworkDnsZone NSX DNS Zone.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return nSX DNS Zone.
*/ | Create a DNS zone by id in a private cloud workload network | beginCreateDnsZoneAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/implementation/WorkloadNetworksClientImpl.java",
"license": "mit",
"size": 538828
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.PollerFlux",
"com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkDnsZoneInner; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.avs.fluent.models.*; import java.nio.*; | [
"com.azure.core",
"com.azure.resourcemanager",
"java.nio"
] | com.azure.core; com.azure.resourcemanager; java.nio; | 1,416,557 |
public static NBTTagCompound getCompound(ItemStack stack, String tag, boolean nullifyOnFail) {
return verifyExistance(stack, tag) ? getNBT(stack).getCompoundTag(tag) : nullifyOnFail ? null : new NBTTagCompound();
} | static NBTTagCompound function(ItemStack stack, String tag, boolean nullifyOnFail) { return verifyExistance(stack, tag) ? getNBT(stack).getCompoundTag(tag) : nullifyOnFail ? null : new NBTTagCompound(); } | /** If nullifyOnFail is true it'll return null if it doesn't find any
* compounds, otherwise it'll return a new one. **/ | If nullifyOnFail is true it'll return null if it doesn't find any | getCompound | {
"repo_name": "bafomdad/realfilingcabinet",
"path": "com/bafomdad/realfilingcabinet/utils/NBTUtils.java",
"license": "mit",
"size": 5196
} | [
"net.minecraft.item.ItemStack",
"net.minecraft.nbt.NBTTagCompound"
] | import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; | import net.minecraft.item.*; import net.minecraft.nbt.*; | [
"net.minecraft.item",
"net.minecraft.nbt"
] | net.minecraft.item; net.minecraft.nbt; | 600,822 |
public static void turnOnAntialiasedDrawing(Graphics g)
{
if(g instanceof Graphics2D)
{
((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}
} | static void function(Graphics g) { if(g instanceof Graphics2D) { ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } } | /**
* Modifes the given {@link Graphics} object to enable anti-aliased
* drawing.
*
* @param g a {@link Graphics} object
*/ | Modifes the given <code>Graphics</code> object to enable anti-aliased drawing | turnOnAntialiasedDrawing | {
"repo_name": "specify/specify6",
"path": "src/edu/ku/brc/ui/GraphicsUtils.java",
"license": "gpl-2.0",
"size": 25375
} | [
"java.awt.Graphics",
"java.awt.Graphics2D",
"java.awt.RenderingHints"
] | import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,441,419 |
//@Contract("null, null -> true; null, !null -> false; !null, null -> false")
public static boolean equal(@Nullable ItemStack a, @Nullable ItemStack b)
{
return a == b || (a != null && b != null && equalsImpl(a, b));
} | static boolean function(@Nullable ItemStack a, @Nullable ItemStack b) { return a == b (a != null && b != null && equalsImpl(a, b)); } | /**
* <p>Determine if the given ItemStacks are equal.</p>
* <p>This method checks the Item, damage value and NBT data of the stack, it does not check stack sizes.</p>
* <p>Adapted from diesieben07's SevenCommons Modding Framework: https://goo.gl/wKCm2L.</p>
*
* @param a an ItemStack
* @param b an ItemStack
* @return true if the ItemStacks are equal
*/ | Determine if the given ItemStacks are equal. This method checks the Item, damage value and NBT data of the stack, it does not check stack sizes. Adapted from diesieben07's SevenCommons Modding Framework: HREF | equal | {
"repo_name": "Mierzen/Lava-Furnace",
"path": "src/main/java/com/mierzen/lavafurnace/FuelTileEntity.java",
"license": "gpl-2.0",
"size": 2452
} | [
"javax.annotation.Nullable",
"net.minecraft.item.ItemStack"
] | import javax.annotation.Nullable; import net.minecraft.item.ItemStack; | import javax.annotation.*; import net.minecraft.item.*; | [
"javax.annotation",
"net.minecraft.item"
] | javax.annotation; net.minecraft.item; | 1,186,667 |
protected void readSecretKeyFromKeystore() throws Exception {
InputStream inputStream=null;
// must not use default keystore type - as it does not support secret keys
KeyStore store=KeyStore.getInstance("JCEKS");
SecretKey tempKey=null;
try {
if(this.secret_key == null) { // in case the secret key was set before, e.g. via injection in a unit test
// load in keystore using this thread's classloader
inputStream=Thread.currentThread().getContextClassLoader().getResourceAsStream(keystore_name);
if(inputStream == null)
inputStream=new FileInputStream(keystore_name);
// we can't find a keystore here -
if(inputStream == null)
throw new Exception("Unable to load keystore " + keystore_name + " ensure file is on classpath");
// we have located a file lets load the keystore
try {
store.load(inputStream, store_password.toCharArray());
// loaded keystore - get the key
tempKey=(SecretKey)store.getKey(alias, key_password.toCharArray());
}
catch(IOException e) {
throw new Exception("Unable to load keystore " + keystore_name + ": " + e);
}
catch(NoSuchAlgorithmException e) {
throw new Exception("No Such algorithm " + keystore_name + ": " + e);
}
catch(CertificateException e) {
throw new Exception("Certificate exception " + keystore_name + ": " + e);
}
if(tempKey == null)
throw new Exception("Unable to retrieve key '" + alias + "' from keystore " + keystore_name);
this.secret_key=tempKey;
if(sym_algorithm.equals(DEFAULT_SYM_ALGO))
sym_algorithm=tempKey.getAlgorithm();
}
}
finally {
Util.close(inputStream);
}
} | void function() throws Exception { InputStream inputStream=null; KeyStore store=KeyStore.getInstance("JCEKS"); SecretKey tempKey=null; try { if(this.secret_key == null) { inputStream=Thread.currentThread().getContextClassLoader().getResourceAsStream(keystore_name); if(inputStream == null) inputStream=new FileInputStream(keystore_name); if(inputStream == null) throw new Exception(STR + keystore_name + STR); try { store.load(inputStream, store_password.toCharArray()); tempKey=(SecretKey)store.getKey(alias, key_password.toCharArray()); } catch(IOException e) { throw new Exception(STR + keystore_name + STR + e); } catch(NoSuchAlgorithmException e) { throw new Exception(STR + keystore_name + STR + e); } catch(CertificateException e) { throw new Exception(STR + keystore_name + STR + e); } if(tempKey == null) throw new Exception(STR + alias + STR + keystore_name); this.secret_key=tempKey; if(sym_algorithm.equals(DEFAULT_SYM_ALGO)) sym_algorithm=tempKey.getAlgorithm(); } } finally { Util.close(inputStream); } } | /**
* Initialisation if a supplied key is defined in the properties. This supplied key must be in a keystore which
* can be generated using the keystoreGenerator file in demos. The keystore must be on the classpath to find it.
*/ | Initialisation if a supplied key is defined in the properties. This supplied key must be in a keystore which can be generated using the keystoreGenerator file in demos. The keystore must be on the classpath to find it | readSecretKeyFromKeystore | {
"repo_name": "pruivo/JGroups",
"path": "src/org/jgroups/protocols/SYM_ENCRYPT.java",
"license": "apache-2.0",
"size": 5974
} | [
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream",
"java.security.KeyStore",
"java.security.NoSuchAlgorithmException",
"java.security.cert.CertificateException",
"javax.crypto.SecretKey",
"org.jgroups.util.Util"
] | import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.security.KeyStore; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import javax.crypto.SecretKey; import org.jgroups.util.Util; | import java.io.*; import java.security.*; import java.security.cert.*; import javax.crypto.*; import org.jgroups.util.*; | [
"java.io",
"java.security",
"javax.crypto",
"org.jgroups.util"
] | java.io; java.security; javax.crypto; org.jgroups.util; | 330,381 |
private String buildPagePropertiesContext(SessionState state, Context context)
{
context.put("tlang", rb);
SitePage page = (SitePage) state.getAttribute("page");
if(page != null) {
// read the form - if rejected, leave things as they are
context.put("page", page);
}
return "_page_properties";
}
| String function(SessionState state, Context context) { context.put("tlang", rb); SitePage page = (SitePage) state.getAttribute("page"); if(page != null) { context.put("page", page); } return STR; } | /**
* Build the context for the properties edit in edit mode.
*/ | Build the context for the properties edit in edit mode | buildPagePropertiesContext | {
"repo_name": "ouit0408/sakai",
"path": "site/site-tool/tool/src/java/org/sakaiproject/site/tool/AdminSitesAction.java",
"license": "apache-2.0",
"size": 76844
} | [
"org.sakaiproject.cheftool.Context",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.site.api.SitePage"
] | import org.sakaiproject.cheftool.Context; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.site.api.SitePage; | import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.site.api.*; | [
"org.sakaiproject.cheftool",
"org.sakaiproject.event",
"org.sakaiproject.site"
] | org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.site; | 2,739,769 |
@Test
public void testTargetType() {
assertTrue(StructuredMarketDataSnapshot.class.isAssignableFrom(RESOLVED.getTargetType()));
} | void function() { assertTrue(StructuredMarketDataSnapshot.class.isAssignableFrom(RESOLVED.getTargetType())); } | /**
* Tests the target type.
*/ | Tests the target type | testTargetType | {
"repo_name": "McLeodMoores/starling",
"path": "projects/core/src/test/java/com/opengamma/core/link/ResolvedSnapshotLinkTest.java",
"license": "apache-2.0",
"size": 2231
} | [
"com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot",
"org.testng.Assert"
] | import com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot; import org.testng.Assert; | import com.opengamma.core.marketdatasnapshot.*; import org.testng.*; | [
"com.opengamma.core",
"org.testng"
] | com.opengamma.core; org.testng; | 2,330,316 |
@Override
public File prepareHSMFile(String fsID, String filePath)
throws HSMException {
logger.debug("prepareHSMFile called with fsID=" + fsID + ", filePath="
+ filePath);
// filePath looks like
// "<year>/<month>/<day>/<hour>/<study_hash>/<series_hash>-<msecs>.tar"
// There is no need to create the entire directory structure for this
// tarball in the outgoing directory, so we only take the file name
return new File(absoluteOutgoingDir, new File(filePath).getName());
} | File function(String fsID, String filePath) throws HSMException { logger.debug(STR + fsID + STR + filePath); return new File(absoluteOutgoingDir, new File(filePath).getName()); } | /**
* The method that is called by the FileCopy service when it is about to
* pack the study files into a tarball, in order to copy it to nearline
* storage (i.e. CAStor) later on.
*
* @param fsID
* The file system ID for nearline storage.
* @param filePath
* The relative path to the study files in online storage.
* @return The tar file to create (i.e. this <code>File</code> object
* indicates the name and location for the tarball).
* @throws HSMException
*/ | The method that is called by the FileCopy service when it is about to pack the study files into a tarball, in order to copy it to nearline storage (i.e. CAStor) later on | prepareHSMFile | {
"repo_name": "medicayun/medicayundicom",
"path": "dcm4jboss-all/tags/DCM4CHEE_2_18_3/dcm4jboss-sar/src/java/org/dcm4chex/archive/hsm/module/castor/CAStorHSMModule.java",
"license": "apache-2.0",
"size": 26452
} | [
"java.io.File",
"org.dcm4chex.archive.hsm.module.HSMException"
] | import java.io.File; import org.dcm4chex.archive.hsm.module.HSMException; | import java.io.*; import org.dcm4chex.archive.hsm.module.*; | [
"java.io",
"org.dcm4chex.archive"
] | java.io; org.dcm4chex.archive; | 160,818 |
protected EntityReference resolveStore(StoreReference store)
{
EntityReference reference = getStoreReference(store);
if (reference.getType() == EntityType.DOCUMENT) {
return this.referenceResolver.resolve(reference, EntityType.DOCUMENT);
}
return this.referenceResolver.resolve(reference, EntityType.SPACE);
} | EntityReference function(StoreReference store) { EntityReference reference = getStoreReference(store); if (reference.getType() == EntityType.DOCUMENT) { return this.referenceResolver.resolve(reference, EntityType.DOCUMENT); } return this.referenceResolver.resolve(reference, EntityType.SPACE); } | /**
* Resolve a given store into a complete reference (either space or document).
*
* @param store the store to be resolved.
* @return a complete entity reference.
*/ | Resolve a given store into a complete reference (either space or document) | resolveStore | {
"repo_name": "pbondoer/xwiki-platform",
"path": "xwiki-platform-core/xwiki-platform-crypto/xwiki-platform-crypto-store/xwiki-platform-crypto-store-wiki/src/main/java/org/xwiki/crypto/store/wiki/internal/AbstractX509WikiStore.java",
"license": "lgpl-2.1",
"size": 11707
} | [
"org.xwiki.crypto.store.StoreReference",
"org.xwiki.model.EntityType",
"org.xwiki.model.reference.EntityReference"
] | import org.xwiki.crypto.store.StoreReference; import org.xwiki.model.EntityType; import org.xwiki.model.reference.EntityReference; | import org.xwiki.crypto.store.*; import org.xwiki.model.*; import org.xwiki.model.reference.*; | [
"org.xwiki.crypto",
"org.xwiki.model"
] | org.xwiki.crypto; org.xwiki.model; | 2,163,822 |
public CompoundConfiguration addBytesMap(
final Map<Bytes, Bytes> map) {
freezeMutableConf();
// put new map at the front of the list (top priority)
this.configs.add(0, new ImmutableConfigMap() {
private final Map<Bytes, Bytes> m = map; | CompoundConfiguration function( final Map<Bytes, Bytes> map) { freezeMutableConf(); this.configs.add(0, new ImmutableConfigMap() { private final Map<Bytes, Bytes> m = map; | /**
* Add Bytes map to config list. This map is generally
* created by HTableDescriptor or HColumnDescriptor, but can be abstractly
* used. The added configuration overrides the previous ones if there are
* name collisions.
*
* @param map
* Bytes map
* @return this, for builder pattern
*/ | Add Bytes map to config list. This map is generally created by HTableDescriptor or HColumnDescriptor, but can be abstractly used. The added configuration overrides the previous ones if there are name collisions | addBytesMap | {
"repo_name": "JingchengDu/hbase",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/CompoundConfiguration.java",
"license": "apache-2.0",
"size": 12370
} | [
"java.util.Map",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.util.Map; import org.apache.hadoop.hbase.util.Bytes; | import java.util.*; import org.apache.hadoop.hbase.util.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 894,208 |
@Override
public void rewriteHudsonWar(File by) throws IOException {
File dest = getHudsonWar();
// this should be impossible given the canRewriteHudsonWar method,
// but let's be defensive
if(dest==null) throw new IOException("jenkins.war location is not known.");
// backing up the old jenkins.war before its lost due to upgrading
// unless we are trying to rewrite jenkins.war by a backup itself
File bak = new File(dest.getPath() + ".bak");
if (!by.equals(bak))
FileUtils.copyFile(dest, bak);
String baseName = dest.getName();
baseName = baseName.substring(0,baseName.indexOf('.'));
File baseDir = getBaseDir();
File copyFiles = new File(baseDir,baseName+".copies");
try (FileWriter w = new FileWriter(copyFiles, true)) {
w.write(by.getAbsolutePath() + '>' + getHudsonWar().getAbsolutePath() + '\n');
}
} | void function(File by) throws IOException { File dest = getHudsonWar(); if(dest==null) throw new IOException(STR); File bak = new File(dest.getPath() + ".bak"); if (!by.equals(bak)) FileUtils.copyFile(dest, bak); String baseName = dest.getName(); baseName = baseName.substring(0,baseName.indexOf('.')); File baseDir = getBaseDir(); File copyFiles = new File(baseDir,baseName+STR); try (FileWriter w = new FileWriter(copyFiles, true)) { w.write(by.getAbsolutePath() + '>' + getHudsonWar().getAbsolutePath() + '\n'); } } | /**
* On Windows, jenkins.war is locked, so we place a new version under a special name,
* which is picked up by the service wrapper upon restart.
*/ | On Windows, jenkins.war is locked, so we place a new version under a special name, which is picked up by the service wrapper upon restart | rewriteHudsonWar | {
"repo_name": "bkmeneguello/jenkins",
"path": "core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java",
"license": "mit",
"size": 6457
} | [
"java.io.File",
"java.io.FileWriter",
"java.io.IOException",
"org.apache.commons.io.FileUtils"
] | import java.io.File; import java.io.FileWriter; import java.io.IOException; import org.apache.commons.io.FileUtils; | import java.io.*; import org.apache.commons.io.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 602,275 |
public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body();
} | String function(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body(); } | /**
* Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkGatewayName The name of the virtual network gateway.
* @param parameters Parameters supplied to the generate virtual network gateway VPN client package operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the String object if successful.
*/ | Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication | beginGenerateVpnProfile | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/VirtualNetworkGatewaysInner.java",
"license": "mit",
"size": 304865
} | [
"com.microsoft.azure.management.network.v2020_03_01.VpnClientParameters"
] | import com.microsoft.azure.management.network.v2020_03_01.VpnClientParameters; | import com.microsoft.azure.management.network.v2020_03_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,790,178 |
public Date getTime(){
return time;
} | Date function(){ return time; } | /**
* Gets the object fetched time. Returns original fetch time when url is file cached.
*
* @return original fetch time
*/ | Gets the object fetched time. Returns original fetch time when url is file cached | getTime | {
"repo_name": "bblue000/AndroidRubick",
"path": "library-androidrubick/src/com/androidquery/callback/AjaxStatus.java",
"license": "apache-2.0",
"size": 7399
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,382,183 |
private void mergeEntry(IntEventType evt, int one, Entry nentry){
nentry.m |= evt.getMask();
mergeDomain(nentry.getD(), evt, one);
} | void function(IntEventType evt, int one, Entry nentry){ nentry.m = evt.getMask(); mergeDomain(nentry.getD(), evt, one); } | /**
* Merge two consecutive entries as long as they are based on the same variable and cause.
* The domain and mask are merged.
* @param evt event received
* @param one value removed, new lower bound, new upper bound or singleton value, wrt to <i>evt</i>
* @param nentry entry to merge with
*/ | Merge two consecutive entries as long as they are based on the same variable and cause. The domain and mask are merged | mergeEntry | {
"repo_name": "chocoteam/choco3",
"path": "src/main/java/org/chocosolver/solver/learn/LazyImplications.java",
"license": "bsd-3-clause",
"size": 16676
} | [
"org.chocosolver.solver.variables.events.IntEventType"
] | import org.chocosolver.solver.variables.events.IntEventType; | import org.chocosolver.solver.variables.events.*; | [
"org.chocosolver.solver"
] | org.chocosolver.solver; | 2,695,961 |
private Map<OWLClass,OWLClassExpression> getSubconceptsMapping() {
Set<OWLClassExpression> sc = collectSCs();
Map<OWLClass,OWLClassExpression> map = new HashMap<OWLClass,OWLClassExpression>();
int counter = 1;
extraAxioms = new HashSet<OWLAxiom>();
System.out.println("[diff" + diff + "] Adding axioms...");
for(OWLClassExpression ce : sc) {
OWLClass c = df.getOWLClass(IRI.create("diffSubc_" + counter));
map.put(c, ce);
OWLAxiom ax = null;
if(diff.equals("L"))
ax = df.getOWLSubClassOfAxiom(c, ce);
else if(diff.equals("R"))
ax = df.getOWLEquivalentClassesAxiom(c, ce);
extraAxioms.add(ax); counter++;
}
ont1.getOWLOntologyManager().addAxioms(ont1, extraAxioms);
ont2.getOWLOntologyManager().addAxioms(ont2, extraAxioms);
System.out.println("[diff" + diff + "] Added " + extraAxioms.size() + " axioms");
return map;
}
| Map<OWLClass,OWLClassExpression> function() { Set<OWLClassExpression> sc = collectSCs(); Map<OWLClass,OWLClassExpression> map = new HashMap<OWLClass,OWLClassExpression>(); int counter = 1; extraAxioms = new HashSet<OWLAxiom>(); System.out.println("[diff" + diff + STR); for(OWLClassExpression ce : sc) { OWLClass c = df.getOWLClass(IRI.create(STR + counter)); map.put(c, ce); OWLAxiom ax = null; if(diff.equals("L")) ax = df.getOWLSubClassOfAxiom(c, ce); else if(diff.equals("R")) ax = df.getOWLEquivalentClassesAxiom(c, ce); extraAxioms.add(ax); counter++; } ont1.getOWLOntologyManager().addAxioms(ont1, extraAxioms); ont2.getOWLOntologyManager().addAxioms(ont2, extraAxioms); System.out.println("[diff" + diff + STR + extraAxioms.size() + STR); return map; } | /**
* Create a mapping between a new term "TempX" and each sub-concept, and add the appropriate
* equivalence axioms to each ontology
* @return Map of new terms to subconcepts
*/ | Create a mapping between a new term "TempX" and each sub-concept, and add the appropriate equivalence axioms to each ontology | getSubconceptsMapping | {
"repo_name": "rsgoncalves/ecco",
"path": "src/main/java/uk/ac/manchester/cs/diff/test/Diff.java",
"license": "lgpl-3.0",
"size": 19501
} | [
"java.util.HashMap",
"java.util.HashSet",
"java.util.Map",
"java.util.Set",
"org.semanticweb.owlapi.model.IRI",
"org.semanticweb.owlapi.model.OWLAxiom",
"org.semanticweb.owlapi.model.OWLClass",
"org.semanticweb.owlapi.model.OWLClassExpression"
] | import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLClassExpression; | import java.util.*; import org.semanticweb.owlapi.model.*; | [
"java.util",
"org.semanticweb.owlapi"
] | java.util; org.semanticweb.owlapi; | 219,376 |
public int doRecordChange(FieldInfo field, int iChangeType, boolean bDisplayOption)
{ // Read a valid record
int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); // Initialize the record
if (iErrorCode != DBConstants.NORMAL_RETURN)
return iErrorCode;
if (m_bUpdateOnUpdate)
if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
|| (iChangeType == DBConstants.AFTER_ADD_TYPE))
return this.writeAndRefresh();
if (iChangeType == DBConstants.BEFORE_FREE_TYPE)
if (m_bUpdateOnClose)
this.writeAndRefresh();
return iErrorCode;
} | int function(FieldInfo field, int iChangeType, boolean bDisplayOption) { int iErrorCode = super.doRecordChange(field, iChangeType, bDisplayOption); if (iErrorCode != DBConstants.NORMAL_RETURN) return iErrorCode; if (m_bUpdateOnUpdate) if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE) (iChangeType == DBConstants.AFTER_ADD_TYPE)) return this.writeAndRefresh(); if (iChangeType == DBConstants.BEFORE_FREE_TYPE) if (m_bUpdateOnClose) this.writeAndRefresh(); return iErrorCode; } | /**
* Called when a change in the record status is about to happen/has happened.
* @param field If this file change is due to a field, this is the field.
* @param iChangeType The type of change that occurred.
* @param bDisplayOption If true, display any changes.
* @return an error code.
* Synchronize records after an update or add.
*/ | Called when a change in the record status is about to happen/has happened | doRecordChange | {
"repo_name": "jbundle/jbundle",
"path": "base/base/src/main/java/org/jbundle/base/db/event/UpdateOnCloseHandler.java",
"license": "gpl-3.0",
"size": 8561
} | [
"org.jbundle.base.model.DBConstants",
"org.jbundle.thin.base.db.FieldInfo"
] | import org.jbundle.base.model.DBConstants; import org.jbundle.thin.base.db.FieldInfo; | import org.jbundle.base.model.*; import org.jbundle.thin.base.db.*; | [
"org.jbundle.base",
"org.jbundle.thin"
] | org.jbundle.base; org.jbundle.thin; | 432,636 |
private static PieDataset createDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Samsung", new Double(27.8));
dataset.setValue("Others", new Double(55.3));
dataset.setValue("Nokia", new Double(16.8));
dataset.setValue("Apple", new Double(17.1));
return dataset;
} | static PieDataset function() { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue(STR, new Double(27.8)); dataset.setValue(STR, new Double(55.3)); dataset.setValue("Nokia", new Double(16.8)); dataset.setValue("Apple", new Double(17.1)); return dataset; } | /**
* Creates a sample dataset. Source: http://www.bbc.co.uk/news/business-15489523
*
* @return A sample dataset.
*/ | Creates a sample dataset. Source: HREF | createDataset | {
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/demo/PieChartDemo1.java",
"license": "lgpl-3.0",
"size": 7049
} | [
"org.jfree.data.general.DefaultPieDataset",
"org.jfree.data.general.PieDataset"
] | import org.jfree.data.general.DefaultPieDataset; import org.jfree.data.general.PieDataset; | import org.jfree.data.general.*; | [
"org.jfree.data"
] | org.jfree.data; | 1,392,830 |
void writeTo(OutputStream out) throws IOException, ModelRuntimeException;
| void writeTo(OutputStream out) throws IOException, ModelRuntimeException; | /**
* Writing a TRiX stream in UTF8 encoding For more info on TRiX read:
* http://www.hpl.hp.com/techreports/2003/HPL-2003-268.html
*
* @param out
* the output to write to
* @throws IOException
* on IOErrors
* @throws ModelRuntimeException
* on RDF serialization errors or model errors
*/ | Writing a TRiX stream in UTF8 encoding For more info on TRiX read: HREF | writeTo | {
"repo_name": "semweb4j/semweb4j",
"path": "org.semweb4j.rdf2go.api/src/main/java/org/ontoware/rdf2go/model/ModelSetIO.java",
"license": "bsd-2-clause",
"size": 6734
} | [
"java.io.IOException",
"java.io.OutputStream",
"org.ontoware.rdf2go.exception.ModelRuntimeException"
] | import java.io.IOException; import java.io.OutputStream; import org.ontoware.rdf2go.exception.ModelRuntimeException; | import java.io.*; import org.ontoware.rdf2go.exception.*; | [
"java.io",
"org.ontoware.rdf2go"
] | java.io; org.ontoware.rdf2go; | 832,519 |
public Collection<String> getBlacklistedTrackerNames() {
return blacklistedTrackers;
} | Collection<String> function() { return blacklistedTrackers; } | /**
* Get the names of task trackers in the cluster.
*
* @return the blacklisted task trackers in the cluster.
*/ | Get the names of task trackers in the cluster | getBlacklistedTrackerNames | {
"repo_name": "ghelmling/hadoop-common",
"path": "src/mapred/org/apache/hadoop/mapred/ClusterStatus.java",
"license": "apache-2.0",
"size": 10937
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 385,393 |
public void addParameterMapping(Class<?> parameterType, Expression expression) {
parameterTypeToExpressionMap.put(parameterType, expression);
} | void function(Class<?> parameterType, Expression expression) { parameterTypeToExpressionMap.put(parameterType, expression); } | /**
* Adds a default parameter type mapping to an expression
*/ | Adds a default parameter type mapping to an expression | addParameterMapping | {
"repo_name": "objectiser/camel",
"path": "components/camel-bean/src/main/java/org/apache/camel/component/bean/DefaultParameterMappingStrategy.java",
"license": "apache-2.0",
"size": 2568
} | [
"org.apache.camel.Expression"
] | import org.apache.camel.Expression; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,704,893 |
static public List<ConnectorType> getValues() {
List<ConnectorType> connectorTypes = new ArrayList<>(nameToConnectorType.values());
return connectorTypes;
} | static List<ConnectorType> function() { List<ConnectorType> connectorTypes = new ArrayList<>(nameToConnectorType.values()); return connectorTypes; } | /**
* Returns the connector type values of all ConnectorTypes as a list.
*
* @return connectorTypes the list of all registered ConnectorTypes.
*/ | Returns the connector type values of all ConnectorTypes as a list | getValues | {
"repo_name": "PathVisio/libGPML",
"path": "org.pathvisio.lib/src/main/java/org/pathvisio/model/type/ConnectorType.java",
"license": "apache-2.0",
"size": 4419
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,528,207 |
public void writeClassFieldLength(int len)
throws IOException
{
writeInt(len);
}
| void function(int len) throws IOException { writeInt(len); } | /**
* Writes the tail of the class definition to the stream.
*/ | Writes the tail of the class definition to the stream | writeClassFieldLength | {
"repo_name": "surlymo/dubbo",
"path": "hessian-lite/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Output.java",
"license": "apache-2.0",
"size": 36381
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,053,902 |
@Nonnull
Set<Revision> getConflictsFor(@Nonnull Iterable<Revision> changes) {
checkNotNull(changes);
Set<Revision> conflicts = Sets.newHashSet();
Map<Revision, String> collisions = getLocalMap(COLLISIONS);
for (Revision r : changes) {
String value = collisions.get(r.asTrunkRevision());
if (value == null) {
continue;
}
try {
conflicts.add(Revision.fromString(value));
} catch (IllegalArgumentException e) {
// backward compatibility: collision marker with value 'true'
}
}
return conflicts;
} | Set<Revision> getConflictsFor(@Nonnull Iterable<Revision> changes) { checkNotNull(changes); Set<Revision> conflicts = Sets.newHashSet(); Map<Revision, String> collisions = getLocalMap(COLLISIONS); for (Revision r : changes) { String value = collisions.get(r.asTrunkRevision()); if (value == null) { continue; } try { conflicts.add(Revision.fromString(value)); } catch (IllegalArgumentException e) { } } return conflicts; } | /**
* Returns the conflicts on the given {@code changes} if there are any. The
* returned revisions are the commits, which created the collision markers
* for one of the {@code changes}.
*
* @param changes the changes to check.
* @return the conflict revisions.
*/ | Returns the conflicts on the given changes if there are any. The returned revisions are the commits, which created the collision markers for one of the changes | getConflictsFor | {
"repo_name": "yesil/jackrabbit-oak",
"path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java",
"license": "apache-2.0",
"size": 93796
} | [
"com.google.common.base.Preconditions",
"com.google.common.collect.Sets",
"java.util.Map",
"java.util.Set",
"javax.annotation.Nonnull"
] | import com.google.common.base.Preconditions; import com.google.common.collect.Sets; import java.util.Map; import java.util.Set; import javax.annotation.Nonnull; | import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import javax.annotation.*; | [
"com.google.common",
"java.util",
"javax.annotation"
] | com.google.common; java.util; javax.annotation; | 410,696 |
int getMaxCapacity(TaskType taskType) {
if (taskType == TaskType.MAP) {
return mapSlots.getMaxCapacity();
} else if (taskType == TaskType.REDUCE) {
return reduceSlots.getMaxCapacity();
}
throw new IllegalArgumentException("Illegal taskType=" + taskType);
} | int getMaxCapacity(TaskType taskType) { if (taskType == TaskType.MAP) { return mapSlots.getMaxCapacity(); } else if (taskType == TaskType.REDUCE) { return reduceSlots.getMaxCapacity(); } throw new IllegalArgumentException(STR + taskType); } | /**
* Get maximum number of slots for the <code>taskType</code>.
* @param taskType
* @return maximum number of slots for the <code>taskType</code>
*/ | Get maximum number of slots for the <code>taskType</code> | getMaxCapacity | {
"repo_name": "ZhangXFeng/hadoop",
"path": "src/hadoop-mapreduce1-project/src/contrib/capacity-scheduler/src/java/org/apache/hadoop/mapred/CapacitySchedulerQueue.java",
"license": "apache-2.0",
"size": 45344
} | [
"org.apache.hadoop.mapreduce.TaskType"
] | import org.apache.hadoop.mapreduce.TaskType; | import org.apache.hadoop.mapreduce.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,382,863 |
public final Property<Double> recoveryRate() {
return metaBean().recoveryRate().createProperty(this);
} | final Property<Double> function() { return metaBean().recoveryRate().createProperty(this); } | /**
* Gets the the {@code recoveryRate} property.
* @return the property, not null
*/ | Gets the the recoveryRate property | recoveryRate | {
"repo_name": "McLeodMoores/starling",
"path": "projects/financial-types/src/main/java/com/opengamma/financial/security/cds/CreditDefaultSwapIndexDefinitionSecurity.java",
"license": "apache-2.0",
"size": 19909
} | [
"org.joda.beans.Property"
] | import org.joda.beans.Property; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 467,153 |
public static List<String> readLines(File file) throws IOException {
return readLines(file, null);
}
/**
* Returns an Iterator for the lines in a <code>File</code>.
* <p>
* This method opens an <code>InputStream</code> for the file.
* When you have finished with the iterator you should close the stream
* to free internal resources. This can be done by calling the
* {@link LineIterator#close()} or
* {@link LineIterator#closeQuietly(LineIterator)} method.
* <p>
* The recommended usage pattern is:
* <pre>
* LineIterator it = FileUtils.lineIterator(file, "UTF-8");
* try {
* while (it.hasNext()) {
* String line = it.nextLine();
* /// do something with line
* }
* } finally {
* LineIterator.closeQuietly(iterator);
* } | static List<String> function(File file) throws IOException { return readLines(file, null); } /** * Returns an Iterator for the lines in a <code>File</code>. * <p> * This method opens an <code>InputStream</code> for the file. * When you have finished with the iterator you should close the stream * to free internal resources. This can be done by calling the * {@link LineIterator#close()} or * {@link LineIterator#closeQuietly(LineIterator)} method. * <p> * The recommended usage pattern is: * <pre> * LineIterator it = FileUtils.lineIterator(file, "UTF-8"); * try { * while (it.hasNext()) { * String line = it.nextLine(); * * } * } finally { * LineIterator.closeQuietly(iterator); * } | /**
* Reads the contents of a file line by line to a List of Strings using the default encoding for the VM.
* The file is always closed.
*
* @param file the file to read, must not be <code>null</code>
* @return the list of Strings representing each line in the file, never <code>null</code>
* @throws IOException in case of an I/O error
* @since Commons IO 1.3
*/ | Reads the contents of a file line by line to a List of Strings using the default encoding for the VM. The file is always closed | readLines | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/UnifiedEmail/src/org/apache/commons/io/FileUtils.java",
"license": "gpl-3.0",
"size": 77172
} | [
"java.io.File",
"java.io.IOException",
"java.io.InputStream",
"java.util.Iterator",
"java.util.List"
] | import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Iterator; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,830,240 |
// BEGIN android-added
private void tryAllAddresses(String dstName, int dstPort, InetAddress
localAddress, int localPort, boolean streaming) throws IOException {
InetAddress[] dstAddresses = InetAddress.getAllByName(dstName);
// Loop through all the destination addresses except the last, trying to
// connect to each one and ignoring errors. There must be at least one
// address, or getAllByName would have thrown UnknownHostException.
InetAddress dstAddress;
for (int i = 0; i < dstAddresses.length - 1; i++) {
dstAddress = dstAddresses[i];
try {
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, streaming);
return;
} catch (SecurityException e1) {
} catch (IOException e2) {
}
}
// Now try to connect to the last address in the array, handing back to
// the caller any exceptions that are thrown.
dstAddress = dstAddresses[dstAddresses.length - 1];
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, streaming);
}
// END android-added
public Socket(String dstName, int dstPort) throws UnknownHostException, IOException {
this(dstName, dstPort, null, 0);
}
public Socket(String dstName, int dstPort, InetAddress localAddress, int localPort) throws IOException {
this();
tryAllAddresses(dstName, dstPort, localAddress, localPort, true);
}
@Deprecated
public Socket(String hostName, int port, boolean streaming) throws IOException {
this();
tryAllAddresses(hostName, port, null, 0, streaming);
}
public Socket(InetAddress dstAddress, int dstPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, null, 0, true);
}
public Socket(InetAddress dstAddress, int dstPort,
InetAddress localAddress, int localPort) throws IOException {
this();
checkDestination(dstAddress, dstPort);
startupSocket(dstAddress, dstPort, localAddress, localPort, true);
}
@Deprecated
public Socket(InetAddress addr, int port, boolean streaming) throws IOException {
this();
checkDestination(addr, port);
startupSocket(addr, port, null, 0, streaming);
}
protected Socket(SocketImpl impl) throws SocketException {
this.impl = impl;
this.proxy = null;
} | void function(String dstName, int dstPort, InetAddress localAddress, int localPort, boolean streaming) throws IOException { InetAddress[] dstAddresses = InetAddress.getAllByName(dstName); InetAddress dstAddress; for (int i = 0; i < dstAddresses.length - 1; i++) { dstAddress = dstAddresses[i]; try { checkDestination(dstAddress, dstPort); startupSocket(dstAddress, dstPort, localAddress, localPort, streaming); return; } catch (SecurityException e1) { } catch (IOException e2) { } } dstAddress = dstAddresses[dstAddresses.length - 1]; checkDestination(dstAddress, dstPort); startupSocket(dstAddress, dstPort, localAddress, localPort, streaming); } Socket(String dstName, int dstPort) throws UnknownHostException, IOException { this(dstName, dstPort, null, 0); } public Socket(String dstName, int dstPort, InetAddress localAddress, int localPort) throws IOException { this(); function(dstName, dstPort, localAddress, localPort, true); } Socket(String hostName, int port, boolean streaming) throws IOException { this(); function(hostName, port, null, 0, streaming); } public Socket(InetAddress dstAddress, int dstPort) throws IOException { this(); checkDestination(dstAddress, dstPort); startupSocket(dstAddress, dstPort, null, 0, true); } public Socket(InetAddress dstAddress, int dstPort, InetAddress localAddress, int localPort) throws IOException { this(); checkDestination(dstAddress, dstPort); startupSocket(dstAddress, dstPort, localAddress, localPort, true); } public Socket(InetAddress addr, int port, boolean streaming) throws IOException { this(); checkDestination(addr, port); startupSocket(addr, port, null, 0, streaming); } protected Socket(SocketImpl impl) throws SocketException { this.impl = impl; this.proxy = null; } | /**
* Tries to connect a socket to all IP addresses of the given hostname.
*
* @param dstName
* the target host name or IP address to connect to.
* @param dstPort
* the port on the target host to connect to.
* @param localAddress
* the address on the local host to bind to.
* @param localPort
* the port on the local host to bind to.
* @param streaming
* if {@code true} a streaming socket is returned, a datagram
* socket otherwise.
* @throws UnknownHostException
* if the host name could not be resolved into an IP address.
* @throws IOException
* if an error occurs while creating the socket.
* @throws SecurityException
* if a security manager exists and it denies the permission to
* connect to the given address and port.
*/ | Tries to connect a socket to all IP addresses of the given hostname | tryAllAddresses | {
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/java/net/Socket.java",
"license": "apache-2.0",
"size": 42548
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 333,503 |
UserVerifierDto editUserVerifier(UserVerifierDto userVerifier) throws ControlServiceException; | UserVerifierDto editUserVerifier(UserVerifierDto userVerifier) throws ControlServiceException; | /**
* Edits the user verifier.
*
* @param userVerifier
* the user verifier
* @return the user verifier dto
* @throws ControlServiceException
* the control service exception
*/ | Edits the user verifier | editUserVerifier | {
"repo_name": "forGGe/kaa",
"path": "server/node/src/main/java/org/kaaproject/kaa/server/control/service/ControlService.java",
"license": "apache-2.0",
"size": 61702
} | [
"org.kaaproject.kaa.common.dto.user.UserVerifierDto",
"org.kaaproject.kaa.server.control.service.exception.ControlServiceException"
] | import org.kaaproject.kaa.common.dto.user.UserVerifierDto; import org.kaaproject.kaa.server.control.service.exception.ControlServiceException; | import org.kaaproject.kaa.common.dto.user.*; import org.kaaproject.kaa.server.control.service.exception.*; | [
"org.kaaproject.kaa"
] | org.kaaproject.kaa; | 2,449,661 |
public String getHeaderValue(String name) {
Map headers = getHeaders();
return headers == null ? null : (String)headers.get(name);
}
| String function(String name) { Map headers = getHeaders(); return headers == null ? null : (String)headers.get(name); } | /**
* Return a header value corresponding to name or null if it doesn't exist.
*/ | Return a header value corresponding to name or null if it doesn't exist | getHeaderValue | {
"repo_name": "mbshopM/openconcerto",
"path": "OpenConcerto/src/org/jdesktop/swingx/action/ServerAction.java",
"license": "gpl-3.0",
"size": 10314
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,639,260 |
public double getDouble(int columnIndex) {
checkColumn(schema.getColumnByIndex(columnIndex), Type.DOUBLE);
checkValue(columnIndex);
return Bytes.getDouble(rowAlloc, schema.getColumnOffset(columnIndex));
} | double function(int columnIndex) { checkColumn(schema.getColumnByIndex(columnIndex), Type.DOUBLE); checkValue(columnIndex); return Bytes.getDouble(rowAlloc, schema.getColumnOffset(columnIndex)); } | /**
* Get the specified column's double
* @param columnIndex Column index in the schema
* @return a double
* @throws IllegalArgumentException if the column is null, is unset,
* or if the type doesn't match the column's type
* @throws IndexOutOfBoundsException if the column doesn't exist
*/ | Get the specified column's double | getDouble | {
"repo_name": "EvilMcJerkface/kudu",
"path": "java/kudu-client/src/main/java/org/apache/kudu/client/PartialRow.java",
"license": "apache-2.0",
"size": 55411
} | [
"org.apache.kudu.Type"
] | import org.apache.kudu.Type; | import org.apache.kudu.*; | [
"org.apache.kudu"
] | org.apache.kudu; | 799,519 |
public boolean filterMatches(AbstractItem item)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "filterMatches", item);
SIMPReferenceStream rstream;
if (item instanceof SIMPReferenceStream) {
rstream = (SIMPReferenceStream) item;
// Check for matching consumer dispatchers
if (rstream == consumerDispatcher.getReferenceStream())
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.TRUE);
return true;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.FALSE);
return false;
} | boolean function(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, STR, item); SIMPReferenceStream rstream; if (item instanceof SIMPReferenceStream) { rstream = (SIMPReferenceStream) item; if (rstream == consumerDispatcher.getReferenceStream()) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, Boolean.TRUE); return true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, Boolean.FALSE); return false; } | /**
* Filter method. Checks whether the given item is a consumerDispatcher and matches the
* one associated with this filter
* @param item - The item on the itemstream
* @return boolean - True if a match, false otherwise.
*/ | Filter method. Checks whether the given item is a consumerDispatcher and matches the one associated with this filter | filterMatches | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionFilter.java",
"license": "epl-1.0",
"size": 3402
} | [
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.ws.sib.msgstore.AbstractItem",
"com.ibm.ws.sib.processor.impl.store.itemstreams.SIMPReferenceStream",
"com.ibm.ws.sib.utils.ras.SibTr"
] | import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sib.msgstore.AbstractItem; import com.ibm.ws.sib.processor.impl.store.itemstreams.SIMPReferenceStream; import com.ibm.ws.sib.utils.ras.SibTr; | import com.ibm.websphere.ras.*; import com.ibm.ws.sib.msgstore.*; import com.ibm.ws.sib.processor.impl.store.itemstreams.*; import com.ibm.ws.sib.utils.ras.*; | [
"com.ibm.websphere",
"com.ibm.ws"
] | com.ibm.websphere; com.ibm.ws; | 1,370,526 |
public ScreenSize getScreenSize(); | ScreenSize function(); | /**
* Get the Screen Size
*
* @return ScreenSize
*/ | Get the Screen Size | getScreenSize | {
"repo_name": "fvasquezjatar/fermat-unused",
"path": "WPD/library/api/fermat-wpd-api/src/main/java/com/bitdubai/fermat_wpd_api/layer/wpd_sub_app_module/wallet_publisher/interfaces/ComponentVersionDetail.java",
"license": "mit",
"size": 2232
} | [
"com.bitdubai.fermat_api.layer.all_definition.resources_structure.enums.ScreenSize"
] | import com.bitdubai.fermat_api.layer.all_definition.resources_structure.enums.ScreenSize; | import com.bitdubai.fermat_api.layer.all_definition.resources_structure.enums.*; | [
"com.bitdubai.fermat_api"
] | com.bitdubai.fermat_api; | 973,969 |
public String SFString(String value) throws InvalidFieldFormatException {
StringReader input = new StringReader(value);
String ret_val = value;
try {
synchronized(mutex) {
fieldParser.ReInit(input);
ret_val = fieldParser.SFString();
}
} catch(ParseException pe) {
String newMsg = pe.getMessage() + " Offending value: " + value;
throw new InvalidFieldFormatException(newMsg);
}
return ret_val;
} | String function(String value) throws InvalidFieldFormatException { StringReader input = new StringReader(value); String ret_val = value; try { synchronized(mutex) { fieldParser.ReInit(input); ret_val = fieldParser.SFString(); } } catch(ParseException pe) { String newMsg = pe.getMessage() + STR + value; throw new InvalidFieldFormatException(newMsg); } return ret_val; } | /**
* Parse an SFString value. We really shouldn't need this, but it is here for
* completeness. If the string starts and ends with quotes it will strips the
* quotes.
*
* @param value The raw value as a string to be parsed
* @return The same string
* @throws InvalidFieldFormatException The field does not match the
* required profile
*/ | Parse an SFString value. We really shouldn't need this, but it is here for completeness. If the string starts and ends with quotes it will strips the quotes | SFString | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/web3d/parser/vrml97/VRML97FieldReader.java",
"license": "gpl-2.0",
"size": 61534
} | [
"java.io.StringReader",
"org.web3d.vrml.lang.InvalidFieldFormatException"
] | import java.io.StringReader; import org.web3d.vrml.lang.InvalidFieldFormatException; | import java.io.*; import org.web3d.vrml.lang.*; | [
"java.io",
"org.web3d.vrml"
] | java.io; org.web3d.vrml; | 2,840,426 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.