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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@Test(expected = IllegalArgumentException.class)
public void test_create_accountIdZero() throws Exception {
instance.create(0, payment);
} | @Test(expected = IllegalArgumentException.class) void function() throws Exception { instance.create(0, payment); } | /**
* <p>
* Failure test for the method <code>create(long accountId, Payment payment)</code> with accountId is zero.<br>
* <code>IllegalArgumentException</code> is expected.
* </p>
*
* @throws Exception
* to JUnit.
*/ | Failure test for the method <code>create(long accountId, Payment payment)</code> with accountId is zero. <code>IllegalArgumentException</code> is expected. | test_create_accountIdZero | {
"repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application",
"path": "Code/SCRD_BRE/src/java/tests/gov/opm/scrd/services/impl/PaymentServiceImplUnitTests.java",
"license": "apache-2.0",
"size": 28086
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,866,282 |
public Set<String> getSiteUsers(String siteId);
| Set<String> function(String siteId); | /**
* Get site users (active).
* @param siteId Site identifier
* @return Users id list
*/ | Get site users (active) | getSiteUsers | {
"repo_name": "noondaysun/sakai",
"path": "sitestats/sitestats-api/src/java/org/sakaiproject/sitestats/api/StatsManager.java",
"license": "apache-2.0",
"size": 29217
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,970,262 |
protected File createDir(final String fileSuffix) throws IOException
{
final File dir = new File(getBasedir(), fileSuffix);
if (dir.exists())
{
FileUtils.deleteDirectory(dir);
}
final boolean dirCreated = dir.mkdirs();
if (!dirCreated)
{
throw new IOException("Cannot create d... | File function(final String fileSuffix) throws IOException { final File dir = new File(getBasedir(), fileSuffix); if (dir.exists()) { FileUtils.deleteDirectory(dir); } final boolean dirCreated = dir.mkdirs(); if (!dirCreated) { throw new IOException(STR + dir.getAbsolutePath() + "'."); } return dir; } | /**
* Provides the given directory within the base director. If the directoy
* exists, it will be removed.
*
* @param fileSuffix the suffix to append to the base directory.
* @return reference to the created directory.
* @throws IOException on any problem generating the directory.
*/ | Provides the given directory within the base director. If the directoy exists, it will be removed | createDir | {
"repo_name": "jdcasey/buildmetadata-maven-plugin",
"path": "src/test/java/test/com/redhat/rcm/maven/plugin/buildmetadata/BuildMetaDataMojoTest.java",
"license": "apache-2.0",
"size": 8741
} | [
"java.io.File",
"java.io.IOException",
"org.codehaus.plexus.util.FileUtils"
] | import java.io.File; import java.io.IOException; import org.codehaus.plexus.util.FileUtils; | import java.io.*; import org.codehaus.plexus.util.*; | [
"java.io",
"org.codehaus.plexus"
] | java.io; org.codehaus.plexus; | 904,624 |
public static String decrypt(String text) throws CipherException {
Key key = null;
try {
key = KeyGeneratorTool.getUserKey();
} catch (IOException e) {
throw new CipherException("Cannot retrieve key, probably no one was created: " + e.getMessage());
}
return decrypt(text, key);
}
| static String function(String text) throws CipherException { Key key = null; try { key = KeyGeneratorTool.getUserKey(); } catch (IOException e) { throw new CipherException(STR + e.getMessage()); } return decrypt(text, key); } | /**
* Decrypt the given Base64 encoded and encrypted {@link String} with the current
* {@link KeyGeneratorTool#getUserKey()}.
*
* @param text
* @return
* @throws CipherException
*/ | Decrypt the given Base64 encoded and encrypted <code>String</code> with the current <code>KeyGeneratorTool#getUserKey()</code> | decrypt | {
"repo_name": "rapidminer/rapidminer-studio",
"path": "src/main/java/com/rapidminer/tools/cipher/CipherTools.java",
"license": "agpl-3.0",
"size": 5771
} | [
"java.io.IOException",
"java.security.Key"
] | import java.io.IOException; import java.security.Key; | import java.io.*; import java.security.*; | [
"java.io",
"java.security"
] | java.io; java.security; | 319,771 |
public void setMinSize(Dimension minSize) {
this.minSize = minSize == null ? null : new Dimension(minSize);
} | void function(Dimension minSize) { this.minSize = minSize == null ? null : new Dimension(minSize); } | /**
* Sets the minimum symbol size that is to be produced.
* @param minSize the minimum size (in pixels), or null for no constraint
*/ | Sets the minimum symbol size that is to be produced | setMinSize | {
"repo_name": "mbhk/barcode4j",
"path": "barcode4j-qr-plugin/src/main/java/org/krysalis/barcode4j/impl/qr/QRCodeBean.java",
"license": "apache-2.0",
"size": 8150
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,684,503 |
protected Node export(Node n, AbstractDocument d) {
super.export(n, d);
AbstractNotation an = (AbstractNotation)n;
an.nodeName = nodeName;
an.publicId = publicId;
an.systemId = systemId;
return n;
} | Node function(Node n, AbstractDocument d) { super.export(n, d); AbstractNotation an = (AbstractNotation)n; an.nodeName = nodeName; an.publicId = publicId; an.systemId = systemId; return n; } | /**
* Exports this node to the given document.
*/ | Exports this node to the given document | export | {
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/AbstractNotation.java",
"license": "apache-2.0",
"size": 4105
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,023,183 |
public ArrayList<CommentLine> getComments() {
ArrayList<CommentLine> commentArray;
commentArray = pComments.getComments();
return commentArray;
} | ArrayList<CommentLine> function() { ArrayList<CommentLine> commentArray; commentArray = pComments.getComments(); return commentArray; } | /**
* getComments returns the source file's comments.
*
*/ | getComments returns the source file's comments | getComments | {
"repo_name": "PrepETNA2015/OSCL-Reload",
"path": "Sources/checker-src/checker/sourceparser/PHPSourceParser.java",
"license": "gpl-3.0",
"size": 17702
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,741,035 |
void appendTo(StringBuffer buffer, Calendar calendar);
} | void appendTo(StringBuffer buffer, Calendar calendar); } | /**
* Appends the value of the specified calendar to the output buffer based on the rule implementation.
*
* @param buffer the output buffer
* @param calendar calendar to be appended
*/ | Appends the value of the specified calendar to the output buffer based on the rule implementation | appendTo | {
"repo_name": "mtwain/Easychad",
"path": "EasychadProj/src/main/java/ml/easychad/lax/android/FastDateFormat.java",
"license": "gpl-2.0",
"size": 55985
} | [
"java.util.Calendar"
] | import java.util.Calendar; | import java.util.*; | [
"java.util"
] | java.util; | 2,726,598 |
public synchronized void swapQueue(
Class<? extends RpcScheduler> schedulerClass,
Class<? extends BlockingQueue<E>> queueClassToUse, int maxSize,
String ns, Configuration conf) {
int priorityLevels = parseNumLevels(ns, conf);
RpcScheduler newScheduler = createScheduler(schedulerClass, priori... | synchronized void function( Class<? extends RpcScheduler> schedulerClass, Class<? extends BlockingQueue<E>> queueClassToUse, int maxSize, String ns, Configuration conf) { int priorityLevels = parseNumLevels(ns, conf); RpcScheduler newScheduler = createScheduler(schedulerClass, priorityLevels, ns, conf); BlockingQueue<E... | /**
* Replaces active queue with the newly requested one and transfers
* all calls to the newQ before returning.
*/ | Replaces active queue with the newly requested one and transfers all calls to the newQ before returning | swapQueue | {
"repo_name": "NJUJYB/disYarn",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/CallQueueManager.java",
"license": "apache-2.0",
"size": 10592
} | [
"java.util.concurrent.BlockingQueue",
"org.apache.hadoop.conf.Configuration"
] | import java.util.concurrent.BlockingQueue; import org.apache.hadoop.conf.Configuration; | import java.util.concurrent.*; import org.apache.hadoop.conf.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,409,605 |
private static void assertAddressListInvalid(String addresses) {
try {
ParticipantController.buildParticipantList(null, addresses);
fail("Expected InvalidParticipantAddress Exception");
} catch (InvalidParticipantAddress e) {
// Expected.
}
} | static void function(String addresses) { try { ParticipantController.buildParticipantList(null, addresses); fail(STR); } catch (InvalidParticipantAddress e) { } } | /**
* Checks that an comma separated address list is not valid.
*/ | Checks that an comma separated address list is not valid | assertAddressListInvalid | {
"repo_name": "wisebaldone/incubator-wave",
"path": "wave/src/test/java/org/waveprotocol/wave/client/wavepanel/impl/edit/ParticipantControllerTest.java",
"license": "apache-2.0",
"size": 5801
} | [
"org.waveprotocol.wave.model.wave.InvalidParticipantAddress"
] | import org.waveprotocol.wave.model.wave.InvalidParticipantAddress; | import org.waveprotocol.wave.model.wave.*; | [
"org.waveprotocol.wave"
] | org.waveprotocol.wave; | 93,935 |
public User updateLastEvent() {
setLastEvent(new Date());
return this;
} | User function() { setLastEvent(new Date()); return this; } | /**
* Helper method to chain last event setter.
*/ | Helper method to chain last event setter | updateLastEvent | {
"repo_name": "eldevanjr/helianto",
"path": "helianto-core/src/main/java/org/helianto/user/domain/User.java",
"license": "apache-2.0",
"size": 12013
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,623,459 |
@Test
public void testSetValuesSuccess() {
list.add(new Triple("Male", 200, true));
list.add(new Triple("Female", 400, false));
list.add(new Triple("Male", 0, true));
three.setValues(list);
assertEquals(list, three.getValues());
} | void function() { list.add(new Triple("Male", 200, true)); list.add(new Triple(STR, 400, false)); list.add(new Triple("Male", 0, true)); three.setValues(list); assertEquals(list, three.getValues()); } | /**
* Test of setValues method, of class ThreeDimData.
* Test case: successfull change of data values.
*/ | Test of setValues method, of class ThreeDimData. Test case: successfull change of data values | testSetValuesSuccess | {
"repo_name": "bojantomic/jeff",
"path": "src/test/java/org/goodoldai/jeff/explanation/data/ThreeDimDataTest.java",
"license": "lgpl-3.0",
"size": 11963
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,821,356 |
public static String replaceSystemProperties(Object source) {
return new StrSubstitutor(StrLookup.systemPropertiesLookup()).replace(source);
}
//-----------------------------------------------------------------------
public StrSubstitutor() {
this((StrLookup) null, DEFAULT_PREFIX, ... | static String function(Object source) { return new StrSubstitutor(StrLookup.systemPropertiesLookup()).replace(source); } public StrSubstitutor() { this((StrLookup) null, DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); } public StrSubstitutor(Map valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_S... | /**
* Replaces all the occurrences of variables in the given source object with
* their matching values from the system properties.
*
* @param source the source text containing the variables to substitute, null returns null
* @return the result of the replace operation
*/ | Replaces all the occurrences of variables in the given source object with their matching values from the system properties | replaceSystemProperties | {
"repo_name": "rytina/dukecon_appsgenerator",
"path": "org.apache.commons.lang/source-bundle/org/apache/commons/lang/text/StrSubstitutor.java",
"license": "epl-1.0",
"size": 33489
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,031,136 |
public Map<String,String> getReplacePotions(); | Map<String,String> function(); | /**
* Returns the map of potion effects that are in the gate's replace potion effect map.
*
* @return a map of potion effect strings
*/ | Returns the map of potion effects that are in the gate's replace potion effect map | getReplacePotions | {
"repo_name": "InsomniaxGaming/TransporterReloaded",
"path": "src/com/frdfsnlght/transporter/api/LocalGate.java",
"license": "gpl-2.0",
"size": 27331
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 905,555 |
void updateInfoPanelPosition(TextPosition position); | void updateInfoPanelPosition(TextPosition position); | /**
* Update the location displayed in the info panel.
*
* @param position
* the new position
*/ | Update the location displayed in the info panel | updateInfoPanelPosition | {
"repo_name": "cemalkilic/che",
"path": "ide/che-core-ide-api/src/main/java/org/eclipse/che/ide/api/editor/texteditor/TextEditorPartView.java",
"license": "epl-1.0",
"size": 3360
} | [
"org.eclipse.che.ide.api.editor.text.TextPosition"
] | import org.eclipse.che.ide.api.editor.text.TextPosition; | import org.eclipse.che.ide.api.editor.text.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 702,631 |
EAttribute getGenUnitOpCostCurve_IsNetGrossP(); | EAttribute getGenUnitOpCostCurve_IsNetGrossP(); | /**
* Returns the meta object for the attribute '{@link CIM.IEC61970.Generation.Production.GenUnitOpCostCurve#isIsNetGrossP <em>Is Net Gross P</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Is Net Gross P</em>'.
* @see CIM.IEC61970.Generation.Product... | Returns the meta object for the attribute '<code>CIM.IEC61970.Generation.Production.GenUnitOpCostCurve#isIsNetGrossP Is Net Gross P</code>'. | getGenUnitOpCostCurve_IsNetGrossP | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Generation/Production/ProductionPackage.java",
"license": "mit",
"size": 499866
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 806,705 |
public static List<RefModel> getTags(Repository repository, boolean fullName, int maxCount) {
return getRefs(repository, Constants.R_TAGS, fullName, maxCount);
}
| static List<RefModel> function(Repository repository, boolean fullName, int maxCount) { return getRefs(repository, Constants.R_TAGS, fullName, maxCount); } | /**
* Returns the list of tags in the repository. If repository does not exist
* or is empty, an empty list is returned.
*
* @param repository
* @param fullName
* if true, /refs/tags/yadayadayada is returned. If false,
* yadayadayada is returned.
* @param maxCount
* ... | Returns the list of tags in the repository. If repository does not exist or is empty, an empty list is returned | getTags | {
"repo_name": "paulsputer/gitblit",
"path": "src/main/java/com/gitblit/utils/JGitUtils.java",
"license": "apache-2.0",
"size": 88271
} | [
"com.gitblit.models.RefModel",
"java.util.List",
"org.eclipse.jgit.lib.Constants",
"org.eclipse.jgit.lib.Repository"
] | import com.gitblit.models.RefModel; import java.util.List; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; | import com.gitblit.models.*; import java.util.*; import org.eclipse.jgit.lib.*; | [
"com.gitblit.models",
"java.util",
"org.eclipse.jgit"
] | com.gitblit.models; java.util; org.eclipse.jgit; | 173,580 |
private void buildArcInflexionPoints(final CamiRepository cr, final ArcHLAPI arc, final int arcID) throws CamiException {
if (arc.getArcgraphicsHLAPI() != null) {
for (PositionHLAPI arcBP : arc.getArcgraphicsHLAPI().getPositionsHLAPI()) {
final Pi arcPi = MF.createPi();
arcPi.setPi(arcID, arcBP.getX(), ... | void function(final CamiRepository cr, final ArcHLAPI arc, final int arcID) throws CamiException { if (arc.getArcgraphicsHLAPI() != null) { for (PositionHLAPI arcBP : arc.getArcgraphicsHLAPI().getPositionsHLAPI()) { final Pi arcPi = MF.createPi(); arcPi.setPi(arcID, arcBP.getX(), arcBP.getY()); cr.addCommand(arcPi); } ... | /**
* Builds an arc bend points into the Cami repository.
*
* @param cr
* Cami repository
* @param arc
* the arc in PNML
* @param arcID
* the arc Id in Cami
* @throws CamiException
* something went wrong when creating the bend points.
*/ | Builds an arc bend points into the Cami repository | buildArcInflexionPoints | {
"repo_name": "lhillah/camipnml",
"path": "cpnami2-cpnami2/src/fr/lip6/move/cpnami/pnml/p2c/PTNet2CamiModel.java",
"license": "epl-1.0",
"size": 22293
} | [
"fr.lip6.move.pnml.cpnami.cami.CamiRepository",
"fr.lip6.move.pnml.cpnami.cami.model.Pi",
"fr.lip6.move.pnml.cpnami.exceptions.CamiException",
"fr.lip6.move.pnml.ptnet.hlapi.ArcHLAPI",
"fr.lip6.move.pnml.ptnet.hlapi.PositionHLAPI"
] | import fr.lip6.move.pnml.cpnami.cami.CamiRepository; import fr.lip6.move.pnml.cpnami.cami.model.Pi; import fr.lip6.move.pnml.cpnami.exceptions.CamiException; import fr.lip6.move.pnml.ptnet.hlapi.ArcHLAPI; import fr.lip6.move.pnml.ptnet.hlapi.PositionHLAPI; | import fr.lip6.move.pnml.cpnami.cami.*; import fr.lip6.move.pnml.cpnami.cami.model.*; import fr.lip6.move.pnml.cpnami.exceptions.*; import fr.lip6.move.pnml.ptnet.hlapi.*; | [
"fr.lip6.move"
] | fr.lip6.move; | 458,590 |
public final InformationLossWithBound<T> getInformationLoss(final Node node, final HashGroupifyEntry entry) {
return this.getInformationLossInternal(node, entry);
} | final InformationLossWithBound<T> function(final Node node, final HashGroupifyEntry entry) { return this.getInformationLossInternal(node, entry); } | /**
* Returns the information loss that would be induced by suppressing the given entry. The loss
* is not necessarily consistent with the loss that is computed by
* <code>getInformationLoss(node, groupify)</code> but is guaranteed to be comparable for
* different entries from the same groupify op... | Returns the information loss that would be induced by suppressing the given entry. The loss is not necessarily consistent with the loss that is computed by <code>getInformationLoss(node, groupify)</code> but is guaranteed to be comparable for different entries from the same groupify operator | getInformationLoss | {
"repo_name": "TheRealRasu/arx",
"path": "src/main/org/deidentifier/arx/metric/Metric.java",
"license": "apache-2.0",
"size": 38625
} | [
"org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry",
"org.deidentifier.arx.framework.lattice.Node"
] | import org.deidentifier.arx.framework.check.groupify.HashGroupifyEntry; import org.deidentifier.arx.framework.lattice.Node; | import org.deidentifier.arx.framework.check.groupify.*; import org.deidentifier.arx.framework.lattice.*; | [
"org.deidentifier.arx"
] | org.deidentifier.arx; | 310,480 |
TestGroupData findById(Long testGroupId) throws RemoteOperationException; | TestGroupData findById(Long testGroupId) throws RemoteOperationException; | /**
* Looks up a {@link TestGroupData test group} by it's unique ID.
*
* @param testGroupId the unique ID of the test group
* @return the found test group
* @throws RemoteOperationException if anything goes wrong while executing
* the remote operation
* @since 2.0.0
*/ | Looks up a <code>TestGroupData test group</code> by it's unique ID | findById | {
"repo_name": "testIT-ResultRepository/resultrepository-core",
"path": "resultrepository-remote-api/src/main/java/info/novatec/testit/resultrepository/remote/v1/TestGroupsRemoteService.java",
"license": "gpl-3.0",
"size": 2329
} | [
"info.novatec.testit.resultrepository.api.dto.TestGroupData",
"info.novatec.testit.resultrepository.remote.v1.exceptions.RemoteOperationException"
] | import info.novatec.testit.resultrepository.api.dto.TestGroupData; import info.novatec.testit.resultrepository.remote.v1.exceptions.RemoteOperationException; | import info.novatec.testit.resultrepository.api.dto.*; import info.novatec.testit.resultrepository.remote.v1.exceptions.*; | [
"info.novatec.testit"
] | info.novatec.testit; | 1,231,883 |
Resources resources = context.getResources();
DisplayMetrics metrics = resources.getDisplayMetrics();
return (int) (dp * (metrics.densityDpi / 160f));
} | Resources resources = context.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); return (int) (dp * (metrics.densityDpi / 160f)); } | /**
* This method converts dp unit to equivalent pixels, depending on device density.
*
* @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels
* @param context Context to get resources and device specific display metrics
* @return A float value to... | This method converts dp unit to equivalent pixels, depending on device density | convertDpToPixel | {
"repo_name": "jreyes/mirror",
"path": "app/src/main/java/com/vaporwarecorp/mirror/util/DisplayMetricsUtil.java",
"license": "apache-2.0",
"size": 2030
} | [
"android.content.res.Resources",
"android.util.DisplayMetrics"
] | import android.content.res.Resources; import android.util.DisplayMetrics; | import android.content.res.*; import android.util.*; | [
"android.content",
"android.util"
] | android.content; android.util; | 2,849,850 |
private static void clearHeaderOperations(List<HeaderOperation> operations, String headerName) {
final Iterator<HeaderOperation> iterator = operations.iterator();
while (iterator.hasNext()) {
if (iterator.next().getHeaderName().equals(headerName)) {
iterator.remove();
}
}
}
private static int... | static void function(List<HeaderOperation> operations, String headerName) { final Iterator<HeaderOperation> iterator = operations.iterator(); while (iterator.hasNext()) { if (iterator.next().getHeaderName().equals(headerName)) { iterator.remove(); } } } private static interface ApiRequestHeaderModification { | /**
* Removes header operations from a list.
*
* @param operations the list from which to remove operations
* @param headerName all operations with that header name will be removed
*/ | Removes header operations from a list | clearHeaderOperations | {
"repo_name": "probedock/java-api-test",
"path": "src/main/java/io/probedock/api/test/headers/ApiHeadersManager.java",
"license": "mit",
"size": 8440
} | [
"java.util.Iterator",
"java.util.List"
] | import java.util.Iterator; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,834,222 |
if (config.random().getBoolean(30)) {
return new String[] { "*" };
}
ArrayList<String> exp = New.arrayList();
String sql = "";
if (config.random().getBoolean(10)) {
sql += "DISTINCT ";
}
int len = config.random().getLog(8) + 1;
for (int i =... | if (config.random().getBoolean(30)) { return new String[] { "*" }; } ArrayList<String> exp = New.arrayList(); String sql = STRDISTINCT STR AS ASTR STR"; } String[] list = new String[exp.size()]; exp.toArray(list); return list; } | /**
* Create a random select list.
*
* @param config the configuration
* @param command the command
* @return the select list
*/ | Create a random select list | getRandomSelectList | {
"repo_name": "miloszpiglas/h2mod",
"path": "src/test/org/h2/test/synth/sql/Expression.java",
"license": "mpl-2.0",
"size": 11613
} | [
"java.util.ArrayList",
"org.h2.util.New"
] | import java.util.ArrayList; import org.h2.util.New; | import java.util.*; import org.h2.util.*; | [
"java.util",
"org.h2.util"
] | java.util; org.h2.util; | 2,430,068 |
public void setDatanodeDetails(
DatanodeDetails datanodeDetails) {
this.datanodeDetails = datanodeDetails;
} | void function( DatanodeDetails datanodeDetails) { this.datanodeDetails = datanodeDetails; } | /**
* Set the contiainerNodeID Proto.
*
* @param datanodeDetails - Container Node ID.
*/ | Set the contiainerNodeID Proto | setDatanodeDetails | {
"repo_name": "dierobotsdie/hadoop",
"path": "hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/RegisterEndpointTask.java",
"license": "apache-2.0",
"size": 8084
} | [
"org.apache.hadoop.hdds.protocol.DatanodeDetails"
] | import org.apache.hadoop.hdds.protocol.DatanodeDetails; | import org.apache.hadoop.hdds.protocol.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 51,739 |
protected void detach() throws IOException {
synchronized(this) {
parent.getList().remove(this);
attached = false;
}//synchronized
}
private final class InternCollection<T extends AbstractFileResource> extends AbstractCollection<T> {
| void function() throws IOException { synchronized(this) { parent.getList().remove(this); attached = false; } } private final class InternCollection<T extends AbstractFileResource> extends AbstractCollection<T> { | /**
* Detaches this file from the parent file
*/ | Detaches this file from the parent file | detach | {
"repo_name": "nordapp/rest",
"path": "org.i3xx.util.ramdisk/src/main/java/org/i3xx/util/ramdisk/DirectoryResource.java",
"license": "apache-2.0",
"size": 4987
} | [
"java.io.IOException",
"java.util.AbstractCollection"
] | import java.io.IOException; import java.util.AbstractCollection; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 716,414 |
public static <T> T fromJson(JSONObject json, Class<T> cls) {
if (json == null) {
throw new IllegalArgumentException("json cannot be null");
}
if (cls == null) {
throw new IllegalArgumentException("cls cannot be null");
}
return getGson().fromJson(json... | static <T> T function(JSONObject json, Class<T> cls) { if (json == null) { throw new IllegalArgumentException(STR); } if (cls == null) { throw new IllegalArgumentException(STR); } return getGson().fromJson(json.toString(), cls); } | /**
* Parses given {@link org.json.JSONObject} to object of given class.
*
* @param json Json
* @param cls Class
* @return Parsed object
*/ | Parses given <code>org.json.JSONObject</code> to object of given class | fromJson | {
"repo_name": "F3roG/ALF",
"path": "lib/src/main/java/com/f3rog/alf/network/JsonParser.java",
"license": "apache-2.0",
"size": 1879
} | [
"org.json.JSONObject"
] | import org.json.JSONObject; | import org.json.*; | [
"org.json"
] | org.json; | 427,053 |
@NotNull
Map<ExternalSystemTaskType, Set<ExternalSystemTaskId>> getTasksInProgress() throws RemoteException; | Map<ExternalSystemTaskType, Set<ExternalSystemTaskId>> getTasksInProgress() throws RemoteException; | /**
* Allows to ask current service for all tasks being executed at the moment.
*
* @return ids of all tasks being executed at the moment grouped by type
* @throws RemoteException as required by RMI
*/ | Allows to ask current service for all tasks being executed at the moment | getTasksInProgress | {
"repo_name": "siosio/intellij-community",
"path": "platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/internal/ExternalSystemTaskAware.java",
"license": "apache-2.0",
"size": 1607
} | [
"com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId",
"com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType",
"java.rmi.RemoteException",
"java.util.Map",
"java.util.Set"
] | import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId; import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType; import java.rmi.RemoteException; import java.util.Map; import java.util.Set; | import com.intellij.openapi.*; import java.rmi.*; import java.util.*; | [
"com.intellij.openapi",
"java.rmi",
"java.util"
] | com.intellij.openapi; java.rmi; java.util; | 726,319 |
public List<Parm> getParmCollection() {
return _parms == null ? Collections.<Parm>emptyList() : _parms;
} | List<Parm> function() { return _parms == null ? Collections.<Parm>emptyList() : _parms; } | /**
* Returns the Collection of parms for this event
*/ | Returns the Collection of parms for this event | getParmCollection | {
"repo_name": "dzonekl/oss2nms",
"path": "plugins/com.netxforge.oss2.model/src/com/netxforge/oss2/xml/event/Event.java",
"license": "gpl-3.0",
"size": 46316
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,578,536 |
public HashSet<String> getSkippedProperties() {
return m_SkippedProperties;
} | HashSet<String> function() { return m_SkippedProperties; } | /**
* Returns the skipped top-level properties.
*
* @return the properties
*/ | Returns the skipped top-level properties | getSkippedProperties | {
"repo_name": "automenta/adams-core",
"path": "src/main/java/adams/core/option/AbstractOptionConsumer.java",
"license": "gpl-3.0",
"size": 16976
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 1,762,667 |
public Object[] nextObjects() throws RemoteException {
ArrayList items = new ArrayList();
while (items.size() < maxBufferSize && iterator.hasNext()) {
items.add(getRemoteObject(iterator.next()));
}
if (items.size() > 0) {
return items.toArray(new Object[items.... | Object[] function() throws RemoteException { ArrayList items = new ArrayList(); while (items.size() < maxBufferSize && iterator.hasNext()) { items.add(getRemoteObject(iterator.next())); } if (items.size() > 0) { return items.toArray(new Object[items.size()]); } else { size = iterator.getPosition(); return null; } } | /**
* Returns an array of remote references to the next elements in this
* iteration.
*
* @return array of remote references, or <code>null</code>
* @throws RemoteException on RMI errors
* @see RemoteIterator#nextObjects(int)
* @see java.util.Iterator#next()
*/ | Returns an array of remote references to the next elements in this iteration | nextObjects | {
"repo_name": "sdmcraft/jackrabbit",
"path": "jackrabbit-jcr-rmi/src/main/java/org/apache/jackrabbit/rmi/server/iterator/ServerIterator.java",
"license": "apache-2.0",
"size": 5032
} | [
"java.rmi.RemoteException",
"java.util.ArrayList"
] | import java.rmi.RemoteException; import java.util.ArrayList; | import java.rmi.*; import java.util.*; | [
"java.rmi",
"java.util"
] | java.rmi; java.util; | 147,583 |
private boolean isNdpForGateway(NeighbourMessageContext pkt) {
DeviceId deviceId = pkt.inPort().deviceId();
Set<IpAddress> gatewayIpAddresses = null;
try {
if (pkt.target().equals(config.getRouterIpv6(deviceId))) {
return true;
}
gatewayIp... | boolean function(NeighbourMessageContext pkt) { DeviceId deviceId = pkt.inPort().deviceId(); Set<IpAddress> gatewayIpAddresses = null; try { if (pkt.target().equals(config.getRouterIpv6(deviceId))) { return true; } gatewayIpAddresses = config.getPortIPs(deviceId); } catch (DeviceConfigNotFoundException e) { log.warn(e.... | /**
* Utility to verify if the ND are for the gateway.
*
* @param pkt the ndp packet
* @return true if the ndp is for the gateway. False otherwise
*/ | Utility to verify if the ND are for the gateway | isNdpForGateway | {
"repo_name": "kuujo/onos",
"path": "apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/IcmpHandler.java",
"license": "apache-2.0",
"size": 20282
} | [
"java.util.Arrays",
"java.util.Set",
"org.onlab.packet.IPv6",
"org.onlab.packet.IpAddress",
"org.onosproject.net.DeviceId",
"org.onosproject.net.neighbour.NeighbourMessageContext",
"org.onosproject.segmentrouting.config.DeviceConfigNotFoundException"
] | import java.util.Arrays; import java.util.Set; import org.onlab.packet.IPv6; import org.onlab.packet.IpAddress; import org.onosproject.net.DeviceId; import org.onosproject.net.neighbour.NeighbourMessageContext; import org.onosproject.segmentrouting.config.DeviceConfigNotFoundException; | import java.util.*; import org.onlab.packet.*; import org.onosproject.net.*; import org.onosproject.net.neighbour.*; import org.onosproject.segmentrouting.config.*; | [
"java.util",
"org.onlab.packet",
"org.onosproject.net",
"org.onosproject.segmentrouting"
] | java.util; org.onlab.packet; org.onosproject.net; org.onosproject.segmentrouting; | 732,228 |
LOGGER.debug("Invalid input received: {}", input);
return Response.status(getErrorStatus())
.entity(new ErrorMessage(getErrorStatus().getStatusCode(),
errorMessage(e)))
.type(mediaType())
.build();
} | LOGGER.debug(STR, input); return Response.status(getErrorStatus()) .entity(new ErrorMessage(getErrorStatus().getStatusCode(), errorMessage(e))) .type(mediaType()) .build(); } | /**
* Given a string representation which was unable to be parsed and the exception thrown, produce
* a {@link Response} to be sent to the client.
*
* By default, generates a {@code 400 Bad Request} with a plain text entity generated by
* {@link #errorMessage(Exception)}.
*
* @param i... | Given a string representation which was unable to be parsed and the exception thrown, produce a <code>Response</code> to be sent to the client. By default, generates a 400 Bad Request with a plain text entity generated by <code>#errorMessage(Exception)</code> | error | {
"repo_name": "ryankennedy/dropwizard",
"path": "dropwizard-jersey/src/main/java/io/dropwizard/jersey/params/AbstractParam.java",
"license": "apache-2.0",
"size": 3926
} | [
"io.dropwizard.jersey.errors.ErrorMessage",
"javax.ws.rs.core.Response"
] | import io.dropwizard.jersey.errors.ErrorMessage; import javax.ws.rs.core.Response; | import io.dropwizard.jersey.errors.*; import javax.ws.rs.core.*; | [
"io.dropwizard.jersey",
"javax.ws"
] | io.dropwizard.jersey; javax.ws; | 1,193,968 |
@NotNull
EntityIterable sort(@NotNull final String entityType, @NotNull final String propertyName, final boolean ascending); | EntityIterable sort(@NotNull final String entityType, @NotNull final String propertyName, final boolean ascending); | /**
* Returns {@linkplain EntityIterable} with entities of specified type sorted by values of specified property.
*
* @param entityType entity type
* @param propertyName property name
* @param ascending {@code true} is sorting order is ascending
* @return {@linkplain EntityIterable} i... | Returns EntityIterable with entities of specified type sorted by values of specified property | sort | {
"repo_name": "JetBrains/xodus",
"path": "openAPI/src/main/java/jetbrains/exodus/entitystore/StoreTransaction.java",
"license": "apache-2.0",
"size": 26380
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,414,980 |
@Nullable
public static Entity spawnCreature(World worldIn, @Nullable ResourceLocation entityID, double x, double y, double z)
{
if (entityID != null && EntityList.ENTITY_EGGS.containsKey(entityID))
{
Entity entity = null;
for (int i = 0; i < 1; ++i)
... | static Entity function(World worldIn, @Nullable ResourceLocation entityID, double x, double y, double z) { if (entityID != null && EntityList.ENTITY_EGGS.containsKey(entityID)) { Entity entity = null; for (int i = 0; i < 1; ++i) { entity = EntityList.createEntityByIDFromName(entityID, worldIn); if (entity instanceof En... | /**
* Spawns the creature specified by the egg's type in the location specified by the last three parameters.
* Parameters: world, entityID, x, y, z.
*/ | Spawns the creature specified by the egg's type in the location specified by the last three parameters. Parameters: world, entityID, x, y, z | spawnCreature | {
"repo_name": "InverMN/MinecraftForgeReference",
"path": "MinecraftItems/ItemMonsterPlacer.java",
"license": "unlicense",
"size": 12266
} | [
"javax.annotation.Nullable",
"net.minecraft.entity.Entity",
"net.minecraft.entity.EntityList",
"net.minecraft.entity.EntityLiving",
"net.minecraft.entity.IEntityLivingData",
"net.minecraft.util.ResourceLocation",
"net.minecraft.util.math.BlockPos",
"net.minecraft.util.math.MathHelper",
"net.minecraf... | import javax.annotation.Nullable; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.IEntityLivingData; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathH... | import javax.annotation.*; import net.minecraft.entity.*; import net.minecraft.util.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"javax.annotation",
"net.minecraft.entity",
"net.minecraft.util",
"net.minecraft.world"
] | javax.annotation; net.minecraft.entity; net.minecraft.util; net.minecraft.world; | 197,547 |
public int GetResistance(final SpellSchools school) {
return GetUInt32Value(UnitField.UNIT_FIELD_RESISTANCES.getValue() + school.ordinal());
} | int function(final SpellSchools school) { return GetUInt32Value(UnitField.UNIT_FIELD_RESISTANCES.getValue() + school.ordinal()); } | /**
* Gets the resistance.
*
* @param school
* the school
* @return the int
*/ | Gets the resistance | GetResistance | {
"repo_name": "Furt/JMaNGOS",
"path": "Realm/src/main/java/org/jmangos/realm/model/unit/Units.java",
"license": "gpl-2.0",
"size": 8033
} | [
"org.jmangos.realm.model.base.update.UnitField",
"org.jmangos.realm.model.enums.SpellSchools"
] | import org.jmangos.realm.model.base.update.UnitField; import org.jmangos.realm.model.enums.SpellSchools; | import org.jmangos.realm.model.base.update.*; import org.jmangos.realm.model.enums.*; | [
"org.jmangos.realm"
] | org.jmangos.realm; | 2,233,236 |
return Kind.TypeExpr;
}
public TDTypeExpr(TDLocation<STypeExpr> location) {
super(location);
}
public TDTypeExpr(Type type) {
super(new TDLocation<STypeExpr>(STypeExpr.make(TDTree.<SType>treeOf(type))));
} | return Kind.TypeExpr; } public TDTypeExpr(TDLocation<STypeExpr> location) { super(location); } public TDTypeExpr(Type type) { super(new TDLocation<STypeExpr>(STypeExpr.make(TDTree.<SType>treeOf(type)))); } | /**
* Returns the kind of this type expression.
*
* @return the kind of this type expression.
*/ | Returns the kind of this type expression | kind | {
"repo_name": "ptitjes/jlato",
"path": "src/main/java/org/jlato/internal/td/expr/TDTypeExpr.java",
"license": "lgpl-3.0",
"size": 2580
} | [
"org.jlato.internal.bu.expr.STypeExpr",
"org.jlato.internal.bu.type.SType",
"org.jlato.internal.td.TDLocation",
"org.jlato.internal.td.TDTree",
"org.jlato.tree.Kind",
"org.jlato.tree.expr.TypeExpr",
"org.jlato.tree.type.Type"
] | import org.jlato.internal.bu.expr.STypeExpr; import org.jlato.internal.bu.type.SType; import org.jlato.internal.td.TDLocation; import org.jlato.internal.td.TDTree; import org.jlato.tree.Kind; import org.jlato.tree.expr.TypeExpr; import org.jlato.tree.type.Type; | import org.jlato.internal.bu.expr.*; import org.jlato.internal.bu.type.*; import org.jlato.internal.td.*; import org.jlato.tree.*; import org.jlato.tree.expr.*; import org.jlato.tree.type.*; | [
"org.jlato.internal",
"org.jlato.tree"
] | org.jlato.internal; org.jlato.tree; | 2,366,819 |
public void startSettingActivity(Context context, Bundle extras) {
if (!startDelegateActivity(context, delegate.getSettingsIntent(), extras)) {
startActivity(context, extras, MyProfileActivity.class);
}
} | void function(Context context, Bundle extras) { if (!startDelegateActivity(context, delegate.getSettingsIntent(), extras)) { startActivity(context, extras, MyProfileActivity.class); } } | /**
* Method is used internally for starting default activity or activity added in delegate
*
* @param context current context
* @param extras activity extras
*/ | Method is used internally for starting default activity or activity added in delegate | startSettingActivity | {
"repo_name": "EaglesoftZJ/actor-platform",
"path": "actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/ActorSDK.java",
"license": "agpl-3.0",
"size": 33417
} | [
"android.content.Context",
"android.os.Bundle",
"im.actor.sdk.controllers.settings.MyProfileActivity"
] | import android.content.Context; import android.os.Bundle; import im.actor.sdk.controllers.settings.MyProfileActivity; | import android.content.*; import android.os.*; import im.actor.sdk.controllers.settings.*; | [
"android.content",
"android.os",
"im.actor.sdk"
] | android.content; android.os; im.actor.sdk; | 1,722,295 |
return MCRConfiguration2
.<MCRProcessableRegistry>getSingleInstanceOf("MCR.Processable.Registry.Class").orElseThrow();
} | return MCRConfiguration2 .<MCRProcessableRegistry>getSingleInstanceOf(STR).orElseThrow(); } | /**
* Return the default instance of the processable registry
*
* @return the singleton instance
*/ | Return the default instance of the processable registry | getSingleInstance | {
"repo_name": "MyCoRe-Org/mycore",
"path": "mycore-base/src/main/java/org/mycore/common/processing/MCRProcessableRegistry.java",
"license": "gpl-3.0",
"size": 2251
} | [
"org.mycore.common.config.MCRConfiguration2"
] | import org.mycore.common.config.MCRConfiguration2; | import org.mycore.common.config.*; | [
"org.mycore.common"
] | org.mycore.common; | 753,073 |
@Override
public HttpServletRequest getRequest()
{
return _request;
} | HttpServletRequest function() { return _request; } | /**
* Returns the servlet request for the page.
*/ | Returns the servlet request for the page | getRequest | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/jsp/PageContextImpl.java",
"license": "gpl-2.0",
"size": 53497
} | [
"javax.servlet.http.HttpServletRequest"
] | import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 905,386 |
PagedIterable<FirewallRule> listByAccount(String resourceGroupName, String accountName); | PagedIterable<FirewallRule> listByAccount(String resourceGroupName, String accountName); | /**
* Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account.
*
* @param resourceGroupName The name of the Azure resource group.
* @param accountName The name of the Data Lake Analytics account.
* @throws IllegalArgumentException thrown if parameters fail ... | Lists the Data Lake Analytics firewall rules within the specified Data Lake Analytics account | listByAccount | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datalakeanalytics/azure-resourcemanager-datalakeanalytics/src/main/java/com/azure/resourcemanager/datalakeanalytics/models/FirewallRules.java",
"license": "mit",
"size": 7662
} | [
"com.azure.core.http.rest.PagedIterable"
] | import com.azure.core.http.rest.PagedIterable; | import com.azure.core.http.rest.*; | [
"com.azure.core"
] | com.azure.core; | 1,046,519 |
public boolean isDirectory() {
boolean isDirectory;
switch (mode) {
case SMB:
try {
isDirectory = new SmbFile(path).isDirectory();
} catch (SmbException e) {
isDirectory = false;
e.printStackTrace... | boolean function() { boolean isDirectory; switch (mode) { case SMB: try { isDirectory = new SmbFile(path).isDirectory(); } catch (SmbException e) { isDirectory = false; e.printStackTrace(); } catch (MalformedURLException e) { isDirectory = false; e.printStackTrace(); } break; case FILE: isDirectory = new File(path).isD... | /**
* Whether this object refers to a directory or file, handles all types of files
* @deprecated use {@link #isDirectory(Context)} to handle content resolvers
*
* @return
*/ | Whether this object refers to a directory or file, handles all types of files | isDirectory | {
"repo_name": "martincz/AmazeFileManager",
"path": "src/main/java/com/amaze/filemanager/filesystem/HFile.java",
"license": "gpl-3.0",
"size": 37016
} | [
"com.amaze.filemanager.exceptions.RootNotPermittedException",
"java.io.File",
"java.net.MalformedURLException",
"jcifs.smb.SmbException",
"jcifs.smb.SmbFile"
] | import com.amaze.filemanager.exceptions.RootNotPermittedException; import java.io.File; import java.net.MalformedURLException; import jcifs.smb.SmbException; import jcifs.smb.SmbFile; | import com.amaze.filemanager.exceptions.*; import java.io.*; import java.net.*; import jcifs.smb.*; | [
"com.amaze.filemanager",
"java.io",
"java.net",
"jcifs.smb"
] | com.amaze.filemanager; java.io; java.net; jcifs.smb; | 501,269 |
protected final void setHeaderScroll(int value) {
if (DEBUG) {
Log.d(LOG_TAG, "setHeaderScroll: " + value);
}
// Clamp value to with pull scroll range
final int maximumPullScroll = getMaximumPullScroll();
value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));
if (mLayoutVisibility... | final void function(int value) { if (DEBUG) { Log.d(LOG_TAG, STR + value); } final int maximumPullScroll = getMaximumPullScroll(); value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value)); if (mLayoutVisibilityChangesEnabled) { if (value < 0) { mHeaderLayout.setVisibility(View.VISIBLE); } else if (value... | /**
* Helper method which just calls scrollTo() in the correct scrolling
* direction.
*
* @param value - New Scroll value
*/ | Helper method which just calls scrollTo() in the correct scrolling direction | setHeaderScroll | {
"repo_name": "FreeSunny/RefreashTabView",
"path": "src/com/example/refreashtabview/refreash/PullToRefreshBase.java",
"license": "apache-2.0",
"size": 46250
} | [
"android.util.Log",
"android.view.View"
] | import android.util.Log; import android.view.View; | import android.util.*; import android.view.*; | [
"android.util",
"android.view"
] | android.util; android.view; | 2,239,649 |
//-----------------------------------------------------------------------
public MetaProperty<FxOptionVolatilitiesName> name() {
return name;
} | MetaProperty<FxOptionVolatilitiesName> function() { return name; } | /**
* The meta-property for the {@code name} property.
* @return the meta-property, not null
*/ | The meta-property for the name property | name | {
"repo_name": "OpenGamma/Strata",
"path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/fxopt/BlackFxOptionSmileVolatilities.java",
"license": "apache-2.0",
"size": 22696
} | [
"org.joda.beans.MetaProperty"
] | import org.joda.beans.MetaProperty; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 1,879,000 |
public static <T> T randomFrom(Random r, List<T> list) {
if (list.size() == 0) {
throw new IllegalArgumentException("Can't pick a random object from an empty list.");
}
return list.get(r.nextInt(list.size()));
} | static <T> T function(Random r, List<T> list) { if (list.size() == 0) { throw new IllegalArgumentException(STR); } return list.get(r.nextInt(list.size())); } | /**
* Pick a random object from the given list.
*/ | Pick a random object from the given list | randomFrom | {
"repo_name": "carrotsearch/randomizedtesting",
"path": "randomized-runner/src/main/java/com/carrotsearch/randomizedtesting/generators/RandomPicks.java",
"license": "apache-2.0",
"size": 2364
} | [
"java.util.List",
"java.util.Random"
] | import java.util.List; import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 2,082,332 |
public Column<C, T> setRenderer(Renderer<? super C> renderer)
throws IllegalArgumentException {
if (renderer == null) {
throw new IllegalArgumentException("Renderer cannot be null.");
}
if (renderer != bodyRenderer) {
// Variab... | Column<C, T> function(Renderer<? super C> renderer) throws IllegalArgumentException { if (renderer == null) { throw new IllegalArgumentException(STR); } if (renderer != bodyRenderer) { boolean columnRemoved = false; double widthInConfiguration = 0.0d; ColumnConfiguration conf = null; int index = 0; if (!isHidden() && g... | /**
* Sets a custom {@link Renderer} for this column.
*
* @param renderer
* The renderer to use for rendering the cells
* @return the column itself
*
* @throws IllegalArgumentException
* if given Renderer is null
*/ | Sets a custom <code>Renderer</code> for this column | setRenderer | {
"repo_name": "kironapublic/vaadin",
"path": "client/src/main/java/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 330612
} | [
"com.vaadin.client.renderers.ComplexRenderer",
"com.vaadin.client.renderers.Renderer",
"com.vaadin.client.renderers.WidgetRenderer",
"com.vaadin.client.widget.escalator.ColumnConfiguration"
] | import com.vaadin.client.renderers.ComplexRenderer; import com.vaadin.client.renderers.Renderer; import com.vaadin.client.renderers.WidgetRenderer; import com.vaadin.client.widget.escalator.ColumnConfiguration; | import com.vaadin.client.renderers.*; import com.vaadin.client.widget.escalator.*; | [
"com.vaadin.client"
] | com.vaadin.client; | 839,192 |
public void setFunctionDescriptor(FunctionDescriptor fd) {
this.descriptor = fd;
}
| void function(FunctionDescriptor fd) { this.descriptor = fd; } | /**
* Set the descriptor for this function.
* @param fd Function descriptor
*/ | Set the descriptor for this function | setFunctionDescriptor | {
"repo_name": "jagazee/teiid-8.7",
"path": "engine/src/main/java/org/teiid/query/sql/symbol/Function.java",
"license": "lgpl-2.1",
"size": 7099
} | [
"org.teiid.query.function.FunctionDescriptor"
] | import org.teiid.query.function.FunctionDescriptor; | import org.teiid.query.function.*; | [
"org.teiid.query"
] | org.teiid.query; | 2,748,213 |
public void testImportResourceTranslator() throws Exception {
echo("Testing resource translator for import");
CmsObject cms = OpenCms.initCmsObject(getCmsObject());
cms.getRequestContext().setSiteRoot("/");
// need to create the "galleries" folder manually
cms.createResour... | void function() throws Exception { echo(STR); CmsObject cms = OpenCms.initCmsObject(getCmsObject()); cms.getRequestContext().setSiteRoot("/"); cms.createResource(STR, CmsResourceTypeFolder.RESOURCE_TYPE_ID); cms.unlockResource(STR); CmsResourceTranslator oldFolderTranslator = OpenCms.getResourceManager().getFolderTrans... | /**
* Tests the resource translation during import.<p>
*
* @throws Exception if something goes wrong
*/ | Tests the resource translation during import | testImportResourceTranslator | {
"repo_name": "mediaworx/opencms-core",
"path": "test/org/opencms/importexport/TestCmsImportExport.java",
"license": "lgpl-2.1",
"size": 81962
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.opencms.file.CmsFile",
"org.opencms.file.CmsObject",
"org.opencms.file.CmsResource",
"org.opencms.file.CmsResourceFilter",
"org.opencms.file.types.CmsResourceTypeFolder",
"org.opencms.file.types.CmsResourceTypeXmlPage",
"org.openc... | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.opencms.file.CmsFile; import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.file.types.CmsResourceTypeFolder; import org.opencms.file.types.CmsResource... | import java.util.*; import org.opencms.file.*; import org.opencms.file.types.*; import org.opencms.i18n.*; import org.opencms.main.*; import org.opencms.relations.*; import org.opencms.report.*; import org.opencms.staticexport.*; import org.opencms.util.*; import org.opencms.xml.page.*; | [
"java.util",
"org.opencms.file",
"org.opencms.i18n",
"org.opencms.main",
"org.opencms.relations",
"org.opencms.report",
"org.opencms.staticexport",
"org.opencms.util",
"org.opencms.xml"
] | java.util; org.opencms.file; org.opencms.i18n; org.opencms.main; org.opencms.relations; org.opencms.report; org.opencms.staticexport; org.opencms.util; org.opencms.xml; | 1,604,335 |
@ProgressDialogView.Indicator
public int progressIndicator() {
return progressIndicator;
} | @ProgressDialogView.Indicator int function() { return progressIndicator; } | /**
* Returns the progress indicator type, set to these options.
* <p>
* Default value: <b>{@link ProgressDialogView#INDICATOR_PROGRESS INDICATOR_PROGRESS} | {@link ProgressDialogView#INDICATOR_TIME INDICATOR_TIME}</b>
*
* @return Progress indicator flags.
* @see #p... | Returns the progress indicator type, set to these options. Default value: <code>ProgressDialogView#INDICATOR_PROGRESS INDICATOR_PROGRESS</code> | <code>ProgressDialogView#INDICATOR_TIME INDICATOR_TIME</code> | progressIndicator | {
"repo_name": "albedinsky/android_dialogs",
"path": "library/src/common/progress/java/com/albedinsky/android/dialog/ProgressDialog.java",
"license": "apache-2.0",
"size": 21247
} | [
"com.albedinsky.android.dialog.view.ProgressDialogView"
] | import com.albedinsky.android.dialog.view.ProgressDialogView; | import com.albedinsky.android.dialog.view.*; | [
"com.albedinsky.android"
] | com.albedinsky.android; | 1,321,373 |
public static Event lookup(SQLConnection sql, int eid)
throws ApiException {
// Null check everything:
OMUtil.sqlCheck(sql);
OMUtil.nullCheck(eid);
ResultSet result = EventsTable.lookupEvent(sql, eid);
// Build Event object.
try {
// Get the fir... | static Event function(SQLConnection sql, int eid) throws ApiException { OMUtil.sqlCheck(sql); OMUtil.nullCheck(eid); ResultSet result = EventsTable.lookupEvent(sql, eid); try { if (!result.next()) { throw new ApiException(ApiStatus.APP_EVENT_NOT_EXIST); } return new Event(result.getInt("eid"), result.getString("name"),... | /**
* Looks up an event in the datatier and returns it as a Event object.
* @throws ApiException With APP_EVENT_NOT_EXIST if event doesn't exist
* or another code if SQL error occurs.
* @param sql The SQL connection.
* @param eid The id of the event to look up.
* @return A new event object... | Looks up an event in the datatier and returns it as a Event object | lookup | {
"repo_name": "gundermanc/pinata",
"path": "service/src/main/java/com/pinata/service/objectmodel/Event.java",
"license": "lgpl-3.0",
"size": 6929
} | [
"com.pinata.service.datatier.EventsTable",
"com.pinata.service.datatier.SQLConnection",
"com.pinata.shared.ApiException",
"com.pinata.shared.ApiStatus",
"java.sql.ResultSet",
"java.sql.SQLException"
] | import com.pinata.service.datatier.EventsTable; import com.pinata.service.datatier.SQLConnection; import com.pinata.shared.ApiException; import com.pinata.shared.ApiStatus; import java.sql.ResultSet; import java.sql.SQLException; | import com.pinata.service.datatier.*; import com.pinata.shared.*; import java.sql.*; | [
"com.pinata.service",
"com.pinata.shared",
"java.sql"
] | com.pinata.service; com.pinata.shared; java.sql; | 2,815,800 |
protected long readLong() throws IOException {
long l = 0;
for(int i = 0; i < 8; i++) {
l <<= 8;
l |= read();
}
return l;
} | long function() throws IOException { long l = 0; for(int i = 0; i < 8; i++) { l <<= 8; l = read(); } return l; } | /** Reads a long at the current pointer.
*
* @return the long at the current pointer.
*/ | Reads a long at the current pointer | readLong | {
"repo_name": "guillaumepitel/BUbiNG",
"path": "src/it/unimi/di/law/bubing/util/ByteArrayDiskQueues.java",
"license": "apache-2.0",
"size": 21815
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 798,376 |
@SuppressWarnings("unused")
private void setPickedAmount(BigDecimal pickedAmount) {
this.pickedAmount = pickedAmount;
} | @SuppressWarnings(STR) void function(BigDecimal pickedAmount) { this.pickedAmount = pickedAmount; } | /**
* Setter for property pickedAmount. This method is used to support
* hibernate. That is because it is private.
*
* @param pickedAmount
* New value of property pickedAmount.
*/ | Setter for property pickedAmount. This method is used to support hibernate. That is because it is private | setPickedAmount | {
"repo_name": "Jacksson/mywms",
"path": "server.app/los.inventory-ejb/src/de/linogistix/los/inventory/pick/model/LOSPickRequestPosition.java",
"license": "gpl-2.0",
"size": 11997
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 1,348,660 |
public boolean isLocalOnlyExecutionMode() {
// Always allow spark to run in a cluster mode. Without this, depending on
// user's local hadoop settings, true may be returned, which causes plan to be
// stored in local path.
if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("spar... | boolean function() { if (HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_ENGINE).equals("spark")) { return false; } return ShimLoader.getHadoopShims().isLocalMode(conf); } | /**
* Does Hive wants to run tasks entirely on the local machine
* (where the query is being compiled)?
*
* Today this translates into running hadoop jobs locally
*/ | Does Hive wants to run tasks entirely on the local machine (where the query is being compiled)? Today this translates into running hadoop jobs locally | isLocalOnlyExecutionMode | {
"repo_name": "jcamachor/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/Context.java",
"license": "apache-2.0",
"size": 43612
} | [
"org.apache.hadoop.hive.conf.HiveConf",
"org.apache.hadoop.hive.shims.ShimLoader"
] | import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.shims.ShimLoader; | import org.apache.hadoop.hive.conf.*; import org.apache.hadoop.hive.shims.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,362,518 |
@Override
public Vector2i getPreferredContentSize(Canvas canvas, Vector2i areaHint) {
Font font = canvas.getCurrentStyle().getFont();
if (isMultiline()) {
List<String> lines = TextLineBuilder.getLines(font, text.get(), areaHint.x);
return font.getSize(lines);
} el... | Vector2i function(Canvas canvas, Vector2i areaHint) { Font font = canvas.getCurrentStyle().getFont(); if (isMultiline()) { List<String> lines = TextLineBuilder.getLines(font, text.get(), areaHint.x); return font.getSize(lines); } else { return new Vector2i(font.getWidth(getText()), font.getLineHeight()); } } | /**
* Get the preferred content size of the widget.
*
* @param canvas The canvas on which the widget resides
* @param areaHint A suggestion for the preferred size of the widget
* @return The preferred content size of the widget
*/ | Get the preferred content size of the widget | getPreferredContentSize | {
"repo_name": "DPirate/Terasology",
"path": "engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java",
"license": "apache-2.0",
"size": 33992
} | [
"java.util.List",
"org.terasology.math.geom.Vector2i",
"org.terasology.rendering.assets.font.Font",
"org.terasology.rendering.nui.Canvas",
"org.terasology.rendering.nui.TextLineBuilder"
] | import java.util.List; import org.terasology.math.geom.Vector2i; import org.terasology.rendering.assets.font.Font; import org.terasology.rendering.nui.Canvas; import org.terasology.rendering.nui.TextLineBuilder; | import java.util.*; import org.terasology.math.geom.*; import org.terasology.rendering.assets.font.*; import org.terasology.rendering.nui.*; | [
"java.util",
"org.terasology.math",
"org.terasology.rendering"
] | java.util; org.terasology.math; org.terasology.rendering; | 982,377 |
public FindOperation<T> min(final BsonDocument min) {
this.min = min;
return this;
} | FindOperation<T> function(final BsonDocument min) { this.min = min; return this; } | /**
* Sets the minimum inclusive lower bound for a specific index. A null value means no max is set.
*
* @param min the min
* @return this
* @since 3.5
*/ | Sets the minimum inclusive lower bound for a specific index. A null value means no max is set | min | {
"repo_name": "jyemin/mongo-java-driver",
"path": "driver-core/src/main/com/mongodb/internal/operation/FindOperation.java",
"license": "apache-2.0",
"size": 35951
} | [
"org.bson.BsonDocument"
] | import org.bson.BsonDocument; | import org.bson.*; | [
"org.bson"
] | org.bson; | 1,984,485 |
@Override
public void dataChanged(FieldIdEnum changedField) {
if (parentObj != null) {
parentObj.dataChanged(changedField);
}
} | void function(FieldIdEnum changedField) { if (parentObj != null) { parentObj.dataChanged(changedField); } } | /**
* Data changed.
*
* @param changedField the changed field
*/ | Data changed | dataChanged | {
"repo_name": "robward-scisys/sldeditor",
"path": "modules/application/src/main/java/com/sldeditor/ui/detail/vendor/geoserver/featuretypestyle/VOGeoServerFTSSortBy.java",
"license": "gpl-3.0",
"size": 12768
} | [
"com.sldeditor.common.xml.ui.FieldIdEnum"
] | import com.sldeditor.common.xml.ui.FieldIdEnum; | import com.sldeditor.common.xml.ui.*; | [
"com.sldeditor.common"
] | com.sldeditor.common; | 418,920 |
private static PlotGroup getGroup1(CSVFile file) throws ParseException{
Series3D series = getSeriesForLinesPlot(file, "JavaQuickSort");
series.append(getSeriesForLinesPlot(file, "ColtQuickSort"));
series.append(getSeriesForLinesPlot(file, "ColtMergeSort"));
List<Plot<?>> pl... | static PlotGroup function(CSVFile file) throws ParseException{ Series3D series = getSeriesForLinesPlot(file, STR); series.append(getSeriesForLinesPlot(file, STR)); series.append(getSeriesForLinesPlot(file, STR)); List<Plot<?>> plots = new ArrayList<Plot<?>>(); plots.add(new PlotLinesClustered(STR, new Labels("Size", ST... | /**
* Returns the first plot group
* @param file
* @return
* @throws ParseException
*/ | Returns the first plot group | getGroup1 | {
"repo_name": "eicherj/subframe",
"path": "src/example/example1/SortEvaluation.java",
"license": "gpl-3.0",
"size": 5862
} | [
"de.linearbits.subframe.graph.Labels",
"de.linearbits.subframe.graph.Plot",
"de.linearbits.subframe.graph.PlotLinesClustered",
"de.linearbits.subframe.graph.Series3D",
"de.linearbits.subframe.io.CSVFile",
"de.linearbits.subframe.render.GnuPlotParams",
"de.linearbits.subframe.render.PlotGroup",
"java.t... | import de.linearbits.subframe.graph.Labels; import de.linearbits.subframe.graph.Plot; import de.linearbits.subframe.graph.PlotLinesClustered; import de.linearbits.subframe.graph.Series3D; import de.linearbits.subframe.io.CSVFile; import de.linearbits.subframe.render.GnuPlotParams; import de.linearbits.subframe.render.P... | import de.linearbits.subframe.graph.*; import de.linearbits.subframe.io.*; import de.linearbits.subframe.render.*; import java.text.*; import java.util.*; | [
"de.linearbits.subframe",
"java.text",
"java.util"
] | de.linearbits.subframe; java.text; java.util; | 1,291,615 |
public void removeListener( final PropertyChangeListener listener ) {
pcs.removePropertyChangeListener( listener );
}
| void function( final PropertyChangeListener listener ) { pcs.removePropertyChangeListener( listener ); } | /**
* Removes a download listener bounded to all download events.
*
* @param listener listener to be removed
*
* @see #addListener(PropertyChangeListener)
*/ | Removes a download listener bounded to all download events | removeListener | {
"repo_name": "icza/scelight",
"path": "src-app/hu/scelight/service/mapdl/MapDownloadManager.java",
"license": "apache-2.0",
"size": 4497
} | [
"java.beans.PropertyChangeListener"
] | import java.beans.PropertyChangeListener; | import java.beans.*; | [
"java.beans"
] | java.beans; | 829,374 |
@Override
public void drawDomainMarker(Graphics2D g2, XYPlot plot,
ValueAxis domainAxis, Marker marker, Rectangle2D dataArea) {
if (marker instanceof ValueMarker) {
ValueMarker vm = (ValueMarker) marker;
double value = vm.getValue();
Range range = ... | void function(Graphics2D g2, XYPlot plot, ValueAxis domainAxis, Marker marker, Rectangle2D dataArea) { if (marker instanceof ValueMarker) { ValueMarker vm = (ValueMarker) marker; double value = vm.getValue(); Range range = domainAxis.getRange(); if (!range.contains(value)) { return; } double v = domainAxis.valueToJava2... | /**
* Draws a line on the chart perpendicular to the x-axis to mark
* a value or range of values.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param domainAxis the domain axis.
* @param marker the marker line.
* @param dataArea the axis data area.
... | Draws a line on the chart perpendicular to the x-axis to mark a value or range of values | drawDomainMarker | {
"repo_name": "jfree/jfreechart-fse",
"path": "src/main/java/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java",
"license": "lgpl-2.1",
"size": 73142
} | [
"java.awt.AlphaComposite",
"java.awt.Composite",
"java.awt.Font",
"java.awt.GradientPaint",
"java.awt.Graphics2D",
"java.awt.Paint",
"java.awt.geom.Line2D",
"java.awt.geom.Point2D",
"java.awt.geom.Rectangle2D",
"org.jfree.chart.axis.ValueAxis",
"org.jfree.chart.plot.IntervalMarker",
"org.jfree... | import java.awt.AlphaComposite; import java.awt.Composite; import java.awt.Font; import java.awt.GradientPaint; import java.awt.Graphics2D; import java.awt.Paint; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.pl... | import java.awt.*; import java.awt.geom.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; import org.jfree.chart.text.*; import org.jfree.chart.ui.*; import org.jfree.data.*; | [
"java.awt",
"org.jfree.chart",
"org.jfree.data"
] | java.awt; org.jfree.chart; org.jfree.data; | 727,169 |
//@PDA jdbc40
public Reader getNCharacterStream(int parameterIndex) throws SQLException
{
synchronized(internalLock_)
{
checkOpen();
SQLData data = null;
// Check if the parameter index refers to the return value parameter.
// If it is not ... | Reader function(int parameterIndex) throws SQLException { synchronized(internalLock_) { checkOpen(); SQLData data = null; if(useReturnValueParameter_ && parameterIndex == 1) { if(!returnValueParameterRegistered_) JDError.throwSQLException(this, JDError.EXC_PARAMETER_TYPE_INVALID); data = returnValueParameter_; } else {... | /**
* Retrieves the value of the designated parameter as a
* <code>java.io.Reader</code> object in the Java programming language.
* It is intended for use when
* accessing <code>NCHAR</code>,<code>NVARCHAR</code>
* and <code>LONGNVARCHAR</code> parameters.
*
* @return a <code>java.io... | Retrieves the value of the designated parameter as a <code>java.io.Reader</code> object in the Java programming language. It is intended for use when accessing <code>NCHAR</code>,<code>NVARCHAR</code> and <code>LONGNVARCHAR</code> parameters | getNCharacterStream | {
"repo_name": "piguangming/jt400",
"path": "cvsroot/src/com/ibm/as400/access/AS400JDBCCallableStatement.java",
"license": "epl-1.0",
"size": 192122
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 840,534 |
public void setFeatures(List<Feature> features) {
for(Feature featu : IProtocol.Feature.values()) {
featuresEnabled.put(featu, false);
}
for(Feature feat : features) {
featuresEnabled.put(feat, true);
}
this.features = features;
}
| void function(List<Feature> features) { for(Feature featu : IProtocol.Feature.values()) { featuresEnabled.put(featu, false); } for(Feature feat : features) { featuresEnabled.put(feat, true); } this.features = features; } | /**
* Sets the features
* @param features
*/ | Sets the features | setFeatures | {
"repo_name": "eggied97/qwirkle",
"path": "qwirkle/src/nl/utwente/ewi/qwirkle/server/connect/ClientHandler.java",
"license": "gpl-2.0",
"size": 4957
} | [
"java.util.List",
"nl.utwente.ewi.qwirkle.protocol.IProtocol"
] | import java.util.List; import nl.utwente.ewi.qwirkle.protocol.IProtocol; | import java.util.*; import nl.utwente.ewi.qwirkle.protocol.*; | [
"java.util",
"nl.utwente.ewi"
] | java.util; nl.utwente.ewi; | 1,093,446 |
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent == null || intent.getAction() == null) {
return START_NOT_STICKY;
}
String action = intent.getAction();
switch (action) {
case ACTION_ADD: {
long uuid... | int function(Intent intent, int flags, int startId) { if (intent == null intent.getAction() == null) { return START_NOT_STICKY; } String action = intent.getAction(); switch (action) { case ACTION_ADD: { long uuid1 = intent.getLongExtra(EXTRA_UUID1, 0); long uuid2 = intent.getLongExtra(EXTRA_UUID2, 0); UUID uuid = new U... | /**
* Executed when service is started by intent
*/ | Executed when service is started by intent | onStartCommand | {
"repo_name": "tobiasschuelke/open-keychain",
"path": "OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/CryptoInputParcelCacheService.java",
"license": "gpl-3.0",
"size": 9464
} | [
"android.content.Intent",
"android.os.Bundle",
"android.os.Message",
"android.os.Messenger",
"android.os.RemoteException",
"java.util.UUID",
"org.sufficientlysecure.keychain.Constants",
"org.sufficientlysecure.keychain.service.input.CryptoInputParcel",
"org.sufficientlysecure.keychain.util.Log"
] | import android.content.Intent; import android.os.Bundle; import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import java.util.UUID; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.service.input.CryptoInputParcel; import org.sufficientlysecu... | import android.content.*; import android.os.*; import java.util.*; import org.sufficientlysecure.keychain.*; import org.sufficientlysecure.keychain.service.input.*; import org.sufficientlysecure.keychain.util.*; | [
"android.content",
"android.os",
"java.util",
"org.sufficientlysecure.keychain"
] | android.content; android.os; java.util; org.sufficientlysecure.keychain; | 1,346,502 |
protected void updateNodeRemoveMeasureUndirectedUnweighted(
UndirectedNode nodeToRemove) {
for (Node undirected1 : this
.getNeighborNodesUndirectedUnweighted(nodeToRemove))
for (Node undirected2 : this
.getNeighborNodesUndirectedUnweighted(undirected1))
if (!undirected2.equals(nodeToRemove))
... | void function( UndirectedNode nodeToRemove) { for (Node undirected1 : this .getNeighborNodesUndirectedUnweighted(nodeToRemove)) for (Node undirected2 : this .getNeighborNodesUndirectedUnweighted(undirected1)) if (!undirected2.equals(nodeToRemove)) for (Node undirected3 : this .getNeighborNodesUndirectedUnweighted(undir... | /**
* Update the dice measure if a node is to be removed
*
* @param nodeToRemove
*/ | Update the dice measure if a node is to be removed | updateNodeRemoveMeasureUndirectedUnweighted | {
"repo_name": "Rwilmes/DNA",
"path": "src/dna/metrics/similarityMeasures/Measures.java",
"license": "gpl-3.0",
"size": 25485
} | [
"dna.graph.nodes.Node",
"dna.graph.nodes.UndirectedNode"
] | import dna.graph.nodes.Node; import dna.graph.nodes.UndirectedNode; | import dna.graph.nodes.*; | [
"dna.graph.nodes"
] | dna.graph.nodes; | 794,712 |
public PropertyNameProcessorMatcher getJavaPropertyNameProcessorMatcher() {
return javaPropertyNameProcessorMatcher;
} | PropertyNameProcessorMatcher function() { return javaPropertyNameProcessorMatcher; } | /**
* Returns the configured PropertyNameProcessorMatcher.<br>
* Default value is PropertyNameProcessorMatcher.DEFAULT<br>
* [JSON -> Java]
*/ | Returns the configured PropertyNameProcessorMatcher. Default value is PropertyNameProcessorMatcher.DEFAULT [JSON -> Java] | getJavaPropertyNameProcessorMatcher | {
"repo_name": "aalmiray/Json-lib",
"path": "subprojects/json-lib-core/src/main/java/org/kordamp/json/JsonConfig.java",
"license": "apache-2.0",
"size": 52525
} | [
"org.kordamp.json.processors.PropertyNameProcessorMatcher"
] | import org.kordamp.json.processors.PropertyNameProcessorMatcher; | import org.kordamp.json.processors.*; | [
"org.kordamp.json"
] | org.kordamp.json; | 1,344,331 |
public void registerContainedBean(String containedBeanName, String containingBeanName) {
synchronized (this.containedBeanMap) {
Set<String> containedBeans = this.containedBeanMap.get(containingBeanName);
if (containedBeans == null) {
containedBeans = new LinkedHashSet<String>(8);
this.containedBeanMa... | void function(String containedBeanName, String containingBeanName) { synchronized (this.containedBeanMap) { Set<String> containedBeans = this.containedBeanMap.get(containingBeanName); if (containedBeans == null) { containedBeans = new LinkedHashSet<String>(8); this.containedBeanMap.put(containingBeanName, containedBean... | /**
* Register a containment relationship between two beans,
* e.g. between an inner bean and its containing outer bean.
* <p>Also registers the containing bean as dependent on the contained bean
* in terms of destruction order.
* @param containedBeanName the name of the contained (inner) bean
* @param cont... | Register a containment relationship between two beans, e.g. between an inner bean and its containing outer bean. Also registers the containing bean as dependent on the contained bean in terms of destruction order | registerContainedBean | {
"repo_name": "kingtang/spring-learn",
"path": "spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java",
"license": "gpl-3.0",
"size": 23287
} | [
"java.util.LinkedHashSet",
"java.util.Set"
] | import java.util.LinkedHashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 933,499 |
public Observable<ServiceResponse<VirtualRouterPeeringInner>> updateWithServiceResponseAsync(String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter t... | Observable<ServiceResponse<VirtualRouterPeeringInner>> function(String resourceGroupName, String virtualRouterName, String peeringName, VirtualRouterPeeringInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumen... | /**
* Updates a Virtual Router Peering.
*
* @param resourceGroupName The resource group name of the Virtual Router Peering.
* @param virtualRouterName The name of the Virtual Router.
* @param peeringName The name of the Virtual Router Peering being updated.
* @param parameters Parameters s... | Updates a Virtual Router Peering | updateWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_07_01/src/main/java/com/microsoft/azure/management/network/v2019_07_01/implementation/VirtualRouterPeeringsInner.java",
"license": "mit",
"size": 53110
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 855,321 |
boolean upstreamAppHasPartitionInfo(StreamDefinition stream, StreamAppDefinition currentApp,
Map<String, String> streamDeploymentProperties) {
Iterator<StreamAppDefinition> iterator = stream.getDeploymentOrderIterator();
while (iterator.hasNext()) {
StreamAppDefinition app = iterator.next();
if (app.eq... | boolean upstreamAppHasPartitionInfo(StreamDefinition stream, StreamAppDefinition currentApp, Map<String, String> streamDeploymentProperties) { Iterator<StreamAppDefinition> iterator = stream.getDeploymentOrderIterator(); while (iterator.hasNext()) { StreamAppDefinition app = iterator.next(); if (app.equals(currentApp) ... | /**
* Return {@code true} if the upstream app (the app that appears before the provided app)
* contains partition related properties.
*
* @param stream stream for the app
* @param currentApp app for which to determine if the upstream app has partition
* properties
* @param streamDeploymentProperties deplo... | Return true if the upstream app (the app that appears before the provided app) contains partition related properties | upstreamAppHasPartitionInfo | {
"repo_name": "trisberg/spring-cloud-dataflow",
"path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/service/impl/AppDeploymentRequestCreator.java",
"license": "apache-2.0",
"size": 17180
} | [
"java.util.Iterator",
"java.util.Map",
"org.springframework.cloud.dataflow.core.BindingPropertyKeys",
"org.springframework.cloud.dataflow.core.StreamAppDefinition",
"org.springframework.cloud.dataflow.core.StreamDefinition"
] | import java.util.Iterator; import java.util.Map; import org.springframework.cloud.dataflow.core.BindingPropertyKeys; import org.springframework.cloud.dataflow.core.StreamAppDefinition; import org.springframework.cloud.dataflow.core.StreamDefinition; | import java.util.*; import org.springframework.cloud.dataflow.core.*; | [
"java.util",
"org.springframework.cloud"
] | java.util; org.springframework.cloud; | 2,119,383 |
public void setFeatures(Map<String, List<org.geomajas.layer.feature.Feature>> featureMap) {
MapModel mapModel = mapWidget.getMapModel();
for (Entry<String, List<org.geomajas.layer.feature.Feature>> clientLayerId : featureMap.entrySet()) {
Layer<?> layer = mapModel.getLayer(clientLayerId.getKey());
if (nul... | void function(Map<String, List<org.geomajas.layer.feature.Feature>> featureMap) { MapModel mapModel = mapWidget.getMapModel(); for (Entry<String, List<org.geomajas.layer.feature.Feature>> clientLayerId : featureMap.entrySet()) { Layer<?> layer = mapModel.getLayer(clientLayerId.getKey()); if (null != layer) { List<org.g... | /**
* Feed a map of features to the widget, so it can be built.
*
* @param featureMap feature map
*/ | Feed a map of features to the widget, so it can be built | setFeatures | {
"repo_name": "geomajas/geomajas-project-client-gwt",
"path": "plugin/widget-featureinfo/featureinfo-gwt/src/main/java/org/geomajas/widget/featureinfo/client/widget/MultiLayerFeaturesList.java",
"license": "agpl-3.0",
"size": 9757
} | [
"java.util.List",
"java.util.Map",
"org.geomajas.gwt.client.map.MapModel",
"org.geomajas.gwt.client.map.feature.Feature",
"org.geomajas.gwt.client.map.layer.Layer"
] | import java.util.List; import java.util.Map; import org.geomajas.gwt.client.map.MapModel; import org.geomajas.gwt.client.map.feature.Feature; import org.geomajas.gwt.client.map.layer.Layer; | import java.util.*; import org.geomajas.gwt.client.map.*; import org.geomajas.gwt.client.map.feature.*; import org.geomajas.gwt.client.map.layer.*; | [
"java.util",
"org.geomajas.gwt"
] | java.util; org.geomajas.gwt; | 1,840,079 |
private static long validateDimensions(long d1, long d2) {
if(d1 >= 0 && d2 >= 0 && d1 != d2) {
throw new DMLRuntimeException("Incorrect dimensions:" + d1 + " != " + d2);
}
return Math.max(d1, d2);
} | static long function(long d1, long d2) { if(d1 >= 0 && d2 >= 0 && d1 != d2) { throw new DMLRuntimeException(STR + d1 + STR + d2); } return Math.max(d1, d2); } | /**
* Compares two potential dimensions d1 and d2 and return the one which is not -1.
* This method is useful when the dimensions are not known at compile time, but are known at runtime.
*
* @param d1 dimension1
* @param d2 dimension1
* @return valid d1 or d2
*/ | Compares two potential dimensions d1 and d2 and return the one which is not -1. This method is useful when the dimensions are not known at compile time, but are known at runtime | validateDimensions | {
"repo_name": "nakul02/systemml",
"path": "src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java",
"license": "apache-2.0",
"size": 24425
} | [
"org.apache.sysml.runtime.DMLRuntimeException"
] | import org.apache.sysml.runtime.DMLRuntimeException; | import org.apache.sysml.runtime.*; | [
"org.apache.sysml"
] | org.apache.sysml; | 212,302 |
private void clean() {
if (admin) {
for (Set<URL> providers : new HashSet<Set<URL>>(received.values())) {
for (URL url : new HashSet<URL>(providers)) {
if (isExpired(url)) {
if (logger.isWarnEnabled()) {
... | void function() { if (admin) { for (Set<URL> providers : new HashSet<Set<URL>>(received.values())) { for (URL url : new HashSet<URL>(providers)) { if (isExpired(url)) { if (logger.isWarnEnabled()) { logger.warn(STR + url); } doUnregister(url); } } } } } | /**
* Remove the expired providers, only when "clean" parameter is true.
*/ | Remove the expired providers, only when "clean" parameter is true | clean | {
"repo_name": "yuyijq/dubbo",
"path": "dubbo-registry/dubbo-registry-multicast/src/main/java/org/apache/dubbo/registry/multicast/MulticastRegistry.java",
"license": "apache-2.0",
"size": 16942
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,716,194 |
@Override
public void getTrackingPart(TrackingParameter trackingParameter, StringBuffer url)
{
addParametersArray(trackingParameter, url, KEYZ);
//if ecom trackingParameter are given, append them to the url as well
addKeyMap(trackingParameter.getEcomParameter... | void function(TrackingParameter trackingParameter, StringBuffer url) { addParametersArray(trackingParameter, url, KEYZ); addKeyMap(trackingParameter.getEcomParameter(), "&"+ Parameter.ECOM, url); addKeyMap(trackingParameter.getAdParameter(), "&" + Parameter.AD, url); addKeyMap(trackingParameter.getPageParameter(), "&" ... | /**
* Fills url buffer based on tracking parameters. use some help function.
* @param trackingParameter
* @param url
*/ | Fills url buffer based on tracking parameters. use some help function | getTrackingPart | {
"repo_name": "Webtrekk/webtrekk-android-sdk",
"path": "webtrekk_sdk/src/main/java/com/webtrekk/webtrekksdk/Request/TrackingRequest.java",
"license": "mit",
"size": 23583
} | [
"com.webtrekk.webtrekksdk.TrackingParameter"
] | import com.webtrekk.webtrekksdk.TrackingParameter; | import com.webtrekk.webtrekksdk.*; | [
"com.webtrekk.webtrekksdk"
] | com.webtrekk.webtrekksdk; | 2,149,291 |
public static Category createCategory(String name) {
return CategoryManagerImpl.getInstance().createCategory(name);
} | static Category function(String name) { return CategoryManagerImpl.getInstance().createCategory(name); } | /** Creates a new Category object and adds it to the list
* @return If successful, returns the newly created Category. Otherwise, returns null.
* @param name Name of Category to add
*/ | Creates a new Category object and adds it to the list | createCategory | {
"repo_name": "BiglySoftware/BiglyBT",
"path": "core/src/com/biglybt/core/category/CategoryManager.java",
"license": "gpl-2.0",
"size": 3011
} | [
"com.biglybt.core.category.impl.CategoryManagerImpl"
] | import com.biglybt.core.category.impl.CategoryManagerImpl; | import com.biglybt.core.category.impl.*; | [
"com.biglybt.core"
] | com.biglybt.core; | 1,042,017 |
public void clear() throws IOException {
synchronized (this) {
int numberOfTries = 2;
while (numberOfTries > 0) {
Connection _conn = getConnection();
if (_conn == null) {
return;
}
try {
... | void function() throws IOException { synchronized (this) { int numberOfTries = 2; while (numberOfTries > 0) { Connection _conn = getConnection(); if (_conn == null) { return; } try { if (preparedClearSql == null) { String clearSql = STR + sessionTable + STR + sessionAppCol + STR; preparedClearSql = _conn.prepareStateme... | /**
* Remove all of the Sessions in this Store.
*
* @exception IOException if an input/output error occurs
*/ | Remove all of the Sessions in this Store | clear | {
"repo_name": "plumer/codana",
"path": "tomcat_files/6.0.0/JDBCStore.java",
"license": "mit",
"size": 31912
} | [
"java.io.IOException",
"java.sql.Connection",
"java.sql.SQLException"
] | import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 1,733,705 |
public void removeLayoutComponent(Component component)
{
// Nothing to do here.
} | void function(Component component) { } | /**
* This method is not used in this layout manager.
*
* @param component not used here
*/ | This method is not used in this layout manager | removeLayoutComponent | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/OverlayLayout.java",
"license": "bsd-3-clause",
"size": 13141
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,745,542 |
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
{
this.checkForDrop(worldIn, pos, state);
} | void function(IBlockState state, World worldIn, BlockPos pos, Block blockIn) { this.checkForDrop(worldIn, pos, state); } | /**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/ | Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid block, etc | neighborChanged | {
"repo_name": "danielyc/test-1.9.4",
"path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockCarpet.java",
"license": "gpl-3.0",
"size": 4644
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; | import net.minecraft.block.state.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.util; net.minecraft.world; | 1,026,716 |
int deleteByExample(DeployTaskApiExample example); | int deleteByExample(DeployTaskApiExample example); | /**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table deploy_task_api
*
* @mbggenerated
*/ | This method was generated by MyBatis Generator. This method corresponds to the database table deploy_task_api | deleteByExample | {
"repo_name": "leonindy/camel",
"path": "camel-admin/src/main/java/com/dianping/phoenix/lb/deploy/dao/api/DeployTaskApiMapper.java",
"license": "gpl-3.0",
"size": 3911
} | [
"com.dianping.phoenix.lb.deploy.model.api.DeployTaskApiExample"
] | import com.dianping.phoenix.lb.deploy.model.api.DeployTaskApiExample; | import com.dianping.phoenix.lb.deploy.model.api.*; | [
"com.dianping.phoenix"
] | com.dianping.phoenix; | 831,207 |
public void flush()
{
if ( _line.length() > 0 || _text.length() > 0 )
breakLine();
try {
_writer.flush();
} catch ( IOException except ) {
// We don't throw an exception, but hold it
// until the end of the document.
if ( _excep... | void function() { if ( _line.length() > 0 _text.length() > 0 ) breakLine(); try { _writer.flush(); } catch ( IOException except ) { if ( _exception == null ) _exception = except; } } | /**
* Flush the output stream. Must be called when done printing
* the document, otherwise some text might be buffered.
*/ | Flush the output stream. Must be called when done printing the document, otherwise some text might be buffered | flush | {
"repo_name": "RackerWilliams/xercesj",
"path": "src/org/apache/xml/serialize/IndentPrinter.java",
"license": "apache-2.0",
"size": 11992
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 851,221 |
public String readFile(String workingDir,String fileName){
File dir =new File(workingDir);
String result = "";
try{
FileReader file = new FileReader(new File(dir,fileName));
BufferedReader buff = new BufferedReader(file);
boolean eof=false;
while(!eof){
if (result.length() > maxSize... | String function(String workingDir,String fileName){ File dir =new File(workingDir); String result = STR(... File too large to display fully. File truncated ...)STR\nSTR"; } return result; } | /**
* Utility function for getCurrentBuffer to read a file into the buffer if this has not been done
* before.
* @param workingDir dir of file to read
* @param fileName of file to read
* @return string with contents of the file
*/ | Utility function for getCurrentBuffer to read a file into the buffer if this has not been done before | readFile | {
"repo_name": "OpenDA-Association/OpenDA",
"path": "application/java/src/org/openda/application/gui/InputTree.java",
"license": "lgpl-3.0",
"size": 10818
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,552,215 |
DHTToken get(InetAddress addr, int port, byte[] secret); | DHTToken get(InetAddress addr, int port, byte[] secret); | /**
* Gets a token.
* @param addr address
* @param port port
* @param secret secret
* @return DHTToken
*/ | Gets a token | get | {
"repo_name": "mfriesen/cthulhu-dht",
"path": "src/main/java/ca/gobits/dht/server/queue/DHTTokenQueue.java",
"license": "apache-2.0",
"size": 2275
} | [
"ca.gobits.dht.DHTToken",
"java.net.InetAddress"
] | import ca.gobits.dht.DHTToken; import java.net.InetAddress; | import ca.gobits.dht.*; import java.net.*; | [
"ca.gobits.dht",
"java.net"
] | ca.gobits.dht; java.net; | 2,514,540 |
private void create_uuid_map()
{
this.uuid_map = new HashMap<>();
for(Rpc rpc : this.rpcs)
{
this.uuid_map.put(rpc.get_transaction_uuid(), rpc);
}
} | void function() { this.uuid_map = new HashMap<>(); for(Rpc rpc : this.rpcs) { this.uuid_map.put(rpc.get_transaction_uuid(), rpc); } } | /**
* Maps all transaction UUIDs to their respective transaction
*/ | Maps all transaction UUIDs to their respective transaction | create_uuid_map | {
"repo_name": "OpenHC/OHC-android",
"path": "app/src/main/java/io/openhc/ohc/basestation/rpc/Rpc_group.java",
"license": "mit",
"size": 6467
} | [
"io.openhc.ohc.basestation.rpc.rpcs.Rpc",
"java.util.HashMap"
] | import io.openhc.ohc.basestation.rpc.rpcs.Rpc; import java.util.HashMap; | import io.openhc.ohc.basestation.rpc.rpcs.*; import java.util.*; | [
"io.openhc.ohc",
"java.util"
] | io.openhc.ohc; java.util; | 2,817,430 |
public void beforeTestMethod(TestInstance testInstance, Annotations<A> annotations) {
}
| void function(TestInstance testInstance, Annotations<A> annotations) { } | /**
* Invoked before the test but after the test setup (eg @Before) is run.
* This can be overridden to for example further initialize the test-fixture using values that were set during
* the test setup.
*
* @param testInstance The test instance, not null
* @param annotations The an... | Invoked before the test but after the test setup (eg @Before) is run. This can be overridden to for example further initialize the test-fixture using values that were set during the test setup | beforeTestMethod | {
"repo_name": "Silvermedia/unitils",
"path": "unitils-core/src/main/java/org/unitils/core/TestAnnotationListener.java",
"license": "apache-2.0",
"size": 2920
} | [
"org.unitils.core.reflect.Annotations"
] | import org.unitils.core.reflect.Annotations; | import org.unitils.core.reflect.*; | [
"org.unitils.core"
] | org.unitils.core; | 1,299,891 |
private void addNamespace(
ModuleMetadataBuilder module, String namespace, NodeTraversal t, Node n) {
if (!isValidNamespaceOrModuleId(namespace)) {
compiler.report(JSError.make(n, INVALID_NAMESPACE_OR_MODULE_ID, namespace));
}
ModuleType existingType = null;
String existingF... | void function( ModuleMetadataBuilder module, String namespace, NodeTraversal t, Node n) { if (!isValidNamespaceOrModuleId(namespace)) { compiler.report(JSError.make(n, INVALID_NAMESPACE_OR_MODULE_ID, namespace)); } ModuleType existingType = null; String existingFileSource = null; if (module.googNamespaces.contains(name... | /**
* Adds the namespaces to the module and checks if the given Closure namespace is a duplicate or
* not.
*/ | Adds the namespaces to the module and checks if the given Closure namespace is a duplicate or not | addNamespace | {
"repo_name": "vobruba-martin/closure-compiler",
"path": "src/com/google/javascript/jscomp/GatherModuleMetadata.java",
"license": "apache-2.0",
"size": 19647
} | [
"com.google.javascript.jscomp.modules.ModuleMetadataMap",
"com.google.javascript.rhino.Node"
] | import com.google.javascript.jscomp.modules.ModuleMetadataMap; import com.google.javascript.rhino.Node; | import com.google.javascript.jscomp.modules.*; import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 1,005,481 |
public void saveCacheConfiguration(DynamicCacheDescriptor desc) throws IgniteCheckedException {
assert desc != null;
locCfgMgr.saveCacheConfiguration(desc.toStoredData(splitter), true);
} | void function(DynamicCacheDescriptor desc) throws IgniteCheckedException { assert desc != null; locCfgMgr.saveCacheConfiguration(desc.toStoredData(splitter), true); } | /**
* Save cache configuration to persistent store if necessary.
*
* @param desc Cache descriptor.
*/ | Save cache configuration to persistent store if necessary | saveCacheConfiguration | {
"repo_name": "SomeFire/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java",
"license": "apache-2.0",
"size": 207339
} | [
"org.apache.ignite.IgniteCheckedException"
] | import org.apache.ignite.IgniteCheckedException; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,420,345 |
private void cacheBitmap(Bitmap bitmap, String fileName) {
if (this.cache != null) {
this.cache.put(bitmap, fileName);
}
} | void function(Bitmap bitmap, String fileName) { if (this.cache != null) { this.cache.put(bitmap, fileName); } } | /**
* Cache an image using the internal cache.
*
* @param bitmap The bitmap to cache.
* @param fileName The file name used for caching the bitmap.
*/ | Cache an image using the internal cache | cacheBitmap | {
"repo_name": "nanyi5452/cleanDemo",
"path": "presentation/src/main/java/com/fernandocejas/android10/sample/presentation/view/component/AutoLoadImageView.java",
"license": "apache-2.0",
"size": 10757
} | [
"android.graphics.Bitmap"
] | import android.graphics.Bitmap; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,100,146 |
public static void loadGlyphs(UnicodeFont font, char c) {
font.addGlyphs(c, c);
try {
font.loadGlyphs();
} catch (SlickException e) {
Log.warn(String.format("Failed to load glyphs for codepoint '%d'.", (int) c), e);
}
} | static void function(UnicodeFont font, char c) { font.addGlyphs(c, c); try { font.loadGlyphs(); } catch (SlickException e) { Log.warn(String.format(STR, (int) c), e); } } | /**
* Adds and loads glyphs for a font.
* @param font the font to add the glyphs to
* @param c the character to load
*/ | Adds and loads glyphs for a font | loadGlyphs | {
"repo_name": "yugecin/opsu",
"path": "src/itdelatrisu/opsu/ui/Fonts.java",
"license": "gpl-3.0",
"size": 6599
} | [
"org.newdawn.slick.SlickException",
"org.newdawn.slick.UnicodeFont",
"org.newdawn.slick.util.Log"
] | import org.newdawn.slick.SlickException; import org.newdawn.slick.UnicodeFont; import org.newdawn.slick.util.Log; | import org.newdawn.slick.*; import org.newdawn.slick.util.*; | [
"org.newdawn.slick"
] | org.newdawn.slick; | 38,922 |
void save(Site site) throws IdUnusedException, PermissionException; | void save(Site site) throws IdUnusedException, PermissionException; | /**
* Save any updates to this site - it must be a defined site (the id must exist) and the user must have update permissions.
*
* @param site
* The site, modified, to save.
* @throws IdUnusedException
* If the site's id is not a defined site id.
* @throws PermissionException
* I... | Save any updates to this site - it must be a defined site (the id must exist) and the user must have update permissions | save | {
"repo_name": "harfalm/Sakai-10.1",
"path": "kernel/api/src/main/java/org/sakaiproject/site/api/SiteService.java",
"license": "apache-2.0",
"size": 39195
} | [
"org.sakaiproject.exception.IdUnusedException",
"org.sakaiproject.exception.PermissionException"
] | import org.sakaiproject.exception.IdUnusedException; import org.sakaiproject.exception.PermissionException; | import org.sakaiproject.exception.*; | [
"org.sakaiproject.exception"
] | org.sakaiproject.exception; | 1,818,298 |
public static CompletableFuture<DocumentLock> lockAsync(Document document, Consumer<Throwable> onError, String operation, int lockIntervalInSeconds) {
DocumentLockRequestHandler dlrh = new DocumentLockRequestHandler(document);
dlrh.setLockIntervalInSeconds(lockIntervalInSeconds);
return Docu... | static CompletableFuture<DocumentLock> function(Document document, Consumer<Throwable> onError, String operation, int lockIntervalInSeconds) { DocumentLockRequestHandler dlrh = new DocumentLockRequestHandler(document); dlrh.setLockIntervalInSeconds(lockIntervalInSeconds); return DocumentLock.createAsync(operation, onEr... | /**
* Locks this instance and returns a DocumentLock object which can be used to unlock this document later.
*
* @param document The document
* @param onError Action which is called on error
* @param operation A client identifier associated with lock operation
* @param lockIntervalInSe... | Locks this instance and returns a DocumentLock object which can be used to unlock this document later | lockAsync | {
"repo_name": "DocuWare/PlatformJavaClient",
"path": "src/com/docuware/dev/Extensions/DocumentLockExtensions.java",
"license": "mit",
"size": 3168
} | [
"com.docuware.dev.schema._public.services.platform.Document",
"java.util.concurrent.CompletableFuture",
"java.util.function.Consumer"
] | import com.docuware.dev.schema._public.services.platform.Document; import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; | import com.docuware.dev.schema._public.services.platform.*; import java.util.concurrent.*; import java.util.function.*; | [
"com.docuware.dev",
"java.util"
] | com.docuware.dev; java.util; | 2,645,408 |
public boolean setCurrentTemplateId(String templateId) {
Template template;
try {
template = TemplateFactory.getDiskTemplates(request.getSession().getServletContext()).get(templateId);
} catch (Exception e) {
e.printStackTrace();
return false;
}
if (template == null) {
return false;
} else {
... | boolean function(String templateId) { Template template; try { template = TemplateFactory.getDiskTemplates(request.getSession().getServletContext()).get(templateId); } catch (Exception e) { e.printStackTrace(); return false; } if (template == null) { return false; } else { setCurrentTemplate(template); return true; } } | /**
* set the current template with id.
*
* @param templateId
* @return false if template not found else true
*/ | set the current template with id | setCurrentTemplateId | {
"repo_name": "Javlo/javlo",
"path": "src/main/java/org/javlo/context/ContentContext.java",
"license": "lgpl-3.0",
"size": 62898
} | [
"org.javlo.template.Template",
"org.javlo.template.TemplateFactory"
] | import org.javlo.template.Template; import org.javlo.template.TemplateFactory; | import org.javlo.template.*; | [
"org.javlo.template"
] | org.javlo.template; | 2,807,915 |
private void addmem(Integer bignum, Integer smallnum){
String big ,small;
big = getKeyFromValue(hashSampledValue, hashPix.get(bignum));
small = getKeyFromValue(hashSampledValue, hashPix.get(smallnum));
String buf = big + "_" + small + "_membrane";
ArrayList<String> adjacentDom = new ArrayList<String>();
... | void function(Integer bignum, Integer smallnum){ String big ,small; big = getKeyFromValue(hashSampledValue, hashPix.get(bignum)); small = getKeyFromValue(hashSampledValue, hashPix.get(smallnum)); String buf = big + "_" + small + STR; ArrayList<String> adjacentDom = new ArrayList<String>(); adjacentDom.add(big + getInde... | /**
* Add a membrane between given two labels (domains).
*
* @param bignum the label of pixel which has higher value
* @param smallnum the label of pixel which has lower value
*/ | Add a membrane between given two labels (domains) | addmem | {
"repo_name": "spatialsimulator/XitoSBML",
"path": "src/main/java/jp/ac/keio/bio/fun/xitosbml/image/ImageEdit.java",
"license": "apache-2.0",
"size": 15770
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,304,306 |
public static CommandLineParser parser(ErrorReporter errorReporter) {
return new ApacheCommonsCommandLineParser(new ApacheFormatterHelpReporter(), errorReporter != null ? errorReporter : NO_OP);
} | static CommandLineParser function(ErrorReporter errorReporter) { return new ApacheCommonsCommandLineParser(new ApacheFormatterHelpReporter(), errorReporter != null ? errorReporter : NO_OP); } | /**
* A {@link CommandLineParser} instance that encapsulates
* {@link org.apache.commons.cli.CommandLineParser} from
* commons-cli.
*
* @param errorReporter ErrorReporter optional, when null,
* {@link #NO_OP} no-op reporter is used.
* @return CommandLineParser
... | A <code>CommandLineParser</code> instance that encapsulates <code>org.apache.commons.cli.CommandLineParser</code> from commons-cli | parser | {
"repo_name": "robusta-inc/package-dependency-checker",
"path": "src/main/java/com/robusta/pdc/command/line/CLAParserFactory.java",
"license": "apache-2.0",
"size": 1054
} | [
"com.robusta.pdc.domain.ErrorReporter"
] | import com.robusta.pdc.domain.ErrorReporter; | import com.robusta.pdc.domain.*; | [
"com.robusta.pdc"
] | com.robusta.pdc; | 1,135,119 |
private static List findBase64Types(SchemaTypeSystem sts) {
List allSeenTypes = new ArrayList();
List base64ElementQNamesList = new ArrayList();
SchemaType outerType;
//add the document types and global types
allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
al... | static List function(SchemaTypeSystem sts) { List allSeenTypes = new ArrayList(); List base64ElementQNamesList = new ArrayList(); SchemaType outerType; allSeenTypes.addAll(Arrays.asList(sts.documentTypes())); allSeenTypes.addAll(Arrays.asList(sts.globalTypes())); for (int i = 0; i < allSeenTypes.size(); i++) { SchemaTy... | /**
* Populate the base64 types The algo is to look for simpletypes that have base64 content, and
* then step out of that onestep and get the element. For now there's an extended check to see
* whether the simple type is related to the Xmime:contentType!
*
* @param sts
*/ | Populate the base64 types The algo is to look for simpletypes that have base64 content, and then step out of that onestep and get the element. For now there's an extended check to see whether the simple type is related to the Xmime:contentType | findBase64Types | {
"repo_name": "apache/axis2-java",
"path": "modules/xmlbeans-codegen/src/main/java/org/apache/axis2/xmlbeans/CodeGenerationUtility.java",
"license": "apache-2.0",
"size": 31155
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"org.apache.axis2.wsdl.util.Constants",
"org.apache.xmlbeans.SchemaProperty",
"org.apache.xmlbeans.SchemaType",
"org.apache.xmlbeans.SchemaTypeSystem"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.axis2.wsdl.util.Constants; import org.apache.xmlbeans.SchemaProperty; import org.apache.xmlbeans.SchemaType; import org.apache.xmlbeans.SchemaTypeSystem; | import java.util.*; import org.apache.axis2.wsdl.util.*; import org.apache.xmlbeans.*; | [
"java.util",
"org.apache.axis2",
"org.apache.xmlbeans"
] | java.util; org.apache.axis2; org.apache.xmlbeans; | 2,300,129 |
private PCollection<KV<Integer, String>> createInput(
Pipeline p, List<KV<Integer, String>> list, List<Long> timestamps) {
PCollection<KV<Integer, String>> input;
if (timestamps.isEmpty()) {
input = p.apply(Create.of(list));
} else {
input = p.apply(Create.timestamped(list, timestamps));... | PCollection<KV<Integer, String>> function( Pipeline p, List<KV<Integer, String>> list, List<Long> timestamps) { PCollection<KV<Integer, String>> input; if (timestamps.isEmpty()) { input = p.apply(Create.of(list)); } else { input = p.apply(Create.timestamped(list, timestamps)); } | /**
* Converts the given list with timestamps into a PCollection.
*/ | Converts the given list with timestamps into a PCollection | createInput | {
"repo_name": "haocafes/DataflowJavaSDK",
"path": "sdk/src/test/java/com/google/cloud/dataflow/sdk/transforms/join/CoGroupByKeyTest.java",
"license": "apache-2.0",
"size": 20918
} | [
"com.google.cloud.dataflow.sdk.Pipeline",
"com.google.cloud.dataflow.sdk.transforms.Create",
"com.google.cloud.dataflow.sdk.values.PCollection",
"java.util.List"
] | import com.google.cloud.dataflow.sdk.Pipeline; import com.google.cloud.dataflow.sdk.transforms.Create; import com.google.cloud.dataflow.sdk.values.PCollection; import java.util.List; | import com.google.cloud.dataflow.sdk.*; import com.google.cloud.dataflow.sdk.transforms.*; import com.google.cloud.dataflow.sdk.values.*; import java.util.*; | [
"com.google.cloud",
"java.util"
] | com.google.cloud; java.util; | 1,886,842 |
static Session random() {
return new Session(UUID.randomUUID(), UUID.randomUUID());
} | static Session random() { return new Session(UUID.randomUUID(), UUID.randomUUID()); } | /**
* Static constructor.
*
* @return New session instance with random client ID and random session ID.
*/ | Static constructor | random | {
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java",
"license": "apache-2.0",
"size": 43056
} | [
"java.util.UUID"
] | import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 2,082,372 |
protected String getArrayBracketsToken(EObject semanticObject, RuleCall ruleCall, INode node) {
if (node != null)
return getTokenText(node);
return "[]";
}
| String function(EObject semanticObject, RuleCall ruleCall, INode node) { if (node != null) return getTokenText(node); return "[]"; } | /**
* ArrayBrackets :
* '[' ']'
* ;
*/ | ArrayBrackets : '[' ']' | getArrayBracketsToken | {
"repo_name": "FTSRG/viatra-dse-swarm",
"path": "plugins/incqueryd/hu.bme.mit.incqueryd.tooling/org.eclipse.incquery.patternlanguage.rdf/src-gen/org/eclipse/incquery/patternlanguage/rdf/serializer/RdfPatternLanguageSyntacticSequencer.java",
"license": "epl-1.0",
"size": 7130
} | [
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.RuleCall",
"org.eclipse.xtext.nodemodel.INode"
] | import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.RuleCall; import org.eclipse.xtext.nodemodel.INode; | import org.eclipse.emf.ecore.*; import org.eclipse.xtext.*; import org.eclipse.xtext.nodemodel.*; | [
"org.eclipse.emf",
"org.eclipse.xtext"
] | org.eclipse.emf; org.eclipse.xtext; | 1,776,082 |
private static void addFlagParam(SnippetInstanceTO snip, String paramName,
Map parameters) {
String ns = snip.getNamespace();
parameters.put(ns + paramName, "t");
parameters.put(ns + paramName + "_ALL", new String[] { "t" });
} | static void function(SnippetInstanceTO snip, String paramName, Map parameters) { String ns = snip.getNamespace(); parameters.put(ns + paramName, "t"); parameters.put(ns + paramName + "_ALL", new String[] { "t" }); } | /** In preparation for invoking a snippet, set a new parameter value
*
* @param snip the snippet we're about to invoke
* @param paramName the name of a parameter to set
* @param parameters the parameters map
*/ | In preparation for invoking a snippet, set a new parameter value | addFlagParam | {
"repo_name": "superzadeh/processdash",
"path": "src/net/sourceforge/processdash/net/cms/FramesetPageAssemblers.java",
"license": "gpl-3.0",
"size": 22289
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,104,994 |
private Dictionary<String, Object> buildBundleProperties() {
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put("resource.resolver.virtual", new String[] { "/:/" });
properties.put("resource.resolver.mapping", new String[] { "/:/",
"/content/:... | Dictionary<String, Object> function() { Dictionary<String, Object> properties = new Hashtable<String, Object>(); properties.put(STR, new String[] { "/:/" }); properties.put(STR, new String[] { "/:/", STR, STR, STR }); properties.put(STR, true); properties.put(STR, new String[] { "/apps", "/libs" }); properties.put(STR,... | /**
* build a properties for a resource resolver bundle.
* @return
*/ | build a properties for a resource resolver bundle | buildBundleProperties | {
"repo_name": "dulvac/sling",
"path": "bundles/resourceresolver/src/test/java/org/apache/sling/resourceresolver/impl/MockedResourceResolverImplTest.java",
"license": "apache-2.0",
"size": 28249
} | [
"java.util.Dictionary",
"java.util.Hashtable",
"org.osgi.framework.Constants"
] | import java.util.Dictionary; import java.util.Hashtable; import org.osgi.framework.Constants; | import java.util.*; import org.osgi.framework.*; | [
"java.util",
"org.osgi.framework"
] | java.util; org.osgi.framework; | 1,867,834 |
public void setClassifier(String classifier) {
JodaBeanUtils.notNull(classifier, "classifier");
this._classifier = classifier;
} | void function(String classifier) { JodaBeanUtils.notNull(classifier, STR); this._classifier = classifier; } | /**
* Sets the classifier that the factory should publish under.
* @param classifier the new value of the property, not null
*/ | Sets the classifier that the factory should publish under | setClassifier | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/source/ConventionSourceComponentFactory.java",
"license": "apache-2.0",
"size": 15778
} | [
"org.joda.beans.JodaBeanUtils"
] | import org.joda.beans.JodaBeanUtils; | import org.joda.beans.*; | [
"org.joda.beans"
] | org.joda.beans; | 2,579,183 |
BundleToken token = new BundleToken(asList(new PackageNameToken(), new SeverityLevelToken()));
assertThat(token.getRequiredLogEntryValues()).containsOnly(LogEntryValue.CLASS, LogEntryValue.LEVEL);
} | BundleToken token = new BundleToken(asList(new PackageNameToken(), new SeverityLevelToken())); assertThat(token.getRequiredLogEntryValues()).containsOnly(LogEntryValue.CLASS, LogEntryValue.LEVEL); } | /**
* Verifies that all required log entry values from child tokens will be returned.
*/ | Verifies that all required log entry values from child tokens will be returned | requiredLogEntryValues | {
"repo_name": "pmwmedia/tinylog",
"path": "tinylog-impl/src/test/java/org/tinylog/pattern/BundleTokenTest.java",
"license": "apache-2.0",
"size": 2324
} | [
"org.assertj.core.api.Assertions",
"org.tinylog.core.LogEntryValue"
] | import org.assertj.core.api.Assertions; import org.tinylog.core.LogEntryValue; | import org.assertj.core.api.*; import org.tinylog.core.*; | [
"org.assertj.core",
"org.tinylog.core"
] | org.assertj.core; org.tinylog.core; | 1,113,720 |
public List<Entity> getValidTargets(Entity entity) {
List<Entity> ents = new ArrayList<Entity>();
boolean friendlyFire = getOptions().booleanOption("friendly_fire");
for (Entity otherEntity : entities) {
// Even if friendly fire is acceptable, do not shoot yourself
... | List<Entity> function(Entity entity) { List<Entity> ents = new ArrayList<Entity>(); boolean friendlyFire = getOptions().booleanOption(STR); for (Entity otherEntity : entities) { if ((otherEntity.getPosition() != null) && !otherEntity.isOffBoard() && otherEntity.isTargetable() && !otherEntity.isSensorReturn(entity.getOw... | /**
* Get a vector of entity objects that are "acceptable" to attack with this
* entity
*/ | Get a vector of entity objects that are "acceptable" to attack with this entity | getValidTargets | {
"repo_name": "chvink/kilomek",
"path": "megamek/src/megamek/common/Game.java",
"license": "gpl-3.0",
"size": 117578
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,733,694 |
void mouseReleased(MouseEvent event); | void mouseReleased(MouseEvent event); | /**
* Invoked after the mouse was released on the filter field.
*
* @param event The mouse event of the click.
*/ | Invoked after the mouse was released on the filter field | mouseReleased | {
"repo_name": "guiquanz/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/Gui/FilterPanel/IFilterFieldListener.java",
"license": "apache-2.0",
"size": 1175
} | [
"java.awt.event.MouseEvent"
] | import java.awt.event.MouseEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,107,294 |
public int getDeathCount()
{ return totalDeaths; }
// tracking objective items
private GoalsInventorySnapshot carrying;
private int currentHealth = 20;
private int currentArmor = 0; | int function() { return totalDeaths; } private GoalsInventorySnapshot carrying; private int currentHealth = 20; private int currentArmor = 0; | /**
* Gets the number of times this player has died.
*
* @return number of deaths
*/ | Gets the number of times this player has died | getDeathCount | {
"repo_name": "rmct/AutoReferee",
"path": "src/main/java/org/mctourney/autoreferee/AutoRefPlayer.java",
"license": "gpl-3.0",
"size": 31093
} | [
"org.mctourney.autoreferee.listeners.GoalsInventorySnapshot"
] | import org.mctourney.autoreferee.listeners.GoalsInventorySnapshot; | import org.mctourney.autoreferee.listeners.*; | [
"org.mctourney.autoreferee"
] | org.mctourney.autoreferee; | 1,240,489 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.