method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
@Override
public String getText(Object object) {
String label = ((Axis)object).getField();
return label == null || label.length() == 0 ?
getString("_UI_Axis_type") :
getString("_UI_Axis_type") + " " + label;
} | String function(Object object) { String label = ((Axis)object).getField(); return label == null label.length() == 0 ? getString(STR) : getString(STR) + " " + label; } | /**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the label text for the adapted class. | getText | {
"repo_name": "debabratahazra/DS",
"path": "designstudio/components/t24/core/com.odcgroup.t24.enquiry.model.edit/src/com/odcgroup/t24/enquiry/enquiry/provider/AxisItemProvider.java",
"license": "epl-1.0",
"size": 6055
} | [
"com.odcgroup.t24.enquiry.enquiry.Axis"
] | import com.odcgroup.t24.enquiry.enquiry.Axis; | import com.odcgroup.t24.enquiry.enquiry.*; | [
"com.odcgroup.t24"
] | com.odcgroup.t24; | 1,433,903 |
private void initComps()
{
WebComponent meta = new WebComponent("meta");
final IModel<String> urlModel = new LoadableDetachableModel<String>()
{
private static final long serialVersionUID = 1L; | void function() { WebComponent meta = new WebComponent("meta"); final IModel<String> urlModel = new LoadableDetachableModel<String>() { private static final long serialVersionUID = 1L; | /**
* Adds components.
*/ | Adds components | initComps | {
"repo_name": "martin-g/wicket-osgi",
"path": "wicket-core/src/main/java/org/apache/wicket/markup/html/pages/BrowserInfoPage.java",
"license": "apache-2.0",
"size": 4248
} | [
"org.apache.wicket.markup.html.WebComponent",
"org.apache.wicket.model.IModel",
"org.apache.wicket.model.LoadableDetachableModel"
] | import org.apache.wicket.markup.html.WebComponent; import org.apache.wicket.model.IModel; import org.apache.wicket.model.LoadableDetachableModel; | import org.apache.wicket.markup.html.*; import org.apache.wicket.model.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 1,981,329 |
Observable<Page<DataLakeAnalyticsAccountBasic>> listNextAsync(final String nextPageLink); | Observable<Page<DataLakeAnalyticsAccountBasic>> listNextAsync(final String nextPageLink); | /**
* Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any.
*
* @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the PagedList<DataLakeAnalyticsAccountBasic> object
*/ | Gets the first page of Data Lake Analytics accounts, if any, within the current subscription. This includes a link to the next page, if any | listNextAsync | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/Accounts.java",
"license": "mit",
"size": 49196
} | [
"com.microsoft.azure.Page",
"com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountBasic"
] | import com.microsoft.azure.Page; import com.microsoft.azure.management.datalake.analytics.models.DataLakeAnalyticsAccountBasic; | import com.microsoft.azure.*; import com.microsoft.azure.management.datalake.analytics.models.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 307,830 |
public static synchronized RandomGenerator getRandomGenerator() {
return randomGenerator;
}
/**
* Evolve the given population. Evolution stops when the stopping condition
* is satisfied. Updates the {@link #getGenerationsEvolved() generationsEvolved} | static synchronized RandomGenerator function() { return randomGenerator; } /** * Evolve the given population. Evolution stops when the stopping condition * is satisfied. Updates the {@link #getGenerationsEvolved() generationsEvolved} | /**
* Returns the (static) random generator.
*
* @return the static random generator shared by GA implementation classes
*/ | Returns the (static) random generator | getRandomGenerator | {
"repo_name": "najibghadri/NeuralNetworkSimulator",
"path": "src/org/apache/commons/math3/genetics/GeneticAlgorithm.java",
"license": "mit",
"size": 8616
} | [
"org.apache.commons.math3.random.RandomGenerator"
] | import org.apache.commons.math3.random.RandomGenerator; | import org.apache.commons.math3.random.*; | [
"org.apache.commons"
] | org.apache.commons; | 103,165 |
public void doUpgrade(StaplerResponse rsp) throws IOException, ServletException {
requirePOST();
Hudson.getInstance().checkPermission(Hudson.ADMINISTER);
HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Hudson.getAuthentication());
if(!Lifecycle.get().canRewriteHudsonWar()) {
sendError("Jenkins upgrade not supported in this running mode");
return;
}
LOGGER.info("Scheduling the core upgrade");
addJob(job);
rsp.sendRedirect2(".");
} | void function(StaplerResponse rsp) throws IOException, ServletException { requirePOST(); Hudson.getInstance().checkPermission(Hudson.ADMINISTER); HudsonUpgradeJob job = new HudsonUpgradeJob(getCoreSource(), Hudson.getAuthentication()); if(!Lifecycle.get().canRewriteHudsonWar()) { sendError(STR); return; } LOGGER.info(STR); addJob(job); rsp.sendRedirect2("."); } | /**
* Schedules a Jenkins upgrade.
*/ | Schedules a Jenkins upgrade | doUpgrade | {
"repo_name": "pantheon-systems/jenkins",
"path": "core/src/main/java/hudson/model/UpdateCenter.java",
"license": "mit",
"size": 38797
} | [
"hudson.lifecycle.Lifecycle",
"java.io.IOException",
"javax.servlet.ServletException",
"org.kohsuke.stapler.StaplerResponse"
] | import hudson.lifecycle.Lifecycle; import java.io.IOException; import javax.servlet.ServletException; import org.kohsuke.stapler.StaplerResponse; | import hudson.lifecycle.*; import java.io.*; import javax.servlet.*; import org.kohsuke.stapler.*; | [
"hudson.lifecycle",
"java.io",
"javax.servlet",
"org.kohsuke.stapler"
] | hudson.lifecycle; java.io; javax.servlet; org.kohsuke.stapler; | 2,892,505 |
@SuppressWarnings("static-method")
@Test
public void testBuildFromTextIterator() {
final LinkedList<String> textList = new LinkedList<>();
textList.add("first query\t1 2 5 3");
textList.add("second query\t100 12");
final GroundTruth<String> groundTruth =
GroundTruth.buildFromTextIterator(textList.iterator(), "\t", " ");
final LinkedList<String> firstQuery = new LinkedList<>();
firstQuery.add("first");
firstQuery.add("query");
final HashSet<Integer> firstResults = new HashSet<>();
firstResults.add(Integer.valueOf(0));
firstResults.add(Integer.valueOf(1));
firstResults.add(Integer.valueOf(4));
firstResults.add(Integer.valueOf(2));
Assert.assertTrue(groundTruth.hasRelevantRecords(firstQuery));
final Collection<Integer> firstRelevantRecords =
groundTruth.getRelevantRecords(firstQuery);
Assert.assertEquals(firstResults, firstRelevantRecords);
final LinkedList<String> secondQuery = new LinkedList<>();
secondQuery.add("second");
secondQuery.add("query");
final HashSet<Integer> secondResults = new HashSet<>();
secondResults.add(Integer.valueOf(99));
secondResults.add(Integer.valueOf(11));
Assert.assertTrue(groundTruth.hasRelevantRecords(secondQuery));
final Collection<Integer> secondRelevantRecords =
groundTruth.getRelevantRecords(secondQuery);
Assert.assertEquals(secondResults, secondRelevantRecords);
}
| @SuppressWarnings(STR) void function() { final LinkedList<String> textList = new LinkedList<>(); textList.add(STR); textList.add(STR); final GroundTruth<String> groundTruth = GroundTruth.buildFromTextIterator(textList.iterator(), "\t", " "); final LinkedList<String> firstQuery = new LinkedList<>(); firstQuery.add("first"); firstQuery.add("query"); final HashSet<Integer> firstResults = new HashSet<>(); firstResults.add(Integer.valueOf(0)); firstResults.add(Integer.valueOf(1)); firstResults.add(Integer.valueOf(4)); firstResults.add(Integer.valueOf(2)); Assert.assertTrue(groundTruth.hasRelevantRecords(firstQuery)); final Collection<Integer> firstRelevantRecords = groundTruth.getRelevantRecords(firstQuery); Assert.assertEquals(firstResults, firstRelevantRecords); final LinkedList<String> secondQuery = new LinkedList<>(); secondQuery.add(STR); secondQuery.add("query"); final HashSet<Integer> secondResults = new HashSet<>(); secondResults.add(Integer.valueOf(99)); secondResults.add(Integer.valueOf(11)); Assert.assertTrue(groundTruth.hasRelevantRecords(secondQuery)); final Collection<Integer> secondRelevantRecords = groundTruth.getRelevantRecords(secondQuery); Assert.assertEquals(secondResults, secondRelevantRecords); } | /**
* Test method for
* {@link GroundTruth#buildFromTextIterator(Iterator, String, String)}.
*/ | Test method for <code>GroundTruth#buildFromTextIterator(Iterator, String, String)</code> | testBuildFromTextIterator | {
"repo_name": "ZabuzaW/LexiSearch",
"path": "test/de/zabuza/lexisearch/benchmarking/GroundTruthTest.java",
"license": "gpl-3.0",
"size": 9145
} | [
"java.util.Collection",
"java.util.HashSet",
"java.util.LinkedList",
"org.junit.Assert"
] | import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 210,909 |
@Test
public void shouldNotUseBetweenSymmetric()
{
// given
SqlConstraints.setDisableBetweenSymmetricPredicate(true);
int min = uniqueInt(10);
int max = min + uniqueInt(10);
// when
String actual = between("lhs", min, max);
// then
String expected = "lhs BETWEEN " + min + " AND " + max;
assertEquals(expected, actual);
} | void function() { SqlConstraints.setDisableBetweenSymmetricPredicate(true); int min = uniqueInt(10); int max = min + uniqueInt(10); String actual = between("lhs", min, max); String expected = STR + min + STR + max; assertEquals(expected, actual); } | /**
* Don't use BETWEEN SYMMETRIC (only use BETWEEN) when requested.
*/ | Don't use BETWEEN SYMMETRIC (only use BETWEEN) when requested | shouldNotUseBetweenSymmetric | {
"repo_name": "zangsir/ANNIS",
"path": "annis-service/src/test/java/annis/sqlgen/TestSqlConstraints.java",
"license": "apache-2.0",
"size": 8569
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,512,745 |
private void testBadlyFormedUri(final String uri, final String errorMsg) {
try {
new URLFileNameParser(80).parseUri(null, null, uri);
fail();
} catch (final FileSystemException e) {
assertSameMessage(errorMsg, uri, e);
}
} | void function(final String uri, final String errorMsg) { try { new URLFileNameParser(80).parseUri(null, null, uri); fail(); } catch (final FileSystemException e) { assertSameMessage(errorMsg, uri, e); } } | /**
* Tests that parsing a URI fails with the expected error.
*/ | Tests that parsing a URI fails with the expected error | testBadlyFormedUri | {
"repo_name": "wso2/wso2-commons-vfs",
"path": "commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/test/GenericFileNameTestCase.java",
"license": "apache-2.0",
"size": 6617
} | [
"org.apache.commons.vfs2.FileSystemException",
"org.apache.commons.vfs2.provider.URLFileNameParser"
] | import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.provider.URLFileNameParser; | import org.apache.commons.vfs2.*; import org.apache.commons.vfs2.provider.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,076,819 |
@Test
public void testTwoPhaseCommitTwoRM_2() throws Exception {
IPhynixxXAConnection<ITestConnection> xaCon1 = factory1.getXAConnection();
ITestConnection con1 = xaCon1.getConnection();
IPhynixxXAConnection<ITestConnection> xaCon2 = factory1.getXAConnection();
ITestConnection con2 = xaCon2.getConnection();
IPhynixxXAConnection<ITestConnection> xaCon3 = factory1.getXAConnection();
ITestConnection con3 = xaCon3.getConnection();
try {
this.getTransactionManager().begin();
// act transactional and enlist the current resource
con1.act(1);
con2.act(1);
con3.act(1);
this.getTransactionManager().commit();
} finally {
if (con1 != null) {
con1.close();
}
if (con2 != null) {
con2.close();
}
if (con3 != null) {
con3.close();
}
}
} | void function() throws Exception { IPhynixxXAConnection<ITestConnection> xaCon1 = factory1.getXAConnection(); ITestConnection con1 = xaCon1.getConnection(); IPhynixxXAConnection<ITestConnection> xaCon2 = factory1.getXAConnection(); ITestConnection con2 = xaCon2.getConnection(); IPhynixxXAConnection<ITestConnection> xaCon3 = factory1.getXAConnection(); ITestConnection con3 = xaCon3.getConnection(); try { this.getTransactionManager().begin(); con1.act(1); con2.act(1); con3.act(1); this.getTransactionManager().commit(); } finally { if (con1 != null) { con1.close(); } if (con2 != null) { con2.close(); } if (con3 != null) { con3.close(); } } } | /**
* one XAResourceProgressState Factory ( == resourceManagers) but two
* Connections. The connections are joined and the transaction end sup in a
* one-phase-commit
*
* @throws Exception
*/ | one XAResourceProgressState Factory ( == resourceManagers) but two Connections. The connections are joined and the transaction end sup in a one-phase-commit | testTwoPhaseCommitTwoRM_2 | {
"repo_name": "csc19601128/Phynixx",
"path": "phynixx/phynixx-xa/src/test/java/org/csc/phynixx/xa/XAResourceIntegrationTest.java",
"license": "apache-2.0",
"size": 45393
} | [
"org.csc.phynixx.phynixx.testconnection.ITestConnection"
] | import org.csc.phynixx.phynixx.testconnection.ITestConnection; | import org.csc.phynixx.phynixx.testconnection.*; | [
"org.csc.phynixx"
] | org.csc.phynixx; | 2,099,766 |
public ChannelFuture sendFuture(Class<? extends Protocol> packetProtocol) throws Exception {
if (!isCancelled()) {
ByteBuf output = constructPacket(packetProtocol, true);
return user().sendRawPacketFuture(output);
}
return user().getChannel().newFailedFuture(new Exception("Cancelled packet"));
} | ChannelFuture function(Class<? extends Protocol> packetProtocol) throws Exception { if (!isCancelled()) { ByteBuf output = constructPacket(packetProtocol, true); return user().sendRawPacketFuture(output); } return user().getChannel().newFailedFuture(new Exception(STR)); } | /**
* Send this packet to the associated user.
* Be careful not to send packets twice.
* (Sends it after current)
* Also returns the packets ChannelFuture
*
* @param packetProtocol - The protocol version of the packet.
* @return The packets ChannelFuture
* @throws Exception if it fails to write
*/ | Send this packet to the associated user. Be careful not to send packets twice. (Sends it after current) Also returns the packets ChannelFuture | sendFuture | {
"repo_name": "Matsv/ViaVersion",
"path": "common/src/main/java/us/myles/ViaVersion/api/PacketWrapper.java",
"license": "mit",
"size": 17795
} | [
"io.netty.buffer.ByteBuf",
"io.netty.channel.ChannelFuture",
"us.myles.ViaVersion"
] | import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelFuture; import us.myles.ViaVersion; | import io.netty.buffer.*; import io.netty.channel.*; import us.myles.*; | [
"io.netty.buffer",
"io.netty.channel",
"us.myles"
] | io.netty.buffer; io.netty.channel; us.myles; | 2,595,698 |
public long getTemporaryKeyStoreRetentionMinutes() {
long minutes;
String value = getProperty(TEMPORARYSTORE_RETENTION_MINUTES);
if(StringUtils.isEmpty(value)) {
LOG.debug("Value of {} is not set, using default value ({})",
TEMPORARYSTORE_RETENTION_MINUTES.getKey(),
TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue());
minutes = TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue();
}
else {
try {
minutes = Long.parseLong(value);
LOG.debug("Value of {} is {}", TEMPORARYSTORE_RETENTION_MINUTES, value);
} catch (NumberFormatException e) {
LOG.warn("Value of {} ({}) should be a number, falling back to default value ({})",
TEMPORARYSTORE_RETENTION_MINUTES.getKey(), value,
TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue());
minutes = TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue();
}
}
return minutes;
} | long function() { long minutes; String value = getProperty(TEMPORARYSTORE_RETENTION_MINUTES); if(StringUtils.isEmpty(value)) { LOG.debug(STR, TEMPORARYSTORE_RETENTION_MINUTES.getKey(), TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue()); minutes = TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue(); } else { try { minutes = Long.parseLong(value); LOG.debug(STR, TEMPORARYSTORE_RETENTION_MINUTES, value); } catch (NumberFormatException e) { LOG.warn(STR, TEMPORARYSTORE_RETENTION_MINUTES.getKey(), value, TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue()); minutes = TEMPORARYSTORE_RETENTION_MINUTES.getDefaultValue(); } } return minutes; } | /**
* Gets the temporary keystore retention time in minutes.
* <p/>
* This value is retrieved from the Ambari property named 'security.temporary.keystore.retention.minutes'.
* If not set, the default value of 90 (minutes) will be returned.
*
* @return a timeout value (in minutes)
*/ | Gets the temporary keystore retention time in minutes. This value is retrieved from the Ambari property named 'security.temporary.keystore.retention.minutes'. If not set, the default value of 90 (minutes) will be returned | getTemporaryKeyStoreRetentionMinutes | {
"repo_name": "sekikn/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java",
"license": "apache-2.0",
"size": 252637
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 860,389 |
private Map<String, HueDevice> getHueDevices() {
Collection<Item> items = getTaggedItems();
Map<String, HueDevice> devices = new HashMap<String, HueDevice>();
Iterator<Item> it = items.iterator();
while (it.hasNext()) {
Item item = it.next();
devices.put(item.getName(), itemToDevice(item));
}
return devices;
} | Map<String, HueDevice> function() { Collection<Item> items = getTaggedItems(); Map<String, HueDevice> devices = new HashMap<String, HueDevice>(); Iterator<Item> it = items.iterator(); while (it.hasNext()) { Item item = it.next(); devices.put(item.getName(), itemToDevice(item)); } return devices; } | /**
* Returns a map of all our items that have voice tags.
*
* @param username
* @return
* Map <item name, HueDevice>
*/ | Returns a map of all our items that have voice tags | getHueDevices | {
"repo_name": "mickey4u/new_mart",
"path": "addons/io/org.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/HueEmulationServlet.java",
"license": "epl-1.0",
"size": 18934
} | [
"java.util.Collection",
"java.util.HashMap",
"java.util.Iterator",
"java.util.Map",
"org.eclipse.smarthome.core.items.Item",
"org.openhab.io.hueemulation.internal.api.HueDevice"
] | import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.eclipse.smarthome.core.items.Item; import org.openhab.io.hueemulation.internal.api.HueDevice; | import java.util.*; import org.eclipse.smarthome.core.items.*; import org.openhab.io.hueemulation.internal.api.*; | [
"java.util",
"org.eclipse.smarthome",
"org.openhab.io"
] | java.util; org.eclipse.smarthome; org.openhab.io; | 1,145,501 |
public void testConfiguredSites() throws Throwable {
echo("Testing Site Configuration");
CmsSiteManagerImpl siteManager = OpenCms.getSiteManager();
echo("Testing default Uri");
assertEquals("/sites/default/", siteManager.getDefaultUri());
echo("Testing workplace server");
assertEquals("http://localhost:8080", siteManager.getWorkplaceServer());
CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot("/sites/default/folder1");
if (site != null) {
echo("Testing Site: '" + site.toString() + "'");
CmsSiteMatcher matcher = site.getSiteMatcher();
echo("Testing Server Protocol");
assertEquals("http", matcher.getServerProtocol());
echo("Testing Server Name");
assertEquals("localhost", matcher.getServerName());
echo("Testing Server Port");
assertEquals(8081, matcher.getServerPort());
} else {
fail("Test failed: site was null!");
}
} | void function() throws Throwable { echo(STR); CmsSiteManagerImpl siteManager = OpenCms.getSiteManager(); echo(STR); assertEquals(STR, siteManager.getDefaultUri()); echo(STR); assertEquals(STR/sites/default/folder1STRTesting Site: 'STR'STRTesting Server ProtocolSTRhttpSTRTesting Server NameSTRlocalhostSTRTesting Server PortSTRTest failed: site was null!"); } } | /**
* Tests the configured site settings.<p>
*
* @throws Throwable if something goes wrong
*/ | Tests the configured site settings | testConfiguredSites | {
"repo_name": "victos/opencms-core",
"path": "test/org/opencms/configuration/TestSiteConfiguration.java",
"license": "lgpl-2.1",
"size": 5005
} | [
"org.opencms.main.OpenCms",
"org.opencms.site.CmsSiteManagerImpl"
] | import org.opencms.main.OpenCms; import org.opencms.site.CmsSiteManagerImpl; | import org.opencms.main.*; import org.opencms.site.*; | [
"org.opencms.main",
"org.opencms.site"
] | org.opencms.main; org.opencms.site; | 1,607,858 |
@Override
public void getTask(@NonNull final String taskId, @NonNull final GetTaskCallback callback) {
checkNotNull(taskId);
checkNotNull(callback);
Task cachedTask = getTaskWithId(taskId);
// Respond immediately with cache if available
if (cachedTask != null) {
callback.onTaskLoaded(cachedTask);
return;
}
// Load from server/persisted if needed. | void function(@NonNull final String taskId, @NonNull final GetTaskCallback callback) { checkNotNull(taskId); checkNotNull(callback); Task cachedTask = getTaskWithId(taskId); if (cachedTask != null) { callback.onTaskLoaded(cachedTask); return; } | /**
* Gets tasks from local data source (sqlite) unless the table is new or empty. In that case it
* uses the network data source. This is done to simplify the sample.
* <p>
* Note: {@link GetTaskCallback#onDataNotAvailable()} is fired if both data sources fail to
* get the data.
*/ | Gets tasks from local data source (sqlite) unless the table is new or empty. In that case it uses the network data source. This is done to simplify the sample. Note: <code>GetTaskCallback#onDataNotAvailable()</code> is fired if both data sources fail to get the data | getTask | {
"repo_name": "sdsxer/mmdiary",
"path": "client/source/mmdiary/app/src/main/java/com/example/android/architecture/blueprints/todoapp/data/source/TasksRepository.java",
"license": "apache-2.0",
"size": 10865
} | [
"android.support.annotation.NonNull",
"com.example.android.architecture.blueprints.todoapp.tasks.domain.model.Task",
"com.google.common.base.Preconditions"
] | import android.support.annotation.NonNull; import com.example.android.architecture.blueprints.todoapp.tasks.domain.model.Task; import com.google.common.base.Preconditions; | import android.support.annotation.*; import com.example.android.architecture.blueprints.todoapp.tasks.domain.model.*; import com.google.common.base.*; | [
"android.support",
"com.example.android",
"com.google.common"
] | android.support; com.example.android; com.google.common; | 1,720,250 |
public double parRate(final DepositZero deposit, final YieldCurveBundle curves) {
final YieldAndDiscountCurve dsc = curves.getCurve(deposit.getDiscountingCurveName());
final double startTime = deposit.getStartTime();
final double endTime = deposit.getEndTime();
final double rcc = Math.log(dsc.getDiscountFactor(startTime) / dsc.getDiscountFactor(endTime)) / deposit.getPaymentAccrualFactor();
final InterestRate rate = deposit.getRate().fromContinuous(new ContinuousInterestRate(rcc));
return rate.getRate();
} | double function(final DepositZero deposit, final YieldCurveBundle curves) { final YieldAndDiscountCurve dsc = curves.getCurve(deposit.getDiscountingCurveName()); final double startTime = deposit.getStartTime(); final double endTime = deposit.getEndTime(); final double rcc = Math.log(dsc.getDiscountFactor(startTime) / dsc.getDiscountFactor(endTime)) / deposit.getPaymentAccrualFactor(); final InterestRate rate = deposit.getRate().fromContinuous(new ContinuousInterestRate(rcc)); return rate.getRate(); } | /**
* Computes the deposit fair rate given the start and end time and the accrual factor.
* When deposit has already start the number may not be meaning full as the remaining period is not in line with the accrual factor.
* @param deposit The deposit.
* @param curves The curves.
* @return The rate.
*/ | Computes the deposit fair rate given the start and end time and the accrual factor. When deposit has already start the number may not be meaning full as the remaining period is not in line with the accrual factor | parRate | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Analytics/src/main/java/com/opengamma/analytics/financial/interestrate/cash/method/DepositZeroDiscountingMethod.java",
"license": "apache-2.0",
"size": 9382
} | [
"com.opengamma.analytics.financial.interestrate.ContinuousInterestRate",
"com.opengamma.analytics.financial.interestrate.InterestRate",
"com.opengamma.analytics.financial.interestrate.YieldCurveBundle",
"com.opengamma.analytics.financial.interestrate.cash.derivative.DepositZero",
"com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve"
] | import com.opengamma.analytics.financial.interestrate.ContinuousInterestRate; import com.opengamma.analytics.financial.interestrate.InterestRate; import com.opengamma.analytics.financial.interestrate.YieldCurveBundle; import com.opengamma.analytics.financial.interestrate.cash.derivative.DepositZero; import com.opengamma.analytics.financial.model.interestrate.curve.YieldAndDiscountCurve; | import com.opengamma.analytics.financial.interestrate.*; import com.opengamma.analytics.financial.interestrate.cash.derivative.*; import com.opengamma.analytics.financial.model.interestrate.curve.*; | [
"com.opengamma.analytics"
] | com.opengamma.analytics; | 1,024,312 |
void finalizeContext(HttpContext context); | void finalizeContext(HttpContext context); | /**
* Triggered when the connection is terminated. This event can be used
* to release objects stored in the context or perform some other kind
* of cleanup.
*
* @param context the actual HTTP context
*/ | Triggered when the connection is terminated. This event can be used to release objects stored in the context or perform some other kind of cleanup | finalizeContext | {
"repo_name": "cictourgune/MDP-Airbnb",
"path": "httpcomponents-core-4.4/httpcore-nio/src/main/java-deprecated/org/apache/http/nio/protocol/NHttpRequestExecutionHandler.java",
"license": "apache-2.0",
"size": 4983
} | [
"org.apache.http.protocol.HttpContext"
] | import org.apache.http.protocol.HttpContext; | import org.apache.http.protocol.*; | [
"org.apache.http"
] | org.apache.http; | 2,130,105 |
private static String getImpersonateClientId(Map<String, String> settings) {
return settings.get("oauth.keycloak.impersonateClient");
} | static String function(Map<String, String> settings) { return settings.get(STR); } | /**
* Returns impersonate client id
*
* @param settings settings
* @return impersonate client id
*/ | Returns impersonate client id | getImpersonateClientId | {
"repo_name": "Metatavu/edelphi",
"path": "common-cdi/src/main/java/fi/metatavu/edelphi/keycloak/KeycloakController.java",
"license": "gpl-3.0",
"size": 20518
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 791,594 |
public ItemStack getItemStack(int i) {
ItemStack is = null;
String arg = parameter.get(i);
if(ItemStackSyntax.items.containsKey(arg.toLowerCase())) {
is = ItemStackSyntax.items.get(arg.toLowerCase());
} else if(arg.contains(":")) {
String a = arg.split(":")[0];
String b = arg.split(":")[1];
int id = 0;
int meta = Integer.parseInt(b);
if(!isInt(a)) {
is = ItemStackSyntax.items.get(a);
is.setDurability((short) meta);
return is;
}
is = new ItemStack(Material.getMaterial(id), 1, (short) meta);
} else if(isInt(arg)) {
is = new ItemStack(Integer.parseInt(arg));
}
return is;
}
| ItemStack function(int i) { ItemStack is = null; String arg = parameter.get(i); if(ItemStackSyntax.items.containsKey(arg.toLowerCase())) { is = ItemStackSyntax.items.get(arg.toLowerCase()); } else if(arg.contains(":")) { String a = arg.split(":")[0]; String b = arg.split(":")[1]; int id = 0; int meta = Integer.parseInt(b); if(!isInt(a)) { is = ItemStackSyntax.items.get(a); is.setDurability((short) meta); return is; } is = new ItemStack(Material.getMaterial(id), 1, (short) meta); } else if(isInt(arg)) { is = new ItemStack(Integer.parseInt(arg)); } return is; } | /**
* Get argument as ItemStack
* @param i The index in your command, starts at 0
* @return
*/ | Get argument as ItemStack | getItemStack | {
"repo_name": "KennethWussmann/Levitate",
"path": "src/main/java/de/ketrwu/levitate/ParameterSet.java",
"license": "gpl-2.0",
"size": 5232
} | [
"de.ketrwu.levitate.syntax.ItemStackSyntax",
"org.bukkit.Material",
"org.bukkit.inventory.ItemStack"
] | import de.ketrwu.levitate.syntax.ItemStackSyntax; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; | import de.ketrwu.levitate.syntax.*; import org.bukkit.*; import org.bukkit.inventory.*; | [
"de.ketrwu.levitate",
"org.bukkit",
"org.bukkit.inventory"
] | de.ketrwu.levitate; org.bukkit; org.bukkit.inventory; | 1,561,305 |
public StringBuffer format(Object pat, StringBuffer result, FieldPosition fpos) {
String pattern = processPattern((String) pat);
int lastOffset = 0;
for (int i = 0; i <= maxOffset; ++i) {
int offidx = offsets[i];
result.append(pattern.substring(lastOffset, offsets[i]));
lastOffset = offidx;
String key = arguments[i];
String obj;
if (key.length() > 0) {
obj = formatObject(processKey(key));
} else {
// else just copy the left and right braces
result.append(this.ldel);
result.append(this.rdel);
continue;
}
if (obj == null) {
// try less-greedy match; useful for e.g. PROP___PROPNAME__ where
// 'PROPNAME' is a key and delims are both '__'
// this does not solve all possible cases, surely, but it should catch
// the most common ones
String lessgreedy = ldel + key;
int fromright = lessgreedy.lastIndexOf(ldel);
if (fromright > 0) {
String newkey = lessgreedy.substring(fromright + ldel.length());
String newsubst = formatObject(processKey(newkey));
if (newsubst != null) {
obj = lessgreedy.substring(0, fromright) + newsubst;
}
}
}
if (obj == null) {
if (throwex) {
throw new IllegalArgumentException("ObjectForKey");
} else {
obj = ldel + key + rdel;
}
}
result.append(obj);
}
result.append(pattern.substring(lastOffset, pattern.length()));
return result;
} | StringBuffer function(Object pat, StringBuffer result, FieldPosition fpos) { String pattern = processPattern((String) pat); int lastOffset = 0; for (int i = 0; i <= maxOffset; ++i) { int offidx = offsets[i]; result.append(pattern.substring(lastOffset, offsets[i])); lastOffset = offidx; String key = arguments[i]; String obj; if (key.length() > 0) { obj = formatObject(processKey(key)); } else { result.append(this.ldel); result.append(this.rdel); continue; } if (obj == null) { String lessgreedy = ldel + key; int fromright = lessgreedy.lastIndexOf(ldel); if (fromright > 0) { String newkey = lessgreedy.substring(fromright + ldel.length()); String newsubst = formatObject(processKey(newkey)); if (newsubst != null) { obj = lessgreedy.substring(0, fromright) + newsubst; } } } if (obj == null) { if (throwex) { throw new IllegalArgumentException(STR); } else { obj = ldel + key + rdel; } } result.append(obj); } result.append(pattern.substring(lastOffset, pattern.length())); return result; } | /**
* Formats the parsed string by inserting table's values.
* @param pat a string pattern
* @param result Buffer to be used for result.
* @param fpos position
* @return Formatted string
*/ | Formats the parsed string by inserting table's values | format | {
"repo_name": "kiwiandroiddev/starcraft-2-build-player",
"path": "app/src/main/java/com/kiwiandroiddev/sc2buildassistant/util/MapFormat.java",
"license": "mit",
"size": 14577
} | [
"java.text.FieldPosition"
] | import java.text.FieldPosition; | import java.text.*; | [
"java.text"
] | java.text; | 670,309 |
private Object supressSerialization(Object obj) {
SerializableProxy res = new SerializableProxy(UUID.randomUUID());
serializedObj.put(res.uuid, obj);
return res;
} | Object function(Object obj) { SerializableProxy res = new SerializableProxy(UUID.randomUUID()); serializedObj.put(res.uuid, obj); return res; } | /**
* Returns an object that should be returned from writeReplace() method.
*
* @param obj Object that must not be changed after serialization/deserialization.
* @return An object to return from writeReplace()
*/ | Returns an object that should be returned from writeReplace() method | supressSerialization | {
"repo_name": "vladisav/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java",
"license": "apache-2.0",
"size": 77511
} | [
"java.util.UUID"
] | import java.util.UUID; | import java.util.*; | [
"java.util"
] | java.util; | 2,136,775 |
public void addToKeyStore(KeyPair keyPair, X509Certificate[] chain, String alias) throws KeyStoreException {
key_store.setKeyEntry(alias, keyPair.getPrivate(), KS_PASSWORD, chain);
} | void function(KeyPair keyPair, X509Certificate[] chain, String alias) throws KeyStoreException { key_store.setKeyEntry(alias, keyPair.getPrivate(), KS_PASSWORD, chain); } | /**
* Add the private key and the certificate chain to the key store.
*/ | Add the private key and the certificate chain to the key store | addToKeyStore | {
"repo_name": "elegnamnden/tsl-trust",
"path": "admin-webapp/src/main/java/se/tillvaxtverket/tsltrust/webservice/daemon/ca/CertificationAuthority.java",
"license": "gpl-3.0",
"size": 19576
} | [
"java.security.KeyPair",
"java.security.KeyStoreException",
"java.security.cert.X509Certificate"
] | import java.security.KeyPair; import java.security.KeyStoreException; import java.security.cert.X509Certificate; | import java.security.*; import java.security.cert.*; | [
"java.security"
] | java.security; | 1,741,027 |
private void chooseActivityDialog(){
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
LayoutInflater inflater = getActivity().getLayoutInflater();
final View dialogView = inflater.inflate(R.layout.choose_activity_dialog, null);
dialogBuilder.setView(dialogView);
alertDialog = dialogBuilder.show();
ListView listViewActivities = (ListView) dialogView.findViewById(android.R.id.list);
Resources resources = getResources();
final ArrayList<RowActivity> listActivities = new ArrayList<>();
listActivities.add(new RowActivity(resources.getDrawable(R.drawable.cycling), resources.getStringArray(R.array.array_activities)[0]));
listActivities.add(new RowActivity(resources.getDrawable(R.drawable.runningmore), resources.getStringArray(R.array.array_activities)[1]));
listActivities.add(new RowActivity(resources.getDrawable(R.drawable.running), resources.getStringArray(R.array.array_activities)[2]));
listActivities.add(new RowActivity(resources.getDrawable(R.drawable.walking), resources.getStringArray(R.array.array_activities)[3]));
listActivities.add(new RowActivity(resources.getDrawable(R.drawable.walking), resources.getStringArray(R.array.array_activities)[4]));
ChooseActivityAdapter activityAdapter = new ChooseActivityAdapter(getActivity(), R.layout.row_activities, listActivities);
listViewActivities.setAdapter(activityAdapter); | void function(){ final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); LayoutInflater inflater = getActivity().getLayoutInflater(); final View dialogView = inflater.inflate(R.layout.choose_activity_dialog, null); dialogBuilder.setView(dialogView); alertDialog = dialogBuilder.show(); ListView listViewActivities = (ListView) dialogView.findViewById(android.R.id.list); Resources resources = getResources(); final ArrayList<RowActivity> listActivities = new ArrayList<>(); listActivities.add(new RowActivity(resources.getDrawable(R.drawable.cycling), resources.getStringArray(R.array.array_activities)[0])); listActivities.add(new RowActivity(resources.getDrawable(R.drawable.runningmore), resources.getStringArray(R.array.array_activities)[1])); listActivities.add(new RowActivity(resources.getDrawable(R.drawable.running), resources.getStringArray(R.array.array_activities)[2])); listActivities.add(new RowActivity(resources.getDrawable(R.drawable.walking), resources.getStringArray(R.array.array_activities)[3])); listActivities.add(new RowActivity(resources.getDrawable(R.drawable.walking), resources.getStringArray(R.array.array_activities)[4])); ChooseActivityAdapter activityAdapter = new ChooseActivityAdapter(getActivity(), R.layout.row_activities, listActivities); listViewActivities.setAdapter(activityAdapter); | /**
* Dialog to choose sports activities
*/ | Dialog to choose sports activities | chooseActivityDialog | {
"repo_name": "HeikkiDev/osport-hello",
"path": "app/src/main/java/com/proyecto/enrique/osporthello/Fragments/HomeFragment.java",
"license": "apache-2.0",
"size": 38269
} | [
"android.content.res.Resources",
"android.support.v7.app.AlertDialog",
"android.view.LayoutInflater",
"android.view.View",
"android.widget.ListView",
"com.proyecto.enrique.osporthello.Adapters",
"com.proyecto.enrique.osporthello.Models",
"java.util.ArrayList"
] | import android.content.res.Resources; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.ListView; import com.proyecto.enrique.osporthello.Adapters; import com.proyecto.enrique.osporthello.Models; import java.util.ArrayList; | import android.content.res.*; import android.support.v7.app.*; import android.view.*; import android.widget.*; import com.proyecto.enrique.osporthello.*; import java.util.*; | [
"android.content",
"android.support",
"android.view",
"android.widget",
"com.proyecto.enrique",
"java.util"
] | android.content; android.support; android.view; android.widget; com.proyecto.enrique; java.util; | 1,988,142 |
public void createPopupMenu(Component aComponent,int x, int y) {
} | void function(Component aComponent,int x, int y) { } | /**
* Creates a popup menu for this panel in the OTB. Not used.
*/ | Creates a popup menu for this panel in the OTB. Not used | createPopupMenu | {
"repo_name": "kernsuite-debian/lofar",
"path": "SAS/OTB/OTB/src/nl/astron/lofar/sas/otbcomponents/AntennaConfigPanel.java",
"license": "gpl-3.0",
"size": 71504
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,458,431 |
private static void applyOpenSSLFix() throws SecurityException {
if ((Build.VERSION.SDK_INT < VERSION_CODE_JELLY_BEAN)
|| (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2)) {
// No need to apply the fix
return;
}
try {
// Mix in the device- and invocation-specific seed.
Class.forName("org.apache.harmony.xnet.provider.jsse.NativeCrypto")
.getMethod("RAND_seed", byte[].class)
.invoke(null, generateSeed());
// Mix output of Linux PRNG into OpenSSL's PRNG
int bytesRead = (Integer) Class.forName(
"org.apache.harmony.xnet.provider.jsse.NativeCrypto")
.getMethod("RAND_load_file", String.class, long.class)
.invoke(null, "/dev/urandom", 1024);
if (bytesRead != 1024) {
throw new IOException(
"Unexpected number of bytes read from Linux PRNG: "
+ bytesRead);
}
} catch (Exception e) {
throw new SecurityException("Failed to seed OpenSSL PRNG", e);
}
} | static void function() throws SecurityException { if ((Build.VERSION.SDK_INT < VERSION_CODE_JELLY_BEAN) (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2)) { return; } try { Class.forName(STR) .getMethod(STR, byte[].class) .invoke(null, generateSeed()); int bytesRead = (Integer) Class.forName( STR) .getMethod(STR, String.class, long.class) .invoke(null, STR, 1024); if (bytesRead != 1024) { throw new IOException( STR + bytesRead); } } catch (Exception e) { throw new SecurityException(STR, e); } } | /**
* Applies the fix for OpenSSL PRNG having low entropy. Does nothing if the
* fix is not needed.
*
* @throws SecurityException if the fix is needed but could not be applied.
*/ | Applies the fix for OpenSSL PRNG having low entropy. Does nothing if the fix is not needed | applyOpenSSLFix | {
"repo_name": "9Cube-dpustula/andOTP",
"path": "app/src/main/java/org/shadowice/flocke/andotp/Utilities/PRNGFixes.java",
"license": "mit",
"size": 12436
} | [
"android.os.Build",
"java.io.IOException"
] | import android.os.Build; import java.io.IOException; | import android.os.*; import java.io.*; | [
"android.os",
"java.io"
] | android.os; java.io; | 1,585,193 |
private void logPlane(Plane plane) {
logln("FLIGHT_ID: " + plane.getFlightId());
logln(plane.getPilot().getInformationAsFormattedText());
if (plane.getCoPilot().isPresent()) {
logln(plane.getCoPilot().get().getInformationAsFormattedText());
} else {
logln(Role.CO_PILOT + ": NONE");
}
if (plane.getCabinCrewList().isPresent()) {
for (Person p : plane.getCabinCrewList().get()) {
logln(p.getInformationAsFormattedText());
}
} else {
logln(Role.CABIN_CREW + ": NONE");
}
if (plane.getPassengerList().isPresent()) {
for (Person p : plane.getPassengerList().get()) {
logln(p.getInformationAsFormattedText());
}
} else {
logln(Role.PASSENGER + ": NONE");
}
} | void function(Plane plane) { logln(STR + plane.getFlightId()); logln(plane.getPilot().getInformationAsFormattedText()); if (plane.getCoPilot().isPresent()) { logln(plane.getCoPilot().get().getInformationAsFormattedText()); } else { logln(Role.CO_PILOT + STR); } if (plane.getCabinCrewList().isPresent()) { for (Person p : plane.getCabinCrewList().get()) { logln(p.getInformationAsFormattedText()); } } else { logln(Role.CABIN_CREW + STR); } if (plane.getPassengerList().isPresent()) { for (Person p : plane.getPassengerList().get()) { logln(p.getInformationAsFormattedText()); } } else { logln(Role.PASSENGER + STR); } } | /**
* Logs the planes information as formatted text to the example log.
*
* @param plane {@link Plane}-instance whose information is written to the log
*/ | Logs the planes information as formatted text to the example log | logPlane | {
"repo_name": "WargulWB/javaExampleProject",
"path": "src/main/java/jep/example/io/xml/XmlIoExample.java",
"license": "mit",
"size": 4272
} | [
"jep.example.io.xml.Person"
] | import jep.example.io.xml.Person; | import jep.example.io.xml.*; | [
"jep.example.io"
] | jep.example.io; | 2,859,486 |
public void setAssetDepreciationDate (Timestamp AssetDepreciationDate); | void function (Timestamp AssetDepreciationDate); | /** Set Asset Depreciation Date.
* Date of last depreciation
*/ | Set Asset Depreciation Date. Date of last depreciation | setAssetDepreciationDate | {
"repo_name": "erpcya/adempierePOS",
"path": "base/src/org/compiere/model/I_I_FixedAsset.java",
"license": "gpl-2.0",
"size": 16713
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,848,367 |
protected Subscription findSubscription(final String topicArn, final String queueArn) {
if(topicArn == null){
throw new IllegalArgumentException("topicArn cannot be null");
}
if(queueArn == null){
throw new IllegalArgumentException("queueArn cannot be null");
}
ListSubscriptionsByTopicResult result;
do {
// Keep looking until we find it or run out of nextTokens.
ListSubscriptionsByTopicRequest request = new ListSubscriptionsByTopicRequest(topicArn);
result = this.awsSNSClient.listSubscriptionsByTopic(request);
for (Subscription subscription : result.getSubscriptions()) {
if (subscription.getProtocol().equals(PROTOCOL_SQS) &&
subscription.getEndpoint().equals(queueArn) &&
subscription.getTopicArn().equals(topicArn)) {
return subscription;
}
}
} while (result.getNextToken() != null);
return null;
}
| Subscription function(final String topicArn, final String queueArn) { if(topicArn == null){ throw new IllegalArgumentException(STR); } if(queueArn == null){ throw new IllegalArgumentException(STR); } ListSubscriptionsByTopicResult result; do { ListSubscriptionsByTopicRequest request = new ListSubscriptionsByTopicRequest(topicArn); result = this.awsSNSClient.listSubscriptionsByTopic(request); for (Subscription subscription : result.getSubscriptions()) { if (subscription.getProtocol().equals(PROTOCOL_SQS) && subscription.getEndpoint().equals(queueArn) && subscription.getTopicArn().equals(topicArn)) { return subscription; } } } while (result.getNextToken() != null); return null; } | /**
* Finds this subscription of the topic to the queue if it exists.
* @param topicArn
* @param queueArn
* @return
*/ | Finds this subscription of the topic to the queue if it exists | findSubscription | {
"repo_name": "john-hill/worker-utilities",
"path": "src/main/java/org/sagebionetworks/workers/util/aws/message/MessageQueueImpl.java",
"license": "mit",
"size": 13474
} | [
"com.amazonaws.services.sns.model.ListSubscriptionsByTopicRequest",
"com.amazonaws.services.sns.model.ListSubscriptionsByTopicResult",
"com.amazonaws.services.sns.model.Subscription"
] | import com.amazonaws.services.sns.model.ListSubscriptionsByTopicRequest; import com.amazonaws.services.sns.model.ListSubscriptionsByTopicResult; import com.amazonaws.services.sns.model.Subscription; | import com.amazonaws.services.sns.model.*; | [
"com.amazonaws.services"
] | com.amazonaws.services; | 1,790,834 |
public void unsubscribe(String source, Bundle data) throws IOException {
if (data == null) {
data = new Bundle();
}
// Use the register servlet, with 'delete=true'.
// Registration service returns a registration_id on success - or an error code.
data.putString(EXTRA_DELETE, "1");
subscribe(source, data);
} | void function(String source, Bundle data) throws IOException { if (data == null) { data = new Bundle(); } data.putString(EXTRA_DELETE, "1"); subscribe(source, data); } | /**
* Unsubscribe from a source to stop receiving messages from it.
* <p>
* This function is blocking and should not be called on the main thread.
*
* @param source to unsubscribe
* @param data (optional) additional information.
* @throws IOException if the request fails.
*/ | Unsubscribe from a source to stop receiving messages from it. This function is blocking and should not be called on the main thread | unsubscribe | {
"repo_name": "scheib/chromium",
"path": "components/gcm_driver/android/java/src/org/chromium/components/gcm_driver/GoogleCloudMessagingV2.java",
"license": "bsd-3-clause",
"size": 7690
} | [
"android.os.Bundle",
"java.io.IOException"
] | import android.os.Bundle; import java.io.IOException; | import android.os.*; import java.io.*; | [
"android.os",
"java.io"
] | android.os; java.io; | 1,719,171 |
public File getIndexJar() {
return xmlIndexJar;
} | File function() { return xmlIndexJar; } | /**
* Get the {@code index.jar} file that represents the local swap repo.
*/ | Get the index.jar file that represents the local swap repo | getIndexJar | {
"repo_name": "CopperheadOS/platform_packages_apps_F-Droid",
"path": "app/src/main/java/org/fdroid/fdroid/localrepo/LocalRepoManager.java",
"license": "gpl-3.0",
"size": 19216
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,769,354 |
void adjustBreaker(long delta) {
if (this.breakerService != null) {
CircuitBreaker breaker = this.breakerService.getBreaker(CircuitBreaker.REQUEST);
if (this.checkBreaker == true) {
// checking breaker means potentially tripping, but it doesn't
// have to if the delta is negative
if (delta > 0) {
try {
breaker.addEstimateBytesAndMaybeBreak(delta, "<reused_arrays>");
} catch (CircuitBreakingException e) {
// since we've already created the data, we need to
// add it so closing the stream re-adjusts properly
breaker.addWithoutBreaking(delta);
// re-throw the original exception
throw e;
}
} else {
breaker.addWithoutBreaking(delta);
}
} else {
// even if we are not checking the breaker, we need to adjust
// its' totals, so add without breaking
breaker.addWithoutBreaking(delta);
}
}
} | void adjustBreaker(long delta) { if (this.breakerService != null) { CircuitBreaker breaker = this.breakerService.getBreaker(CircuitBreaker.REQUEST); if (this.checkBreaker == true) { if (delta > 0) { try { breaker.addEstimateBytesAndMaybeBreak(delta, STR); } catch (CircuitBreakingException e) { breaker.addWithoutBreaking(delta); throw e; } } else { breaker.addWithoutBreaking(delta); } } else { breaker.addWithoutBreaking(delta); } } } | /**
* Adjust the circuit breaker with the given delta, if the delta is
* negative, or checkBreaker is false, the breaker will be adjusted
* without tripping
*/ | Adjust the circuit breaker with the given delta, if the delta is negative, or checkBreaker is false, the breaker will be adjusted without tripping | adjustBreaker | {
"repo_name": "palecur/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/common/util/BigArrays.java",
"license": "apache-2.0",
"size": 28051
} | [
"org.elasticsearch.common.breaker.CircuitBreaker",
"org.elasticsearch.common.breaker.CircuitBreakingException"
] | import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.breaker.CircuitBreakingException; | import org.elasticsearch.common.breaker.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 424,885 |
public static void startActivityForResult(@NonNull final Bundle extras,
@NonNull final Activity activity,
@NonNull final String pkg,
@NonNull final String cls,
final int requestCode,
@Nullable final Bundle options) {
startActivityForResult(activity, extras, pkg, cls, requestCode, options);
} | static void function(@NonNull final Bundle extras, @NonNull final Activity activity, @NonNull final String pkg, @NonNull final String cls, final int requestCode, @Nullable final Bundle options) { startActivityForResult(activity, extras, pkg, cls, requestCode, options); } | /**
* Start the activity for result.
*
* @param extras The Bundle of extras to add to this intent.
* @param activity The activity.
* @param pkg The name of the package.
* @param cls The name of the class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param options Additional options for how the Activity should be started.
*/ | Start the activity for result | startActivityForResult | {
"repo_name": "didi/DoraemonKit",
"path": "Android/dokit-util/src/main/java/com/didichuxing/doraemonkit/util/ActivityUtils.java",
"license": "apache-2.0",
"size": 90700
} | [
"android.app.Activity",
"android.os.Bundle",
"androidx.annotation.NonNull",
"androidx.annotation.Nullable"
] | import android.app.Activity; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; | import android.app.*; import android.os.*; import androidx.annotation.*; | [
"android.app",
"android.os",
"androidx.annotation"
] | android.app; android.os; androidx.annotation; | 2,638,874 |
@Deprecated
public KeyIterator getKeyIterator(InetSocketAddress address)
throws MemcachedException, InterruptedException, TimeoutException;
| KeyIterator function(InetSocketAddress address) throws MemcachedException, InterruptedException, TimeoutException; | /**
* Get key iterator for special memcached server.You must known that the
* iterator is a snapshot for memcached all keys,it is not real-time.The
* 'stats cachedump" has length limitation,so iterator could not visit all
* keys if you have many keys.Your application should not be dependent on
* this feature.
*
* @deprecated memcached 1.6.x will remove cachedump stats command,so this
* method will be removed in the future
* @param address
* @return
*/ | Get key iterator for special memcached server.You must known that the iterator is a snapshot for memcached all keys,it is not real-time.The 'stats cachedump" has length limitation,so iterator could not visit all keys if you have many keys.Your application should not be dependent on this feature | getKeyIterator | {
"repo_name": "springning/xmemcached",
"path": "src/main/java/net/rubyeye/xmemcached/MemcachedClient.java",
"license": "apache-2.0",
"size": 60137
} | [
"java.net.InetSocketAddress",
"java.util.concurrent.TimeoutException",
"net.rubyeye.xmemcached.exception.MemcachedException"
] | import java.net.InetSocketAddress; import java.util.concurrent.TimeoutException; import net.rubyeye.xmemcached.exception.MemcachedException; | import java.net.*; import java.util.concurrent.*; import net.rubyeye.xmemcached.exception.*; | [
"java.net",
"java.util",
"net.rubyeye.xmemcached"
] | java.net; java.util; net.rubyeye.xmemcached; | 2,909,086 |
public void setQueryContextService(final QueryContextService queryContextService)
{
this.queryContextService = queryContextService;
} | void function(final QueryContextService queryContextService) { this.queryContextService = queryContextService; } | /**
* Set a new value for the queryContextService property.
*
* @param queryContextService
* the queryContextService to set
*/ | Set a new value for the queryContextService property | setQueryContextService | {
"repo_name": "openfurther/further-open-core",
"path": "fqe/fqe-ws/src/main/java/edu/utah/further/fqe/ws/FqeServiceRestImpl.java",
"license": "apache-2.0",
"size": 28626
} | [
"edu.utah.further.fqe.api.service.query.QueryContextService"
] | import edu.utah.further.fqe.api.service.query.QueryContextService; | import edu.utah.further.fqe.api.service.query.*; | [
"edu.utah.further"
] | edu.utah.further; | 585,826 |
@SuppressWarnings( "unchecked" ) protected static List<String> receiveDebugBuffer( OutputStream outputStream,
InputStream inputStream, LogChannelInterface log ) throws KettleException {
List<String> stdOutStdErr = new ArrayList<String>();
boolean debug = log == null || log.isDebug();
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> command = new HashMap<String, Object>();
command.put( "command", "get_debug_buffer" );
if ( inputStream != null && outputStream != null ) {
try {
if ( debug ) {
outputCommandDebug( command, log );
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
mapper.writeValue( bos, command );
byte[] bytes = bos.toByteArray();
// write the command
writeDelimitedToOutputStream( bytes, outputStream );
bytes = readDelimitedFromInputStream( inputStream );
Map<String, Object> ack = mapper.readValue( bytes, Map.class );
if ( !ack.get( "response" ).toString().equals( "ok" ) ) {
// fatal error
throw new KettleException( ack.get( ERROR_MESSAGE_KEY ).toString() );
}
Object stOut = ack.get( "std_out" );
stdOutStdErr.add( stOut != null ? stOut.toString() : "" );
Object stdErr = ack.get( "std_err" );
stdOutStdErr.add( stdErr != null ? stdErr.toString() : "" );
} catch ( IOException ex ) {
throw new KettleException( ex );
}
} else if ( debug ) {
outputCommandDebug( command, log );
}
return stdOutStdErr;
} | @SuppressWarnings( STR ) static List<String> function( OutputStream outputStream, InputStream inputStream, LogChannelInterface log ) throws KettleException { List<String> stdOutStdErr = new ArrayList<String>(); boolean debug = log == null log.isDebug(); ObjectMapper mapper = new ObjectMapper(); Map<String, Object> command = new HashMap<String, Object>(); command.put( STR, STR ); if ( inputStream != null && outputStream != null ) { try { if ( debug ) { outputCommandDebug( command, log ); } ByteArrayOutputStream bos = new ByteArrayOutputStream(); mapper.writeValue( bos, command ); byte[] bytes = bos.toByteArray(); writeDelimitedToOutputStream( bytes, outputStream ); bytes = readDelimitedFromInputStream( inputStream ); Map<String, Object> ack = mapper.readValue( bytes, Map.class ); if ( !ack.get( STR ).toString().equals( "ok" ) ) { throw new KettleException( ack.get( ERROR_MESSAGE_KEY ).toString() ); } Object stOut = ack.get( STR ); stdOutStdErr.add( stOut != null ? stOut.toString() : STRstd_errSTR" ); } catch ( IOException ex ) { throw new KettleException( ex ); } } else if ( debug ) { outputCommandDebug( command, log ); } return stdOutStdErr; } | /**
* Std out and err are redirected to StringIO objects in the server. This
* method retrieves the values of those buffers.
*
* @param outputStream the output stream to talk to the server on
* @param inputStream the input stream to receive server responses from
* @param log optional log
* @return the std out and err strings as a two element list
* @throws KettleException if a problem occurs
*/ | Std out and err are redirected to StringIO objects in the server. This method retrieves the values of those buffers | receiveDebugBuffer | {
"repo_name": "pentaho-labs/pentaho-cpython-plugin",
"path": "src/org/pentaho/python/ServerUtils.java",
"license": "apache-2.0",
"size": 45122
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.codehaus.jackson.map.ObjectMapper",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.core.logging.LogChannelInterface"
] | import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.codehaus.jackson.map.ObjectMapper; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.logging.LogChannelInterface; | import java.io.*; import java.util.*; import org.codehaus.jackson.map.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.logging.*; | [
"java.io",
"java.util",
"org.codehaus.jackson",
"org.pentaho.di"
] | java.io; java.util; org.codehaus.jackson; org.pentaho.di; | 2,441,973 |
protected final NamespaceService getNamespaceService()
{
return m_davHelper.getNamespaceService();
}
| final NamespaceService function() { return m_davHelper.getNamespaceService(); } | /**
* Convenience method to return the namespace service
*
* @return NamespaceService
*/ | Convenience method to return the namespace service | getNamespaceService | {
"repo_name": "to2y/AlfrescoOnlineEditWebDAV",
"path": "OnlineEditWebDAV/src/jp/aegif/alfresco/online_webdav/WebDAVMethod.java",
"license": "gpl-2.0",
"size": 46386
} | [
"org.alfresco.service.namespace.NamespaceService"
] | import org.alfresco.service.namespace.NamespaceService; | import org.alfresco.service.namespace.*; | [
"org.alfresco.service"
] | org.alfresco.service; | 1,424,777 |
@Step
List<ICell> cellsMatch(String regex); | List<ICell> cellsMatch(String regex); | /**
* Get all Cells with values matches to searched regex
*/ | Get all Cells with values matches to searched regex | cellsMatch | {
"repo_name": "bes422/JDI",
"path": "Java/JDI/jdi-uitest-core/src/main/java/com/epam/jdi/uitests/core/interfaces/complex/tables/ITable.java",
"license": "gpl-3.0",
"size": 10479
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,836,125 |
// TODO(louiscryan): Not clear if we want to use this idiom for 'simple' stubs.
public static <ReqT, RespT> Iterator<RespT> blockingServerStreamingCall(
ClientCall<ReqT, RespT> call, ReqT param) {
BlockingResponseStream<RespT> result = new BlockingResponseStream<RespT>(call);
asyncUnaryRequestCall(call, param, result.listener(), true);
return result;
} | static <ReqT, RespT> Iterator<RespT> function( ClientCall<ReqT, RespT> call, ReqT param) { BlockingResponseStream<RespT> result = new BlockingResponseStream<RespT>(call); asyncUnaryRequestCall(call, param, result.listener(), true); return result; } | /**
* Executes a server-streaming call returning a blocking {@link Iterator} over the
* response stream.
* @return an iterator over the response stream.
*/ | Executes a server-streaming call returning a blocking <code>Iterator</code> over the response stream | blockingServerStreamingCall | {
"repo_name": "aglne/grpc-java",
"path": "stub/src/main/java/io/grpc/stub/ClientCalls.java",
"license": "bsd-3-clause",
"size": 13599
} | [
"io.grpc.ClientCall",
"java.util.Iterator"
] | import io.grpc.ClientCall; import java.util.Iterator; | import io.grpc.*; import java.util.*; | [
"io.grpc",
"java.util"
] | io.grpc; java.util; | 1,366,827 |
String getMethodHelp() throws XmlRpcException; | String getMethodHelp() throws XmlRpcException; | /** <p>This method may be used to implement
* {@link XmlRpcListableHandlerMapping#getMethodHelp(String)}.
* Typically, the handler mapping will pick up the
* matching handler, invoke its method
* {@link #getMethodHelp()}, and return the result.</p>
*/ | This method may be used to implement <code>XmlRpcListableHandlerMapping#getMethodHelp(String)</code>. Typically, the handler mapping will pick up the matching handler, invoke its method <code>#getMethodHelp()</code>, and return the result | getMethodHelp | {
"repo_name": "kralf/ros-android",
"path": "src/xmlrpc/org/apache/xmlrpc/metadata/XmlRpcMetaDataHandler.java",
"license": "apache-2.0",
"size": 2393
} | [
"org.apache.xmlrpc.XmlRpcException"
] | import org.apache.xmlrpc.XmlRpcException; | import org.apache.xmlrpc.*; | [
"org.apache.xmlrpc"
] | org.apache.xmlrpc; | 1,220,143 |
private void deleteFiles(final Set<IPath> nameSet,
IProgressMonitor monitor) throws CoreException {
if (nameSet == null || nameSet.isEmpty()) {
return;
}
Set<IContainer> subFolders = new HashSet<IContainer>();
for (IPath filePath : nameSet) {
// Generate new path
IFile currentFile = project.getFile(filePath);
if (currentFile.exists()) {
// Retrieve parent folder and store for deletion
IContainer folder = currentFile.getParent();
subFolders.add(folder);
currentFile.delete(true, monitor);
}
monitor.worked(1);
}
// Delete parent folders, if they are empty
for (IContainer folder : subFolders) {
if (folder.exists() && folder.members().length == 0) {
folder.delete(true, monitor);
}
monitor.worked(1);
}
} | void function(final Set<IPath> nameSet, IProgressMonitor monitor) throws CoreException { if (nameSet == null nameSet.isEmpty()) { return; } Set<IContainer> subFolders = new HashSet<IContainer>(); for (IPath filePath : nameSet) { IFile currentFile = project.getFile(filePath); if (currentFile.exists()) { IContainer folder = currentFile.getParent(); subFolders.add(folder); currentFile.delete(true, monitor); } monitor.worked(1); } for (IContainer folder : subFolders) { if (folder.exists() && folder.members().length == 0) { folder.delete(true, monitor); } monitor.worked(1); } } | /**
* Deletes a set of files from the file system, and also their parent
* folders if those become empty during this process.
*
* @param nameSet set of file paths
* @param monitor progress monitor
* @throws CoreException if an error occurs
*/ | Deletes a set of files from the file system, and also their parent folders if those become empty during this process | deleteFiles | {
"repo_name": "rondiplomatico/texlipse",
"path": "source/net/sourceforge/texlipse/builder/OutputFileManager.java",
"license": "epl-1.0",
"size": 28451
} | [
"java.util.HashSet",
"java.util.Set",
"org.eclipse.core.resources.IContainer",
"org.eclipse.core.resources.IFile",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IPath",
"org.eclipse.core.runtime.IProgressMonitor"
] | import java.util.HashSet; import java.util.Set; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; | import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; | [
"java.util",
"org.eclipse.core"
] | java.util; org.eclipse.core; | 1,573,733 |
public Set getUnsynchronizedFragments() {
final ID3v2_4 total = new ID3v2_4(id3v2tag);
final Set set = new HashSet(32);
total.append(id3v1tag);
total.append(lyrics3tag);
total.append(filenameTag);
total.append(id3v2tag);
final ID3v2_4 id3v1 = new ID3v2_4(id3v1tag);
final ID3v2_4 lyrics3 = new ID3v2_4(lyrics3tag);
final ID3v2_4 filename = new ID3v2_4(filenameTag);
final AbstractID3v2 id3v2 = id3v2tag;
final Iterator iterator = total.iterator();
while (iterator.hasNext()) {
final AbstractID3v2Frame frame = (AbstractID3v2Frame) iterator.next();
final String identifier = frame.getIdentifier();
if (id3v2 != null) {
if (id3v2.hasFrame(identifier)) {
if (!id3v2.getFrame(identifier).isSubsetOf(frame)) {
set.add(identifier);
}
}
}
if (id3v1.hasFrame(identifier)) {
if (!id3v1.getFrame(identifier).isSubsetOf(frame)) {
set.add(identifier);
}
}
if (lyrics3.hasFrame(identifier)) {
if (!lyrics3.getFrame(identifier).isSubsetOf(frame)) {
set.add(identifier);
}
}
if (filename.hasFrame(identifier)) {
if (!filename.getFrame(identifier).isSubsetOf(frame)) {
set.add(identifier);
}
}
}
return set;
} | Set function() { final ID3v2_4 total = new ID3v2_4(id3v2tag); final Set set = new HashSet(32); total.append(id3v1tag); total.append(lyrics3tag); total.append(filenameTag); total.append(id3v2tag); final ID3v2_4 id3v1 = new ID3v2_4(id3v1tag); final ID3v2_4 lyrics3 = new ID3v2_4(lyrics3tag); final ID3v2_4 filename = new ID3v2_4(filenameTag); final AbstractID3v2 id3v2 = id3v2tag; final Iterator iterator = total.iterator(); while (iterator.hasNext()) { final AbstractID3v2Frame frame = (AbstractID3v2Frame) iterator.next(); final String identifier = frame.getIdentifier(); if (id3v2 != null) { if (id3v2.hasFrame(identifier)) { if (!id3v2.getFrame(identifier).isSubsetOf(frame)) { set.add(identifier); } } } if (id3v1.hasFrame(identifier)) { if (!id3v1.getFrame(identifier).isSubsetOf(frame)) { set.add(identifier); } } if (lyrics3.hasFrame(identifier)) { if (!lyrics3.getFrame(identifier).isSubsetOf(frame)) { set.add(identifier); } } if (filename.hasFrame(identifier)) { if (!filename.getFrame(identifier).isSubsetOf(frame)) { set.add(identifier); } } } return set; } | /**
* Returns a HashSet of unsynchronized fragments across all tags in this object. A fragment is unsynchronized if it
* exists in two or more tags but is not equal across all of them.
*
* @return a HashSet of unsynchronized fragments
*/ | Returns a HashSet of unsynchronized fragments across all tags in this object. A fragment is unsynchronized if it exists in two or more tags but is not equal across all of them | getUnsynchronizedFragments | {
"repo_name": "Gooair/groovesquid",
"path": "src/main/java/org/farng/mp3/MP3File.java",
"license": "gpl-3.0",
"size": 48247
} | [
"java.util.HashSet",
"java.util.Iterator",
"java.util.Set",
"org.farng.mp3.id3.AbstractID3v2",
"org.farng.mp3.id3.AbstractID3v2Frame"
] | import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.farng.mp3.id3.AbstractID3v2; import org.farng.mp3.id3.AbstractID3v2Frame; | import java.util.*; import org.farng.mp3.id3.*; | [
"java.util",
"org.farng.mp3"
] | java.util; org.farng.mp3; | 256,959 |
public static ConfigFunctionsManager getConfigFunctionsManager()
{
return engine.getConfigFunctionsManager();
} | static ConfigFunctionsManager function() { return engine.getConfigFunctionsManager(); } | /**
* Returns the Resource manager.
* <p>
* @return The Resource manager.
*/ | Returns the Resource manager. | getConfigFunctionsManager | {
"repo_name": "whichonespink44/TerrainControl",
"path": "common/src/main/java/com/khorn/terraincontrol/TerrainControl.java",
"license": "mit",
"size": 11264
} | [
"com.khorn.terraincontrol.configuration.ConfigFunctionsManager"
] | import com.khorn.terraincontrol.configuration.ConfigFunctionsManager; | import com.khorn.terraincontrol.configuration.*; | [
"com.khorn.terraincontrol"
] | com.khorn.terraincontrol; | 1,593,944 |
static void accept(
final AnnotationVisitor av,
final String name,
final Object value)
{
if (av != null) {
if (value instanceof String[]) {
String[] typeconst = (String[]) value;
av.visitEnum(name, typeconst[0], typeconst[1]);
} else if (value instanceof AnnotationNode) {
AnnotationNode an = (AnnotationNode) value;
an.accept(av.visitAnnotation(name, an.desc));
} else if (value instanceof List) {
AnnotationVisitor v = av.visitArray(name);
List array = (List) value;
for (int j = 0; j < array.size(); ++j) {
accept(v, null, array.get(j));
}
v.visitEnd();
} else {
av.visit(name, value);
}
}
} | static void accept( final AnnotationVisitor av, final String name, final Object value) { if (av != null) { if (value instanceof String[]) { String[] typeconst = (String[]) value; av.visitEnum(name, typeconst[0], typeconst[1]); } else if (value instanceof AnnotationNode) { AnnotationNode an = (AnnotationNode) value; an.accept(av.visitAnnotation(name, an.desc)); } else if (value instanceof List) { AnnotationVisitor v = av.visitArray(name); List array = (List) value; for (int j = 0; j < array.size(); ++j) { accept(v, null, array.get(j)); } v.visitEnd(); } else { av.visit(name, value); } } } | /**
* Makes the given visitor visit a given annotation value.
*
* @param av an annotation visitor. Maybe <tt>null</tt>.
* @param name the value name.
* @param value the actual value.
*/ | Makes the given visitor visit a given annotation value | accept | {
"repo_name": "syntelos/gwtcc",
"path": "src/com/google/gwt/dev/asm/tree/AnnotationNode.java",
"license": "apache-2.0",
"size": 6617
} | [
"com.google.gwt.dev.asm.AnnotationVisitor",
"java.util.List"
] | import com.google.gwt.dev.asm.AnnotationVisitor; import java.util.List; | import com.google.gwt.dev.asm.*; import java.util.*; | [
"com.google.gwt",
"java.util"
] | com.google.gwt; java.util; | 1,652,479 |
public String parseIfMatches(String tag) throws ValidationException {
Matcher matcher = detectionPattern().matcher(tag);
if (!matcher.matches()) {
return null;
}
String tagValue = matcher.group(1);
String errorMsg = validator().apply(tagValue);
if (errorMsg != null) {
throw new ValidationException(tagValue, errorMsg);
}
return tagValue;
}
}
public static final String TIMEOUT = "timeout";
public static final String REQUIRES_DARWIN = "requires-darwin";
public static final String DISABLE_LOCAL_PREFETCH = "disable-local-prefetch";
public static final ParseableRequirement CPU =
ParseableRequirement.create(
"cpu:<int>",
Pattern.compile("cpu:(.+)"),
s -> {
Preconditions.checkNotNull(s);
int value;
try {
value = Integer.parseInt(s);
} catch (NumberFormatException e) {
return "can't be parsed as an integer";
}
// De-and-reserialize & compare to only allow canonical integer formats.
if (!Integer.toString(value).equals(s)) {
return "must be in canonical format (e.g. '4' instead of '+04')";
}
if (value < 1) {
return "can't be zero or negative";
}
return null;
});
public static final String SUPPORTS_WORKERS = "supports-workers";
public static final String SUPPORTS_MULTIPLEX_WORKERS = "supports-multiplex-workers";
public static final ImmutableMap<String, String> WORKER_MODE_ENABLED =
ImmutableMap.of(SUPPORTS_WORKERS, "1");
public static final String LOCAL = "local";
public static final String NO_CACHE = "no-cache";
public static final String NO_REMOTE_CACHE = "no-remote-cache";
public static final String NO_REMOTE_EXEC = "no-remote-exec";
public static final String NO_REMOTE = "no-remote";
public static final String LEGACY_NOSANDBOX = "nosandbox";
public static final String NO_SANDBOX = "no-sandbox";
public static final String REQUIRES_NETWORK = "requires-network";
public static final String BLOCK_NETWORK = "block-network";
public static final String REQUIRES_FAKEROOT = "requires-fakeroot";
public static final String DO_NOT_REPORT = "internal-do-not-report";
public static final String REMOTE_EXECUTION_INLINE_OUTPUTS = "internal-inline-outputs"; | String function(String tag) throws ValidationException { Matcher matcher = detectionPattern().matcher(tag); if (!matcher.matches()) { return null; } String tagValue = matcher.group(1); String errorMsg = validator().apply(tagValue); if (errorMsg != null) { throw new ValidationException(tagValue, errorMsg); } return tagValue; } } public static final String TIMEOUT = STR; public static final String REQUIRES_DARWIN = STR; public static final String DISABLE_LOCAL_PREFETCH = STR; public static final ParseableRequirement CPU = ParseableRequirement.create( STR, Pattern.compile(STR), s -> { Preconditions.checkNotNull(s); int value; try { value = Integer.parseInt(s); } catch (NumberFormatException e) { return STR; } if (!Integer.toString(value).equals(s)) { return STR; } if (value < 1) { return STR; } return null; }); public static final String SUPPORTS_WORKERS = STR; public static final String SUPPORTS_MULTIPLEX_WORKERS = STR; public static final ImmutableMap<String, String> WORKER_MODE_ENABLED = ImmutableMap.of(SUPPORTS_WORKERS, "1"); public static final String LOCAL = "local"; public static final String NO_CACHE = STR; public static final String NO_REMOTE_CACHE = STR; public static final String NO_REMOTE_EXEC = STR; public static final String NO_REMOTE = STR; public static final String LEGACY_NOSANDBOX = STR; public static final String NO_SANDBOX = STR; public static final String REQUIRES_NETWORK = STR; public static final String BLOCK_NETWORK = STR; public static final String REQUIRES_FAKEROOT = STR; public static final String DO_NOT_REPORT = STR; public static final String REMOTE_EXECUTION_INLINE_OUTPUTS = STR; | /**
* Returns the parsed value from a tag, if this {@link ParseableRequirement} detects that it is
* responsible for it, otherwise returns {@code null}.
*
* @throws ValidationException if the value parsed out of the tag doesn't pass the validator.
*/ | Returns the parsed value from a tag, if this <code>ParseableRequirement</code> detects that it is responsible for it, otherwise returns null | parseIfMatches | {
"repo_name": "aehlig/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/ExecutionRequirements.java",
"license": "apache-2.0",
"size": 9201
} | [
"com.google.common.base.Preconditions",
"com.google.common.collect.ImmutableMap",
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import java.util.regex.Matcher; import java.util.regex.Pattern; | import com.google.common.base.*; import com.google.common.collect.*; import java.util.regex.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 2,243,006 |
private PathEntity createEntityPathTo(Entity par1Entity, double par2, double par4, double par6, float par8)
{
this.path.clearPath();
this.pointMap.clearMap();
boolean flag = this.isPathingInWater;
int i = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D);
if (this.canEntityDrown && par1Entity.isInWater())
{
i = (int)par1Entity.boundingBox.minY;
for (int j = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), i, MathHelper.floor_double(par1Entity.posZ)); j == Block.waterMoving.blockID || j == Block.waterStill.blockID; j = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), i, MathHelper.floor_double(par1Entity.posZ)))
{
++i;
}
flag = this.isPathingInWater;
this.isPathingInWater = false;
}
else
{
i = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D);
}
PathPoint pathpoint = this.openPoint(MathHelper.floor_double(par1Entity.boundingBox.minX), i, MathHelper.floor_double(par1Entity.boundingBox.minZ));
PathPoint pathpoint1 = this.openPoint(MathHelper.floor_double(par2 - (double)(par1Entity.width / 2.0F)), MathHelper.floor_double(par4), MathHelper.floor_double(par6 - (double)(par1Entity.width / 2.0F)));
PathPoint pathpoint2 = new PathPoint(MathHelper.floor_float(par1Entity.width + 1.0F), MathHelper.floor_float(par1Entity.height + 1.0F), MathHelper.floor_float(par1Entity.width + 1.0F));
PathEntity pathentity = this.addToPath(par1Entity, pathpoint, pathpoint1, pathpoint2, par8);
this.isPathingInWater = flag;
return pathentity;
} | PathEntity function(Entity par1Entity, double par2, double par4, double par6, float par8) { this.path.clearPath(); this.pointMap.clearMap(); boolean flag = this.isPathingInWater; int i = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); if (this.canEntityDrown && par1Entity.isInWater()) { i = (int)par1Entity.boundingBox.minY; for (int j = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), i, MathHelper.floor_double(par1Entity.posZ)); j == Block.waterMoving.blockID j == Block.waterStill.blockID; j = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), i, MathHelper.floor_double(par1Entity.posZ))) { ++i; } flag = this.isPathingInWater; this.isPathingInWater = false; } else { i = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); } PathPoint pathpoint = this.openPoint(MathHelper.floor_double(par1Entity.boundingBox.minX), i, MathHelper.floor_double(par1Entity.boundingBox.minZ)); PathPoint pathpoint1 = this.openPoint(MathHelper.floor_double(par2 - (double)(par1Entity.width / 2.0F)), MathHelper.floor_double(par4), MathHelper.floor_double(par6 - (double)(par1Entity.width / 2.0F))); PathPoint pathpoint2 = new PathPoint(MathHelper.floor_float(par1Entity.width + 1.0F), MathHelper.floor_float(par1Entity.height + 1.0F), MathHelper.floor_float(par1Entity.width + 1.0F)); PathEntity pathentity = this.addToPath(par1Entity, pathpoint, pathpoint1, pathpoint2, par8); this.isPathingInWater = flag; return pathentity; } | /**
* Internal implementation of creating a path from an entity to a point
*/ | Internal implementation of creating a path from an entity to a point | createEntityPathTo | {
"repo_name": "HATB0T/RuneCraftery",
"path": "forge/mcp/src/minecraft/net/minecraft/pathfinding/PathFinder.java",
"license": "lgpl-3.0",
"size": 14801
} | [
"net.minecraft.block.Block",
"net.minecraft.entity.Entity",
"net.minecraft.util.MathHelper"
] | import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; | import net.minecraft.block.*; import net.minecraft.entity.*; import net.minecraft.util.*; | [
"net.minecraft.block",
"net.minecraft.entity",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.entity; net.minecraft.util; | 936,530 |
private static int version() {
System.err.println("dx version " + Version.VERSION);
//todo fix it
return 0;
} | static int function() { System.err.println(STR + Version.VERSION); return 0; } | /**
* Prints the version message.
*/ | Prints the version message | version | {
"repo_name": "tranleduy2000/javaide",
"path": "dx/src/main/java/com/duy/dx/command/Main.java",
"license": "gpl-3.0",
"size": 7850
} | [
"com.duy.dx.Version"
] | import com.duy.dx.Version; | import com.duy.dx.*; | [
"com.duy.dx"
] | com.duy.dx; | 1,939,723 |
private Map retrieveDocumentActions(String cashManagementDocId, TransactionalDocumentPresentationController presentationController, TransactionalDocumentAuthorizer docAuthorizer) {
Map documentActionsMap = null;
try {
final CashManagementDocument cmDoc = (CashManagementDocument)SpringContext.getBean(DocumentService.class).getByDocumentHeaderId(cashManagementDocId);
Set<String> documentActions = presentationController.getDocumentActions(cmDoc);
documentActions = docAuthorizer.getEditModes(cmDoc, GlobalVariables.getUserSession().getPerson(), documentActions);
documentActionsMap = convertSetToMap(documentActions);
}
catch (WorkflowException we) {
throw new RuntimeException("Workflow exception while retrieving document " + cashManagementDocId, we);
}
return documentActionsMap;
} | Map function(String cashManagementDocId, TransactionalDocumentPresentationController presentationController, TransactionalDocumentAuthorizer docAuthorizer) { Map documentActionsMap = null; try { final CashManagementDocument cmDoc = (CashManagementDocument)SpringContext.getBean(DocumentService.class).getByDocumentHeaderId(cashManagementDocId); Set<String> documentActions = presentationController.getDocumentActions(cmDoc); documentActions = docAuthorizer.getEditModes(cmDoc, GlobalVariables.getUserSession().getPerson(), documentActions); documentActionsMap = convertSetToMap(documentActions); } catch (WorkflowException we) { throw new RuntimeException(STR + cashManagementDocId, we); } return documentActionsMap; } | /**
* Retrieves the document actions for the given cash management document
* @param cashManagementDocId the id of the cash management document to check
* @param presentationController the presentation controller of the cash management document
* @param docAuthorizer the cash management document authorizer
* @return a Map of document actions
*/ | Retrieves the document actions for the given cash management document | retrieveDocumentActions | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/fp/document/web/struts/DepositWizardAction.java",
"license": "apache-2.0",
"size": 49629
} | [
"java.util.Map",
"java.util.Set",
"org.kuali.kfs.fp.document.CashManagementDocument",
"org.kuali.kfs.sys.context.SpringContext",
"org.kuali.rice.kew.api.exception.WorkflowException",
"org.kuali.rice.kns.document.authorization.TransactionalDocumentAuthorizer",
"org.kuali.rice.kns.document.authorization.TransactionalDocumentPresentationController",
"org.kuali.rice.krad.service.DocumentService",
"org.kuali.rice.krad.util.GlobalVariables"
] | import java.util.Map; import java.util.Set; import org.kuali.kfs.fp.document.CashManagementDocument; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.kew.api.exception.WorkflowException; import org.kuali.rice.kns.document.authorization.TransactionalDocumentAuthorizer; import org.kuali.rice.kns.document.authorization.TransactionalDocumentPresentationController; import org.kuali.rice.krad.service.DocumentService; import org.kuali.rice.krad.util.GlobalVariables; | import java.util.*; import org.kuali.kfs.fp.document.*; import org.kuali.kfs.sys.context.*; import org.kuali.rice.kew.api.exception.*; import org.kuali.rice.kns.document.authorization.*; import org.kuali.rice.krad.service.*; import org.kuali.rice.krad.util.*; | [
"java.util",
"org.kuali.kfs",
"org.kuali.rice"
] | java.util; org.kuali.kfs; org.kuali.rice; | 2,086,634 |
@Override
public void addAboutItems(JMenu m, Application app, @Nullable View v) {
ActionMap am = app.getActionMap(v);
Action a;
if (null != (a = am.get(AboutAction.ID))) {
add(m,a);
}
} | void function(JMenu m, Application app, @Nullable View v) { ActionMap am = app.getActionMap(v); Action a; if (null != (a = am.get(AboutAction.ID))) { add(m,a); } } | /** Adds items for the following actions to the menu:
* <ul>
* <li>{@link AboutAction}</li>
* </ul>
*/ | Adds items for the following actions to the menu: <code>AboutAction</code> | addAboutItems | {
"repo_name": "runqingz/umple",
"path": "Umplificator/UmplifiedProjects/jhotdraw7/src/main/java/org/jhotdraw/app/DefaultMenuBuilder.java",
"license": "mit",
"size": 10691
} | [
"edu.umd.cs.findbugs.annotations.Nullable",
"javax.swing.Action",
"javax.swing.ActionMap",
"javax.swing.JMenu",
"org.jhotdraw.app.action.app.AboutAction"
] | import edu.umd.cs.findbugs.annotations.Nullable; import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.JMenu; import org.jhotdraw.app.action.app.AboutAction; | import edu.umd.cs.findbugs.annotations.*; import javax.swing.*; import org.jhotdraw.app.action.app.*; | [
"edu.umd.cs",
"javax.swing",
"org.jhotdraw.app"
] | edu.umd.cs; javax.swing; org.jhotdraw.app; | 2,700,681 |
private void invokeConfigurationMethod(Object targetInstance,
ITestNGMethod tm,
Object[] params,
ITestResult testResult)
throws InvocationTargetException, IllegalAccessException
{
// Mark this method with the current thread id
tm.setId(ThreadUtil.currentThreadInfo());
{
InvokedMethod invokedMethod= new InvokedMethod(targetInstance,
tm,
System.currentTimeMillis(),
testResult);
runInvokedMethodListeners(BEFORE_INVOCATION, invokedMethod, testResult);
m_notifier.addInvokedMethod(invokedMethod);
try {
Reporter.setCurrentTestResult(testResult);
ConstructorOrMethod method = tm.getConstructorOrMethod();
//
// If this method is a IConfigurable, invoke its run() method
//
IConfigurable configurableInstance =
IConfigurable.class.isAssignableFrom(method.getDeclaringClass()) ?
(IConfigurable) targetInstance : m_configuration.getConfigurable();
if (configurableInstance != null) {
MethodInvocationHelper.invokeConfigurable(targetInstance, params, configurableInstance, method.getMethod(),
testResult);
}
else {
//
// Not a IConfigurable, invoke directly
//
if (MethodHelper.calculateTimeOut(tm) <= 0) {
MethodInvocationHelper.invokeMethod(method.getMethod(), targetInstance, params);
}
else {
MethodInvocationHelper.invokeWithTimeout(tm, targetInstance, params, testResult);
if (!testResult.isSuccess()) {
// A time out happened
throwConfigurationFailure(testResult, testResult.getThrowable());
throw testResult.getThrowable();
}
}
}
}
catch (InvocationTargetException | IllegalAccessException ex) {
throwConfigurationFailure(testResult, ex);
throw ex;
} catch (Throwable ex) {
throwConfigurationFailure(testResult, ex);
throw new TestNGException(ex);
}
finally {
testResult.setEndMillis(System.currentTimeMillis());
Reporter.setCurrentTestResult(testResult);
runInvokedMethodListeners(AFTER_INVOCATION, invokedMethod, testResult);
Reporter.setCurrentTestResult(null);
}
}
} | void function(Object targetInstance, ITestNGMethod tm, Object[] params, ITestResult testResult) throws InvocationTargetException, IllegalAccessException { tm.setId(ThreadUtil.currentThreadInfo()); { InvokedMethod invokedMethod= new InvokedMethod(targetInstance, tm, System.currentTimeMillis(), testResult); runInvokedMethodListeners(BEFORE_INVOCATION, invokedMethod, testResult); m_notifier.addInvokedMethod(invokedMethod); try { Reporter.setCurrentTestResult(testResult); ConstructorOrMethod method = tm.getConstructorOrMethod(); IConfigurable.class.isAssignableFrom(method.getDeclaringClass()) ? (IConfigurable) targetInstance : m_configuration.getConfigurable(); if (configurableInstance != null) { MethodInvocationHelper.invokeConfigurable(targetInstance, params, configurableInstance, method.getMethod(), testResult); } else { MethodInvocationHelper.invokeMethod(method.getMethod(), targetInstance, params); } else { MethodInvocationHelper.invokeWithTimeout(tm, targetInstance, params, testResult); if (!testResult.isSuccess()) { throwConfigurationFailure(testResult, testResult.getThrowable()); throw testResult.getThrowable(); } } } } catch (InvocationTargetException IllegalAccessException ex) { throwConfigurationFailure(testResult, ex); throw ex; } catch (Throwable ex) { throwConfigurationFailure(testResult, ex); throw new TestNGException(ex); } finally { testResult.setEndMillis(System.currentTimeMillis()); Reporter.setCurrentTestResult(testResult); runInvokedMethodListeners(AFTER_INVOCATION, invokedMethod, testResult); Reporter.setCurrentTestResult(null); } } } | /**
* Effectively invokes a configuration method on all passed in instances.
* TODO: Should change this method to be more like invokeMethod() so that we can
* handle calls to {@code IInvokedMethodListener} better.
*
* @param targetInstance the instance to invoke the configuration method on
* @param tm the configuration method
* @param params the parameters needed for method invocation
* @param testResult
* @throws InvocationTargetException
* @throws IllegalAccessException
*/ | Effectively invokes a configuration method on all passed in instances. handle calls to IInvokedMethodListener better | invokeConfigurationMethod | {
"repo_name": "akozlova/testng",
"path": "src/main/java/org/testng/internal/Invoker.java",
"license": "apache-2.0",
"size": 68558
} | [
"java.lang.reflect.InvocationTargetException",
"org.testng.IConfigurable",
"org.testng.ITestNGMethod",
"org.testng.ITestResult",
"org.testng.Reporter",
"org.testng.TestNGException",
"org.testng.internal.thread.ThreadUtil"
] | import java.lang.reflect.InvocationTargetException; import org.testng.IConfigurable; import org.testng.ITestNGMethod; import org.testng.ITestResult; import org.testng.Reporter; import org.testng.TestNGException; import org.testng.internal.thread.ThreadUtil; | import java.lang.reflect.*; import org.testng.*; import org.testng.internal.thread.*; | [
"java.lang",
"org.testng",
"org.testng.internal"
] | java.lang; org.testng; org.testng.internal; | 375,519 |
@SuppressWarnings("rawtypes")
private MigrationInformation inheritUnmodifiedFields(Migration migration, MigrationInformation migrationInfo) {
String identifier = migrationInfo.getIdentifier();
if (identifier == null) {
identifier = migration.getMigrationSource() != null ? migration.getMigrationSource().getDefaultIdentifier()
.getIdentifier() : migrationInfo.getIdentifier();
}
MigrationType type = migrationInfo.getType() != null ? migrationInfo.getType() : migration.getType();
MigrationInformation result = new MigrationInformation(identifier, type);
if (migrationInfo.getDate() == null) {
migrationInfo.setDate(migration.getDate());
}
if (migrationInfo.getInfo() == null) {
migrationInfo.setInfo(migration.getInfo());
}
if (migrationInfo.getResolver() == null) {
migrationInfo.setResolver(migration.getResultIdentifierResolver());
}
return result;
} | @SuppressWarnings(STR) MigrationInformation function(Migration migration, MigrationInformation migrationInfo) { String identifier = migrationInfo.getIdentifier(); if (identifier == null) { identifier = migration.getMigrationSource() != null ? migration.getMigrationSource().getDefaultIdentifier() .getIdentifier() : migrationInfo.getIdentifier(); } MigrationType type = migrationInfo.getType() != null ? migrationInfo.getType() : migration.getType(); MigrationInformation result = new MigrationInformation(identifier, type); if (migrationInfo.getDate() == null) { migrationInfo.setDate(migration.getDate()); } if (migrationInfo.getInfo() == null) { migrationInfo.setInfo(migration.getInfo()); } if (migrationInfo.getResolver() == null) { migrationInfo.setResolver(migration.getResultIdentifierResolver()); } return result; } | /**
* Fills in migration modification information object with data inherited from previous version of migration.
*
* @param migration
* migration before modification.
* @param migrationInfo
* migration modification information.
* @return filled in migration modification information.
*/ | Fills in migration modification information object with data inherited from previous version of migration | inheritUnmodifiedFields | {
"repo_name": "psnc-dl/darceo",
"path": "wrdz/wrdz-zmd/business/src/main/java/pl/psnc/synat/wrdz/zmd/object/migration/ObjectMigrationManagerBean.java",
"license": "gpl-3.0",
"size": 24035
} | [
"pl.psnc.synat.wrdz.zmd.entity.object.migration.Migration",
"pl.psnc.synat.wrdz.zmd.entity.types.MigrationType",
"pl.psnc.synat.wrdz.zmd.input.MigrationInformation"
] | import pl.psnc.synat.wrdz.zmd.entity.object.migration.Migration; import pl.psnc.synat.wrdz.zmd.entity.types.MigrationType; import pl.psnc.synat.wrdz.zmd.input.MigrationInformation; | import pl.psnc.synat.wrdz.zmd.entity.object.migration.*; import pl.psnc.synat.wrdz.zmd.entity.types.*; import pl.psnc.synat.wrdz.zmd.input.*; | [
"pl.psnc.synat"
] | pl.psnc.synat; | 594,525 |
public void deleteRefactoringDescriptors(final RefactoringDescriptorProxy[] proxies, final IRefactoringDescriptorDeleteQuery query, IProgressMonitor monitor) throws CoreException {
Assert.isNotNull(proxies);
Assert.isNotNull(query);
if (monitor == null)
monitor= new NullProgressMonitor();
try {
monitor.beginTask(RefactoringCoreMessages.RefactoringHistoryService_deleting_refactorings, proxies.length + 300);
final Set set= new HashSet(proxies.length);
for (int index= 0; index < proxies.length; index++) {
if (query.proceed(proxies[index]).isOK())
set.add(proxies[index]);
monitor.worked(1);
}
if (!set.isEmpty()) {
final RefactoringDescriptorProxy[] delete= (RefactoringDescriptorProxy[]) set.toArray(new RefactoringDescriptorProxy[set.size()]);
deleteRefactoringDescriptors(delete, new SubProgressMonitor(monitor, 300));
for (int index= 0; index < delete.length; index++)
fireRefactoringHistoryEvent(delete[index], RefactoringHistoryEvent.DELETED);
}
} finally {
monitor.done();
}
} | void function(final RefactoringDescriptorProxy[] proxies, final IRefactoringDescriptorDeleteQuery query, IProgressMonitor monitor) throws CoreException { Assert.isNotNull(proxies); Assert.isNotNull(query); if (monitor == null) monitor= new NullProgressMonitor(); try { monitor.beginTask(RefactoringCoreMessages.RefactoringHistoryService_deleting_refactorings, proxies.length + 300); final Set set= new HashSet(proxies.length); for (int index= 0; index < proxies.length; index++) { if (query.proceed(proxies[index]).isOK()) set.add(proxies[index]); monitor.worked(1); } if (!set.isEmpty()) { final RefactoringDescriptorProxy[] delete= (RefactoringDescriptorProxy[]) set.toArray(new RefactoringDescriptorProxy[set.size()]); deleteRefactoringDescriptors(delete, new SubProgressMonitor(monitor, 300)); for (int index= 0; index < delete.length; index++) fireRefactoringHistoryEvent(delete[index], RefactoringHistoryEvent.DELETED); } } finally { monitor.done(); } } | /**
* Deletes the specified refactoring descriptors from their associated
* refactoring histories.
*
* @param proxies
* the refactoring descriptor proxies
* @param query
* the refactoring descriptor delete query to use
* @param monitor
* the progress monitor to use, or <code>null</code>
* @throws CoreException
* if an error occurs while deleting the refactoring
* descriptors. Reasons include:
* <ul>
* <li>The refactoring history has an illegal format, contains
* illegal arguments or otherwise illegal information.</li>
* <li>An I/O error occurs while deleting the refactoring
* descriptors from the refactoring history.</li>
* </ul>
*
* @see IRefactoringCoreStatusCodes#REFACTORING_HISTORY_FORMAT_ERROR
* @see IRefactoringCoreStatusCodes#REFACTORING_HISTORY_IO_ERROR
*/ | Deletes the specified refactoring descriptors from their associated refactoring histories | deleteRefactoringDescriptors | {
"repo_name": "dhuebner/che",
"path": "plugins/plugin-java/che-plugin-java-ext-jdt/org-eclipse-ltk-core-refactoring/src/main/java/org/eclipse/ltk/internal/core/refactoring/history/RefactoringHistoryService.java",
"license": "epl-1.0",
"size": 40828
} | [
"java.util.HashSet",
"java.util.Set",
"org.eclipse.core.runtime.Assert",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IProgressMonitor",
"org.eclipse.core.runtime.NullProgressMonitor",
"org.eclipse.core.runtime.SubProgressMonitor",
"org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy",
"org.eclipse.ltk.core.refactoring.history.RefactoringHistoryEvent",
"org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages"
] | import java.util.HashSet; import java.util.Set; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy; import org.eclipse.ltk.core.refactoring.history.RefactoringHistoryEvent; import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages; | import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.ltk.core.refactoring.*; import org.eclipse.ltk.core.refactoring.history.*; import org.eclipse.ltk.internal.core.refactoring.*; | [
"java.util",
"org.eclipse.core",
"org.eclipse.ltk"
] | java.util; org.eclipse.core; org.eclipse.ltk; | 2,452,427 |
public List<Organization> getOrganizationsForFormViewer() throws Exception {
List<Organization> orgs = organizationBlo.getOrganizations();
for (Organization org : orgs) {
int[] types = {Folder.FORM_FOLDER, Folder.BASIC_DATA_FOLDER, Folder.REFERENCE_DATA_FOLDER,
Folder.RELEASED_FORM_FOLDER,};
wfFolderBlo.getChildrenFoldersForOrgViewer(org, types);
for (TreeNode child : org.getChildren()) {
if (((Folder) child).getType() == Folder.BASIC_DATA_FOLDER) {
} else if (((Folder) child).getType() == Folder.FORM_FOLDER) {
getLeafForms(child);
} else if (((Folder) child).getType() == Folder.RELEASED_FORM_FOLDER) {
getLeafReleasedForms(child);
} else if (((Folder) child).getType() == Folder.REFERENCE_DATA_FOLDER) {
getLeafReference(child);
}
}
}
return orgs;
} | List<Organization> function() throws Exception { List<Organization> orgs = organizationBlo.getOrganizations(); for (Organization org : orgs) { int[] types = {Folder.FORM_FOLDER, Folder.BASIC_DATA_FOLDER, Folder.REFERENCE_DATA_FOLDER, Folder.RELEASED_FORM_FOLDER,}; wfFolderBlo.getChildrenFoldersForOrgViewer(org, types); for (TreeNode child : org.getChildren()) { if (((Folder) child).getType() == Folder.BASIC_DATA_FOLDER) { } else if (((Folder) child).getType() == Folder.FORM_FOLDER) { getLeafForms(child); } else if (((Folder) child).getType() == Folder.RELEASED_FORM_FOLDER) { getLeafReleasedForms(child); } else if (((Folder) child).getType() == Folder.REFERENCE_DATA_FOLDER) { getLeafReference(child); } } } return orgs; } | /**
* Gets all organizations for form explorer tree in data & form perspective.
* These organizations include all form folders that may contain forms and
* the forms.
*
* @return
* @throws Exception
* @date 2011-11-2 下午09:31:58
*/ | Gets all organizations for form explorer tree in data & form perspective. These organizations include all form folders that may contain forms and the forms | getOrganizationsForFormViewer | {
"repo_name": "CloudBPM/SwinFlowCloud-CloudSide",
"path": "springboot_api/src/main/java/com/cloudibpm/blo/form/FormBlo.java",
"license": "apache-2.0",
"size": 6719
} | [
"com.cloudibpm.core.TreeNode",
"com.cloudibpm.core.folder.Folder",
"com.cloudibpm.core.organization.Organization",
"java.util.List"
] | import com.cloudibpm.core.TreeNode; import com.cloudibpm.core.folder.Folder; import com.cloudibpm.core.organization.Organization; import java.util.List; | import com.cloudibpm.core.*; import com.cloudibpm.core.folder.*; import com.cloudibpm.core.organization.*; import java.util.*; | [
"com.cloudibpm.core",
"java.util"
] | com.cloudibpm.core; java.util; | 2,311,638 |
// private static final AudioFormat.Encoding[] NO_ENCODING = {};
// private static final AudioFormat.Encoding[] PCM_ENCODING = {
// AudioFormat.Encoding.PCM_SIGNED };
// private static final AudioFormat.Encoding[] FLAC_ENCODING = {
// FlacEncoding.FLAC };
// private static final AudioFormat.Encoding[] BOTH_ENCODINGS = {
// FlacEncoding.FLAC,
// AudioFormat.Encoding.PCM_SIGNED
// };
// private static final AudioFormat[] NO_FORMAT = {};
public AudioFormat.Encoding[] getSourceEncodings() {
if (HAS_ENCODING) {
AudioFormat.Encoding[] encodings = {
FlacEncoding.FLAC, AudioFormat.Encoding.PCM_SIGNED
};
return encodings;
} else {
AudioFormat.Encoding[] encodings = {
FlacEncoding.FLAC
};
return encodings;
}
}
| AudioFormat.Encoding[] function() { if (HAS_ENCODING) { AudioFormat.Encoding[] encodings = { FlacEncoding.FLAC, AudioFormat.Encoding.PCM_SIGNED }; return encodings; } else { AudioFormat.Encoding[] encodings = { FlacEncoding.FLAC }; return encodings; } } | /**
* Obtains the set of source format encodings from which format conversion
* services are provided by this provider.
*
* @return array of source format encodings. The array will always have a
* length of at least 1.
*/ | Obtains the set of source format encodings from which format conversion services are provided by this provider | getSourceEncodings | {
"repo_name": "XtremeMP-Project/xtrememp-fx",
"path": "xtrememp-audio-spi-flac/src/org/kc7bfi/jflac/sound/spi/FlacFormatConversionProvider.java",
"license": "bsd-3-clause",
"size": 11201
} | [
"javax.sound.sampled.AudioFormat"
] | import javax.sound.sampled.AudioFormat; | import javax.sound.sampled.*; | [
"javax.sound"
] | javax.sound; | 1,428,816 |
@Override
public java.math.BigDecimal getWriteOffAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_WriteOffAmt);
if (bd == null)
return Env.ZERO;
return bd;
} | java.math.BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_WriteOffAmt); if (bd == null) return Env.ZERO; return bd; } | /** Get Write-off Amount.
@return Amount to write-off
*/ | Get Write-off Amount | getWriteOffAmt | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/X_C_Payment.java",
"license": "gpl-2.0",
"size": 53379
} | [
"java.math.BigDecimal",
"org.compiere.util.Env"
] | import java.math.BigDecimal; import org.compiere.util.Env; | import java.math.*; import org.compiere.util.*; | [
"java.math",
"org.compiere.util"
] | java.math; org.compiere.util; | 104,565 |
public HTable truncateTable(byte [] tableName) throws IOException {
HTable table = new HTable(getConfiguration(), tableName);
Scan scan = new Scan();
ResultScanner resScan = table.getScanner(scan);
for(Result res : resScan) {
Delete del = new Delete(res.getRow());
table.delete(del);
}
resScan = table.getScanner(scan);
return table;
} | HTable function(byte [] tableName) throws IOException { HTable table = new HTable(getConfiguration(), tableName); Scan scan = new Scan(); ResultScanner resScan = table.getScanner(scan); for(Result res : resScan) { Delete del = new Delete(res.getRow()); table.delete(del); } resScan = table.getScanner(scan); return table; } | /**
* Provide an existing table name to truncate
* @param tableName existing table
* @return HTable to that new table
* @throws IOException
*/ | Provide an existing table name to truncate | truncateTable | {
"repo_name": "bcopeland/hbase-thrift",
"path": "src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 58875
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.Delete",
"org.apache.hadoop.hbase.client.HTable",
"org.apache.hadoop.hbase.client.Result",
"org.apache.hadoop.hbase.client.ResultScanner",
"org.apache.hadoop.hbase.client.Scan"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; import org.apache.hadoop.hbase.client.Scan; | import java.io.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 341,162 |
public static void main(String[] args) throws Exception {
int res = ToolRunner.run(new Configuration(),
new LoadGenerator(), args);
System.exit(res);
} | static void function(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new LoadGenerator(), args); System.exit(res); } | /** Main program
*
* @param args command line arguments
* @throws Exception
*/ | Main program | main | {
"repo_name": "Shmuma/hadoop",
"path": "src/test/org/apache/hadoop/fs/loadGenerator/LoadGenerator.java",
"license": "apache-2.0",
"size": 17799
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.util.ToolRunner"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.util.ToolRunner; | import org.apache.hadoop.conf.*; import org.apache.hadoop.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,251,634 |
void setNewDepthMax(@NonNegative int depthMax);
| void setNewDepthMax(@NonNegative int depthMax); | /**
* Set the depth max of the outer ring.
*
* @param depthMax the new maximum depth
*/ | Set the depth max of the outer ring | setNewDepthMax | {
"repo_name": "sirixdb/sirix",
"path": "bundles/sirix-gui/src/main/java/org/sirix/gui/view/model/interfaces/Model.java",
"license": "bsd-3-clause",
"size": 5803
} | [
"org.checkerframework.checker.index.qual.NonNegative"
] | import org.checkerframework.checker.index.qual.NonNegative; | import org.checkerframework.checker.index.qual.*; | [
"org.checkerframework.checker"
] | org.checkerframework.checker; | 1,496,235 |
@Override
public AggIterOutcome outputCurrentBatch() {
// Handle the case of an EMIT with an empty batch
if ( handleEmit && ( batchHolders == null || batchHolders[0].size() == 0 ) ) {
lastBatchOutputCount = 0; // empty
allocateOutgoing(0);
for (VectorWrapper<?> v : outgoing) {
v.getValueVector().getMutator().setValueCount(0);
}
outgoing.getContainer().setRecordCount(0);
// When returning the last outgoing batch (following an incoming EMIT), then replace OK with EMIT
this.outcome = IterOutcome.EMIT;
handleEmit = false; // finish handling EMIT
if ( outBatchIndex != null ) {
outBatchIndex[0] = 0; // reset, for the next EMIT
}
return AggIterOutcome.AGG_EMIT;
}
// when incoming was an empty batch, just finish up
if ( schema == null ) {
logger.trace("Incoming was empty; output is an empty batch.");
this.outcome = IterOutcome.NONE; // no records were read
allFlushed = true;
return AggIterOutcome.AGG_NONE;
}
// Initialization (covers the case of early output)
ArrayList<BatchHolder> currPartition = batchHolders[earlyPartition];
int currOutBatchIndex = outBatchIndex[earlyPartition];
int partitionToReturn = earlyPartition;
if ( ! earlyOutput ) {
// Update the next partition to return (if needed)
// skip fully returned (or spilled) partitions
while (nextPartitionToReturn < numPartitions) {
//
// If this partition was spilled - spill the rest of it and skip it
//
if ( isSpilled(nextPartitionToReturn) ) {
spillAPartition(nextPartitionToReturn); // spill the rest
SpilledPartition sp = new SpilledPartition();
sp.spillFile = spillFiles[nextPartitionToReturn];
sp.spilledBatches = spilledBatchesCount[nextPartitionToReturn];
sp.cycleNum = cycleNum; // remember the current cycle
sp.origPartn = nextPartitionToReturn; // for debugging / filename
sp.prevOrigPartn = originalPartition; // for debugging / filename
spilledPartitionsList.add(sp);
reinitPartition(nextPartitionToReturn); // free the memory
try {
spillSet.close(writers[nextPartitionToReturn]);
} catch (IOException ioe) {
throw UserException.resourceError(ioe)
.message("IO Error while closing output stream")
.build(logger);
}
writers[nextPartitionToReturn] = null;
}
else {
currPartition = batchHolders[nextPartitionToReturn];
currOutBatchIndex = outBatchIndex[nextPartitionToReturn];
// If curr batch (partition X index) is not empty - proceed to return it
if (currOutBatchIndex < currPartition.size() && 0 != currPartition.get(currOutBatchIndex).getNumPendingOutput()) {
break;
}
}
nextPartitionToReturn++; // else check next partition
}
// if passed the last partition - either done or need to restart and read spilled partitions
if (nextPartitionToReturn >= numPartitions) {
// The following "if" is probably never used; due to a similar check at the end of this method
if ( spilledPartitionsList.isEmpty() ) { // and no spilled partitions
allFlushed = true;
this.outcome = IterOutcome.NONE;
if ( is2ndPhase && spillSet.getWriteBytes() > 0 ) {
stats.setLongStat(Metric.SPILL_MB, // update stats - total MB spilled
(int) Math.round(spillSet.getWriteBytes() / 1024.0D / 1024.0));
}
return AggIterOutcome.AGG_NONE; // then return NONE
}
// Else - there are still spilled partitions to process - pick one and handle just like a new incoming
buildComplete = false; // go back and call doWork() again
handlingSpills = true; // beginning to work on the spill files
// pick a spilled partition; set a new incoming ...
SpilledPartition sp = spilledPartitionsList.remove(0);
// Create a new "incoming" out of the spilled partition spill file
newIncoming = new SpilledRecordbatch(sp.spillFile, sp.spilledBatches, context, schema, oContext, spillSet);
originalPartition = sp.origPartn; // used for the filename
logger.trace("Reading back spilled original partition {} as an incoming",originalPartition);
// Initialize .... new incoming, new set of partitions
try { initializeSetup(newIncoming); } catch (Exception e) { throw new RuntimeException(e); }
// update the cycle num if needed
// The current cycle num should always be one larger than in the spilled partition
if ( cycleNum == sp.cycleNum ) {
cycleNum = 1 + sp.cycleNum;
stats.setLongStat(Metric.SPILL_CYCLE, cycleNum); // update stats
// report first spill or memory stressful situations
if ( cycleNum == 1 ) { logger.info("Started reading spilled records "); }
if ( cycleNum == 2 ) { logger.info("SECONDARY SPILLING "); }
if ( cycleNum == 3 ) { logger.warn("TERTIARY SPILLING "); }
if ( cycleNum == 4 ) { logger.warn("QUATERNARY SPILLING "); }
if ( cycleNum == 5 ) { logger.warn("QUINARY SPILLING "); }
}
if ( EXTRA_DEBUG_SPILL ) {
logger.debug("Start reading spilled partition {} (prev {}) from cycle {} (with {} batches). More {} spilled partitions left.",
sp.origPartn, sp.prevOrigPartn, sp.cycleNum, sp.spilledBatches, spilledPartitionsList.size());
}
return AggIterOutcome.AGG_RESTART;
}
partitionToReturn = nextPartitionToReturn ;
}
// get the number of records in the batch holder that are pending output
int numPendingOutput = currPartition.get(currOutBatchIndex).getNumPendingOutput();
// The following accounting is for logging, metrics, etc.
rowsInPartition += numPendingOutput ;
if ( ! handlingSpills ) { rowsNotSpilled += numPendingOutput; }
else { rowsSpilledReturned += numPendingOutput; }
if ( earlyOutput ) { rowsReturnedEarly += numPendingOutput; }
allocateOutgoing(numPendingOutput);
currPartition.get(currOutBatchIndex).outputValues();
int numOutputRecords = numPendingOutput;
this.htables[partitionToReturn].outputKeys(currOutBatchIndex, this.outContainer, numPendingOutput);
// set the value count for outgoing batch value vectors
for (VectorWrapper<?> v : outgoing) {
v.getValueVector().getMutator().setValueCount(numOutputRecords);
}
outgoing.getRecordBatchMemoryManager().updateOutgoingStats(numOutputRecords);
if (logger.isDebugEnabled()) {
logger.debug("BATCH_STATS, outgoing: {}", new RecordBatchSizer(outgoing));
}
this.outcome = IterOutcome.OK;
if ( EXTRA_DEBUG_SPILL && is2ndPhase ) {
logger.debug("So far returned {} + SpilledReturned {} total {} (spilled {})",rowsNotSpilled,rowsSpilledReturned,
rowsNotSpilled+rowsSpilledReturned,
rowsSpilled);
}
lastBatchOutputCount = numOutputRecords;
outBatchIndex[partitionToReturn]++;
// if just flushed the last batch in the partition
if (outBatchIndex[partitionToReturn] == currPartition.size()) {
if ( EXTRA_DEBUG_SPILL ) {
logger.debug("HashAggregate: {} Flushed partition {} with {} batches total {} rows",
earlyOutput ? "(Early)" : "",
partitionToReturn, outBatchIndex[partitionToReturn], rowsInPartition);
}
rowsInPartition = 0; // reset to count for the next partition
// deallocate memory used by this partition, and re-initialize
reinitPartition(partitionToReturn);
if ( earlyOutput ) {
if ( EXTRA_DEBUG_SPILL ) {
logger.debug("HASH AGG: Finished (early) re-init partition {}, mem allocated: {}", earlyPartition, allocator.getAllocatedMemory());
}
outBatchIndex[earlyPartition] = 0; // reset, for next time
earlyOutput = false ; // done with early output
}
else if ( handleEmit ) {
// When returning the last outgoing batch (following an incoming EMIT), then replace OK with EMIT
this.outcome = IterOutcome.EMIT;
handleEmit = false; // finished handling EMIT
outBatchIndex[partitionToReturn] = 0; // reset, for the next EMIT
return AggIterOutcome.AGG_EMIT;
}
else if ( (partitionToReturn + 1 == numPartitions) && spilledPartitionsList.isEmpty() ) { // last partition ?
allFlushed = true; // next next() call will return NONE
logger.trace("HashAggregate: All batches flushed.");
// cleanup my internal state since there is nothing more to return
this.cleanup();
}
}
return AggIterOutcome.AGG_OK;
} | AggIterOutcome function() { if ( handleEmit && ( batchHolders == null batchHolders[0].size() == 0 ) ) { lastBatchOutputCount = 0; allocateOutgoing(0); for (VectorWrapper<?> v : outgoing) { v.getValueVector().getMutator().setValueCount(0); } outgoing.getContainer().setRecordCount(0); this.outcome = IterOutcome.EMIT; handleEmit = false; if ( outBatchIndex != null ) { outBatchIndex[0] = 0; } return AggIterOutcome.AGG_EMIT; } if ( schema == null ) { logger.trace(STR); this.outcome = IterOutcome.NONE; allFlushed = true; return AggIterOutcome.AGG_NONE; } ArrayList<BatchHolder> currPartition = batchHolders[earlyPartition]; int currOutBatchIndex = outBatchIndex[earlyPartition]; int partitionToReturn = earlyPartition; if ( ! earlyOutput ) { while (nextPartitionToReturn < numPartitions) { spillAPartition(nextPartitionToReturn); SpilledPartition sp = new SpilledPartition(); sp.spillFile = spillFiles[nextPartitionToReturn]; sp.spilledBatches = spilledBatchesCount[nextPartitionToReturn]; sp.cycleNum = cycleNum; sp.origPartn = nextPartitionToReturn; sp.prevOrigPartn = originalPartition; spilledPartitionsList.add(sp); reinitPartition(nextPartitionToReturn); try { spillSet.close(writers[nextPartitionToReturn]); } catch (IOException ioe) { throw UserException.resourceError(ioe) .message(STR) .build(logger); } writers[nextPartitionToReturn] = null; } else { currPartition = batchHolders[nextPartitionToReturn]; currOutBatchIndex = outBatchIndex[nextPartitionToReturn]; if (currOutBatchIndex < currPartition.size() && 0 != currPartition.get(currOutBatchIndex).getNumPendingOutput()) { break; } } nextPartitionToReturn++; } if (nextPartitionToReturn >= numPartitions) { if ( spilledPartitionsList.isEmpty() ) { allFlushed = true; this.outcome = IterOutcome.NONE; if ( is2ndPhase && spillSet.getWriteBytes() > 0 ) { stats.setLongStat(Metric.SPILL_MB, (int) Math.round(spillSet.getWriteBytes() / 1024.0D / 1024.0)); } return AggIterOutcome.AGG_NONE; } buildComplete = false; handlingSpills = true; SpilledPartition sp = spilledPartitionsList.remove(0); newIncoming = new SpilledRecordbatch(sp.spillFile, sp.spilledBatches, context, schema, oContext, spillSet); originalPartition = sp.origPartn; logger.trace(STR,originalPartition); try { initializeSetup(newIncoming); } catch (Exception e) { throw new RuntimeException(e); } if ( cycleNum == sp.cycleNum ) { cycleNum = 1 + sp.cycleNum; stats.setLongStat(Metric.SPILL_CYCLE, cycleNum); if ( cycleNum == 1 ) { logger.info(STR); } if ( cycleNum == 2 ) { logger.info(STR); } if ( cycleNum == 3 ) { logger.warn(STR); } if ( cycleNum == 4 ) { logger.warn(STR); } if ( cycleNum == 5 ) { logger.warn(STR); } } if ( EXTRA_DEBUG_SPILL ) { logger.debug(STR, sp.origPartn, sp.prevOrigPartn, sp.cycleNum, sp.spilledBatches, spilledPartitionsList.size()); } return AggIterOutcome.AGG_RESTART; } partitionToReturn = nextPartitionToReturn ; } int numPendingOutput = currPartition.get(currOutBatchIndex).getNumPendingOutput(); rowsInPartition += numPendingOutput ; if ( ! handlingSpills ) { rowsNotSpilled += numPendingOutput; } else { rowsSpilledReturned += numPendingOutput; } if ( earlyOutput ) { rowsReturnedEarly += numPendingOutput; } allocateOutgoing(numPendingOutput); currPartition.get(currOutBatchIndex).outputValues(); int numOutputRecords = numPendingOutput; this.htables[partitionToReturn].outputKeys(currOutBatchIndex, this.outContainer, numPendingOutput); for (VectorWrapper<?> v : outgoing) { v.getValueVector().getMutator().setValueCount(numOutputRecords); } outgoing.getRecordBatchMemoryManager().updateOutgoingStats(numOutputRecords); if (logger.isDebugEnabled()) { logger.debug(STR, new RecordBatchSizer(outgoing)); } this.outcome = IterOutcome.OK; if ( EXTRA_DEBUG_SPILL && is2ndPhase ) { logger.debug(STR,rowsNotSpilled,rowsSpilledReturned, rowsNotSpilled+rowsSpilledReturned, rowsSpilled); } lastBatchOutputCount = numOutputRecords; outBatchIndex[partitionToReturn]++; if (outBatchIndex[partitionToReturn] == currPartition.size()) { if ( EXTRA_DEBUG_SPILL ) { logger.debug(STR, earlyOutput ? STR : STRHASH AGG: Finished (early) re-init partition {}, mem allocated: {}STRHashAggregate: All batches flushed."); this.cleanup(); } } return AggIterOutcome.AGG_OK; } | /**
* Output the next batch from partition "nextPartitionToReturn"
*
* @return iteration outcome (e.g., OK, NONE ...)
*/ | Output the next batch from partition "nextPartitionToReturn" | outputCurrentBatch | {
"repo_name": "ppadma/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggTemplate.java",
"license": "apache-2.0",
"size": 69912
} | [
"java.io.IOException",
"java.util.ArrayList",
"org.apache.drill.common.exceptions.UserException",
"org.apache.drill.exec.record.RecordBatch",
"org.apache.drill.exec.record.RecordBatchSizer",
"org.apache.drill.exec.record.VectorWrapper"
] | import java.io.IOException; import java.util.ArrayList; import org.apache.drill.common.exceptions.UserException; import org.apache.drill.exec.record.RecordBatch; import org.apache.drill.exec.record.RecordBatchSizer; import org.apache.drill.exec.record.VectorWrapper; | import java.io.*; import java.util.*; import org.apache.drill.common.exceptions.*; import org.apache.drill.exec.record.*; | [
"java.io",
"java.util",
"org.apache.drill"
] | java.io; java.util; org.apache.drill; | 1,135,076 |
@Override
public void onPlaybackStart() {
if (!mSession.isActive()) {
mSession.setActive(true);
}
mDelayedStopHandler.removeCallbacksAndMessages(null);
// The service needs to continue running even after the bound client (usually a
// MediaController) disconnects, otherwise the music playback will stop.
// Calling startService(Intent) will keep the service running until it is explicitly killed.
startService(new Intent(getApplicationContext(), MusicService.class));
} | void function() { if (!mSession.isActive()) { mSession.setActive(true); } mDelayedStopHandler.removeCallbacksAndMessages(null); startService(new Intent(getApplicationContext(), MusicService.class)); } | /**
* Callback method called from PlaybackManager whenever the music is about to play.
*/ | Callback method called from PlaybackManager whenever the music is about to play | onPlaybackStart | {
"repo_name": "cuongnd/test_pro",
"path": "android_application/bho886/soundplayer/src/main/java/com/example/android/uamp/MusicService.java",
"license": "gpl-2.0",
"size": 19641
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 340,598 |
@Deprecated
public Site getSite() {
return getNonPersistentSite();
} | Site function() { return getNonPersistentSite(); } | /**
* Returns a Site instance that is not attached to any Hibernate session
* @return
* @deprecated this has been changed to {@link #getNonPersistentSite()} to explicitly indicate that the site
* being returned is not attached to a Hibernate session
*/ | Returns a Site instance that is not attached to any Hibernate session | getSite | {
"repo_name": "caosg/BroadleafCommerce",
"path": "common/src/main/java/org/broadleafcommerce/common/web/BroadleafRequestContext.java",
"license": "apache-2.0",
"size": 26089
} | [
"org.broadleafcommerce.common.site.domain.Site"
] | import org.broadleafcommerce.common.site.domain.Site; | import org.broadleafcommerce.common.site.domain.*; | [
"org.broadleafcommerce.common"
] | org.broadleafcommerce.common; | 936,843 |
ExclusiveContentRepository forRepository(Factory<? extends ArtifactRepository> repository); | ExclusiveContentRepository forRepository(Factory<? extends ArtifactRepository> repository); | /**
* Declares the repository
* @param repository the repository for which we declare exclusive content
* @return this repository descriptor
*/ | Declares the repository | forRepository | {
"repo_name": "gradle/gradle",
"path": "subprojects/core-api/src/main/java/org/gradle/api/artifacts/repositories/ExclusiveContentRepository.java",
"license": "apache-2.0",
"size": 1841
} | [
"org.gradle.internal.Factory"
] | import org.gradle.internal.Factory; | import org.gradle.internal.*; | [
"org.gradle.internal"
] | org.gradle.internal; | 2,433,777 |
protected void translateFromAbsoluteToLayoutRelative(Translatable t) {
IFigure figure = getLayoutContainer();
figure.translateToRelative(t);
figure.translateFromParent(t);
Point negatedLayoutOrigin = getLayoutOrigin().getNegated();
t.performTranslate(negatedLayoutOrigin.x, negatedLayoutOrigin.y);
}
| void function(Translatable t) { IFigure figure = getLayoutContainer(); figure.translateToRelative(t); figure.translateFromParent(t); Point negatedLayoutOrigin = getLayoutOrigin().getNegated(); t.performTranslate(negatedLayoutOrigin.x, negatedLayoutOrigin.y); } | /**
* Translates a {@link Translatable} in absolute coordinates to be
* layout-relative, i.e. relative to the {@link #getLayoutContainer()}'s
* origin, which is obtained via {@link #getLayoutOrigin()}.
*
* @param t
* the Translatable in absolute coordinates to be translated to
* layout-relative coordinates.
* @since 3.7
*/ | Translates a <code>Translatable</code> in absolute coordinates to be layout-relative, i.e. relative to the <code>#getLayoutContainer()</code>'s origin, which is obtained via <code>#getLayoutOrigin()</code> | translateFromAbsoluteToLayoutRelative | {
"repo_name": "opensagres/xdocreport.eclipse",
"path": "rap/org.eclipse.gef/src/org/eclipse/gef/editpolicies/LayoutEditPolicy.java",
"license": "lgpl-2.1",
"size": 15680
} | [
"org.eclipse.draw2d.IFigure",
"org.eclipse.draw2d.geometry.Point",
"org.eclipse.draw2d.geometry.Translatable"
] | import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Translatable; | import org.eclipse.draw2d.*; import org.eclipse.draw2d.geometry.*; | [
"org.eclipse.draw2d"
] | org.eclipse.draw2d; | 2,201,050 |
public void testSequentialUpdatesNoConflicts() throws Exception {
IgniteEx ignite0 = startGrid(0);
final IgniteEx ignite1 = startGrid(1);
final String intFieldName = "f1"; | void function() throws Exception { IgniteEx ignite0 = startGrid(0); final IgniteEx ignite1 = startGrid(1); final String intFieldName = "f1"; | /**
* Verifies that all sequential updates that don't introduce any conflicts are accepted and observed by all nodes.
*/ | Verifies that all sequential updates that don't introduce any conflicts are accepted and observed by all nodes | testSequentialUpdatesNoConflicts | {
"repo_name": "pperalta/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectMetadataExchangeMultinodeTest.java",
"license": "apache-2.0",
"size": 16349
} | [
"org.apache.ignite.internal.IgniteEx"
] | import org.apache.ignite.internal.IgniteEx; | import org.apache.ignite.internal.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,563,090 |
@Test
public void testReplicatedRegionPersistentWanGateway_restartSenderWithCleanQueues_expectNoEventsReceived() {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
createCacheInVMs(nyPort, vm2, vm3);
createReceiverInVMs(vm2, vm3);
createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
String firstDStore = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2,
false, 100, 10, false, true, null, null, true));
String secondDStore = (String) vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2,
false, 100, 10, false, true, null, null, true));
logger.info("The first ds is " + firstDStore);
logger.info("The second ds is " + secondDStore);
vm2.invoke(
() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap()));
vm3.invoke(
() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap()));
startSenderInVMs("ln", vm4, vm5);
vm4.invoke(() -> WANTestBase.pauseSender("ln"));
vm5.invoke(() -> WANTestBase.pauseSender("ln"));
vm4.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln",
isOffHeap()));
vm5.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln",
isOffHeap()));
vm6.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln",
isOffHeap()));
vm7.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln",
isOffHeap()));
vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000));
logger.info("Completed puts in the region");
vm4.invoke(() -> WANTestBase.stopSender("ln"));
vm5.invoke(() -> WANTestBase.stopSender("ln"));
logger.info("Stopped all the senders. ");
AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSenderwithCleanQueues("ln"));
logger.info("Started the sender in vm 4");
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0));
vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0));
vm5.invoke(() -> WANTestBase.startSenderwithCleanQueues("ln"));
logger.info("Started the sender in vm 5");
try {
inv1.await();
} catch (InterruptedException e) {
fail("Got interrupted exception while waiting for startSender to finish.");
}
vm4.invoke(() -> waitForSenderRunningState("ln"));
vm5.invoke(() -> waitForSenderRunningState("ln"));
vm4.invoke(() -> checkQueueSize("ln", 0));
vm5.invoke(() -> checkQueueSize("ln", 0));
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0));
vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0));
} | void function() { Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1)); Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort)); createCacheInVMs(nyPort, vm2, vm3); createReceiverInVMs(vm2, vm3); createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); String firstDStore = (String) vm4.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, false, 100, 10, false, true, null, null, true)); String secondDStore = (String) vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, false, 100, 10, false, true, null, null, true)); logger.info(STR + firstDStore); logger.info(STR + secondDStore); vm2.invoke( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap())); vm3.invoke( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap())); startSenderInVMs("ln", vm4, vm5); vm4.invoke(() -> WANTestBase.pauseSender("ln")); vm5.invoke(() -> WANTestBase.pauseSender("ln")); vm4.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); vm5.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); vm6.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); vm7.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); logger.info(STR); vm4.invoke(() -> WANTestBase.stopSender("ln")); vm5.invoke(() -> WANTestBase.stopSender("ln")); logger.info(STR); AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSenderwithCleanQueues("ln")); logger.info(STR); vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0)); vm5.invoke(() -> WANTestBase.startSenderwithCleanQueues("ln")); logger.info(STR); try { inv1.await(); } catch (InterruptedException e) { fail(STR); } vm4.invoke(() -> waitForSenderRunningState("ln")); vm5.invoke(() -> waitForSenderRunningState("ln")); vm4.invoke(() -> checkQueueSize("ln", 0)); vm5.invoke(() -> checkQueueSize("ln", 0)); vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0)); vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 0)); } | /**
* Enable persistence for GatewaySender, stop the sender and start it with clean-queues option.
* Check if the remote site receives all the event.
*/ | Enable persistence for GatewaySender, stop the sender and start it with clean-queues option. Check if the remote site receives all the event | testReplicatedRegionPersistentWanGateway_restartSenderWithCleanQueues_expectNoEventsReceived | {
"repo_name": "davinash/geode",
"path": "geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java",
"license": "apache-2.0",
"size": 26874
} | [
"org.apache.geode.internal.cache.wan.WANTestBase",
"org.apache.geode.test.dunit.AsyncInvocation",
"org.junit.Assert"
] | import org.apache.geode.internal.cache.wan.WANTestBase; import org.apache.geode.test.dunit.AsyncInvocation; import org.junit.Assert; | import org.apache.geode.internal.cache.wan.*; import org.apache.geode.test.dunit.*; import org.junit.*; | [
"org.apache.geode",
"org.junit"
] | org.apache.geode; org.junit; | 206,732 |
private void initReportPanel() {
reportInitJP= new JPanel();
reportInitJP.setLayout(new MigLayout("align 50% 50%"));
reportInitJP.setBackground(Color.WHITE);
reportStartLabel= new JLabel("Choose a patient to start a pharmacogenomic analysis.");
reportStartLabel.setFont(new Font(reportStartLabel.getFont().getName(), Font.PLAIN, 14));
reportStartLabel.setForeground(Color.DARK_GRAY);
reportInitJP.add(reportStartLabel);
reportPane= new JScrollPane();
reportPane.setBorder(BorderFactory.createEmptyBorder());
//reportPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
reportPane.setViewportView(reportInitJP);
}
| void function() { reportInitJP= new JPanel(); reportInitJP.setLayout(new MigLayout(STR)); reportInitJP.setBackground(Color.WHITE); reportStartLabel= new JLabel(STR); reportStartLabel.setFont(new Font(reportStartLabel.getFont().getName(), Font.PLAIN, 14)); reportStartLabel.setForeground(Color.DARK_GRAY); reportInitJP.add(reportStartLabel); reportPane= new JScrollPane(); reportPane.setBorder(BorderFactory.createEmptyBorder()); reportPane.setViewportView(reportInitJP); } | /**
* Initialize the report panel.
*/ | Initialize the report panel | initReportPanel | {
"repo_name": "ronammar/pharmacogenomics",
"path": "src/pgx/PGXPanel.java",
"license": "lgpl-3.0",
"size": 37951
} | [
"java.awt.Color",
"java.awt.Font",
"javax.swing.BorderFactory",
"javax.swing.JLabel",
"javax.swing.JPanel",
"javax.swing.JScrollPane",
"net.miginfocom.swing.MigLayout"
] | import java.awt.Color; import java.awt.Font; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import net.miginfocom.swing.MigLayout; | import java.awt.*; import javax.swing.*; import net.miginfocom.swing.*; | [
"java.awt",
"javax.swing",
"net.miginfocom.swing"
] | java.awt; javax.swing; net.miginfocom.swing; | 976,859 |
@Nullable public CacheConfiguration getMetaCacheConfiguration() {
return metaCacheCfg;
} | @Nullable CacheConfiguration function() { return metaCacheCfg; } | /**
* Cache config to store IGFS meta information.
*
* @return Cache configuration object.
*/ | Cache config to store IGFS meta information | getMetaCacheConfiguration | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java",
"license": "apache-2.0",
"size": 30260
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,502,035 |
public void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
} | void function(Date lastUpdated) { this.lastUpdated = lastUpdated; } | /**
* When the account info was last updated.
*
* @param lastUpdated When the account info was last updated.
*/ | When the account info was last updated | setLastUpdated | {
"repo_name": "stoicflame/ofx4j",
"path": "src/main/java/com/webcohesion/ofx4j/domain/data/signup/AccountInfoRequest.java",
"license": "apache-2.0",
"size": 1442
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,718,261 |
public boolean contains(Object mapEntry) {
if (!(mapEntry instanceof Map.Entry)) {
return false;
}
DataCursor cursor = null;
try {
cursor = new DataCursor(view, false);
Map.Entry entry = (Map.Entry) mapEntry;
OperationStatus status =
cursor.findBoth(entry.getKey(), entry.getValue(), false);
return (status == OperationStatus.SUCCESS);
} catch (Exception e) {
throw StoredContainer.convertException(e);
} finally {
closeCursor(cursor);
}
} | boolean function(Object mapEntry) { if (!(mapEntry instanceof Map.Entry)) { return false; } DataCursor cursor = null; try { cursor = new DataCursor(view, false); Map.Entry entry = (Map.Entry) mapEntry; OperationStatus status = cursor.findBoth(entry.getKey(), entry.getValue(), false); return (status == OperationStatus.SUCCESS); } catch (Exception e) { throw StoredContainer.convertException(e); } finally { closeCursor(cursor); } } | /**
* Returns true if this set contains the specified element.
* This method conforms to the {@link Set#contains} interface.
*
* @param mapEntry is a {@link java.util.Map.Entry} instance to be checked.
*
* @return true if the key-value pair is present in the set, or false if
* the mapEntry is not a {@link java.util.Map.Entry} instance or is not
* present in the set.
*
* <!-- begin JE only -->
* @throws OperationFailureException if one of the <a
* href="../je/OperationFailureException.html#readFailures">Read Operation
* Failures</a> occurs.
*
* @throws EnvironmentFailureException if an unexpected, internal or
* environment-wide failure occurs.
* <!-- end JE only -->
*
* @throws RuntimeExceptionWrapper if a checked exception is thrown,
* including a {@code DatabaseException} on BDB (C edition).
*/ | Returns true if this set contains the specified element. This method conforms to the <code>Set#contains</code> interface | contains | {
"repo_name": "prat0318/dbms",
"path": "mini_dbms/je-5.0.103/src/com/sleepycat/collections/StoredEntrySet.java",
"license": "mit",
"size": 7094
} | [
"com.sleepycat.je.OperationStatus",
"java.util.Map"
] | import com.sleepycat.je.OperationStatus; import java.util.Map; | import com.sleepycat.je.*; import java.util.*; | [
"com.sleepycat.je",
"java.util"
] | com.sleepycat.je; java.util; | 2,363,253 |
private Map<String, TaskObject> getMap(String map) {
return requestStatusMap.get(map);
} | Map<String, TaskObject> function(String map) { return requestStatusMap.get(map); } | /**
* Helper method to get a request status map given the name.
*/ | Helper method to get a request status map given the name | getMap | {
"repo_name": "williamchengit/TestRepo",
"path": "solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java",
"license": "apache-2.0",
"size": 52146
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,148,869 |
public OffsetDateTime getLastUpdated() {
return this.lastUpdated;
} | OffsetDateTime function() { return this.lastUpdated; } | /**
* Get the lastUpdated property: The last updated timestamp for the pipeline run event in ISO8601 format.
*
* @return the lastUpdated value.
*/ | Get the lastUpdated property: The last updated timestamp for the pipeline run event in ISO8601 format | getLastUpdated | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/synapse/azure-analytics-synapse-artifacts/src/main/java/com/azure/analytics/synapse/artifacts/models/PipelineRun.java",
"license": "mit",
"size": 6489
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 897,313 |
@Override
public synchronized void save() {
if(areStatsDisabled()){
return;
}
if (BulkChange.contains(this))
return;
File userFolder = getUserFolder();
if (userFolder == null) {
return;
}
XmlFile configFile = getConfigFile(userFolder);
try {
configFile.write(this);
SaveableListener.fireOnChange(this, configFile);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to save " + configFile, e);
}
} | synchronized void function() { if(areStatsDisabled()){ return; } if (BulkChange.contains(this)) return; File userFolder = getUserFolder(); if (userFolder == null) { return; } XmlFile configFile = getConfigFile(userFolder); try { configFile.write(this); SaveableListener.fireOnChange(this, configFile); } catch (IOException e) { LOGGER.log(Level.WARNING, STR + configFile, e); } } | /**
* Saves the configuration info to the disk.
*/ | Saves the configuration info to the disk | save | {
"repo_name": "patbos/jenkins",
"path": "core/src/main/java/jenkins/security/apitoken/ApiTokenStats.java",
"license": "mit",
"size": 11361
} | [
"hudson.model.listeners.SaveableListener",
"java.io.File",
"java.io.IOException",
"java.util.logging.Level"
] | import hudson.model.listeners.SaveableListener; import java.io.File; import java.io.IOException; import java.util.logging.Level; | import hudson.model.listeners.*; import java.io.*; import java.util.logging.*; | [
"hudson.model.listeners",
"java.io",
"java.util"
] | hudson.model.listeners; java.io; java.util; | 1,948,237 |
public void readMetaData(Transfer transfer) throws IOException {
dataType = transfer.readInt();
precision = transfer.readLong();
scale = transfer.readInt();
nullable = transfer.readInt();
} | void function(Transfer transfer) throws IOException { dataType = transfer.readInt(); precision = transfer.readLong(); scale = transfer.readInt(); nullable = transfer.readInt(); } | /**
* Write the parameter meta data from the transfer object.
*
* @param transfer the transfer object
*/ | Write the parameter meta data from the transfer object | readMetaData | {
"repo_name": "ferquies/2dam",
"path": "AD/Tema 2/h2/src/main/org/h2/expression/ParameterRemote.java",
"license": "gpl-3.0",
"size": 2567
} | [
"java.io.IOException",
"org.h2.value.Transfer"
] | import java.io.IOException; import org.h2.value.Transfer; | import java.io.*; import org.h2.value.*; | [
"java.io",
"org.h2.value"
] | java.io; org.h2.value; | 1,994,587 |
public RequestedContentTypeResolverBuilder mediaType(String key, MediaType mediaType) {
this.mediaTypes.put(key, mediaType);
return this;
} | RequestedContentTypeResolverBuilder function(String key, MediaType mediaType) { this.mediaTypes.put(key, mediaType); return this; } | /**
* Alternative to {@link #mediaTypes} to add a single mapping.
*/ | Alternative to <code>#mediaTypes</code> to add a single mapping | mediaType | {
"repo_name": "boggad/jdk9-sample",
"path": "sample-catalog/spring-jdk9/src/spring.web.reactive/org/springframework/web/reactive/accept/RequestedContentTypeResolverBuilder.java",
"license": "mit",
"size": 8479
} | [
"org.springframework.http.MediaType"
] | import org.springframework.http.MediaType; | import org.springframework.http.*; | [
"org.springframework.http"
] | org.springframework.http; | 1,807,980 |
public void setReadOnly(boolean readOnly) throws SQLException {
this.conn.setReadOnly(readOnly);
} | void function(boolean readOnly) throws SQLException { this.conn.setReadOnly(readOnly); } | /**
*
* Puts this connection in read-only mode as a hint to enable
*
* database optimizations.
*
*
*
* <P>
* <B>Note: </B> This method cannot be called while in the
*
* middle of a transaction.
*
*
*
* @param readOnly
* true enables read-only mode; false disables
*
* read-only mode.
*
* @exception SQLException
* if a database access error occurs
*
*/ | Puts this connection in read-only mode as a hint to enable database optimizations. Note: This method cannot be called while in the middle of a transaction | setReadOnly | {
"repo_name": "idega/com.idega.core",
"path": "src/java/com/idega/data/DatastoreConnection.java",
"license": "gpl-3.0",
"size": 22381
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 171,626 |
private void showArrow(int whichArrow, int requestedX) {
final View showArrow = (whichArrow == R.id.arrow_up) ? mArrowUp : mArrowDown;
final View hideArrow = (whichArrow == R.id.arrow_up) ? mArrowDown : mArrowUp;
final int arrowWidth = mArrowUp.getMeasuredWidth();
showArrow.setVisibility(View.VISIBLE);
ViewGroup.MarginLayoutParams param = (ViewGroup.MarginLayoutParams)showArrow.getLayoutParams();
param.leftMargin = requestedX - arrowWidth / 2;
hideArrow.setVisibility(View.INVISIBLE);
}
| void function(int whichArrow, int requestedX) { final View showArrow = (whichArrow == R.id.arrow_up) ? mArrowUp : mArrowDown; final View hideArrow = (whichArrow == R.id.arrow_up) ? mArrowDown : mArrowUp; final int arrowWidth = mArrowUp.getMeasuredWidth(); showArrow.setVisibility(View.VISIBLE); ViewGroup.MarginLayoutParams param = (ViewGroup.MarginLayoutParams)showArrow.getLayoutParams(); param.leftMargin = requestedX - arrowWidth / 2; hideArrow.setVisibility(View.INVISIBLE); } | /**
* Show arrow
*
* @param whichArrow arrow type resource id
* @param requestedX distance from left screen
*/ | Show arrow | showArrow | {
"repo_name": "kshark27/UltraExplorer",
"path": "filebrowserULTRA/src/com/mirrorlabs/quickaction/QuickAction.java",
"license": "gpl-3.0",
"size": 9568
} | [
"android.view.View",
"android.view.ViewGroup"
] | import android.view.View; import android.view.ViewGroup; | import android.view.*; | [
"android.view"
] | android.view; | 1,647,659 |
public void setMenuItemLoggerPanel(JCheckBoxMenuItem menuItemLoggerPanel) {
this.menuItemLoggerPanel = menuItemLoggerPanel;
}
| void function(JCheckBoxMenuItem menuItemLoggerPanel) { this.menuItemLoggerPanel = menuItemLoggerPanel; } | /**
* Set the menu item LoggerPanel.
* @param menuItemLoggerPanel The menu item LoggerPanel
*/ | Set the menu item LoggerPanel | setMenuItemLoggerPanel | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-jmeter-3.0/src/core/org/apache/jmeter/gui/GuiPackage.java",
"license": "apache-2.0",
"size": 29555
} | [
"javax.swing.JCheckBoxMenuItem"
] | import javax.swing.JCheckBoxMenuItem; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,583,345 |
public void doShow_student_submission(RunData data)
{
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
Set t = (Set) state.getAttribute(STUDENT_LIST_SHOW_TABLE);
ParameterParser params = data.getParameters();
String id = params.getString("studentId");
// add the student id into the table
t.add(id);
state.setAttribute(STUDENT_LIST_SHOW_TABLE, t);
} // doShow_student_submission | void function(RunData data) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); Set t = (Set) state.getAttribute(STUDENT_LIST_SHOW_TABLE); ParameterParser params = data.getParameters(); String id = params.getString(STR); t.add(id); state.setAttribute(STUDENT_LIST_SHOW_TABLE, t); } | /**
* Action is to show the student submissions
*/ | Action is to show the student submissions | doShow_student_submission | {
"repo_name": "rodriguezdevera/sakai",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 685575
} | [
"java.util.Set",
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.util.ParameterParser"
] | import java.util.Set; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.util.ParameterParser; | import java.util.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.util.*; | [
"java.util",
"org.sakaiproject.cheftool",
"org.sakaiproject.event",
"org.sakaiproject.util"
] | java.util; org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.util; | 1,051,861 |
public void addChangeListener(ChangeListener l) {
if (listener != null) {
throw new IllegalStateException();
}
listener = l;
} | void function(ChangeListener l) { if (listener != null) { throw new IllegalStateException(); } listener = l; } | /** Add a listener to changes of the panel's validity.
* @param l the listener to add
* @see #isValid
*/ | Add a listener to changes of the panel's validity | addChangeListener | {
"repo_name": "Jacksson/mywms",
"path": "rich.client/los.clientsuite/LOS Processes/src/de/linogistix/wmsprocesses/stockunittransfer/BOStockUnitTransferPanelChoose.java",
"license": "gpl-2.0",
"size": 12735
} | [
"javax.swing.event.ChangeListener"
] | import javax.swing.event.ChangeListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 1,848,839 |
protected static void getAlignedPoint(Point2D p, VisualItem item,
double w, double h, int xAlign, int yAlign)
{
double x = item.getX(), y = item.getY();
if ( Double.isNaN(x) || Double.isInfinite(x) )
x = 0; // safety check
if ( Double.isNaN(y) || Double.isInfinite(y) )
y = 0; // safety check
if ( xAlign == Constants.CENTER ) {
x = x-(w/2);
} else if ( xAlign == Constants.RIGHT ) {
x = x-w;
}
if ( yAlign == Constants.CENTER ) {
y = y-(h/2);
} else if ( yAlign == Constants.BOTTOM ) {
y = y-h;
}
p.setLocation(x,y);
} | static void function(Point2D p, VisualItem item, double w, double h, int xAlign, int yAlign) { double x = item.getX(), y = item.getY(); if ( Double.isNaN(x) Double.isInfinite(x) ) x = 0; if ( Double.isNaN(y) Double.isInfinite(y) ) y = 0; if ( xAlign == Constants.CENTER ) { x = x-(w/2); } else if ( xAlign == Constants.RIGHT ) { x = x-w; } if ( yAlign == Constants.CENTER ) { y = y-(h/2); } else if ( yAlign == Constants.BOTTOM ) { y = y-h; } p.setLocation(x,y); } | /**
* Helper method, which calculates the top-left co-ordinate of an item
* given the item's alignment.
*/ | Helper method, which calculates the top-left co-ordinate of an item given the item's alignment | getAlignedPoint | {
"repo_name": "ezegarra/microbrowser",
"path": "src/prefuse/render/LabelRenderer.java",
"license": "bsd-3-clause",
"size": 29353
} | [
"java.awt.geom.Point2D"
] | import java.awt.geom.Point2D; | import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 582,062 |
FinderState updateAssociatedDataConsNameForFieldName(final Name.DataCons associatedDataConsNameForFieldName) {
return new FinderState(Collections.singletonList(associatedDataConsNameForFieldName), this.associatedTypeClassNameForInstanceMethod);
}
| FinderState updateAssociatedDataConsNameForFieldName(final Name.DataCons associatedDataConsNameForFieldName) { return new FinderState(Collections.singletonList(associatedDataConsNameForFieldName), this.associatedTypeClassNameForInstanceMethod); } | /**
* Constructs a new state object based on this one, but with an updated name representing
* the data constructor that is associated with any field names encountered during the
* visitation.
*
* @param associatedDataConsNameForFieldName
* data constructor name that is associated with any field names encountered
* during the visitation. Can *not* be null.
* @return a new state object.
*/ | Constructs a new state object based on this one, but with an updated name representing the data constructor that is associated with any field names encountered during the visitation | updateAssociatedDataConsNameForFieldName | {
"repo_name": "levans/Open-Quark",
"path": "src/CAL_Platform/src/org/openquark/cal/compiler/IdentifierOccurrenceFinder.java",
"license": "bsd-3-clause",
"size": 81938
} | [
"java.util.Collections",
"org.openquark.cal.compiler.SourceModel"
] | import java.util.Collections; import org.openquark.cal.compiler.SourceModel; | import java.util.*; import org.openquark.cal.compiler.*; | [
"java.util",
"org.openquark.cal"
] | java.util; org.openquark.cal; | 481,400 |
public static java.util.Set extractTumourSerumMarkerSet(ims.domain.ILightweightDomainFactory domainFactory, ims.clinicaladmin.vo.TumourSerumMarkersVoCollection voCollection)
{
return extractTumourSerumMarkerSet(domainFactory, voCollection, null, new HashMap());
}
| static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.clinicaladmin.vo.TumourSerumMarkersVoCollection voCollection) { return extractTumourSerumMarkerSet(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.oncology.configuration.domain.objects.TumourSerumMarker set from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.oncology.configuration.domain.objects.TumourSerumMarker set from the value object collection | extractTumourSerumMarkerSet | {
"repo_name": "openhealthcare/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/clinicaladmin/vo/domain/TumourSerumMarkersVoAssembler.java",
"license": "agpl-3.0",
"size": 18379
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,654,457 |
@WebMethod(operationName = "deleteRoleResponsibilityAction")
@CacheEvict(value={Permission.Cache.NAME, Responsibility.Cache.NAME, RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
void deleteRoleResponsibilityAction(@WebParam(name = "roleResponsibilityActionId") String roleResponsibilityActionId) throws RiceIllegalArgumentException; | @WebMethod(operationName = STR) @CacheEvict(value={Permission.Cache.NAME, Responsibility.Cache.NAME, RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true) void deleteRoleResponsibilityAction(@WebParam(name = STR) String roleResponsibilityActionId) throws RiceIllegalArgumentException; | /**
* Deletes the given RoleResponsibilityAction
*
* @since 2.1.2
* @param roleResponsibilityActionId id of the RoleResponsibilityAction to delete.
* @throws RiceIllegalArgumentException if roleResponsibilityActionId is null.
* @throws RiceIllegalStateException if roleResponsibilityAction does not exist.
*/ | Deletes the given RoleResponsibilityAction | deleteRoleResponsibilityAction | {
"repo_name": "ricepanda/rice-git3",
"path": "rice-middleware/kim/kim-api/src/main/java/org/kuali/rice/kim/api/role/RoleService.java",
"license": "apache-2.0",
"size": 48854
} | [
"javax.jws.WebMethod",
"javax.jws.WebParam",
"org.kuali.rice.core.api.exception.RiceIllegalArgumentException",
"org.kuali.rice.kim.api.common.delegate.DelegateMember",
"org.kuali.rice.kim.api.common.delegate.DelegateType",
"org.kuali.rice.kim.api.permission.Permission",
"org.kuali.rice.kim.api.responsibility.Responsibility",
"org.springframework.cache.annotation.CacheEvict"
] | import javax.jws.WebMethod; import javax.jws.WebParam; import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; import org.kuali.rice.kim.api.common.delegate.DelegateMember; import org.kuali.rice.kim.api.common.delegate.DelegateType; import org.kuali.rice.kim.api.permission.Permission; import org.kuali.rice.kim.api.responsibility.Responsibility; import org.springframework.cache.annotation.CacheEvict; | import javax.jws.*; import org.kuali.rice.core.api.exception.*; import org.kuali.rice.kim.api.common.delegate.*; import org.kuali.rice.kim.api.permission.*; import org.kuali.rice.kim.api.responsibility.*; import org.springframework.cache.annotation.*; | [
"javax.jws",
"org.kuali.rice",
"org.springframework.cache"
] | javax.jws; org.kuali.rice; org.springframework.cache; | 2,794,519 |
@Test(expected = IllegalArgumentException.class)
public void testInvalidValueOfIncorrectString() {
Ip4Address ipAddress;
String fromString = "NoSuchIpAddress";
ipAddress = Ip4Address.valueOf(fromString);
} | @Test(expected = IllegalArgumentException.class) void function() { Ip4Address ipAddress; String fromString = STR; ipAddress = Ip4Address.valueOf(fromString); } | /**
* Tests invalid valueOf() converter for an incorrect string.
*/ | Tests invalid valueOf() converter for an incorrect string | testInvalidValueOfIncorrectString | {
"repo_name": "kuujo/onos",
"path": "utils/misc/src/test/java/org/onlab/packet/Ip4AddressTest.java",
"license": "apache-2.0",
"size": 13533
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,946,441 |
@Test
public void verifySublistWithOffset() {
int startIndex = 1;
List<E> list = seq.subList(startIndex, getMaxTests());
Assert.assertEquals(getMaxTests() - startIndex, list.size());
for (int n = 0; n < list.size(); n++) {
Assert.assertEquals(seq.get(startIndex + n), list.get(n));
}
} | void function() { int startIndex = 1; List<E> list = seq.subList(startIndex, getMaxTests()); Assert.assertEquals(getMaxTests() - startIndex, list.size()); for (int n = 0; n < list.size(); n++) { Assert.assertEquals(seq.get(startIndex + n), list.get(n)); } } | /**
* Verify the sublist works with offset.
*/ | Verify the sublist works with offset | verifySublistWithOffset | {
"repo_name": "beargiles/projecteuler",
"path": "src/test/java/com/invariantproperties/projecteuler/AbstractSequenceTest.java",
"license": "apache-2.0",
"size": 9284
} | [
"java.util.List",
"org.junit.Assert"
] | import java.util.List; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,183,246 |
public static String emailPassword(HttpServletRequest request, HttpServletResponse response) {
String defaultScreenLocation = "component://securityext/widget/EmailSecurityScreens.xml#PasswordEmail";
Delegator delegator = (Delegator) request.getAttribute("delegator");
LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
String productStoreId = ProductStoreWorker.getProductStoreId(request);
String errMsg = null;
boolean useEncryption = "true".equals(UtilProperties.getPropertyValue("security.properties", "password.encrypt"));
String userLoginId = request.getParameter("USERNAME");
if ((userLoginId != null) && ("true".equals(UtilProperties.getPropertyValue("security.properties", "username.lowercase")))) {
userLoginId = userLoginId.toLowerCase();
}
if (!UtilValidate.isNotEmpty(userLoginId)) {
// the password was incomplete
errMsg = UtilProperties.getMessage(resource, "loginevents.username_was_empty_reenter", UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
GenericValue supposedUserLogin = null;
String passwordToSend = null;
try {
supposedUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
if (supposedUserLogin == null) {
// the Username was not found
errMsg = UtilProperties.getMessage(resource, "loginevents.username_not_found_reenter", UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
if (useEncryption) {
// password encrypted, can't send, generate new password and email to user
passwordToSend = RandomStringUtils.randomAlphanumeric(Integer.parseInt(UtilProperties.getPropertyValue("security", "password.length.min", "5")));
if ("true".equals(UtilProperties.getPropertyValue("security.properties", "password.lowercase"))){
passwordToSend=passwordToSend.toLowerCase();
}
supposedUserLogin.set("currentPassword", HashCrypt.cryptUTF8(LoginServices.getHashType(), null, passwordToSend));
supposedUserLogin.set("passwordHint", "Auto-Generated Password");
if ("true".equals(UtilProperties.getPropertyValue("security.properties", "password.email_password.require_password_change"))){
supposedUserLogin.set("requirePasswordChange", "Y");
}
} else {
passwordToSend = supposedUserLogin.getString("currentPassword");
}
} catch (GenericEntityException e) {
Debug.logWarning(e, "", module);
Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
errMsg = UtilProperties.getMessage(resource, "loginevents.error_accessing_password", messageMap, UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
StringBuilder emails = new StringBuilder();
GenericValue party = null;
try {
party = supposedUserLogin.getRelatedOne("Party", false);
} catch (GenericEntityException e) {
Debug.logWarning(e, "", module);
party = null;
}
if (party != null) {
Iterator<GenericValue> emailIter = UtilMisc.toIterator(ContactHelper.getContactMechByPurpose(party, "PRIMARY_EMAIL", false));
while (emailIter != null && emailIter.hasNext()) {
GenericValue email = emailIter.next();
emails.append(emails.length() > 0 ? "," : "").append(email.getString("infoString"));
}
}
if (!UtilValidate.isNotEmpty(emails.toString())) {
// the Username was not found
errMsg = UtilProperties.getMessage(resource, "loginevents.no_primary_email_address_set_contact_customer_service", UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
// get the ProductStore email settings
GenericValue productStoreEmail = null;
try {
productStoreEmail = delegator.findOne("ProductStoreEmailSetting", false, "productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE");
} catch (GenericEntityException e) {
Debug.logError(e, "Problem getting ProductStoreEmailSetting", module);
}
String bodyScreenLocation = null;
if (productStoreEmail != null) {
bodyScreenLocation = productStoreEmail.getString("bodyScreenLocation");
}
if (UtilValidate.isEmpty(bodyScreenLocation)) {
bodyScreenLocation = defaultScreenLocation;
}
// set the needed variables in new context
Map<String, Object> bodyParameters = FastMap.newInstance();
bodyParameters.put("useEncryption", Boolean.valueOf(useEncryption));
bodyParameters.put("password", UtilFormatOut.checkNull(passwordToSend));
bodyParameters.put("locale", UtilHttp.getLocale(request));
bodyParameters.put("userLogin", supposedUserLogin);
bodyParameters.put("productStoreId", productStoreId);
Map<String, Object> serviceContext = FastMap.newInstance();
serviceContext.put("bodyScreenUri", bodyScreenLocation);
serviceContext.put("bodyParameters", bodyParameters);
if (productStoreEmail != null) {
serviceContext.put("subject", productStoreEmail.getString("subject"));
serviceContext.put("sendFrom", productStoreEmail.get("fromAddress"));
serviceContext.put("sendCc", productStoreEmail.get("ccAddress"));
serviceContext.put("sendBcc", productStoreEmail.get("bccAddress"));
serviceContext.put("contentType", productStoreEmail.get("contentType"));
} else {
GenericValue emailTemplateSetting = null;
try {
emailTemplateSetting = delegator.findOne("EmailTemplateSetting", true, "emailTemplateSettingId", "EMAIL_PASSWORD");
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
if (emailTemplateSetting != null) {
String subject = emailTemplateSetting.getString("subject");
subject = FlexibleStringExpander.expandString(subject, UtilMisc.toMap("userLoginId", userLoginId));
serviceContext.put("subject", subject);
serviceContext.put("sendFrom", emailTemplateSetting.get("fromAddress"));
} else {
serviceContext.put("subject", UtilProperties.getMessage(resource, "loginservices.password_reminder_subject", UtilMisc.toMap("userLoginId", userLoginId), UtilHttp.getLocale(request)));
serviceContext.put("sendFrom", EntityUtilProperties.getPropertyValue("general.properties", "defaultFromEmailAddress", delegator));
}
}
serviceContext.put("sendTo", emails.toString());
serviceContext.put("partyId", party.getString("partyId"));
try {
Map<String, Object> result = dispatcher.runSync("sendMailHiddenInLogFromScreen", serviceContext);
if (ModelService.RESPOND_ERROR.equals(result.get(ModelService.RESPONSE_MESSAGE))) {
Map<String, Object> messageMap = UtilMisc.toMap("errorMessage", result.get(ModelService.ERROR_MESSAGE));
errMsg = UtilProperties.getMessage(resource, "loginevents.error_unable_email_password_contact_customer_service_errorwas", messageMap, UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
} catch (GenericServiceException e) {
Debug.logWarning(e, "", module);
errMsg = UtilProperties.getMessage(resource, "loginevents.error_unable_email_password_contact_customer_service", UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
// don't save password until after it has been sent
if (useEncryption) {
try {
supposedUserLogin.store();
} catch (GenericEntityException e) {
Debug.logWarning(e, "", module);
Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
errMsg = UtilProperties.getMessage(resource, "loginevents.error_saving_new_password_email_not_correct_password", messageMap, UtilHttp.getLocale(request));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
}
if (useEncryption) {
errMsg = UtilProperties.getMessage(resource, "loginevents.new_password_createdandsent_check_email", UtilHttp.getLocale(request));
request.setAttribute("_EVENT_MESSAGE_", errMsg);
} else {
errMsg = UtilProperties.getMessage(resource, "loginevents.new_password_sent_check_email", UtilHttp.getLocale(request));
request.setAttribute("_EVENT_MESSAGE_", errMsg);
}
return "success";
} | static String function(HttpServletRequest request, HttpServletResponse response) { String defaultScreenLocation = STRdelegatorSTRdispatcherSTRtrueSTRsecurity.propertiesSTRpassword.encryptSTRUSERNAMESTRtrueSTRsecurity.propertiesSTRusername.lowercaseSTRloginevents.username_was_empty_reenterSTR_ERROR_MESSAGE_STRerrorSTRUserLoginSTRuserLoginIdSTRloginevents.username_not_found_reenterSTR_ERROR_MESSAGE_STRerrorSTRsecuritySTRpassword.length.minSTR5STRtrueSTRsecurity.propertiesSTRpassword.lowercaseSTRcurrentPasswordSTRpasswordHintSTRAuto-Generated PasswordSTRtrueSTRsecurity.propertiesSTRpassword.email_password.require_password_changeSTRrequirePasswordChangeSTRYSTRcurrentPasswordSTRSTRerrorMessageSTRloginevents.error_accessing_passwordSTR_ERROR_MESSAGE_STRerrorSTRPartySTRSTRPRIMARY_EMAILSTR,STRSTRinfoStringSTRloginevents.no_primary_email_address_set_contact_customer_serviceSTR_ERROR_MESSAGE_STRerrorSTRProductStoreEmailSettingSTRproductStoreIdSTRemailTypeSTRPRDS_PWD_RETRIEVESTRProblem getting ProductStoreEmailSettingSTRbodyScreenLocationSTRuseEncryptionSTRpasswordSTRlocaleSTRuserLoginSTRproductStoreIdSTRbodyScreenUriSTRbodyParametersSTRsubjectSTRsubjectSTRsendFromSTRfromAddressSTRsendCcSTRccAddressSTRsendBccSTRbccAddressSTRcontentTypeSTRcontentTypeSTREmailTemplateSettingSTRemailTemplateSettingIdSTREMAIL_PASSWORDSTRsubjectSTRuserLoginIdSTRsubjectSTRsendFromSTRfromAddressSTRsubjectSTRloginservices.password_reminder_subjectSTRuserLoginIdSTRsendFromSTRgeneral.propertiesSTRdefaultFromEmailAddressSTRsendToSTRpartyIdSTRpartyIdSTRsendMailHiddenInLogFromScreenSTRerrorMessageSTRloginevents.error_unable_email_password_contact_customer_service_errorwasSTR_ERROR_MESSAGE_STRerrorSTRSTRloginevents.error_unable_email_password_contact_customer_serviceSTR_ERROR_MESSAGE_STRerrorSTRSTRerrorMessageSTRloginevents.error_saving_new_password_email_not_correct_passwordSTR_ERROR_MESSAGE_STRerrorSTRloginevents.new_password_createdandsent_check_emailSTR_EVENT_MESSAGE_STRloginevents.new_password_sent_check_emailSTR_EVENT_MESSAGE_STRsuccess"; } | /**
* Email the password for the userLoginId specified in the request object.
*
* @param request The HTTPRequest object for the current request
* @param response The HTTPResponse object for the current request
* @return String specifying the exit status of this event
*/ | Email the password for the userLoginId specified in the request object | emailPassword | {
"repo_name": "gildaslemoal/elpi",
"path": "applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java",
"license": "gpl-2.0",
"size": 20128
} | [
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] | import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.*; | [
"javax.servlet"
] | javax.servlet; | 1,327,811 |
public void save(RepositoryElementInterface repositoryElement, String versionComment, ProgressMonitorListener monitor, boolean overwrite) throws KettleException; | void function(RepositoryElementInterface repositoryElement, String versionComment, ProgressMonitorListener monitor, boolean overwrite) throws KettleException; | /**
* Save an object to the repository optionally overwriting any associated objects.
* @param repositoryElement Object to save
* @param versionComment Version comment for update
* @param monitor Progress Monitor to report feedback to
* @param overwrite Overwrite any existing objects involved in saving {@code repositoryElement}, e.g. repositoryElement, database connections, slave servers
* @throws KettleException Error saving the object to the repository
*/ | Save an object to the repository optionally overwriting any associated objects | save | {
"repo_name": "juanmjacobs/kettle",
"path": "src/org/pentaho/di/repository/Repository.java",
"license": "lgpl-2.1",
"size": 25729
} | [
"org.pentaho.di.core.ProgressMonitorListener",
"org.pentaho.di.core.exception.KettleException"
] | import org.pentaho.di.core.ProgressMonitorListener; import org.pentaho.di.core.exception.KettleException; | import org.pentaho.di.core.*; import org.pentaho.di.core.exception.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 2,220,102 |
protected boolean keepFirst(ImmutableBytesWritable ibw1, ImmutableBytesWritable ibw2) {
return 0 >= getDataType().compareTo(ibw1, columnModifier, ibw2, columnModifier, getDataType());
} | boolean function(ImmutableBytesWritable ibw1, ImmutableBytesWritable ibw2) { return 0 >= getDataType().compareTo(ibw1, columnModifier, ibw2, columnModifier, getDataType()); } | /**
* Compares two bytes writables, and returns true if the first one should be
* kept, and false otherwise. For the MIN function, this method will return
* true if the first bytes writable is less than the second.
*
* @param ibw1 the first bytes writable
* @param ibw2 the second bytes writable
* @return true if the first bytes writable should be kept
*/ | Compares two bytes writables, and returns true if the first one should be kept, and false otherwise. For the MIN function, this method will return true if the first bytes writable is less than the second | keepFirst | {
"repo_name": "forcedotcom/phoenix",
"path": "phoenix-core/src/main/java/com/salesforce/phoenix/expression/aggregator/MinAggregator.java",
"license": "bsd-3-clause",
"size": 4316
} | [
"org.apache.hadoop.hbase.io.ImmutableBytesWritable"
] | import org.apache.hadoop.hbase.io.ImmutableBytesWritable; | import org.apache.hadoop.hbase.io.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,656,292 |
@Test
public void testMakeCoffee_3()
throws Exception {
CoffeeMaker fixture = new CoffeeMaker();
Recipe r = new Recipe();
r.setPrice(1);
int amtPaid = 1;
int result = fixture.makeCoffee(r, amtPaid);
// add additional test code here
assertEquals(0, result);
}
| void function() throws Exception { CoffeeMaker fixture = new CoffeeMaker(); Recipe r = new Recipe(); r.setPrice(1); int amtPaid = 1; int result = fixture.makeCoffee(r, amtPaid); assertEquals(0, result); } | /**
* Run the int makeCoffee(Recipe,int) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 4/27/16 6:34 PM
*/ | Run the int makeCoffee(Recipe,int) method test | testMakeCoffee_3 | {
"repo_name": "Nahom30/cosc603-Negash-project5",
"path": "CoffeeMaker/src/edu/towson/cis/cosc603/project5/coffeemaker/CoffeeMakerTest.java",
"license": "gpl-3.0",
"size": 15836
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,682,202 |
public IgniteStripedThreadPoolExecutor asyncCallbackPool(); | IgniteStripedThreadPoolExecutor function(); | /**
* Gets async callback pool.
*
* @return Async callback pool.
*/ | Gets async callback pool | asyncCallbackPool | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java",
"license": "apache-2.0",
"size": 20940
} | [
"org.apache.ignite.thread.IgniteStripedThreadPoolExecutor"
] | import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor; | import org.apache.ignite.thread.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,045,636 |
public void
removeIIOReadProgressListener (IIOReadProgressListener listener) {
if (listener == null || progressListeners == null) {
return;
}
progressListeners = removeFromList(progressListeners, listener);
} | void function (IIOReadProgressListener listener) { if (listener == null progressListeners == null) { return; } progressListeners = removeFromList(progressListeners, listener); } | /**
* Removes an <code>IIOReadProgressListener</code> from the list
* of registered progress listeners. If the listener was not
* previously registered, or if <code>listener</code> is
* <code>null</code>, no exception will be thrown and no action
* will be taken.
*
* @param listener an IIOReadProgressListener to be unregistered.
*
* @see #addIIOReadProgressListener
*/ | Removes an <code>IIOReadProgressListener</code> from the list of registered progress listeners. If the listener was not previously registered, or if <code>listener</code> is <code>null</code>, no exception will be thrown and no action will be taken | removeIIOReadProgressListener | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/javax/imageio/ImageReader.java",
"license": "apache-2.0",
"size": 118398
} | [
"javax.imageio.event.IIOReadProgressListener"
] | import javax.imageio.event.IIOReadProgressListener; | import javax.imageio.event.*; | [
"javax.imageio"
] | javax.imageio; | 2,570,824 |
public void updateUserInfo(final String firstName, final String lastName) {
final String url = HttpConstants.getApiBaseUrl()
+ ApiEndpoints.UPDATE_USER_INFO;
final JSONObject mUserProfileObject = new JSONObject();
final JSONObject mUserProfileMasterObject = new JSONObject();
try {
mUserProfileObject.put(HttpConstants.FIRST_NAME, firstName);
mUserProfileObject.put(HttpConstants.LAST_NAME, lastName);
mUserProfileMasterObject
.put(HttpConstants.USER, mUserProfileObject);
final BlMultiPartRequest updateUserProfileRequest = new BlMultiPartRequest(Method.PUT,
url, null,
mVolleyCallbacks);
updateUserProfileRequest
.addMultipartParam(HttpConstants.USER, "application/json",
mUserProfileMasterObject
.toString()
);
updateUserProfileRequest.setRequestId(RequestId.SAVE_USER_PROFILE);
addRequestToQueue(updateUserProfileRequest, true, 0, true);
} catch (final JSONException e) {
e.printStackTrace();
}
} | void function(final String firstName, final String lastName) { final String url = HttpConstants.getApiBaseUrl() + ApiEndpoints.UPDATE_USER_INFO; final JSONObject mUserProfileObject = new JSONObject(); final JSONObject mUserProfileMasterObject = new JSONObject(); try { mUserProfileObject.put(HttpConstants.FIRST_NAME, firstName); mUserProfileObject.put(HttpConstants.LAST_NAME, lastName); mUserProfileMasterObject .put(HttpConstants.USER, mUserProfileObject); final BlMultiPartRequest updateUserProfileRequest = new BlMultiPartRequest(Method.PUT, url, null, mVolleyCallbacks); updateUserProfileRequest .addMultipartParam(HttpConstants.USER, STR, mUserProfileMasterObject .toString() ); updateUserProfileRequest.setRequestId(RequestId.SAVE_USER_PROFILE); addRequestToQueue(updateUserProfileRequest, true, 0, true); } catch (final JSONException e) { e.printStackTrace(); } } | /**
* Updates the user info with just the first name and last name
*
* @param firstName The user's first name
* @param lastName The user's last name
*/ | Updates the user info with just the first name and last name | updateUserInfo | {
"repo_name": "barterli/barterli_android",
"path": "barterli/src/main/java/li/barter/fragments/AbstractBarterLiFragment.java",
"license": "apache-2.0",
"size": 19501
} | [
"com.android.volley.Request",
"li.barter.http.BlMultiPartRequest",
"li.barter.http.HttpConstants",
"org.json.JSONException",
"org.json.JSONObject"
] | import com.android.volley.Request; import li.barter.http.BlMultiPartRequest; import li.barter.http.HttpConstants; import org.json.JSONException; import org.json.JSONObject; | import com.android.volley.*; import li.barter.http.*; import org.json.*; | [
"com.android.volley",
"li.barter.http",
"org.json"
] | com.android.volley; li.barter.http; org.json; | 1,253,606 |
@Test
public void iterateTemplateNames() throws Exception {
final MkContainer container = new MkGrizzlyContainer().next(
new MkAnswer.Simple(
HttpURLConnection.HTTP_OK,
Json.createArrayBuilder()
.add("C")
.add("Java")
.build()
.toString()
)
).start();
final RtGitignores gitignores = new RtGitignores(
new RtGithub(new JdkRequest(container.home()))
);
MatcherAssert.assertThat(
gitignores.iterate(),
Matchers.<String>iterableWithSize(2)
);
container.stop();
} | void function() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add("C") .add("Java") .build() .toString() ) ).start(); final RtGitignores gitignores = new RtGitignores( new RtGithub(new JdkRequest(container.home())) ); MatcherAssert.assertThat( gitignores.iterate(), Matchers.<String>iterableWithSize(2) ); container.stop(); } | /**
* RtGitignores can iterate template names.
* @throws Exception if there is any error
*/ | RtGitignores can iterate template names | iterateTemplateNames | {
"repo_name": "prondzyn/jcabi-github",
"path": "src/test/java/com/jcabi/github/RtGitignoresTest.java",
"license": "bsd-3-clause",
"size": 3488
} | [
"com.jcabi.http.mock.MkAnswer",
"com.jcabi.http.mock.MkContainer",
"com.jcabi.http.mock.MkGrizzlyContainer",
"com.jcabi.http.request.JdkRequest",
"java.net.HttpURLConnection",
"javax.json.Json",
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers"
] | import com.jcabi.http.mock.MkAnswer; import com.jcabi.http.mock.MkContainer; import com.jcabi.http.mock.MkGrizzlyContainer; import com.jcabi.http.request.JdkRequest; import java.net.HttpURLConnection; import javax.json.Json; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; | import com.jcabi.http.mock.*; import com.jcabi.http.request.*; import java.net.*; import javax.json.*; import org.hamcrest.*; | [
"com.jcabi.http",
"java.net",
"javax.json",
"org.hamcrest"
] | com.jcabi.http; java.net; javax.json; org.hamcrest; | 1,955,476 |
public void addCounterSuperColumn(CounterSuperColumn superColumn)
{
this.counterSuperColumns.add(superColumn);
} | void function(CounterSuperColumn superColumn) { this.counterSuperColumns.add(superColumn); } | /**
* Adds the counter super column.
*
* @param superColumn the super column
*/ | Adds the counter super column | addCounterSuperColumn | {
"repo_name": "ravisund/Kundera",
"path": "src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/ThriftRow.java",
"license": "apache-2.0",
"size": 6194
} | [
"org.apache.cassandra.thrift.CounterSuperColumn"
] | import org.apache.cassandra.thrift.CounterSuperColumn; | import org.apache.cassandra.thrift.*; | [
"org.apache.cassandra"
] | org.apache.cassandra; | 2,472,078 |
@SuppressWarnings({"PackageVisibleInnerClass", "PublicInnerClass"})
public static interface IndexesFactory {
ArrayList<Index> createIndexes(GridH2Table tbl);
}
@SuppressWarnings("PackageVisibleInnerClass")
static class ScanIndex implements Index {
static final String SCAN_INDEX_NAME_SUFFIX = "__SCAN_";
private static final IndexType TYPE = IndexType.createScan(false);
private final GridH2IndexBase delegate;
private ScanIndex(GridH2IndexBase delegate) {
this.delegate = delegate;
} | @SuppressWarnings({STR, STR}) static interface IndexesFactory { ArrayList<Index> function(GridH2Table tbl); } @SuppressWarnings(STR) static class ScanIndex implements Index { static final String SCAN_INDEX_NAME_SUFFIX = STR; private static final IndexType TYPE = IndexType.createScan(false); private final GridH2IndexBase delegate; private ScanIndex(GridH2IndexBase delegate) { this.delegate = delegate; } | /**
* Create list of indexes. First must be primary key, after that all unique indexes and
* only then non-unique indexes.
* All indexes must be subtypes of {@link GridH2TreeIndex}.
*
* @param tbl Table to create indexes for.
* @return List of indexes.
*/ | Create list of indexes. First must be primary key, after that all unique indexes and only then non-unique indexes. All indexes must be subtypes of <code>GridH2TreeIndex</code> | createIndexes | {
"repo_name": "agura/incubator-ignite",
"path": "modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java",
"license": "apache-2.0",
"size": 28243
} | [
"java.util.ArrayList",
"org.h2.index.Index",
"org.h2.index.IndexType"
] | import java.util.ArrayList; import org.h2.index.Index; import org.h2.index.IndexType; | import java.util.*; import org.h2.index.*; | [
"java.util",
"org.h2.index"
] | java.util; org.h2.index; | 728,611 |
public Metadata getMetadata(); | Metadata function(); | /**
* The iPhoto metadata for the image.
*
* @return The iPhoto metadata for the image.
*/ | The iPhoto metadata for the image | getMetadata | {
"repo_name": "rometools/rome",
"path": "rome-modules/src/main/java/com/rometools/modules/photocast/PhotocastModule.java",
"license": "apache-2.0",
"size": 2760
} | [
"com.rometools.modules.photocast.types.Metadata"
] | import com.rometools.modules.photocast.types.Metadata; | import com.rometools.modules.photocast.types.*; | [
"com.rometools.modules"
] | com.rometools.modules; | 810,420 |
public interface EaseUserProfileProvider {
EaseUser getUser(String username);
} | interface EaseUserProfileProvider { EaseUser function(String username); } | /**
* return EaseUser for input username
* @param username
* @return
*/ | return EaseUser for input username | getUser | {
"repo_name": "simonOrganization/safe",
"path": "easeui/src/com/hyphenate/easeui/controller/EaseUI.java",
"license": "apache-2.0",
"size": 9391
} | [
"com.hyphenate.easeui.domain.EaseUser"
] | import com.hyphenate.easeui.domain.EaseUser; | import com.hyphenate.easeui.domain.*; | [
"com.hyphenate.easeui"
] | com.hyphenate.easeui; | 2,088,671 |
private TQueryExecRequest createExecRequest(
Planner planner, StringBuilder explainString) throws ImpalaException {
TQueryCtx queryCtx = planner.getQueryCtx();
AnalysisContext.AnalysisResult analysisResult = planner.getAnalysisResult();
boolean isMtExec = analysisResult.isQueryStmt() &&
queryCtx.request.query_options.isSetMt_dop() &&
queryCtx.request.query_options.mt_dop > 0;
List<PlanFragment> planRoots = Lists.newArrayList();
TQueryExecRequest result = new TQueryExecRequest();
if (isMtExec) {
LOG.trace("create mt plan");
planRoots.addAll(planner.createParallelPlans());
} else {
LOG.trace("create plan");
planRoots.add(planner.createPlan().get(0));
}
// create per-plan exec info;
// also assemble list of names of tables with missing or corrupt stats for
// assembling a warning message
for (PlanFragment planRoot: planRoots) {
result.addToPlan_exec_info(
createPlanExecInfo(planRoot, planner, queryCtx, result));
}
// Optionally disable spilling in the backend. Allow spilling if there are plan hints
// or if all tables have stats.
boolean disableSpilling =
queryCtx.request.query_options.isDisable_unsafe_spills()
&& !queryCtx.tables_missing_stats.isEmpty()
&& !analysisResult.getAnalyzer().hasPlanHints();
// for now, always disable spilling for multi-threaded execution
if (isMtExec || disableSpilling) queryCtx.setDisable_spilling(true);
// assign fragment idx
int idx = 0;
for (TPlanExecInfo planExecInfo: result.plan_exec_info) {
for (TPlanFragment fragment: planExecInfo.fragments) fragment.setIdx(idx++);
}
// create EXPLAIN output after setting everything else
result.setQuery_ctx(queryCtx); // needed by getExplainString()
ArrayList<PlanFragment> allFragments = planRoots.get(0).getNodesPreOrder();
explainString.append(planner.getExplainString(allFragments, result));
result.setQuery_plan(explainString.toString());
return result;
} | TQueryExecRequest function( Planner planner, StringBuilder explainString) throws ImpalaException { TQueryCtx queryCtx = planner.getQueryCtx(); AnalysisContext.AnalysisResult analysisResult = planner.getAnalysisResult(); boolean isMtExec = analysisResult.isQueryStmt() && queryCtx.request.query_options.isSetMt_dop() && queryCtx.request.query_options.mt_dop > 0; List<PlanFragment> planRoots = Lists.newArrayList(); TQueryExecRequest result = new TQueryExecRequest(); if (isMtExec) { LOG.trace(STR); planRoots.addAll(planner.createParallelPlans()); } else { LOG.trace(STR); planRoots.add(planner.createPlan().get(0)); } for (PlanFragment planRoot: planRoots) { result.addToPlan_exec_info( createPlanExecInfo(planRoot, planner, queryCtx, result)); } boolean disableSpilling = queryCtx.request.query_options.isDisable_unsafe_spills() && !queryCtx.tables_missing_stats.isEmpty() && !analysisResult.getAnalyzer().hasPlanHints(); if (isMtExec disableSpilling) queryCtx.setDisable_spilling(true); int idx = 0; for (TPlanExecInfo planExecInfo: result.plan_exec_info) { for (TPlanFragment fragment: planExecInfo.fragments) fragment.setIdx(idx++); } result.setQuery_ctx(queryCtx); ArrayList<PlanFragment> allFragments = planRoots.get(0).getNodesPreOrder(); explainString.append(planner.getExplainString(allFragments, result)); result.setQuery_plan(explainString.toString()); return result; } | /**
* Create a populated TQueryExecRequest, corresponding to the supplied planner.
*/ | Create a populated TQueryExecRequest, corresponding to the supplied planner | createExecRequest | {
"repo_name": "924060929/impala-frontend",
"path": "fe/src/main/java/org/apache/impala/service/Frontend.java",
"license": "apache-2.0",
"size": 55472
} | [
"com.google.common.collect.Lists",
"java.util.ArrayList",
"java.util.List",
"org.apache.impala.analysis.AnalysisContext",
"org.apache.impala.common.ImpalaException",
"org.apache.impala.planner.PlanFragment",
"org.apache.impala.planner.Planner",
"org.apache.impala.thrift.TPlanExecInfo",
"org.apache.impala.thrift.TPlanFragment",
"org.apache.impala.thrift.TQueryCtx",
"org.apache.impala.thrift.TQueryExecRequest"
] | import com.google.common.collect.Lists; import java.util.ArrayList; import java.util.List; import org.apache.impala.analysis.AnalysisContext; import org.apache.impala.common.ImpalaException; import org.apache.impala.planner.PlanFragment; import org.apache.impala.planner.Planner; import org.apache.impala.thrift.TPlanExecInfo; import org.apache.impala.thrift.TPlanFragment; import org.apache.impala.thrift.TQueryCtx; import org.apache.impala.thrift.TQueryExecRequest; | import com.google.common.collect.*; import java.util.*; import org.apache.impala.analysis.*; import org.apache.impala.common.*; import org.apache.impala.planner.*; import org.apache.impala.thrift.*; | [
"com.google.common",
"java.util",
"org.apache.impala"
] | com.google.common; java.util; org.apache.impala; | 1,457,201 |
public List getCollectionDescriptors(boolean withInherited)
{
if(withInherited && getSuperClassDescriptor() != null)
{
List result = new ArrayList(m_CollectionDescriptors);
result.addAll(getSuperClassDescriptor().getCollectionDescriptors(true));
return result;
}
else
{
return m_CollectionDescriptors;
}
}
| List function(boolean withInherited) { if(withInherited && getSuperClassDescriptor() != null) { List result = new ArrayList(m_CollectionDescriptors); result.addAll(getSuperClassDescriptor().getCollectionDescriptors(true)); return result; } else { return m_CollectionDescriptors; } } | /**
* Returns all defined {@link CollectionDescriptor} for
* this class descriptor.
*
* @param withInherited If <em>true</em> inherited super class references will be included.
*/ | Returns all defined <code>CollectionDescriptor</code> for this class descriptor | getCollectionDescriptors | {
"repo_name": "kuali/ojb-1.0.4",
"path": "src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java",
"license": "apache-2.0",
"size": 73402
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 801,894 |
@Produce
public UserForgotPasswordSuccessEvent produceUserForgotPasswordSuccessEvent() {
return new UserForgotPasswordSuccessEvent();
}
| UserForgotPasswordSuccessEvent function() { return new UserForgotPasswordSuccessEvent(); } | /**
* Creates an event for successful Forgot Password request
*
* @param user
* User currently signed in
* @return
*/ | Creates an event for successful Forgot Password request | produceUserForgotPasswordSuccessEvent | {
"repo_name": "rdrobinson3/LoginAndSignupTutorial",
"path": "src/com/keyconsultant/parse/logintutorial/model/user/UserManager.java",
"license": "apache-2.0",
"size": 5074
} | [
"com.keyconsultant.parse.logintutorial.model.user.authenticate.UserForgotPasswordSuccessEvent"
] | import com.keyconsultant.parse.logintutorial.model.user.authenticate.UserForgotPasswordSuccessEvent; | import com.keyconsultant.parse.logintutorial.model.user.authenticate.*; | [
"com.keyconsultant.parse"
] | com.keyconsultant.parse; | 2,174,836 |
public void updatePrototypes() throws IOException, ScriptingException; | void function() throws IOException, ScriptingException; | /**
* This method is called before an execution context for a request
* evaluation is entered to let the Engine know it should update
* its prototype information
*/ | This method is called before an execution context for a request evaluation is entered to let the Engine know it should update its prototype information | updatePrototypes | {
"repo_name": "axiomsoftware/axiom-stack",
"path": "src/java/axiom/scripting/ScriptingEngine.java",
"license": "agpl-3.0",
"size": 4904
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,171,574 |
@Override
public void addLayoutComponent(String name, Component comp) {
} | void function(String name, Component comp) { } | /**
* Not used by this class.
*/ | Not used by this class | addLayoutComponent | {
"repo_name": "benbenw/jmeter",
"path": "src/jorphan/src/main/java/org/apache/jorphan/gui/layout/VerticalLayout.java",
"license": "apache-2.0",
"size": 8024
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,728,726 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.