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 Vector2 localToStageCoordinates (Vector2 localCoords) {
return localToAscendantCoordinates(null, localCoords);
}
| Vector2 function (Vector2 localCoords) { return localToAscendantCoordinates(null, localCoords); } | /** Transforms the specified point in the actor's coordinates to be in the stage's coordinates.
* @see Stage#toScreenCoordinates(Vector2, com.badlogic.gdx.math.Matrix4) */ | Transforms the specified point in the actor's coordinates to be in the stage's coordinates | localToStageCoordinates | {
"repo_name": "lordjone/libgdx",
"path": "gdx/src/com/badlogic/gdx/scenes/scene2d/Actor.java",
"license": "apache-2.0",
"size": 25122
} | [
"com.badlogic.gdx.math.Vector2"
] | import com.badlogic.gdx.math.Vector2; | import com.badlogic.gdx.math.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 908,651 |
protected Date getDate(final int year, final int month, final int day, final int hour, final int minute,
final int second) {
final var calendar = DateUtils.newCalendar();
calendar.clear();
calendar.set(year, month - 1, day, hour, minute, second);
calendar.set(Calendar.MILLISECOND, 0);
return calen... | Date function(final int year, final int month, final int day, final int hour, final int minute, final int second) { final var calendar = DateUtils.newCalendar(); calendar.clear(); calendar.set(year, month - 1, day, hour, minute, second); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } | /**
* Get a date
*
* @param year
* year
* @param month
* 1 based (January = 1)
* @param day
* day
* @param hour
* hour
* @param minute
* minute
* @param second
* second
* @return Date
*/ | Get a date | getDate | {
"repo_name": "ligoj/bootstrap",
"path": "bootstrap-business-test/src/main/java/org/ligoj/bootstrap/AbstractDataGeneratorTest.java",
"license": "mit",
"size": 11380
} | [
"java.util.Calendar",
"java.util.Date",
"org.ligoj.bootstrap.core.DateUtils"
] | import java.util.Calendar; import java.util.Date; import org.ligoj.bootstrap.core.DateUtils; | import java.util.*; import org.ligoj.bootstrap.core.*; | [
"java.util",
"org.ligoj.bootstrap"
] | java.util; org.ligoj.bootstrap; | 220,156 |
public void setXdsbRegistryGetter(XdsbRegistryGetter xdsbRegistryGetter) {
this.xdsbRegistryGetter = xdsbRegistryGetter;
} | void function(XdsbRegistryGetter xdsbRegistryGetter) { this.xdsbRegistryGetter = xdsbRegistryGetter; } | /**
* Sets the xdsb registry getter.
*
* @param xdsbRegistryGetter
* the new xdsb registry getter
*/ | Sets the xdsb registry getter | setXdsbRegistryGetter | {
"repo_name": "OBHITA/Consent2Share",
"path": "DS4P/acs-showcase/web-pg/src/main/java/gov/samhsa/consent2share/showcase/service/PixOperationsServiceImpl.java",
"license": "bsd-3-clause",
"size": 20714
} | [
"gov.samhsa.consent2share.showcase.infrastructure.XdsbRegistryGetter"
] | import gov.samhsa.consent2share.showcase.infrastructure.XdsbRegistryGetter; | import gov.samhsa.consent2share.showcase.infrastructure.*; | [
"gov.samhsa.consent2share"
] | gov.samhsa.consent2share; | 312,023 |
RequestContext.setUsername(AbstractTest.USERNAME);
} | RequestContext.setUsername(AbstractTest.USERNAME); } | /**
* Prepares the test class for execution.
*/ | Prepares the test class for execution | setUp | {
"repo_name": "mwarman/spring-data-fundamentals",
"path": "src/test/java/org/example/ws/AbstractTest.java",
"license": "apache-2.0",
"size": 1054
} | [
"org.example.ws.util.RequestContext"
] | import org.example.ws.util.RequestContext; | import org.example.ws.util.*; | [
"org.example.ws"
] | org.example.ws; | 2,695,587 |
public static String getValidMimeTypeFromUrl(String url) {
if (url != null) {
String extension = FilenameUtils.getExtension(url);
if (extension != null) {
String type = MimeTypeMap.getSingleton()
.getMimeTypeFromExtension(extension);
if (type != null && enclosureTypeValid(type)) {
return t... | static String function(String url) { if (url != null) { String extension = FilenameUtils.getExtension(url); if (extension != null) { String type = MimeTypeMap.getSingleton() .getMimeTypeFromExtension(extension); if (type != null && enclosureTypeValid(type)) { return type; } } } return null; } | /**
* Should be used if mime-type of enclosure tag is not supported. This
* method will check if the mime-type of the file extension is supported. If
* the type is not supported, this method will return null.
*/ | Should be used if mime-type of enclosure tag is not supported. This method will check if the mime-type of the file extension is supported. If the type is not supported, this method will return null | getValidMimeTypeFromUrl | {
"repo_name": "Woogis/SisatongPodcast",
"path": "core/src/main/java/net/sisatong/podcast/core/syndication/util/SyndTypeUtils.java",
"license": "mit",
"size": 1095
} | [
"android.webkit.MimeTypeMap",
"org.apache.commons.io.FilenameUtils"
] | import android.webkit.MimeTypeMap; import org.apache.commons.io.FilenameUtils; | import android.webkit.*; import org.apache.commons.io.*; | [
"android.webkit",
"org.apache.commons"
] | android.webkit; org.apache.commons; | 2,683,441 |
public static List<Fabricante> getAll() {
ProcedimientoNoTransaccionalDAO consulta = new DAOManager();
return (List< Fabricante>) consulta.ejecutar((DAOManager DAOManager) -> {
return DAOManager.getFabricanteDAO().getAllFabricantesHabilitados();
});
} | static List<Fabricante> function() { ProcedimientoNoTransaccionalDAO consulta = new DAOManager(); return (List< Fabricante>) consulta.ejecutar((DAOManager DAOManager) -> { return DAOManager.getFabricanteDAO().getAllFabricantesHabilitados(); }); } | /**
* Se obtiene listado de todos los fabricantes.
*
* @return listado de Fabricantes
*/ | Se obtiene listado de todos los fabricantes | getAll | {
"repo_name": "NullPointer-Chile/farmacia-popular",
"path": "farmacia-popular/src/main/java/cl/nullpointer/farmaciapopular/dominio/Fabricante.java",
"license": "gpl-3.0",
"size": 5797
} | [
"cl.nullpointer.farmaciapopular.DAO",
"java.util.List"
] | import cl.nullpointer.farmaciapopular.DAO; import java.util.List; | import cl.nullpointer.farmaciapopular.*; import java.util.*; | [
"cl.nullpointer.farmaciapopular",
"java.util"
] | cl.nullpointer.farmaciapopular; java.util; | 1,081,989 |
private void restartExecutor(int startFrom) {
Intent intent = new Intent();
intent.setClass(this, LayoutTestsExecutor.class);
intent.setAction(Intent.ACTION_RUN);
if (startFrom < mTotalTestCount) {
File testListFile = new File(getExternalFilesDir(null), "test_list.txt");... | void function(int startFrom) { Intent intent = new Intent(); intent.setClass(this, LayoutTestsExecutor.class); intent.setAction(Intent.ACTION_RUN); if (startFrom < mTotalTestCount) { File testListFile = new File(getExternalFilesDir(null), STR); FsUtils.saveTestListToStorage(testListFile, startFrom, mTestsList); intent.... | /**
* (Re)starts the executer activity from the given test number (inclusive, 0-based).
* This number is an index in mTestsList, not the sublist passed in the intent.
*
* @param startFrom
* test index in mTestsList to start the tests from (inclusive, 0-based)
*/ | (Re)starts the executer activity from the given test number (inclusive, 0-based). This number is an index in mTestsList, not the sublist passed in the intent | restartExecutor | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/base/tests/DumpRenderTree2/src/com/android/dumprendertree2/TestsListActivity.java",
"license": "gpl-2.0",
"size": 7513
} | [
"android.content.Intent",
"java.io.File"
] | import android.content.Intent; import java.io.File; | import android.content.*; import java.io.*; | [
"android.content",
"java.io"
] | android.content; java.io; | 2,663,003 |
public Map<String, StoredProcedureParameter> storedProcedureParameters() {
return this.storedProcedureParameters;
} | Map<String, StoredProcedureParameter> function() { return this.storedProcedureParameters; } | /**
* Get sQL stored procedure parameters.
*
* @return the storedProcedureParameters value
*/ | Get sQL stored procedure parameters | storedProcedureParameters | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/datafactory/mgmt-v2018_06_01/src/main/java/com/microsoft/azure/management/datafactory/v2018_06_01/SqlMISink.java",
"license": "mit",
"size": 6204
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,083,161 |
public void testEquals() {
RectangleInsets i1 = new RectangleInsets(
UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0
);
RectangleInsets i2 = new RectangleInsets(
UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0
);
assertTrue(i1.equals(i2));
assertTrue(i2.equals(i1)... | void function() { RectangleInsets i1 = new RectangleInsets( UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0 ); RectangleInsets i2 = new RectangleInsets( UnitType.ABSOLUTE, 1.0, 2.0, 3.0, 4.0 ); assertTrue(i1.equals(i2)); assertTrue(i2.equals(i1)); i1 = new RectangleInsets(UnitType.RELATIVE, 1.0, 2.0, 3.0, 4.0); assertFalse(i1.eq... | /**
* Test the equals() method.
*/ | Test the equals() method | testEquals | {
"repo_name": "tekkies/jcommon-serialdate-refactor",
"path": "source/org/jfree/ui/junit/RectangleInsetsTests.java",
"license": "lgpl-2.1",
"size": 11865
} | [
"org.jfree.ui.RectangleInsets",
"org.jfree.util.UnitType"
] | import org.jfree.ui.RectangleInsets; import org.jfree.util.UnitType; | import org.jfree.ui.*; import org.jfree.util.*; | [
"org.jfree.ui",
"org.jfree.util"
] | org.jfree.ui; org.jfree.util; | 1,853,446 |
protected void handleStationCommand(int stationId, Command command) {
try {
if (command == OnOffType.ON) {
openSprinklerDevice.openStation(stationId);
} else if (command == OnOffType.OFF) {
openSprinklerDevice.closeStation(stationId);
} els... | void function(int stationId, Command command) { try { if (command == OnOffType.ON) { openSprinklerDevice.openStation(stationId); } else if (command == OnOffType.OFF) { openSprinklerDevice.closeStation(stationId); } else { logger.error(STR + command.toString() + ")."); } } catch (Exception exp) { updateStatus(ThingStatu... | /**
* Handles control of an OpenSprnkler station based on commanded
* received by a channel call.
*
* @param stationId Int of the station to control. Starts at 0.
* @param command Command being issues to the channel.
*/ | Handles control of an OpenSprnkler station based on commanded received by a channel call | handleStationCommand | {
"repo_name": "mickey4u/new_mart",
"path": "addons/binding/org.openhab.binding.opensprinkler/src/main/java/org/openhab/binding/opensprinkler/handler/OpenSprinklerHandler.java",
"license": "epl-1.0",
"size": 5173
} | [
"org.eclipse.smarthome.core.library.types.OnOffType",
"org.eclipse.smarthome.core.thing.ThingStatus",
"org.eclipse.smarthome.core.thing.ThingStatusDetail",
"org.eclipse.smarthome.core.types.Command"
] | import org.eclipse.smarthome.core.library.types.OnOffType; import org.eclipse.smarthome.core.thing.ThingStatus; import org.eclipse.smarthome.core.thing.ThingStatusDetail; import org.eclipse.smarthome.core.types.Command; | import org.eclipse.smarthome.core.library.types.*; import org.eclipse.smarthome.core.thing.*; import org.eclipse.smarthome.core.types.*; | [
"org.eclipse.smarthome"
] | org.eclipse.smarthome; | 1,059,740 |
private static String getFqdnHostName(InetAddress inetAddress) {
String fqdnHostName;
try {
fqdnHostName = inetAddress.getCanonicalHostName();
} catch (Throwable t) {
LOG.warn("Unable to determine the canonical hostname. Input split assignment (such as " +
"for HDFS files) may be non-local when the c... | static String function(InetAddress inetAddress) { String fqdnHostName; try { fqdnHostName = inetAddress.getCanonicalHostName(); } catch (Throwable t) { LOG.warn(STR + STR); LOG.debug(STR, t); fqdnHostName = inetAddress.getHostAddress(); } return fqdnHostName; } | /**
* Gets the fully qualified hostname of the TaskManager based on the network address.
*
* @param inetAddress the network address that the TaskManager binds its sockets to
* @return fully qualified hostname of the TaskManager
*/ | Gets the fully qualified hostname of the TaskManager based on the network address | getFqdnHostName | {
"repo_name": "fhueske/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/TaskManagerLocation.java",
"license": "apache-2.0",
"size": 9543
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 849,028 |
public static ODataDeltaFeed readDeltaFeed(final String contentType, final EdmEntitySet entitySet,
final InputStream content,
final EntityProviderReadProperties properties) throws EntityProviderException {
return createEntityProvider().readDeltaFeed(contentType, entitySet, content, properties);
}
... | static ODataDeltaFeed function(final String contentType, final EdmEntitySet entitySet, final InputStream content, final EntityProviderReadProperties properties) throws EntityProviderException { return createEntityProvider().readDeltaFeed(contentType, entitySet, content, properties); } /** * Read (de-serialize) data fro... | /**
* Read (de-serialize) a delta data feed from <code>content</code> (as {@link InputStream}) in specified format
* (given as <code>contentType</code>) based on <code>entity data model</code> (given as {@link EdmEntitySet}) and
* provide this data as {@link ODataEntry} .
*
* @param contentType format o... | Read (de-serialize) a delta data feed from <code>content</code> (as <code>InputStream</code>) in specified format (given as <code>contentType</code>) based on <code>entity data model</code> (given as <code>EdmEntitySet</code>) and provide this data as <code>ODataEntry</code> | readDeltaFeed | {
"repo_name": "apache/olingo-odata2",
"path": "odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java",
"license": "apache-2.0",
"size": 52818
} | [
"java.io.InputStream",
"java.util.Map",
"org.apache.olingo.odata2.api.edm.EdmEntitySet",
"org.apache.olingo.odata2.api.ep.entry.ODataEntry",
"org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed"
] | import java.io.InputStream; import java.util.Map; import org.apache.olingo.odata2.api.edm.EdmEntitySet; import org.apache.olingo.odata2.api.ep.entry.ODataEntry; import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed; | import java.io.*; import java.util.*; import org.apache.olingo.odata2.api.edm.*; import org.apache.olingo.odata2.api.ep.entry.*; import org.apache.olingo.odata2.api.ep.feed.*; | [
"java.io",
"java.util",
"org.apache.olingo"
] | java.io; java.util; org.apache.olingo; | 2,518,042 |
public void transferTo(PinotDataBuffer rhs) {
Preconditions.checkNotNull(rhs);
Preconditions.checkArgument(rhs instanceof PinotLByteBuffer);
PinotLByteBuffer rhsBuffer = (PinotLByteBuffer) rhs;
if (rhs != this) {
rhsBuffer.buffer = buffer;
rhsBuffer.owner = owner;
this.owner = false;... | void function(PinotDataBuffer rhs) { Preconditions.checkNotNull(rhs); Preconditions.checkArgument(rhs instanceof PinotLByteBuffer); PinotLByteBuffer rhsBuffer = (PinotLByteBuffer) rhs; if (rhs != this) { rhsBuffer.buffer = buffer; rhsBuffer.owner = owner; this.owner = false; } } | /**
* Transfer the ownership of this buffer. Ownership is transferred only if
* this buffer is the owner. Otherwise, this method simply acts like a copy
* @param rhs
*/ | Transfer the ownership of this buffer. Ownership is transferred only if this buffer is the owner. Otherwise, this method simply acts like a copy | transferTo | {
"repo_name": "tkao1000/pinot",
"path": "pinot-core/src/main/java/com/linkedin/pinot/core/segment/memory/PinotLByteBuffer.java",
"license": "apache-2.0",
"size": 14882
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 698,637 |
private String toValidTableName(String string) {
final Function<String, String> lowercase = String::toLowerCase;
return lowercase
// prefix must be a letter
.andThen(s -> s.matches("^[a-zA-Z].*") ? s : "x" + s)
// replace non alphanumeric characters
.... | String function(String string) { final Function<String, String> lowercase = String::toLowerCase; return lowercase .andThen(s -> s.matches(STR) ? s : "x" + s) .andThen(s -> s.replaceAll("\\W", "_")) .andThen(s -> isValidKeyword(s) ? s : s + "_") .andThen(s -> StringUtils.left(s, IDENTIFIER_MAX_LEN)) .apply(string); } | /**
* Converts table name to valid string according to database engine and driver constraints.
* @param string table name
* @return valid name
*/ | Converts table name to valid string according to database engine and driver constraints | toValidTableName | {
"repo_name": "trustedanalytics/dataset-publisher",
"path": "src/main/java/org/trustedanalytics/datasetpublisher/boundary/MetadataMapper.java",
"license": "apache-2.0",
"size": 4311
} | [
"java.util.function.Function",
"org.apache.commons.lang.StringUtils"
] | import java.util.function.Function; import org.apache.commons.lang.StringUtils; | import java.util.function.*; import org.apache.commons.lang.*; | [
"java.util",
"org.apache.commons"
] | java.util; org.apache.commons; | 634,072 |
void queryCdmaRoamingPreference(Message response); | void queryCdmaRoamingPreference(Message response); | /**
* Query the CDMA roaming preference setting
*
* @param response is callback message to report one of CDMA_RM_*
*/ | Query the CDMA roaming preference setting | queryCdmaRoamingPreference | {
"repo_name": "indashnet/InDashNet.Open.UN2000",
"path": "android/frameworks/opt/telephony/src/java/com/android/internal/telephony/CommandsInterface.java",
"license": "apache-2.0",
"size": 60442
} | [
"android.os.Message"
] | import android.os.Message; | import android.os.*; | [
"android.os"
] | android.os; | 1,621,255 |
private Literal add( final Literal p_literal )
{
final Set<ILiteral<Literal>> l_elements = m_multielements.getOrDefault( p_literal.getFunctor(), new HashSet<>() );
l_elements.add( new CLiteral( p_literal ) );
m_multielements.put( p_literal.getFunctor(), l_elements );
... | Literal function( final Literal p_literal ) { final Set<ILiteral<Literal>> l_elements = m_multielements.getOrDefault( p_literal.getFunctor(), new HashSet<>() ); l_elements.add( new CLiteral( p_literal ) ); m_multielements.put( p_literal.getFunctor(), l_elements ); return p_literal; } } | /**
* adds an element to the storage
*
* @param p_literal literal
* @return input literal
*/ | adds an element to the storage | add | {
"repo_name": "flashpixx/MecSim",
"path": "src/main/java/de/tu_clausthal/in/mec/object/car/CCarJasonAgent.java",
"license": "gpl-3.0",
"size": 17209
} | [
"de.tu_clausthal.in.mec.object.mas.generic.ILiteral",
"de.tu_clausthal.in.mec.object.mas.jason.belief.CLiteral",
"java.util.HashSet",
"java.util.Set"
] | import de.tu_clausthal.in.mec.object.mas.generic.ILiteral; import de.tu_clausthal.in.mec.object.mas.jason.belief.CLiteral; import java.util.HashSet; import java.util.Set; | import de.tu_clausthal.in.mec.object.mas.generic.*; import de.tu_clausthal.in.mec.object.mas.jason.belief.*; import java.util.*; | [
"de.tu_clausthal.in",
"java.util"
] | de.tu_clausthal.in; java.util; | 456,437 |
public void setMediumDateFormatter(DateTimeFormatter mediumDateFormatter){
this.mediumDateFormatter = mediumDateFormatter;
}
/**
* Sets the Short Date Formatter, the value by default is {@link FormatStyle#SHORT}. <br>
* Is be used to set a Date format text in {@li... | void function(DateTimeFormatter mediumDateFormatter){ this.mediumDateFormatter = mediumDateFormatter; } /** * Sets the Short Date Formatter, the value by default is {@link FormatStyle#SHORT}. <br> * Is be used to set a Date format text in {@link #getTimeText(Entry)} | /**
* Sets the Medium Date Formatter, the value by default is {@link FormatStyle#MEDIUM}. <br>
* Is used to set a format text on the Date Label.
* @param mediumDateFormatter sets medium date time format.
*/ | Sets the Medium Date Formatter, the value by default is <code>FormatStyle#MEDIUM</code>. Is used to set a format text on the Date Label | setMediumDateFormatter | {
"repo_name": "dlemmermann/CalendarFX",
"path": "CalendarFXView/src/main/java/com/calendarfx/view/AgendaView.java",
"license": "apache-2.0",
"size": 27040
} | [
"com.calendarfx.model.Entry",
"java.time.format.DateTimeFormatter",
"java.time.format.FormatStyle"
] | import com.calendarfx.model.Entry; import java.time.format.DateTimeFormatter; import java.time.format.FormatStyle; | import com.calendarfx.model.*; import java.time.format.*; | [
"com.calendarfx.model",
"java.time"
] | com.calendarfx.model; java.time; | 1,445,405 |
public Map getXPathNamespaceURIs() {
return xpathNamespaceURIs;
}
| Map function() { return xpathNamespaceURIs; } | /**
* DOCUMENT ME!
*
* @return the Map of namespace URIs that will be used by by XPath
* expressions to resolve namespace prefixes into namespace URIs.
* The map is keyed by namespace prefix and the value is the
* namespace URI. This value could well be null ... | DOCUMENT ME | getXPathNamespaceURIs | {
"repo_name": "teslaworksumn/lightshow-visualizer",
"path": "lib/dom4j-1.6.1/src/java/org/dom4j/DocumentFactory.java",
"license": "mit",
"size": 15078
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,283,488 |
public static ims.core.documents.domain.objects.PatientDocument extractPatientDocument(ims.domain.ILightweightDomainFactory domainFactory, ims.correspondence.vo.CheckedOutDocumentVo valueObject)
{
return extractPatientDocument(domainFactory, valueObject, new HashMap());
}
| static ims.core.documents.domain.objects.PatientDocument function(ims.domain.ILightweightDomainFactory domainFactory, ims.correspondence.vo.CheckedOutDocumentVo valueObject) { return extractPatientDocument(domainFactory, valueObject, new HashMap()); } | /**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/ | Create the domain object from the value object | extractPatientDocument | {
"repo_name": "open-health-hub/openmaxims-linux",
"path": "openmaxims_workspace/ValueObjects/src/ims/correspondence/vo/domain/CheckedOutDocumentVoAssembler.java",
"license": "agpl-3.0",
"size": 20100
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,430,852 |
@Test
public void testObjectFilter() throws Exception {
VerbDefinition definition = mapper.readValue(VerbDefinitionFilterTest.class.getResourceAsStream("/object.json"), VerbDefinition.class);
VerbDefinitionKeepFilter filter = new VerbDefinitionKeepFilter(Sets.newHashSet(definition));
fil... | void function() throws Exception { VerbDefinition definition = mapper.readValue(VerbDefinitionFilterTest.class.getResourceAsStream(STR), VerbDefinition.class); VerbDefinitionKeepFilter filter = new VerbDefinitionKeepFilter(Sets.newHashSet(definition)); filter.prepare(null); StreamsDatum datum1 = new StreamsDatum(mapper... | /**
* Test object filter, if object doesn't have a type it should not pass
*/ | Test object filter, if object doesn't have a type it should not pass | testObjectFilter | {
"repo_name": "robdouglas/incubator-streams",
"path": "streams-components/streams-filters/src/test/java/org/apache/streams/filters/test/VerbDefinitionFilterTest.java",
"license": "apache-2.0",
"size": 15305
} | [
"com.google.common.collect.Sets",
"java.util.List",
"org.apache.streams.core.StreamsDatum",
"org.apache.streams.filters.VerbDefinitionKeepFilter",
"org.apache.streams.pojo.json.Activity",
"org.apache.streams.verbs.VerbDefinition"
] | import com.google.common.collect.Sets; import java.util.List; import org.apache.streams.core.StreamsDatum; import org.apache.streams.filters.VerbDefinitionKeepFilter; import org.apache.streams.pojo.json.Activity; import org.apache.streams.verbs.VerbDefinition; | import com.google.common.collect.*; import java.util.*; import org.apache.streams.core.*; import org.apache.streams.filters.*; import org.apache.streams.pojo.json.*; import org.apache.streams.verbs.*; | [
"com.google.common",
"java.util",
"org.apache.streams"
] | com.google.common; java.util; org.apache.streams; | 1,694,722 |
public void setCreationDate(Date date) {
m_CreationDate = date;
} | void function(Date date) { m_CreationDate = date; } | /**
* --------------------------------------------------------------------------
* ------------------------------
*/ | -------------------------------------------------------------------------- ------------------------------ | setCreationDate | {
"repo_name": "CecileBONIN/Silverpeas-Core",
"path": "lib-core/src/main/java/com/silverpeas/util/clipboard/SilverpeasKeyData.java",
"license": "agpl-3.0",
"size": 4973
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,180,501 |
public AVMStoreDescriptor getSystemStore()
{
AVMStoreDescriptor store = getStore(SYSTEM);
if (store == null)
{
createStore(SYSTEM);
return getStore(SYSTEM);
}
return store;
}
| AVMStoreDescriptor function() { AVMStoreDescriptor store = getStore(SYSTEM); if (store == null) { createStore(SYSTEM); return getStore(SYSTEM); } return store; } | /**
* Get (and create if necessary) the system store. This store houses things
* like workflow packages.
* @return The descriptor.
*/ | Get (and create if necessary) the system store. This store houses things like workflow packages | getSystemStore | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/repository/source/java/org/alfresco/repo/avm/AVMServiceImpl.java",
"license": "lgpl-3.0",
"size": 59118
} | [
"org.alfresco.service.cmr.avm.AVMStoreDescriptor"
] | import org.alfresco.service.cmr.avm.AVMStoreDescriptor; | import org.alfresco.service.cmr.avm.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 118,888 |
protected void messageReceived(WsByteBuffer buffer) {
buffer.flip();
int length = buffer.remaining();
SipMessageByteBuffer data = SipMessageByteBuffer.fromPool();
data.ensureCapacity(length);
byte[] bytes = data.getBytes();
buffer.get(bytes, 0, length); // move data from WsByteBuffer to SipMessageByteBuf... | void function(WsByteBuffer buffer) { buffer.flip(); int length = buffer.remaining(); SipMessageByteBuffer data = SipMessageByteBuffer.fromPool(); data.ensureCapacity(length); byte[] bytes = data.getBytes(); buffer.get(bytes, 0, length); buffer.clear(); buffer.release(); data.setContentSize(length); if (TraceComponent.i... | /**
* called when new data arrives
*/ | called when new data arrives | messageReceived | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.sipcontainer/src/com/ibm/ws/sip/stack/transport/sip/BaseConnection.java",
"license": "epl-1.0",
"size": 5200
} | [
"com.ibm.websphere.ras.Tr",
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.ws.sip.stack.dispatch.Dispatcher",
"com.ibm.ws.sip.stack.transaction.transport.connections.SipMessageByteBuffer",
"com.ibm.wsspi.bytebuffer.WsByteBuffer"
] | import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sip.stack.dispatch.Dispatcher; import com.ibm.ws.sip.stack.transaction.transport.connections.SipMessageByteBuffer; import com.ibm.wsspi.bytebuffer.WsByteBuffer; | import com.ibm.websphere.ras.*; import com.ibm.ws.sip.stack.dispatch.*; import com.ibm.ws.sip.stack.transaction.transport.connections.*; import com.ibm.wsspi.bytebuffer.*; | [
"com.ibm.websphere",
"com.ibm.ws",
"com.ibm.wsspi"
] | com.ibm.websphere; com.ibm.ws; com.ibm.wsspi; | 1,435,142 |
private void ar2gvr(float[] poseMatrix, float scale) {
// Real world scale
Matrix.scaleM(poseMatrix, 0, scale, scale, scale);
poseMatrix[12] = poseMatrix[12] * scale;
poseMatrix[13] = poseMatrix[13] * scale;
poseMatrix[14] = poseMatrix[14] * scale;
} | void function(float[] poseMatrix, float scale) { Matrix.scaleM(poseMatrix, 0, scale, scale, scale); poseMatrix[12] = poseMatrix[12] * scale; poseMatrix[13] = poseMatrix[13] * scale; poseMatrix[14] = poseMatrix[14] * scale; } | /**
* Converts from AR world space to GVRf world space.
*/ | Converts from AR world space to GVRf world space | ar2gvr | {
"repo_name": "Samsung/GearVRf",
"path": "GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreHelper.java",
"license": "apache-2.0",
"size": 12822
} | [
"android.opengl.Matrix"
] | import android.opengl.Matrix; | import android.opengl.*; | [
"android.opengl"
] | android.opengl; | 2,106,433 |
public final MetaProperty<String> nodeName() {
return _nodeName;
} | final MetaProperty<String> function() { return _nodeName; } | /**
* The meta-property for the {@code nodeName} property.
* @return the meta-property, not null
*/ | The meta-property for the nodeName property | nodeName | {
"repo_name": "McLeodMoores/starling",
"path": "projects/financial/src/main/java/com/opengamma/batch/domain/ComputeNode.java",
"license": "apache-2.0",
"size": 8529
} | [
"org.joda.beans.MetaProperty"
] | import org.joda.beans.MetaProperty; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 2,557,832 |
public Object custToJdbcValue(DBValue value) throws DBAdapterException {
switch (value.type()) {
case STRING:
case TEXT:
return value.get().toString();
case SHORTINT:
return ((Short)value.get()).shortValue();
case INT:
return ((Integer) value.get()).intValue();
case LONG:
return ((Long) value... | Object function(DBValue value) throws DBAdapterException { switch (value.type()) { case STRING: case TEXT: return value.get().toString(); case SHORTINT: return ((Short)value.get()).shortValue(); case INT: return ((Integer) value.get()).intValue(); case LONG: return ((Long) value.get()).longValue(); case DATE: return (j... | /**
* Customize {@link DBValue} to JDBC value for prepared statement
* @param value
* @return
* @throws DBAdapterException
*/ | Customize <code>DBValue</code> to JDBC value for prepared statement | custToJdbcValue | {
"repo_name": "mozartframework/cms",
"path": "src/com/mozartframework/db/adapter/DBAdapter.java",
"license": "gpl-3.0",
"size": 43627
} | [
"com.mozartframework.db.base.DBValue",
"com.mozartframework.db.base.FileValue",
"com.mozartframework.util.UnreachableCodeReachedException"
] | import com.mozartframework.db.base.DBValue; import com.mozartframework.db.base.FileValue; import com.mozartframework.util.UnreachableCodeReachedException; | import com.mozartframework.db.base.*; import com.mozartframework.util.*; | [
"com.mozartframework.db",
"com.mozartframework.util"
] | com.mozartframework.db; com.mozartframework.util; | 773,722 |
public IBinder getBinder() {
synchronized (mLock) {
return mBinder;
}
}
| IBinder function() { synchronized (mLock) { return mBinder; } } | /**
* Returns a reference to the named service
*
* @return a reference to the service, or <code>null</code> if the service does not exist
*/ | Returns a reference to the named service | getBinder | {
"repo_name": "zoozooll/MyExercise",
"path": "meep/Meep/src/com/oregonscientific/meep/ServiceConnector.java",
"license": "apache-2.0",
"size": 4876
} | [
"android.os.IBinder"
] | import android.os.IBinder; | import android.os.*; | [
"android.os"
] | android.os; | 1,356,757 |
private void fireInvitationListeners(String room, String inviter, String reason, String password,
Message message) {
InvitationListener[] listeners;
synchronized (invitationsListeners) {
listeners = new InvitationListener[invit... | void function(String room, String inviter, String reason, String password, Message message) { InvitationListener[] listeners; synchronized (invitationsListeners) { listeners = new InvitationListener[invitationsListeners.size()]; invitationsListeners.toArray(listeners); } for (InvitationListener listener : listeners) { ... | /**
* Fires invitation listeners.
*/ | Fires invitation listeners | fireInvitationListeners | {
"repo_name": "jtietema/telegraph",
"path": "app/libs/asmack-android-16-source/org/jivesoftware/smackx/muc/MultiUserChat.java",
"license": "gpl-3.0",
"size": 121525
} | [
"org.jivesoftware.smack.packet.Message"
] | import org.jivesoftware.smack.packet.Message; | import org.jivesoftware.smack.packet.*; | [
"org.jivesoftware.smack"
] | org.jivesoftware.smack; | 1,249,720 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "nwnpallewela/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/IterateMediatorTargetOutputConnectorItemProvider.java",
"license": "apache-2.0",
"size": 2948
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,081,341 |
@Override
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) {
super.doRender(entity, x, y, z, entityYaw, partialTicks);
if (entity.healingEnderCrystal != null) {
this.bindTexture(ENDERCRYSTAL_BEAM_TEXTURES);
float f = MathHelper.sin(((float) entity.healingE... | void function(T entity, double x, double y, double z, float entityYaw, float partialTicks) { super.doRender(entity, x, y, z, entityYaw, partialTicks); if (entity.healingEnderCrystal != null) { this.bindTexture(ENDERCRYSTAL_BEAM_TEXTURES); float f = MathHelper.sin(((float) entity.healingEnderCrystal.ticksExisted + parti... | /**
* Renders the desired {@code T} type Entity.
*/ | Renders the desired T type Entity | doRender | {
"repo_name": "Tamaized/TamModized",
"path": "src/main/java/tamaized/tammodized/client/entity/render/RenderDragonOld.java",
"license": "mit",
"size": 7020
} | [
"net.minecraft.util.math.MathHelper"
] | import net.minecraft.util.math.MathHelper; | import net.minecraft.util.math.*; | [
"net.minecraft.util"
] | net.minecraft.util; | 2,689,944 |
public ServiceFuture<WorkerPoolResourceInner> updateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, final ServiceCallback<WorkerPoolResourceInner> serviceCallback) {
return ServiceFuture.fromResponse(updateWorkerPoolWithServiceRespons... | ServiceFuture<WorkerPoolResourceInner> function(String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, final ServiceCallback<WorkerPoolResourceInner> serviceCallback) { return ServiceFuture.fromResponse(updateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, ... | /**
* Create or update a worker pool.
* Create or update a worker pool.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @param workerPoolName Name of the worker pool.
* @param workerPoolEnvelop... | Create or update a worker pool. Create or update a worker pool | updateWorkerPoolAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceEnvironmentsInner.java",
"license": "mit",
"size": 664956
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,440,090 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
String projectID = request.getParamet... | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(STR); try (PrintWriter out = response.getWriter()) { String projectID = request.getParameter(STR); String taskID = request.getParameter(STR); String uniqueTaskID = request.getParameter(... | /**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods | processRequest | {
"repo_name": "linyumai/icon",
"path": "src/main/java/JSONWebService/UpdateTaskOrAdhoc.java",
"license": "mit",
"size": 4815
} | [
"java.io.IOException",
"java.io.PrintWriter",
"java.text.DateFormat",
"java.text.ParseException",
"java.text.SimpleDateFormat",
"java.util.Date",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import java.io.IOException; import java.io.PrintWriter; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; | [
"java.io",
"java.text",
"java.util",
"javax.servlet"
] | java.io; java.text; java.util; javax.servlet; | 563,430 |
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
/**
* {@inheritDoc} | void function() { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } /** * {@inheritDoc} | /**
* Set up the {@link android.app.ActionBar}, if the API is available.
*/ | Set up the <code>android.app.ActionBar</code>, if the API is available | setupActionBar | {
"repo_name": "mbenz95/lpCounter",
"path": "app/src/main/java/benzm/yugiohlifepointcounter/SettingsActivity.java",
"license": "mit",
"size": 11834
} | [
"android.support.v7.app.ActionBar"
] | import android.support.v7.app.ActionBar; | import android.support.v7.app.*; | [
"android.support"
] | android.support; | 1,239,947 |
private void add(Collection<String> newList) {
// Groups of items in a row that haven't yet been added to list.
// They are grouped so that can find the right place to insert them.
List<String> itemsToAdd = new ArrayList<String>();
// For each of the new items...
int insertionPoint = 0;
for (St... | void function(Collection<String> newList) { List<String> itemsToAdd = new ArrayList<String>(); int insertionPoint = 0; for (String item : newList) { int indexWhereItemExists = indexWhereItemExists(insertionPoint, item); if (indexWhereItemExists >= 0) { if (!itemsToAdd.isEmpty()) { add(insertionPoint, itemsToAdd); inser... | /**
* Adds items that are not already in the list to the list. Items are
* carefully added at proper place in list. New items are either added
* at beginning, middle, or end of list, depending on other items that
* match to the original list.
*
* @param newList
* items to be added to th... | Adds items that are not already in the list to the list. Items are carefully added at proper place in list. New items are either added at beginning, middle, or end of list, depending on other items that match to the original list | add | {
"repo_name": "scrudden/core",
"path": "transitime/src/main/java/org/transitime/utils/OrderedCollection.java",
"license": "gpl-3.0",
"size": 5899
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 674,507 |
@Override
protected void event(final UserRequest ureq, final Component source, final Event event) {
if (event.getCommand().equals("close")) {
doDispose();
return;
}
if (source == refreshButton) {
updateUI(ureq, false);
}
} | void function(final UserRequest ureq, final Component source, final Event event) { if (event.getCommand().equals("close")) { doDispose(); return; } if (source == refreshButton) { updateUI(ureq, false); } } | /**
* org.olat.presentation.framework.components.Component, org.olat.system.event.control.Event)
*/ | org.olat.presentation.framework.components.Component, org.olat.system.event.control.Event) | event | {
"repo_name": "huihoo/olat",
"path": "olat7.8/src/main/java/org/olat/presentation/instantmessaging/ConnectedClientsListController.java",
"license": "apache-2.0",
"size": 9166
} | [
"org.olat.presentation.framework.core.UserRequest",
"org.olat.presentation.framework.core.components.Component",
"org.olat.system.event.Event"
] | import org.olat.presentation.framework.core.UserRequest; import org.olat.presentation.framework.core.components.Component; import org.olat.system.event.Event; | import org.olat.presentation.framework.core.*; import org.olat.presentation.framework.core.components.*; import org.olat.system.event.*; | [
"org.olat.presentation",
"org.olat.system"
] | org.olat.presentation; org.olat.system; | 1,104,192 |
public AclStatus getAclStatus(Path path) throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support getAclStatus");
} | AclStatus function(Path path) throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); } | /**
* Gets the ACL of a file or directory.
*
* @param path Path to get
* @return AclStatus describing the ACL of the file or directory
* @throws IOException if an ACL could not be read
*/ | Gets the ACL of a file or directory | getAclStatus | {
"repo_name": "jonathangizmo/HadoopDistJ",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "mit",
"size": 110020
} | [
"java.io.IOException",
"org.apache.hadoop.fs.permission.AclStatus"
] | import java.io.IOException; import org.apache.hadoop.fs.permission.AclStatus; | import java.io.*; import org.apache.hadoop.fs.permission.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,934,284 |
@InterfaceAudience.Private
boolean isOrderTime() {
return this.orderTime;
} | @InterfaceAudience.Private boolean isOrderTime() { return this.orderTime; } | /**
* Should directory contents be displayed in mtime order.
* @return true mtime order, false default order
*/ | Should directory contents be displayed in mtime order | isOrderTime | {
"repo_name": "bysslord/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java",
"license": "apache-2.0",
"size": 10878
} | [
"org.apache.hadoop.classification.InterfaceAudience"
] | import org.apache.hadoop.classification.InterfaceAudience; | import org.apache.hadoop.classification.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 980,301 |
@Override
protected String getAnalyzerEnabledSettingKey() {
return Settings.KEYS.ANALYZER_GOLANG_MOD_ENABLED;
} | String function() { return Settings.KEYS.ANALYZER_GOLANG_MOD_ENABLED; } | /**
* Returns the key name for the analyzers enabled setting.
*
* @return the key name for the analyzers enabled setting
*/ | Returns the key name for the analyzers enabled setting | getAnalyzerEnabledSettingKey | {
"repo_name": "stefanneuhaus/DependencyCheck",
"path": "core/src/main/java/org/owasp/dependencycheck/analyzer/GolangModAnalyzer.java",
"license": "apache-2.0",
"size": 11247
} | [
"org.owasp.dependencycheck.utils.Settings"
] | import org.owasp.dependencycheck.utils.Settings; | import org.owasp.dependencycheck.utils.*; | [
"org.owasp.dependencycheck"
] | org.owasp.dependencycheck; | 1,786,080 |
@Override
public void onDestroy() {
super.onDestroy();
if (db != null && db.isOpen()) {
DataBaseHelper dbHelper = new DataBaseHelper(getActivity());
dbHelper.closeDatabase(db);
}
} | void function() { super.onDestroy(); if (db != null && db.isOpen()) { DataBaseHelper dbHelper = new DataBaseHelper(getActivity()); dbHelper.closeDatabase(db); } } | /**
* al cerrar la activity definiivamente miramos que no tengamos la base de datos abierta.
*/ | al cerrar la activity definiivamente miramos que no tengamos la base de datos abierta | onDestroy | {
"repo_name": "gothalo/Android-2017",
"path": "009B-Notebook/app/src/main/java/cat/foixench/ceina/notebook/fragments/NotesListFragment.java",
"license": "gpl-3.0",
"size": 4474
} | [
"cat.foixench.ceina.notebook.db.DataBaseHelper"
] | import cat.foixench.ceina.notebook.db.DataBaseHelper; | import cat.foixench.ceina.notebook.db.*; | [
"cat.foixench.ceina"
] | cat.foixench.ceina; | 905,688 |
public void updateRow(Row row) {
String pKey = this.getPrimaryKey().name;
String setString = "SET";
Iterator<Column> colIt = row.Iterator();
while(colIt.hasNext()) {
Column next = colIt.next();
if(!colIt.next().isPrimaryKey()) {
setStrin... | void function(Row row) { String pKey = this.getPrimaryKey().name; String setString = "SET"; Iterator<Column> colIt = row.Iterator(); while(colIt.hasNext()) { Column next = colIt.next(); if(!colIt.next().isPrimaryKey()) { setString += " " + next.getName() + "='" + next.getData().toString() + "'"; if(colIt.hasNext()) { s... | /**
* Update the specified <tt>Row</tt> in the <tt>Table</tt>.
*
* @param row The <tt>Row</tt> to update.
*/ | Update the specified Row in the Table | updateRow | {
"repo_name": "TheAcademician/CobraSQLib",
"path": "src/us/drome/cobrasqlib/Table.java",
"license": "mit",
"size": 9771
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,140,794 |
public static List<String> findAnnotatedClasses(String[] strPathsOrJars,
final Class<? extends Annotation>[] annotations)
throws IOException {
return findClassesThatExtend(strPathsOrJars, annotations, false, null, null, true);
} | static List<String> function(String[] strPathsOrJars, final Class<? extends Annotation>[] annotations) throws IOException { return findClassesThatExtend(strPathsOrJars, annotations, false, null, null, true); } | /**
* Find classes in the provided path(s)/jar(s) that extend the class(es).
* Inner classes are not searched.
*
* @param strPathsOrJars - pathnames or jarfiles to search for classes
* @param annotations - required annotations
*
* @return List containing discovered classes
* @thr... | Find classes in the provided path(s)/jar(s) that extend the class(es). Inner classes are not searched | findAnnotatedClasses | {
"repo_name": "ra0077/jmeter",
"path": "src/jorphan/org/apache/jorphan/reflect/ClassFinder.java",
"license": "apache-2.0",
"size": 20176
} | [
"java.io.IOException",
"java.lang.annotation.Annotation",
"java.util.List"
] | import java.io.IOException; import java.lang.annotation.Annotation; import java.util.List; | import java.io.*; import java.lang.annotation.*; import java.util.*; | [
"java.io",
"java.lang",
"java.util"
] | java.io; java.lang; java.util; | 2,480,879 |
public void sort(Comparator<K> sorter){
Object swapK, swapV;
int c;
boolean sorted;
for(int n = 0; n<size; n++){
sorted = true;
for(int m = 0; m<(size-1)-n; m++){
if(sorter==null){
c = ((Comparable)k[m]).compareTo(k[m+1]);
}else{
c = sorter.compare((K)k[m], (K)k[m+1]);
}
if(c>... | void function(Comparator<K> sorter){ Object swapK, swapV; int c; boolean sorted; for(int n = 0; n<size; n++){ sorted = true; for(int m = 0; m<(size-1)-n; m++){ if(sorter==null){ c = ((Comparable)k[m]).compareTo(k[m+1]); }else{ c = sorter.compare((K)k[m], (K)k[m+1]); } if(c>0){ sorted = false; swapK = k[m]; k[m] = k[m+1... | /**
* Sorts the map by keys.
*
* @param sorter
* - This comparator rule used to sort the key list. If null, all keys are assumed to extend Comparable.
*/ | Sorts the map by keys | sort | {
"repo_name": "Wraithaven/WraithEngine2",
"path": "src/wraith/lib/util/SortedMap.java",
"license": "gpl-3.0",
"size": 4855
} | [
"java.util.Comparator"
] | import java.util.Comparator; | import java.util.*; | [
"java.util"
] | java.util; | 334,208 |
public static void listCertificates(com.azure.resourcemanager.batch.BatchManager batchManager) {
batchManager
.certificates()
.listByBatchAccount("default-azurebatch-japaneast", "sampleacct", 1, null, null, Context.NONE);
} | static void function(com.azure.resourcemanager.batch.BatchManager batchManager) { batchManager .certificates() .listByBatchAccount(STR, STR, 1, null, null, Context.NONE); } | /**
* Sample code: ListCertificates.
*
* @param batchManager Entry point to BatchManager.
*/ | Sample code: ListCertificates | listCertificates | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/CertificateListByBatchAccountSamples.java",
"license": "mit",
"size": 1414
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,457,090 |
public ValueNode bindExpression(
FromList fromList,
SubqueryList subqueryList,
Vector aggregateVector)
throws StandardException
{
int operandType;
TypeId opTypeId;
bindOperand(fromList, subqueryList,
aggregateVector);
opTypeId = operand.getTypeId();
operandType = opTypeId.getJDBCTypeId()... | ValueNode function( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { int operandType; TypeId opTypeId; bindOperand(fromList, subqueryList, aggregateVector); opTypeId = operand.getTypeId(); operandType = opTypeId.getJDBCTypeId(); TypeCompiler tc = operand.getTypeCompiler()... | /**
* Bind this operator
*
* @param fromList The query's FROM list
* @param subqueryList The subquery list being built as we find SubqueryNodes
* @param aggregateVector The aggregate vector being built as we find AggregateNodes
*
* @return The new top of the expression tree.
*
* @exception Standard... | Bind this operator | bindExpression | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/sql/compile/ExtractOperatorNode.java",
"license": "apache-2.0",
"size": 5367
} | [
"java.sql.Types",
"java.util.Vector",
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.reference.SQLState",
"org.apache.derby.iapi.sql.compile.TypeCompiler",
"org.apache.derby.iapi.types.DataTypeDescriptor",
"org.apache.derby.iapi.types.DateTimeDataValue",
"org.apache.derby.iapi... | import java.sql.Types; import java.util.Vector; import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.sql.compile.TypeCompiler; import org.apache.derby.iapi.types.DataTypeDescriptor; import org.apache.derby.iapi.types.DateTimeDataValue; impor... | import java.sql.*; import java.util.*; import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.reference.*; import org.apache.derby.iapi.sql.compile.*; import org.apache.derby.iapi.types.*; | [
"java.sql",
"java.util",
"org.apache.derby"
] | java.sql; java.util; org.apache.derby; | 1,555,626 |
BasePostfixScript getScript(); | BasePostfixScript getScript(); | /**
* Returns the parent script with the properties.
*
* @return the {@link BasePostfixScript}.
*/ | Returns the parent script with the properties | getScript | {
"repo_name": "devent/sscontrol",
"path": "sscontrol-mail-postfix/src/main/java/com/anrisoftware/sscontrol/mail/postfix/linux/AuthConfig.java",
"license": "agpl-3.0",
"size": 1971
} | [
"com.anrisoftware.sscontrol.mail.postfix.script.linux.BasePostfixScript"
] | import com.anrisoftware.sscontrol.mail.postfix.script.linux.BasePostfixScript; | import com.anrisoftware.sscontrol.mail.postfix.script.linux.*; | [
"com.anrisoftware.sscontrol"
] | com.anrisoftware.sscontrol; | 2,662,132 |
private void fetchPlain() {
// A plain scalar could be a simple key.
savePossibleSimpleKey();
// No simple keys after plain scalars. But note that `scan_plain` will
// change this flag if the scan is finished at the beginning of the
// line.
this.allowSimpleKey = fal... | void function() { savePossibleSimpleKey(); this.allowSimpleKey = false; Token tok = scanPlain(); this.tokens.add(tok); } | /**
* Fetch a plain scalar.
*/ | Fetch a plain scalar | fetchPlain | {
"repo_name": "lsst-camera-dh/snakeyaml",
"path": "src/main/java/org/yaml/snakeyaml/scanner/ScannerImpl.java",
"license": "apache-2.0",
"size": 82645
} | [
"org.yaml.snakeyaml.tokens.Token"
] | import org.yaml.snakeyaml.tokens.Token; | import org.yaml.snakeyaml.tokens.*; | [
"org.yaml.snakeyaml"
] | org.yaml.snakeyaml; | 2,084,242 |
public void testConfigureCamelCaseTokenFilter() throws IOException {
Settings settings = Settings.builder().put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()).build();
Settings indexSettings = Settings.builder()
.put(IndexMetadata.SETTING_VERSION_CREATED, Version... | void function() throws IOException { Settings settings = Settings.builder().put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()).build(); Settings indexSettings = Settings.builder() .put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT) .put(STR, "mock") .put(STR, "mock") .put(STR, STR) .putLis... | /**
* Tests that {@code camelCase} filter names and {@code snake_case} filter names don't collide.
*/ | Tests that camelCase filter names and snake_case filter names don't collide | testConfigureCamelCaseTokenFilter | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/test/java/org/elasticsearch/index/analysis/AnalysisRegistryTests.java",
"license": "apache-2.0",
"size": 23382
} | [
"java.io.IOException",
"org.elasticsearch.Version",
"org.elasticsearch.cluster.metadata.IndexMetadata",
"org.elasticsearch.common.settings.Settings",
"org.elasticsearch.env.Environment",
"org.elasticsearch.index.IndexSettings",
"org.elasticsearch.plugins.AnalysisPlugin",
"org.elasticsearch.test.IndexS... | import java.io.IOException; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.plugins.AnalysisPlugin; import org.el... | import java.io.*; import org.elasticsearch.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.env.*; import org.elasticsearch.index.*; import org.elasticsearch.plugins.*; import org.elasticsearch.test.*; | [
"java.io",
"org.elasticsearch",
"org.elasticsearch.cluster",
"org.elasticsearch.common",
"org.elasticsearch.env",
"org.elasticsearch.index",
"org.elasticsearch.plugins",
"org.elasticsearch.test"
] | java.io; org.elasticsearch; org.elasticsearch.cluster; org.elasticsearch.common; org.elasticsearch.env; org.elasticsearch.index; org.elasticsearch.plugins; org.elasticsearch.test; | 1,753,942 |
public boolean validateDrop(Object target, int operation,
TransferData transferType) {
// deny if outline is dirty
if (this.outline.isModelDirty()) {
return false;
}
// check transfer type, only allow text
if (!TextTransfer.getInstance().isSupportedType(transferType)) {
return false;
}
... | boolean function(Object target, int operation, TransferData transferType) { if (this.outline.isModelDirty()) { return false; } if (!TextTransfer.getInstance().isSupportedType(transferType)) { return false; } OutlineNode targetNode = (OutlineNode)target; if (targetNode == null targetNode.getType() == OutlineNode.TYPE_PR... | /**
* Validate the drop. Invalidation is caused if
*
* - outline is not uptodate
* - transfer type is other than text
* - drop target is equal or children of source
* - target is preamble
*
* @param target
* @param operation
* @param transferType
*
* @return t... | Validate the drop. Invalidation is caused if - outline is not uptodate - transfer type is other than text - drop target is equal or children of source - target is preamble | validateDrop | {
"repo_name": "kolovos/texlipse",
"path": "net.sourceforge.texlipse/src/net/sourceforge/texlipse/outline/TexOutlineDNDAdapter.java",
"license": "epl-1.0",
"size": 7256
} | [
"net.sourceforge.texlipse.model.OutlineNode",
"org.eclipse.swt.dnd.TextTransfer",
"org.eclipse.swt.dnd.TransferData"
] | import net.sourceforge.texlipse.model.OutlineNode; import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.TransferData; | import net.sourceforge.texlipse.model.*; import org.eclipse.swt.dnd.*; | [
"net.sourceforge.texlipse",
"org.eclipse.swt"
] | net.sourceforge.texlipse; org.eclipse.swt; | 137,855 |
public MessageBuilder appendString(final String text, final Formatting... format)
{
boolean blockPresent = false;
for (final Formatting formatting : format)
{
if (formatting == Formatting.BLOCK)
{
blockPresent = true;
continue;
... | MessageBuilder function(final String text, final Formatting... format) { boolean blockPresent = false; for (final Formatting formatting : format) { if (formatting == Formatting.BLOCK) { blockPresent = true; continue; } this.builder.append(formatting.getTag()); } if (blockPresent) { this.builder.append(Formatting.BLOCK.... | /**
* Appends a formatted string to the Message
*
* @param text
* the text to append
* @param format
* the format(s) to apply to the text
* @return this instance
*/ | Appends a formatted string to the Message | appendString | {
"repo_name": "Java-Discord-Bot-System/JDA",
"path": "src/main/java/net/dv8tion/jda/MessageBuilder.java",
"license": "apache-2.0",
"size": 11355
} | [
"net.dv8tion.jda.entities.Message"
] | import net.dv8tion.jda.entities.Message; | import net.dv8tion.jda.entities.*; | [
"net.dv8tion.jda"
] | net.dv8tion.jda; | 590,488 |
public long allocate(long size, boolean init, boolean reserved) throws GridOffHeapOutOfMemoryException {
return allocate0(size, init, reserved, allocated);
} | long function(long size, boolean init, boolean reserved) throws GridOffHeapOutOfMemoryException { return allocate0(size, init, reserved, allocated); } | /**
* Allocates memory of given size in bytes.
*
* @param size Size of allocated block.
* @param init Flag to zero-out the initialized memory or not.
* @param reserved Flag indicating that memory being allocated was reserved before.
* @return Allocated block address.
* @throws GridOff... | Allocates memory of given size in bytes | allocate | {
"repo_name": "samaitra/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/offheap/unsafe/GridUnsafeMemory.java",
"license": "apache-2.0",
"size": 19083
} | [
"org.apache.ignite.internal.util.offheap.GridOffHeapOutOfMemoryException"
] | import org.apache.ignite.internal.util.offheap.GridOffHeapOutOfMemoryException; | import org.apache.ignite.internal.util.offheap.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,244,519 |
public static FSEditLog createStandaloneEditLog(File logDir)
throws IOException {
assertTrue(logDir.mkdirs() || logDir.exists());
if (!FileUtil.fullyDeleteContents(logDir)) {
throw new IOException("Unable to delete contents of " + logDir);
}
NNStorage storage = Mockito.mock(NNStorage.class... | static FSEditLog function(File logDir) throws IOException { assertTrue(logDir.mkdirs() logDir.exists()); if (!FileUtil.fullyDeleteContents(logDir)) { throw new IOException(STR + logDir); } NNStorage storage = Mockito.mock(NNStorage.class); StorageDirectory sd = FSImageTestUtil.mockStorageDirectory(logDir, NameNodeDirTy... | /**
* Return a standalone instance of FSEditLog that will log into the given
* log directory. The returned instance is not yet opened.
*/ | Return a standalone instance of FSEditLog that will log into the given log directory. The returned instance is not yet opened | createStandaloneEditLog | {
"repo_name": "tianshouzhi/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/FSImageTestUtil.java",
"license": "apache-2.0",
"size": 19641
} | [
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Lists",
"java.io.File",
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.FileUtil",
"org.apache.hadoop.hdfs.server.common.Storage",
"org.apache.hadoop.hdfs.server.namenode.NNSt... | import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.io.File; import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.hdfs.server.common.Storage; import org.apache.hadoop... | import com.google.common.collect.*; import java.io.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.junit.*; import org.mockito.*; | [
"com.google.common",
"java.io",
"java.util",
"org.apache.hadoop",
"org.junit",
"org.mockito"
] | com.google.common; java.io; java.util; org.apache.hadoop; org.junit; org.mockito; | 2,303,489 |
@ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE)
public void resume(); | @ResourceOperation(resource = Resource.DATA, operation = Operation.MANAGE) void function(); | /**
* Resumes this paused GatewaySender.
*/ | Resumes this paused GatewaySender | resume | {
"repo_name": "prasi-in/geode",
"path": "geode-core/src/main/java/org/apache/geode/management/GatewaySenderMXBean.java",
"license": "apache-2.0",
"size": 7086
} | [
"org.apache.geode.management.internal.security.ResourceOperation",
"org.apache.geode.security.ResourcePermission"
] | import org.apache.geode.management.internal.security.ResourceOperation; import org.apache.geode.security.ResourcePermission; | import org.apache.geode.management.internal.security.*; import org.apache.geode.security.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,161,564 |
public List<IViewPart> getOpenViews() {
return Display.syncExec(new ResultRunnable<List<IViewPart>>() { | List<IViewPart> function() { return Display.syncExec(new ResultRunnable<List<IViewPart>>() { | /**
* Gets all currently opened views as list of view parts. Includes also
* views on non-active tabs.
*
* @return list of currently opened view parts
*/ | Gets all currently opened views as list of view parts. Includes also views on non-active tabs | getOpenViews | {
"repo_name": "djelinek/reddeer",
"path": "plugins/org.eclipse.reddeer.workbench.core/src/org/eclipse/reddeer/workbench/core/lookup/WorkbenchPartLookup.java",
"license": "epl-1.0",
"size": 7219
} | [
"java.util.List",
"org.eclipse.reddeer.common.util.Display",
"org.eclipse.reddeer.common.util.ResultRunnable",
"org.eclipse.ui.IViewPart"
] | import java.util.List; import org.eclipse.reddeer.common.util.Display; import org.eclipse.reddeer.common.util.ResultRunnable; import org.eclipse.ui.IViewPart; | import java.util.*; import org.eclipse.reddeer.common.util.*; import org.eclipse.ui.*; | [
"java.util",
"org.eclipse.reddeer",
"org.eclipse.ui"
] | java.util; org.eclipse.reddeer; org.eclipse.ui; | 2,677,218 |
@Override
public String getDetails(Comparison.Detail difference, ComparisonType type, boolean formatXml) {
if (difference.getTarget() == null) {
return "<NULL>";
}
return getFullFormattedXml(difference.getTarget(), type, formatXml);
}
/**
* Formats the node usin... | String function(Comparison.Detail difference, ComparisonType type, boolean formatXml) { if (difference.getTarget() == null) { return STR; } return getFullFormattedXml(difference.getTarget(), type, formatXml); } /** * Formats the node using a format suitable for the node type and comparison. * * <p>The implementation ou... | /**
* Return the xml node from {@link Detail#getTarget()} as formatted String.
*
* <p>Delegates to {@link #getFullFormattedXml} unless the {@code Comparison.Detail}'s {@code target} is null.</p>
*
* @param difference The {@link Comparison#getControlDetails()} or {@link Comparison#getTestDetails... | Return the xml node from <code>Detail#getTarget()</code> as formatted String. Delegates to <code>#getFullFormattedXml</code> unless the Comparison.Detail's target is null | getDetails | {
"repo_name": "xmlunit/xmlunit",
"path": "xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java",
"license": "apache-2.0",
"size": 19963
} | [
"org.w3c.dom.Document",
"org.w3c.dom.DocumentType",
"org.xmlunit.diff.Comparison"
] | import org.w3c.dom.Document; import org.w3c.dom.DocumentType; import org.xmlunit.diff.Comparison; | import org.w3c.dom.*; import org.xmlunit.diff.*; | [
"org.w3c.dom",
"org.xmlunit.diff"
] | org.w3c.dom; org.xmlunit.diff; | 2,376,589 |
@NonNull
@SuppressFBWarnings(value = "ICAST_IDIV_CAST_TO_DOUBLE", justification = "We want to truncate here.")
public static String getTimeSpanString(long duration) {
// Break the duration up in to units.
long years = duration / ONE_YEAR_MS;
duration %= ONE_YEAR_MS;
long mont... | @SuppressFBWarnings(value = STR, justification = STR) static String function(long duration) { long years = duration / ONE_YEAR_MS; duration %= ONE_YEAR_MS; long months = duration / ONE_MONTH_MS; duration %= ONE_MONTH_MS; long days = duration / ONE_DAY_MS; duration %= ONE_DAY_MS; long hours = duration / ONE_HOUR_MS; dur... | /**
* Returns a human readable text of the time duration, for example "3 minutes 40 seconds".
* This version should be used for representing a duration of some activity (like build)
*
* @param duration
* number of milliseconds.
*/ | Returns a human readable text of the time duration, for example "3 minutes 40 seconds". This version should be used for representing a duration of some activity (like build) | getTimeSpanString | {
"repo_name": "rsandell/jenkins",
"path": "core/src/main/java/hudson/Util.java",
"license": "mit",
"size": 71490
} | [
"edu.umd.cs.findbugs.annotations.SuppressFBWarnings"
] | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | import edu.umd.cs.findbugs.annotations.*; | [
"edu.umd.cs"
] | edu.umd.cs; | 1,787,331 |
public CoinbaseContacts getCoinbaseContacts() throws IOException {
return getCoinbaseContacts(null, null, null);
} | CoinbaseContacts function() throws IOException { return getCoinbaseContacts(null, null, null); } | /**
* Authenticated resource that returns contacts the user has previously sent to or received from.
* This is a paged resource and will return the first page by default.
*
* @see <a href="https://coinbase.com/api/doc/1.0/contacts/index.html">coinbase.com/api/doc/1.0/contacts/index.html</a>
* @return {@... | Authenticated resource that returns contacts the user has previously sent to or received from. This is a paged resource and will return the first page by default | getCoinbaseContacts | {
"repo_name": "habibmasuro/XChange",
"path": "xchange-coinbase/src/main/java/com/xeiam/xchange/coinbase/service/polling/CoinbaseAccountServiceRaw.java",
"license": "mit",
"size": 27451
} | [
"com.xeiam.xchange.coinbase.dto.account.CoinbaseContacts",
"java.io.IOException"
] | import com.xeiam.xchange.coinbase.dto.account.CoinbaseContacts; import java.io.IOException; | import com.xeiam.xchange.coinbase.dto.account.*; import java.io.*; | [
"com.xeiam.xchange",
"java.io"
] | com.xeiam.xchange; java.io; | 27,950 |
@Column(name = "remove_time")
@Override
public Date getRemoveTime() {
return (Date) get(9);
} | @Column(name = STR) Date function() { return (Date) get(9); } | /**
* Getter for <code>cattle.account_link.remove_time</code>.
*/ | Getter for <code>cattle.account_link.remove_time</code> | getRemoveTime | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/tables/records/AccountLinkRecord.java",
"license": "apache-2.0",
"size": 14374
} | [
"java.util.Date",
"javax.persistence.Column"
] | import java.util.Date; import javax.persistence.Column; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 1,538,589 |
protected void invokeInternalEx(XTeeMessage<Document> request,
XTeeMessage<Element> response,
SOAPMessage responseMessage,
SOAPMessage requestMessage) throws Exception {
invokeInternal(request, response);
} | void function(XTeeMessage<Document> request, XTeeMessage<Element> response, SOAPMessage responseMessage, SOAPMessage requestMessage) throws Exception { invokeInternal(request, response); } | /**
* This method can be overridden if you need direct access to the request and response messages.
*
* @param request
* @param response
* @param responseMessage
* @param requestMessage
* @throws Exception
*/ | This method can be overridden if you need direct access to the request and response messages | invokeInternalEx | {
"repo_name": "nortal/j-road",
"path": "server/src/main/java/com/nortal/jroad/endpoint/AbstractXTeeBaseEndpoint.java",
"license": "apache-2.0",
"size": 11431
} | [
"com.nortal.jroad.model.XTeeMessage",
"javax.xml.soap.SOAPMessage",
"org.w3c.dom.Document",
"org.w3c.dom.Element"
] | import com.nortal.jroad.model.XTeeMessage; import javax.xml.soap.SOAPMessage; import org.w3c.dom.Document; import org.w3c.dom.Element; | import com.nortal.jroad.model.*; import javax.xml.soap.*; import org.w3c.dom.*; | [
"com.nortal.jroad",
"javax.xml",
"org.w3c.dom"
] | com.nortal.jroad; javax.xml; org.w3c.dom; | 1,460,986 |
protected KeyStore loadTrustStore() throws Exception
{
return _trustStore != null ? _trustStore : getKeyStore(_trustStoreInputStream,
_trustStorePath, _trustStoreType, _trustStoreProvider,
_trustStorePassword==null? null: _trustStorePassword.toString());
} | KeyStore function() throws Exception { return _trustStore != null ? _trustStore : getKeyStore(_trustStoreInputStream, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword==null? null: _trustStorePassword.toString()); } | /**
* Override this method to provide alternate way to load a truststore.
*
* @return the key store instance
* @throws Exception if the truststore cannot be loaded
*/ | Override this method to provide alternate way to load a truststore | loadTrustStore | {
"repo_name": "itead/IoTgo_Android_App",
"path": "plugins/com.knowledgecode.cordova.websocket/src/android/org/eclipse/jetty/util/ssl/SslContextFactory.java",
"license": "mit",
"size": 50483
} | [
"java.security.KeyStore"
] | import java.security.KeyStore; | import java.security.*; | [
"java.security"
] | java.security; | 1,860,982 |
public boolean selectReport(String reportTitle) {
boolean reportPresent = false;
try {
driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
wait.until(ExpectedConditions.visibilityOfAllElements(reportList));
for (int i = 0; i < reportList.size(); i++) {
if (reportList.get(i).getText().equ... | boolean function(String reportTitle) { boolean reportPresent = false; try { driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS); wait.until(ExpectedConditions.visibilityOfAllElements(reportList)); for (int i = 0; i < reportList.size(); i++) { if (reportList.get(i).getText().equals(reportTitle)) { driver.mana... | /**
* select report with the given title
*
* @param reportTitle
* @return
*/ | select report with the given title | selectReport | {
"repo_name": "CognizantOneDevOps/Insights",
"path": "PlatformRegressionTest/src/main/java/com/cognizant/devops/platformregressiontest/test/ui/dashboardreportdownload/DashboardReportDownloadConfiguration.java",
"license": "apache-2.0",
"size": 11114
} | [
"java.util.List",
"java.util.concurrent.TimeUnit",
"org.openqa.selenium.By",
"org.openqa.selenium.WebElement",
"org.openqa.selenium.support.ui.ExpectedConditions"
] | import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; | import java.util.*; import java.util.concurrent.*; import org.openqa.selenium.*; import org.openqa.selenium.support.ui.*; | [
"java.util",
"org.openqa.selenium"
] | java.util; org.openqa.selenium; | 1,534,247 |
@SuppressWarnings("unchecked")
@Test
public void testInit() throws DataProviderException {
SaveRestoreService.getInstance().setSelectedDataProvider(dataProvider);
List<Branch> branches = selector.branchesProperty().get();
assertEquals("Two branches are available at startup", 2, branc... | @SuppressWarnings(STR) void function() throws DataProviderException { SaveRestoreService.getInstance().setSelectedDataProvider(dataProvider); List<Branch> branches = selector.branchesProperty().get(); assertEquals(STR, 2, branches.size()); assertEquals(STR, branch, branches.get(0)); assertEquals(STR, someBranch, branch... | /**
* Test selector initialisation and default settings.
*
* @throws DataProviderException
*/ | Test selector initialisation and default settings | testInit | {
"repo_name": "frib-high-level-controls/save-set-restore",
"path": "plugins/org.csstudio.saverestore.ui.test/src/org/csstudio/saverestore/ui/SelectorTest.java",
"license": "mit",
"size": 21215
} | [
"java.util.List",
"java.util.Optional",
"org.csstudio.saverestore.CompletionNotifier",
"org.csstudio.saverestore.DataProviderException",
"org.csstudio.saverestore.SaveRestoreService",
"org.csstudio.saverestore.data.BaseLevel",
"org.csstudio.saverestore.data.Branch",
"org.csstudio.saverestore.data.Save... | import java.util.List; import java.util.Optional; import org.csstudio.saverestore.CompletionNotifier; import org.csstudio.saverestore.DataProviderException; import org.csstudio.saverestore.SaveRestoreService; import org.csstudio.saverestore.data.BaseLevel; import org.csstudio.saverestore.data.Branch; import org.csstudi... | import java.util.*; import org.csstudio.saverestore.*; import org.csstudio.saverestore.data.*; import org.junit.*; import org.mockito.*; | [
"java.util",
"org.csstudio.saverestore",
"org.junit",
"org.mockito"
] | java.util; org.csstudio.saverestore; org.junit; org.mockito; | 2,889,079 |
private static int readPageCacheId(final long absPtr) {
return GridUnsafe.getInt(absPtr + PAGE_CACHE_ID_OFFSET);
} | static int function(final long absPtr) { return GridUnsafe.getInt(absPtr + PAGE_CACHE_ID_OFFSET); } | /**
* Reads cache ID from the page at the given absolute pointer.
*
* @param absPtr Absolute memory pointer to the page header.
* @return Cache ID written to the page.
*/ | Reads cache ID from the page at the given absolute pointer | readPageCacheId | {
"repo_name": "WilliamDo/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImpl.java",
"license": "apache-2.0",
"size": 79433
} | [
"org.apache.ignite.internal.util.GridUnsafe"
] | import org.apache.ignite.internal.util.GridUnsafe; | import org.apache.ignite.internal.util.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 88,954 |
private static void extractDefaultOauthTokenIssuers(Map<String, OauthTokenIssuer> allOAuthTokenIssuerMap,
Map<String, OauthTokenIssuer> defaultOAuthTokenIssuerMap) {
// TODO: 4/9/19 Implement logic to read default issuer from config.
// TODO: ... | static void function(Map<String, OauthTokenIssuer> allOAuthTokenIssuerMap, Map<String, OauthTokenIssuer> defaultOAuthTokenIssuerMap) { defaultOAuthTokenIssuerMap.put(OAuthServerConfiguration.JWT_TOKEN_TYPE, allOAuthTokenIssuerMap.get(OAuthServerConfiguration.JWT_TOKEN_TYPE)); allOAuthTokenIssuerMap.remove(OAuthServerCo... | /**
* Differentiate default token issuers from all available token issuers map.
*
* @param allOAuthTokenIssuerMap Map of all available token issuers.
* @param defaultOAuthTokenIssuerMap default token issuers
*/ | Differentiate default token issuers from all available token issuers map | extractDefaultOauthTokenIssuers | {
"repo_name": "darshanasbg/identity-inbound-auth-oauth",
"path": "components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/util/OAuth2Util.java",
"license": "apache-2.0",
"size": 193919
} | [
"java.util.Map",
"org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration",
"org.wso2.carbon.identity.oauth2.token.OauthTokenIssuer"
] | import java.util.Map; import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration; import org.wso2.carbon.identity.oauth2.token.OauthTokenIssuer; | import java.util.*; import org.wso2.carbon.identity.oauth.config.*; import org.wso2.carbon.identity.oauth2.token.*; | [
"java.util",
"org.wso2.carbon"
] | java.util; org.wso2.carbon; | 2,718,047 |
public UserHandle getUser() {
return user;
} | UserHandle function() { return user; } | /**
* The {@link android.os.UserHandle} for whom this notification is intended.
* @hide
*/ | The <code>android.os.UserHandle</code> for whom this notification is intended | getUser | {
"repo_name": "szpaddy/android-4.1.2_r2-core",
"path": "java/android/service/notification/StatusBarNotification.java",
"license": "apache-2.0",
"size": 7414
} | [
"android.os.UserHandle"
] | import android.os.UserHandle; | import android.os.*; | [
"android.os"
] | android.os; | 2,498,074 |
public Iterator getObjects() {
return _objects.iterator();
} | Iterator function() { return _objects.iterator(); } | /**
* Returns the list of objects as an iterator.
*
* @return iterator of objects
*/ | Returns the list of objects as an iterator | getObjects | {
"repo_name": "axeolotl/wsrp4cxf",
"path": "persistence-xml/src/java/org/apache/wsrp4j/persistence/xml/driver/PersistentDataObjectImpl.java",
"license": "apache-2.0",
"size": 3448
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 523,268 |
public static List<AuthorView> getAuthors(Document doc, XpathReader xpath) throws XPathException {
return new AuthorsXmlExtractor(doc, xpath).buildAuthors();
} | static List<AuthorView> function(Document doc, XpathReader xpath) throws XPathException { return new AuthorsXmlExtractor(doc, xpath).buildAuthors(); } | /**
* Retrieves the authors as {@link AuthorView}s from article XML.
*
* @param doc parsed representation of the article XML
* @param xpath XpathReader to use to process xpath expressions
* @return list of AuthorView objects
*/ | Retrieves the authors as <code>AuthorView</code>s from article XML | getAuthors | {
"repo_name": "PLOS/rhino",
"path": "src/main/java/org/ambraproject/rhino/service/impl/AuthorsXmlExtractor.java",
"license": "mit",
"size": 24991
} | [
"java.util.List",
"javax.xml.xpath.XPathException",
"org.ambraproject.rhino.content.xml.XpathReader",
"org.ambraproject.rhino.view.article.author.AuthorView",
"org.w3c.dom.Document"
] | import java.util.List; import javax.xml.xpath.XPathException; import org.ambraproject.rhino.content.xml.XpathReader; import org.ambraproject.rhino.view.article.author.AuthorView; import org.w3c.dom.Document; | import java.util.*; import javax.xml.xpath.*; import org.ambraproject.rhino.content.xml.*; import org.ambraproject.rhino.view.article.author.*; import org.w3c.dom.*; | [
"java.util",
"javax.xml",
"org.ambraproject.rhino",
"org.w3c.dom"
] | java.util; javax.xml; org.ambraproject.rhino; org.w3c.dom; | 1,442,287 |
public static Metric<AbstractILMultiDimensional> createPrecomputedEntropyMetric(double threshold, double gsFactor) {
return __MetricV2.createPrecomputedEntropyMetric(threshold, gsFactor);
} | static Metric<AbstractILMultiDimensional> function(double threshold, double gsFactor) { return __MetricV2.createPrecomputedEntropyMetric(threshold, gsFactor); } | /**
* Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric. The default aggregate function,
* which is the sum-function, will be used for comparing results.
* This metric will respect attribute weights defined in the configuration.
*
* @param threshold The... | Creates a potentially precomputed instance of the non-monotonic non-uniform entropy metric. The default aggregate function, which is the sum-function, will be used for comparing results. This metric will respect attribute weights defined in the configuration | createPrecomputedEntropyMetric | {
"repo_name": "jgaupp/arx",
"path": "src/main/org/deidentifier/arx/metric/Metric.java",
"license": "apache-2.0",
"size": 71459
} | [
"org.deidentifier.arx.metric.v2.AbstractILMultiDimensional"
] | import org.deidentifier.arx.metric.v2.AbstractILMultiDimensional; | import org.deidentifier.arx.metric.v2.*; | [
"org.deidentifier.arx"
] | org.deidentifier.arx; | 1,826,238 |
private int getSourceId(Key key) {
Preconditions.checkNotNull(key);
if (key.isSpacer()) {
return UNDEFINED;
}
return getKeyState(key, metaState).getFlick(
Direction.CENTER).get().getKeyEntity().getSourceId();
} | int function(Key key) { Preconditions.checkNotNull(key); if (key.isSpacer()) { return UNDEFINED; } return getKeyState(key, metaState).getFlick( Direction.CENTER).get().getKeyEntity().getSourceId(); } | /**
* Returns source id of the given {@code key} unmodified-center
*/ | Returns source id of the given key unmodified-center | getSourceId | {
"repo_name": "kbc-developers/android_packages_inputmethods_Mozc",
"path": "src/com/google/android/inputmethod/japanese/accessibility/KeyboardAccessibilityNodeProvider.java",
"license": "bsd-3-clause",
"size": 13677
} | [
"com.google.common.base.Preconditions",
"org.mozc.android.inputmethod.japanese.keyboard.Flick",
"org.mozc.android.inputmethod.japanese.keyboard.Key"
] | import com.google.common.base.Preconditions; import org.mozc.android.inputmethod.japanese.keyboard.Flick; import org.mozc.android.inputmethod.japanese.keyboard.Key; | import com.google.common.base.*; import org.mozc.android.inputmethod.japanese.keyboard.*; | [
"com.google.common",
"org.mozc.android"
] | com.google.common; org.mozc.android; | 1,082,791 |
public int getPreferenciasDescuento(){
String valor=PreferenceManager.getDefaultSharedPreferences(contexto).getString("txtDescuento", "0");
int retorno=0;
try
{
retorno=Integer.parseInt(valor);
}
catch (Exception e) {
// TODO: handle exception
retorno=0;
Log.d(TAG,"getPreferenciasDescue... | int function(){ String valor=PreferenceManager.getDefaultSharedPreferences(contexto).getString(STR, "0"); int retorno=0; try { retorno=Integer.parseInt(valor); } catch (Exception e) { retorno=0; Log.d(TAG,STR); } return retorno; } | /**
* Devuelve el valor del ajuste de descuento.
* @return
*/ | Devuelve el valor del ajuste de descuento | getPreferenciasDescuento | {
"repo_name": "oscarcoresoft/gastosmovil",
"path": "src/deeloco/android/gastos/Movil/plus/ValoresPreferencias.java",
"license": "gpl-3.0",
"size": 17356
} | [
"android.preference.PreferenceManager",
"android.util.Log"
] | import android.preference.PreferenceManager; import android.util.Log; | import android.preference.*; import android.util.*; | [
"android.preference",
"android.util"
] | android.preference; android.util; | 2,190,589 |
@org.junit.Test
public void testHTML() {
Bot bot = Bot.createInstance();
Language language = bot.mind().getThought(Language.class);
language.setLearningMode(LearningMode.Disabled);
TextEntry text = bot.awareness().getSense(TextEntry.class);
List<String> output = registerForOutput(text);
//bot.setDebugLe... | @org.junit.Test void function() { Bot bot = Bot.createInstance(); Language language = bot.mind().getThought(Language.class); language.setLearningMode(LearningMode.Disabled); TextEntry text = bot.awareness().getSense(TextEntry.class); List<String> output = registerForOutput(text); text.input(STR); String response = wait... | /**
* Test HTML templates.
*/ | Test HTML templates | testHTML | {
"repo_name": "BOTlibre/BOTlibre",
"path": "ai-engine-test/source/org/botlibre/test/TestAIML2.java",
"license": "epl-1.0",
"size": 39487
} | [
"java.util.List",
"org.botlibre.Bot",
"org.botlibre.sense.text.TextEntry",
"org.botlibre.thought.language.Language"
] | import java.util.List; import org.botlibre.Bot; import org.botlibre.sense.text.TextEntry; import org.botlibre.thought.language.Language; | import java.util.*; import org.botlibre.*; import org.botlibre.sense.text.*; import org.botlibre.thought.language.*; | [
"java.util",
"org.botlibre",
"org.botlibre.sense",
"org.botlibre.thought"
] | java.util; org.botlibre; org.botlibre.sense; org.botlibre.thought; | 1,850,968 |
public Artifact getPythonIntermediateStubArtifact(Artifact executable) {
return getArtifactWithExtension(executable, ".temp");
} | Artifact function(Artifact executable) { return getArtifactWithExtension(executable, ".temp"); } | /**
* Returns an artifact next to the executable file with ".temp" suffix. Used only if we're
* building a zip.
*/ | Returns an artifact next to the executable file with ".temp" suffix. Used only if we're building a zip | getPythonIntermediateStubArtifact | {
"repo_name": "perezd/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java",
"license": "apache-2.0",
"size": 42929
} | [
"com.google.devtools.build.lib.actions.Artifact"
] | import com.google.devtools.build.lib.actions.Artifact; | import com.google.devtools.build.lib.actions.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,285,439 |
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<PublicIpPrefixInner>, PublicIpPrefixInner> beginCreateOrUpdate(
String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); | @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<PublicIpPrefixInner>, PublicIpPrefixInner> beginCreateOrUpdate( String resourceGroupName, String publicIpPrefixName, PublicIpPrefixInner parameters); | /**
* Creates or updates a static or dynamic public IP prefix.
*
* @param resourceGroupName The name of the resource group.
* @param publicIpPrefixName The name of the public IP prefix.
* @param parameters Parameters supplied to the create or update public IP prefix operation.
* @throws Il... | Creates or updates a static or dynamic public IP prefix | beginCreateOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java",
"license": "mit",
"size": 24606
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,452,631 |
public DateTime deletedDate() {
if (this.deletedDate == null) {
return null;
}
return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC);
} | DateTime function() { if (this.deletedDate == null) { return null; } return new DateTime(this.deletedDate * 1000L, DateTimeZone.UTC); } | /**
* Get the deletedDate value.
*
* @return the deletedDate value
*/ | Get the deletedDate value | deletedDate | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/keyvault/microsoft-azure-keyvault/src/main/java/com/microsoft/azure/keyvault/models/DeletedSasDefinitionItem.java",
"license": "mit",
"size": 2165
} | [
"org.joda.time.DateTime",
"org.joda.time.DateTimeZone"
] | import org.joda.time.DateTime; import org.joda.time.DateTimeZone; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,506,131 |
@Override public void exitFormalParameterList(@NotNull PJParser.FormalParameterListContext ctx) { } | @Override public void exitFormalParameterList(@NotNull PJParser.FormalParameterListContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterFormalParameterList | {
"repo_name": "Diolor/PJ",
"path": "src/main/java/com/lorentzos/pj/PJBaseListener.java",
"license": "mit",
"size": 73292
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 782,425 |
public static void start(Context context) {
Intent intent = new Intent();
intent.setAction(MainActivity.ACTION_SHOW_PLAYER);
context.getApplicationContext().sendBroadcast(intent);
} | static void function(Context context) { Intent intent = new Intent(); intent.setAction(MainActivity.ACTION_SHOW_PLAYER); context.getApplicationContext().sendBroadcast(intent); } | /**
* Show the audio player from an intent
*
* @param context The context of the activity
*/ | Show the audio player from an intent | start | {
"repo_name": "jomanmuk/vlc_android",
"path": "vlc-android/src/org/videolan/vlc/gui/audio/AudioPlayer.java",
"license": "gpl-2.0",
"size": 24540
} | [
"android.content.Context",
"android.content.Intent",
"org.videolan.vlc.gui.MainActivity"
] | import android.content.Context; import android.content.Intent; import org.videolan.vlc.gui.MainActivity; | import android.content.*; import org.videolan.vlc.gui.*; | [
"android.content",
"org.videolan.vlc"
] | android.content; org.videolan.vlc; | 1,152,117 |
void update(int offset, WritableColumnVector values, VectorizedValuesReader valuesReader); | void update(int offset, WritableColumnVector values, VectorizedValuesReader valuesReader); | /**
* Read a single value from `valuesReader` into `values`, at `offset`.
*
* @param offset offset in `values` to put the new value
* @param values destination value vector
* @param valuesReader reader to read values from
*/ | Read a single value from `valuesReader` into `values`, at `offset` | update | {
"repo_name": "maropu/spark",
"path": "sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/ParquetVectorUpdater.java",
"license": "apache-2.0",
"size": 3250
} | [
"org.apache.spark.sql.execution.vectorized.WritableColumnVector"
] | import org.apache.spark.sql.execution.vectorized.WritableColumnVector; | import org.apache.spark.sql.execution.vectorized.*; | [
"org.apache.spark"
] | org.apache.spark; | 2,528,455 |
private static void configureTemplateResources(final Config config,
final String resourceOwnerName,
final List<HttpResource> resources) {
final TimeValue templateTimeout =
TEMPLATE_CHECK_TIM... | static void function(final Config config, final String resourceOwnerName, final List<HttpResource> resources) { final TimeValue templateTimeout = TEMPLATE_CHECK_TIMEOUT_SETTING.getConcreteSettingForNamespace(config.name()).get(config.settings()); for (final String templateId : MonitoringTemplateUtils.TEMPLATE_IDS) { fi... | /**
* Adds the {@code resources} necessary for checking and publishing monitoring templates.
*
* @param config The HTTP Exporter's configuration
* @param resourceOwnerName The resource owner name to display for any logging messages.
* @param resources The resources to add too.
*/ | Adds the resources necessary for checking and publishing monitoring templates | configureTemplateResources | {
"repo_name": "uschindler/elasticsearch",
"path": "x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java",
"license": "apache-2.0",
"size": 45814
} | [
"java.util.List",
"java.util.function.Supplier",
"org.elasticsearch.common.unit.TimeValue",
"org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils"
] | import java.util.List; import java.util.function.Supplier; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringTemplateUtils; | import java.util.*; import java.util.function.*; import org.elasticsearch.common.unit.*; import org.elasticsearch.xpack.core.monitoring.exporter.*; | [
"java.util",
"org.elasticsearch.common",
"org.elasticsearch.xpack"
] | java.util; org.elasticsearch.common; org.elasticsearch.xpack; | 1,040,451 |
@Test
public void testDateTimeRoundtrip() throws ParseException {
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("Europe/Amsterdam"));
c.clear();
c.set(2015, 8, 15, 13, 37, 56);
Date d = c.getTime();
String generated = JsonPrinter.format(d);
System.err.pri... | void function() throws ParseException { Calendar c = Calendar.getInstance(TimeZone.getTimeZone(STR)); c.clear(); c.set(2015, 8, 15, 13, 37, 56); Date d = c.getTime(); String generated = JsonPrinter.format(d); System.err.println(generated); Date parsedDate = sut.parseTime(generated); assertEquals(d, parsedDate); } | /**
* Test that a date-time string that the {@link JsonPrinter} outputs a string
* that JsonParser can read correctly. This defines a non-UTC date-time that
* when output as a string and parsed must give the same date-time.
* @throws ParseException when JsonPrinter outputs a string that JsonParse
... | Test that a date-time string that the <code>JsonPrinter</code> outputs a string that JsonParser can read correctly. This defines a non-UTC date-time that when output as a string and parsed must give the same date-time | testDateTimeRoundtrip | {
"repo_name": "JayanthyChengan/dataverse",
"path": "src/test/java/edu/harvard/iq/dataverse/util/json/JsonParserTest.java",
"license": "apache-2.0",
"size": 30380
} | [
"java.text.ParseException",
"java.util.Calendar",
"java.util.Date",
"java.util.TimeZone",
"org.junit.Assert"
] | import java.text.ParseException; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; import org.junit.Assert; | import java.text.*; import java.util.*; import org.junit.*; | [
"java.text",
"java.util",
"org.junit"
] | java.text; java.util; org.junit; | 2,814,497 |
public static JSONArray toArray() throws JSONException {
JSONArray obj = new JSONArray();
if (logoCache != null) {
for (int i = 0; i < logoCache.size(); i++) {
obj.put(i, logoCache.get(i).toObject());
}
}
return obj;
} | static JSONArray function() throws JSONException { JSONArray obj = new JSONArray(); if (logoCache != null) { for (int i = 0; i < logoCache.size(); i++) { obj.put(i, logoCache.get(i).toObject()); } } return obj; } | /**
* Gets array with each logo information saved.
* @return JSONArray
* @throws JSONException
*/ | Gets array with each logo information saved | toArray | {
"repo_name": "GSMADeveloper/MobileConnectSDKTestApp",
"path": "archive/oneapi/logo/LogoCache.java",
"license": "mit",
"size": 9447
} | [
"org.json.JSONArray",
"org.json.JSONException"
] | import org.json.JSONArray; import org.json.JSONException; | import org.json.*; | [
"org.json"
] | org.json; | 644,173 |
public BlobLeaseClientBuilder blobAsyncClient(BlobAsyncClientBase blobAsyncClient) {
Objects.requireNonNull(blobAsyncClient);
this.pipeline = blobAsyncClient.getHttpPipeline();
this.url = blobAsyncClient.getBlobUrl();
this.isBlob = true;
this.accountName = blobAsyncClient.get... | BlobLeaseClientBuilder function(BlobAsyncClientBase blobAsyncClient) { Objects.requireNonNull(blobAsyncClient); this.pipeline = blobAsyncClient.getHttpPipeline(); this.url = blobAsyncClient.getBlobUrl(); this.isBlob = true; this.accountName = blobAsyncClient.getAccountName(); this.serviceVersion = blobAsyncClient.getSe... | /**
* Configures the builder based on the passed {@link BlobAsyncClient}. This will set the {@link HttpPipeline} and
* {@link URL} that are used to interact with the service.
*
* @param blobAsyncClient BlobAsyncClient used to configure the builder.
* @return the updated BlobLeaseClientBuilder o... | Configures the builder based on the passed <code>BlobAsyncClient</code>. This will set the <code>HttpPipeline</code> and <code>URL</code> that are used to interact with the service | blobAsyncClient | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobLeaseClientBuilder.java",
"license": "mit",
"size": 6903
} | [
"com.azure.core.http.HttpPipeline",
"com.azure.storage.blob.BlobContainerClient",
"java.util.Objects"
] | import com.azure.core.http.HttpPipeline; import com.azure.storage.blob.BlobContainerClient; import java.util.Objects; | import com.azure.core.http.*; import com.azure.storage.blob.*; import java.util.*; | [
"com.azure.core",
"com.azure.storage",
"java.util"
] | com.azure.core; com.azure.storage; java.util; | 1,574,609 |
public VirtualMachineScaleSetExtensionUpdate withProvisionAfterExtensions(List<String> provisionAfterExtensions) {
this.provisionAfterExtensions = provisionAfterExtensions;
return this;
} | VirtualMachineScaleSetExtensionUpdate function(List<String> provisionAfterExtensions) { this.provisionAfterExtensions = provisionAfterExtensions; return this; } | /**
* Set collection of extension names after which this extension needs to be provisioned.
*
* @param provisionAfterExtensions the provisionAfterExtensions value to set
* @return the VirtualMachineScaleSetExtensionUpdate object itself.
*/ | Set collection of extension names after which this extension needs to be provisioned | withProvisionAfterExtensions | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/compute/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/compute/v2019_11_01/VirtualMachineScaleSetExtensionUpdate.java",
"license": "mit",
"size": 8992
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 688,946 |
ProfileFragment fragment = new ProfileFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
private LocalDb mLocalDb;
private User mUser;
private Room mMyRoom;
private boolean mIsCurren... | ProfileFragment fragment = new ProfileFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; } private LocalDb mLocalDb; private User mUser; private Room mMyRoom; private boolean mIsCurrentUser; private Follow mFollow; private LinearLayout m... | /**
* Returns a new instance of this fragment for the given section
* number.
*/ | Returns a new instance of this fragment for the given section number | newInstance | {
"repo_name": "tl-nguyen/RadarApp",
"path": "RadarApp/app/src/main/java/bg/mentormate/academy/radarapp/fragments/ProfileFragment.java",
"license": "mit",
"size": 13886
} | [
"android.os.Bundle",
"android.widget.Button",
"android.widget.LinearLayout",
"android.widget.ProgressBar",
"android.widget.TextView",
"bg.mentormate.academy.radarapp.data.LocalDb",
"bg.mentormate.academy.radarapp.models.Follow",
"bg.mentormate.academy.radarapp.models.Room",
"bg.mentormate.academy.ra... | import android.os.Bundle; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import bg.mentormate.academy.radarapp.data.LocalDb; import bg.mentormate.academy.radarapp.models.Follow; import bg.mentormate.academy.radarapp.models.Room; impor... | import android.os.*; import android.widget.*; import bg.mentormate.academy.radarapp.data.*; import bg.mentormate.academy.radarapp.models.*; import bg.mentormate.academy.radarapp.views.*; import com.parse.*; | [
"android.os",
"android.widget",
"bg.mentormate.academy",
"com.parse"
] | android.os; android.widget; bg.mentormate.academy; com.parse; | 2,065,986 |
private static boolean isBoss(LivingEntity livingEntity) {
switch (livingEntity.getType()) {
case ENDER_DRAGON:
case WITHER:
return true;
default:
return false;
}
} | static boolean function(LivingEntity livingEntity) { switch (livingEntity.getType()) { case ENDER_DRAGON: case WITHER: return true; default: return false; } } | /**
* Check if a given LivingEntity is a boss.
*
* @param livingEntity The {@link LivingEntity} of the livingEntity to check
* @return true if the livingEntity is a boss, false otherwise
*/ | Check if a given LivingEntity is a boss | isBoss | {
"repo_name": "EvilOlaf/mcMMO",
"path": "src/main/java/com/gmail/nossr50/util/MobHealthbarUtils.java",
"license": "agpl-3.0",
"size": 6046
} | [
"org.bukkit.entity.LivingEntity"
] | import org.bukkit.entity.LivingEntity; | import org.bukkit.entity.*; | [
"org.bukkit.entity"
] | org.bukkit.entity; | 1,421,437 |
void setAttribute(PerunSession sess, Member member, Group group, Attribute attribute) throws PrivilegeException, GroupNotExistsException, MemberNotExistsException, AttributeNotExistsException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException, MemberGroupMismatchE... | void setAttribute(PerunSession sess, Member member, Group group, Attribute attribute) throws PrivilegeException, GroupNotExistsException, MemberNotExistsException, AttributeNotExistsException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException, MemberGroupMismatchExce... | /**
* Store the particular attribute associated with the group and member combination. Core attributes can't be set this way.
* <p>
* PRIVILEGE: Principal need to have access to all attributes which he wants to set.
*
* @param sess perun session
* @param member member to set on
* @param group ... | Store the particular attribute associated with the group and member combination. Core attributes can't be set this way. | setAttribute | {
"repo_name": "zoraseb/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/AttributesManager.java",
"license": "bsd-2-clause",
"size": 265364
} | [
"cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException",
"cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException",
"cz.metacentrum.perun.core.api.exceptions.MemberGroupMismatchException",
"cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException",
"cz.metacentrum.perun.core... | import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException; import cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException; import cz.metacentrum.perun.core.api.exceptions.MemberGroupMismatchException; import cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException; import cz.metacent... | import cz.metacentrum.perun.core.api.exceptions.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 1,122,791 |
protected Connection createConnection() throws JMSException {
ConnectionFactory cf = getConnectionFactory();
if (jms11Available) {
return cf.createConnection();
}
else {
return ((QueueConnectionFactory) cf).createQueueConnection();
}
} | Connection function() throws JMSException { ConnectionFactory cf = getConnectionFactory(); if (jms11Available) { return cf.createConnection(); } else { return ((QueueConnectionFactory) cf).createQueueConnection(); } } | /**
* Create a new JMS Connection for this JMS invoker.
*/ | Create a new JMS Connection for this JMS invoker | createConnection | {
"repo_name": "kingtang/spring-learn",
"path": "spring-jms/src/main/java/org/springframework/jms/remoting/JmsInvokerClientInterceptor.java",
"license": "gpl-3.0",
"size": 16492
} | [
"javax.jms.Connection",
"javax.jms.ConnectionFactory",
"javax.jms.JMSException",
"javax.jms.QueueConnectionFactory"
] | import javax.jms.Connection; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.QueueConnectionFactory; | import javax.jms.*; | [
"javax.jms"
] | javax.jms; | 408,675 |
public List<FeedbackSessionAttributes> getFeedbackSessionsForUserInCourse(
String courseId, String userEmail)
throws EntityDoesNotExistException {
if (!coursesLogic.isCoursePresent(courseId)) {
throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_COURSE);
}
... | List<FeedbackSessionAttributes> function( String courseId, String userEmail) throws EntityDoesNotExistException { if (!coursesLogic.isCoursePresent(courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_COURSE); } return getFeedbackSessionsForUserInCourseSkipCheck(courseId, userEmail); } | /**
* Checks if the specified course exists, then gets the feedback sessions for
* the specified user in the course if it does exist.
*
* @return a list of viewable feedback sessions for any user for his course.
*/ | Checks if the specified course exists, then gets the feedback sessions for the specified user in the course if it does exist | getFeedbackSessionsForUserInCourse | {
"repo_name": "aacoba/teammates",
"path": "src/main/java/teammates/logic/core/FeedbackSessionsLogic.java",
"license": "gpl-2.0",
"size": 118079
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,694,407 |
public static void printUnicode (
final MessageOrBuilder message, final Appendable output)
throws IOException {
UNICODE_PRINTER.print (message, new TextGenerator (output));
} | static void function ( final MessageOrBuilder message, final Appendable output) throws IOException { UNICODE_PRINTER.print (message, new TextGenerator (output)); } | /**
* Same as {@code print()}, except that non-ASCII characters are not
* escaped.
*/ | Same as print(), except that non-ASCII characters are not escaped | printUnicode | {
"repo_name": "CodeBrig/Beam",
"path": "src/com/google/protobuf/TextFormat.java",
"license": "mit",
"size": 78931
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,582,072 |
public String getUsername() throws UserNotFoundException {
if (authToken == null) {
throw new UserNotFoundException();
}
return getAddress().getNode();
} | String function() throws UserNotFoundException { if (authToken == null) { throw new UserNotFoundException(); } return getAddress().getNode(); } | /**
* Returns the username associated with this session. Use this information
* with the user manager to obtain the user based on username.
*
* @return the username associated with this session
* @throws org.jivesoftware.openfire.user.UserNotFoundException if a user is not associated with a ses... | Returns the username associated with this session. Use this information with the user manager to obtain the user based on username | getUsername | {
"repo_name": "xiupitter/openfire",
"path": "LocalClientSession.java",
"license": "apache-2.0",
"size": 44952
} | [
"org.jivesoftware.openfire.user.UserNotFoundException"
] | import org.jivesoftware.openfire.user.UserNotFoundException; | import org.jivesoftware.openfire.user.*; | [
"org.jivesoftware.openfire"
] | org.jivesoftware.openfire; | 1,002,468 |
public void replayPhase2()
{
if (jtsLogger.logger.isDebugEnabled()) {
jtsLogger.logger.debug("CachedRecoveredTransaction.replayPhase2 ["
+ _theTransactionUid + ", " + _theTransactionType + "]");
}
TransactionCache.replayPhase2(_theTransactionUid, _theTransactionType);
}
... | void function() { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(STR + _theTransactionUid + STR + _theTransactionType + "]"); } TransactionCache.replayPhase2(_theTransactionUid, _theTransactionType); } private Uid _theTransactionUid = null; private String _theTransactionType = null; | /**
* Replays phase 2 of the transaction.
*/ | Replays phase 2 of the transaction | replayPhase2 | {
"repo_name": "nmcl/scratch",
"path": "graalvm/transactions/fork/narayana/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/transactions/CachedRecoveredTransaction.java",
"license": "apache-2.0",
"size": 5852
} | [
"com.arjuna.ats.arjuna.common.Uid"
] | import com.arjuna.ats.arjuna.common.Uid; | import com.arjuna.ats.arjuna.common.*; | [
"com.arjuna.ats"
] | com.arjuna.ats; | 2,308,032 |
public ServiceCall<SkuInner> putAsyncNonResourceAsync(SkuInner sku, final ServiceCallback<SkuInner> serviceCallback) {
return ServiceCall.create(putAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback);
} | ServiceCall<SkuInner> function(SkuInner sku, final ServiceCallback<SkuInner> serviceCallback) { return ServiceCall.create(putAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback); } | /**
* Long running put request with non resource.
*
* @param sku Sku to put
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/ | Long running put request with non resource | putAsyncNonResourceAsync | {
"repo_name": "yugangw-msft/autorest",
"path": "src/generator/AutoRest.Java.Azure.Fluent.Tests/src/main/java/fixtures/lro/implementation/LROsInner.java",
"license": "mit",
"size": 366932
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,681,196 |
GridNioFuture<?> writeNetBuffer() throws IgniteCheckedException {
assert isHeldByCurrentThread();
ByteBuffer cp = copy(outNetBuf);
return parent.proceedSessionWrite(ses, cp, true);
} | GridNioFuture<?> writeNetBuffer() throws IgniteCheckedException { assert isHeldByCurrentThread(); ByteBuffer cp = copy(outNetBuf); return parent.proceedSessionWrite(ses, cp, true); } | /**
* Copies data from out net buffer and passes it to the underlying chain.
*
* @return Write future.
* @throws GridNioException If send failed.
*/ | Copies data from out net buffer and passes it to the underlying chain | writeNetBuffer | {
"repo_name": "afinka77/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/nio/ssl/GridNioSslHandler.java",
"license": "apache-2.0",
"size": 22919
} | [
"java.nio.ByteBuffer",
"org.apache.ignite.IgniteCheckedException",
"org.apache.ignite.internal.util.nio.GridNioFuture"
] | import java.nio.ByteBuffer; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.internal.util.nio.GridNioFuture; | import java.nio.*; import org.apache.ignite.*; import org.apache.ignite.internal.util.nio.*; | [
"java.nio",
"org.apache.ignite"
] | java.nio; org.apache.ignite; | 229,447 |
@Override
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() {
if (customFlavor != null) {
return new java.awt.datatransfer.DataFlavor[] { customFlavor,
DATA_FLAVOR,
java.awt.datatransfer.DataFlavor.stringFlavor }; // end flavors array
}
else {
return new java.awt.... | java.awt.datatransfer.DataFlavor[] function() { if (customFlavor != null) { return new java.awt.datatransfer.DataFlavor[] { customFlavor, DATA_FLAVOR, java.awt.datatransfer.DataFlavor.stringFlavor }; } else { return new java.awt.datatransfer.DataFlavor[] { DATA_FLAVOR, java.awt.datatransfer.DataFlavor.stringFlavor }; }... | /**
* Returns a two- or three-element array containing first
* the custom data flavor, if one was created in the constructors,
* second the default {@link #DATA_FLAVOR} associated with {@link TransferableObject}, and third the {@link java.awt.datatransfer.DataFlavor.stringFlavor}.
*
* @return An array o... | Returns a two- or three-element array containing first the custom data flavor, if one was created in the constructors, second the default <code>#DATA_FLAVOR</code> associated with <code>TransferableObject</code>, and third the <code>java.awt.datatransfer.DataFlavor.stringFlavor</code> | getTransferDataFlavors | {
"repo_name": "un1q/umlLet",
"path": "Baselet/src/com/baselet/gui/standalone/FileDrop.java",
"license": "gpl-3.0",
"size": 31521
} | [
"java.awt.datatransfer.DataFlavor"
] | import java.awt.datatransfer.DataFlavor; | import java.awt.datatransfer.*; | [
"java.awt"
] | java.awt; | 2,338,138 |
public static String readFromFile(File file) throws IOException {
return new String(Files.readAllBytes(file.toPath()), CHARSET);
} | static String function(File file) throws IOException { return new String(Files.readAllBytes(file.toPath()), CHARSET); } | /**
* Assumes file exists
*/ | Assumes file exists | readFromFile | {
"repo_name": "ChaseYaoCong/main",
"path": "src/main/java/seedu/todo/commons/util/FileUtil.java",
"license": "mit",
"size": 3213
} | [
"java.io.File",
"java.io.IOException",
"java.nio.file.Files"
] | import java.io.File; import java.io.IOException; import java.nio.file.Files; | import java.io.*; import java.nio.file.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 1,212,557 |
public static void getPrivateEndpointConnection(
com.azure.resourcemanager.videoanalyzer.VideoAnalyzerManager manager) {
manager
.privateEndpointConnections()
.getWithResponse("contoso", "contososports", "10000000-0000-0000-0000-000000000000", Context.NONE);
} | static void function( com.azure.resourcemanager.videoanalyzer.VideoAnalyzerManager manager) { manager .privateEndpointConnections() .getWithResponse(STR, STR, STR, Context.NONE); } | /**
* Sample code: Get private endpoint connection.
*
* @param manager Entry point to VideoAnalyzerManager.
*/ | Sample code: Get private endpoint connection | getPrivateEndpointConnection | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/videoanalyzer/azure-resourcemanager-videoanalyzer/src/samples/java/com/azure/resourcemanager/videoanalyzer/generated/PrivateEndpointConnectionsGetSamples.java",
"license": "mit",
"size": 1008
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,858,249 |
String localizedName(ResourceProxy proxy); | String localizedName(ResourceProxy proxy); | /**
* A localized human-friendly name for this tile source
*
* @param proxy a resource proxy
* @return the localized tile source name
*/ | A localized human-friendly name for this tile source | localizedName | {
"repo_name": "garvankeeley/MozStumbler",
"path": "android/src/main/java/org/mozilla/osmdroid/tileprovider/tilesource/ITileSource.java",
"license": "mpl-2.0",
"size": 2000
} | [
"org.mozilla.osmdroid.ResourceProxy"
] | import org.mozilla.osmdroid.ResourceProxy; | import org.mozilla.osmdroid.*; | [
"org.mozilla.osmdroid"
] | org.mozilla.osmdroid; | 2,655,580 |
public String getParameterDescription( String key ) throws UnknownParamException {
return namedParams.getParameterDescription( key );
} | String function( String key ) throws UnknownParamException { return namedParams.getParameterDescription( key ); } | /**
* Gets the description of the specified parameter.
*
* @param key
* the name of the parameter
* @return the parameter description
* @throws UnknownParamException
* if the parameter does not exist
* @see org.pentaho.di.core.parameters.NamedParams#getParameterDescription(jav... | Gets the description of the specified parameter | getParameterDescription | {
"repo_name": "gretchiemoran/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 194677
} | [
"org.pentaho.di.core.parameters.UnknownParamException"
] | import org.pentaho.di.core.parameters.UnknownParamException; | import org.pentaho.di.core.parameters.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 602,857 |
private void shareImage(final Bitmap bitmap) {
File image; //image to share
//check to see if the cache/shared_images directory is present
final File imagesDir =
new File(this.getCacheDir().toString() + File.separator + "shared_image");
if (!imagesDir.exists()) {
... | void function(final Bitmap bitmap) { File image; final File imagesDir = new File(this.getCacheDir().toString() + File.separator + STR); if (!imagesDir.exists()) { imagesDir.mkdir(); } else { deleteFilesInDir(imagesDir); } try { image = File.createTempFile("img", ".png", imagesDir); FileOutputStream out = null; try { ou... | /**
* Converts an image to a PNG, stores it to the cache, then shares it. Saves the image to
* /cache/shared_image for easy deletion. If the /cache/shared_image folder already exists, we
* clear it's contents as to avoid increasing the cache size unnecessarily.
*
* @param bitmap image to share
... | Converts an image to a PNG, stores it to the cache, then shares it. Saves the image to cache/shared_image for easy deletion. If the /cache/shared_image folder already exists, we clear it's contents as to avoid increasing the cache size unnecessarily | shareImage | {
"repo_name": "Deadleg/Slide",
"path": "app/src/main/java/me/ccrama/redditslide/Activities/TumblrPager.java",
"license": "gpl-3.0",
"size": 35684
} | [
"android.content.Intent",
"android.graphics.Bitmap",
"android.net.Uri",
"android.support.v4.content.FileProvider",
"android.widget.Toast",
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException"
] | import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.support.v4.content.FileProvider; import android.widget.Toast; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; | import android.content.*; import android.graphics.*; import android.net.*; import android.support.v4.content.*; import android.widget.*; import java.io.*; | [
"android.content",
"android.graphics",
"android.net",
"android.support",
"android.widget",
"java.io"
] | android.content; android.graphics; android.net; android.support; android.widget; java.io; | 1,782,985 |
public static GeoPoint parseGeoPoint(XContentParser parser, GeoPoint point) throws IOException, ElasticsearchParseException {
double lat = Double.NaN;
double lon = Double.NaN;
String geohash = null;
if(parser.currentToken() == Token.START_OBJECT) {
while(parser.n... | static GeoPoint function(XContentParser parser, GeoPoint point) throws IOException, ElasticsearchParseException { double lat = Double.NaN; double lon = Double.NaN; String geohash = null; if(parser.currentToken() == Token.START_OBJECT) { while(parser.nextToken() != Token.END_OBJECT) { if(parser.currentToken() == Token.F... | /**
* Parse a {@link GeoPoint} with a {@link XContentParser}. A geopoint has one of the following forms:
*
* <ul>
* <li>Object: <pre>{"lat": <i><latitude></i>, "lon": <i><longitude></i>}</pre></li>
* <li>String: <pre>"<i><latitude></i>,<i><... | Parse a <code>GeoPoint</code> with a <code>XContentParser</code>. A geopoint has one of the following forms: Object: <code>{"lat": <latitude>, "lon": <longitude>}</code> String: <code>"<latitude>,<longitude>"</code> Geohash: <code>"<geohash>"</code> ... | parseGeoPoint | {
"repo_name": "PhaedrusTheGreek/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java",
"license": "apache-2.0",
"size": 20006
} | [
"java.io.IOException",
"org.elasticsearch.ElasticsearchParseException",
"org.elasticsearch.common.xcontent.XContentParser"
] | import java.io.IOException; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.xcontent.XContentParser; | import java.io.*; import org.elasticsearch.*; import org.elasticsearch.common.xcontent.*; | [
"java.io",
"org.elasticsearch",
"org.elasticsearch.common"
] | java.io; org.elasticsearch; org.elasticsearch.common; | 1,040,612 |
protected ClusterRecord getCluster (int bodyOid)
{
BodyObject bobj = (BodyObject)_omgr.getObject(bodyOid);
if (bobj instanceof ClusteredBodyObject) {
return _clusters.get(((ClusteredBodyObject)bobj).getClusterOid());
} else {
return null;
}
} | ClusterRecord function (int bodyOid) { BodyObject bobj = (BodyObject)_omgr.getObject(bodyOid); if (bobj instanceof ClusteredBodyObject) { return _clusters.get(((ClusteredBodyObject)bobj).getClusterOid()); } else { return null; } } | /**
* Fetches the cluster record for the specified body.
*/ | Fetches the cluster record for the specified body | getCluster | {
"repo_name": "threerings/vilya",
"path": "core/src/main/java/com/threerings/whirled/spot/server/SpotSceneManager.java",
"license": "lgpl-2.1",
"size": 21351
} | [
"com.threerings.crowd.data.BodyObject",
"com.threerings.whirled.spot.data.ClusteredBodyObject"
] | import com.threerings.crowd.data.BodyObject; import com.threerings.whirled.spot.data.ClusteredBodyObject; | import com.threerings.crowd.data.*; import com.threerings.whirled.spot.data.*; | [
"com.threerings.crowd",
"com.threerings.whirled"
] | com.threerings.crowd; com.threerings.whirled; | 2,292,239 |
@Test
public void testUploadConsentWithSourceAttachment() {
Consent consent = new Consent();
consent.setSource(new Attachment().setUrl("http://foo"));
myConsentDao.create(consent);
} | void function() { Consent consent = new Consent(); consent.setSource(new Attachment().setUrl("http: myConsentDao.create(consent); } | /**
* Make sure this can upload successfully (indexer failed at one point)
*/ | Make sure this can upload successfully (indexer failed at one point) | testUploadConsentWithSourceAttachment | {
"repo_name": "SingingTree/hapi-fhir",
"path": "hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3Test.java",
"license": "apache-2.0",
"size": 138185
} | [
"org.hl7.fhir.dstu3.model.Attachment",
"org.hl7.fhir.dstu3.model.Consent"
] | import org.hl7.fhir.dstu3.model.Attachment; import org.hl7.fhir.dstu3.model.Consent; | import org.hl7.fhir.dstu3.model.*; | [
"org.hl7.fhir"
] | org.hl7.fhir; | 734,471 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.