method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public URN param(final String name, final Object value) {
if (name == null || value == null) {
throw new IllegalArgumentException(
"Parameter name and value must be non-null.");
}
final Map<String, String> params = this.params();
params.put(name, value.toString());
return URN.create(String.format("%s%s",
this.toString().split("\\?")[0], URN.enmap(params)));
}
| URN function(final String name, final Object value) { if (name == null value == null) { throw new IllegalArgumentException( STR); } final Map<String, String> params = this.params(); params.put(name, value.toString()); return URN.create(String.format("%s%s", this.toString().split("\\?")[0], URN.enmap(params))); } | /**
* Add (overwrite) a query param and return a new URN.
*
* @param name
* Name of parameter
* @param value
* The value of parameter
* @return New URN
*/ | Add (overwrite) a query param and return a new URN | param | {
"repo_name": "DEMANES/demanes-api",
"path": "src/eu/artemis/demanes/datatypes/URN.java",
"license": "apache-2.0",
"size": 12591
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,333,124 |
public void open() throws IOException {
if (!isOpen() && refCnt() > 0) {
// Only open if this DefaultFileRegion was not released yet.
file = new RandomAccessFile(f, "r").getChannel();
}
} | void function() throws IOException { if (!isOpen() && refCnt() > 0) { file = new RandomAccessFile(f, "r").getChannel(); } } | /**
* Explicitly open the underlying file-descriptor if not done yet.
*/ | Explicitly open the underlying file-descriptor if not done yet | open | {
"repo_name": "fengjiachun/netty",
"path": "transport/src/main/java/io/netty/channel/DefaultFileRegion.java",
"license": "apache-2.0",
"size": 6297
} | [
"java.io.IOException",
"java.io.RandomAccessFile"
] | import java.io.IOException; import java.io.RandomAccessFile; | import java.io.*; | [
"java.io"
] | java.io; | 647,588 |
public static Collection<ItemDeltaType> toItemDeltaTypes(ItemDelta delta) throws SchemaException {
return toItemDeltaTypes(delta, null);
} | static Collection<ItemDeltaType> function(ItemDelta delta) throws SchemaException { return toItemDeltaTypes(delta, null); } | /**
* Converts this delta to PropertyModificationType (XML).
*/ | Converts this delta to PropertyModificationType (XML) | toItemDeltaTypes | {
"repo_name": "gureronder/midpoint",
"path": "infra/schema/src/main/java/com/evolveum/midpoint/schema/DeltaConvertor.java",
"license": "apache-2.0",
"size": 21927
} | [
"com.evolveum.midpoint.prism.delta.ItemDelta",
"com.evolveum.midpoint.util.exception.SchemaException",
"com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType",
"java.util.Collection"
] | import com.evolveum.midpoint.prism.delta.ItemDelta; import com.evolveum.midpoint.util.exception.SchemaException; import com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType; import java.util.Collection; | import com.evolveum.midpoint.prism.delta.*; import com.evolveum.midpoint.util.exception.*; import com.evolveum.prism.xml.ns._public.types_3.*; import java.util.*; | [
"com.evolveum.midpoint",
"com.evolveum.prism",
"java.util"
] | com.evolveum.midpoint; com.evolveum.prism; java.util; | 345,962 |
@Deprecated
public static Object newGroupInParallel(String className, Class<?>[] genericParameters, Object[][] params,
String[] nodeList)
throws ClassNotFoundException, ClassNotReifiableException, ActiveObjectCreationException, NodeException {
Node[] nodeListString = new Node[nodeList.length];
for (int i = 0; i < nodeList.length; i++)
nodeListString[i] = NodeFactory.getNode(nodeList[i]);
return ProActiveGroup.newGroupInParallel(className, genericParameters, params, nodeListString);
} | static Object function(String className, Class<?>[] genericParameters, Object[][] params, String[] nodeList) throws ClassNotFoundException, ClassNotReifiableException, ActiveObjectCreationException, NodeException { Node[] nodeListString = new Node[nodeList.length]; for (int i = 0; i < nodeList.length; i++) nodeListString[i] = NodeFactory.getNode(nodeList[i]); return ProActiveGroup.newGroupInParallel(className, genericParameters, params, nodeListString); } | /**
* Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
* Threads are used to build the group's members. This methods returns when all members were created.
* @param className the name of the (upper) class of the group's member.
* @param params the array that contain the parameters used to build the group's member.
* If <code>params</code> is <code>null</code>, builds an empty group.
* @param nodeList the names of the nodes where the members are created.
* @return a typed group with its members.
* @throws ActiveObjectCreationException if a problem occur while creating the stub or the body
* @throws ClassNotFoundException if the Class<?> corresponding to <code>className</code> can't be found.
* @throws ClassNotReifiableException if the Class<?> corresponding to <code>className</code> can't be reify.
* @throws NodeException if the node was null and that the DefaultNode cannot be created
* @deprecated Use {@link org.objectweb.proactive.api.PAGroup#newGroupInParallel(String,Class<?>[],Object[][],String[])} instead
*/ | Creates an object representing a group (a typed group) and creates members with params cycling on nodeList. Threads are used to build the group's members. This methods returns when all members were created | newGroupInParallel | {
"repo_name": "paraita/programming",
"path": "programming-core/src/main/java/org/objectweb/proactive/core/group/ProActiveGroup.java",
"license": "agpl-3.0",
"size": 96895
} | [
"org.objectweb.proactive.ActiveObjectCreationException",
"org.objectweb.proactive.core.mop.ClassNotReifiableException",
"org.objectweb.proactive.core.node.Node",
"org.objectweb.proactive.core.node.NodeException",
"org.objectweb.proactive.core.node.NodeFactory"
] | import org.objectweb.proactive.ActiveObjectCreationException; import org.objectweb.proactive.core.mop.ClassNotReifiableException; import org.objectweb.proactive.core.node.Node; import org.objectweb.proactive.core.node.NodeException; import org.objectweb.proactive.core.node.NodeFactory; | import org.objectweb.proactive.*; import org.objectweb.proactive.core.mop.*; import org.objectweb.proactive.core.node.*; | [
"org.objectweb.proactive"
] | org.objectweb.proactive; | 1,039,782 |
protected String getSqlForUpper(Function function) {
return "UPPER(" + getSqlFrom(function.getArguments().get(0)) + ")";
}
| String function(Function function) { return STR + getSqlFrom(function.getArguments().get(0)) + ")"; } | /**
* Converts the <code>UPPER</code> function into SQL.
*
* @param function the function to convert.
* @return a string representation of the SQL.
*/ | Converts the <code>UPPER</code> function into SQL | getSqlForUpper | {
"repo_name": "badgerwithagun/morf",
"path": "morf-core/src/main/java/org/alfasoftware/morf/jdbc/SqlDialect.java",
"license": "apache-2.0",
"size": 128834
} | [
"org.alfasoftware.morf.sql.element.Function"
] | import org.alfasoftware.morf.sql.element.Function; | import org.alfasoftware.morf.sql.element.*; | [
"org.alfasoftware.morf"
] | org.alfasoftware.morf; | 75,056 |
@Override
public void addPoint(PointPOJO pointPOJO) {
SQLiteDatabase db = this.getWritableDatabase();
try {
ContentValues values = new ContentValues();
values.put(KEY_TITLE, pointPOJO.getTitle());
values.put(KEY_COORDINATES, pointPOJO.getGeocoordinates());
db.insert(TABLE_NAME, null, values);
db.close();
} catch (Exception e) {
Log.e(Utils.POI_TAG, " Exception :" + e);
}
} | void function(PointPOJO pointPOJO) { SQLiteDatabase db = this.getWritableDatabase(); try { ContentValues values = new ContentValues(); values.put(KEY_TITLE, pointPOJO.getTitle()); values.put(KEY_COORDINATES, pointPOJO.getGeocoordinates()); db.insert(TABLE_NAME, null, values); db.close(); } catch (Exception e) { Log.e(Utils.POI_TAG, STR + e); } } | /**
* Adds a detail to the database.
* IPointListener interface
*
* @param pointPOJO to add
*/ | Adds a detail to the database. IPointListener interface | addPoint | {
"repo_name": "VictorTellez/PointsOfInterest",
"path": "app/src/main/java/com/apps/poi/models/helper/DBPointHelper.java",
"license": "cc0-1.0",
"size": 5971
} | [
"android.content.ContentValues",
"android.database.sqlite.SQLiteDatabase",
"android.util.Log",
"com.apps.poi.models.data.PointPOJO",
"com.apps.poi.utils.Utils"
] | import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; import android.util.Log; import com.apps.poi.models.data.PointPOJO; import com.apps.poi.utils.Utils; | import android.content.*; import android.database.sqlite.*; import android.util.*; import com.apps.poi.models.data.*; import com.apps.poi.utils.*; | [
"android.content",
"android.database",
"android.util",
"com.apps.poi"
] | android.content; android.database; android.util; com.apps.poi; | 1,944,405 |
public long getLastModified(Resource resource)
{
// get the previously used root
String name = resource.getName();
String root = (String)templateRoots.get(name);
try
{
// get a connection to the URL
URL u = new URL(root + name);
URLConnection conn = u.openConnection();
tryToSetTimeout(conn);
return conn.getLastModified();
}
catch (IOException ioe)
{
// the file is not reachable at its previous address
String msg = "URLResourceLoader: '"+name+"' is no longer reachable at '"+root+"'";
Logger.error(this,msg, ioe);
throw new ResourceNotFoundException(msg, ioe);
}
} | long function(Resource resource) { String name = resource.getName(); String root = (String)templateRoots.get(name); try { URL u = new URL(root + name); URLConnection conn = u.openConnection(); tryToSetTimeout(conn); return conn.getLastModified(); } catch (IOException ioe) { String msg = STR+name+STR+root+"'"; Logger.error(this,msg, ioe); throw new ResourceNotFoundException(msg, ioe); } } | /**
* Checks to see when a resource was last modified
*
* @param resource Resource the resource to check
* @return long The time when the resource was last modified or 0 if the file can't be reached
*/ | Checks to see when a resource was last modified | getLastModified | {
"repo_name": "ggonzales/ksl",
"path": "src/org/apache/velocity/runtime/resource/loader/URLResourceLoader.java",
"license": "gpl-3.0",
"size": 7909
} | [
"com.dotmarketing.util.Logger",
"java.io.IOException",
"java.net.URLConnection",
"org.apache.velocity.exception.ResourceNotFoundException",
"org.apache.velocity.runtime.resource.Resource"
] | import com.dotmarketing.util.Logger; import java.io.IOException; import java.net.URLConnection; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.resource.Resource; | import com.dotmarketing.util.*; import java.io.*; import java.net.*; import org.apache.velocity.exception.*; import org.apache.velocity.runtime.resource.*; | [
"com.dotmarketing.util",
"java.io",
"java.net",
"org.apache.velocity"
] | com.dotmarketing.util; java.io; java.net; org.apache.velocity; | 987,071 |
public void setFallbackRegistry(Registry fallbackRegistry) {
this.fallbackRegistry = fallbackRegistry;
}
/**
* Gets the supplier {@link Registry} | void function(Registry fallbackRegistry) { this.fallbackRegistry = fallbackRegistry; } /** * Gets the supplier {@link Registry} | /**
* To use a custom {@link Registry} as fallback.
*/ | To use a custom <code>Registry</code> as fallback | setFallbackRegistry | {
"repo_name": "pax95/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/DefaultRegistry.java",
"license": "apache-2.0",
"size": 12369
} | [
"org.apache.camel.spi.Registry"
] | import org.apache.camel.spi.Registry; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,331,127 |
public List<NotePadMeta> getSelectedNotes()
{
List<NotePadMeta> selection =new ArrayList<NotePadMeta>();
for (NotePadMeta note : notes) {
if (note.isSelected()) {
selection.add(note);
}
}
return selection;
} | List<NotePadMeta> function() { List<NotePadMeta> selection =new ArrayList<NotePadMeta>(); for (NotePadMeta note : notes) { if (note.isSelected()) { selection.add(note); } } return selection; } | /**
* Get an array of all the selected notes
*
* @return An array of all the selected notes.
*/ | Get an array of all the selected notes | getSelectedNotes | {
"repo_name": "soluvas/pdi-ce",
"path": "src/org/pentaho/di/trans/TransMeta.java",
"license": "apache-2.0",
"size": 203052
} | [
"java.util.ArrayList",
"java.util.List",
"org.pentaho.di.core.NotePadMeta"
] | import java.util.ArrayList; import java.util.List; import org.pentaho.di.core.NotePadMeta; | import java.util.*; import org.pentaho.di.core.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 2,767,918 |
public static DataValueSet getDataValueSet( InputStream in )
{
PdfReader reader = null;
DataValueSet dataValueSet = new DataValueSet();
List<org.hisp.dhis.dxf2.datavalue.DataValue> dataValueList = new ArrayList<>();
try
{
reader = new PdfReader( in );
AcroFields form = reader.getAcroFields();
if ( form != null )
{
// Process OrgUnitUID and PeriodID from the PDF Form
String orgUnitUid = form.getField( PdfDataEntryFormUtil.LABELCODE_ORGID ).trim();
String periodId = form.getField( PdfDataEntryFormUtil.LABELCODE_PERIODID ).trim();
if ( periodId == null || periodId.isEmpty() )
{
throw new InvalidIdentifierReferenceException( ERROR_EMPTY_PERIOD );
}
if ( orgUnitUid == null || orgUnitUid.isEmpty() )
{
throw new InvalidIdentifierReferenceException( ERROR_EMPTY_ORG_UNIT );
}
Period period = PeriodType.getPeriodFromIsoString( periodId );
if ( period == null )
{
throw new InvalidIdentifierReferenceException( ERROR_INVALID_PERIOD + periodId );
}
// Loop Through the Fields and get data.
@SuppressWarnings( "unchecked" )
Set<String> fldNames = form.getFields().keySet();
for ( String fldName : fldNames )
{
if ( fldName.startsWith( PdfDataEntryFormUtil.LABELCODE_DATAENTRYTEXTFIELD ) )
{
String[] strArrFldName = fldName.split( "_" );
org.hisp.dhis.dxf2.datavalue.DataValue dataValue = new org.hisp.dhis.dxf2.datavalue.DataValue();
dataValue.setDataElement( strArrFldName[1] );
dataValue.setCategoryOptionCombo( strArrFldName[2] );
dataValue.setOrgUnit( orgUnitUid );
dataValue.setPeriod( period.getIsoDate() );
dataValue.setValue( fieldValueFormat( strArrFldName, form.getField( fldName ) ) );
dataValue.setStoredBy( DATAVALUE_IMPORT_STOREBY );
dataValue.setComment( DATAVALUE_IMPORT_COMMENT );
dataValue.setFollowup( false );
dataValue.setLastUpdated( new SimpleDateFormat( DATAVALUE_IMPORT_TIMESTAMP_DATEFORMAT )
.format( new Date() ) );
dataValueList.add( dataValue );
}
}
dataValueSet.setDataValues( dataValueList );
}
else
{
throw new RuntimeException( "Could not generate PDF AcroFields form from input" );
}
}
catch ( Exception ex )
{
throw new RuntimeException( ex );
}
finally
{
if ( reader != null )
{
reader.close();
}
}
return dataValueSet;
}
| static DataValueSet function( InputStream in ) { PdfReader reader = null; DataValueSet dataValueSet = new DataValueSet(); List<org.hisp.dhis.dxf2.datavalue.DataValue> dataValueList = new ArrayList<>(); try { reader = new PdfReader( in ); AcroFields form = reader.getAcroFields(); if ( form != null ) { String orgUnitUid = form.getField( PdfDataEntryFormUtil.LABELCODE_ORGID ).trim(); String periodId = form.getField( PdfDataEntryFormUtil.LABELCODE_PERIODID ).trim(); if ( periodId == null periodId.isEmpty() ) { throw new InvalidIdentifierReferenceException( ERROR_EMPTY_PERIOD ); } if ( orgUnitUid == null orgUnitUid.isEmpty() ) { throw new InvalidIdentifierReferenceException( ERROR_EMPTY_ORG_UNIT ); } Period period = PeriodType.getPeriodFromIsoString( periodId ); if ( period == null ) { throw new InvalidIdentifierReferenceException( ERROR_INVALID_PERIOD + periodId ); } @SuppressWarnings( STR ) Set<String> fldNames = form.getFields().keySet(); for ( String fldName : fldNames ) { if ( fldName.startsWith( PdfDataEntryFormUtil.LABELCODE_DATAENTRYTEXTFIELD ) ) { String[] strArrFldName = fldName.split( "_" ); org.hisp.dhis.dxf2.datavalue.DataValue dataValue = new org.hisp.dhis.dxf2.datavalue.DataValue(); dataValue.setDataElement( strArrFldName[1] ); dataValue.setCategoryOptionCombo( strArrFldName[2] ); dataValue.setOrgUnit( orgUnitUid ); dataValue.setPeriod( period.getIsoDate() ); dataValue.setValue( fieldValueFormat( strArrFldName, form.getField( fldName ) ) ); dataValue.setStoredBy( DATAVALUE_IMPORT_STOREBY ); dataValue.setComment( DATAVALUE_IMPORT_COMMENT ); dataValue.setFollowup( false ); dataValue.setLastUpdated( new SimpleDateFormat( DATAVALUE_IMPORT_TIMESTAMP_DATEFORMAT ) .format( new Date() ) ); dataValueList.add( dataValue ); } } dataValueSet.setDataValues( dataValueList ); } else { throw new RuntimeException( STR ); } } catch ( Exception ex ) { throw new RuntimeException( ex ); } finally { if ( reader != null ) { reader.close(); } } return dataValueSet; } | /**
* Creates data value set from Input Stream (PDF) for PDF data import
*/ | Creates data value set from Input Stream (PDF) for PDF data import | getDataValueSet | {
"repo_name": "minagri-rwanda/DHIS2-Agriculture",
"path": "dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java",
"license": "bsd-3-clause",
"size": 11646
} | [
"com.lowagie.text.pdf.AcroFields",
"com.lowagie.text.pdf.PdfReader",
"java.io.InputStream",
"java.text.SimpleDateFormat",
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"java.util.Set",
"org.hisp.dhis.common.exception.InvalidIdentifierReferenceException",
"org.hisp.dhis.dxf2.datavalueset.DataValueSet",
"org.hisp.dhis.period.Period",
"org.hisp.dhis.period.PeriodType"
] | import com.lowagie.text.pdf.AcroFields; import com.lowagie.text.pdf.PdfReader; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; import org.hisp.dhis.common.exception.InvalidIdentifierReferenceException; import org.hisp.dhis.dxf2.datavalueset.DataValueSet; import org.hisp.dhis.period.Period; import org.hisp.dhis.period.PeriodType; | import com.lowagie.text.pdf.*; import java.io.*; import java.text.*; import java.util.*; import org.hisp.dhis.common.exception.*; import org.hisp.dhis.dxf2.datavalueset.*; import org.hisp.dhis.period.*; | [
"com.lowagie.text",
"java.io",
"java.text",
"java.util",
"org.hisp.dhis"
] | com.lowagie.text; java.io; java.text; java.util; org.hisp.dhis; | 337,622 |
public void copyFrom(QueryTreeNode node) throws StandardException {
super.copyFrom(node);
CreateIndexNode other = (CreateIndexNode)node;
this.unique = other.unique;
this.indexName = (TableName)
getNodeFactory().copyNode(other.indexName, getParserContext());
this.tableName = (TableName)
getNodeFactory().copyNode(other.tableName, getParserContext());
this.columnList = (IndexColumnList)
getNodeFactory().copyNode(other.columnList, getParserContext());
this.joinType = other.joinType;
this.properties = other.properties; // TODO: Clone?
this.existenceCheck = other.existenceCheck;
this.storageFormat = (StorageFormatNode)getNodeFactory().copyNode(other.storageFormat,
getParserContext());
} | void function(QueryTreeNode node) throws StandardException { super.copyFrom(node); CreateIndexNode other = (CreateIndexNode)node; this.unique = other.unique; this.indexName = (TableName) getNodeFactory().copyNode(other.indexName, getParserContext()); this.tableName = (TableName) getNodeFactory().copyNode(other.tableName, getParserContext()); this.columnList = (IndexColumnList) getNodeFactory().copyNode(other.columnList, getParserContext()); this.joinType = other.joinType; this.properties = other.properties; this.existenceCheck = other.existenceCheck; this.storageFormat = (StorageFormatNode)getNodeFactory().copyNode(other.storageFormat, getParserContext()); } | /**
* Fill this node with a deep copy of the given node.
*/ | Fill this node with a deep copy of the given node | copyFrom | {
"repo_name": "liangry/sqlparser",
"path": "src/main/java/com/foundationdb/sql/parser/CreateIndexNode.java",
"license": "apache-2.0",
"size": 5953
} | [
"com.foundationdb.sql.StandardException"
] | import com.foundationdb.sql.StandardException; | import com.foundationdb.sql.*; | [
"com.foundationdb.sql"
] | com.foundationdb.sql; | 2,358,260 |
public String deleteContentletsFromIdList(String List, String userId) throws PortalException, SystemException, DotDataException,DotSecurityException {
List<String> conditionletWithErrors = new ArrayList<>();
validateUser();
ContentletAPI conAPI = APILocator.getContentletAPI();
String[] inodes = List.split(",");
Integer contdeleted = 0;
User user = UserLocalManagerUtil.getUserById(userId);
for (int i = 0; i < inodes.length; i++) {
inodes[i] = inodes[i].trim();
}
List<Contentlet> contentlets = new ArrayList<Contentlet>();
for (String inode : inodes) {
if (!inode.trim().equals("")) {
contentlets.addAll(conAPI.getSiblings(inode));
}
}
if (!contentlets.isEmpty()) {
for (Contentlet contentlet : contentlets) {
boolean delete = conAPI.destroy(contentlet, user, true);
if (!delete){
conditionletWithErrors.add(contentlet.getIdentifier());
}else{
contdeleted++;
}
}
return getDeleteContentletMessage(user, conditionletWithErrors, contdeleted);
}else{
return LanguageUtil.get(user, "message.contentlet.delete.error.dontExists");
}
}
| String function(String List, String userId) throws PortalException, SystemException, DotDataException,DotSecurityException { List<String> conditionletWithErrors = new ArrayList<>(); validateUser(); ContentletAPI conAPI = APILocator.getContentletAPI(); String[] inodes = List.split(","); Integer contdeleted = 0; User user = UserLocalManagerUtil.getUserById(userId); for (int i = 0; i < inodes.length; i++) { inodes[i] = inodes[i].trim(); } List<Contentlet> contentlets = new ArrayList<Contentlet>(); for (String inode : inodes) { if (!inode.trim().equals(STRmessage.contentlet.delete.error.dontExists"); } } | /**
* Takes a list of comma-separated Identifiers and deletes them.
*
* @param List
* - The list of Identifiers as Strings.
* @param userId
* - The ID of the user performing this action.
* @return A String array of information that provides the user with the
* results of performing this action.
* @throws PortalException
* An error occurred when retrieving the user information.
* @throws SystemException
* A system error occurred. Please check the system logs.
* @throws DotDataException
* An error occurred when accessing the contentlets to delete.
* @throws DotSecurityException
* The user does not have permissions to perform this action.
*/ | Takes a list of comma-separated Identifiers and deletes them | deleteContentletsFromIdList | {
"repo_name": "dotCMS/core",
"path": "dotCMS/src/main/java/com/dotmarketing/portlets/cmsmaintenance/ajax/CMSMaintenanceAjax.java",
"license": "gpl-3.0",
"size": 12972
} | [
"com.dotmarketing.business.APILocator",
"com.dotmarketing.exception.DotDataException",
"com.dotmarketing.exception.DotSecurityException",
"com.dotmarketing.portlets.contentlet.business.ContentletAPI",
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.liferay.portal.PortalException",
"com.liferay.portal.SystemException",
"com.liferay.portal.ejb.UserLocalManagerUtil",
"com.liferay.portal.model.User",
"java.util.ArrayList",
"java.util.List"
] | import com.dotmarketing.business.APILocator; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.exception.DotSecurityException; import com.dotmarketing.portlets.contentlet.business.ContentletAPI; import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.liferay.portal.PortalException; import com.liferay.portal.SystemException; import com.liferay.portal.ejb.UserLocalManagerUtil; import com.liferay.portal.model.User; import java.util.ArrayList; import java.util.List; | import com.dotmarketing.business.*; import com.dotmarketing.exception.*; import com.dotmarketing.portlets.contentlet.business.*; import com.dotmarketing.portlets.contentlet.model.*; import com.liferay.portal.*; import com.liferay.portal.ejb.*; import com.liferay.portal.model.*; import java.util.*; | [
"com.dotmarketing.business",
"com.dotmarketing.exception",
"com.dotmarketing.portlets",
"com.liferay.portal",
"java.util"
] | com.dotmarketing.business; com.dotmarketing.exception; com.dotmarketing.portlets; com.liferay.portal; java.util; | 2,092,651 |
public void initialize(Context context, HapticFeedbackController hapticFeedbackController,
int initialHoursOfDay, int initialMinutes, boolean is24HourMode) {
if (mTimeInitialized) {
Log.e(TAG, "Time has already been initialized.");
return;
}
mHapticFeedbackController = hapticFeedbackController;
mIs24HourMode = is24HourMode;
mHideAmPm = mAccessibilityManager.isTouchExplorationEnabled()? true : mIs24HourMode;
// Initialize the circle and AM/PM circles if applicable.
mCircleView.initialize(context, mHideAmPm);
mCircleView.invalidate();
if (!mHideAmPm) {
mAmPmCirclesView.initialize(context, initialHoursOfDay < 12? AM : PM);
mAmPmCirclesView.invalidate();
}
// Initialize the hours and minutes numbers.
Resources res = context.getResources();
int[] hours = {12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
int[] hours_24 = {0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
int[] minutes = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55};
String[] hoursTexts = new String[12];
String[] innerHoursTexts = new String[12];
String[] minutesTexts = new String[12];
for (int i = 0; i < 12; i++) {
hoursTexts[i] = is24HourMode?
String.format("%02d", hours_24[i]) : String.format("%d", hours[i]);
innerHoursTexts[i] = String.format("%d", hours[i]);
minutesTexts[i] = String.format("%02d", minutes[i]);
}
mHourRadialTextsView.initialize(res,
hoursTexts, (is24HourMode? innerHoursTexts : null), mHideAmPm, true);
mHourRadialTextsView.invalidate();
mMinuteRadialTextsView.initialize(res, minutesTexts, null, mHideAmPm, false);
mMinuteRadialTextsView.invalidate();
// Initialize the currently-selected hour and minute.
setValueForItem(HOUR_INDEX, initialHoursOfDay);
setValueForItem(MINUTE_INDEX, initialMinutes);
int hourDegrees = (initialHoursOfDay % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE;
mHourRadialSelectorView.initialize(context, mHideAmPm, is24HourMode, true,
hourDegrees, isHourInnerCircle(initialHoursOfDay));
int minuteDegrees = initialMinutes * MINUTE_VALUE_TO_DEGREES_STEP_SIZE;
mMinuteRadialSelectorView.initialize(context, mHideAmPm, false, false,
minuteDegrees, false);
mTimeInitialized = true;
} | void function(Context context, HapticFeedbackController hapticFeedbackController, int initialHoursOfDay, int initialMinutes, boolean is24HourMode) { if (mTimeInitialized) { Log.e(TAG, STR); return; } mHapticFeedbackController = hapticFeedbackController; mIs24HourMode = is24HourMode; mHideAmPm = mAccessibilityManager.isTouchExplorationEnabled()? true : mIs24HourMode; mCircleView.initialize(context, mHideAmPm); mCircleView.invalidate(); if (!mHideAmPm) { mAmPmCirclesView.initialize(context, initialHoursOfDay < 12? AM : PM); mAmPmCirclesView.invalidate(); } Resources res = context.getResources(); int[] hours = {12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; int[] hours_24 = {0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}; int[] minutes = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55}; String[] hoursTexts = new String[12]; String[] innerHoursTexts = new String[12]; String[] minutesTexts = new String[12]; for (int i = 0; i < 12; i++) { hoursTexts[i] = is24HourMode? String.format("%02d", hours_24[i]) : String.format("%d", hours[i]); innerHoursTexts[i] = String.format("%d", hours[i]); minutesTexts[i] = String.format("%02d", minutes[i]); } mHourRadialTextsView.initialize(res, hoursTexts, (is24HourMode? innerHoursTexts : null), mHideAmPm, true); mHourRadialTextsView.invalidate(); mMinuteRadialTextsView.initialize(res, minutesTexts, null, mHideAmPm, false); mMinuteRadialTextsView.invalidate(); setValueForItem(HOUR_INDEX, initialHoursOfDay); setValueForItem(MINUTE_INDEX, initialMinutes); int hourDegrees = (initialHoursOfDay % 12) * HOUR_VALUE_TO_DEGREES_STEP_SIZE; mHourRadialSelectorView.initialize(context, mHideAmPm, is24HourMode, true, hourDegrees, isHourInnerCircle(initialHoursOfDay)); int minuteDegrees = initialMinutes * MINUTE_VALUE_TO_DEGREES_STEP_SIZE; mMinuteRadialSelectorView.initialize(context, mHideAmPm, false, false, minuteDegrees, false); mTimeInitialized = true; } | /**
* Initialize the Layout with starting values.
* @param context
* @param initialHoursOfDay
* @param initialMinutes
* @param is24HourMode
*/ | Initialize the Layout with starting values | initialize | {
"repo_name": "blksup/Habit-Tracker",
"path": "app/src/main/java/com/android/datetimepicker/time/RadialPickerLayout.java",
"license": "gpl-3.0",
"size": 35161
} | [
"android.content.Context",
"android.content.res.Resources",
"android.util.Log",
"com.android.datetimepicker.HapticFeedbackController"
] | import android.content.Context; import android.content.res.Resources; import android.util.Log; import com.android.datetimepicker.HapticFeedbackController; | import android.content.*; import android.content.res.*; import android.util.*; import com.android.datetimepicker.*; | [
"android.content",
"android.util",
"com.android.datetimepicker"
] | android.content; android.util; com.android.datetimepicker; | 1,906,189 |
private Response delete(int projectId) {
ResponseBuilder responseBuilder = Response.noContent();
ProjectDao dao = new ProjectDao();
try {
Project project = dao.findById(projectId);
if (project == null) {
LOG.warn("Proect with id " + projectId + "does not exist.");
responseBuilder.status(Status.BAD_REQUEST);
responseBuilder.entity("Project with id " + projectId + " does not exist.");
} else {
dao.delete(project);
}
} catch (RuntimeException e) {
LOG.error("Error deleting project: " + e, e);
responseBuilder.status(Status.INTERNAL_SERVER_ERROR);
responseBuilder.entity("An error occurred while deleting the project.");
}
return responseBuilder.build();
} | Response function(int projectId) { ResponseBuilder responseBuilder = Response.noContent(); ProjectDao dao = new ProjectDao(); try { Project project = dao.findById(projectId); if (project == null) { LOG.warn(STR + projectId + STR); responseBuilder.status(Status.BAD_REQUEST); responseBuilder.entity(STR + projectId + STR); } else { dao.delete(project); } } catch (RuntimeException e) { LOG.error(STR + e, e); responseBuilder.status(Status.INTERNAL_SERVER_ERROR); responseBuilder.entity(STR); } return responseBuilder.build(); } | /**
* Check that project exists and delete it.
*
* @param projectId
* @return Response suitable to pass to client
*/ | Check that project exists and delete it | delete | {
"repo_name": "rkadle/Tank",
"path": "rest/service/project/src/main/java/com/intuit/tank/service/impl/v1/project/ProjectServiceV1.java",
"license": "epl-1.0",
"size": 12830
} | [
"com.intuit.tank.dao.ProjectDao",
"com.intuit.tank.project.Project",
"javax.ws.rs.core.Response"
] | import com.intuit.tank.dao.ProjectDao; import com.intuit.tank.project.Project; import javax.ws.rs.core.Response; | import com.intuit.tank.dao.*; import com.intuit.tank.project.*; import javax.ws.rs.core.*; | [
"com.intuit.tank",
"javax.ws"
] | com.intuit.tank; javax.ws; | 2,450,518 |
@Override
public String getCustomLockDescriptor(Person user) {
if (newMaintainableObject == null) {
throw new PessimisticLockingException("Maintenance Document " + getDocumentNumber() +
" is using pessimistic locking with custom lock descriptors, but no new maintainable object has been defined");
}
return newMaintainableObject.getCustomLockDescriptor(user);
}
| String function(Person user) { if (newMaintainableObject == null) { throw new PessimisticLockingException(STR + getDocumentNumber() + STR); } return newMaintainableObject.getCustomLockDescriptor(user); } | /**
* Returns the custom lock descriptor generated by the new maintainable object, if defined. Will throw a
* PessimisticLockingException if the new maintainable is null.
*
* @see org.kuali.rice.krad.document.Document#getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person)
* @see org.kuali.rice.krad.maintenance.Maintainable#getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person)
*/ | Returns the custom lock descriptor generated by the new maintainable object, if defined. Will throw a PessimisticLockingException if the new maintainable is null | getCustomLockDescriptor | {
"repo_name": "ewestfal/rice-svn2git-test",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/maintenance/MaintenanceDocumentBase.java",
"license": "apache-2.0",
"size": 49628
} | [
"org.kuali.rice.kim.api.identity.Person",
"org.kuali.rice.krad.exception.PessimisticLockingException"
] | import org.kuali.rice.kim.api.identity.Person; import org.kuali.rice.krad.exception.PessimisticLockingException; | import org.kuali.rice.kim.api.identity.*; import org.kuali.rice.krad.exception.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,359,777 |
public OsgiRegistration registerToOsgi(
Class<? extends Module> configBeanClass, AutoCloseable instance,
ModuleIdentifier moduleIdentifier) {
try {
final Set<Class<?>> configuresInterfaces = InterfacesHelper
.getOsgiRegistrationTypes(configBeanClass);
checkInstanceImplementing(instance, configuresInterfaces);
// bundleContext.registerService blows up with empty 'clazzes'
if (configuresInterfaces.isEmpty() == false) {
final Dictionary<String, ?> propertiesForOsgi = getPropertiesForOsgi(moduleIdentifier);
final ServiceRegistration<?> serviceRegistration = bundleContext
.registerService(classesToNames(configuresInterfaces), instance, propertiesForOsgi);
return new OsgiRegistration(serviceRegistration);
} else {
return new OsgiRegistration();
}
} catch (IllegalStateException e) {
throw new IllegalStateException(
"Error while registering instance into OSGi Service Registry: "
+ moduleIdentifier, e);
}
} | OsgiRegistration function( Class<? extends Module> configBeanClass, AutoCloseable instance, ModuleIdentifier moduleIdentifier) { try { final Set<Class<?>> configuresInterfaces = InterfacesHelper .getOsgiRegistrationTypes(configBeanClass); checkInstanceImplementing(instance, configuresInterfaces); if (configuresInterfaces.isEmpty() == false) { final Dictionary<String, ?> propertiesForOsgi = getPropertiesForOsgi(moduleIdentifier); final ServiceRegistration<?> serviceRegistration = bundleContext .registerService(classesToNames(configuresInterfaces), instance, propertiesForOsgi); return new OsgiRegistration(serviceRegistration); } else { return new OsgiRegistration(); } } catch (IllegalStateException e) { throw new IllegalStateException( STR + moduleIdentifier, e); } } | /**
* To be called for every created, reconfigured and recreated config bean.
* It is expected that before using this method OSGi service registry will
* be cleaned from previous registrations.
*/ | To be called for every created, reconfigured and recreated config bean. It is expected that before using this method OSGi service registry will be cleaned from previous registrations | registerToOsgi | {
"repo_name": "xiaohanz/softcontroller",
"path": "opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/BeanToOsgiServiceManager.java",
"license": "epl-1.0",
"size": 4679
} | [
"java.util.Dictionary",
"java.util.Set",
"org.opendaylight.controller.config.api.ModuleIdentifier",
"org.opendaylight.controller.config.manager.impl.util.InterfacesHelper",
"org.opendaylight.controller.config.spi.Module",
"org.osgi.framework.ServiceRegistration"
] | import java.util.Dictionary; import java.util.Set; import org.opendaylight.controller.config.api.ModuleIdentifier; import org.opendaylight.controller.config.manager.impl.util.InterfacesHelper; import org.opendaylight.controller.config.spi.Module; import org.osgi.framework.ServiceRegistration; | import java.util.*; import org.opendaylight.controller.config.api.*; import org.opendaylight.controller.config.manager.impl.util.*; import org.opendaylight.controller.config.spi.*; import org.osgi.framework.*; | [
"java.util",
"org.opendaylight.controller",
"org.osgi.framework"
] | java.util; org.opendaylight.controller; org.osgi.framework; | 1,155,193 |
@Override
public void run()
{
int secsToMillis = 1000;
try (BufferedInputStream in = new BufferedInputStream(clientSocket.getInputStream());
BufferedOutputStream out = new BufferedOutputStream(clientSocket.getOutputStream()))
{
byte[] msg = new byte[4096];
int bytesRead = 0;
int n;
while ((n = in.read(msg, bytesRead, 256)) != -1)
{
bytesRead += n;
if (bytesRead == 4096)
{
break;
}
if (in.available() == 0)
{
break;
}
}
Thread.sleep(DELAY_SECS * secsToMillis);
for (int i = bytesRead; i > 0; i--)
{
out.write(msg[i - 1]);
}
out.flush();
} catch (Exception e)
{
e.printStackTrace();
}
} | void function() { int secsToMillis = 1000; try (BufferedInputStream in = new BufferedInputStream(clientSocket.getInputStream()); BufferedOutputStream out = new BufferedOutputStream(clientSocket.getOutputStream())) { byte[] msg = new byte[4096]; int bytesRead = 0; int n; while ((n = in.read(msg, bytesRead, 256)) != -1) { bytesRead += n; if (bytesRead == 4096) { break; } if (in.available() == 0) { break; } } Thread.sleep(DELAY_SECS * secsToMillis); for (int i = bytesRead; i > 0; i--) { out.write(msg[i - 1]); } out.flush(); } catch (Exception e) { e.printStackTrace(); } } | /**
* Reads a string from the client, sleeps the specified time and
* returns the reversed string.
*/ | Reads a string from the client, sleeps the specified time and returns the reversed string | run | {
"repo_name": "KTH-ID2212/exercise5",
"path": "WordReverser/src/se/kth/id2212/ex5/wordreverter/gui/SlowConnectionHandler.java",
"license": "apache-2.0",
"size": 1740
} | [
"java.io.BufferedInputStream",
"java.io.BufferedOutputStream"
] | import java.io.BufferedInputStream; import java.io.BufferedOutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,200,566 |
@Override
public void handlePreferences(GenericPreferencesEvent event) {
log.debug("Called");
if (event == null) {
log.warn("Received a null event");
return;
}
log.debug("Event class is {}", event.getClass().getSimpleName());
log.debug("Broadcasting to {} listener(s)", listeners.size());
for (GenericPreferencesEventListener listener : listeners) {
Preconditions.checkNotNull(listener, "'listener must be present'");
listener.onPreferencesEvent(event);
}
} | void function(GenericPreferencesEvent event) { log.debug(STR); if (event == null) { log.warn(STR); return; } log.debug(STR, event.getClass().getSimpleName()); log.debug(STR, listeners.size()); for (GenericPreferencesEventListener listener : listeners) { Preconditions.checkNotNull(listener, STR); listener.onPreferencesEvent(event); } } | /**
* Handles the process of broadcasting the event to listeners
* allowing this process to be decoupled
*
* @param event The generic event (or its proxy)
*/ | Handles the process of broadcasting the event to listeners allowing this process to be decoupled | handlePreferences | {
"repo_name": "oscarguindzberg/multibit-hd",
"path": "mbhd-swing/src/main/java/org/multibit/hd/ui/platform/handler/DefaultPreferencesHandler.java",
"license": "mit",
"size": 2447
} | [
"com.google.common.base.Preconditions",
"org.multibit.hd.ui.platform.listener.GenericPreferencesEvent",
"org.multibit.hd.ui.platform.listener.GenericPreferencesEventListener"
] | import com.google.common.base.Preconditions; import org.multibit.hd.ui.platform.listener.GenericPreferencesEvent; import org.multibit.hd.ui.platform.listener.GenericPreferencesEventListener; | import com.google.common.base.*; import org.multibit.hd.ui.platform.listener.*; | [
"com.google.common",
"org.multibit.hd"
] | com.google.common; org.multibit.hd; | 1,476,261 |
public Object getValueAt(final int rowIndex,
final int columnIndex)
{
SearchResult result = rowData.get(rowIndex);
switch (columnIndex)
{
case 0:
return result.getName();
case 1:
return getDate(result.getLastModified());
case 2:
return getFileSize(result.getFileSize());
default:
return "x";
}
}
| Object function(final int rowIndex, final int columnIndex) { SearchResult result = rowData.get(rowIndex); switch (columnIndex) { case 0: return result.getName(); case 1: return getDate(result.getLastModified()); case 2: return getFileSize(result.getFileSize()); default: return "x"; } } | /**
* Retrieves a value from a row/column.
*
* @param rowIndex the row index
* @param columnIndex the column index
* @return the value at the specified row/column
*/ | Retrieves a value from a row/column | getValueAt | {
"repo_name": "argonium/nemo",
"path": "src/io/miti/nemo/app/DetailsTableModel.java",
"license": "mit",
"size": 5141
} | [
"io.miti.nemo.common.SearchResult"
] | import io.miti.nemo.common.SearchResult; | import io.miti.nemo.common.*; | [
"io.miti.nemo"
] | io.miti.nemo; | 208,209 |
public ArrayList<String> getAgentsInMeeting() {
return agentsInMeeting;
} | ArrayList<String> function() { return agentsInMeeting; } | /**
* Gets a list of identifiers of agents that are in this meeting.
*
* @return the agentsInMeeting the list of names
*/ | Gets a list of identifiers of agents that are in this meeting | getAgentsInMeeting | {
"repo_name": "TobiasMende/CASi",
"path": "src/de/uniluebeck/imis/casi/simulation/model/actions/HaveAMeeting.java",
"license": "lgpl-3.0",
"size": 2599
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,956,115 |
default List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName)
{
return listTables(session, schemaName.orElse(null));
} | default List<SchemaTableName> listTables(ConnectorSession session, Optional<String> schemaName) { return listTables(session, schemaName.orElse(null)); } | /**
* List table names, possibly filtered by schema. An empty list is returned if none match.
*/ | List table names, possibly filtered by schema. An empty list is returned if none match | listTables | {
"repo_name": "sopel39/presto",
"path": "presto-spi/src/main/java/io/prestosql/spi/connector/ConnectorMetadata.java",
"license": "apache-2.0",
"size": 18147
} | [
"java.util.List",
"java.util.Optional"
] | import java.util.List; import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 1,304,190 |
DatabaseTable getDatabaseTable() {
return getDataBase().getTable(ComunicationLayerNetworkServiceDatabaseConstants.INCOMING_MESSAGES_TABLE_NAME);
} | DatabaseTable getDatabaseTable() { return getDataBase().getTable(ComunicationLayerNetworkServiceDatabaseConstants.INCOMING_MESSAGES_TABLE_NAME); } | /**
* Return the DatabaseTable
*
* @return DatabaseTable
*/ | Return the DatabaseTable | getDatabaseTable | {
"repo_name": "fvasquezjatar/fermat-unused",
"path": "CCP/plugin/network_service/fermat-ccp-plugin-network-service-crypto-transmission-bitdubai/src/main/java/com/bitdubai/fermat_ccp_plugin/layer/network_service/crypto_transmission/developer/bitdubai/version_1/database/communication/IncomingMessageDao.java",
"license": "mit",
"size": 23073
} | [
"com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable",
"com.bitdubai.fermat_ccp_plugin.layer.network_service.crypto_transmission.developer.bitdubai.version_1.database.ComunicationLayerNetworkServiceDatabaseConstants"
] | import com.bitdubai.fermat_api.layer.osa_android.database_system.DatabaseTable; import com.bitdubai.fermat_ccp_plugin.layer.network_service.crypto_transmission.developer.bitdubai.version_1.database.ComunicationLayerNetworkServiceDatabaseConstants; | import com.bitdubai.fermat_api.layer.osa_android.database_system.*; import com.bitdubai.fermat_ccp_plugin.layer.network_service.crypto_transmission.developer.bitdubai.version_1.database.*; | [
"com.bitdubai.fermat_api",
"com.bitdubai.fermat_ccp_plugin"
] | com.bitdubai.fermat_api; com.bitdubai.fermat_ccp_plugin; | 310,983 |
public ProcessTxnResult processTxn(TxnHeader hdr, Record txn) {
return dataTree.processTxn(hdr, txn);
} | ProcessTxnResult function(TxnHeader hdr, Record txn) { return dataTree.processTxn(hdr, txn); } | /**
* the process txn on the data
* @param hdr the txnheader for the txn
* @param txn the transaction that needs to be processed
* @return the result of processing the transaction on this
* datatree/zkdatabase
*/ | the process txn on the data | processTxn | {
"repo_name": "ExactTargetDev/zookeeper",
"path": "src/java/main/org/apache/zookeeper/server/ZKDatabase.java",
"license": "apache-2.0",
"size": 15459
} | [
"org.apache.jute.Record",
"org.apache.zookeeper.server.DataTree",
"org.apache.zookeeper.txn.TxnHeader"
] | import org.apache.jute.Record; import org.apache.zookeeper.server.DataTree; import org.apache.zookeeper.txn.TxnHeader; | import org.apache.jute.*; import org.apache.zookeeper.server.*; import org.apache.zookeeper.txn.*; | [
"org.apache.jute",
"org.apache.zookeeper"
] | org.apache.jute; org.apache.zookeeper; | 1,523,865 |
public void removeChildNode(final PortfolioNode childNode) {
_childNodes.remove(childNode);
} | void function(final PortfolioNode childNode) { _childNodes.remove(childNode); } | /**
* Removes a node from the list of immediate children.
*
* @param childNode the child node to remove, not null
*/ | Removes a node from the list of immediate children | removeChildNode | {
"repo_name": "McLeodMoores/starling",
"path": "projects/core/src/main/java/com/opengamma/core/position/impl/SimplePortfolioNode.java",
"license": "apache-2.0",
"size": 14221
} | [
"com.opengamma.core.position.PortfolioNode"
] | import com.opengamma.core.position.PortfolioNode; | import com.opengamma.core.position.*; | [
"com.opengamma.core"
] | com.opengamma.core; | 2,512,086 |
void aggregate(Aggregate op); | void aggregate(Aggregate op); | /**
* This method enqueues aggregate op for future invocation
*
* @param op
*/ | This method enqueues aggregate op for future invocation | aggregate | {
"repo_name": "RobAltena/deeplearning4j",
"path": "nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/GridExecutioner.java",
"license": "apache-2.0",
"size": 1921
} | [
"org.nd4j.linalg.api.ops.aggregates.Aggregate"
] | import org.nd4j.linalg.api.ops.aggregates.Aggregate; | import org.nd4j.linalg.api.ops.aggregates.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 1,680,977 |
public Configuration getConfiguration(String key); | Configuration function(String key); | /**
* Get the configuration for the given key. If there is no such configuration, a new one is
* created with empty value (returns null).
*
* @param key unique configuration key for lookup
* @return a configuration object with either the configured value or null as value
*/ | Get the configuration for the given key. If there is no such configuration, a new one is created with empty value (returns null) | getConfiguration | {
"repo_name": "StexX/KiWi-OSE",
"path": "src/action/kiwi/api/config/ConfigurationService.java",
"license": "bsd-3-clause",
"size": 7332
} | [
"kiwi.config.Configuration"
] | import kiwi.config.Configuration; | import kiwi.config.*; | [
"kiwi.config"
] | kiwi.config; | 2,420,413 |
@Override
public DataSourcePropertiesInterface getDataSource() {
return sldData.getDataSourceProperties();
} | DataSourcePropertiesInterface function() { return sldData.getDataSourceProperties(); } | /**
* Gets the data source.
*
* @return the data source
*/ | Gets the data source | getDataSource | {
"repo_name": "robward-scisys/sldeditor",
"path": "modules/application/src/test/java/com/sldeditor/test/unit/datasource/impl/DummyInternalSLDFile4.java",
"license": "gpl-3.0",
"size": 4046
} | [
"com.sldeditor.common.DataSourcePropertiesInterface"
] | import com.sldeditor.common.DataSourcePropertiesInterface; | import com.sldeditor.common.*; | [
"com.sldeditor.common"
] | com.sldeditor.common; | 326,736 |
private ComponentType getComponentType(SootClass currentClass) {
if (componentTypeCache.containsKey(currentClass))
return componentTypeCache.get(currentClass);
// Check the type of this class
ComponentType ctype = ComponentType.Plain;
List<SootClass> extendedClasses = Scene.v().getActiveHierarchy().getSuperclassesOf(currentClass);
for(SootClass sc : extendedClasses) {
if(sc.getName().equals(AndroidEntryPointConstants.APPLICATIONCLASS))
ctype = ComponentType.Application;
else if(sc.getName().equals(AndroidEntryPointConstants.ACTIVITYCLASS))
ctype = ComponentType.Activity;
else if(sc.getName().equals(AndroidEntryPointConstants.SERVICECLASS))
ctype = ComponentType.Service;
else if(sc.getName().equals(AndroidEntryPointConstants.BROADCASTRECEIVERCLASS))
ctype = ComponentType.BroadcastReceiver;
else if(sc.getName().equals(AndroidEntryPointConstants.CONTENTPROVIDERCLASS))
ctype = ComponentType.ContentProvider;
else
continue;
// As soon was we have found one matching parent class, we abort
break;
}
componentTypeCache.put(currentClass, ctype);
return ctype;
} | ComponentType function(SootClass currentClass) { if (componentTypeCache.containsKey(currentClass)) return componentTypeCache.get(currentClass); ComponentType ctype = ComponentType.Plain; List<SootClass> extendedClasses = Scene.v().getActiveHierarchy().getSuperclassesOf(currentClass); for(SootClass sc : extendedClasses) { if(sc.getName().equals(AndroidEntryPointConstants.APPLICATIONCLASS)) ctype = ComponentType.Application; else if(sc.getName().equals(AndroidEntryPointConstants.ACTIVITYCLASS)) ctype = ComponentType.Activity; else if(sc.getName().equals(AndroidEntryPointConstants.SERVICECLASS)) ctype = ComponentType.Service; else if(sc.getName().equals(AndroidEntryPointConstants.BROADCASTRECEIVERCLASS)) ctype = ComponentType.BroadcastReceiver; else if(sc.getName().equals(AndroidEntryPointConstants.CONTENTPROVIDERCLASS)) ctype = ComponentType.ContentProvider; else continue; break; } componentTypeCache.put(currentClass, ctype); return ctype; } | /**
* Gets the type of component represented by the given Soot class
* @param currentClass The class for which to get the component type
* @return The component type of the given class
*/ | Gets the type of component represented by the given Soot class | getComponentType | {
"repo_name": "xph906/FlowDroidInfoflowNew",
"path": "src/soot/jimple/infoflow/entryPointCreators/AndroidEntryPointCreator.java",
"license": "lgpl-2.1",
"size": 43830
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,422,381 |
public void init()
{
PropertyCheck.mandatory(this, "storeUrl", storeRef);
PropertyCheck.mandatory(this, "transactionService", transactionService);
PropertyCheck.mandatory(this, "nodeService", nodeService);
PropertyCheck.mandatory(this, "permissionServiceSPI", permissionServiceSPI);
PropertyCheck.mandatory(this, "authorityService", authorityService);
PropertyCheck.mandatory(this, "authenticationService", authenticationService);
PropertyCheck.mandatory(this, "namespacePrefixResolver", namespacePrefixResolver);
PropertyCheck.mandatory(this, "policyComponent", policyComponent);
PropertyCheck.mandatory(this, "personCache", personCache);
PropertyCheck.mandatory(this, "aclDao", aclDao);
PropertyCheck.mandatory(this, "homeFolderManager", homeFolderManager);
PropertyCheck.mandatory(this, "repoAdminService", repoAdminService);
beforeCreateNodeValidationBehaviour = new JavaBehaviour(this, "beforeCreateNodeValidation");
this.policyComponent.bindClassBehaviour(
BeforeCreateNodePolicy.QNAME,
ContentModel.TYPE_PERSON,
beforeCreateNodeValidationBehaviour);
beforeDeleteNodeValidationBehaviour = new JavaBehaviour(this, "beforeDeleteNodeValidation");
this.policyComponent.bindClassBehaviour(
BeforeDeleteNodePolicy.QNAME,
ContentModel.TYPE_PERSON,
beforeDeleteNodeValidationBehaviour);
this.policyComponent.bindClassBehaviour(
OnCreateNodePolicy.QNAME,
ContentModel.TYPE_PERSON,
new JavaBehaviour(this, "onCreateNode"));
this.policyComponent.bindClassBehaviour(
BeforeDeleteNodePolicy.QNAME,
ContentModel.TYPE_PERSON,
new JavaBehaviour(this, "beforeDeleteNode"));
this.policyComponent.bindClassBehaviour(
OnUpdatePropertiesPolicy.QNAME,
ContentModel.TYPE_PERSON,
new JavaBehaviour(this, "onUpdateProperties"));
this.policyComponent.bindClassBehaviour(
OnUpdatePropertiesPolicy.QNAME,
ContentModel.TYPE_USER,
new JavaBehaviour(this, "onUpdatePropertiesUser"));
}
/**
* {@inheritDoc}
| void function() { PropertyCheck.mandatory(this, STR, storeRef); PropertyCheck.mandatory(this, STR, transactionService); PropertyCheck.mandatory(this, STR, nodeService); PropertyCheck.mandatory(this, STR, permissionServiceSPI); PropertyCheck.mandatory(this, STR, authorityService); PropertyCheck.mandatory(this, STR, authenticationService); PropertyCheck.mandatory(this, STR, namespacePrefixResolver); PropertyCheck.mandatory(this, STR, policyComponent); PropertyCheck.mandatory(this, STR, personCache); PropertyCheck.mandatory(this, STR, aclDao); PropertyCheck.mandatory(this, STR, homeFolderManager); PropertyCheck.mandatory(this, STR, repoAdminService); beforeCreateNodeValidationBehaviour = new JavaBehaviour(this, STR); this.policyComponent.bindClassBehaviour( BeforeCreateNodePolicy.QNAME, ContentModel.TYPE_PERSON, beforeCreateNodeValidationBehaviour); beforeDeleteNodeValidationBehaviour = new JavaBehaviour(this, STR); this.policyComponent.bindClassBehaviour( BeforeDeleteNodePolicy.QNAME, ContentModel.TYPE_PERSON, beforeDeleteNodeValidationBehaviour); this.policyComponent.bindClassBehaviour( OnCreateNodePolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, STR)); this.policyComponent.bindClassBehaviour( BeforeDeleteNodePolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, STR)); this.policyComponent.bindClassBehaviour( OnUpdatePropertiesPolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, STR)); this.policyComponent.bindClassBehaviour( OnUpdatePropertiesPolicy.QNAME, ContentModel.TYPE_USER, new JavaBehaviour(this, STR)); } /** * {@inheritDoc} | /**
* Spring bean init method
*/ | Spring bean init method | init | {
"repo_name": "Kast0rTr0y/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/security/person/PersonServiceImpl.java",
"license": "lgpl-3.0",
"size": 80307
} | [
"org.alfresco.model.ContentModel",
"org.alfresco.repo.node.NodeServicePolicies",
"org.alfresco.repo.policy.JavaBehaviour",
"org.alfresco.util.PropertyCheck"
] | import org.alfresco.model.ContentModel; import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.JavaBehaviour; import org.alfresco.util.PropertyCheck; | import org.alfresco.model.*; import org.alfresco.repo.node.*; import org.alfresco.repo.policy.*; import org.alfresco.util.*; | [
"org.alfresco.model",
"org.alfresco.repo",
"org.alfresco.util"
] | org.alfresco.model; org.alfresco.repo; org.alfresco.util; | 2,254,470 |
public void seek(long position) throws IOException {
inputStream.seek(position);
} | void function(long position) throws IOException { inputStream.seek(position); } | /**
* Seeks to the specified position.
* @param position The position in bytes.
* @throws IOException On read error
*/ | Seeks to the specified position | seek | {
"repo_name": "sedmelluq/lavaplayer",
"path": "main/src/main/java/com/sedmelluq/discord/lavaplayer/container/matroska/format/MatroskaFileReader.java",
"license": "apache-2.0",
"size": 7560
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,713,770 |
@Override
public String toString() {
return new String(buf, 0, count);
}
/**
* Returns the contents of this ByteArrayOutputStream as a string. Each byte
* {@code b} in this stream is converted to a character {@code c} using the
* following function:
* {@code c == (char)(((hibyte & 0xff) << 8) | (b & 0xff))}. This method is
* deprecated and either {@link #toString()} or {@link #toString(String)} | String function() { return new String(buf, 0, count); } /** * Returns the contents of this ByteArrayOutputStream as a string. Each byte * {@code b} in this stream is converted to a character {@code c} using the * following function: * {@code c == (char)(((hibyte & 0xff) << 8) (b & 0xff))}. This method is * deprecated and either {@link #toString()} or {@link #toString(String)} | /**
* Returns the contents of this ByteArrayOutputStream as a string. Any
* changes made to the receiver after returning will not be reflected in the
* string returned to the caller.
*
* @return this stream's current contents as a string.
*/ | Returns the contents of this ByteArrayOutputStream as a string. Any changes made to the receiver after returning will not be reflected in the string returned to the caller | toString | {
"repo_name": "PaytmLabs/cassandra",
"path": "src/java/org/apache/cassandra/io/util/FastByteArrayOutputStream.java",
"license": "apache-2.0",
"size": 8966
} | [
"java.io.ByteArrayOutputStream"
] | import java.io.ByteArrayOutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 892,570 |
public List<LaunchConfiguration> describeLaunchConfigurations(String... names) {
if (names == null || names.length == 0) {
LOGGER.info(String.format("Getting all launch configurations in region %s.", region));
} else {
LOGGER.info(String.format("Getting launch configurations for %d names in region %s.",
names.length, region));
}
List<LaunchConfiguration> lcs = new LinkedList<LaunchConfiguration>();
AmazonAutoScalingClient asgClient = asgClient();
DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest()
.withLaunchConfigurationNames(names);
DescribeLaunchConfigurationsResult result = asgClient.describeLaunchConfigurations(request);
lcs.addAll(result.getLaunchConfigurations());
while (result.getNextToken() != null) {
request.setNextToken(result.getNextToken());
result = asgClient.describeLaunchConfigurations(request);
lcs.addAll(result.getLaunchConfigurations());
}
LOGGER.info(String.format("Got %d launch configurations in region %s.", lcs.size(), region));
return lcs;
} | List<LaunchConfiguration> function(String... names) { if (names == null names.length == 0) { LOGGER.info(String.format(STR, region)); } else { LOGGER.info(String.format(STR, names.length, region)); } List<LaunchConfiguration> lcs = new LinkedList<LaunchConfiguration>(); AmazonAutoScalingClient asgClient = asgClient(); DescribeLaunchConfigurationsRequest request = new DescribeLaunchConfigurationsRequest() .withLaunchConfigurationNames(names); DescribeLaunchConfigurationsResult result = asgClient.describeLaunchConfigurations(request); lcs.addAll(result.getLaunchConfigurations()); while (result.getNextToken() != null) { request.setNextToken(result.getNextToken()); result = asgClient.describeLaunchConfigurations(request); lcs.addAll(result.getLaunchConfigurations()); } LOGGER.info(String.format(STR, lcs.size(), region)); return lcs; } | /**
* Describe a set of specific launch configurations.
*
* @param names the launch configuration names
* @return the launch configurations
*/ | Describe a set of specific launch configurations | describeLaunchConfigurations | {
"repo_name": "harish143us/SimianArmy",
"path": "src/main/java/com/netflix/simianarmy/client/aws/AWSClient.java",
"license": "apache-2.0",
"size": 35989
} | [
"com.amazonaws.services.autoscaling.AmazonAutoScalingClient",
"com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest",
"com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsResult",
"com.amazonaws.services.autoscaling.model.LaunchConfiguration",
"java.util.LinkedList",
"java.util.List"
] | import com.amazonaws.services.autoscaling.AmazonAutoScalingClient; import com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsRequest; import com.amazonaws.services.autoscaling.model.DescribeLaunchConfigurationsResult; import com.amazonaws.services.autoscaling.model.LaunchConfiguration; import java.util.LinkedList; import java.util.List; | import com.amazonaws.services.autoscaling.*; import com.amazonaws.services.autoscaling.model.*; import java.util.*; | [
"com.amazonaws.services",
"java.util"
] | com.amazonaws.services; java.util; | 2,121,401 |
public GVRPeriodicEngine getPeriodicEngine() {
return GVRPeriodicEngine.getInstance(this);
}
/**
* Register a method that is called every time GVRF creates a new
* {@link GVRContext}.
*
* Android apps aren't mapped 1:1 to Linux processes; the system may keep a
* process loaded even after normal complete shutdown, and call Android
* lifecycle methods to reinitialize it. This causes problems for (in
* particular) lazy-created singletons that are tied to a particular
* {@code GVRContext}. This method lets you register a handler that will be
* called on restart, which can reset your {@code static} variables to the
* compiled-in start state.
*
* <p>
* For example,
*
* <pre>
*
* static YourSingletonClass sInstance;
* static {
* GVRContext.addResetOnRestartHandler(new Runnable() {
*
* @Override
* public void run() {
* sInstance = null;
* }
* });
* } | GVRPeriodicEngine function() { return GVRPeriodicEngine.getInstance(this); } /** * Register a method that is called every time GVRF creates a new * {@link GVRContext}. * * Android apps aren't mapped 1:1 to Linux processes; the system may keep a * process loaded even after normal complete shutdown, and call Android * lifecycle methods to reinitialize it. This causes problems for (in * particular) lazy-created singletons that are tied to a particular * {@code GVRContext}. This method lets you register a handler that will be * called on restart, which can reset your {@code static} variables to the * compiled-in start state. * * <p> * For example, * * <pre> * * static YourSingletonClass sInstance; * static { * GVRContext.addResetOnRestartHandler(new Runnable() { * * @Override * public void run() { * sInstance = null; * } * }); * } | /**
* The {@linkplain GVRPeriodicEngine periodic engine} singleton.
*
* Use the periodic engine to schedule {@linkplain Runnable runnables} to
* run on the GL thread at a future time.
*
* @return The {@linkplain GVRPeriodicEngine periodic engine} singleton.
*/ | The GVRPeriodicEngine periodic engine singleton. Use the periodic engine to schedule Runnable runnables to run on the GL thread at a future time | getPeriodicEngine | {
"repo_name": "gaurav-mcl/GearVRf",
"path": "GVRf/Framework/src/org/gearvrf/GVRContext.java",
"license": "apache-2.0",
"size": 109748
} | [
"org.gearvrf.periodic.GVRPeriodicEngine"
] | import org.gearvrf.periodic.GVRPeriodicEngine; | import org.gearvrf.periodic.*; | [
"org.gearvrf.periodic"
] | org.gearvrf.periodic; | 2,174,319 |
@Override
public void flush() throws IOException {
if (debug > 1) {
UtilImpl.LOGGER.info("flush() @ CompressionResponseStream");
}
if (closed) {
throw new IOException("Cannot flush a closed output stream");
}
if (gzipstream != null) {
gzipstream.flush();
}
} | void function() throws IOException { if (debug > 1) { UtilImpl.LOGGER.info(STR); } if (closed) { throw new IOException(STR); } if (gzipstream != null) { gzipstream.flush(); } } | /**
* Flush any buffered data for this output stream, which also causes the
* response to be committed.
*/ | Flush any buffered data for this output stream, which also causes the response to be committed | flush | {
"repo_name": "skyvers/skyve",
"path": "skyve-web/src/main/java/org/skyve/impl/web/filter/gzip/CompressionResponseStream.java",
"license": "lgpl-2.1",
"size": 8641
} | [
"java.io.IOException",
"org.skyve.impl.util.UtilImpl"
] | import java.io.IOException; import org.skyve.impl.util.UtilImpl; | import java.io.*; import org.skyve.impl.util.*; | [
"java.io",
"org.skyve.impl"
] | java.io; org.skyve.impl; | 212,170 |
public static List<Version> allUnreleasedVersions() {
return UNRELEASED_VERSIONS;
} | static List<Version> function() { return UNRELEASED_VERSIONS; } | /**
* Returns an immutable, sorted list containing all unreleased versions.
*/ | Returns an immutable, sorted list containing all unreleased versions | allUnreleasedVersions | {
"repo_name": "GlenRSmith/elasticsearch",
"path": "test/framework/src/main/java/org/elasticsearch/test/VersionUtils.java",
"license": "apache-2.0",
"size": 11672
} | [
"java.util.List",
"org.elasticsearch.Version"
] | import java.util.List; import org.elasticsearch.Version; | import java.util.*; import org.elasticsearch.*; | [
"java.util",
"org.elasticsearch"
] | java.util; org.elasticsearch; | 361,472 |
public DelegationActionResponse doAction(ActionRequest actionRequest, ActionResponse actionResponse, DelegationRequest delegationRequest) throws IOException;
/**
* Calls {@link #doAction(ResourceRequest, ResourceResponse, DelegationRequest)} with no {@link DelegationRequest} | DelegationActionResponse function(ActionRequest actionRequest, ActionResponse actionResponse, DelegationRequest delegationRequest) throws IOException; /** * Calls {@link #doAction(ResourceRequest, ResourceResponse, DelegationRequest)} with no {@link DelegationRequest} | /**
* Executes a portlet action request on the delegate window. The state, mode and parameters in the delegation request (if set) are used
* by the delegate.
*
* @param actionRequest The current portlet's action request
* @param actionResponse The current portlet's action response
* @param delegationRequest The state to set for the delegate and the basis for generated URLs
* @return The delegation response state, will indicate if the delegate sent a redirect
*/ | Executes a portlet action request on the delegate window. The state, mode and parameters in the delegation request (if set) are used by the delegate | doAction | {
"repo_name": "MichaelVose2/uPortal",
"path": "uportal-war/src/main/java/org/apereo/portal/api/portlet/PortletDelegationDispatcher.java",
"license": "apache-2.0",
"size": 6792
} | [
"java.io.IOException",
"javax.portlet.ActionRequest",
"javax.portlet.ActionResponse",
"javax.portlet.ResourceRequest",
"javax.portlet.ResourceResponse"
] | import java.io.IOException; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; | import java.io.*; import javax.portlet.*; | [
"java.io",
"javax.portlet"
] | java.io; javax.portlet; | 267,167 |
public Map<String, Integer> getTagCountForSpaces(String spaces) throws XWikiException
{
return this.getProtectedPlugin().getTagCountForSpaces(spaces, this.context);
} | Map<String, Integer> function(String spaces) throws XWikiException { return this.getProtectedPlugin().getTagCountForSpaces(spaces, this.context); } | /**
* Get cardinality map of tags for list wiki spaces.
*
* @param spaces the list of space to get tags in, as a comma separated, quoted string
* @return map of tags with their occurences counts
* @throws XWikiException if search query fails (possible failures: DB access problems, etc).
* @since 8.1
*/ | Get cardinality map of tags for list wiki spaces | getTagCountForSpaces | {
"repo_name": "xwiki/xwiki-platform",
"path": "xwiki-platform-core/xwiki-platform-tag/xwiki-platform-tag-api/src/main/java/com/xpn/xwiki/plugin/tag/TagPluginApi.java",
"license": "lgpl-2.1",
"size": 12786
} | [
"com.xpn.xwiki.XWikiException",
"java.util.Map"
] | import com.xpn.xwiki.XWikiException; import java.util.Map; | import com.xpn.xwiki.*; import java.util.*; | [
"com.xpn.xwiki",
"java.util"
] | com.xpn.xwiki; java.util; | 1,395,171 |
public StompAckMode getAckMode() {
return EnumUtil.findByValue(StompAckMode.class, this.getHeaders().get(StompHeader.ACK.value()));
} | StompAckMode function() { return EnumUtil.findByValue(StompAckMode.class, this.getHeaders().get(StompHeader.ACK.value())); } | /**
* Get acknowledge mode.
*
* @return acknowledge mode
*/ | Get acknowledge mode | getAckMode | {
"repo_name": "lancomsystems/stomp",
"path": "stomp-core/src/main/java/de/lancom/systems/stomp/core/wire/frame/SubscribeFrame.java",
"license": "apache-2.0",
"size": 3708
} | [
"de.lancom.systems.stomp.core.util.EnumUtil",
"de.lancom.systems.stomp.core.wire.StompAckMode",
"de.lancom.systems.stomp.core.wire.StompHeader"
] | import de.lancom.systems.stomp.core.util.EnumUtil; import de.lancom.systems.stomp.core.wire.StompAckMode; import de.lancom.systems.stomp.core.wire.StompHeader; | import de.lancom.systems.stomp.core.util.*; import de.lancom.systems.stomp.core.wire.*; | [
"de.lancom.systems"
] | de.lancom.systems; | 65,362 |
public static void styleEditable(Context ctx, HashMap<String, ITypeface> fonts, Editable textSpanned, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) {
fonts = init(ctx, fonts);
//find all icons which should be replaced with the iconFont
List<StyleContainer> styleContainers = IconicsUtils.findIconsFromEditable(textSpanned, fonts);
//set all the icons and styles
IconicsUtils.applyStyles(ctx, textSpanned, styleContainers, styles, stylesFor);
}
public static class IconicsBuilderString {
private Context ctx;
private Spanned text;
private List<CharacterStyle> withStyles;
private HashMap<String, List<CharacterStyle>> withStylesFor;
private List<ITypeface> fonts;
public IconicsBuilderString(Context ctx, List<ITypeface> fonts, Spanned text, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) {
this.ctx = ctx;
this.fonts = fonts;
this.text = text;
this.withStyles = styles;
this.withStylesFor = stylesFor;
} | static void function(Context ctx, HashMap<String, ITypeface> fonts, Editable textSpanned, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) { fonts = init(ctx, fonts); List<StyleContainer> styleContainers = IconicsUtils.findIconsFromEditable(textSpanned, fonts); IconicsUtils.applyStyles(ctx, textSpanned, styleContainers, styles, stylesFor); } public static class IconicsBuilderString { private Context ctx; private Spanned text; private List<CharacterStyle> withStyles; private HashMap<String, List<CharacterStyle>> withStylesFor; private List<ITypeface> fonts; public IconicsBuilderString(Context ctx, List<ITypeface> fonts, Spanned text, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) { this.ctx = ctx; this.fonts = fonts; this.text = text; this.withStyles = styles; this.withStylesFor = stylesFor; } | /**
* Iterates over the editable once and replace icon font placeholders with the correct mapping.
* Afterwards it will apply the styles
*
* @param ctx
* @param fonts
* @param textSpanned
* @param styles
* @param stylesFor
*/ | Iterates over the editable once and replace icon font placeholders with the correct mapping. Afterwards it will apply the styles | styleEditable | {
"repo_name": "astir-trotter/mobile-android",
"path": "projects/AndroidCustomer/atcustom/src/main/java/com/astir_trotter/atcustom/ui/iconics/core/Iconics.java",
"license": "mit",
"size": 13664
} | [
"android.content.Context",
"android.text.Editable",
"android.text.Spanned",
"android.text.style.CharacterStyle",
"com.astir_trotter.atcustom.ui.iconics.core.typeface.ITypeface",
"com.astir_trotter.atcustom.ui.iconics.core.utils.IconicsUtils",
"com.astir_trotter.atcustom.ui.iconics.core.utils.StyleContainer",
"java.util.HashMap",
"java.util.List"
] | import android.content.Context; import android.text.Editable; import android.text.Spanned; import android.text.style.CharacterStyle; import com.astir_trotter.atcustom.ui.iconics.core.typeface.ITypeface; import com.astir_trotter.atcustom.ui.iconics.core.utils.IconicsUtils; import com.astir_trotter.atcustom.ui.iconics.core.utils.StyleContainer; import java.util.HashMap; import java.util.List; | import android.content.*; import android.text.*; import android.text.style.*; import com.astir_trotter.atcustom.ui.iconics.core.typeface.*; import com.astir_trotter.atcustom.ui.iconics.core.utils.*; import java.util.*; | [
"android.content",
"android.text",
"com.astir_trotter.atcustom",
"java.util"
] | android.content; android.text; com.astir_trotter.atcustom; java.util; | 2,735,606 |
public static Comparator<CharSequence> newCharSequenceComparator()
{
return charSeqComp;
}
| static Comparator<CharSequence> function() { return charSeqComp; } | /**
* Returns a comparator for general character sequences.
*
* @return the comparator
*/ | Returns a comparator for general character sequences | newCharSequenceComparator | {
"repo_name": "justinjohn83/utils-java",
"path": "utils/src/main/java/com/gamesalutes/utils/Comparators.java",
"license": "lgpl-3.0",
"size": 6738
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 2,750,759 |
public static boolean generateApplicationtokens(String keyType, String appName,
HttpContext httpContext, String storeURL)
throws Exception {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(storeURL + APIMTestConstants.ADD_SUBSCRIPTION_URL);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair(APIMTestConstants.API_ACTION, APIMTestConstants.GENERATE_APPLICATION_KEY_ACTION));
params.add(new BasicNameValuePair("application", appName));
params.add(new BasicNameValuePair("authorizedDomains", "ALL"));
params.add(new BasicNameValuePair("callbackUrl", ""));
params.add(new BasicNameValuePair("keytype", keyType));
params.add(new BasicNameValuePair("validityTime", "3600"));
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
//Execute and get the response.
HttpResponse response = httpclient.execute(httppost, httpContext);
HttpEntity entity = response.getEntity();
String responseString = EntityUtils.toString(entity, "UTF-8");
boolean isError = Boolean.parseBoolean(responseString.split(",")[0].split(":")[1].split("}")[0].trim());
//If API publishing success
if (!isError) {
return true;
} else {
String errorMsg = responseString.split(",")[1].split(":")[1].split("}")[0].trim();
throw new Exception("Error while subscribing to the API- " + errorMsg);
}
} | static boolean function(String keyType, String appName, HttpContext httpContext, String storeURL) throws Exception { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(storeURL + APIMTestConstants.ADD_SUBSCRIPTION_URL); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair(APIMTestConstants.API_ACTION, APIMTestConstants.GENERATE_APPLICATION_KEY_ACTION)); params.add(new BasicNameValuePair(STR, appName)); params.add(new BasicNameValuePair(STR, "ALL")); params.add(new BasicNameValuePair(STR, STRkeytypeSTRvalidityTimeSTR3600STRUTF-8STRUTF-8STR,STR:STR}STR,STR:STR}STRError while subscribing to the API- " + errorMsg); } } | /**
* Generate Application tokens using given Application and KeyType
*
* @param keyType
* @param appName
* @param httpContext
* @param storeURL
* @return
* @throws Exception
*/ | Generate Application tokens using given Application and KeyType | generateApplicationtokens | {
"repo_name": "rshahintha/product-hub",
"path": "modules/integration/tests-ui-integration/src/test/java/org/wso2/am/integration/ui/tests/util/TestUtil.java",
"license": "apache-2.0",
"size": 17437
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.http.NameValuePair",
"org.apache.http.client.HttpClient",
"org.apache.http.client.methods.HttpPost",
"org.apache.http.impl.client.DefaultHttpClient",
"org.apache.http.message.BasicNameValuePair",
"org.apache.http.protocol.HttpContext"
] | import java.util.ArrayList; import java.util.List; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.protocol.HttpContext; | import java.util.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.impl.client.*; import org.apache.http.message.*; import org.apache.http.protocol.*; | [
"java.util",
"org.apache.http"
] | java.util; org.apache.http; | 2,320,227 |
@Test
public void whenToListInvokedThenArrayConvertedToList() {
int[][] array = new int[][]{{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}};
List<Integer> listExpected = new ArrayList<>();
for (int i = 0; i < 10; i++) {
listExpected.add(i);
}
List<Integer> list = convertList.toList(array);
assertTrue(listExpected.equals(list));
} | void function() { int[][] array = new int[][]{{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}}; List<Integer> listExpected = new ArrayList<>(); for (int i = 0; i < 10; i++) { listExpected.add(i); } List<Integer> list = convertList.toList(array); assertTrue(listExpected.equals(list)); } | /**
* Test which checks toList() method.
*/ | Test which checks toList() method | whenToListInvokedThenArrayConvertedToList | {
"repo_name": "Fenix7x/Java-A-to-Z",
"path": "chapter_005/CollectionsLite/src/test/java/ru/job4j/ConvertListTest.java",
"license": "apache-2.0",
"size": 2017
} | [
"java.util.ArrayList",
"java.util.List",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.List; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,420,097 |
public List<DocElement> getDocumentation() {
return this.documentation;
} | List<DocElement> function() { return this.documentation; } | /**
* Returns the documentation element of the target port.
* @return the documentation element, or {@code null} if the target port does not have any documentation
*/ | Returns the documentation element of the target port | getDocumentation | {
"repo_name": "cocoatomo/asakusafw",
"path": "mapreduce/compiler/core/src/main/java/com/asakusafw/compiler/operator/OperatorPortDeclaration.java",
"license": "apache-2.0",
"size": 3873
} | [
"com.asakusafw.utils.java.model.syntax.DocElement",
"java.util.List"
] | import com.asakusafw.utils.java.model.syntax.DocElement; import java.util.List; | import com.asakusafw.utils.java.model.syntax.*; import java.util.*; | [
"com.asakusafw.utils",
"java.util"
] | com.asakusafw.utils; java.util; | 421,823 |
IDataHolder loadFile(IMonitor mon) throws ScanFileHolderException; | IDataHolder loadFile(IMonitor mon) throws ScanFileHolderException; | /**
* This function is called when the ScanFileHolder needs to load data from a particular source
* It can also be called on by itself
*
* @param mon - may be null
* @return This returned object is all the data which has been loaded returned in a small object package.
* @throws ScanFileHolderException
*/ | This function is called when the ScanFileHolder needs to load data from a particular source It can also be called on by itself | loadFile | {
"repo_name": "colinpalmer/dawnsci",
"path": "org.eclipse.dawnsci.analysis.api/src/org/eclipse/dawnsci/analysis/api/io/IFileLoader.java",
"license": "epl-1.0",
"size": 2300
} | [
"org.eclipse.dawnsci.analysis.api.monitor.IMonitor"
] | import org.eclipse.dawnsci.analysis.api.monitor.IMonitor; | import org.eclipse.dawnsci.analysis.api.monitor.*; | [
"org.eclipse.dawnsci"
] | org.eclipse.dawnsci; | 1,391,667 |
public int obtain() {
synchronized (this) {
int candidate = this.ctr;
int result = nextClearBit(candidate);
if (result == -1 && candidate != 0) {
// The following check will do some additional work by scanning
// the range [candidate..MAX_ID] again if it does not find a clear bit
// in the range [0..candidate-1] but it will only do this when
// we are going to throw an exception.
result = nextClearBit(0);
}
if (result == -1) {
throw new IllegalStateException(LocalizedStrings.UniqueIdGenerator_RAN_OUT_OF_MESSAGE_IDS.toLocalizedString());
} else {
setBit(result);
if (result == MAX_ID) {
this.ctr = 0;
} else {
this.ctr = result+1;
}
return result;
}
}
} | int function() { synchronized (this) { int candidate = this.ctr; int result = nextClearBit(candidate); if (result == -1 && candidate != 0) { result = nextClearBit(0); } if (result == -1) { throw new IllegalStateException(LocalizedStrings.UniqueIdGenerator_RAN_OUT_OF_MESSAGE_IDS.toLocalizedString()); } else { setBit(result); if (result == MAX_ID) { this.ctr = 0; } else { this.ctr = result+1; } return result; } } } | /**
* Obtain an id form the pool of available ids and return it.
* @throws IllegalStateException if all ids have been obtained
*/ | Obtain an id form the pool of available ids and return it | obtain | {
"repo_name": "papicella/snappy-store",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/UniqueIdGenerator.java",
"license": "apache-2.0",
"size": 8039
} | [
"com.gemstone.gemfire.internal.i18n.LocalizedStrings"
] | import com.gemstone.gemfire.internal.i18n.LocalizedStrings; | import com.gemstone.gemfire.internal.i18n.*; | [
"com.gemstone.gemfire"
] | com.gemstone.gemfire; | 1,154,676 |
public IgniteUuid getUUID() {
return uuid;
} | IgniteUuid function() { return uuid; } | /**
* Get storage UUID.
*
* @return storage UUID.
*/ | Get storage UUID | getUUID | {
"repo_name": "ntikhonov/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/math/impls/storage/matrix/BlockMatrixStorage.java",
"license": "apache-2.0",
"size": 12683
} | [
"org.apache.ignite.lang.IgniteUuid"
] | import org.apache.ignite.lang.IgniteUuid; | import org.apache.ignite.lang.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 204,659 |
void removePlayerFromTeam(Player player); | void removePlayerFromTeam(Player player); | /**
* Removes a player from their team if they are in one.
*
* @param player The player to remove from their team.
*/ | Removes a player from their team if they are in one | removePlayerFromTeam | {
"repo_name": "UltimateGames/UltimateGames",
"path": "api/src/main/java/me/ampayne2/ultimategames/api/players/teams/TeamManager.java",
"license": "lgpl-3.0",
"size": 4307
} | [
"org.bukkit.entity.Player"
] | import org.bukkit.entity.Player; | import org.bukkit.entity.*; | [
"org.bukkit.entity"
] | org.bukkit.entity; | 2,795,381 |
public void changeHarmonicNote(TGMeasure measure,long start,int string,TGEffectHarmonic harmonic){
TGNote note = getNote(measure,start,string);
if(note != null){
note.getEffect().setHarmonic(harmonic);
}
}
| void function(TGMeasure measure,long start,int string,TGEffectHarmonic harmonic){ TGNote note = getNote(measure,start,string); if(note != null){ note.getEffect().setHarmonic(harmonic); } } | /**
* Agrega un harmonic
*/ | Agrega un harmonic | changeHarmonicNote | {
"repo_name": "yuan39/TuxGuitar",
"path": "TuxGuitar/src/org/herac/tuxguitar/song/managers/TGMeasureManager.java",
"license": "lgpl-2.1",
"size": 73348
} | [
"org.herac.tuxguitar.song.models.TGMeasure",
"org.herac.tuxguitar.song.models.TGNote",
"org.herac.tuxguitar.song.models.effects.TGEffectHarmonic"
] | import org.herac.tuxguitar.song.models.TGMeasure; import org.herac.tuxguitar.song.models.TGNote; import org.herac.tuxguitar.song.models.effects.TGEffectHarmonic; | import org.herac.tuxguitar.song.models.*; import org.herac.tuxguitar.song.models.effects.*; | [
"org.herac.tuxguitar"
] | org.herac.tuxguitar; | 189,373 |
@android.view.RemotableViewMethod
public final void setHintTextColor(int color)
{
mHintTextColor = ColorStateList.valueOf(color);
updateTextColors();
} | @android.view.RemotableViewMethod final void function(int color) { mHintTextColor = ColorStateList.valueOf(color); updateTextColors(); } | /**
* Sets the color of the hint text for all the states (disabled, focussed, selected...) of this
* TextView.
*
* @see #setHintTextColor(ColorStateList)
* @see #getHintTextColors()
* @see #setTextColor(int)
* @attr ref android.R.styleable#TextView_textColorHint
*/ | Sets the color of the hint text for all the states (disabled, focussed, selected...) of this TextView | setHintTextColor | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/android/widget/TextView.java",
"license": "apache-2.0",
"size": 271830
} | [
"android.content.res.ColorStateList"
] | import android.content.res.ColorStateList; | import android.content.res.*; | [
"android.content"
] | android.content; | 31,420 |
@Override
public TileEntity createNewTileEntity(World par1World, int var)
{
return new TileEntityTsarBomba();
}
@SideOnly(Side.CLIENT)
IIcon icon;
| TileEntity function(World par1World, int var) { return new TileEntityTsarBomba(); } @SideOnly(Side.CLIENT) IIcon icon; | /**
* each class overrides this to return a new <className>
*/ | each class overrides this to return a new | createNewTileEntity | {
"repo_name": "rodolphito/Rival-Rebels-Mod",
"path": "main/java/assets/rivalrebels/common/block/trap/BlockTsarBomba.java",
"license": "mpl-2.0",
"size": 3399
} | [
"net.minecraft.tileentity.TileEntity",
"net.minecraft.util.IIcon",
"net.minecraft.world.World"
] | import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; | import net.minecraft.tileentity.*; import net.minecraft.util.*; import net.minecraft.world.*; | [
"net.minecraft.tileentity",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.tileentity; net.minecraft.util; net.minecraft.world; | 2,019,427 |
public ColorModel createColorModel(int bpc) throws IOException
{
return createColorModel(bpc, -1);
} | ColorModel function(int bpc) throws IOException { return createColorModel(bpc, -1); } | /**
* Create a Java color model for this colorspace.
*
* @param bpc The number of bits per component.
*
* @return A color model that can be used for Java AWT operations.
*
* @throws IOException If there is an error creating the color model.
*/ | Create a Java color model for this colorspace | createColorModel | {
"repo_name": "myrridin/qz-print",
"path": "pdfbox_1.8.4_qz/src/org/apache/pdfbox/pdmodel/graphics/color/PDIndexed.java",
"license": "lgpl-2.1",
"size": 12609
} | [
"java.awt.image.ColorModel",
"java.io.IOException"
] | import java.awt.image.ColorModel; import java.io.IOException; | import java.awt.image.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 1,937,712 |
public static Date truncDate(final Date date, final String timezone,
final int truncateLevel) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone(timezone));
calendar.setTime(date);
switch (truncateLevel) {
case Calendar.YEAR:
calendar.set(Calendar.MONTH, 0);
case Calendar.MONTH:
calendar.set(Calendar.DAY_OF_MONTH, 1);
case Calendar.DATE:
calendar.set(Calendar.HOUR_OF_DAY, 0);
case Calendar.HOUR:
calendar.set(Calendar.MINUTE, 0);
case Calendar.MINUTE:
calendar.set(Calendar.SECOND, 0);
case Calendar.SECOND:
calendar.set(Calendar.MILLISECOND, 0);
}
return calendar.getTime();
} | static Date function(final Date date, final String timezone, final int truncateLevel) { Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timezone)); calendar.setTime(date); switch (truncateLevel) { case Calendar.YEAR: calendar.set(Calendar.MONTH, 0); case Calendar.MONTH: calendar.set(Calendar.DAY_OF_MONTH, 1); case Calendar.DATE: calendar.set(Calendar.HOUR_OF_DAY, 0); case Calendar.HOUR: calendar.set(Calendar.MINUTE, 0); case Calendar.MINUTE: calendar.set(Calendar.SECOND, 0); case Calendar.SECOND: calendar.set(Calendar.MILLISECOND, 0); } return calendar.getTime(); } | /**
* Truncates the date assuming it's in the specified {@code timezone} to the
* specified {@code truncateLevel}.
*
* @param date
* the date to be truncated
* @param timezone
* the timezone
* @param truncateLevel
* one of:
* <ul>
* <li>{@link Calendar#YEAR}</li>
* <li>{@link Calendar#MONTH}</li>
* <li>{@link Calendar#DATE}</li>
* <li>{@link Calendar#HOUR}</li>
* <li>{@link Calendar#MINUTE}</li>
* <li>{@link Calendar#SECOND}</li>
* <li>{@link Calendar#MILLISECOND}</li>
* </ul>
*
* @return the truncated date
*/ | Truncates the date assuming it's in the specified timezone to the specified truncateLevel | truncDate | {
"repo_name": "pmeisen/gen-misc",
"path": "src/net/meisen/general/genmisc/types/Dates.java",
"license": "mit",
"size": 14415
} | [
"java.util.Calendar",
"java.util.Date",
"java.util.TimeZone"
] | import java.util.Calendar; import java.util.Date; import java.util.TimeZone; | import java.util.*; | [
"java.util"
] | java.util; | 551,294 |
public boolean awaitClose(long timeout, TimeUnit timeUnit) throws InterruptedException {
return closeLatch.await(timeout, timeUnit);
} | boolean function(long timeout, TimeUnit timeUnit) throws InterruptedException { return closeLatch.await(timeout, timeUnit); } | /**
* Wait for this {@link IndicesService} to be effectively closed. When this returns {@code true}, all shards and shard stores
* are closed and all shard {@link CacheHelper#addClosedListener(org.apache.lucene.index.IndexReader.ClosedListener) closed
* listeners} have run. However some {@link IndexEventListener#onStoreClosed(ShardId) shard closed listeners} might not have
* run.
* @return true if all shards closed within the given timeout, false otherwise
* @throws InterruptedException if the current thread got interrupted while waiting for shards to close
*/ | Wait for this <code>IndicesService</code> to be effectively closed. When this returns true, all shards and shard stores are closed and all shard <code>CacheHelper#addClosedListener(org.apache.lucene.index.IndexReader.ClosedListener) closed listeners</code> have run. However some <code>IndexEventListener#onStoreClosed(ShardId) shard closed listeners</code> might not have run | awaitClose | {
"repo_name": "robin13/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/indices/IndicesService.java",
"license": "apache-2.0",
"size": 82542
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,049,458 |
private void registerDriver()
{
if ((network.get() != null) && (this.context != null)
&& (this.regDriver == null))
{
Hashtable<String, Object> propDriver = new Hashtable<String, Object>();
propDriver
.put(DeviceCostants.DRIVER_ID, HueGatewayDriver.DRIVER_ID);
propDriver.put(DeviceCostants.GATEWAY_COUNT,
connectedGateways.size());
this.regDriver = this.context.registerService(
Driver.class.getName(), this, propDriver);
this.regHueGateway = this.context.registerService(
HueGatewayDriver.class.getName(), this, null);
}
} | void function() { if ((network.get() != null) && (this.context != null) && (this.regDriver == null)) { Hashtable<String, Object> propDriver = new Hashtable<String, Object>(); propDriver .put(DeviceCostants.DRIVER_ID, HueGatewayDriver.DRIVER_ID); propDriver.put(DeviceCostants.GATEWAY_COUNT, connectedGateways.size()); this.regDriver = this.context.registerService( Driver.class.getName(), this, propDriver); this.regHueGateway = this.context.registerService( HueGatewayDriver.class.getName(), this, null); } } | /**
* Registers this driver in the OSGi framework, making its services
* available to all the other bundles living in the same or in connected
* frameworks.
*/ | Registers this driver in the OSGi framework, making its services available to all the other bundles living in the same or in connected frameworks | registerDriver | {
"repo_name": "dog-gateway/hue-drivers",
"path": "it.polito.elite.dog.drivers.hue.gateway/src/it/polito/elite/dog/drivers/hue/gateway/HueGatewayDriver.java",
"license": "apache-2.0",
"size": 11785
} | [
"it.polito.elite.dog.core.library.model.DeviceCostants",
"java.util.Hashtable",
"org.osgi.service.device.Driver"
] | import it.polito.elite.dog.core.library.model.DeviceCostants; import java.util.Hashtable; import org.osgi.service.device.Driver; | import it.polito.elite.dog.core.library.model.*; import java.util.*; import org.osgi.service.device.*; | [
"it.polito.elite",
"java.util",
"org.osgi.service"
] | it.polito.elite; java.util; org.osgi.service; | 2,686,558 |
CNaviViewEdge createEdge(final INaviViewNode source, final INaviViewNode target,
final EdgeType edgeType); | CNaviViewEdge createEdge(final INaviViewNode source, final INaviViewNode target, final EdgeType edgeType); | /**
* Creates a new edge in the view.
*
* @param source Source node of the edge.
* @param target Target node of the edge-
* @param edgeType Type of the edge.
*
* @return The created edge.
*/ | Creates a new edge in the view | createEdge | {
"repo_name": "dgrif/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/views/IViewContent.java",
"license": "apache-2.0",
"size": 4788
} | [
"com.google.security.zynamics.binnavi.disassembly.CNaviViewEdge",
"com.google.security.zynamics.binnavi.disassembly.INaviViewNode",
"com.google.security.zynamics.zylib.gui.zygraph.edges.EdgeType"
] | import com.google.security.zynamics.binnavi.disassembly.CNaviViewEdge; import com.google.security.zynamics.binnavi.disassembly.INaviViewNode; import com.google.security.zynamics.zylib.gui.zygraph.edges.EdgeType; | import com.google.security.zynamics.binnavi.disassembly.*; import com.google.security.zynamics.zylib.gui.zygraph.edges.*; | [
"com.google.security"
] | com.google.security; | 1,542,209 |
public ApplicationDefinition getApplicationDefinition(int id) throws BusinessException {
if (id == ApplicationDefinition.DEFAULT_ID) {
return ApplicationDefinition.DEFAULT_APPLICATION_DEFINITION;
}
for (ApplicationDefinition appDef : applicationDefinitions) {
if (appDef.getId() == id) {
return appDef;
}
}
throw new BusinessException("Retrieve application with id '" + id + "'.", BusinessContextErrorCodeEnum.UNKNOWN_APPLICATION);
} | ApplicationDefinition function(int id) throws BusinessException { if (id == ApplicationDefinition.DEFAULT_ID) { return ApplicationDefinition.DEFAULT_APPLICATION_DEFINITION; } for (ApplicationDefinition appDef : applicationDefinitions) { if (appDef.getId() == id) { return appDef; } } throw new BusinessException(STR + id + "'.", BusinessContextErrorCodeEnum.UNKNOWN_APPLICATION); } | /**
* Retrieves the {@link ApplicationDefinition} with the given identifier.
*
* @param id
* unique id identifying the application definition to retrieve
* @return Return the {@link ApplicationDefinition} with the given id, or null if no application
* definition with the passed id could be found.
* @throws BusinessException
* if an application with the given id does not exist.
*/ | Retrieves the <code>ApplicationDefinition</code> with the given identifier | getApplicationDefinition | {
"repo_name": "inspectIT/inspectIT",
"path": "inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/ci/BusinessContextDefinition.java",
"license": "agpl-3.0",
"size": 9630
} | [
"rocks.inspectit.shared.all.exception.BusinessException",
"rocks.inspectit.shared.all.exception.enumeration.BusinessContextErrorCodeEnum",
"rocks.inspectit.shared.cs.ci.business.impl.ApplicationDefinition"
] | import rocks.inspectit.shared.all.exception.BusinessException; import rocks.inspectit.shared.all.exception.enumeration.BusinessContextErrorCodeEnum; import rocks.inspectit.shared.cs.ci.business.impl.ApplicationDefinition; | import rocks.inspectit.shared.all.exception.*; import rocks.inspectit.shared.all.exception.enumeration.*; import rocks.inspectit.shared.cs.ci.business.impl.*; | [
"rocks.inspectit.shared"
] | rocks.inspectit.shared; | 2,613,753 |
private void discard(final byte[] discards) {
final int end = buffered_lines;
int j = 0;
for (int i = 0; i < end; ++i)
if (no_discards || discards[i] == 0) {
undiscarded[j] = equivs[i];
realindexes[j++] = i;
} else
changed_flag[1 + i] = true;
nondiscarded_lines = j;
}
file_data(Object[] data, Hashtable h) {
buffered_lines = data.length;
equivs = new int[buffered_lines];
undiscarded = new int[buffered_lines];
realindexes = new int[buffered_lines];
for (int i = 0; i < data.length; ++i) {
Integer ir = (Integer) h.get(data[i]);
if (ir == null)
h.put(data[i], new Integer(equivs[i] = equiv_max++));
else
equivs[i] = ir.intValue();
}
}
| void function(final byte[] discards) { final int end = buffered_lines; int j = 0; for (int i = 0; i < end; ++i) if (no_discards discards[i] == 0) { undiscarded[j] = equivs[i]; realindexes[j++] = i; } else changed_flag[1 + i] = true; nondiscarded_lines = j; } file_data(Object[] data, Hashtable h) { buffered_lines = data.length; equivs = new int[buffered_lines]; undiscarded = new int[buffered_lines]; realindexes = new int[buffered_lines]; for (int i = 0; i < data.length; ++i) { Integer ir = (Integer) h.get(data[i]); if (ir == null) h.put(data[i], new Integer(equivs[i] = equiv_max++)); else equivs[i] = ir.intValue(); } } | /**
* Actually discard the lines.
*
* @param discards flags lines to be discarded
*/ | Actually discard the lines | discard | {
"repo_name": "dobin/BurpSentinel",
"path": "src/util/diff/GnuDiff.java",
"license": "gpl-3.0",
"size": 31569
} | [
"java.util.Hashtable"
] | import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 1,208,301 |
@WebMethod(operationName = "GetGeoIPContext", action = "http://www.webservicex.net/GetGeoIPContext")
@RequestWrapper(localName = "GetGeoIPContext", targetNamespace = "http://www.webservicex.net/", className = "net.webservicex.GetGeoIPContext")
@ResponseWrapper(localName = "GetGeoIPContextResponse", targetNamespace = "http://www.webservicex.net/", className = "net.webservicex.GetGeoIPContextResponse")
@WebResult(name = "GetGeoIPContextResult", targetNamespace = "http://www.webservicex.net/")
public net.webservicex.GeoIP getGeoIPContext(); | @WebMethod(operationName = STR, action = "http: @RequestWrapper(localName = STR, targetNamespace = "http: @ResponseWrapper(localName = "GetGeoIPContextResponseSTRhttp: @WebResult(name = "GetGeoIPContextResultSTRhttp: net.webservicex.GeoIP function(); | /**
* GeoIPService - GetGeoIPContext enables you to easily look up countries by Context
*/ | GeoIPService - GetGeoIPContext enables you to easily look up countries by Context | getGeoIPContext | {
"repo_name": "coldeez/java_pft",
"path": "soap-sample/src/main/java/net/webservicex/GeoIPServiceSoap.java",
"license": "apache-2.0",
"size": 1955
} | [
"javax.jws.WebMethod",
"javax.jws.WebResult",
"javax.xml.ws.RequestWrapper",
"javax.xml.ws.ResponseWrapper"
] | import javax.jws.WebMethod; import javax.jws.WebResult; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; | import javax.jws.*; import javax.xml.ws.*; | [
"javax.jws",
"javax.xml"
] | javax.jws; javax.xml; | 1,604,634 |
private IEditorInput createEditorInput(File file) {
IFile[] workspaceFile = getWorkspaceFiles(file);
if (workspaceFile != null && workspaceFile.length > 0) {
IFile file2 = selectWorkspaceFile(workspaceFile);
if (file2 != null) {
return new FileEditorInput(file2);
} else {
return new FileEditorInput(workspaceFile[0]);
}
}
return PydevFileEditorInput.create(file, true);
} | IEditorInput function(File file) { IFile[] workspaceFile = getWorkspaceFiles(file); if (workspaceFile != null && workspaceFile.length > 0) { IFile file2 = selectWorkspaceFile(workspaceFile); if (file2 != null) { return new FileEditorInput(file2); } else { return new FileEditorInput(workspaceFile[0]); } } return PydevFileEditorInput.create(file, true); } | /**
* Creates some editor input for the passed file
* @param file the file for which an editor input should be created
* @return the editor input that'll open the passed file.
*/ | Creates some editor input for the passed file | createEditorInput | {
"repo_name": "aptana/Pydev",
"path": "bundles/org.python.pydev/src/org/python/pydev/editorinput/PySourceLocatorBase.java",
"license": "epl-1.0",
"size": 20109
} | [
"java.io.File",
"org.eclipse.core.resources.IFile",
"org.eclipse.ui.IEditorInput",
"org.eclipse.ui.part.FileEditorInput"
] | import java.io.File; import org.eclipse.core.resources.IFile; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.part.FileEditorInput; | import java.io.*; import org.eclipse.core.resources.*; import org.eclipse.ui.*; import org.eclipse.ui.part.*; | [
"java.io",
"org.eclipse.core",
"org.eclipse.ui"
] | java.io; org.eclipse.core; org.eclipse.ui; | 163,488 |
public void commandSEND(short command, short LDimmer) {
SoulissCommGate.sendFORCEFrame(SoulissNetworkParameter.datagramsocket, SoulissNetworkParameter.IPAddressOnLAN,
this.getSoulissNodeID(), this.getSlot(), command, LDimmer);
} | void function(short command, short LDimmer) { SoulissCommGate.sendFORCEFrame(SoulissNetworkParameter.datagramsocket, SoulissNetworkParameter.IPAddressOnLAN, this.getSoulissNodeID(), this.getSlot(), command, LDimmer); } | /**
* Send Command with Dimmer Value
*
* @param command
*/ | Send Command with Dimmer Value | commandSEND | {
"repo_name": "lewie/openhab",
"path": "bundles/binding/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/network/typicals/SoulissT19.java",
"license": "epl-1.0",
"size": 2490
} | [
"org.openhab.binding.souliss.internal.network.udp.SoulissCommGate"
] | import org.openhab.binding.souliss.internal.network.udp.SoulissCommGate; | import org.openhab.binding.souliss.internal.network.udp.*; | [
"org.openhab.binding"
] | org.openhab.binding; | 2,866,632 |
public void setValues(PropertyValuesHolder... values) {
int numValues = values.length;
mValues = values;
mValuesMap = new HashMap<String, PropertyValuesHolder>(numValues);
for (int i = 0; i < numValues; ++i) {
PropertyValuesHolder valuesHolder = values[i];
mValuesMap.put(valuesHolder.getPropertyName(), valuesHolder);
}
// New property/values/target should cause re-initialization prior to starting
mInitialized = false;
} | void function(PropertyValuesHolder... values) { int numValues = values.length; mValues = values; mValuesMap = new HashMap<String, PropertyValuesHolder>(numValues); for (int i = 0; i < numValues; ++i) { PropertyValuesHolder valuesHolder = values[i]; mValuesMap.put(valuesHolder.getPropertyName(), valuesHolder); } mInitialized = false; } | /**
* Sets the values, per property, being animated between. This function is called internally
* by the constructors of ValueAnimator that take a list of values. But a ValueAnimator can
* be constructed without values and this method can be called to set the values manually
* instead.
*
* @param values The set of values, per property, being animated between.
*/ | Sets the values, per property, being animated between. This function is called internally by the constructors of ValueAnimator that take a list of values. But a ValueAnimator can be constructed without values and this method can be called to set the values manually instead | setValues | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/animation/ValueAnimator.java",
"license": "gpl-3.0",
"size": 65550
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 86,757 |
public void setTargetType(TargetTypeListBox targetType) {
this._targetType = targetType;
} | void function(TargetTypeListBox targetType) { this._targetType = targetType; } | /**
* Sets the target type.
*
* @param targetType
* the new target type
*/ | Sets the target type | setTargetType | {
"repo_name": "Governance/dtgov",
"path": "dtgov-ui-war/src/main/java/org/overlord/dtgov/ui/client/local/pages/TargetPage.java",
"license": "apache-2.0",
"size": 23891
} | [
"org.overlord.dtgov.ui.client.local.pages.targets.TargetTypeListBox"
] | import org.overlord.dtgov.ui.client.local.pages.targets.TargetTypeListBox; | import org.overlord.dtgov.ui.client.local.pages.targets.*; | [
"org.overlord.dtgov"
] | org.overlord.dtgov; | 2,912,500 |
private final boolean isValidValue(final BigInteger value) {
logger.warn("NotificationEventType must convert BigInteger " + value +
" to Integer value " + value.intValue());
return isValidValue(value.intValue());
} | final boolean function(final BigInteger value) { logger.warn(STR + value + STR + value.intValue()); return isValidValue(value.intValue()); } | /**
* wrapper method for UnsignedIntegers that use BigIntegers to store value
*
*/ | wrapper method for UnsignedIntegers that use BigIntegers to store value | isValidValue | {
"repo_name": "mksmbrtsh/LLRPexplorer",
"path": "src/org/llrp/ltk/generated/enumerations/NotificationEventType.java",
"license": "apache-2.0",
"size": 9370
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 177,543 |
public Path getWorkDir()
{
if (_workPath == null)
return CauchoSystem.getWorkPath();
else
return _workPath;
} | Path function() { if (_workPath == null) return CauchoSystem.getWorkPath(); else return _workPath; } | /**
* Returns the class dir for the generated class.
*/ | Returns the class dir for the generated class | getWorkDir | {
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/java/gen/JavaClassGenerator.java",
"license": "gpl-2.0",
"size": 13869
} | [
"com.caucho.server.util.CauchoSystem",
"com.caucho.vfs.Path"
] | import com.caucho.server.util.CauchoSystem; import com.caucho.vfs.Path; | import com.caucho.server.util.*; import com.caucho.vfs.*; | [
"com.caucho.server",
"com.caucho.vfs"
] | com.caucho.server; com.caucho.vfs; | 404,635 |
response.setContentType("text/event-stream");
response.setCharacterEncoding ("UTF-8");
PrintWriter out = response.getWriter();
out.append("retry: 10000s\n");
out.append("data: ");
String onlineGPlayers = SocialLogin.getOnlineGooglePlayers();
String onlineFBPlayers = SocialLogin.getOnlineFacebookPlayers();
out.append(onlineGPlayers);
out.append(onlineFBPlayers);
out.append("\n\n");
response.flushBuffer();
} | response.setContentType(STR); response.setCharacterEncoding ("UTF-8"); PrintWriter out = response.getWriter(); out.append(STR); out.append(STR); String onlineGPlayers = SocialLogin.getOnlineGooglePlayers(); String onlineFBPlayers = SocialLogin.getOnlineFacebookPlayers(); out.append(onlineGPlayers); out.append(onlineFBPlayers); out.append("\n\n"); response.flushBuffer(); } | /**
* Handles the HTTP
* <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>GET</code> method | doGet | {
"repo_name": "mbdietrich/MUCapstone2013_Team2",
"path": "ttt2/src/java/nz/ac/massey/cs/capstone/server/OnlineFriends.java",
"license": "gpl-3.0",
"size": 1638
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 1,960,537 |
public Command getCurrentCommand() {
return currentCommand;
} | Command function() { return currentCommand; } | /**
* Gets current command associated with this instance of DiskBalancer.
*/ | Gets current command associated with this instance of DiskBalancer | getCurrentCommand | {
"repo_name": "szegedim/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/DiskBalancerCLI.java",
"license": "apache-2.0",
"size": 14999
} | [
"org.apache.hadoop.hdfs.server.diskbalancer.command.Command"
] | import org.apache.hadoop.hdfs.server.diskbalancer.command.Command; | import org.apache.hadoop.hdfs.server.diskbalancer.command.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,637,331 |
OptimizedMarshaller optimizedMarsh() {
return optmMarsh;
} | OptimizedMarshaller optimizedMarsh() { return optmMarsh; } | /**
* Returns instance of {@link OptimizedMarshaller}.
*
* @return Optimized marshaller.
*/ | Returns instance of <code>OptimizedMarshaller</code> | optimizedMarsh | {
"repo_name": "thuTom/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/portable/PortableContext.java",
"license": "apache-2.0",
"size": 37372
} | [
"org.apache.ignite.marshaller.optimized.OptimizedMarshaller"
] | import org.apache.ignite.marshaller.optimized.OptimizedMarshaller; | import org.apache.ignite.marshaller.optimized.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 589,176 |
byte[] compute(byte type, ByteBuffer bb,
byte[] sequence, boolean isSimulated); | byte[] compute(byte type, ByteBuffer bb, byte[] sequence, boolean isSimulated); | /**
* Compute and returns the MAC for the remaining data
* in this ByteBuffer.
*
* On return, the bb position == limit, and limit will
* have not changed.
*
* @param type record type
* @param bb a ByteBuffer in which the position and limit
* demarcate the data to be MAC'd.
* @param isSimulated if true, simulate the MAC computation
* @param sequence the explicit sequence number, or null if using
* the implicit sequence number for the computation
*
* @return the MAC result
*/ | Compute and returns the MAC for the remaining data in this ByteBuffer. On return, the bb position == limit, and limit will have not changed | compute | {
"repo_name": "md-5/jdk10",
"path": "src/java.base/share/classes/sun/security/ssl/Authenticator.java",
"license": "gpl-2.0",
"size": 21734
} | [
"java.nio.ByteBuffer"
] | import java.nio.ByteBuffer; | import java.nio.*; | [
"java.nio"
] | java.nio; | 946,102 |
public void addInitializers(ApplicationContextInitializer<?>... initializers) {
this.initializers.addAll(Arrays.asList(initializers));
} | void function(ApplicationContextInitializer<?>... initializers) { this.initializers.addAll(Arrays.asList(initializers)); } | /**
* Add {@link ApplicationContextInitializer}s to be applied to the Spring
* {@link ApplicationContext}.
* @param initializers the initializers to add
*/ | Add <code>ApplicationContextInitializer</code>s to be applied to the Spring <code>ApplicationContext</code> | addInitializers | {
"repo_name": "neo4j-contrib/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/SpringApplication.java",
"license": "apache-2.0",
"size": 45037
} | [
"java.util.Arrays",
"org.springframework.context.ApplicationContextInitializer"
] | import java.util.Arrays; import org.springframework.context.ApplicationContextInitializer; | import java.util.*; import org.springframework.context.*; | [
"java.util",
"org.springframework.context"
] | java.util; org.springframework.context; | 1,098,367 |
EReference getLogicalDevice_NominalValues(); | EReference getLogicalDevice_NominalValues(); | /**
* Returns the meta object for the containment reference '{@link COSEM.LogicalDevice#getNominalValues <em>Nominal Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Nominal Values</em>'.
* @see COSEM.LogicalDevice#getNominalValues()
* @see #getLogicalDevice()
* @generated
*/ | Returns the meta object for the containment reference '<code>COSEM.LogicalDevice#getNominalValues Nominal Values</code>'. | getLogicalDevice_NominalValues | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/COSEM/COSEMPackage.java",
"license": "mit",
"size": 60487
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,873,360 |
disableConnectionReuseIfNecessary();
HttpURLConnection urlConnection = null;
BufferedOutputStream out = null;
BufferedInputStream in = null;
try {
final URL url = new URL(urlString);
urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setReadTimeout(10000);
urlConnection.setConnectTimeout(15000);
urlConnection.setRequestMethod("GET");
urlConnection.connect();
if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
in = new BufferedInputStream(urlConnection.getInputStream(), IO_BUFFER_SIZE);
BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
StringBuilder builder = new StringBuilder(in.available());
String line;
while ((line = reader.readLine()) != null) {
builder.append(line);
}
Ln.i("Url = %s result = %s",urlString, builder.toString());
return builder.toString();
}
} catch (final IOException e) {
Ln.e(e, "Error in downloadUrl");
} finally {
if (urlConnection != null) {
urlConnection.disconnect();
}
try {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
} catch (final IOException e) {
}
}
return null;
} | disableConnectionReuseIfNecessary(); HttpURLConnection urlConnection = null; BufferedOutputStream out = null; BufferedInputStream in = null; try { final URL url = new URL(urlString); urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setReadTimeout(10000); urlConnection.setConnectTimeout(15000); urlConnection.setRequestMethod("GET"); urlConnection.connect(); if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) { in = new BufferedInputStream(urlConnection.getInputStream(), IO_BUFFER_SIZE); BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); StringBuilder builder = new StringBuilder(in.available()); String line; while ((line = reader.readLine()) != null) { builder.append(line); } Ln.i(STR,urlString, builder.toString()); return builder.toString(); } } catch (final IOException e) { Ln.e(e, STR); } finally { if (urlConnection != null) { urlConnection.disconnect(); } try { if (out != null) { out.close(); } if (in != null) { in.close(); } } catch (final IOException e) { } } return null; } | /**
* Download the input URL and return the output as a String
*
* @param urlString
* The URL to download
*
* @return A String with the downloaded contents
*
* @throws IOException
*/ | Download the input URL and return the output as a String | downloadUrl | {
"repo_name": "antew/RedditInPictures",
"path": "src/main/java/com/antew/redditinpictures/library/network/SynchronousNetworkApi.java",
"license": "apache-2.0",
"size": 5025
} | [
"com.antew.redditinpictures.library.util.Ln",
"java.io.BufferedInputStream",
"java.io.BufferedOutputStream",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.net.HttpURLConnection"
] | import com.antew.redditinpictures.library.util.Ln; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; | import com.antew.redditinpictures.library.util.*; import java.io.*; import java.net.*; | [
"com.antew.redditinpictures",
"java.io",
"java.net"
] | com.antew.redditinpictures; java.io; java.net; | 1,495,720 |
public PublicIpPrefixPropertiesFormatInner withCustomIpPrefix(SubResource customIpPrefix) {
this.customIpPrefix = customIpPrefix;
return this;
} | PublicIpPrefixPropertiesFormatInner function(SubResource customIpPrefix) { this.customIpPrefix = customIpPrefix; return this; } | /**
* Set the customIpPrefix property: The customIpPrefix that this prefix is associated with.
*
* @param customIpPrefix the customIpPrefix value to set.
* @return the PublicIpPrefixPropertiesFormatInner object itself.
*/ | Set the customIpPrefix property: The customIpPrefix that this prefix is associated with | withCustomIpPrefix | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/PublicIpPrefixPropertiesFormatInner.java",
"license": "mit",
"size": 7665
} | [
"com.azure.core.management.SubResource"
] | import com.azure.core.management.SubResource; | import com.azure.core.management.*; | [
"com.azure.core"
] | com.azure.core; | 2,363,295 |
BaseTable simpleQueryLocalOnlyTables(String appName, DbHandle dbHandleName, String tableId,
String whereClause, BindArgs bindArgs, String[] groupBy,
String having, String[] orderByColNames,
String[] orderByDirections, Integer limit, Integer offset)
throws ServicesAvailabilityException; | BaseTable simpleQueryLocalOnlyTables(String appName, DbHandle dbHandleName, String tableId, String whereClause, BindArgs bindArgs, String[] groupBy, String having, String[] orderByColNames, String[] orderByDirections, Integer limit, Integer offset) throws ServicesAvailabilityException; | /**
* Get a {@link BaseTable} for this local only table based on the given SQL command. All
* columns from the table are returned.
* <p>
* If any of the clause parts are omitted (null), then the appropriate
* simplified SQL statement is constructed.
*
* @param appName
* @param dbHandleName
* @param tableId
* @param whereClause the whereClause for the selection, beginning with "WHERE". Must
* include "?" instead of actual values, which are instead passed in
* the selectionArgs.
* @param bindArgs an array of primitive values (String, Boolean, int, double) for
* bind parameters
* @param groupBy an array of elementKeys
* @param having
* @param orderByColNames array of columns to order the results by
* @param orderByDirections either "ASC" or "DESC", corresponding to each column name
* @param limit the maximum number of rows to return
* @param offset the index to start counting the limit from
* @return A {@link UserTable} containing the results of the query
* @throws ServicesAvailabilityException
*/ | Get a <code>BaseTable</code> for this local only table based on the given SQL command. All columns from the table are returned. If any of the clause parts are omitted (null), then the appropriate simplified SQL statement is constructed | simpleQueryLocalOnlyTables | {
"repo_name": "opendatakit/androidlibrary",
"path": "androidlibrary_lib/src/main/java/org/opendatakit/database/service/UserDbInterface.java",
"license": "apache-2.0",
"size": 50250
} | [
"org.opendatakit.database.data.BaseTable",
"org.opendatakit.database.queries.BindArgs",
"org.opendatakit.exception.ServicesAvailabilityException"
] | import org.opendatakit.database.data.BaseTable; import org.opendatakit.database.queries.BindArgs; import org.opendatakit.exception.ServicesAvailabilityException; | import org.opendatakit.database.data.*; import org.opendatakit.database.queries.*; import org.opendatakit.exception.*; | [
"org.opendatakit.database",
"org.opendatakit.exception"
] | org.opendatakit.database; org.opendatakit.exception; | 2,673,320 |
public Bean<X> getParentBean()
{
return _bean;
} | Bean<X> function() { return _bean; } | /**
* Returns the declaring bean
*/ | Returns the declaring bean | getParentBean | {
"repo_name": "christianchristensen/resin",
"path": "modules/kernel/src/com/caucho/config/inject/ObserverMethodImpl.java",
"license": "gpl-2.0",
"size": 6580
} | [
"javax.enterprise.inject.spi.Bean"
] | import javax.enterprise.inject.spi.Bean; | import javax.enterprise.inject.spi.*; | [
"javax.enterprise"
] | javax.enterprise; | 1,670,501 |
public static void checkCdf(File cdfFile) throws IOException {
byte[] magic= new byte[4];
if ( cdfFile.length()<4 ) {
throw new IllegalArgumentException("CDF file is empty");
}
try (InputStream in = new FileInputStream(cdfFile)) {
int n= in.read(magic);
if ( n==4 ) {
if ( ( magic[0] & 0xFF )==0xCD && ( magic[1] & 0xFF )==0xF3 ) {
logger.fine("V2.6 or newer");
} else if ( magic[0]==67 && magic[1]==68 && magic[2]==70 ) {
throw new IllegalArgumentException("File appears to be NetCDF, use vap+nc:");
} else if ( magic[1]==72 && magic[2]==68 && magic[3]==70 ) {
throw new IllegalArgumentException("File appears to be NetCDF (on HDF), use vap+nc:");
} else if ( magic[0]==0 && magic[1]==0 && magic[2]==-1 && magic[3]==-1 ) {
logger.fine("pre-V2.6");
} else if ( ( magic[0] & 0xFF )==0xCC && ( magic[1] & 0xFF )==0xCC && ( magic[2] & 0xFF )==0x00 && ( magic[3] & 0xFF )==0x01 ) {
logger.fine("compressed");
} else {
// assume it's the old version of CDF that didn't have a magic number.
}
}
}
} | static void function(File cdfFile) throws IOException { byte[] magic= new byte[4]; if ( cdfFile.length()<4 ) { throw new IllegalArgumentException(STR); } try (InputStream in = new FileInputStream(cdfFile)) { int n= in.read(magic); if ( n==4 ) { if ( ( magic[0] & 0xFF )==0xCD && ( magic[1] & 0xFF )==0xF3 ) { logger.fine(STR); } else if ( magic[0]==67 && magic[1]==68 && magic[2]==70 ) { throw new IllegalArgumentException(STR); } else if ( magic[1]==72 && magic[2]==68 && magic[3]==70 ) { throw new IllegalArgumentException(STR); } else if ( magic[0]==0 && magic[1]==0 && magic[2]==-1 && magic[3]==-1 ) { logger.fine(STR); } else if ( ( magic[0] & 0xFF )==0xCC && ( magic[1] & 0xFF )==0xCC && ( magic[2] & 0xFF )==0x00 && ( magic[3] & 0xFF )==0x01 ) { logger.fine(STR); } else { } } } } | /**
* check if the file really is a CDF, and throw IllegalArgumentException if it is not.
* NetCDF files occasionally use the extension .cdf.
* @param cdfFile a CDF file (or not)
* @throws IllegalArgumentException when the file is not a CDF.
* @throws IOException when the file cannot be read.
*/ | check if the file really is a CDF, and throw IllegalArgumentException if it is not. NetCDF files occasionally use the extension .cdf | checkCdf | {
"repo_name": "autoplot/app",
"path": "CdfJavaDataSource/src/org/autoplot/cdf/CdfDataSource.java",
"license": "gpl-2.0",
"size": 70582
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 309,084 |
@CheckForNull
public Date getDate(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
return DateUtils.parseDate(value);
}
return null;
} | Date function(String key) { String value = getString(key); if (StringUtils.isNotEmpty(value)) { return DateUtils.parseDate(value); } return null; } | /**
* Effective value as {@link Date}, without time fields. Format is {@link DateUtils#DATE_FORMAT}.
*
* @return the value as a {@link Date}. If the property does not have value nor default value, then {@code null} is returned.
* @throws RuntimeException if value is not empty and is not in accordance with {@link DateUtils#DATE_FORMAT}.
*/ | Effective value as <code>Date</code>, without time fields. Format is <code>DateUtils#DATE_FORMAT</code> | getDate | {
"repo_name": "lbndev/sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java",
"license": "lgpl-3.0",
"size": 15679
} | [
"java.util.Date",
"org.apache.commons.lang.StringUtils",
"org.sonar.api.utils.DateUtils"
] | import java.util.Date; import org.apache.commons.lang.StringUtils; import org.sonar.api.utils.DateUtils; | import java.util.*; import org.apache.commons.lang.*; import org.sonar.api.utils.*; | [
"java.util",
"org.apache.commons",
"org.sonar.api"
] | java.util; org.apache.commons; org.sonar.api; | 2,081,163 |
@Override
public void setPayrollTotalHours(BigDecimal payrollTotalHours) {
this.payrollTotalHours = payrollTotalHours;
} | void function(BigDecimal payrollTotalHours) { this.payrollTotalHours = payrollTotalHours; } | /**
* Sets the payrollTotalHours.
*
* @param payrollTotalHours The payrollTotalHours to set.
*/ | Sets the payrollTotalHours | setPayrollTotalHours | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/ld/businessobject/ExpenseTransferSourceAccountingLine.java",
"license": "apache-2.0",
"size": 7591
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,373,893 |
@Ignore
@Test
public void testPropertyResolution() throws Exception {
final HashMap<String, String> flowProps = new HashMap<>();
flowProps.put("props7", "flow7");
flowProps.put("props6", "flow6");
flowProps.put("props5", "flow5");
final FlowRunner runner = createFlowRunner("job3", flowProps);
final Map<String, ExecutableNode> nodeMap = new HashMap<>();
createNodeMap(runner.getExecutableFlow(), nodeMap);
// 1. Start flow. Job 2 should start
runFlowRunnerInThread(runner);
pause(250);
// Job 2 is a normal job.
// Only the flow overrides and the shared properties matter
ExecutableNode node = nodeMap.get("job2");
final Props job2Props = node.getInputProps();
Assert.assertEquals("shared1", job2Props.get("props1"));
Assert.assertEquals("job2", job2Props.get("props2"));
Assert.assertEquals("moo3", job2Props.get("props3"));
Assert.assertEquals("job7", job2Props.get("props7"));
Assert.assertEquals("flow5", job2Props.get("props5"));
Assert.assertEquals("flow6", job2Props.get("props6"));
Assert.assertEquals("shared4", job2Props.get("props4"));
Assert.assertEquals("shared8", job2Props.get("props8"));
// Job 1 is inside another flow, and is nested in a different directory
// The priority order should be:
// job1->innerflow->job2.output->flow.overrides->job1 shared props
final Props job2Generated = new Props();
job2Generated.put("props6", "gjob6");
job2Generated.put("props9", "gjob9");
job2Generated.put("props10", "gjob10");
InteractiveTestJob.getTestJob("job2").succeedJob(job2Generated);
pause(250);
node = nodeMap.get("innerflow:job1");
final Props job1Props = node.getInputProps();
Assert.assertEquals("job1", job1Props.get("props1"));
Assert.assertEquals("job2", job1Props.get("props2"));
Assert.assertEquals("job8", job1Props.get("props8"));
Assert.assertEquals("gjob9", job1Props.get("props9"));
Assert.assertEquals("gjob10", job1Props.get("props10"));
Assert.assertEquals("innerflow6", job1Props.get("props6"));
Assert.assertEquals("innerflow5", job1Props.get("props5"));
Assert.assertEquals("flow7", job1Props.get("props7"));
Assert.assertEquals("moo3", job1Props.get("props3"));
Assert.assertEquals("moo4", job1Props.get("props4"));
// Job 4 is inside another flow and takes output from job 1
// The priority order should be:
// job4->job1.output->innerflow->job2.output->flow.overrides->job4 shared
// props
final Props job1GeneratedProps = new Props();
job1GeneratedProps.put("props9", "g2job9");
job1GeneratedProps.put("props7", "g2job7");
InteractiveTestJob.getTestJob("innerflow:job1").succeedJob(
job1GeneratedProps);
pause(250);
node = nodeMap.get("innerflow:job4");
final Props job4Props = node.getInputProps();
Assert.assertEquals("job8", job4Props.get("props8"));
Assert.assertEquals("job9", job4Props.get("props9"));
Assert.assertEquals("g2job7", job4Props.get("props7"));
Assert.assertEquals("innerflow5", job4Props.get("props5"));
Assert.assertEquals("innerflow6", job4Props.get("props6"));
Assert.assertEquals("gjob10", job4Props.get("props10"));
Assert.assertEquals("shared4", job4Props.get("props4"));
Assert.assertEquals("shared1", job4Props.get("props1"));
Assert.assertEquals("shared2", job4Props.get("props2"));
Assert.assertEquals("moo3", job4Props.get("props3"));
// Job 3 is a normal job taking props from an embedded flow
// The priority order should be:
// job3->innerflow.output->flow.overrides->job3.sharedprops
final Props job4GeneratedProps = new Props();
job4GeneratedProps.put("props9", "g4job9");
job4GeneratedProps.put("props6", "g4job6");
InteractiveTestJob.getTestJob("innerflow:job4").succeedJob(
job4GeneratedProps);
pause(250);
node = nodeMap.get("job3");
final Props job3Props = node.getInputProps();
Assert.assertEquals("job3", job3Props.get("props3"));
Assert.assertEquals("g4job6", job3Props.get("props6"));
Assert.assertEquals("g4job9", job3Props.get("props9"));
Assert.assertEquals("flow7", job3Props.get("props7"));
Assert.assertEquals("flow5", job3Props.get("props5"));
Assert.assertEquals("shared1", job3Props.get("props1"));
Assert.assertEquals("shared2", job3Props.get("props2"));
Assert.assertEquals("moo4", job3Props.get("props4"));
} | void function() throws Exception { final HashMap<String, String> flowProps = new HashMap<>(); flowProps.put(STR, "flow7"); flowProps.put(STR, "flow6"); flowProps.put(STR, "flow5"); final FlowRunner runner = createFlowRunner("job3", flowProps); final Map<String, ExecutableNode> nodeMap = new HashMap<>(); createNodeMap(runner.getExecutableFlow(), nodeMap); runFlowRunnerInThread(runner); pause(250); ExecutableNode node = nodeMap.get("job2"); final Props job2Props = node.getInputProps(); Assert.assertEquals(STR, job2Props.get(STR)); Assert.assertEquals("job2", job2Props.get(STR)); Assert.assertEquals("moo3", job2Props.get(STR)); Assert.assertEquals("job7", job2Props.get(STR)); Assert.assertEquals("flow5", job2Props.get(STR)); Assert.assertEquals("flow6", job2Props.get(STR)); Assert.assertEquals(STR, job2Props.get(STR)); Assert.assertEquals(STR, job2Props.get(STR)); final Props job2Generated = new Props(); job2Generated.put(STR, "gjob6"); job2Generated.put(STR, "gjob9"); job2Generated.put(STR, STR); InteractiveTestJob.getTestJob("job2").succeedJob(job2Generated); pause(250); node = nodeMap.get(STR); final Props job1Props = node.getInputProps(); Assert.assertEquals("job1", job1Props.get(STR)); Assert.assertEquals("job2", job1Props.get(STR)); Assert.assertEquals("job8", job1Props.get(STR)); Assert.assertEquals("gjob9", job1Props.get(STR)); Assert.assertEquals(STR, job1Props.get(STR)); Assert.assertEquals(STR, job1Props.get(STR)); Assert.assertEquals(STR, job1Props.get(STR)); Assert.assertEquals("flow7", job1Props.get(STR)); Assert.assertEquals("moo3", job1Props.get(STR)); Assert.assertEquals("moo4", job1Props.get(STR)); final Props job1GeneratedProps = new Props(); job1GeneratedProps.put(STR, STR); job1GeneratedProps.put(STR, STR); InteractiveTestJob.getTestJob(STR).succeedJob( job1GeneratedProps); pause(250); node = nodeMap.get(STR); final Props job4Props = node.getInputProps(); Assert.assertEquals("job8", job4Props.get(STR)); Assert.assertEquals("job9", job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals(STR, job4Props.get(STR)); Assert.assertEquals("moo3", job4Props.get(STR)); final Props job4GeneratedProps = new Props(); job4GeneratedProps.put(STR, STR); job4GeneratedProps.put(STR, STR); InteractiveTestJob.getTestJob(STR).succeedJob( job4GeneratedProps); pause(250); node = nodeMap.get("job3"); final Props job3Props = node.getInputProps(); Assert.assertEquals("job3", job3Props.get(STR)); Assert.assertEquals(STR, job3Props.get(STR)); Assert.assertEquals(STR, job3Props.get(STR)); Assert.assertEquals("flow7", job3Props.get(STR)); Assert.assertEquals("flow5", job3Props.get(STR)); Assert.assertEquals(STR, job3Props.get(STR)); Assert.assertEquals(STR, job3Props.get(STR)); Assert.assertEquals("moo4", job3Props.get(STR)); } | /**
* Tests the basic flow resolution. Flow is defined in execpropstest
*/ | Tests the basic flow resolution. Flow is defined in execpropstest | testPropertyResolution | {
"repo_name": "sunghyuk/azkaban",
"path": "azkaban-exec-server/src/test/java/azkaban/execapp/FlowRunnerPropertyResolutionTest.java",
"license": "apache-2.0",
"size": 9754
} | [
"java.util.HashMap",
"java.util.Map",
"org.junit.Assert"
] | import java.util.HashMap; import java.util.Map; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,352,235 |
private boolean processAllFiles() {
createDexFile();
if (args.jarOutput) {
outputResources = new TreeMap<String, byte[]>();
}
anyFilesProcessed = false;
String[] fileNames = args.fileNames;
if (args.numThreads > 1) {
threadPool = Executors.newFixedThreadPool(args.numThreads);
parallelProcessorFutures = new ArrayList<Future<Void>>();
}
try {
if (args.mainDexListFile != null) {
// with --main-dex-list
FileNameFilter mainPassFilter = args.strictNameCheck ? new MainDexListFilter() :
new BestEffortMainDexListFilter();
// forced in main dex
for (int i = 0; i < fileNames.length; i++) {
processOne(fileNames[i], mainPassFilter);
}
if (dexOutputArrays.size() > 0) {
throw new DexException("Too many classes in " + Arguments.MAIN_DEX_LIST_OPTION
+ ", main dex capacity exceeded");
}
if (args.minimalMainDex) {
// start second pass directly in a secondary dex file.
createDexFile();
}
// remaining files
for (int i = 0; i < fileNames.length; i++) {
processOne(fileNames[i], new NotFilter(mainPassFilter));
}
} else {
// without --main-dex-list
for (int i = 0; i < fileNames.length; i++) {
processOne(fileNames[i], ClassPathOpener.acceptAll);
}
}
} catch (StopProcessing ex) {
}
if (args.numThreads > 1) {
try {
threadPool.shutdown();
if (!threadPool.awaitTermination(600L, TimeUnit.SECONDS)) {
throw new RuntimeException("Timed out waiting for threads.");
}
} catch (InterruptedException ex) {
threadPool.shutdownNow();
throw new RuntimeException("A thread has been interrupted.");
}
try {
for (Future<?> future : parallelProcessorFutures) {
future.get();
}
} catch (ExecutionException e) {
Throwable cause = e.getCause();
// All Exceptions should have been handled in the ParallelProcessor, only Errors
// should remain
if (cause instanceof Error) {
throw (Error) e.getCause();
} else {
throw new AssertionError(e.getCause());
}
} catch (InterruptedException e) {
// If we're here, it means all threads have completed cleanly, so there should not be
// any InterruptedException
throw new AssertionError(e);
}
}
int errorNum = errors.get();
if (errorNum != 0) {
dxConsole.err.println(errorNum + " error" +
((errorNum == 1) ? "" : "s") + "; aborting");
return false;
}
if (args.incremental && !anyFilesProcessed) {
return true;
}
if (!(anyFilesProcessed || args.emptyOk)) {
dxConsole.err.println("no classfiles specified");
return false;
}
if (args.optimize && args.statistics) {
args.cfOptions.codeStatistics.dumpStatistics(dxConsole.out);
}
return true;
} | boolean function() { createDexFile(); if (args.jarOutput) { outputResources = new TreeMap<String, byte[]>(); } anyFilesProcessed = false; String[] fileNames = args.fileNames; if (args.numThreads > 1) { threadPool = Executors.newFixedThreadPool(args.numThreads); parallelProcessorFutures = new ArrayList<Future<Void>>(); } try { if (args.mainDexListFile != null) { FileNameFilter mainPassFilter = args.strictNameCheck ? new MainDexListFilter() : new BestEffortMainDexListFilter(); for (int i = 0; i < fileNames.length; i++) { processOne(fileNames[i], mainPassFilter); } if (dexOutputArrays.size() > 0) { throw new DexException(STR + Arguments.MAIN_DEX_LIST_OPTION + STR); } if (args.minimalMainDex) { createDexFile(); } for (int i = 0; i < fileNames.length; i++) { processOne(fileNames[i], new NotFilter(mainPassFilter)); } } else { for (int i = 0; i < fileNames.length; i++) { processOne(fileNames[i], ClassPathOpener.acceptAll); } } } catch (StopProcessing ex) { } if (args.numThreads > 1) { try { threadPool.shutdown(); if (!threadPool.awaitTermination(600L, TimeUnit.SECONDS)) { throw new RuntimeException(STR); } } catch (InterruptedException ex) { threadPool.shutdownNow(); throw new RuntimeException(STR); } try { for (Future<?> future : parallelProcessorFutures) { future.get(); } } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof Error) { throw (Error) e.getCause(); } else { throw new AssertionError(e.getCause()); } } catch (InterruptedException e) { throw new AssertionError(e); } } int errorNum = errors.get(); if (errorNum != 0) { dxConsole.err.println(errorNum + STR + ((errorNum == 1) ? STRsSTR; abortingSTRno classfiles specified"); return false; } if (args.optimize && args.statistics) { args.cfOptions.codeStatistics.dumpStatistics(dxConsole.out); } return true; } | /**
* Constructs the output {@link DexFile}, fill it in with all the
* specified classes, and populate the resources map if required.
*
* @return whether processing was successful
*/ | Constructs the output <code>DexFile</code>, fill it in with all the specified classes, and populate the resources map if required | processAllFiles | {
"repo_name": "neonichu/buck",
"path": "third-party/java/dx/src/com/android/dx/command/dexer/Main.java",
"license": "apache-2.0",
"size": 58955
} | [
"com.android.dex.DexException",
"com.android.dx.cf.direct.ClassPathOpener",
"java.util.ArrayList",
"java.util.TreeMap",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.Executors",
"java.util.concurrent.Future",
"java.util.concurrent.TimeUnit"
] | import com.android.dex.DexException; import com.android.dx.cf.direct.ClassPathOpener; import java.util.ArrayList; import java.util.TreeMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; | import com.android.dex.*; import com.android.dx.cf.direct.*; import java.util.*; import java.util.concurrent.*; | [
"com.android.dex",
"com.android.dx",
"java.util"
] | com.android.dex; com.android.dx; java.util; | 2,225,198 |
boolean processAckOnMaster(List<DistStageAck> acks); | boolean processAckOnMaster(List<DistStageAck> acks); | /**
* After all slaves replied through {@link #executeOnSlave()}, this method will be called on the master.
* @return returning false will cause the benchmark to stop.
*/ | After all slaves replied through <code>#executeOnSlave()</code>, this method will be called on the master | processAckOnMaster | {
"repo_name": "wburns/radargun",
"path": "core/src/main/java/org/radargun/DistStage.java",
"license": "apache-2.0",
"size": 973
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,369,526 |
public List<String> getCategories() {
return categories;
} | List<String> function() { return categories; } | /**
* <p>Getter for the field <code>categories</code>.</p>
*
* @return a {@link java.util.List} object.
*/ | Getter for the field <code>categories</code> | getCategories | {
"repo_name": "rfdrake/opennms",
"path": "opennms-webapp/src/main/java/org/opennms/web/map/view/VProperties.java",
"license": "gpl-2.0",
"size": 14337
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,001,509 |
if (portletResponse instanceof RenderResponse) {
return ((RenderResponse)portletResponse).createRenderURL();
}
else if (portletResponse instanceof ResourceResponse) {
return ((ResourceResponse)portletResponse).createRenderURL();
}
throw new IllegalArgumentException();
} | if (portletResponse instanceof RenderResponse) { return ((RenderResponse)portletResponse).createRenderURL(); } else if (portletResponse instanceof ResourceResponse) { return ((ResourceResponse)portletResponse).createRenderURL(); } throw new IllegalArgumentException(); } | /**
* Creates a render PortletURL
* @param portletResponse PortletResponse
* @return PortletURL
*/ | Creates a render PortletURL | createPortletUrl | {
"repo_name": "apache/portals-pluto",
"path": "pluto-taglib/src/main/java/org/apache/pluto/tags/RenderURLTag286.java",
"license": "apache-2.0",
"size": 1834
} | [
"javax.portlet.RenderResponse",
"javax.portlet.ResourceResponse"
] | import javax.portlet.RenderResponse; import javax.portlet.ResourceResponse; | import javax.portlet.*; | [
"javax.portlet"
] | javax.portlet; | 1,213,049 |
void assertDefinitionNode(Node n, int type) {
Preconditions.checkState(sourceName != null);
Preconditions.checkState(n.getType() == type);
} | void assertDefinitionNode(Node n, int type) { Preconditions.checkState(sourceName != null); Preconditions.checkState(n.getType() == type); } | /**
* Asserts that it's ok to define this node's name.
* The node should have a source name and be of the specified type.
*/ | Asserts that it's ok to define this node's name. The node should have a source name and be of the specified type | assertDefinitionNode | {
"repo_name": "jayli/kissy",
"path": "tools/module-compiler/src/com/google/javascript/jscomp/TypedScopeCreator.java",
"license": "mit",
"size": 59987
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; | import com.google.common.base.*; import com.google.javascript.rhino.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 2,054,195 |
private long getPropertyLength(Object value) throws ValueFormatException, RepositoryException
{
// Handle streams
if (value instanceof ContentReader)
{
return ((ContentReader)value).getSize();
}
if (value instanceof InputStream)
{
return -1;
}
// Handle all other data types by converting to string
String strValue = (String)DefaultTypeConverter.INSTANCE.convert(String.class, value);
return strValue.length();
}
| long function(Object value) throws ValueFormatException, RepositoryException { if (value instanceof ContentReader) { return ((ContentReader)value).getSize(); } if (value instanceof InputStream) { return -1; } String strValue = (String)DefaultTypeConverter.INSTANCE.convert(String.class, value); return strValue.length(); } | /**
* Get Length of a Value
*
* @param value
* @return
* @throws ValueFormatException
* @throws RepositoryException
*/ | Get Length of a Value | getPropertyLength | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/repository/source/java/org/alfresco/jcr/item/PropertyImpl.java",
"license": "lgpl-3.0",
"size": 24077
} | [
"java.io.InputStream",
"javax.jcr.RepositoryException",
"javax.jcr.ValueFormatException",
"org.alfresco.service.cmr.repository.ContentReader",
"org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter"
] | import java.io.InputStream; import javax.jcr.RepositoryException; import javax.jcr.ValueFormatException; import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter; | import java.io.*; import javax.jcr.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.repository.datatype.*; | [
"java.io",
"javax.jcr",
"org.alfresco.service"
] | java.io; javax.jcr; org.alfresco.service; | 1,004,835 |
public SqlWindow createCurrentRowWindow(final String columnName) {
return SqlWindow.create(
null,
null,
new SqlNodeList(SqlParserPos.ZERO),
new SqlNodeList(
ImmutableList.of(
new SqlIdentifier(columnName, SqlParserPos.ZERO)),
SqlParserPos.ZERO),
SqlLiteral.createBoolean(true, SqlParserPos.ZERO),
SqlWindow.createCurrentRow(SqlParserPos.ZERO),
SqlWindow.createCurrentRow(SqlParserPos.ZERO),
SqlLiteral.createBoolean(true, SqlParserPos.ZERO),
SqlParserPos.ZERO);
} | SqlWindow function(final String columnName) { return SqlWindow.create( null, null, new SqlNodeList(SqlParserPos.ZERO), new SqlNodeList( ImmutableList.of( new SqlIdentifier(columnName, SqlParserPos.ZERO)), SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlWindow.createCurrentRow(SqlParserPos.ZERO), SqlLiteral.createBoolean(true, SqlParserPos.ZERO), SqlParserPos.ZERO); } | /**
* Creates a window <code>(RANGE <i>columnName</i> CURRENT ROW)</code>.
*
* @param columnName Order column
*/ | Creates a window <code>(RANGE columnName CURRENT ROW)</code> | createCurrentRowWindow | {
"repo_name": "jcamachor/calcite",
"path": "core/src/main/java/org/apache/calcite/sql/SqlWindow.java",
"license": "apache-2.0",
"size": 30138
} | [
"com.google.common.collect.ImmutableList",
"org.apache.calcite.sql.parser.SqlParserPos"
] | import com.google.common.collect.ImmutableList; import org.apache.calcite.sql.parser.SqlParserPos; | import com.google.common.collect.*; import org.apache.calcite.sql.parser.*; | [
"com.google.common",
"org.apache.calcite"
] | com.google.common; org.apache.calcite; | 425,110 |
public void startDocument ()
throws SAXException
{
try {
reset();
if(writeXmlDecl) {
String e="";
if(encoding!=null)
e = " encoding=\""+encoding+'\"';
writeXmlDecl("<?xml version=\"1.0\""+e +" standalone=\"yes\"?>");
}
if(header!=null)
write(header);
super.startDocument();
} catch( IOException e ) {
throw new SAXException(e);
}
} | void function () throws SAXException { try { reset(); if(writeXmlDecl) { String e=STR encoding=\STR'; writeXmlDecl(STR1.0\STR standalone=\"yes\"?>"); } if(header!=null) write(header); super.startDocument(); } catch( IOException e ) { throw new SAXException(e); } } | /**
* Write the XML declaration at the beginning of the document.
*
* Pass the event on down the filter chain for further processing.
*
* @exception org.xml.sax.SAXException If there is an error
* writing the XML declaration, or if a handler further down
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#startDocument()
*/ | Write the XML declaration at the beginning of the document. Pass the event on down the filter chain for further processing | startDocument | {
"repo_name": "samskivert/ikvm-openjdk",
"path": "build/linux-amd64/impsrc/com/sun/xml/internal/bind/marshaller/XMLWriter.java",
"license": "gpl-2.0",
"size": 31867
} | [
"java.io.IOException",
"org.xml.sax.SAXException"
] | import java.io.IOException; import org.xml.sax.SAXException; | import java.io.*; import org.xml.sax.*; | [
"java.io",
"org.xml.sax"
] | java.io; org.xml.sax; | 4,316 |
public List<Node> getNodePath() {
return nodePath;
}
// -------------- MODIFIERS ------------- | List<Node> function() { return nodePath; } | /**
* Construct an return a list of nodes that represents the path.
*
* @return A list of nodes representing the path.
*/ | Construct an return a list of nodes that represents the path | getNodePath | {
"repo_name": "margaritis/gs-core",
"path": "src/org/graphstream/graph/Path.java",
"license": "lgpl-3.0",
"size": 11889
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,979,649 |
@Test
@JUnitHttpServer(port=10342, vhosts={"127.0.0.1"})
@JUnitCollector(datacollectionConfig="/org/opennms/netmgt/config/http-datacollection-config.xml", datacollectionType="http",
anticipateRrds={ "1/documentCount", "1/greatAnswer", "1/someNumber" }, anticipateFiles={ "1/strings.properties" })
public final void testCollect() throws Exception {
m_collectionSpecification.initialize(m_collectionAgent);
CollectionSet collectionSet = m_collectionSpecification.collect(m_collectionAgent);
assertEquals("collection status", ServiceCollector.COLLECTION_SUCCEEDED, collectionSet.getStatus());
CollectorTestUtils.persistCollectionSet(m_collectionSpecification, collectionSet);
m_collectionSpecification.release(m_collectionAgent);
} | @JUnitHttpServer(port=10342, vhosts={STR}) @JUnitCollector(datacollectionConfig=STR, datacollectionType="http", anticipateRrds={ STR, STR, STR }, anticipateFiles={ STR }) final void function() throws Exception { m_collectionSpecification.initialize(m_collectionAgent); CollectionSet collectionSet = m_collectionSpecification.collect(m_collectionAgent); assertEquals(STR, ServiceCollector.COLLECTION_SUCCEEDED, collectionSet.getStatus()); CollectorTestUtils.persistCollectionSet(m_collectionSpecification, collectionSet); m_collectionSpecification.release(m_collectionAgent); } | /**
* Test method for {@link org.opennms.netmgt.collectd.HttpCollector#collect(
* org.opennms.netmgt.collectd.CollectionAgent, org.opennms.netmgt.model.events.EventProxy, Map)}.
*/ | Test method for <code>org.opennms.netmgt.collectd.HttpCollector#collect( org.opennms.netmgt.collectd.CollectionAgent, org.opennms.netmgt.model.events.EventProxy, Map)</code> | testCollect | {
"repo_name": "bugcy013/opennms-tmp-tools",
"path": "opennms-services/src/test/java/org/opennms/netmgt/collectd/HttpCollectorTest.java",
"license": "gpl-2.0",
"size": 19020
} | [
"org.junit.Assert",
"org.opennms.core.test.http.annotations.JUnitHttpServer",
"org.opennms.netmgt.config.collector.CollectionSet"
] | import org.junit.Assert; import org.opennms.core.test.http.annotations.JUnitHttpServer; import org.opennms.netmgt.config.collector.CollectionSet; | import org.junit.*; import org.opennms.core.test.http.annotations.*; import org.opennms.netmgt.config.collector.*; | [
"org.junit",
"org.opennms.core",
"org.opennms.netmgt"
] | org.junit; org.opennms.core; org.opennms.netmgt; | 1,117,317 |
public static Artifact createFile(
RuleContext ruleContext, String fileName, CharSequence contents, boolean executable) {
Artifact scriptFileArtifact = ruleContext.getPackageRelativeArtifact(
fileName, ruleContext.getConfiguration().getGenfilesDirectory(
ruleContext.getRule().getRepository()));
ruleContext.registerAction(
FileWriteAction.create(ruleContext, scriptFileArtifact, contents, executable));
return scriptFileArtifact;
} | static Artifact function( RuleContext ruleContext, String fileName, CharSequence contents, boolean executable) { Artifact scriptFileArtifact = ruleContext.getPackageRelativeArtifact( fileName, ruleContext.getConfiguration().getGenfilesDirectory( ruleContext.getRule().getRepository())); ruleContext.registerAction( FileWriteAction.create(ruleContext, scriptFileArtifact, contents, executable)); return scriptFileArtifact; } | /**
* Creates a FileWriteAction to write contents to the resulting artifact fileName in the genfiles
* root underneath the package path.
*
* @param ruleContext the ruleContext that will own the action of creating this file
* @param fileName name of the file to create
* @param contents data to write to file
* @param executable flags that file should be marked executable
* @return Artifact describing the file to create
*/ | Creates a FileWriteAction to write contents to the resulting artifact fileName in the genfiles root underneath the package path | createFile | {
"repo_name": "juhalindfors/bazel-patches",
"path": "src/main/java/com/google/devtools/build/lib/analysis/actions/FileWriteAction.java",
"license": "apache-2.0",
"size": 9845
} | [
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.analysis.RuleContext"
] | import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.RuleContext; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,147,025 |
public ValidatorError doValidation() {
ValidatorError error = validateNetworkInterface();
if (error != null) {
return error;
}
if (isCobblerOnly()) {
return null;
}
Server hostServer = getHostServer();
// Check base channel.
log.debug("** Checking basechannel.");
if (hostServer.getBaseChannel() == null) {
return new ValidatorError("kickstart.schedule.nobasechannel",
hostServer.getName());
}
// Check that we have a valid ks package
log.debug("** Checking validkspackage");
error = validateKickstartPackage();
if (error != null) {
return error;
}
if (ksdata.isRhel()) {
// Check that we have a valid up2date version
log.debug("** Checking valid up2date");
error = validateUp2dateVersion();
if (error != null) {
return error;
}
}
// we already shall be subscribed to the tools channel
// (since validateKickstartPackage), so no other actions needed
return null;
} | ValidatorError function() { ValidatorError error = validateNetworkInterface(); if (error != null) { return error; } if (isCobblerOnly()) { return null; } Server hostServer = getHostServer(); log.debug(STR); if (hostServer.getBaseChannel() == null) { return new ValidatorError(STR, hostServer.getName()); } log.debug(STR); error = validateKickstartPackage(); if (error != null) { return error; } if (ksdata.isRhel()) { log.debug(STR); error = validateUp2dateVersion(); if (error != null) { return error; } } return null; } | /**
* Do the validation needed for this command. This ensures that the system
* hosting the kickstart has the necessary resources to do so.
*
* @return Returns a ValidatorError, if any errors occur
*/ | Do the validation needed for this command. This ensures that the system hosting the kickstart has the necessary resources to do so | doValidation | {
"repo_name": "hustodemon/spacewalk",
"path": "java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java",
"license": "gpl-2.0",
"size": 56521
} | [
"com.redhat.rhn.common.validator.ValidatorError",
"com.redhat.rhn.domain.server.Server"
] | import com.redhat.rhn.common.validator.ValidatorError; import com.redhat.rhn.domain.server.Server; | import com.redhat.rhn.common.validator.*; import com.redhat.rhn.domain.server.*; | [
"com.redhat.rhn"
] | com.redhat.rhn; | 1,283,934 |
public List<Event> getListEventWeek() {
return listEventWeek;
} | List<Event> function() { return listEventWeek; } | /**
* Method declaration
* @return
* @see
*/ | Method declaration | getListEventWeek | {
"repo_name": "stephaneperry/Silverpeas-Core",
"path": "web-core/src/main/java/com/stratelia/webactiv/util/viewGenerator/html/monthCalendar/Week.java",
"license": "agpl-3.0",
"size": 8847
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,169,894 |
protected void prepareReleasedTimeRangeCondition(
CmsUUID projectId,
long startTime,
long endTime,
StringBuffer conditions,
List params) {
if (startTime > 0L) {
// READ_IGNORE_TIME: if NOT set, add condition to match released date against startTime
conditions.append(BEGIN_INCLUDE_CONDITION);
conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_AFTER));
conditions.append(END_CONDITION);
params.add(Long.valueOf(startTime));
}
if (endTime > 0L) {
// READ_IGNORE_TIME: if NOT set, add condition to match released date against endTime
conditions.append(BEGIN_INCLUDE_CONDITION);
conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_BEFORE));
conditions.append(END_CONDITION);
params.add(Long.valueOf(endTime));
}
} | void function( CmsUUID projectId, long startTime, long endTime, StringBuffer conditions, List params) { if (startTime > 0L) { conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_AFTER)); conditions.append(END_CONDITION); params.add(Long.valueOf(startTime)); } if (endTime > 0L) { conditions.append(BEGIN_INCLUDE_CONDITION); conditions.append(m_sqlManager.readQuery(projectId, C_STRUCTURE_SELECT_BY_DATE_RELEASED_BEFORE)); conditions.append(END_CONDITION); params.add(Long.valueOf(endTime)); } } | /**
* Appends the appropriate selection criteria related with the released date.<p>
*
* @param projectId the id of the project
* @param startTime the start time
* @param endTime the stop time
* @param conditions buffer to append the selection criteria
* @param params list to append the selection parameters
*/ | Appends the appropriate selection criteria related with the released date | prepareReleasedTimeRangeCondition | {
"repo_name": "serrapos/opencms-core",
"path": "src/org/opencms/db/jpa/CmsVfsDriver.java",
"license": "lgpl-2.1",
"size": 188123
} | [
"java.util.List",
"org.opencms.util.CmsUUID"
] | import java.util.List; import org.opencms.util.CmsUUID; | import java.util.*; import org.opencms.util.*; | [
"java.util",
"org.opencms.util"
] | java.util; org.opencms.util; | 44,409 |
private boolean checkRolePermission(Session session, Role role, Permission perm)
throws SecurityException
{
boolean result = false;
List<UserAdminRole> uaRoles = session.getAdminRoles();
if(CollectionUtils.isNotEmpty( uaRoles ))
{
// validate perm and retrieve perm's ou:
PermObj inObj = new PermObj(perm.getObjName());
inObj.setContextId(contextId);
PermObj pObj = permP.read(inObj);
for(UserAdminRole uaRole : uaRoles)
{
if(uaRole.getName().equalsIgnoreCase(SUPER_ADMIN))
{
result = true;
break;
}
Set<String> osPs = uaRole.getOsPSet();
if(CollectionUtils.isNotEmpty( osPs ))
{
// create Set with case insensitive comparator:
Set<String> osPsFinal = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
for(String osP : osPs)
{
// Add osU children to the set:
osPsFinal.add(osP);
Set<String> children = PsoUtil.getInstance().getDescendants( osP, this.contextId );
osPsFinal.addAll(children);
}
// does the admin role have authority over the perm object?
if(osPsFinal.contains(pObj.getOu()))
{
// Get the Role range for admin role:
Set<String> range;
if(uaRole.getBeginRange() != null && uaRole.getEndRange() != null && !uaRole.getBeginRange().equalsIgnoreCase(uaRole.getEndRange()))
{
range = RoleUtil.getInstance().getAscendants(uaRole.getBeginRange(), uaRole.getEndRange(), uaRole.isEndInclusive(), this.contextId);
if(uaRole.isBeginInclusive())
{
range.add(uaRole.getBeginRange());
}
if( CollectionUtils.isNotEmpty( range ))
{
// Does admin role have authority over a role contained with the allowable role range?
if(range.contains(role.getName()))
{
result = true;
break;
}
}
}
// Does admin role have authority over the role?
else if(uaRole.getBeginRange() != null && uaRole.getBeginRange().equalsIgnoreCase(role.getName()))
{
result = true;
break;
}
}
}
}
}
return result;
} | boolean function(Session session, Role role, Permission perm) throws SecurityException { boolean result = false; List<UserAdminRole> uaRoles = session.getAdminRoles(); if(CollectionUtils.isNotEmpty( uaRoles )) { PermObj inObj = new PermObj(perm.getObjName()); inObj.setContextId(contextId); PermObj pObj = permP.read(inObj); for(UserAdminRole uaRole : uaRoles) { if(uaRole.getName().equalsIgnoreCase(SUPER_ADMIN)) { result = true; break; } Set<String> osPs = uaRole.getOsPSet(); if(CollectionUtils.isNotEmpty( osPs )) { Set<String> osPsFinal = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); for(String osP : osPs) { osPsFinal.add(osP); Set<String> children = PsoUtil.getInstance().getDescendants( osP, this.contextId ); osPsFinal.addAll(children); } if(osPsFinal.contains(pObj.getOu())) { Set<String> range; if(uaRole.getBeginRange() != null && uaRole.getEndRange() != null && !uaRole.getBeginRange().equalsIgnoreCase(uaRole.getEndRange())) { range = RoleUtil.getInstance().getAscendants(uaRole.getBeginRange(), uaRole.getEndRange(), uaRole.isEndInclusive(), this.contextId); if(uaRole.isBeginInclusive()) { range.add(uaRole.getBeginRange()); } if( CollectionUtils.isNotEmpty( range )) { if(range.contains(role.getName())) { result = true; break; } } } else if(uaRole.getBeginRange() != null && uaRole.getBeginRange().equalsIgnoreCase(role.getName())) { result = true; break; } } } } } return result; } | /**
* This helper function processes ARBAC PRA "can assign".
* @param session
* @param role
* @param perm
* @return boolean
* @throws SecurityException
*/ | This helper function processes ARBAC PRA "can assign" | checkRolePermission | {
"repo_name": "PennState/directory-fortress-core-1",
"path": "src/main/java/org/apache/directory/fortress/core/impl/DelAccessMgrImpl.java",
"license": "apache-2.0",
"size": 17303
} | [
"java.util.List",
"java.util.Set",
"java.util.TreeSet",
"org.apache.commons.collections.CollectionUtils",
"org.apache.directory.fortress.core.SecurityException",
"org.apache.directory.fortress.core.model.PermObj",
"org.apache.directory.fortress.core.model.Permission",
"org.apache.directory.fortress.core.model.Role",
"org.apache.directory.fortress.core.model.Session",
"org.apache.directory.fortress.core.model.UserAdminRole"
] | import java.util.List; import java.util.Set; import java.util.TreeSet; import org.apache.commons.collections.CollectionUtils; import org.apache.directory.fortress.core.SecurityException; import org.apache.directory.fortress.core.model.PermObj; import org.apache.directory.fortress.core.model.Permission; import org.apache.directory.fortress.core.model.Role; import org.apache.directory.fortress.core.model.Session; import org.apache.directory.fortress.core.model.UserAdminRole; | import java.util.*; import org.apache.commons.collections.*; import org.apache.directory.fortress.core.*; import org.apache.directory.fortress.core.model.*; | [
"java.util",
"org.apache.commons",
"org.apache.directory"
] | java.util; org.apache.commons; org.apache.directory; | 228,912 |
public Insets getBorderInsets(Component c)
{
return new Insets(top, left, bottom, right);
} | Insets function(Component c) { return new Insets(top, left, bottom, right); } | /**
* This method returns the insets of the border.
*
* @param c The Component to find border insets for.
*
* @return The border insets.
*/ | This method returns the insets of the border | getBorderInsets | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/plaf/basic/BasicDesktopIconUI.java",
"license": "bsd-3-clause",
"size": 15822
} | [
"java.awt.Component",
"java.awt.Insets"
] | import java.awt.Component; import java.awt.Insets; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,008,466 |
public Q has(String selector) {
return function(new HasFunction<T>(selector, searchStrategy, provider));
} | Q function(String selector) { return function(new HasFunction<T>(selector, searchStrategy, provider)); } | /**
* Pick such Resources from the collection that have descendant matching the selector.
*
* @param selector Descendant selector
* @return new SlingQuery object transformed by this operation
*/ | Pick such Resources from the collection that have descendant matching the selector | has | {
"repo_name": "headwirecom/sling",
"path": "contrib/extensions/sling-query/src/main/java/org/apache/sling/query/AbstractQuery.java",
"license": "apache-2.0",
"size": 26338
} | [
"org.apache.sling.query.function.HasFunction"
] | import org.apache.sling.query.function.HasFunction; | import org.apache.sling.query.function.*; | [
"org.apache.sling"
] | org.apache.sling; | 699,938 |
public Properties getDistributedSystemProperties() {
return distributedSystemProperties;
} | Properties function() { return distributedSystemProperties; } | /**
* Gets the Geode Distributed System (cluster) Properties configuration.
*
* @return a Properties object containing configuration settings for the Geode Distributed
* System (cluster).
* @see java.util.Properties
*/ | Gets the Geode Distributed System (cluster) Properties configuration | getDistributedSystemProperties | {
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java",
"license": "apache-2.0",
"size": 86323
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 1,539,472 |
public static String getStatusDescription(Context context, int statusCode, String deviceName) {
String ret;
if (statusCode == BluetoothShare.STATUS_PENDING) {
ret = context.getString(R.string.status_pending);
} else if (statusCode == BluetoothShare.STATUS_RUNNING) {
ret = context.getString(R.string.status_running);
} else if (statusCode == BluetoothShare.STATUS_SUCCESS) {
ret = context.getString(R.string.status_success);
} else if (statusCode == BluetoothShare.STATUS_NOT_ACCEPTABLE) {
ret = context.getString(R.string.status_not_accept);
} else if (statusCode == BluetoothShare.STATUS_FORBIDDEN) {
ret = context.getString(R.string.status_forbidden);
} else if (statusCode == BluetoothShare.STATUS_CANCELED) {
ret = context.getString(R.string.status_canceled);
} else if (statusCode == BluetoothShare.STATUS_FILE_ERROR) {
ret = context.getString(R.string.status_file_error);
} else if (statusCode == BluetoothShare.STATUS_ERROR_NO_SDCARD) {
ret = context.getString(R.string.status_no_sd_card);
} else if (statusCode == BluetoothShare.STATUS_CONNECTION_ERROR) {
ret = context.getString(R.string.status_connection_error);
} else if (statusCode == BluetoothShare.STATUS_ERROR_SDCARD_FULL) {
ret = context.getString(R.string.bt_sm_2_1, deviceName);
} else if ((statusCode == BluetoothShare.STATUS_BAD_REQUEST)
|| (statusCode == BluetoothShare.STATUS_LENGTH_REQUIRED)
|| (statusCode == BluetoothShare.STATUS_PRECONDITION_FAILED)
|| (statusCode == BluetoothShare.STATUS_UNHANDLED_OBEX_CODE)
|| (statusCode == BluetoothShare.STATUS_OBEX_DATA_ERROR)) {
ret = context.getString(R.string.status_protocol_error);
} else {
ret = context.getString(R.string.status_unknown_error);
}
return ret;
} | static String function(Context context, int statusCode, String deviceName) { String ret; if (statusCode == BluetoothShare.STATUS_PENDING) { ret = context.getString(R.string.status_pending); } else if (statusCode == BluetoothShare.STATUS_RUNNING) { ret = context.getString(R.string.status_running); } else if (statusCode == BluetoothShare.STATUS_SUCCESS) { ret = context.getString(R.string.status_success); } else if (statusCode == BluetoothShare.STATUS_NOT_ACCEPTABLE) { ret = context.getString(R.string.status_not_accept); } else if (statusCode == BluetoothShare.STATUS_FORBIDDEN) { ret = context.getString(R.string.status_forbidden); } else if (statusCode == BluetoothShare.STATUS_CANCELED) { ret = context.getString(R.string.status_canceled); } else if (statusCode == BluetoothShare.STATUS_FILE_ERROR) { ret = context.getString(R.string.status_file_error); } else if (statusCode == BluetoothShare.STATUS_ERROR_NO_SDCARD) { ret = context.getString(R.string.status_no_sd_card); } else if (statusCode == BluetoothShare.STATUS_CONNECTION_ERROR) { ret = context.getString(R.string.status_connection_error); } else if (statusCode == BluetoothShare.STATUS_ERROR_SDCARD_FULL) { ret = context.getString(R.string.bt_sm_2_1, deviceName); } else if ((statusCode == BluetoothShare.STATUS_BAD_REQUEST) (statusCode == BluetoothShare.STATUS_LENGTH_REQUIRED) (statusCode == BluetoothShare.STATUS_PRECONDITION_FAILED) (statusCode == BluetoothShare.STATUS_UNHANDLED_OBEX_CODE) (statusCode == BluetoothShare.STATUS_OBEX_DATA_ERROR)) { ret = context.getString(R.string.status_protocol_error); } else { ret = context.getString(R.string.status_unknown_error); } return ret; } | /**
* Get status description according to status code.
*/ | Get status description according to status code | getStatusDescription | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppUtility.java",
"license": "gpl-2.0",
"size": 13564
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 2,373,380 |
private ILexLocation location(int tokline, int tokpos, int startOffset,
int endOffset)
{
// Fix for location on traces
if (this.location != null)
{
return this.location;
} else
{
return new LexLocation(file, currentModule, tokline, tokpos, linecount, charpos, startOffset, endOffset);
}
} | ILexLocation function(int tokline, int tokpos, int startOffset, int endOffset) { if (this.location != null) { return this.location; } else { return new LexLocation(file, currentModule, tokline, tokpos, linecount, charpos, startOffset, endOffset); } } | /**
* Create a {@link LexLocation} object from the current stream position.
*
* @param tokline
* The token start line.
* @param tokpos
* The token start position.
* @param endOffset
* @return A new LexLocation.
*/ | Create a <code>LexLocation</code> object from the current stream position | location | {
"repo_name": "overturetool/overture",
"path": "core/parser/src/main/java/org/overture/parser/lex/LexTokenReader.java",
"license": "gpl-3.0",
"size": 27326
} | [
"org.overture.ast.intf.lex.ILexLocation",
"org.overture.ast.lex.LexLocation"
] | import org.overture.ast.intf.lex.ILexLocation; import org.overture.ast.lex.LexLocation; | import org.overture.ast.intf.lex.*; import org.overture.ast.lex.*; | [
"org.overture.ast"
] | org.overture.ast; | 1,875,974 |
public static IParser getParser(IElementType type, EObject object,
String parserHint) {
return ParserService.getInstance().getParser(
new HintAdapter(type, object, parserHint));
}
| static IParser function(IElementType type, EObject object, String parserHint) { return ParserService.getInstance().getParser( new HintAdapter(type, object, parserHint)); } | /**
* Utility method that consults ParserService
* @generated
*/ | Utility method that consults ParserService | getParser | {
"repo_name": "deveshg/fsm",
"path": "com.example.fsm.diagram/src/com/example/fsm/diagram/providers/FsmParserProvider.java",
"license": "epl-1.0",
"size": 3423
} | [
"org.eclipse.emf.ecore.EObject",
"org.eclipse.gmf.runtime.common.ui.services.parser.IParser",
"org.eclipse.gmf.runtime.common.ui.services.parser.ParserService",
"org.eclipse.gmf.runtime.emf.type.core.IElementType"
] | import org.eclipse.emf.ecore.EObject; import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; import org.eclipse.gmf.runtime.emf.type.core.IElementType; | import org.eclipse.emf.ecore.*; import org.eclipse.gmf.runtime.common.ui.services.parser.*; import org.eclipse.gmf.runtime.emf.type.core.*; | [
"org.eclipse.emf",
"org.eclipse.gmf"
] | org.eclipse.emf; org.eclipse.gmf; | 2,807,480 |
public Map<String, NXgeometry> getAllGeometry();
| Map<String, NXgeometry> function(); | /**
* Get all NXgeometry nodes:
* <ul>
* <li>
* geometry of the fermi chopper</li>
* </ul>
*
* @return a map from node names to the NXgeometry for that node.
*/ | Get all NXgeometry nodes: geometry of the fermi chopper | getAllGeometry | {
"repo_name": "belkassaby/dawnsci",
"path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXfermi_chopper.java",
"license": "epl-1.0",
"size": 11611
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 543,244 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.