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 Set<String> getDeferredSet() { if (deferredSet == null){ this.deferredSet = new HashSet<String>(); } return deferredSet; }
Set<String> function() { if (deferredSet == null){ this.deferredSet = new HashSet<String>(); } return deferredSet; }
/** * This set contains the list of attributes that must be calculated at commit time. */
This set contains the list of attributes that must be calculated at commit time
getDeferredSet
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/ObjectChangeSet.java", "license": "epl-1.0", "size": 56003 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,189,232
public void createNormal (String input, String output, String variable, boolean fromGMM) throws IOException { temp = readFile(input); n = 1; if (variable.equals("Duration") || variable.equals("DailyTimes")) max = findMax(); else if (variable.equals("StartTime")) ...
void function (String input, String output, String variable, boolean fromGMM) throws IOException { temp = readFile(input); n = 1; if (variable.equals(STR) variable.equals(STR)) max = findMax(); else if (variable.equals(STR)) max = Constants.MINUTES_PER_DAY; else if (variable.equals(STR)) max = Constants.MINUTES_PER_DAY...
/** * This function is used for the creation of an Gaussian distribution given * the variable and the input.The result is exported to a file. * * @param input * The input file with the value array. * @param output * The output file name. * @param variable * The ran...
This function is used for the creation of an Gaussian distribution given the variable and the input.The result is exported to a file
createNormal
{ "repo_name": "cassandra-project/training", "path": "src/eu/cassandra/training/utils/MixtureCreator.java", "license": "apache-2.0", "size": 11559 }
[ "java.io.IOException", "java.util.Vector" ]
import java.io.IOException; import java.util.Vector;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,963,783
public XML xml() { return new XMLDocument(this.body()).merge(this.context()); }
XML function() { return new XMLDocument(this.body()).merge(this.context()); }
/** * Get XML body. * @return XML body */
Get XML body
xml
{ "repo_name": "chmodas/jcabi-http", "path": "src/main/java/com/jcabi/http/response/XmlResponse.java", "license": "bsd-3-clause", "size": 5404 }
[ "com.jcabi.xml.XMLDocument" ]
import com.jcabi.xml.XMLDocument;
import com.jcabi.xml.*;
[ "com.jcabi.xml" ]
com.jcabi.xml;
877,608
public void computeScrollDelta() { final long currentTime = AnimationUtils.currentAnimationTimeMillis(); final long elapsedSinceStart = currentTime - mStartTime; final float scale; if (elapsedSinceStart < mRampUpTime) { scale = mInterpolator.getInterpolation((float) elapsedSinceStart / mRampUpTime); } e...
void function() { final long currentTime = AnimationUtils.currentAnimationTimeMillis(); final long elapsedSinceStart = currentTime - mStartTime; final float scale; if (elapsedSinceStart < mRampUpTime) { scale = mInterpolator.getInterpolation((float) elapsedSinceStart / mRampUpTime); } else { scale = 1f; } final long el...
/** * Computes the current scroll deltas. This usually only be called after * starting the scroller with {@link #start()}. * * @see #getDeltaX() * @see #getDeltaY() */
Computes the current scroll deltas. This usually only be called after starting the scroller with <code>#start()</code>
computeScrollDelta
{ "repo_name": "n2hsu/Nii-Launcher", "path": "src/com/n2hsu/launcher/RampUpScroller.java", "license": "apache-2.0", "size": 3290 }
[ "android.view.animation.AnimationUtils" ]
import android.view.animation.AnimationUtils;
import android.view.animation.*;
[ "android.view" ]
android.view;
2,805,946
private static boolean evaluateArguments(@NotNull List<? extends String> names, @NotNull String[] values, @NotNull SsiProcessingState ssiProcessingState) { String expression = "expr".equalsIgnoreCase(names.get(0)) ? values[0] : null; if (expression == null) { throw new SsiStopProcessingException(); ...
static boolean function(@NotNull List<? extends String> names, @NotNull String[] values, @NotNull SsiProcessingState ssiProcessingState) { String expression = "expr".equalsIgnoreCase(names.get(0)) ? values[0] : null; if (expression == null) { throw new SsiStopProcessingException(); } try { return new ExpressionParseTre...
/** * Retrieves the expression from the specified arguments and performs the necessary evaluation steps. */
Retrieves the expression from the specified arguments and performs the necessary evaluation steps
evaluateArguments
{ "repo_name": "asedunov/intellij-community", "path": "platform/built-in-server/src/org/jetbrains/builtInWebServer/ssi/SsiConditional.java", "license": "apache-2.0", "size": 4814 }
[ "java.text.ParseException", "java.util.List", "org.jetbrains.annotations.NotNull" ]
import java.text.ParseException; import java.util.List; import org.jetbrains.annotations.NotNull;
import java.text.*; import java.util.*; import org.jetbrains.annotations.*;
[ "java.text", "java.util", "org.jetbrains.annotations" ]
java.text; java.util; org.jetbrains.annotations;
2,535,805
private void updateMoneyLineChart(HashMap<Garage.CarType, Double> moneyStats) { adhocMoneySeries.getData().add(getLineChartData(adhocMoneySeries.getData().size()+1, moneyStats.get(Garage.CarType.AD_HOC))); reservedMoneySeries.getData().add(getLineChartData(reservedMoneySeries.getData().size()+1, mon...
void function(HashMap<Garage.CarType, Double> moneyStats) { adhocMoneySeries.getData().add(getLineChartData(adhocMoneySeries.getData().size()+1, moneyStats.get(Garage.CarType.AD_HOC))); reservedMoneySeries.getData().add(getLineChartData(reservedMoneySeries.getData().size()+1, moneyStats.get(Garage.CarType.RESERVED))); ...
/** * Update line chart */
Update line chart
updateMoneyLineChart
{ "repo_name": "MelleDijkstra/ParkingGarage", "path": "src/main/java/parkinggarage/controllers/StatisticsController.java", "license": "mit", "size": 9083 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
434,395
private void setSubmissionRefs(Connection connection) throws ObjectStoreException { long bT = System.currentTimeMillis(); // to monitor time spent in the process // note: the map should contain only live submissions for (Integer submissionId : submissionDataMap.keySet()) { ...
void function(Connection connection) throws ObjectStoreException { long bT = System.currentTimeMillis(); for (Integer submissionId : submissionDataMap.keySet()) { for (Integer dataId : submissionDataMap.get(submissionId)) { LOG.debug(STR + submissionId + STR + dataId); if (appliedDataMap.get(dataId).intermineObjectId =...
/** * ================ * REFERENCES * ================ * to store references between submission and submissionData * (1 to many) */
================ REFERENCES ================ to store references between submission and submissionData (1 to many)
setSubmissionRefs
{ "repo_name": "tomck/intermine", "path": "bio/sources/chado-db/main/src/org/intermine/bio/dataconversion/ModEncodeMetaDataProcessor.java", "license": "lgpl-2.1", "size": 176582 }
[ "java.sql.Connection", "org.intermine.objectstore.ObjectStoreException", "org.intermine.xml.full.Reference" ]
import java.sql.Connection; import org.intermine.objectstore.ObjectStoreException; import org.intermine.xml.full.Reference;
import java.sql.*; import org.intermine.objectstore.*; import org.intermine.xml.full.*;
[ "java.sql", "org.intermine.objectstore", "org.intermine.xml" ]
java.sql; org.intermine.objectstore; org.intermine.xml;
2,873,480
public static <T> T newInstance(Class<T> classToInstantiate) { return WhiteboxImpl.newInstance(classToInstantiate); }
static <T> T function(Class<T> classToInstantiate) { return WhiteboxImpl.newInstance(classToInstantiate); }
/** * Create a new instance of a class without invoking its constructor. * <p> * No byte-code manipulation is needed to perform this operation and thus * it's not necessary use the {@code PowerMockRunner} or * {@code PrepareForTest} annotation to use this functionality. * * @param <T> * The ...
Create a new instance of a class without invoking its constructor. No byte-code manipulation is needed to perform this operation and thus it's not necessary use the PowerMockRunner or PrepareForTest annotation to use this functionality
newInstance
{ "repo_name": "hazendaz/powermock", "path": "powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java", "license": "apache-2.0", "size": 31475 }
[ "org.powermock.reflect.internal.WhiteboxImpl" ]
import org.powermock.reflect.internal.WhiteboxImpl;
import org.powermock.reflect.internal.*;
[ "org.powermock.reflect" ]
org.powermock.reflect;
1,328,681
public void reset() { if (m_counter != null) { m_counter.reset(); } else { ByteBuffer status = ByteBuffer.allocateDirect(4); // set the byte order status.order(ByteOrder.LITTLE_ENDIAN); EncoderJNI.resetEncoder(m_encoder, status.asIntBuffer()); HALUtil.checkStatus(status.asIntBuffer()); } }
void function() { if (m_counter != null) { m_counter.reset(); } else { ByteBuffer status = ByteBuffer.allocateDirect(4); status.order(ByteOrder.LITTLE_ENDIAN); EncoderJNI.resetEncoder(m_encoder, status.asIntBuffer()); HALUtil.checkStatus(status.asIntBuffer()); } }
/** * Reset the Encoder distance to zero. Resets the current count to zero on * the encoder. */
Reset the Encoder distance to zero. Resets the current count to zero on the encoder
reset
{ "repo_name": "trc492/Frc2015RecycleRush", "path": "code/WPILibJ/Encoder.java", "license": "mit", "size": 28404 }
[ "edu.wpi.first.wpilibj.hal.EncoderJNI", "edu.wpi.first.wpilibj.hal.HALUtil", "java.nio.ByteBuffer", "java.nio.ByteOrder" ]
import edu.wpi.first.wpilibj.hal.EncoderJNI; import edu.wpi.first.wpilibj.hal.HALUtil; import java.nio.ByteBuffer; import java.nio.ByteOrder;
import edu.wpi.first.wpilibj.hal.*; import java.nio.*;
[ "edu.wpi.first", "java.nio" ]
edu.wpi.first; java.nio;
1,610,617
public void load(URL url) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); try { DataAdapter da = new StreamDataAdapter(in); da.computeStats(); if (sampleStats.getN() == 0) { throw Ma...
void function(URL url) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); try { DataAdapter da = new StreamDataAdapter(in); da.computeStats(); if (sampleStats.getN() == 0) { throw MathRuntimeException.createEOFException(STR, url); } in = new BufferedReader(new InputStr...
/** * Computes the empirical distribution using data read from a URL. * @param url url of the input file * * @throws IOException if an IO error occurs */
Computes the empirical distribution using data read from a URL
load
{ "repo_name": "SpoonLabs/astor", "path": "examples/math_76/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java", "license": "gpl-2.0", "size": 16129 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStreamReader", "org.apache.commons.math.MathRuntimeException" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.commons.math.MathRuntimeException;
import java.io.*; import org.apache.commons.math.*;
[ "java.io", "org.apache.commons" ]
java.io; org.apache.commons;
1,391,891
private int uploadContent(final Path path, final ContentInformation information) throws Exception { final WebDavClient webdavclient = new WebDavClient(Proxy.fromPreferences(), WEB_DAV_USER, WEB_DAV_PASSWORD, true); final String...
int function(final Path path, final ContentInformation information) throws Exception { final WebDavClient webdavclient = new WebDavClient(Proxy.fromPreferences(), WEB_DAV_USER, WEB_DAV_PASSWORD, true); final String filename = FilenameUtils.getName(path.toString()); final String url = determineUrl(webdavclient, filename...
/** * DOCUMENT ME! * * @param path DOCUMENT ME! * @param information DOCUMENT ME! * * @return DOCUMENT ME! * * @throws Exception DOCUMENT ME! */
DOCUMENT ME
uploadContent
{ "repo_name": "switchonproject/cids-custom-switchon", "path": "src/main/java/de/cismet/cids/custom/switchon/wizards/panels/BasicImportDocumentVisualPanel.java", "license": "lgpl-3.0", "size": 37874 }
[ "de.cismet.commons.security.WebDavClient", "de.cismet.commons.security.WebDavHelper", "de.cismet.netutil.Proxy", "java.nio.file.Path", "java.util.ResourceBundle", "org.apache.commons.io.FilenameUtils" ]
import de.cismet.commons.security.WebDavClient; import de.cismet.commons.security.WebDavHelper; import de.cismet.netutil.Proxy; import java.nio.file.Path; import java.util.ResourceBundle; import org.apache.commons.io.FilenameUtils;
import de.cismet.commons.security.*; import de.cismet.netutil.*; import java.nio.file.*; import java.util.*; import org.apache.commons.io.*;
[ "de.cismet.commons", "de.cismet.netutil", "java.nio", "java.util", "org.apache.commons" ]
de.cismet.commons; de.cismet.netutil; java.nio; java.util; org.apache.commons;
2,108,343
@Override public User getUserInformationByUserId(String userId) { return storageIo.getUser(userId); }
User function(String userId) { return storageIo.getUser(userId); }
/** * Returns user information based on userId. * * @return user information record */
Returns user information based on userId
getUserInformationByUserId
{ "repo_name": "codimeo/codi-studio", "path": "appinventor/appengine/src/com/google/appinventor/server/UserInfoServiceImpl.java", "license": "apache-2.0", "size": 5481 }
[ "com.google.appinventor.shared.rpc.user.User" ]
import com.google.appinventor.shared.rpc.user.User;
import com.google.appinventor.shared.rpc.user.*;
[ "com.google.appinventor" ]
com.google.appinventor;
2,517,987
public List<File> findNRecentSnapshots(int n) throws IOException { FileSnap snaplog = new FileSnap(snapDir); return snaplog.findNRecentSnapshots(n); }
List<File> function(int n) throws IOException { FileSnap snaplog = new FileSnap(snapDir); return snaplog.findNRecentSnapshots(n); }
/** * the n most recent snapshots * @param n the number of recent snapshots * @return the list of n most recent snapshots, with * the most recent in front * @throws IOException */
the n most recent snapshots
findNRecentSnapshots
{ "repo_name": "breed/zookeeper", "path": "src/java/main/org/apache/zookeeper/server/persistence/FileTxnSnapLog.java", "license": "apache-2.0", "size": 13248 }
[ "java.io.File", "java.io.IOException", "java.util.List" ]
import java.io.File; import java.io.IOException; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
765,051
@LargeTest public void testPerformanceWithAudioTrack() throws Exception { final String videoItemFileName1 = INPUT_FILE_PATH + "H264_BP_1080x720_30fps_800kbps_1_17.mp4"; final String audioFilename1 = INPUT_FILE_PATH + "AACLC_44.1kHz_256kbps_s_1_17.mp4"; final Strin...
void function() throws Exception { final String videoItemFileName1 = INPUT_FILE_PATH + STR; final String audioFilename1 = INPUT_FILE_PATH + STR; final String audioFilename2 = INPUT_FILE_PATH + STR; final int renderingMode = MediaItem.RENDERING_MODE_BLACK_BORDER; final int audioVolume = 50; final String[] loggingInfo = ...
/** * To test the performance : With an audio track * * @throws Exception */
To test the performance : With an audio track
testPerformanceWithAudioTrack
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/com/android/mediaframeworktest/performance/VideoEditorPerformance.java", "license": "apache-2.0", "size": 46584 }
[ "android.media.videoeditor.AudioTrack", "android.media.videoeditor.MediaItem", "android.media.videoeditor.MediaVideoItem" ]
import android.media.videoeditor.AudioTrack; import android.media.videoeditor.MediaItem; import android.media.videoeditor.MediaVideoItem;
import android.media.videoeditor.*;
[ "android.media" ]
android.media;
2,565,319
private void writeRelationships(final Processor processor, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { writeSimpleElement(xmlStreamWriter, "h3", "Relationships: "); if (processor.getRelationships().size() > 0) { xmlStreamWriter.writeStartElement("tabl...
void function(final Processor processor, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { writeSimpleElement(xmlStreamWriter, "h3", STR); if (processor.getRelationships().size() > 0) { xmlStreamWriter.writeStartElement("table"); xmlStreamWriter.writeAttribute("id", STR); xmlStreamWriter.writeStartElem...
/** * Writes a table describing the relations a processor has. * * @param processor the processor to describe * @param xmlStreamWriter the stream writer to use * @throws XMLStreamException thrown if there was a problem writing the xml */
Writes a table describing the relations a processor has
writeRelationships
{ "repo_name": "YolandaMDavis/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/html/HtmlProcessorDocumentationWriter.java", "license": "apache-2.0", "size": 11093 }
[ "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamWriter", "org.apache.nifi.processor.Processor", "org.apache.nifi.processor.Relationship" ]
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.apache.nifi.processor.Processor; import org.apache.nifi.processor.Relationship;
import javax.xml.stream.*; import org.apache.nifi.processor.*;
[ "javax.xml", "org.apache.nifi" ]
javax.xml; org.apache.nifi;
2,913,629
public void testClear() { NavigableSet q = populatedSet(SIZE); q.clear(); assertTrue(q.isEmpty()); assertEquals(0, q.size()); q.add(new Integer(1)); assertFalse(q.isEmpty()); q.clear(); assertTrue(q.isEmpty()); }
void function() { NavigableSet q = populatedSet(SIZE); q.clear(); assertTrue(q.isEmpty()); assertEquals(0, q.size()); q.add(new Integer(1)); assertFalse(q.isEmpty()); q.clear(); assertTrue(q.isEmpty()); }
/** * clear removes all elements */
clear removes all elements
testClear
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "test/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java", "license": "gpl-2.0", "size": 32034 }
[ "java.util.NavigableSet" ]
import java.util.NavigableSet;
import java.util.*;
[ "java.util" ]
java.util;
1,456,319
public int getPrevSibling(int nodeIndex, boolean free) { if (nodeIndex == -1) { return -1; } int chunk = nodeIndex >> CHUNK_SHIFT; int index = nodeIndex & CHUNK_MASK; int type = getChunkIndex(fNodeType, chunk, index); if (type == Node.TEXT_NODE) { ...
int function(int nodeIndex, boolean free) { if (nodeIndex == -1) { return -1; } int chunk = nodeIndex >> CHUNK_SHIFT; int index = nodeIndex & CHUNK_MASK; int type = getChunkIndex(fNodeType, chunk, index); if (type == Node.TEXT_NODE) { do { nodeIndex = getChunkIndex(fNodePrevSib, chunk, index); if (nodeIndex == -1) { br...
/** * Returns the prev sibling of the given node. * @param free True to free sibling index. */
Returns the prev sibling of the given node
getPrevSibling
{ "repo_name": "srnsw/xena", "path": "xena/ext/src/xerces-2_9_1/src/org/apache/xerces/dom/DeferredDocumentImpl.java", "license": "gpl-3.0", "size": 74980 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,616,916
public static Calendar addYears(Date origin, int value) { return addYears(createCalendar(origin), value); }
static Calendar function(Date origin, int value) { return addYears(createCalendar(origin), value); }
/** * Add/Subtract the specified amount of years to the given {@link Date}. * * <p> * The returned {@link Calendar} has its fields synced. * </p> * * @param origin * @param value * @return * @since 0.9.2 */
Add/Subtract the specified amount of years to the given <code>Date</code>. The returned <code>Calendar</code> has its fields synced.
addYears
{ "repo_name": "DDTH/ddth-commons", "path": "ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DateTimeUtils.java", "license": "mit", "size": 25648 }
[ "java.util.Calendar", "java.util.Date" ]
import java.util.Calendar; import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,230,289
static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) { in.markReaderIndex(); int length; switch(tag >> 2 & 0x3F) { case 60: if (!in.isReadable()) { return NOT_ENOUGH_INPUT; } length = in.readUnsignedByte(); break;...
static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) { in.markReaderIndex(); int length; switch(tag >> 2 & 0x3F) { case 60: if (!in.isReadable()) { return NOT_ENOUGH_INPUT; } length = in.readUnsignedByte(); break; case 61: if (in.readableBytes() < 2) { return NOT_ENOUGH_INPUT; } length = in.readUnsignedShortLE()...
/** * Reads a literal from the input buffer directly to the output buffer. * A "literal" is an uncompressed segment of data stored directly in the * byte stream. * * @param tag The tag that identified this segment as a literal is also * used to encode part of the length of the d...
Reads a literal from the input buffer directly to the output buffer. A "literal" is an uncompressed segment of data stored directly in the byte stream
decodeLiteral
{ "repo_name": "bryce-anderson/netty", "path": "codec/src/main/java/io/netty/handler/codec/compression/Snappy.java", "license": "apache-2.0", "size": 24168 }
[ "io.netty.buffer.ByteBuf" ]
import io.netty.buffer.ByteBuf;
import io.netty.buffer.*;
[ "io.netty.buffer" ]
io.netty.buffer;
1,416,022
public void chatMessage(OmegleSession session, String message);
void function(OmegleSession session, String message);
/** * Called when a chat receives a message * * @param session * The session that received it * @param message * The message received */
Called when a chat receives a message
chatMessage
{ "repo_name": "nikkiii/omegle-api-java", "path": "src/org/nikki/omegle/event/OmegleEventListener.java", "license": "gpl-3.0", "size": 6109 }
[ "org.nikki.omegle.core.OmegleSession" ]
import org.nikki.omegle.core.OmegleSession;
import org.nikki.omegle.core.*;
[ "org.nikki.omegle" ]
org.nikki.omegle;
1,908,190
@Test public void missingJournalEntries() throws Exception { long startSN = 0x10; long nextSN = startSN; UfsJournalLogWriter writer = new UfsJournalLogWriter(mJournal, nextSN); long truncateSize = 0; long firstCorruptedEntrySeq = startSN + 4; for (int i = 0; i < 5; i++) { writer.write(...
void function() throws Exception { long startSN = 0x10; long nextSN = startSN; UfsJournalLogWriter writer = new UfsJournalLogWriter(mJournal, nextSN); long truncateSize = 0; long firstCorruptedEntrySeq = startSN + 4; for (int i = 0; i < 5; i++) { writer.write(newEntry(nextSN)); nextSN++; if (i == 3) { writer.flush(); U...
/** * Tests that {@link UfsJournalLogWriter} can detect the failure in which some flushed journal * entries are missing from the journal during recovery. */
Tests that <code>UfsJournalLogWriter</code> can detect the failure in which some flushed journal entries are missing from the journal during recovery
missingJournalEntries
{ "repo_name": "bf8086/alluxio", "path": "core/server/master/src/test/java/alluxio/master/journal/ufs/UfsJournalLogWriterTest.java", "license": "apache-2.0", "size": 20091 }
[ "java.io.DataOutputStream", "java.io.File", "java.io.FileOutputStream", "java.io.IOException", "java.nio.channels.FileChannel", "org.junit.Assert", "org.mockito.Mockito" ]
import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; import org.junit.Assert; import org.mockito.Mockito;
import java.io.*; import java.nio.channels.*; import org.junit.*; import org.mockito.*;
[ "java.io", "java.nio", "org.junit", "org.mockito" ]
java.io; java.nio; org.junit; org.mockito;
1,721,188
public static boolean isSameDay(Calendar cal1, Calendar cal2) { boolean same = false; if ((cal1 == null) && (cal2 == null)) { same = true; } else if ((cal1 != null) && (cal2 != null)) { return org.apache.commons.lang.time.DateUtils.isSameDay(cal1, cal2); ...
static boolean function(Calendar cal1, Calendar cal2) { boolean same = false; if ((cal1 == null) && (cal2 == null)) { same = true; } else if ((cal1 != null) && (cal2 != null)) { return org.apache.commons.lang.time.DateUtils.isSameDay(cal1, cal2); } else { same = false; } return same; }
/** * Adds null-safety to commons.DateUtils isSameDay method. * * @return true if both calendars are null or represent the same day */
Adds null-safety to commons.DateUtils isSameDay method
isSameDay
{ "repo_name": "bhutchinson/kfs", "path": "kfs-core/src/main/java/org/kuali/kfs/sys/util/KfsDateUtils.java", "license": "agpl-3.0", "size": 10217 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
2,585,803
private void connectUsingConnectionStringCredentials( final String accountName, final String containerName, final String accountKey) throws InvalidKeyException, StorageException, IOException, URISyntaxException { // If the account name is "acc.blob.core.windows.net", then the // rawAccountNa...
void function( final String accountName, final String containerName, final String accountKey) throws InvalidKeyException, StorageException, IOException, URISyntaxException { String rawAccountName = accountName.split("\\.")[0]; StorageCredentials credentials = new StorageCredentialsAccountAndKey( rawAccountName, account...
/** * Connect to Azure storage using account key credentials. */
Connect to Azure storage using account key credentials
connectUsingConnectionStringCredentials
{ "repo_name": "legend-hua/hadoop", "path": "hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/AzureNativeFileSystemStore.java", "license": "apache-2.0", "size": 107808 }
[ "com.microsoft.azure.storage.StorageCredentials", "com.microsoft.azure.storage.StorageCredentialsAccountAndKey", "com.microsoft.azure.storage.StorageException", "java.io.IOException", "java.net.URISyntaxException", "java.security.InvalidKeyException" ]
import com.microsoft.azure.storage.StorageCredentials; import com.microsoft.azure.storage.StorageCredentialsAccountAndKey; import com.microsoft.azure.storage.StorageException; import java.io.IOException; import java.net.URISyntaxException; import java.security.InvalidKeyException;
import com.microsoft.azure.storage.*; import java.io.*; import java.net.*; import java.security.*;
[ "com.microsoft.azure", "java.io", "java.net", "java.security" ]
com.microsoft.azure; java.io; java.net; java.security;
2,376,360
public List<AssignmentCategory> getCategories() { return categories; }
List<AssignmentCategory> function() { return categories; }
/** * Returns the List of AssignmentCategory objects * * @return the requested AssignmentCategory List */
Returns the List of AssignmentCategory objects
getCategories
{ "repo_name": "spockNinja/GhostGrader", "path": "src/objects/MyCourse.java", "license": "mit", "size": 20762 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,266,150
public void testDoesNotResolveTxAnnotationOnMethodFromClassImplementingAnnotatedInterface() throws SecurityException, NoSuchMethodException { AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource(); Method m = ImplementsAnnotatedInterface.class.getMethod("echo", Throwable.class); ...
void function() throws SecurityException, NoSuchMethodException { AnnotationTransactionAttributeSource atas = new AnnotationTransactionAttributeSource(); Method m = ImplementsAnnotatedInterface.class.getMethod("echo", Throwable.class); TransactionAttribute ta = atas.getTransactionAttribute(m, ImplementsAnnotatedInterfa...
/** * Note: resolution does not occur. Thus we can't make a class transactional if * it implements a transactionally annotated interface. This behaviour could only * be changed in AbstractFallbackTransactionAttributeSource in Spring proper. * @throws SecurityException * @throws NoSuchMethodException */
Note: resolution does not occur. Thus we can't make a class transactional if it implements a transactionally annotated interface. This behaviour could only be changed in AbstractFallbackTransactionAttributeSource in Spring proper
testDoesNotResolveTxAnnotationOnMethodFromClassImplementingAnnotatedInterface
{ "repo_name": "qobel/esoguproject", "path": "spring-framework/spring-aspects/src/test/java/org/springframework/transaction/aspectj/TransactionAspectTests.java", "license": "apache-2.0", "size": 9208 }
[ "java.lang.reflect.Method", "org.springframework.transaction.annotation.AnnotationTransactionAttributeSource", "org.springframework.transaction.interceptor.TransactionAttribute" ]
import java.lang.reflect.Method; import org.springframework.transaction.annotation.AnnotationTransactionAttributeSource; import org.springframework.transaction.interceptor.TransactionAttribute;
import java.lang.reflect.*; import org.springframework.transaction.annotation.*; import org.springframework.transaction.interceptor.*;
[ "java.lang", "org.springframework.transaction" ]
java.lang; org.springframework.transaction;
2,615,326
void addFilter(DocumentFilter filter);
void addFilter(DocumentFilter filter);
/** * Adds a filter to intercept requests. * * @param filter * filter */
Adds a filter to intercept requests
addFilter
{ "repo_name": "adnovum/katharsis-framework", "path": "katharsis-core/src/main/java/io/katharsis/module/Module.java", "license": "apache-2.0", "size": 4751 }
[ "io.katharsis.repository.filter.DocumentFilter" ]
import io.katharsis.repository.filter.DocumentFilter;
import io.katharsis.repository.filter.*;
[ "io.katharsis.repository" ]
io.katharsis.repository;
1,005,275
public boolean passesFileFilters(MergedInfoInterface mergedInfo) { return true; }
boolean function(MergedInfoInterface mergedInfo) { return true; }
/** * Does the file pass the active filter collection. * @param mergedInfo the file to test. * @return true if it passes the active filter collection; false if not. */
Does the file pass the active filter collection
passesFileFilters
{ "repo_name": "jimv39/qvcsos", "path": "qvcse-gui/src/main/java/com/qumasoft/guitools/qwin/AbstractFileTableModel.java", "license": "apache-2.0", "size": 8593 }
[ "com.qumasoft.qvcslib.MergedInfoInterface" ]
import com.qumasoft.qvcslib.MergedInfoInterface;
import com.qumasoft.qvcslib.*;
[ "com.qumasoft.qvcslib" ]
com.qumasoft.qvcslib;
2,856,946
private List<String> getToBeAddMembers() { List<String> members = new ArrayList<String>(); int length = contactAdapter.isCheckedArray.length; for (int i = 0; i < length; i++) { String username = contactAdapter.getItem(i).getUsername(); if (contactAdapter.isCheckedArray[i] && !existMembers.contains(userna...
List<String> function() { List<String> members = new ArrayList<String>(); int length = contactAdapter.isCheckedArray.length; for (int i = 0; i < length; i++) { String username = contactAdapter.getItem(i).getUsername(); if (contactAdapter.isCheckedArray[i] && !existMembers.contains(username)) { members.add(username); } ...
/** * get selected members * * @return */
get selected members
getToBeAddMembers
{ "repo_name": "CinderellaCJ/ARCard", "path": "src/com/cj/arcard/ui/GroupPickContactsActivity.java", "license": "apache-2.0", "size": 6335 }
[ "android.content.Context", "com.hyphenate.easeui.adapter.EaseContactAdapter", "com.hyphenate.easeui.domain.EaseUser", "java.util.ArrayList", "java.util.List" ]
import android.content.Context; import com.hyphenate.easeui.adapter.EaseContactAdapter; import com.hyphenate.easeui.domain.EaseUser; import java.util.ArrayList; import java.util.List;
import android.content.*; import com.hyphenate.easeui.adapter.*; import com.hyphenate.easeui.domain.*; import java.util.*;
[ "android.content", "com.hyphenate.easeui", "java.util" ]
android.content; com.hyphenate.easeui; java.util;
2,419,533
@Nullable public static Double degreesMinutesSecondsToDecimal(@NotNull final Rational degs, @NotNull final Rational mins, @NotNull final Rational secs, final boolean isNegative) { double decimal = Math.abs(degs.doubleValue()) + mins.doubleValue() / 60.0d + secs.double...
static Double function(@NotNull final Rational degs, @NotNull final Rational mins, @NotNull final Rational secs, final boolean isNegative) { double decimal = Math.abs(degs.doubleValue()) + mins.doubleValue() / 60.0d + secs.doubleValue() / 3600.0d; if (Double.isNaN(decimal)) return null; if (isNegative) decimal *= -1; r...
/** * Converts DMS (degrees-minutes-seconds) rational values, as given in {@link com.drew.metadata.exif.GpsDirectory}, * into a single value in degrees, as a double. */
Converts DMS (degrees-minutes-seconds) rational values, as given in <code>com.drew.metadata.exif.GpsDirectory</code>, into a single value in degrees, as a double
degreesMinutesSecondsToDecimal
{ "repo_name": "CURocketry/Ground_Station_GUI", "path": "src/com/drew/lang/GeoLocation.java", "license": "gpl-3.0", "size": 4765 }
[ "com.drew.lang.annotations.NotNull" ]
import com.drew.lang.annotations.NotNull;
import com.drew.lang.annotations.*;
[ "com.drew.lang" ]
com.drew.lang;
354,791
public void testGetNumberOfDependents() { for (ExecutionMode m : ExecutionMode.values()) for (Integer v1 : new Integer[] { 1, null }) { CompletableFuture<Integer> f = new CompletableFuture<>(); assertEquals(0, f.getNumberOfDependents()); final CompletableFuture<Void> g = ...
void function() { for (ExecutionMode m : ExecutionMode.values()) for (Integer v1 : new Integer[] { 1, null }) { CompletableFuture<Integer> f = new CompletableFuture<>(); assertEquals(0, f.getNumberOfDependents()); final CompletableFuture<Void> g = m.thenRun(f, new Noop(m)); assertEquals(1, f.getNumberOfDependents()); a...
/** * getNumberOfDependents returns number of dependent tasks */
getNumberOfDependents returns number of dependent tasks
testGetNumberOfDependents
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "test/java/util/concurrent/tck/CompletableFutureTest.java", "license": "gpl-2.0", "size": 175854 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
563,644
@Override public int getAvailableTags(PublicKey target, SessionKey key) { OutboundSession sess = getSession(target); if (sess == null) { return 0; } if (sess.getCurrentKey().equals(key)) { return sess.availableTags(); } return 0; }
int function(PublicKey target, SessionKey key) { OutboundSession sess = getSession(target); if (sess == null) { return 0; } if (sess.getCurrentKey().equals(key)) { return sess.availableTags(); } return 0; }
/** * Determine (approximately) how many available session tags for the current target * have been confirmed and are available * */
Determine (approximately) how many available session tags for the current target have been confirmed and are available
getAvailableTags
{ "repo_name": "oakes/Nightweb", "path": "common/java/core/net/i2p/crypto/TransientSessionKeyManager.java", "license": "unlicense", "size": 47446 }
[ "net.i2p.data.PublicKey", "net.i2p.data.SessionKey" ]
import net.i2p.data.PublicKey; import net.i2p.data.SessionKey;
import net.i2p.data.*;
[ "net.i2p.data" ]
net.i2p.data;
339,344
public BigDecimal getWeight() { return myWeight; }
BigDecimal function() { return myWeight; }
/** * Assuming there is precisely 1 weight - this class is used to describe 1 asset (portfolio member). */
Assuming there is precisely 1 weight - this class is used to describe 1 asset (portfolio member)
getWeight
{ "repo_name": "optimatika/ojAlgo-finance", "path": "src/main/java/org/ojalgo/finance/portfolio/SimpleAsset.java", "license": "mit", "size": 3296 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,249,396
ServiceFuture<CloudJobSchedule> getAsync(String jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions, final ServiceCallback<CloudJobSchedule> serviceCallback);
ServiceFuture<CloudJobSchedule> getAsync(String jobScheduleId, JobScheduleGetOptions jobScheduleGetOptions, final ServiceCallback<CloudJobSchedule> serviceCallback);
/** * Gets information about the specified Job Schedule. * * @param jobScheduleId The ID of the Job Schedule to get. * @param jobScheduleGetOptions Additional parameters for the operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throw...
Gets information about the specified Job Schedule
getAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/batch/microsoft-azure-batch/src/main/java/com/microsoft/azure/batch/protocol/JobSchedules.java", "license": "mit", "size": 58025 }
[ "com.microsoft.azure.batch.protocol.models.CloudJobSchedule", "com.microsoft.azure.batch.protocol.models.JobScheduleGetOptions", "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.azure.batch.protocol.models.CloudJobSchedule; import com.microsoft.azure.batch.protocol.models.JobScheduleGetOptions; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.azure.batch.protocol.models.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
526,477
public List<String> getSectionNamesForCourse(String courseId) throws EntityDoesNotExistException { Assumption.assertNotNull(courseId); return coursesLogic.getSectionsNameForCourse(courseId); }
List<String> function(String courseId) throws EntityDoesNotExistException { Assumption.assertNotNull(courseId); return coursesLogic.getSectionsNameForCourse(courseId); }
/** * Returns a list of section names for the course with ID courseId. * * <p>Preconditions: <br> * * All parameters are non-null. * * @see CoursesLogic#getSectionsNameForCourse(String) */
Returns a list of section names for the course with ID courseId. Preconditions: All parameters are non-null
getSectionNamesForCourse
{ "repo_name": "thenaesh/teammates", "path": "src/main/java/teammates/logic/api/Logic.java", "license": "gpl-2.0", "size": 87996 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
602,702
public void beginJavadocTree(DetailNode rootAst) { // No code by default, should be overridden only by demand at subclasses }
void function(DetailNode rootAst) { }
/** * Called before the starting to process a tree. * @param rootAst * the root of the tree */
Called before the starting to process a tree
beginJavadocTree
{ "repo_name": "cs1331/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java", "license": "apache-2.0", "size": 22828 }
[ "com.puppycrawl.tools.checkstyle.api.DetailNode" ]
import com.puppycrawl.tools.checkstyle.api.DetailNode;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
1,960,752
@Test(groups = { "direct" }, timeOut = TIMEOUT * 10) public void createRecoversFrom410GoneFromServiceOnPartitionSplitDuringIdleTime() throws Exception { executeCreateRecoversFrom410GoneOnPartitionSplitDuringIdleTime(true); }
@Test(groups = { STR }, timeOut = TIMEOUT * 10) void function() throws Exception { executeCreateRecoversFrom410GoneOnPartitionSplitDuringIdleTime(true); }
/** * Tests document creation through direct mode */
Tests document creation through direct mode
createRecoversFrom410GoneFromServiceOnPartitionSplitDuringIdleTime
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/GoneAndRetryPolicyWithSpyClientTest.java", "license": "mit", "size": 19344 }
[ "org.testng.annotations.Test" ]
import org.testng.annotations.Test;
import org.testng.annotations.*;
[ "org.testng.annotations" ]
org.testng.annotations;
1,331,853
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public int physicalCountAll() { String sql = "SELECT COUNT(*) FROM SYSTEM_CONFIGS"; return executeQuerySingle(sql, Integer.class); }
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) int function() { String sql = STR; return executeQuerySingle(sql, Integer.class); }
/** * Count all data * @return count */
Count all data
physicalCountAll
{ "repo_name": "support-project/knowledge", "path": "src/main/java/org/support/project/web/dao/gen/GenSystemConfigsDao.java", "license": "apache-2.0", "size": 19514 }
[ "org.support.project.aop.Aspect" ]
import org.support.project.aop.Aspect;
import org.support.project.aop.*;
[ "org.support.project" ]
org.support.project;
734,416
public void testScheduleJob() throws Exception { SchedulerService s = SpringContext.getBean(SchedulerService.class); BatchJobStatus job = s.getJob(SchedulerService.UNSCHEDULED_GROUP, "manualPurgeJob"); assertNotNull("job must not be null", job); assertFalse("must return isScheduled ...
void function() throws Exception { SchedulerService s = SpringContext.getBean(SchedulerService.class); BatchJobStatus job = s.getJob(SchedulerService.UNSCHEDULED_GROUP, STR); assertNotNull(STR, job); assertFalse(STR, job.isScheduled()); job.schedule(); job = s.getJob(SchedulerService.UNSCHEDULED_GROUP, STR); assertNotN...
/** * Test that the schedule job function works and puts the job into the standard scheduled group. Also tests to make sure that * BatchJobStatus detects the scheduled status even if it is in the unscheduled group. Assumes: clearOldOriginEntriesJob exists * as a job in the unscheduled group. */
Test that the schedule job function works and puts the job into the standard scheduled group. Also tests to make sure that BatchJobStatus detects the scheduled status even if it is in the unscheduled group. Assumes: clearOldOriginEntriesJob exists as a job in the unscheduled group
testScheduleJob
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/test/java/org/kuali/kfs/sys/batch/service/SchedulerServiceImplTest.java", "license": "agpl-3.0", "size": 13606 }
[ "org.kuali.kfs.sys.batch.BatchJobStatus", "org.kuali.kfs.sys.context.SpringContext" ]
import org.kuali.kfs.sys.batch.BatchJobStatus; import org.kuali.kfs.sys.context.SpringContext;
import org.kuali.kfs.sys.batch.*; import org.kuali.kfs.sys.context.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,518,554
private int getLastInsertID(final Connection dbConn) throws SQLException { PreparedStatement stat = null; try { stat = dbConn.prepareStatement("SELECT LAST_INSERT_ID()"); final ResultSet results = stat.executeQuery(); if ( results.first() ) return results.getInt(1); throw new SQLException("Ack...
int function(final Connection dbConn) throws SQLException { PreparedStatement stat = null; try { stat = dbConn.prepareStatement(STR); final ResultSet results = stat.executeQuery(); if ( results.first() ) return results.getInt(1); throw new SQLException(STR); } finally { if (stat != null) stat.close(); } }
/** * Get the last insert ID */
Get the last insert ID
getLastInsertID
{ "repo_name": "UWCS/choob", "path": "src/main/java/uk/co/uwcs/choob/modules/SecurityModule.java", "license": "lgpl-2.1", "size": 51502 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,996,690
protected void handleStyledAttributes(TypedArray a) { }
void function(TypedArray a) { }
/** * Allows Derivative classes to handle the XML Attrs without creating a * TypedArray themsevles * * @param a - TypedArray of PullToRefresh Attributes */
Allows Derivative classes to handle the XML Attrs without creating a TypedArray themsevles
handleStyledAttributes
{ "repo_name": "FreeSunny/RefreashTabView", "path": "src/com/example/refreashtabview/refreash/PullToRefreshBase.java", "license": "apache-2.0", "size": 46250 }
[ "android.content.res.TypedArray" ]
import android.content.res.TypedArray;
import android.content.res.*;
[ "android.content" ]
android.content;
2,239,645
public void setPullRefreshEnable(boolean enable) { mEnablePullRefresh = enable; if (!mEnablePullRefresh) { // disable, hide the content mHeaderViewContent.setVisibility(View.INVISIBLE); } else { mHeaderViewContent.setVisibility(View.VISIBLE); } }
void function(boolean enable) { mEnablePullRefresh = enable; if (!mEnablePullRefresh) { mHeaderViewContent.setVisibility(View.INVISIBLE); } else { mHeaderViewContent.setVisibility(View.VISIBLE); } }
/** * enable or disable pull down refresh feature. * * @param enable */
enable or disable pull down refresh feature
setPullRefreshEnable
{ "repo_name": "yangyankai/XListView", "path": "app/src/main/java/com/sf/manager/xlistview/view/XListView.java", "license": "apache-2.0", "size": 10758 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,502,117
public void removeServerGroup(ActivationKey key, ServerGroup group) { key.removeServerGroup(group); }
void function(ActivationKey key, ServerGroup group) { key.removeServerGroup(group); }
/** * Remove a ServerGroup from an activation key. * @param key Activation key to be acted upon * @param group ServerGroup to remove */
Remove a ServerGroup from an activation key
removeServerGroup
{ "repo_name": "aronparsons/spacewalk", "path": "java/code/src/com/redhat/rhn/manager/token/ActivationKeyManager.java", "license": "gpl-2.0", "size": 24292 }
[ "com.redhat.rhn.domain.server.ServerGroup", "com.redhat.rhn.domain.token.ActivationKey" ]
import com.redhat.rhn.domain.server.ServerGroup; import com.redhat.rhn.domain.token.ActivationKey;
import com.redhat.rhn.domain.server.*; import com.redhat.rhn.domain.token.*;
[ "com.redhat.rhn" ]
com.redhat.rhn;
2,665,632
public void setMetricsService(MetricsService service) { metricsService = service; }
void function(MetricsService service) { metricsService = service; }
/** * Configures metric services. * * @param service metrics service */
Configures metric services
setMetricsService
{ "repo_name": "gkatsikas/onos", "path": "apps/cpman/app/src/main/java/org/onosproject/cpman/impl/SystemMetricsAggregator.java", "license": "apache-2.0", "size": 5629 }
[ "org.onlab.metrics.MetricsService" ]
import org.onlab.metrics.MetricsService;
import org.onlab.metrics.*;
[ "org.onlab.metrics" ]
org.onlab.metrics;
418,190
private boolean handleTouchEvent(MotionEvent ev) { int action = ev.getAction(); int x = (int) ev.getX(); int y = (int) ev.getY(); switch (action) { case MotionEvent.ACTION_DOWN: // Keep track of the down positions mDownX = x; ...
boolean function(MotionEvent ev) { int action = ev.getAction(); int x = (int) ev.getX(); int y = (int) ev.getY(); switch (action) { case MotionEvent.ACTION_DOWN: mDownX = x; mDownY = mLastY = y; if (shouldStopScroll(ev)) { stopScroll(); } if (mScrollbar != null) { mScrollbar.handleTouchEvent(ev, mDownX, mDownY, mLastY)...
/** * Handles the touch event and determines whether to show the fast scroller (or updates it if * it is already showing). */
Handles the touch event and determines whether to show the fast scroller (or updates it if it is already showing)
handleTouchEvent
{ "repo_name": "lcg833/Trebuchet", "path": "Trebuchet/src/main/java/com/android/launcher3/BaseRecyclerView.java", "license": "gpl-3.0", "size": 11694 }
[ "android.view.MotionEvent" ]
import android.view.MotionEvent;
import android.view.*;
[ "android.view" ]
android.view;
1,531,859
@JsonRpcMethod("getblockchaininfo") BlockChainInfo getblockchaininfo();
@JsonRpcMethod(STR) BlockChainInfo getblockchaininfo();
/** * GetBlockChainInfo Added in Bitcoin Core 0.9.2 * * <p>The getblockchaininfo RPC provides information about the current state of the block chain. */
GetBlockChainInfo Added in Bitcoin Core 0.9.2 The getblockchaininfo RPC provides information about the current state of the block chain
getblockchaininfo
{ "repo_name": "trevorbernard/heimdal", "path": "cosigner-bitcoin/src/main/java/io/emax/cosigner/bitcoin/bitcoindrpc/BlockChainRpc.java", "license": "mpl-2.0", "size": 1177 }
[ "com.googlecode.jsonrpc4j.JsonRpcMethod" ]
import com.googlecode.jsonrpc4j.JsonRpcMethod;
import com.googlecode.jsonrpc4j.*;
[ "com.googlecode.jsonrpc4j" ]
com.googlecode.jsonrpc4j;
1,123,010
public static boolean isValidInt(@Nullable final String integerStr, final int lowerBound, final int upperBound, final boolean includeLowerBound, final boolean includeUpperBound) { if (lowerBound > upperBound) { throw new IllegalArgumentException(ExceptionValues.INVALID_BOUNDS); } else if...
static boolean function(@Nullable final String integerStr, final int lowerBound, final int upperBound, final boolean includeLowerBound, final boolean includeUpperBound) { if (lowerBound > upperBound) { throw new IllegalArgumentException(ExceptionValues.INVALID_BOUNDS); } else if (!isValidInt(integerStr)) { return false...
/** * Given an integer string, it checks if it's a valid integer (base on apaches NumberUtils.createInteger) and if * it's between the lowerBound and upperBound. * * @param integerStr the integer string to check * @param lowerBound the lower bound of the interval * @param upp...
Given an integer string, it checks if it's a valid integer (base on apaches NumberUtils.createInteger) and if it's between the lowerBound and upperBound
isValidInt
{ "repo_name": "victorursan/cs-actions", "path": "cs-commons/src/main/java/io/cloudslang/content/utils/NumberUtilities.java", "license": "apache-2.0", "size": 9648 }
[ "io.cloudslang.content.constants.ExceptionValues", "org.jetbrains.annotations.Nullable" ]
import io.cloudslang.content.constants.ExceptionValues; import org.jetbrains.annotations.Nullable;
import io.cloudslang.content.constants.*; import org.jetbrains.annotations.*;
[ "io.cloudslang.content", "org.jetbrains.annotations" ]
io.cloudslang.content; org.jetbrains.annotations;
494,940
public static <T> List<T> loadJsonValues(File json, Class<T> clazz) throws IOException { List<T> answer = new ArrayList<>(); if (json.exists() && json.isFile()) { MappingIterator<T> iter = objectMapper.readerFor(clazz).readValues(json); while (iter.hasNext()) { ...
static <T> List<T> function(File json, Class<T> clazz) throws IOException { List<T> answer = new ArrayList<>(); if (json.exists() && json.isFile()) { MappingIterator<T> iter = objectMapper.readerFor(clazz).readValues(json); while (iter.hasNext()) { answer.add(iter.next()); } } return answer; }
/** * Saves the json object to the given file */
Saves the json object to the given file
loadJsonValues
{ "repo_name": "EricWittmann/fabric8", "path": "forge/fabric8-forge-core/src/main/java/io/fabric8/forge/rest/model/Models.java", "license": "apache-2.0", "size": 2247 }
[ "com.fasterxml.jackson.databind.MappingIterator", "java.io.File", "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import com.fasterxml.jackson.databind.MappingIterator; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List;
import com.fasterxml.jackson.databind.*; import java.io.*; import java.util.*;
[ "com.fasterxml.jackson", "java.io", "java.util" ]
com.fasterxml.jackson; java.io; java.util;
2,665,669
public Write withBigtableOptions(BigtableOptions.Builder optionsBuilder) { checkNotNull(optionsBuilder, "optionsBuilder"); // TODO: is there a better way to clone a Builder? Want it to be immune from user changes. BigtableOptions options = optionsBuilder.build(); RetryOptions retryOptions = ...
Write function(BigtableOptions.Builder optionsBuilder) { checkNotNull(optionsBuilder, STR); BigtableOptions options = optionsBuilder.build(); RetryOptions retryOptions = options.getRetryOptions(); BigtableOptions.Builder clonedBuilder = options.toBuilder() .setBulkOptions( options.getBulkOptions().toBuilder() .setUseBu...
/** * Returns a new {@link BigtableIO.Write} that will write to the Cloud Bigtable cluster * indicated by the given options, and using any other specified customizations. * * <p>Clones the given {@link BigtableOptions} builder so that any further changes * will have no effect on the returned {@...
Returns a new <code>BigtableIO.Write</code> that will write to the Cloud Bigtable cluster indicated by the given options, and using any other specified customizations. Clones the given <code>BigtableOptions</code> builder so that any further changes will have no effect on the returned <code>BigtableIO.Write</code>. Doe...
withBigtableOptions
{ "repo_name": "joshualitt/DataflowJavaSDK", "path": "sdk/src/main/java/com/google/cloud/dataflow/sdk/io/bigtable/BigtableIO.java", "license": "apache-2.0", "size": 40098 }
[ "com.google.cloud.bigtable.config.BigtableOptions", "com.google.cloud.bigtable.config.RetryOptions", "com.google.common.base.Preconditions" ]
import com.google.cloud.bigtable.config.BigtableOptions; import com.google.cloud.bigtable.config.RetryOptions; import com.google.common.base.Preconditions;
import com.google.cloud.bigtable.config.*; import com.google.common.base.*;
[ "com.google.cloud", "com.google.common" ]
com.google.cloud; com.google.common;
17,611
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { if (v instanceof ViewGroup) { final ViewGroup group = (ViewGroup) v; final int scrollX = v.getScrollX(); final int scrollY = v.getScrollY(); final int count = group.getChildCount(); ...
boolean function(View v, boolean checkV, int dx, int x, int y) { if (v instanceof ViewGroup) { final ViewGroup group = (ViewGroup) v; final int scrollX = v.getScrollX(); final int scrollY = v.getScrollY(); final int count = group.getChildCount(); for (int i = count - 1; i >= 0; i--) { final View child = group.getChildA...
/** * Tests scrollability within child views of v given a delta of dx. * * @param v View to test for horizontal scrollability * @param checkV Whether the view v passed should itself be checked for scrollability (true), * or just its children (false). * @param dx Delta scrolle...
Tests scrollability within child views of v given a delta of dx
canScroll
{ "repo_name": "felipecsl/AndroidSlidingUpPanel", "path": "library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java", "license": "apache-2.0", "size": 39248 }
[ "android.support.v4.view.ViewCompat", "android.view.View", "android.view.ViewGroup" ]
import android.support.v4.view.ViewCompat; import android.view.View; import android.view.ViewGroup;
import android.support.v4.view.*; import android.view.*;
[ "android.support", "android.view" ]
android.support; android.view;
535,739
public void setRegisterNameValue(YangString registerNameValue) throws JNCException { setLeafValue(Epc.NAMESPACE, "register-name", registerNameValue, childrenNames()); }
void function(YangString registerNameValue) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, registerNameValue, childrenNames()); }
/** * Sets the value for child leaf "register-name", * using instance of generated typedef class. * @param registerNameValue The value to set. * @param registerNameValue used during instantiation. */
Sets the value for child leaf "register-name", using instance of generated typedef class
setRegisterNameValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/fgw/statistics/fgwBm/ERabRelease.java", "license": "apache-2.0", "size": 11380 }
[ "com.tailf.jnc.YangString" ]
import com.tailf.jnc.YangString;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
2,275,703
public static String implode(String a_delim, List<String> a_list) { if(a_list.size() == 0) return ""; int length = 0; for(String entry : a_list) length += entry.length(); length += a_delim.length()*(a_list.size()-1); StringBuilder ret = new StringBuilder(length); boolean first = true; for(Strin...
static String function(String a_delim, List<String> a_list) { if(a_list.size() == 0) return ""; int length = 0; for(String entry : a_list) length += entry.length(); length += a_delim.length()*(a_list.size()-1); StringBuilder ret = new StringBuilder(length); boolean first = true; for(String entry : a_list) { if(first) f...
/** * Concatenates a list of Strings with a specified delimiter. * @param a_delim The delimiter to use to glue the strings together. * @param a_list The list of strings to join. * @return The concatenated string. */
Concatenates a list of Strings with a specified delimiter
implode
{ "repo_name": "FacilMap/ajax-proxy", "path": "src/main/java/eu/cdauth/ajaxproxy/Servlet.java", "license": "agpl-3.0", "size": 14888 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,383,954
protected void setTreeViewer(TreeViewer treeViewer) { this.treeViewer = treeViewer; }
void function(TreeViewer treeViewer) { this.treeViewer = treeViewer; }
/** * Set the treeViewer. * @param treeViewer * * @since 3.1 */
Set the treeViewer
setTreeViewer
{ "repo_name": "AntoineDelacroix/NewSuperProject-", "path": "org.eclipse.jface/src/org/eclipse/jface/preference/PreferenceDialog.java", "license": "gpl-2.0", "size": 43452 }
[ "org.eclipse.jface.viewers.TreeViewer" ]
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
717,585
public static boolean deleteRecursively(File root, boolean deleteRoot) { if (root != null && root.exists()) { if (root.isDirectory()) { File[] children = root.listFiles(); if (children != null) { for (File aChildren : children) { ...
static boolean function(File root, boolean deleteRoot) { if (root != null && root.exists()) { if (root.isDirectory()) { File[] children = root.listFiles(); if (children != null) { for (File aChildren : children) { deleteRecursively(aChildren, true); } } } if (deleteRoot) { return root.delete(); } else { return true; } ...
/** * Delete the supplied {@link java.io.File} - for directories, * recursively delete any nested directories or files as well. * * @param root the root <code>File</code> to delete * @param deleteRoot whether or not to delete the root itself or just the content of the root. * @return...
Delete the supplied <code>java.io.File</code> - for directories, recursively delete any nested directories or files as well
deleteRecursively
{ "repo_name": "dharmendrak/fsriver", "path": "src/test/java/fr/pilato/elasticsearch/river/fs/util/FsUtils.java", "license": "apache-2.0", "size": 2979 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,968,643
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<VirtualMachineInner>> listByLocationSinglePageAsync(String location, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( ...
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<VirtualMachineInner>> function(String location, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (location == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.c...
/** * Gets all the virtual machines under the specified subscription for the specified location. * * @param location The location for which virtual machines under the subscription are queried. * @param context The context to associate with this operation. * @throws IllegalArgumentException thro...
Gets all the virtual machines under the specified subscription for the specified location
listByLocationSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/implementation/VirtualMachinesClientImpl.java", "license": "mit", "size": 333925 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.Context", "com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.compute.fluent.models.VirtualMachineInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.compute.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
902,556
public ServiceResult<List<Permission>> findAllPermissions();
ServiceResult<List<Permission>> function();
/** * Find all permissions * * @return */
Find all permissions
findAllPermissions
{ "repo_name": "christopher-worley/common-app", "path": "core-commonapp-service-api/src/main/java/core/commonapp/client/service/security/SecurityService.java", "license": "lgpl-3.0", "size": 1274 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,103,186
ContentItemQuery createdDateAfter(Date afterTime);
ContentItemQuery createdDateAfter(Date afterTime);
/** * Only select content items created after the given time */
Only select content items created after the given time
createdDateAfter
{ "repo_name": "marcus-nl/flowable-engine", "path": "modules/flowable-content-api/src/main/java/org/flowable/content/api/ContentItemQuery.java", "license": "apache-2.0", "size": 6374 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,827,393
@Override public CoordinateReferenceSystem getCoordinateSystemReproject() { return null; } /** * Always returns {@link SortBy#UNSORTED}. * * @return {@link SortBy#UNSORTED}
CoordinateReferenceSystem function() { return null; } /** * Always returns {@link SortBy#UNSORTED}. * * @return {@link SortBy#UNSORTED}
/** * Return <code>null</code> as FIDSQuery does not require a CS. * * @return <code>null</code> as reprojection is not required. * @see org.geotools.data.Query#getCoordinateSystemReproject() */
Return <code>null</code> as FIDSQuery does not require a CS
getCoordinateSystemReproject
{ "repo_name": "geotools/geotools", "path": "modules/library/main/src/main/java/org/geotools/data/FIDSQuery.java", "license": "lgpl-2.1", "size": 12058 }
[ "org.opengis.filter.sort.SortBy", "org.opengis.referencing.crs.CoordinateReferenceSystem" ]
import org.opengis.filter.sort.SortBy; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.filter.sort.*; import org.opengis.referencing.crs.*;
[ "org.opengis.filter", "org.opengis.referencing" ]
org.opengis.filter; org.opengis.referencing;
1,006,794
public List<AndesRemovableMetadata> getExpiredMessages(int limit) throws AndesException;
List<AndesRemovableMetadata> function(int limit) throws AndesException;
/** * get expired messages from store * * @param limit max num of messages to read * @return AndesRemovableMetadata * @throws AndesException */
get expired messages from store
getExpiredMessages
{ "repo_name": "AnujaLK/andes", "path": "modules/andes-core/broker/src/main/java/org/wso2/andes/kernel/MessageStore.java", "license": "apache-2.0", "size": 12696 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,487,600
public static void pull(Path repositoryDirectory, String username, String password) { pull(repositoryDirectory, username, password, null); }
static void function(Path repositoryDirectory, String username, String password) { pull(repositoryDirectory, username, password, null); }
/** * Pull modifications from the default branch a git repository. * * @param repositoryDirectory The directory in which the git repo exists. * @param username The username for the git repository connection, null if none. * @param password The password for the git repository connection, null if...
Pull modifications from the default branch a git repository
pull
{ "repo_name": "san-tak/alien4cloud", "path": "alien4cloud-common/src/main/java/alien4cloud/git/RepositoryManager.java", "license": "apache-2.0", "size": 36696 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
1,061,662
public int getUInt16(int index) throws IOException { validateIndex(index, 2); if (_isMotorolaByteOrder) { // Motorola - MSB first return (getByte(index ) << 8 & 0xFF00) | (getByte(index + 1) & 0xFF); } else { // Intel orderi...
int function(int index) throws IOException { validateIndex(index, 2); if (_isMotorolaByteOrder) { return (getByte(index ) << 8 & 0xFF00) (getByte(index + 1) & 0xFF); } else { return (getByte(index + 1) << 8 & 0xFF00) (getByte(index ) & 0xFF); } }
/** * Returns an unsigned 16-bit int calculated from two bytes of data at the specified index. * * @param index position within the data buffer to read first byte * @return the 16 bit int value, between 0x0000 and 0xFFFF * @throws IOException the buffer does not contain enough bytes to service ...
Returns an unsigned 16-bit int calculated from two bytes of data at the specified index
getUInt16
{ "repo_name": "Nadahar/metadata-extractor", "path": "Source/com/drew/lang/RandomAccessReader.java", "license": "apache-2.0", "size": 17891 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,835,183
public static <E> void printPreOrderLabeled(Tree<E> tree, Position<E> position, List<Integer> path) { int depth = path.size(); // depth equals the length of the path System.out.print(spaces(2 * depth)); for (int j = 0; j < depth; j++) { System.out.print(path.get(j) + (j == depth - 1 ...
static <E> void function(Tree<E> tree, Position<E> position, List<Integer> path) { int depth = path.size(); System.out.print(spaces(2 * depth)); for (int j = 0; j < depth; j++) { System.out.print(path.get(j) + (j == depth - 1 ? " " : ".")); } System.out.println(position.getElement()); path.add(1); for (Position<E> chil...
/** * Prints labeled representation of subtree of the tree rooted at a position having a depth. * * @param <E> * @param tree * @param position * @param path */
Prints labeled representation of subtree of the tree rooted at a position having a depth
printPreOrderLabeled
{ "repo_name": "rogeriogentil/data-structures-and-algorithms", "path": "src/main/java/rogeriogentil/data/structures/chapter08/TreeUtil.java", "license": "gpl-3.0", "size": 3378 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,376,802
public static void saveJson(File json, Object object) throws IOException { objectMapper.writer().writeValue(json, object); }
static void function(File json, Object object) throws IOException { objectMapper.writer().writeValue(json, object); }
/** * Saves the json object to the given file */
Saves the json object to the given file
saveJson
{ "repo_name": "aslakknutsen/fabric8", "path": "components/kubernetes-api/src/main/java/io/fabric8/kubernetes/api/KubernetesHelper.java", "license": "apache-2.0", "size": 25210 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
724,856
public void deleteUser(User toDelete) { for (Course c : userService.getAllCourses(toDelete)) { Lecturer lec = c.getLecturerFromUser(toDelete); PrivilegedUser priv = c.getPrivilegedUserFromUser(toDelete); Student stud = c.getStudentFromUser(toDelete); if (lec ...
void function(User toDelete) { for (Course c : userService.getAllCourses(toDelete)) { Lecturer lec = c.getLecturerFromUser(toDelete); PrivilegedUser priv = c.getPrivilegedUserFromUser(toDelete); Student stud = c.getStudentFromUser(toDelete); if (lec != null) { lec.setDeleted(true); } if (priv != null) { priv.setDeleted...
/** * Deletes a user by overwriting all of his/her attributes. * This is beneficial for not destroying many relations by deleting this * user completely. This method overloads the deleteUser method of this * class. * * @param toDelete the user to be deleted */
Deletes a user by overwriting all of his/her attributes. This is beneficial for not destroying many relations by deleting this user completely. This method overloads the deleteUser method of this class
deleteUser
{ "repo_name": "stefanoberdoerfer/exmatrikulator", "path": "src/main/java/de/unibremen/opensores/controller/admin/UserOverviewController.java", "license": "agpl-3.0", "size": 25963 }
[ "de.unibremen.opensores.model.Course", "de.unibremen.opensores.model.Lecturer", "de.unibremen.opensores.model.PrivilegedUser", "de.unibremen.opensores.model.Student", "de.unibremen.opensores.model.User", "org.apache.commons.lang3.RandomStringUtils" ]
import de.unibremen.opensores.model.Course; import de.unibremen.opensores.model.Lecturer; import de.unibremen.opensores.model.PrivilegedUser; import de.unibremen.opensores.model.Student; import de.unibremen.opensores.model.User; import org.apache.commons.lang3.RandomStringUtils;
import de.unibremen.opensores.model.*; import org.apache.commons.lang3.*;
[ "de.unibremen.opensores", "org.apache.commons" ]
de.unibremen.opensores; org.apache.commons;
94,730
public static FeatureConfiguration configureFeatures(RuleContext ruleContext) { return configureFeatures(ruleContext, ImmutableSet.<String>of(), ImmutableSet.<String>of()); }
static FeatureConfiguration function(RuleContext ruleContext) { return configureFeatures(ruleContext, ImmutableSet.<String>of(), ImmutableSet.<String>of()); }
/** * Creates a feature configuration for a given rule. * * @param ruleContext the context of the rule we want the feature configuration for. * @return the feature configuration for the given {@code ruleContext}. */
Creates a feature configuration for a given rule
configureFeatures
{ "repo_name": "charlieaustin/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java", "license": "apache-2.0", "size": 28879 }
[ "com.google.common.collect.ImmutableSet", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures" ]
import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures;
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.cpp.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
2,257,300
public void setChannelLogTable( ChannelLogTable channelLogTable ) { this.channelLogTable = channelLogTable; }
void function( ChannelLogTable channelLogTable ) { this.channelLogTable = channelLogTable; }
/** * Sets the channel log table for the job. * * @param channelLogTable the channelLogTable to set */
Sets the channel log table for the job
setChannelLogTable
{ "repo_name": "Advent51/pentaho-kettle", "path": "engine/src/main/java/org/pentaho/di/base/AbstractMeta.java", "license": "apache-2.0", "size": 54941 }
[ "org.pentaho.di.core.logging.ChannelLogTable" ]
import org.pentaho.di.core.logging.ChannelLogTable;
import org.pentaho.di.core.logging.*;
[ "org.pentaho.di" ]
org.pentaho.di;
81,809
@Test public void testToSet() { final Set<String> expected = new TreeSet<String>(Arrays.asList("e1", "e2", "e3", "e4", "e5")); final String[] target = new String[] { "e1", "e2", "e3", "e4", "e5" }; Assert.assertEquals(new TreeSet<String>(expected), CollectionUtil.toSet(TreeSet.class, ta...
void function() { final Set<String> expected = new TreeSet<String>(Arrays.asList("e1", "e2", "e3", "e4", "e5")); final String[] target = new String[] { "e1", "e2", "e3", "e4", "e5" }; Assert.assertEquals(new TreeSet<String>(expected), CollectionUtil.toSet(TreeSet.class, target)); }
/** * Tests {@link CollectionUtil#toSet(Class, Object...)}. * */
Tests <code>CollectionUtil#toSet(Class, Object...)</code>
testToSet
{ "repo_name": "Blockhaus2000/InternalPluginManager", "path": "internalpluginmanager-base-api/src/test/java/com/blockhaus2000/ipm/base/CollectionUtilTest.java", "license": "gpl-3.0", "size": 3371 }
[ "java.util.Arrays", "java.util.Set", "java.util.TreeSet", "org.junit.Assert" ]
import java.util.Arrays; import java.util.Set; import java.util.TreeSet; import org.junit.Assert;
import java.util.*; import org.junit.*;
[ "java.util", "org.junit" ]
java.util; org.junit;
649,425
public void pushMessage(IMessage message) throws IOException { if (log.isDebugEnabled()) { log.debug("pushMessage: {} to {} consumers", message, consumers.size()); } for (IConsumer consumer : consumers) { try { ((IPushableConsumer) consumer).pushMessag...
void function(IMessage message) throws IOException { if (log.isDebugEnabled()) { log.debug(STR, message, consumers.size()); } for (IConsumer consumer : consumers) { try { ((IPushableConsumer) consumer).pushMessage(this, message); } catch (Throwable t) { if (t instanceof IOException) { throw (IOException) t; } log.error...
/** * Pushes a message out to all the PushableConsumers. * * @param message * the message to be pushed to consumers * @throws IOException * In case IOException of some sort is occurred */
Pushes a message out to all the PushableConsumers
pushMessage
{ "repo_name": "Red5/red5-server-common", "path": "src/main/java/org/red5/server/messaging/InMemoryPushPushPipe.java", "license": "apache-2.0", "size": 3718 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
992,439
@Override public void updateUI() { super.updateUI(); if (tree != null) { tree.updateUI(); } // Use the tree's default foreground and background colors in the // table. LookAndFeel.installColorsAndFont(this, "Tree.background", ...
void function() { super.updateUI(); if (tree != null) { tree.updateUI(); } LookAndFeel.installColorsAndFont(this, STR, STR, STR); }
/** * Overridden to message super and forward the method to the tree. * Since the tree is not actually in the component hierarchy it will * never receive this unless we forward it in this manner. */
Overridden to message super and forward the method to the tree. Since the tree is not actually in the component hierarchy it will never receive this unless we forward it in this manner
updateUI
{ "repo_name": "maikelsteneker/checkstyle-throwsIndent", "path": "src/checkstyle/com/puppycrawl/tools/checkstyle/gui/JTreeTable.java", "license": "lgpl-2.1", "size": 18801 }
[ "javax.swing.LookAndFeel" ]
import javax.swing.LookAndFeel;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
2,645,887
public MediaContainer retrieveSections() throws Exception { String sectionsURL = resourcePath.getSectionsURL(); MediaContainer mediaContainer = serializeResource(sectionsURL); return mediaContainer; }
MediaContainer function() throws Exception { String sectionsURL = resourcePath.getSectionsURL(); MediaContainer mediaContainer = serializeResource(sectionsURL); return mediaContainer; }
/** * This retrieves the available libraries. This can include such * things as Movies, and TV shows. * * @return MediaContainer the media container for the library * @throws Exception */
This retrieves the available libraries. This can include such things as Movies, and TV shows
retrieveSections
{ "repo_name": "0359xiaodong/serenity-android", "path": "plexapp-rest-library/src/main/java/us/nineworlds/plex/rest/PlexappFactory.java", "license": "mit", "size": 9303 }
[ "us.nineworlds.plex.rest.model.impl.MediaContainer" ]
import us.nineworlds.plex.rest.model.impl.MediaContainer;
import us.nineworlds.plex.rest.model.impl.*;
[ "us.nineworlds.plex" ]
us.nineworlds.plex;
1,610,768
@JsonIgnore public String[] getTagsAsArray() { lockTags.lock(); try { Set<String> tags = tagsAsList(); return tags.toArray(ArrayUtils.EMPTY_STRING_ARRAY); } finally { lockTags.unlock(); } }
String[] function() { lockTags.lock(); try { Set<String> tags = tagsAsList(); return tags.toArray(ArrayUtils.EMPTY_STRING_ARRAY); } finally { lockTags.unlock(); } }
/** * Gets all tags as an array of {@code String}s. * * @return */
Gets all tags as an array of Strings
getTagsAsArray
{ "repo_name": "DDTH/djs-commons", "path": "src/main/java/com/github/ddth/djs/bo/job/JobInfoBo.java", "license": "mit", "size": 9439 }
[ "java.util.Set", "org.apache.commons.lang3.ArrayUtils" ]
import java.util.Set; import org.apache.commons.lang3.ArrayUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,479,835
public void testNoOpCommunicationErrorResolve_4() throws Exception { testCommSpi = true; sesTimeout = 2000; commFailureRslvr = NoOpCommunicationFailureResolver.FACTORY; startGrid(0); startGridsMultiThreaded(1, 3); ZkTestCommunicationSpi commSpi = ZkTestCommunicati...
void function() throws Exception { testCommSpi = true; sesTimeout = 2000; commFailureRslvr = NoOpCommunicationFailureResolver.FACTORY; startGrid(0); startGridsMultiThreaded(1, 3); ZkTestCommunicationSpi commSpi = ZkTestCommunicationSpi.testSpi(ignite(3)); commSpi.pingLatch = new CountDownLatch(1);
/** * Tests case when Coordinator fails while resolve process is in progress. * * @throws Exception If failed. */
Tests case when Coordinator fails while resolve process is in progress
testNoOpCommunicationErrorResolve_4
{ "repo_name": "SharplEr/ignite", "path": "modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java", "license": "apache-2.0", "size": 156332 }
[ "java.util.concurrent.CountDownLatch" ]
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,605,274
@Test public void testAutomatedMultimatch() throws GraphException { final GraphPolicyRule rule = newRule("I:Instrument[E].filter = Filter[I], I.otf = OTF[I]", "I:[I]"); final GraphPolicy policy = GraphPolicyRule.parseRules(mockGraphPathBean, ImmutableSet.<GraphPolicyRule>of(rule)); final...
void function() throws GraphException { final GraphPolicyRule rule = newRule(STR, "I:[I]"); final GraphPolicy policy = GraphPolicyRule.parseRules(mockGraphPathBean, ImmutableSet.<GraphPolicyRule>of(rule)); final Details detailsInstrument = new MockDetails(new Instrument(), Action.EXCLUDE, Orphan.IRRELEVANT, true, true,...
/** * Check that multimatch detection triggers with a mutimatch rule. * @throws GraphException unexpected */
Check that multimatch detection triggers with a mutimatch rule
testAutomatedMultimatch
{ "repo_name": "knabar/openmicroscopy", "path": "components/server/test/ome/services/graphs/GraphPolicyRuleTest.java", "license": "gpl-2.0", "size": 54291 }
[ "com.google.common.collect.ImmutableMap", "com.google.common.collect.ImmutableSet", "java.util.Set", "org.testng.Assert" ]
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.Set; import org.testng.Assert;
import com.google.common.collect.*; import java.util.*; import org.testng.*;
[ "com.google.common", "java.util", "org.testng" ]
com.google.common; java.util; org.testng;
1,234,067
public Rational divide(Rational otherValue) { if (otherValue.numerator.equals(BigInteger.ZERO)) throw new IllegalArgumentException("Attempt to divide by a Rational that is 0!"); BigInteger myNumOtherDenomGcd = this.numerator.gcd(otherValue.numerator); BigInteger otherNumMyDenomGcd = otherValue.denominator.g...
Rational function(Rational otherValue) { if (otherValue.numerator.equals(BigInteger.ZERO)) throw new IllegalArgumentException(STR); BigInteger myNumOtherDenomGcd = this.numerator.gcd(otherValue.numerator); BigInteger otherNumMyDenomGcd = otherValue.denominator.gcd(this.denominator); return new Rational( this.numerator....
/** * Divides this rational number by another rational number and returns a new instance of <code>Rational</code>. This number itself * is not modified during this calculation. * @param otherValue The second argument of the division. * @return A new instance of <code>Rational</code> representing the result. *...
Divides this rational number by another rational number and returns a new instance of <code>Rational</code>. This number itself is not modified during this calculation
divide
{ "repo_name": "breitwieser/cx3d-cpp", "path": "src/main/java/ini/cx3d/parallelSpatialOrganization/Rational.java", "license": "gpl-3.0", "size": 11798 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
640,825
private Date parseDate(String messageString) throws ContentException { int timestampPosition = messageString.indexOf("data-timestamp=\""); if (timestampPosition < 0) { throw new ContentException("malformed response: " + messageString); } timestampPosition += 16; ...
Date function(String messageString) throws ContentException { int timestampPosition = messageString.indexOf(STRSTRmalformed response: STR', timestampPosition))) * 1000L); }
/** * This method parses the timestamp from a raw message, and returns it as a Date. * * @param messageString the raw message string parsed by splitMessage * @return A Date representing the moment this message has been sent. * @throws ContentException */
This method parses the timestamp from a raw message, and returns it as a Date
parseDate
{ "repo_name": "nerdzeu/nerdzapi-java-impl", "path": "src/eu/nerdz/api/impl/reverse/messages/ReverseConversationHandler.java", "license": "gpl-3.0", "size": 19480 }
[ "eu.nerdz.api.ContentException", "java.util.Date" ]
import eu.nerdz.api.ContentException; import java.util.Date;
import eu.nerdz.api.*; import java.util.*;
[ "eu.nerdz.api", "java.util" ]
eu.nerdz.api; java.util;
1,711,130
private void ackClassPaths(RuntimeMXBean rtBean) { assert log != null; // Ack all class paths. if (log.isDebugEnabled()) { log.debug("Boot class path: " + rtBean.getBootClassPath()); log.debug("Class path: " + rtBean.getClassPath()); log.debug("Library pa...
void function(RuntimeMXBean rtBean) { assert log != null; if (log.isDebugEnabled()) { log.debug(STR + rtBean.getBootClassPath()); log.debug(STR + rtBean.getClassPath()); log.debug(STR + rtBean.getLibraryPath()); } }
/** * Prints out class paths in debug mode. * * @param rtBean Java runtime bean. */
Prints out class paths in debug mode
ackClassPaths
{ "repo_name": "VladimirErshov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java", "license": "apache-2.0", "size": 111511 }
[ "java.lang.management.RuntimeMXBean" ]
import java.lang.management.RuntimeMXBean;
import java.lang.management.*;
[ "java.lang" ]
java.lang;
155,523
public void testBadTypeDefInterfaceAndStructuralTyping4() throws Exception { JSDocInfo jsdoc = parse("@interface\n@record*/", "Bad type annotation. conflicting @record tag"); }
void function() throws Exception { JSDocInfo jsdoc = parse(STR, STR); }
/** * test structural interface matching */
test structural interface matching
testBadTypeDefInterfaceAndStructuralTyping4
{ "repo_name": "mneise/closure-compiler", "path": "test/com/google/javascript/jscomp/parsing/JsDocInfoParserTest.java", "license": "apache-2.0", "size": 160487 }
[ "com.google.javascript.rhino.JSDocInfo" ]
import com.google.javascript.rhino.JSDocInfo;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
255,336
protected void initializeEditingDomain() { // Create an adapter factory that yields item providers. // adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFact...
void function() { adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new BaseItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new DistributionItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory(...
/** * This sets up the editing domain for the model editor. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This sets up the editing domain for the model editor.
initializeEditingDomain
{ "repo_name": "aciancone/klapersuite", "path": "klapersuite.metamodel.simjava.editor/src/simulator/base/presentation/BaseEditor.java", "license": "epl-1.0", "size": 53739 }
[ "org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory", "org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory" ]
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.*; import org.eclipse.emf.edit.provider.resource.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
715,406
private void onAddAttachment() { if (K9.isGalleryBuggy()) { if (K9.useGalleryBugWorkaround()) { Toast.makeText(MessageCompose.this, getString(R.string.message_compose_use_workaround), Toast.LENGTH_LONG).show(); ...
void function() { if (K9.isGalleryBuggy()) { if (K9.useGalleryBugWorkaround()) { Toast.makeText(MessageCompose.this, getString(R.string.message_compose_use_workaround), Toast.LENGTH_LONG).show(); } else { Toast.makeText(MessageCompose.this, getString(R.string.message_compose_buggy_gallery), Toast.LENGTH_LONG).show(); }...
/** * Kick off a picker for whatever kind of MIME types we'll accept and let Android take over. */
Kick off a picker for whatever kind of MIME types we'll accept and let Android take over
onAddAttachment
{ "repo_name": "hoverkey/honeybee", "path": "sdk/examples/k9mail/src/com/fsck/k9/activity/MessageCompose.java", "license": "lgpl-3.0", "size": 152924 }
[ "android.widget.Toast" ]
import android.widget.Toast;
import android.widget.*;
[ "android.widget" ]
android.widget;
2,710,611
public static void insertValue(HashMap m, String var, String val, String path) { insertValue(m, var, val, path, false); }
static void function(HashMap m, String var, String val, String path) { insertValue(m, var, val, path, false); }
/** * Inserts the variable in the appropriate place in a {@link HashMap}, * according to the AcePathfinder. * * @param m the HashMap to add the variable to. * @param var the variable to lookup in the AcePathfinder * @param val the value to insert into the HashMap * @param path use a c...
Inserts the variable in the appropriate place in a <code>HashMap</code>, according to the AcePathfinder
insertValue
{ "repo_name": "agmip/ace-lookup", "path": "src/main/java/org/agmip/ace/util/AcePathfinderUtil.java", "license": "bsd-3-clause", "size": 13013 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,419,897
// does the fasta file exist? check that first... if (!fastaFile.exists()) throw new UserException("The fasta file you specified (" + fastaFile.getAbsolutePath() + ") does not exist."); final boolean isGzipped = fastaFile.getAbsolutePath().endsWith(".gz"); if ( isGzipped ) { ...
if (!fastaFile.exists()) throw new UserException(STR + fastaFile.getAbsolutePath() + STR); final boolean isGzipped = fastaFile.getAbsolutePath().endsWith(".gz"); if ( isGzipped ) { throw new UserException.CannotHandleGzippedRef(); } final File indexFile = new File(fastaFile.getAbsolutePath() + ".fai"); final String fas...
/** * Create reference data source from fasta file, after performing several preliminary checks on the file. * This static utility was refactored from the constructor of ReferenceDataSource. * Possibly may be better as an overloaded constructor. * @param fastaFile Fasta file to be used as reference ...
Create reference data source from fasta file, after performing several preliminary checks on the file. This static utility was refactored from the constructor of ReferenceDataSource. Possibly may be better as an overloaded constructor
checkAndCreate
{ "repo_name": "davidadamsphd/hellbender", "path": "src/main/java/org/broadinstitute/hellbender/utils/fasta/CachingIndexedFastaSequenceFile.java", "license": "bsd-3-clause", "size": 13749 }
[ "java.io.File", "java.io.FileNotFoundException", "org.broadinstitute.hellbender.exceptions.UserException" ]
import java.io.File; import java.io.FileNotFoundException; import org.broadinstitute.hellbender.exceptions.UserException;
import java.io.*; import org.broadinstitute.hellbender.exceptions.*;
[ "java.io", "org.broadinstitute.hellbender" ]
java.io; org.broadinstitute.hellbender;
2,850,435
public CharSequence getJavaScriptOptions() { StringBuilder sb = new StringBuilder(); this.optionsRenderer.renderBefore(sb); int count = 0; for (Entry<String, Object> entry : options.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof IModelOption< ? >)...
CharSequence function() { StringBuilder sb = new StringBuilder(); this.optionsRenderer.renderBefore(sb); int count = 0; for (Entry<String, Object> entry : options.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); if (value instanceof IModelOption< ? >) value = ((IModelOption< ? >) value).wrapO...
/** * Returns the JavaScript statement corresponding to options. */
Returns the JavaScript statement corresponding to options
getJavaScriptOptions
{ "repo_name": "downloadsha3by/wiquery", "path": "wiquery-core/src/main/java/org/odlabs/wiquery/core/options/Options.java", "license": "mit", "size": 14965 }
[ "java.util.Map", "org.odlabs.wiquery.core.javascript.JsScope" ]
import java.util.Map; import org.odlabs.wiquery.core.javascript.JsScope;
import java.util.*; import org.odlabs.wiquery.core.javascript.*;
[ "java.util", "org.odlabs.wiquery" ]
java.util; org.odlabs.wiquery;
2,469,984
@Nullable public Collection<ClusterNode> topology(long topVer) { if (!histSupported) throw new UnsupportedOperationException("Current discovery SPI does not support " + "topology snapshots history (consider using TCP discovery SPI)."); Map<Long, Collection<ClusterNode>> ...
@Nullable Collection<ClusterNode> function(long topVer) { if (!histSupported) throw new UnsupportedOperationException(STR + STR); Map<Long, Collection<ClusterNode>> snapshots = topHist; Collection<ClusterNode> nodes = snapshots.get(topVer); if (nodes == null) { DiscoCache cache = discoCacheHist.get(new AffinityTopology...
/** * Gets topology by specified version from history storage. * * @param topVer Topology version. * @return Topology nodes or {@code null} if there are no nodes for passed in version. */
Gets topology by specified version from history storage
topology
{ "repo_name": "chandresh-pancholi/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java", "license": "apache-2.0", "size": 138014 }
[ "java.util.Collection", "java.util.Map", "org.apache.ignite.cluster.ClusterNode", "org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion", "org.jetbrains.annotations.Nullable" ]
import java.util.Collection; import java.util.Map; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.jetbrains.annotations.Nullable;
import java.util.*; import org.apache.ignite.cluster.*; import org.apache.ignite.internal.processors.affinity.*; import org.jetbrains.annotations.*;
[ "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.util; org.apache.ignite; org.jetbrains.annotations;
2,203,934
public static boolean enableHelp(Component component, String helpId) { Guardian.assertNotNull("component", component); Guardian.assertNotNull("helpId", helpId); if (getHelpSet() == null || !isValidID(helpId)) { return false; } getHelpBroker().enableHelp(component,...
static boolean function(Component component, String helpId) { Guardian.assertNotNull(STR, component); Guardian.assertNotNull(STR, helpId); if (getHelpSet() == null !isValidID(helpId)) { return false; } getHelpBroker().enableHelp(component, helpId, getHelpSet()); return true; }
/** * Enables help for a component. Convenience method which delegates to the held help broker, if ther is any, an * applies the help set from the help broker and the help id to the given component. * * @param component the component to which the help id should applied * @param helpId the he...
Enables help for a component. Convenience method which delegates to the held help broker, if ther is any, an applies the help set from the help broker and the help id to the given component
enableHelp
{ "repo_name": "lveci/nest", "path": "beam/beam-ui/src/main/java/org/esa/beam/framework/help/HelpSys.java", "license": "gpl-3.0", "size": 7141 }
[ "java.awt.Component", "org.esa.beam.util.Guardian" ]
import java.awt.Component; import org.esa.beam.util.Guardian;
import java.awt.*; import org.esa.beam.util.*;
[ "java.awt", "org.esa.beam" ]
java.awt; org.esa.beam;
1,506,146
@Override protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); }
void function(int xCoord, int yCoord, int zCoord, Block stepBlock) { this.worldObj.playSoundAtEntity(this, STR, 1.0F, 1.0F); }
/** * Plays step sound at given x, y, z for the entity */
Plays step sound at given x, y, z for the entity
func_145780_a
{ "repo_name": "soultek101/projectzulu1.7.10", "path": "src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityLizard.java", "license": "lgpl-2.1", "size": 6385 }
[ "net.minecraft.block.Block" ]
import net.minecraft.block.Block;
import net.minecraft.block.*;
[ "net.minecraft.block" ]
net.minecraft.block;
2,439,079
public static String getResourceString(String key) { ResourceBundle bundle = OALEditorPlugin.getDefaultOALPlugin().getResourceBundle(); try { return bundle.getString(key); } catch (MissingResourceException e) { return key; } }
static String function(String key) { ResourceBundle bundle = OALEditorPlugin.getDefaultOALPlugin().getResourceBundle(); try { return bundle.getString(key); } catch (MissingResourceException e) { return key; } }
/** * Returns the string from the plugin's resource bundle, * or 'key' if not found. */
Returns the string from the plugin's resource bundle, or 'key' if not found
getResourceString
{ "repo_name": "HebaKhaled/bposs", "path": "src/com.mentor.nucleus.bp.ui.text/src/com/mentor/nucleus/bp/ui/text/OALEditorPlugin.java", "license": "apache-2.0", "size": 3453 }
[ "java.util.MissingResourceException", "java.util.ResourceBundle" ]
import java.util.MissingResourceException; import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
433,729
public void setSlope(GMetricSlope slope) { this.slope = slope; }
void function(GMetricSlope slope) { this.slope = slope; }
/** * The slope */
The slope
setSlope
{ "repo_name": "jmandawg/camel", "path": "components/camel-ganglia/src/main/java/org/apache/camel/component/ganglia/GangliaConfiguration.java", "license": "apache-2.0", "size": 8036 }
[ "info.ganglia.gmetric4j.gmetric.GMetricSlope" ]
import info.ganglia.gmetric4j.gmetric.GMetricSlope;
import info.ganglia.gmetric4j.gmetric.*;
[ "info.ganglia.gmetric4j" ]
info.ganglia.gmetric4j;
2,652,629
public String getAttribute(String name, String attribute) { if (name == null || attribute == null) { return null; } String[] propName = parsePropertyName(name); // Search for this property by traversing down the XML heirarchy. Element element = document.getR...
String function(String name, String attribute) { if (name == null attribute == null) { return null; } String[] propName = parsePropertyName(name); Element element = document.getRootElement(); for (String child : propName) { element = element.element(child); if (element == null) { break; } } if (element != null) { retur...
/** * Returns the value of the attribute of the given property name or <tt>null</tt> * if it doesn't exist. Note, this * * @param name the property name to lookup - ie, "foo.bar" * @param attribute the name of the attribute, ie "id" * @return the value of the attribute of the given p...
Returns the value of the attribute of the given property name or null if it doesn't exist. Note, this
getAttribute
{ "repo_name": "GinRyan/OpenFireMODxmppServer", "path": "src/java/org/jivesoftware/util/XMLProperties.java", "license": "apache-2.0", "size": 24737 }
[ "org.dom4j.Element" ]
import org.dom4j.Element;
import org.dom4j.*;
[ "org.dom4j" ]
org.dom4j;
810,010
public void updateActivity(Activity newActivity) { if (this.activity != newActivity) { this.activity = newActivity; hideProgressDialog(); } }
void function(Activity newActivity) { if (this.activity != newActivity) { this.activity = newActivity; hideProgressDialog(); } }
/** * Sets a new {@link Activity} for the {@link ProgressDialog}. * * @param newActivity * can be <code>null</code> */
Sets a new <code>Activity</code> for the <code>ProgressDialog</code>
updateActivity
{ "repo_name": "schnatterer/nusic", "path": "nusic-ui-android/src/main/java/info/schnatterer/nusic/android/LoadNewRelasesServiceBinding.java", "license": "gpl-3.0", "size": 12045 }
[ "android.app.Activity" ]
import android.app.Activity;
import android.app.*;
[ "android.app" ]
android.app;
1,752,332
@Override public T visitUnsignedNumber(@NotNull LabeledExprParser.UnsignedNumberContext ctx) { return visitChildren(ctx); }
@Override public T visitUnsignedNumber(@NotNull LabeledExprParser.UnsignedNumberContext ctx) { return visitChildren(ctx); }
/** * {@inheritDoc} * * <p>The default implementation returns the result of calling * {@link #visitChildren} on {@code ctx}.</p> */
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
visitExpression
{ "repo_name": "SokolAndrey/PascalCompiler", "path": "PascalCompiler/LabeledExprBaseVisitor.java", "license": "gpl-2.0", "size": 5242 }
[ "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;
208,511
@ApiModelProperty(example = "null", value = "date when this configuration values expire") public DateTime getExpirationDate() { return expirationDate; }
@ApiModelProperty(example = "null", value = STR) DateTime function() { return expirationDate; }
/** * date when this configuration values expire * @return expirationDate **/
date when this configuration values expire
getExpirationDate
{ "repo_name": "Avalara/avataxbr-clients", "path": "java-client/src/main/java/io/swagger/client/model/IcmsConfByState.java", "license": "gpl-3.0", "size": 16453 }
[ "io.swagger.annotations.ApiModelProperty", "org.joda.time.DateTime" ]
import io.swagger.annotations.ApiModelProperty; import org.joda.time.DateTime;
import io.swagger.annotations.*; import org.joda.time.*;
[ "io.swagger.annotations", "org.joda.time" ]
io.swagger.annotations; org.joda.time;
511,823
@Test public void testConvertBytesToPrintFriendlyStringWithStartAndEndPositions() throws Exception { assertEquals(Hl7Util.NULL_REPLACEMENT_VALUE, Hl7Util.convertToPrintFriendlyString((byte[]) null, 0, 1000)); assertEquals(Hl7Util.NULL_REPLACEMENT_VALUE, Hl7Util.convertToPrintFriendlyString((byte...
void function() throws Exception { assertEquals(Hl7Util.NULL_REPLACEMENT_VALUE, Hl7Util.convertToPrintFriendlyString((byte[]) null, 0, 1000)); assertEquals(Hl7Util.NULL_REPLACEMENT_VALUE, Hl7Util.convertToPrintFriendlyString((byte[]) null, 200, 1000)); assertEquals(Hl7Util.NULL_REPLACEMENT_VALUE, Hl7Util.convertToPrint...
/** * Description of test. * * @throws Exception in the event of a test error. */
Description of test
testConvertBytesToPrintFriendlyStringWithStartAndEndPositions
{ "repo_name": "curso007/camel", "path": "components/camel-mllp/src/test/java/org/apache/camel/component/mllp/internal/Hl7UtilTest.java", "license": "apache-2.0", "size": 34877 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
354,882
boolean isPartnerReviewAdded = false; reviewDAO = new ReviewDAO(); Date systemDate = new Date(); Timestamp date = new Timestamp(systemDate.getTime()); review.setReviewDate(date); isPartnerReviewAdded = reviewDAO.addPartnerReview(review); return isPartnerReviewAdded; }
boolean isPartnerReviewAdded = false; reviewDAO = new ReviewDAO(); Date systemDate = new Date(); Timestamp date = new Timestamp(systemDate.getTime()); review.setReviewDate(date); isPartnerReviewAdded = reviewDAO.addPartnerReview(review); return isPartnerReviewAdded; }
/** * Adds a review by a customer of a partner * @param review the review to add * @return true if success, false else */
Adds a review by a customer of a partner
addPartnerReview
{ "repo_name": "elliottpost/comp433-project", "path": "src/com/online/lakeshoremarket/domain/ReviewDomain.java", "license": "gpl-2.0", "size": 1304 }
[ "com.online.lakeshoremarket.dao.ReviewDAO", "java.sql.Timestamp", "java.util.Date" ]
import com.online.lakeshoremarket.dao.ReviewDAO; import java.sql.Timestamp; import java.util.Date;
import com.online.lakeshoremarket.dao.*; import java.sql.*; import java.util.*;
[ "com.online.lakeshoremarket", "java.sql", "java.util" ]
com.online.lakeshoremarket; java.sql; java.util;
2,231,854
@Override public String getCreateChildText(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; boolean qualify = childFeature == MapperPackage.Literals.MAPPING_CONDITION__LEFT_PATH_CONDITIONS || childFeature == MapperP...
String function(Object owner, Object feature, Object child, Collection<?> selection) { Object childFeature = feature; Object childObject = child; boolean qualify = childFeature == MapperPackage.Literals.MAPPING_CONDITION__LEFT_PATH_CONDITIONS childFeature == MapperPackage.Literals.CROSS_CONDITION__RIGHT_PATH_CONDITIONS...
/** * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the label text for <code>org.eclipse.emf.edit.command.CreateChildCommand</code>.
getCreateChildText
{ "repo_name": "openmapsoftware/mappingtools", "path": "openmap-mapper-edit/src/main/java/com/openMap1/mapper/provider/CrossConditionItemProvider.java", "license": "epl-1.0", "size": 7880 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
752,860
generate(pixmap, 128, 64, Color.WHITE, 0, 0); }
generate(pixmap, 128, 64, Color.WHITE, 0, 0); }
/** * Single operation process * * @param pixmap */
Single operation process
generate
{ "repo_name": "shadoq/s3GdxProcTexture", "path": "src/net/shad/s3rend/gfx/pixmap/procedural/Cell.java", "license": "apache-2.0", "size": 4836 }
[ "com.badlogic.gdx.graphics.Color" ]
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
1,063,618
Set<String> getSubSchemaNames();
Set<String> getSubSchemaNames();
/** * Returns the names of this schema's child schemas. * * @return Names of this schema's child schemas */
Returns the names of this schema's child schemas
getSubSchemaNames
{ "repo_name": "datametica/calcite", "path": "core/src/main/java/org/apache/calcite/schema/Schema.java", "license": "apache-2.0", "size": 8935 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
977,874
@ServiceMethod(returns = ReturnType.SINGLE) Response<PrivateLinkResourceInner> getWithResponse( String resourceGroupName, String accountName, String groupName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<PrivateLinkResourceInner> getWithResponse( String resourceGroupName, String accountName, String groupName, Context context);
/** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. ...
Gets the private link resources that need to be created for a Cosmos DB account
getWithResponse
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java", "license": "mit", "size": 6929 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.cosmos.fluent.models.PrivateLinkResourceInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.cosmos.fluent.models.PrivateLinkResourceInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.cosmos.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,236,738
protected void waitToBecomePrimary() throws InterruptedException { if (getPrimary()) { return; } synchronized (this._primaryLock) { while (!getPrimary()) { this.getLogger().info(LocalizedStrings.GatewayImpl_0__WAITING_TO_BECOME_PRIMARY_GATEWAY, this); this._primaryLock.wait()...
void function() throws InterruptedException { if (getPrimary()) { return; } synchronized (this._primaryLock) { while (!getPrimary()) { this.getLogger().info(LocalizedStrings.GatewayImpl_0__WAITING_TO_BECOME_PRIMARY_GATEWAY, this); this._primaryLock.wait(); } } } private boolean failoverCompleted = false; private final ...
/** * Wait to be told to become the primary <code>Gateway</code>. This method * is invoked by the <code>Gateway</code>'s<code>EventDispatcher</code> * to wait until it is primary before processing the queue. */
Wait to be told to become the primary <code>Gateway</code>. This method is invoked by the <code>Gateway</code>'s<code>EventDispatcher</code> to wait until it is primary before processing the queue
waitToBecomePrimary
{ "repo_name": "papicella/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/GatewayImpl.java", "license": "apache-2.0", "size": 88653 }
[ "com.gemstone.gemfire.internal.i18n.LocalizedStrings" ]
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
import com.gemstone.gemfire.internal.i18n.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
1,329,018
private ResourceContainerImporter importZipInputStream(boolean classesOnly) throws IOException { try (ZipInputStream jis = new ZipInputStream(new FileInputStream(container.file))) { ZipEntry entry; while ((entry = jis.getNextEntry()) != null) { final String name = entry.getName(); //skip directorie...
ResourceContainerImporter function(boolean classesOnly) throws IOException { try (ZipInputStream jis = new ZipInputStream(new FileInputStream(container.file))) { ZipEntry entry; while ((entry = jis.getNextEntry()) != null) { final String name = entry.getName(); if (entry.isDirectory()) continue; addUnknownFile(name, ji...
/** * Imports resources from zip archives using ZipInputStream */
Imports resources from zip archives using ZipInputStream
importZipInputStream
{ "repo_name": "Konloch/bytecode-viewer", "path": "src/main/java/the/bytecode/club/bytecodeviewer/resources/ResourceContainerImporter.java", "license": "gpl-3.0", "size": 6252 }
[ "java.io.FileInputStream", "java.io.IOException", "java.util.zip.ZipEntry", "java.util.zip.ZipInputStream" ]
import java.io.FileInputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
758,940
Set<String> exposedClasses = new HashSet<String>(); return exposedClasses; }
Set<String> exposedClasses = new HashSet<String>(); return exposedClasses; }
/** * Exposes a list of non-KNS entity class names * * @see PersistableBusinessObjectClassExposer#exposePersistableBusinessObjectClassNames() */
Exposes a list of non-KNS entity class names
exposePersistableBusinessObjectClassNames
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-framework/krad-app-framework/src/main/java/org/kuali/rice/krad/app/persistence/jpa/RiceToNervousSystemBusinessObjectClassExposer.java", "license": "apache-2.0", "size": 9361 }
[ "java.util.HashSet", "java.util.Set" ]
import java.util.HashSet; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,828,503
Mediation getMediationPolicy(Organization org, String apiId, String mediationPolicyId) throws MediationPolicyPersistenceException;
Mediation getMediationPolicy(Organization org, String apiId, String mediationPolicyId) throws MediationPolicyPersistenceException;
/** * Get mediation policy of API * * @param org Organization the mediation policy is owned by * @param apiId API ID * @param mediationPolicyId Mediation policy ID * @return Mediation Policy of API * @throws MediationPolicyPersistenceException */
Get mediation policy of API
getMediationPolicy
{ "repo_name": "jaadds/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/APIPersistence.java", "license": "apache-2.0", "size": 18354 }
[ "org.wso2.carbon.apimgt.persistence.dto.Mediation", "org.wso2.carbon.apimgt.persistence.dto.Organization", "org.wso2.carbon.apimgt.persistence.exceptions.MediationPolicyPersistenceException" ]
import org.wso2.carbon.apimgt.persistence.dto.Mediation; import org.wso2.carbon.apimgt.persistence.dto.Organization; import org.wso2.carbon.apimgt.persistence.exceptions.MediationPolicyPersistenceException;
import org.wso2.carbon.apimgt.persistence.dto.*; import org.wso2.carbon.apimgt.persistence.exceptions.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,344,449