method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public static List<CompletionResult> getFactoryCompletions(String surl1, int carotPos, ProgressMonitor mon) throws Exception {
CompletionContext cc = new CompletionContext();
URISplit split = URISplit.parse(surl1);
if ( carotPos==0 && surl1.trim().length()>0 ) {
return Co... | static List<CompletionResult> function(String surl1, int carotPos, ProgressMonitor mon) throws Exception { CompletionContext cc = new CompletionContext(); URISplit split = URISplit.parse(surl1); if ( carotPos==0 && surl1.trim().length()>0 ) { return Collections.singletonList( new CompletionResult(STR, STR, STR:STR:STR&... | /**
* get the completions from the plug-in factory..
* @param surl1
* @param carotPos
* @param mon
* @return
* @throws Exception
*/ | get the completions from the plug-in factory. | getFactoryCompletions | {
"repo_name": "autoplot/app",
"path": "DataSource/src/org/autoplot/datasource/DataSetURI.java",
"license": "gpl-2.0",
"size": 105000
} | [
"java.util.Collections",
"java.util.List",
"org.das2.util.monitor.ProgressMonitor"
] | import java.util.Collections; import java.util.List; import org.das2.util.monitor.ProgressMonitor; | import java.util.*; import org.das2.util.monitor.*; | [
"java.util",
"org.das2.util"
] | java.util; org.das2.util; | 2,833,788 |
@SuppressWarnings("unused")
public void deleteDocument(String documentId) throws FileNotFoundException {
throw new UnsupportedOperationException("Delete not supported");
} | @SuppressWarnings(STR) void function(String documentId) throws FileNotFoundException { throw new UnsupportedOperationException(STR); } | /**
* Delete the requested document.
* <p>
* Upon returning, any URI permission grants for the given document will be
* revoked. If additional documents were deleted as a side effect of this
* call (such as documents inside a directory) the implementor is
* responsible for revoking those p... | Delete the requested document. Upon returning, any URI permission grants for the given document will be revoked. If additional documents were deleted as a side effect of this call (such as documents inside a directory) the implementor is responsible for revoking those permissions using <code>#revokeDocumentPermission(S... | deleteDocument | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/provider/DocumentsProvider.java",
"license": "gpl-3.0",
"size": 34375
} | [
"java.io.FileNotFoundException"
] | import java.io.FileNotFoundException; | import java.io.*; | [
"java.io"
] | java.io; | 708,086 |
public static ims.core.resource.place.domain.objects.OrganisationPCTLinkConfig extractOrganisationPCTLinkConfig(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.OrganisationPCTLinkConfigVo valueObject)
{
return extractOrganisationPCTLinkConfig(domainFactory, valueObject, new HashMap());
}
| static ims.core.resource.place.domain.objects.OrganisationPCTLinkConfig function(ims.domain.ILightweightDomainFactory domainFactory, ims.admin.vo.OrganisationPCTLinkConfigVo valueObject) { return extractOrganisationPCTLinkConfig(domainFactory, valueObject, new HashMap()); } | /**
* Create the domain object from the value object.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param valueObject - extract the domain object fields from this.
*/ | Create the domain object from the value object | extractOrganisationPCTLinkConfig | {
"repo_name": "IMS-MAXIMS/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/admin/vo/domain/OrganisationPCTLinkConfigVoAssembler.java",
"license": "agpl-3.0",
"size": 18349
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,872,698 |
boolean parseLocal(String localFile, String docName, boolean replace, String mimeType)
throws EXistException, PermissionDeniedException, SAXException, URISyntaxException; | boolean parseLocal(String localFile, String docName, boolean replace, String mimeType) throws EXistException, PermissionDeniedException, SAXException, URISyntaxException; | /**
* Parse a file previously uploaded with upload.
*
* The temporary file will be removed.
*
* @param localFile
* @param docName
* @param replace
* @param mimeType
* @return
* @throws EXistException
* @throws org.exist.security.PermissionDeniedException
* @t... | Parse a file previously uploaded with upload. The temporary file will be removed | parseLocal | {
"repo_name": "RemiKoutcherawy/exist",
"path": "exist-core/src/main/java/org/exist/xmlrpc/RpcAPI.java",
"license": "lgpl-2.1",
"size": 39647
} | [
"java.net.URISyntaxException",
"org.exist.EXistException",
"org.exist.security.PermissionDeniedException",
"org.xml.sax.SAXException"
] | import java.net.URISyntaxException; import org.exist.EXistException; import org.exist.security.PermissionDeniedException; import org.xml.sax.SAXException; | import java.net.*; import org.exist.*; import org.exist.security.*; import org.xml.sax.*; | [
"java.net",
"org.exist",
"org.exist.security",
"org.xml.sax"
] | java.net; org.exist; org.exist.security; org.xml.sax; | 1,627,063 |
@Override
public Object compile(final String script, final Map<String, String> params) {
final CompilerSettings compilerSettings;
if (params.isEmpty()) {
// Use the default settings.
compilerSettings = DEFAULT_COMPILER_SETTINGS;
} else {
// Use custom... | Object function(final String script, final Map<String, String> params) { final CompilerSettings compilerSettings; if (params.isEmpty()) { compilerSettings = DEFAULT_COMPILER_SETTINGS; } else { compilerSettings = new CompilerSettings(); Map<String, String> copy = new HashMap<>(params); String value = copy.remove(Compile... | /**
* Compiles a Plan A script with the specified parameters.
* @param script The code to be compiled.
* @param params The params used to modify the compiler settings on a per script basis.
* @return Compiled script object represented by an {@link Executable}.
*/ | Compiles a Plan A script with the specified parameters | compile | {
"repo_name": "davidvgalbraith/elasticsearch",
"path": "plugins/lang-plan-a/src/main/java/org/elasticsearch/plan/a/PlanAScriptEngineService.java",
"license": "apache-2.0",
"size": 8112
} | [
"java.util.HashMap",
"java.util.Map",
"org.elasticsearch.SpecialPermission"
] | import java.util.HashMap; import java.util.Map; import org.elasticsearch.SpecialPermission; | import java.util.*; import org.elasticsearch.*; | [
"java.util",
"org.elasticsearch"
] | java.util; org.elasticsearch; | 1,843,267 |
@SuppressWarnings("rawtypes")
public synchronized void addAffixGroupUpdateConsumer(List<Setting.AffixSetting<?>> settings, BiConsumer<String, Settings> consumer) {
List<SettingUpdater> affixUpdaters = new ArrayList<>(settings.size());
for (Setting.AffixSetting<?> setting : settings) {
... | @SuppressWarnings(STR) synchronized void function(List<Setting.AffixSetting<?>> settings, BiConsumer<String, Settings> consumer) { List<SettingUpdater> affixUpdaters = new ArrayList<>(settings.size()); for (Setting.AffixSetting<?> setting : settings) { ensureSettingIsRegistered(setting); affixUpdaters.add(setting.newAf... | /**
* Adds a affix settings consumer that accepts the settings for a group of settings. The consumer is only
* notified if at least one of the settings change.
* <p>
* Note: Only settings registered in {@link SettingsModule} can be changed dynamically.
* </p>
*/ | Adds a affix settings consumer that accepts the settings for a group of settings. The consumer is only notified if at least one of the settings change. Note: Only settings registered in <code>SettingsModule</code> can be changed dynamically. | addAffixGroupUpdateConsumer | {
"repo_name": "jmluy/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/common/settings/AbstractScopedSettings.java",
"license": "apache-2.0",
"size": 47024
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"java.util.function.BiConsumer"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.BiConsumer; | import java.util.*; import java.util.function.*; | [
"java.util"
] | java.util; | 529,509 |
public static BuddhistChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
BuddhistChronology chrono = cCache.get(zone);
if (chrono == null) {
// First create without a lower limit.
chrono = new Buddhi... | static BuddhistChronology function(DateTimeZone zone) { if (zone == null) { zone = DateTimeZone.getDefault(); } BuddhistChronology chrono = cCache.get(zone); if (chrono == null) { chrono = new BuddhistChronology(GJChronology.getInstance(zone, null), null); DateTime lowerLimit = new DateTime(1, 1, 1, 0, 0, 0, 0, chrono)... | /**
* Standard instance of a Buddhist Chronology, that matches
* Sun's BuddhistCalendar class. This means that it follows the
* GregorianJulian calendar rules with a cutover date.
*
* @param zone the time zone to use, null is default
*/ | Standard instance of a Buddhist Chronology, that matches Sun's BuddhistCalendar class. This means that it follows the GregorianJulian calendar rules with a cutover date | getInstance | {
"repo_name": "AlexeyTrusov/testing5",
"path": "src/main/java/org/joda/time/chrono/BuddhistChronology.java",
"license": "apache-2.0",
"size": 9082
} | [
"org.joda.time.Chronology",
"org.joda.time.DateTime",
"org.joda.time.DateTimeZone"
] | import org.joda.time.Chronology; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,370,372 |
@ServiceMethod(returns = ReturnType.SINGLE)
ComponentLinkedStorageAccountsInner createAndUpdate(
String resourceGroupName,
String resourceName,
StorageType storageType,
ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties); | @ServiceMethod(returns = ReturnType.SINGLE) ComponentLinkedStorageAccountsInner createAndUpdate( String resourceGroupName, String resourceName, StorageType storageType, ComponentLinkedStorageAccountsInner linkedStorageAccountsProperties); | /**
* Replace current linked storage account for an Application Insights component.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the Application Insights component resource.
* @param storageType The type of the Appl... | Replace current linked storage account for an Application Insights component | createAndUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/applicationinsights/azure-resourcemanager-applicationinsights/src/main/java/com/azure/resourcemanager/applicationinsights/fluent/ComponentLinkedStorageAccountsOperationsClient.java",
"license": "mit",
"size": 9881
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner",
"com.azure.resourcemanager.applicationinsights.models.StorageType"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.applicationinsights.fluent.models.ComponentLinkedStorageAccountsInner; import com.azure.resourcemanager.applicationinsights.models.StorageType; | import com.azure.core.annotation.*; import com.azure.resourcemanager.applicationinsights.fluent.models.*; import com.azure.resourcemanager.applicationinsights.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,138,640 |
public void loadFrom(File f) throws IOException
{
IOException exception = null;
FileInputStream input = null;
input = new FileInputStream(f);
try
{
loadFrom(input);
} catch (IOException e)
{
exception = e;
} finally
{
if (input != null)
{
input.close();
}
}
... | void function(File f) throws IOException { IOException exception = null; FileInputStream input = null; input = new FileInputStream(f); try { loadFrom(input); } catch (IOException e) { exception = e; } finally { if (input != null) { input.close(); } } if (exception != null) { throw (exception); } } | /**
* load prefs from given props file.
* @param f
* @throws java.io.IOException
*/ | load prefs from given props file | loadFrom | {
"repo_name": "tcolar/javaontracks",
"path": "src/net/jot/prefs/JOTPropertiesPreferences.java",
"license": "artistic-2.0",
"size": 3112
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException"
] | import java.io.File; import java.io.FileInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,964,148 |
public static <K> K pollRandom(Collection<K> collection, Random rnd) {
int size = collection.size();
if (size == 0) {
return null;
}
int index = rnd.nextInt(size);
List<K> values = new ArrayList<K>(collection);
K retVal = values.get(index);
// now ... | static <K> K function(Collection<K> collection, Random rnd) { int size = collection.size(); if (size == 0) { return null; } int index = rnd.nextInt(size); List<K> values = new ArrayList<K>(collection); K retVal = values.get(index); collection.remove(retVal); return retVal; } | /**
* Returns a random element from a collection. This method is pretty slow O(n), but the Java collection
* framework
* does not offer a better solution. This method puts the collection into a {@link List} and fetches a
* random
* element using {@link List#get(int)}.
*
* @param collection
... | Returns a random element from a collection. This method is pretty slow O(n), but the Java collection framework does not offer a better solution. This method puts the collection into a <code>List</code> and fetches a random element using <code>List#get(int)</code> | pollRandom | {
"repo_name": "thirdy/TomP2P",
"path": "core/src/main/java/net/tomp2p/utils/Utils.java",
"license": "apache-2.0",
"size": 34619
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List",
"java.util.Random"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Random; | import java.util.*; | [
"java.util"
] | java.util; | 2,076,489 |
public static void set(Object obj,
long propertyId,
String val,
int member,
int index)
{
switch(getPropertyMappingKind(obj.getTypeId(),propertyId,member))
{
case MappedToNull:
... | static void function(Object obj, long propertyId, String val, int member, int index) { switch(getPropertyMappingKind(obj.getTypeId(),propertyId,member)) { case MappedToNull: throw new ReadOnlyException(STR); case MappedToParameter: throw new ReadOnlyException(STR); case MappedToMember: { int[] classMemberRef = getClass... | /**
* Set a String property member in the object using a property.
*
* @param obj The object to modify.
* @param propertyId TypeId of the property to use.
* @param val The value to set the member to.
* @param member Index of the property member to modify.
* @param index Array index.
... | Set a String property member in the object using a property | set | {
"repo_name": "SafirSDK/safir-sdk-core",
"path": "src/dots/dots_java.ss/src/com.saabgroup.safir.dob.typesystem/src/com/saabgroup/safir/dob/typesystem/Properties.java",
"license": "gpl-3.0",
"size": 83391
} | [
"com.saabgroup.safir.dob.typesystem.Object"
] | import com.saabgroup.safir.dob.typesystem.Object; | import com.saabgroup.safir.dob.typesystem.*; | [
"com.saabgroup.safir"
] | com.saabgroup.safir; | 1,592,740 |
private void logExceptionForFailureAnalysis(String msg) {
// Some error messages are formatted in multiple lines and with tabs.
// We clean the messages to help parse the stack traces for failure analysis.
// We keep at most 2 lines, otherwise the error message may be too long.
Strin... | void function(String msg) { String[] lines = msg.split(STR); msg = lines.length >= 2 ? lines[0] + " " + lines[1] : lines[0]; msg = msg.replaceAll("\t", " "); TestFailure e = new TestFailure(msg); StackTraceElement[] elements = e.getStackTrace(); final int callerIndex = 2; if (elements.length <= callerIndex) { return; }... | /**
* Create an Exception and print the stack trace for an error msg.
* This makes it possible to detect a failure reason for this error.
*/ | Create an Exception and print the stack trace for an error msg. This makes it possible to detect a failure reason for this error | logExceptionForFailureAnalysis | {
"repo_name": "md-5/jdk10",
"path": "test/hotspot/jtreg/vmTestbase/nsk/share/Log.java",
"license": "gpl-2.0",
"size": 24117
} | [
"java.io.PrintStream"
] | import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 968,864 |
public String getString(int index) throws IOException {
return inputStreamToString(getInputStream(index));
} | String function(int index) throws IOException { return inputStreamToString(getInputStream(index)); } | /**
* Returns the string value for {@code index}.
*/ | Returns the string value for index | getString | {
"repo_name": "armstrongli/XCamera",
"path": "src/com/xxboy/common/DiskLruCache.java",
"license": "gpl-2.0",
"size": 28357
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,860,465 |
private ResourcesBrowseItem getResourcesBrowseItem(ContentResource resource) {
ResourceProperties props = resource.getProperties();
String itemType = ((ContentResource)resource).getContentType();
String itemName = props.getProperty(ResourceProperties.PROP_DISPLAY_NAME);
ResourcesBrowseItem newItem = new Reso... | ResourcesBrowseItem function(ContentResource resource) { ResourceProperties props = resource.getProperties(); String itemType = ((ContentResource)resource).getContentType(); String itemName = props.getProperty(ResourceProperties.PROP_DISPLAY_NAME); ResourcesBrowseItem newItem = new ResourcesBrowseItem(resource.getId(),... | /**
* get an ResourcesBrowseItem object based on a given ContentResource object
* @param resource
* @return
*/ | get an ResourcesBrowseItem object based on a given ContentResource object | getResourcesBrowseItem | {
"repo_name": "noondaysun/sakai",
"path": "content/content-tool/tool/src/java/org/sakaiproject/content/tool/ResourcesAction.java",
"license": "apache-2.0",
"size": 337685
} | [
"org.sakaiproject.content.api.ContentResource",
"org.sakaiproject.entity.api.ResourceProperties",
"org.sakaiproject.time.api.Time"
] | import org.sakaiproject.content.api.ContentResource; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.time.api.Time; | import org.sakaiproject.content.api.*; import org.sakaiproject.entity.api.*; import org.sakaiproject.time.api.*; | [
"org.sakaiproject.content",
"org.sakaiproject.entity",
"org.sakaiproject.time"
] | org.sakaiproject.content; org.sakaiproject.entity; org.sakaiproject.time; | 2,312,247 |
public static boolean getValue(List <ControlFeature> daList, Long phaseId, String featureName){
if ((phaseId == null) || (featureName == null)){
return false;
}
// Loop over dependent object assignments found for this simulation
for (ListIterator<ControlFeature> lc = daList
.listIterator... | static boolean function(List <ControlFeature> daList, Long phaseId, String featureName){ if ((phaseId == null) (featureName == null)){ return false; } for (ListIterator<ControlFeature> lc = daList .listIterator(); lc.hasNext();) { ControlFeature cf = lc.next(); if ((cf.phaseid.intValue() == 0) (cf.phaseid.intValue() ==... | /**
* Returns the value found when one passes it in a particular list (probably for a particular simulation)
* and a feature name.
*
* @param daList
* @param phaseId
* @param featureName
* @return
*/ | Returns the value found when one passes it in a particular list (probably for a particular simulation) and a feature name | getValue | {
"repo_name": "skipcole/opensimplatform",
"path": "WEB-INF/classes/org/usip/osp/specialfeatures/ControlFeature.java",
"license": "bsd-3-clause",
"size": 4478
} | [
"java.util.List",
"java.util.ListIterator"
] | import java.util.List; import java.util.ListIterator; | import java.util.*; | [
"java.util"
] | java.util; | 961,199 |
@Override
public void addUserMaterial(Material m) {
Preferences prefs = PREFNODE.node("userMaterials");
// Check whether material already exists
if (getUserMaterials().contains(m)) {
return;
}
// Add material using next free key (key is not used when loading)
String mat = m.toStorableString(... | void function(Material m) { Preferences prefs = PREFNODE.node(STR); if (getUserMaterials().contains(m)) { return; } String mat = m.toStorableString(); for (int i = 0;; i++) { String key = STR + i; if (prefs.get(key, null) == null) { prefs.put(key, mat); return; } } } | /**
* Add a user-defined material to the preferences. The preferences are
* first checked for an existing material matching the provided one using
* {@link Material#equals(Object)}.
*
* @param m the material to add.
*/ | Add a user-defined material to the preferences. The preferences are first checked for an existing material matching the provided one using <code>Material#equals(Object)</code> | addUserMaterial | {
"repo_name": "joebowen/landing_zone_project",
"path": "openrocket-release-15.03/swing/src/net/sf/openrocket/gui/util/SwingPreferences.java",
"license": "gpl-2.0",
"size": 16552
} | [
"java.util.prefs.Preferences",
"net.sf.openrocket.material.Material"
] | import java.util.prefs.Preferences; import net.sf.openrocket.material.Material; | import java.util.prefs.*; import net.sf.openrocket.material.*; | [
"java.util",
"net.sf.openrocket"
] | java.util; net.sf.openrocket; | 1,446,970 |
public ServiceFuture<List<DatabaseInner>> listByClusterAsync(String resourceGroupName, String clusterName, final ServiceCallback<List<DatabaseInner>> serviceCallback) {
return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback);
} | ServiceFuture<List<DatabaseInner>> function(String resourceGroupName, String clusterName, final ServiceCallback<List<DatabaseInner>> serviceCallback) { return ServiceFuture.fromResponse(listByClusterWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); } | /**
* Returns the list of databases of the given Kusto cluster.
*
* @param resourceGroupName The name of the resource group containing the Kusto cluster.
* @param clusterName The name of the Kusto cluster.
* @param serviceCallback the async ServiceCallback to handle successful and failed respon... | Returns the list of databases of the given Kusto cluster | listByClusterAsync | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/kusto/mgmt-v2019_05_15/src/main/java/com/microsoft/azure/management/kusto/v2019_05_15/implementation/DatabasesInner.java",
"license": "mit",
"size": 87420
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture",
"java.util.List"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.List; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 2,125,998 |
EReference getDocumentRoot_SignalEventDefinition(); | EReference getDocumentRoot_SignalEventDefinition(); | /**
* Returns the meta object for the containment reference '{@link org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition <em>Signal Event Definition</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Signal Event Definition</em>'.
* @see o... | Returns the meta object for the containment reference '<code>org.eclipse.bpmn2.DocumentRoot#getSignalEventDefinition Signal Event Definition</code>'. | getDocumentRoot_SignalEventDefinition | {
"repo_name": "Rikkola/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java",
"license": "apache-2.0",
"size": 929298
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,124,049 |
public boolean isAccountDisabled(String username) {
LockOutFlag flag = getDisabledStatus(username);
if (flag == null) {
return false;
}
Date curDate = new Date();
if (flag.getStartTime() != null && curDate.before(flag.getStartTime())) {
return false;
... | boolean function(String username) { LockOutFlag flag = getDisabledStatus(username); if (flag == null) { return false; } Date curDate = new Date(); if (flag.getStartTime() != null && curDate.before(flag.getStartTime())) { return false; } if (flag.getEndTime() != null && curDate.after(flag.getEndTime())) { return false; ... | /**
* Returns true or false if an account is currently locked out.
*
* @param username Username of account to check on.
* @return True or false if the account is currently locked out.
*/ | Returns true or false if an account is currently locked out | isAccountDisabled | {
"repo_name": "trimnguye/JavaChatServer",
"path": "src/java/org/jivesoftware/openfire/lockout/LockOutManager.java",
"license": "apache-2.0",
"size": 9689
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 781,499 |
public CountDownLatch getRatesAsync(com.mozu.api.contracts.shippingruntime.RateRequest rateRequest, String responseFields, AsyncCallback<com.mozu.api.contracts.shippingruntime.RatesResponse> callback) throws Exception
{
MozuClient<com.mozu.api.contracts.shippingruntime.RatesResponse> client = com.mozu.api.clients... | CountDownLatch function(com.mozu.api.contracts.shippingruntime.RateRequest rateRequest, String responseFields, AsyncCallback<com.mozu.api.contracts.shippingruntime.RatesResponse> callback) throws Exception { MozuClient<com.mozu.api.contracts.shippingruntime.RatesResponse> client = com.mozu.api.clients.commerce.catalog.... | /**
* Retrieves the shipping rates applicable for the site.
* <p><pre><code>
* Shipping shipping = new Shipping();
* CountDownLatch latch = shipping.getRates( rateRequest, responseFields, callback );
* latch.await() * </code></pre></p>
* @param responseFields Use this field to include those fields which a... | Retrieves the shipping rates applicable for the site. <code><code> Shipping shipping = new Shipping(); CountDownLatch latch = shipping.getRates( rateRequest, responseFields, callback ); latch.await() * </code></code> | getRatesAsync | {
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/catalog/storefront/ShippingResource.java",
"license": "mit",
"size": 4704
} | [
"com.mozu.api.AsyncCallback",
"com.mozu.api.MozuClient",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 381,255 |
private void createNewLandingZones() {
try {
List<String> lzPaths = tenantDA.getLzPaths();
LOG.debug("TenantProcessor: Localhost is {}", getHostname());
for (String currLzPath : lzPaths) {
createDirIfNotExists(currLzPath);
}
} catch (... | void function() { try { List<String> lzPaths = tenantDA.getLzPaths(); LOG.debug(STR, getHostname()); for (String currLzPath : lzPaths) { createDirIfNotExists(currLzPath); } } catch (UnknownHostException e) { LOG.error(STR, e); } } | /**
* Attempt to create new landing zones based on the tenant DB collection.
*/ | Attempt to create new landing zones based on the tenant DB collection | createNewLandingZones | {
"repo_name": "inbloom/secure-data-service",
"path": "sli/ingestion/ingestion-core/src/main/java/org/slc/sli/ingestion/processors/TenantProcessor.java",
"license": "apache-2.0",
"size": 9423
} | [
"java.net.UnknownHostException",
"java.util.List"
] | import java.net.UnknownHostException; import java.util.List; | import java.net.*; import java.util.*; | [
"java.net",
"java.util"
] | java.net; java.util; | 1,400,370 |
public static interface RequestCallback<T> {
public void onSuccess(EditorRequest<T> request); | static interface RequestCallback<T> { public void function(EditorRequest<T> request); | /**
* The method that must be called when the request has been
* processed correctly.
*
* @param request
* the original request object
*/ | The method that must be called when the request has been processed correctly | onSuccess | {
"repo_name": "fireflyc/vaadin",
"path": "client/src/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 285073
} | [
"com.vaadin.client.widget.grid.EditorHandler"
] | import com.vaadin.client.widget.grid.EditorHandler; | import com.vaadin.client.widget.grid.*; | [
"com.vaadin.client"
] | com.vaadin.client; | 2,082 |
public Node item(int index);
| Node function(int index); | /**
* This method retrieves a node specified by ordinal index. Nodes are
* numbered in tree order (depth-first traversal order).
* @param index The index of the node to be fetched. The index origin is
* 0.
* @return The <code>Node</code> at the corresponding position upon
* ... | This method retrieves a node specified by ordinal index. Nodes are numbered in tree order (depth-first traversal order) | item | {
"repo_name": "SaharChang/Author-Extraction",
"path": "AuthorExtract/src/org/w3c/dom/html2/HTMLOptionsCollection.java",
"license": "apache-2.0",
"size": 3895
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,260,146 |
public ServiceFuture<List<RegexEntityExtractor>> listRegexEntityInfosAsync(UUID appId, String versionId, ListRegexEntityInfosOptionalParameter listRegexEntityInfosOptionalParameter, final ServiceCallback<List<RegexEntityExtractor>> serviceCallback) {
return ServiceFuture.fromResponse(listRegexEntityInfosWit... | ServiceFuture<List<RegexEntityExtractor>> function(UUID appId, String versionId, ListRegexEntityInfosOptionalParameter listRegexEntityInfosOptionalParameter, final ServiceCallback<List<RegexEntityExtractor>> serviceCallback) { return ServiceFuture.fromResponse(listRegexEntityInfosWithServiceResponseAsync(appId, version... | /**
* Gets information about the regular expression entity models in a version of the application.
*
* @param appId The application ID.
* @param versionId The version ID.
* @param listRegexEntityInfosOptionalParameter the object representing the optional parameters to be set before calling this... | Gets information about the regular expression entity models in a version of the application | listRegexEntityInfosAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/cognitiveservices/ms-azure-cs-luis-authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java",
"license": "mit",
"size": 818917
} | [
"com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListRegexEntityInfosOptionalParameter",
"com.microsoft.azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture",
"java.util.List"
] | import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.ListRegexEntityInfosOptionalParameter; import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.RegexEntityExtractor; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import java.util.List; | import com.microsoft.azure.cognitiveservices.language.luis.authoring.models.*; import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.azure",
"com.microsoft.rest",
"java.util"
] | com.microsoft.azure; com.microsoft.rest; java.util; | 2,213,434 |
private void startIntellicutPanelShowTimer(DisplayedPartConnectable dPartConnectable) {
boolean enabled = GemCutter.getPreferences().getBoolean(INTELLICUT_POPUP_ENABLED_PREF_KEY, INTELLICUT_POPUP_ENABLED_DEFAULT);
if (enabled) {
... | void function(DisplayedPartConnectable dPartConnectable) { boolean enabled = GemCutter.getPreferences().getBoolean(INTELLICUT_POPUP_ENABLED_PREF_KEY, INTELLICUT_POPUP_ENABLED_DEFAULT); if (enabled) { int delay = GemCutter.getPreferences().getInt(INTELLICUT_POPUP_DELAY_PREF_KEY, INTELLICUT_POPUP_DELAY_DEFAULT) * 1000; i... | /**
* Start the intellicutPanelShowTimer if automatic intellicut is enabled.
*/ | Start the intellicutPanelShowTimer if automatic intellicut is enabled | startIntellicutPanelShowTimer | {
"repo_name": "levans/Open-Quark",
"path": "src/Quark_Gems/src/org/openquark/gems/client/IntellicutManager.java",
"license": "bsd-3-clause",
"size": 45071
} | [
"java.awt.event.ActionListener",
"javax.swing.Timer",
"org.openquark.gems.client.DisplayedGem"
] | import java.awt.event.ActionListener; import javax.swing.Timer; import org.openquark.gems.client.DisplayedGem; | import java.awt.event.*; import javax.swing.*; import org.openquark.gems.client.*; | [
"java.awt",
"javax.swing",
"org.openquark.gems"
] | java.awt; javax.swing; org.openquark.gems; | 1,243,715 |
public DependencyCustomizer add(String module, boolean transitive) {
return add(module, null, null, transitive);
}
/**
* Add a single dependency with the specified classifier and type and, optionally, all
* of its dependencies. The group ID and version of the dependency are resolved from
* the module by u... | DependencyCustomizer function(String module, boolean transitive) { return add(module, null, null, transitive); } /** * Add a single dependency with the specified classifier and type and, optionally, all * of its dependencies. The group ID and version of the dependency are resolved from * the module by using the customi... | /**
* Add a single dependency and, optionally, all of its dependencies. The group ID and
* version of the dependency are resolved from the module using the customizer's
* {@link ArtifactCoordinatesResolver}.
* @param module The module ID
* @param transitive {@code true} if the transitive dependencies should a... | Add a single dependency and, optionally, all of its dependencies. The group ID and version of the dependency are resolved from the module using the customizer's <code>ArtifactCoordinatesResolver</code> | add | {
"repo_name": "srikalyan/spring-boot",
"path": "spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/DependencyCustomizer.java",
"license": "apache-2.0",
"size": 9061
} | [
"org.springframework.boot.cli.compiler.dependencies.ArtifactCoordinatesResolver"
] | import org.springframework.boot.cli.compiler.dependencies.ArtifactCoordinatesResolver; | import org.springframework.boot.cli.compiler.dependencies.*; | [
"org.springframework.boot"
] | org.springframework.boot; | 1,382,708 |
protected boolean hasExternalBusinessObjectProperty(Class boClass, Map<String,String> fieldValues ) {
try {
Object sampleBo = boClass.newInstance();
for ( String key : fieldValues.keySet() ) {
if ( isExternalBusinessObjectProperty( sampleBo, key )) {
return true;
}
}
... | boolean function(Class boClass, Map<String,String> fieldValues ) { try { Object sampleBo = boClass.newInstance(); for ( String key : fieldValues.keySet() ) { if ( isExternalBusinessObjectProperty( sampleBo, key )) { return true; } } } catch ( Exception ex ) { LOG.debug(STR + boClass + STR, ex ); } return false; } | /**
* Checks whether any of the fieldValues being passed refer to a property within an ExternalizableBusinessObject.
*/ | Checks whether any of the fieldValues being passed refer to a property within an ExternalizableBusinessObject | hasExternalBusinessObjectProperty | {
"repo_name": "geothomasp/kualico-rice-kc",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/lookup/KualiLookupableHelperServiceImpl.java",
"license": "apache-2.0",
"size": 20067
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,261,182 |
@Test
public void testSetObject() {
KeyedObjects2D data = new KeyedObjects2D();
data.setObject("Obj1", "R1", "C1");
data.setObject("Obj2", "R2", "C2");
assertEquals("Obj1", data.getObject("R1", "C1"));
assertEquals("Obj2", data.getObject("R2", "C2"));
assertNull(d... | void function() { KeyedObjects2D data = new KeyedObjects2D(); data.setObject("Obj1", "R1", "C1"); data.setObject("Obj2", "R2", "C2"); assertEquals("Obj1", data.getObject("R1", "C1")); assertEquals("Obj2", data.getObject("R2", "C2")); assertNull(data.getObject("R1", "C2")); assertNull(data.getObject("R2", "C1")); data.s... | /**
* Some checks for the setObject(Object, Comparable, Comparable) method.
*/ | Some checks for the setObject(Object, Comparable, Comparable) method | testSetObject | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/test/java/org/jfree/data/KeyedObjects2DTest.java",
"license": "gpl-3.0",
"size": 12839
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,383,865 |
private static String getPictureString(ParseObject parseUser) {
if (parseUser != null) {
// Get "pictures" from Parse table "FacebookAccounts"
// in the parseUser row
String list = (String) parseUser.get("pictures");
return list;
}
return null;
} | static String function(ParseObject parseUser) { if (parseUser != null) { String list = (String) parseUser.get(STR); return list; } return null; } | /**
* getPictureString() returns the string from the pictures column of the
* FacebookAccounts table of the parseUser in the NOM Parse database.
*
* Note: The string should be split with "," to obtain each photo ID.
*/ | getPictureString() returns the string from the pictures column of the FacebookAccounts table of the parseUser in the NOM Parse database. Note: The string should be split with "," to obtain each photo ID | getPictureString | {
"repo_name": "wihuang/Team-Alice",
"path": "ProjectNom/src/cse110/TeamNom/projectnom/AppParseAccess.java",
"license": "mit",
"size": 24207
} | [
"com.parse.ParseObject"
] | import com.parse.ParseObject; | import com.parse.*; | [
"com.parse"
] | com.parse; | 78,571 |
public SyncMemberState syncState() {
return this.syncState;
} | SyncMemberState function() { return this.syncState; } | /**
* Get sync state of the sync member. Possible values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', 'DisabledTombstoneCleanup', 'DisabledBackupRestore', 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', 'DeProvisioning'... | Get sync state of the sync member. Possible values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', 'DisabledTombstoneCleanup', 'DisabledBackupRestore', 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', 'DeProvisioning', 'DeProvis... | syncState | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/sql/mgmt-v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMemberInner.java",
"license": "mit",
"size": 7895
} | [
"com.microsoft.azure.management.sql.v2015_05_01_preview.SyncMemberState"
] | import com.microsoft.azure.management.sql.v2015_05_01_preview.SyncMemberState; | import com.microsoft.azure.management.sql.v2015_05_01_preview.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,691,168 |
public void resizeText(int width, int height) {
CharSequence text = getText();
// Do not resize if the view does not have dimensions or there is no text
if (text == null || text.length() == 0 || height <= 0 || width <= 0 || mTextSize == 0) {
return;
}
// Get the ... | void function(int width, int height) { CharSequence text = getText(); if (text == null text.length() == 0 height <= 0 width <= 0 mTextSize == 0) { return; } TextPaint textPaint = getPaint(); float oldTextSize = textPaint.getTextSize(); float targetTextSize = mMaxTextSize > 0 ? Math.min(mTextSize, mMaxTextSize) : mTextS... | /**
* Resize the text size with specified width and height
* @param width
* @param height
*/ | Resize the text size with specified width and height | resizeText | {
"repo_name": "fabiophillip/sumosenseimongodb",
"path": "src/cenario/AutoResizeTextView.java",
"license": "epl-1.0",
"size": 10759
} | [
"android.text.Layout",
"android.text.StaticLayout",
"android.text.TextPaint",
"android.util.TypedValue"
] | import android.text.Layout; import android.text.StaticLayout; import android.text.TextPaint; import android.util.TypedValue; | import android.text.*; import android.util.*; | [
"android.text",
"android.util"
] | android.text; android.util; | 152,322 |
@Override public void exitVarType(@NotNull JavaParser.VarTypeContext ctx) { } | @Override public void exitVarType(@NotNull JavaParser.VarTypeContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterVarType | {
"repo_name": "ChShersh/university-courses",
"path": "parsing-course/03/src/com/kovanikov/parser/JavaBaseListener.java",
"license": "mit",
"size": 10426
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,569,143 |
public Unit<?> getUnits() {
return unit;
} | Unit<?> function() { return unit; } | /**
* Returns the unit information for quantitative categories in this list. May returns {@code
* null} if there is no quantitative categories in this list, or if there is no unit
* information.
*/ | Returns the unit information for quantitative categories in this list. May returns null if there is no quantitative categories in this list, or if there is no unit information | getUnits | {
"repo_name": "geotools/geotools",
"path": "modules/library/coverage/src/main/java/org/geotools/coverage/CategoryList.java",
"license": "lgpl-2.1",
"size": 32378
} | [
"javax.measure.Unit"
] | import javax.measure.Unit; | import javax.measure.*; | [
"javax.measure"
] | javax.measure; | 2,600,612 |
static Manifest getManifest(final File file)
{
final Manifest result = withJar(file, ManifestExtractor.INSTANCE);
return (result == null) ? new Manifest() : result;
} | static Manifest getManifest(final File file) { final Manifest result = withJar(file, ManifestExtractor.INSTANCE); return (result == null) ? new Manifest() : result; } | /**
* Get the {@link Manifest} from a Jar file, or create a new one if there isn't one already.
*
* @param file the file that is the jar contents
* @return the manifest or an empty new one if one can't be found.
*/ | Get the <code>Manifest</code> from a Jar file, or create a new one if there isn't one already | getManifest | {
"repo_name": "mrdon/PLUG",
"path": "atlassian-plugins-osgi/src/main/java/com/atlassian/plugin/osgi/factory/transform/JarUtils.java",
"license": "bsd-3-clause",
"size": 3779
} | [
"java.io.File",
"java.util.jar.Manifest"
] | import java.io.File; import java.util.jar.Manifest; | import java.io.*; import java.util.jar.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,876,857 |
public DataStore<Object, Persistent> getDataStore() {
return dataStore;
} | DataStore<Object, Persistent> function() { return dataStore; } | /**
* Get DataStore
*/ | Get DataStore | getDataStore | {
"repo_name": "jlpedrosa/camel",
"path": "components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java",
"license": "apache-2.0",
"size": 3327
} | [
"org.apache.gora.persistency.Persistent",
"org.apache.gora.store.DataStore"
] | import org.apache.gora.persistency.Persistent; import org.apache.gora.store.DataStore; | import org.apache.gora.persistency.*; import org.apache.gora.store.*; | [
"org.apache.gora"
] | org.apache.gora; | 793,409 |
public void setRegisterValueValue(YangString registerValueValue)
throws JNCException {
setLeafValue(Epc.NAMESPACE,
"register-value",
registerValueValue,
childrenNames());
} | void function(YangString registerValueValue) throws JNCException { setLeafValue(Epc.NAMESPACE, STR, registerValueValue, childrenNames()); } | /**
* Sets the value for child leaf "register-value",
* using instance of generated typedef class.
* @param registerValueValue The value to set.
* @param registerValueValue used during instantiation.
*/ | Sets the value for child leaf "register-value", using instance of generated typedef class | setRegisterValueValue | {
"repo_name": "jnpr-shinma/yangfile",
"path": "hitel/src/hctaEpc/mmeSgsn/statistics/gprsMm/RauFail.java",
"license": "apache-2.0",
"size": 11341
} | [
"com.tailf.jnc.YangString"
] | import com.tailf.jnc.YangString; | import com.tailf.jnc.*; | [
"com.tailf.jnc"
] | com.tailf.jnc; | 2,338,398 |
@Override
public void run(Formatter formatter, Reporter reporter, Runtime runtime) {
Set<Tag> tags = tagsAndInheritedTags();
runtime.buildBackendWorlds(reporter, tags, scenario);
try {
formatter.startOfScenarioLifeCycle((Scenario) getGherkinModel());
} catch (Throwabl... | void function(Formatter formatter, Reporter reporter, Runtime runtime) { Set<Tag> tags = tagsAndInheritedTags(); runtime.buildBackendWorlds(reporter, tags, scenario); try { formatter.startOfScenarioLifeCycle((Scenario) getGherkinModel()); } catch (Throwable ignore) { } runtime.runBeforeHooks(reporter, tags); runBackgro... | /**
* This method is called when Cucumber is run from the CLI, but not when run from JUnit
*/ | This method is called when Cucumber is run from the CLI, but not when run from JUnit | run | {
"repo_name": "roman-grytsay/cucumber-rocky",
"path": "src/test/java/framework/manager/cucumber/runtime/model/CucumberScenario.java",
"license": "mit",
"size": 2412
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,957,817 |
public SparseDataset parse(String name, String path) throws FileNotFoundException, IOException, ParseException {
return parse(name, new File(path));
} | SparseDataset function(String name, String path) throws FileNotFoundException, IOException, ParseException { return parse(name, new File(path)); } | /**
* Parse a sparse dataset from given file.
* @param path the file path of data source.
* @throws java.io.FileNotFoundException
*/ | Parse a sparse dataset from given file | parse | {
"repo_name": "wavelets/smile",
"path": "SmileData/src/smile/data/parser/SparseDatasetParser.java",
"license": "apache-2.0",
"size": 5737
} | [
"java.io.File",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.text.ParseException"
] | import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.text.ParseException; | import java.io.*; import java.text.*; | [
"java.io",
"java.text"
] | java.io; java.text; | 530,768 |
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> beginUpdateTags(
String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) {
return beginUpdateTagsAsync(resourceGr... | @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> function( String resourceGroupName, String applicationSecurityGroupName, TagsObject parameters, Context context) { return beginUpdateTagsAsync(resourceGroupName, applicationSecurityGroupName,... | /**
* Updates an application security group's tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationSecurityGroupName The name of the application security group.
* @param parameters Parameters supplied to update application security group tags.
* @param con... | Updates an application security group's tags | beginUpdateTags | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationSecurityGroupsClientImpl.java",
"license": "mit",
"size": 79677
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.SyncPoller",
"com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner",
"com.azure.resource... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner; impor... | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*; import com.azure.resourcemanager.network.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,739,930 |
private void handleReceivedSequence(ReceivedSequenceMsg message) {
this.multiplayerFullSequence = message.getSequence();
message.getPresenter().getHandler().sendEmptyMessage(Constants.MULTIPLAYER_READY);
} | void function(ReceivedSequenceMsg message) { this.multiplayerFullSequence = message.getSequence(); message.getPresenter().getHandler().sendEmptyMessage(Constants.MULTIPLAYER_READY); } | /**
* 2nd player in multiplayer classic mode - Receives the sequence and communicates to the
* GameViewActor "let the game begin!"
* @param message
*/ | 2nd player in multiplayer classic mode - Receives the sequence and communicates to the GameViewActor "let the game begin!" | handleReceivedSequence | {
"repo_name": "simoneapp/S3-16-simone",
"path": "app/src/main/java/app/simone/singleplayer/controller/CPUActor.java",
"license": "mit",
"size": 4730
} | [
"app.simone.shared.utils.Constants",
"app.simone.singleplayer.messages.ReceivedSequenceMsg"
] | import app.simone.shared.utils.Constants; import app.simone.singleplayer.messages.ReceivedSequenceMsg; | import app.simone.shared.utils.*; import app.simone.singleplayer.messages.*; | [
"app.simone.shared",
"app.simone.singleplayer"
] | app.simone.shared; app.simone.singleplayer; | 1,687,685 |
public synchronized void close() throws IOException {
if (logStream != null) {
logStream.close();
}
for (FileOutputStream log : streamsToFlush) {
log.close();
}
} | synchronized void function() throws IOException { if (logStream != null) { logStream.close(); } for (FileOutputStream log : streamsToFlush) { log.close(); } } | /**
* close all the open file handles
* @throws IOException
*/ | close all the open file handles | close | {
"repo_name": "apurtell/zookeeper",
"path": "src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java",
"license": "apache-2.0",
"size": 22283
} | [
"java.io.FileOutputStream",
"java.io.IOException"
] | import java.io.FileOutputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,053,407 |
private void addSupplementaryAuthHeader(String headerName, String entity, Context context) {
context.getData(AZURE_REQUEST_HTTP_HEADERS_KEY)
.ifPresent(headers -> {
if (headers instanceof HttpHeaders) {
HttpHeaders customHttpHeaders = (HttpHeaders) headers;
... | void function(String headerName, String entity, Context context) { context.getData(AZURE_REQUEST_HTTP_HEADERS_KEY) .ifPresent(headers -> { if (headers instanceof HttpHeaders) { HttpHeaders customHttpHeaders = (HttpHeaders) headers; customHttpHeaders.add(headerName, entity); } }); } | /**
* Check that the additional headers field is present and add the additional auth header
*
* @param headerName name of the header to be added
* @param context current request context
*
* @return boolean representing the outcome of adding header operation
*/ | Check that the additional headers field is present and add the additional auth header | addSupplementaryAuthHeader | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/administration/ServiceBusAdministrationAsyncClient.java",
"license": "mit",
"size": 144140
} | [
"com.azure.core.http.HttpHeaders",
"com.azure.core.util.Context"
] | import com.azure.core.http.HttpHeaders; import com.azure.core.util.Context; | import com.azure.core.http.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,726,383 |
@Test(expected = BadTsvLineException.class)
public void testTsvParserBadTsvLineExcessiveColumns() throws BadTsvLineException {
TsvParser parser = new TsvParser("HBASE_ROW_KEY,col_a", "\t");
byte[] line = Bytes.toBytes("val_a\tval_b\tval_c");
parser.parse(line, line.length);
} | @Test(expected = BadTsvLineException.class) void function() throws BadTsvLineException { TsvParser parser = new TsvParser(STR, "\t"); byte[] line = Bytes.toBytes(STR); parser.parse(line, line.length); } | /**
* Test cases that throw BadTsvLineException
*/ | Test cases that throw BadTsvLineException | testTsvParserBadTsvLineExcessiveColumns | {
"repo_name": "HubSpot/hbase",
"path": "hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTsvParser.java",
"license": "apache-2.0",
"size": 14129
} | [
"org.apache.hadoop.hbase.mapreduce.ImportTsv",
"org.apache.hadoop.hbase.util.Bytes",
"org.junit.Test"
] | import org.apache.hadoop.hbase.mapreduce.ImportTsv; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Test; | import org.apache.hadoop.hbase.mapreduce.*; import org.apache.hadoop.hbase.util.*; import org.junit.*; | [
"org.apache.hadoop",
"org.junit"
] | org.apache.hadoop; org.junit; | 2,719,330 |
private static void handle(ExecutionException ex) {
Throwable cause = ex.getCause();
if (cause instanceof OperationCancelledException) {
// Operation was cancelled, we don't necessary want to propagate
// this up to the user.
return;
}
if (cause instanceof DistributedSystemDisconnec... | static void function(ExecutionException ex) { Throwable cause = ex.getCause(); if (cause instanceof OperationCancelledException) { return; } if (cause instanceof DistributedSystemDisconnectedException) { throw new DistributedSystemDisconnectedException(STR, ex); } throw new RuntimeAdminException( LocalizedStrings.Remot... | /**
* Handles an <code>ExecutionException</code> by examining its cause and throwing an appropriate
* runtime exception.
*/ | Handles an <code>ExecutionException</code> by examining its cause and throwing an appropriate runtime exception | handle | {
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java",
"license": "apache-2.0",
"size": 48674
} | [
"java.util.concurrent.ExecutionException",
"org.apache.geode.admin.OperationCancelledException",
"org.apache.geode.admin.RuntimeAdminException",
"org.apache.geode.distributed.DistributedSystemDisconnectedException",
"org.apache.geode.internal.i18n.LocalizedStrings"
] | import java.util.concurrent.ExecutionException; import org.apache.geode.admin.OperationCancelledException; import org.apache.geode.admin.RuntimeAdminException; import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.internal.i18n.LocalizedStrings; | import java.util.concurrent.*; import org.apache.geode.admin.*; import org.apache.geode.distributed.*; import org.apache.geode.internal.i18n.*; | [
"java.util",
"org.apache.geode"
] | java.util; org.apache.geode; | 1,493,293 |
public static List<BundleInfo> generate(List<Feature> features, List<Feature> additionalFeatures,
boolean forceBuild, String pluginPath, String eclipsePath, String target, String baseDir, String binFolder,
String libsFolder) {
//System.out.println(target + "\\LoaderLog.txt");
... | static List<BundleInfo> function(List<Feature> features, List<Feature> additionalFeatures, boolean forceBuild, String pluginPath, String eclipsePath, String target, String baseDir, String binFolder, String libsFolder) { LoaderLog.init(target + STR); Generator gen = new Generator(new File(baseDir), new File(pluginPath),... | /**
* Gathers Bundles for a list of features, depending on version restrictions.
* @param features A list of features for the build.
* @param forceBuild if true, ignore missing plugins and version issues.
* @param additionalFeatures A list of features that could be used by the main features.
* ... | Gathers Bundles for a list of features, depending on version restrictions | generate | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Tools/EASy-ANT/EASyLoader/src/de/uni_hildesheim/sse/easy/loader/Generator.java",
"license": "apache-2.0",
"size": 44963
} | [
"de.uni_hildesheim.sse.easy.loader.framework.BundleInfo",
"de.uni_hildesheim.sse.easy.loader.framework.Feature",
"de.uni_hildesheim.sse.easy.loader.framework.LoaderLog",
"java.io.File",
"java.util.ArrayList",
"java.util.List"
] | import de.uni_hildesheim.sse.easy.loader.framework.BundleInfo; import de.uni_hildesheim.sse.easy.loader.framework.Feature; import de.uni_hildesheim.sse.easy.loader.framework.LoaderLog; import java.io.File; import java.util.ArrayList; import java.util.List; | import de.uni_hildesheim.sse.easy.loader.framework.*; import java.io.*; import java.util.*; | [
"de.uni_hildesheim.sse",
"java.io",
"java.util"
] | de.uni_hildesheim.sse; java.io; java.util; | 2,548,475 |
default @NotNull AnnotationBuilder highlightReference(@NotNull AnnotationBuilder annotationBuilder) {
return annotationBuilder;
} | default @NotNull AnnotationBuilder highlightReference(@NotNull AnnotationBuilder annotationBuilder) { return annotationBuilder; } | /**
* Implement this method to set various attributes of the highlight.
*/ | Implement this method to set various attributes of the highlight | highlightReference | {
"repo_name": "jwren/intellij-community",
"path": "platform/refactoring/src/com/intellij/codeInsight/highlighting/PsiHighlightedReference.java",
"license": "apache-2.0",
"size": 1376
} | [
"com.intellij.lang.annotation.AnnotationBuilder",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.lang.annotation.AnnotationBuilder; import org.jetbrains.annotations.NotNull; | import com.intellij.lang.annotation.*; import org.jetbrains.annotations.*; | [
"com.intellij.lang",
"org.jetbrains.annotations"
] | com.intellij.lang; org.jetbrains.annotations; | 265,235 |
private TableRow addPlayer() {
// first, make sure that we won't exceed the max number of players
if (this.tableRows.size() >= config.getMaxPlayers()) {
MessageBox.popUpMessage("Sorry, adding another player would exceed the maximum allowed.",
this);
return null;
}
// add the row
TableRow row = ... | TableRow function() { if (this.tableRows.size() >= config.getMaxPlayers()) { MessageBox.popUpMessage(STR, this); return null; } TableRow row = (TableRow) getLayoutInflater().inflate( R.layout.game_player_list_row, playerTable, false); GamePlayerType[] availTypes = config.getAvailTypes(); ArrayAdapter<CharSequence> adap... | /**
* addPlayer
*
* adds a new, blank row to the player table and initializes instance
* variables and listeners appropriately
*
* @return a reference to the TableRow object that was created or null on
* failure
*/ | addPlayer adds a new, blank row to the player table and initializes instance variables and listeners appropriately | addPlayer | {
"repo_name": "MaxRobinson/Phase10",
"path": "Phase10Proj/src/edu/up/cs301/game/GameMainActivity.java",
"license": "gpl-2.0",
"size": 24770
} | [
"android.widget.ArrayAdapter",
"android.widget.ImageButton",
"android.widget.Spinner",
"android.widget.TableRow",
"android.widget.TextView",
"edu.up.cs301.game.config.GamePlayerType",
"edu.up.cs301.game.util.MessageBox"
] | import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.Spinner; import android.widget.TableRow; import android.widget.TextView; import edu.up.cs301.game.config.GamePlayerType; import edu.up.cs301.game.util.MessageBox; | import android.widget.*; import edu.up.cs301.game.config.*; import edu.up.cs301.game.util.*; | [
"android.widget",
"edu.up.cs301"
] | android.widget; edu.up.cs301; | 1,436,329 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<MetricAlertResourceInner>> getByResourceGroupWithResponseAsync(
String resourceGroupName, String ruleName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<MetricAlertResourceInner>> function( String resourceGroupName, String ruleName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .err... | /**
* Retrieve an alert rule definition.
*
* @param resourceGroupName The name of the resource group.
* @param ruleName The name of the rule.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @... | Retrieve an alert rule definition | getByResourceGroupWithResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/implementation/MetricAlertsClientImpl.java",
"license": "mit",
"size": 48535
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.monitor.fluent.models.MetricAlertResourceInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.monitor.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 773,306 |
protected void addNbportPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Vswitch_nbport_feature"),
getString("_UI_PropertyDescriptor_descript... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), VmwarePackage.Literals.VSWITCH__NBPORT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_... | /**
* This adds a property descriptor for the Nbport feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Nbport feature. | addNbportPropertyDescriptor | {
"repo_name": "occiware/Multi-Cloud-Studio",
"path": "plugins/org.eclipse.cmf.occi.multicloud.vmware.edit/src-gen/org/eclipse/cmf/occi/multicloud/vmware/provider/VswitchItemProvider.java",
"license": "epl-1.0",
"size": 7713
} | [
"org.eclipse.cmf.occi.multicloud.vmware.VmwarePackage",
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor"
] | import org.eclipse.cmf.occi.multicloud.vmware.VmwarePackage; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; | import org.eclipse.cmf.occi.multicloud.vmware.*; import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.cmf",
"org.eclipse.emf"
] | org.eclipse.cmf; org.eclipse.emf; | 456,124 |
private String getFieldTypeAndAssignment(Method method, String fieldName) {
StringBuilder builder = new StringBuilder();
builder.append("protected ");
appendType(method.getGenericReturnType(), builder);
builder.append(" ");
builder.append(fieldName);
builder.append(";... | String function(Method method, String fieldName) { StringBuilder builder = new StringBuilder(); builder.append(STR); appendType(method.getGenericReturnType(), builder); builder.append(" "); builder.append(fieldName); builder.append(";\n"); return builder.toString(); } | /**
* In most cases we simply echo the return type and field name, except for JsonArray<T>, which is special in the server impl case,
* since it must be represented by a List<T> for Gson to correctly serialize/deserialize it.
*
* @param method
* The getter method.
* @return String ... | In most cases we simply echo the return type and field name, except for JsonArray, which is special in the server impl case, since it must be represented by a List for Gson to correctly serialize/deserialize it | getFieldTypeAndAssignment | {
"repo_name": "codenvy/che-core",
"path": "platform-api/che-core-api-dto/src/main/java/org/eclipse/che/dto/generator/DtoImplServerTemplate.java",
"license": "epl-1.0",
"size": 32204
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,327,755 |
@Override
public Object execute(ExecutionEvent event) {
final TranspositionWizard wizard = new TranspositionWizard();
final WizardDialog dialog = new WizardDialog(getActiveWorkbenchWindow().getShell(), wizard);
dialog.setHelpAvailable(true);
| Object function(ExecutionEvent event) { final TranspositionWizard wizard = new TranspositionWizard(); final WizardDialog dialog = new WizardDialog(getActiveWorkbenchWindow().getShell(), wizard); dialog.setHelpAvailable(true); | /**
* This methods performs the action
*/ | This methods performs the action | execute | {
"repo_name": "kevinott/crypto",
"path": "org.jcryptool.crypto.classic.transposition/src/org/jcryptool/crypto/classic/transposition/algorithm/TranspositionAlgorithmHandler.java",
"license": "epl-1.0",
"size": 5951
} | [
"org.eclipse.core.commands.ExecutionEvent",
"org.eclipse.jface.wizard.WizardDialog",
"org.jcryptool.crypto.classic.transposition.ui.TranspositionWizard"
] | import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.jface.wizard.WizardDialog; import org.jcryptool.crypto.classic.transposition.ui.TranspositionWizard; | import org.eclipse.core.commands.*; import org.eclipse.jface.wizard.*; import org.jcryptool.crypto.classic.transposition.ui.*; | [
"org.eclipse.core",
"org.eclipse.jface",
"org.jcryptool.crypto"
] | org.eclipse.core; org.eclipse.jface; org.jcryptool.crypto; | 1,587,757 |
public ServiceFuture<VpnProfileResponseInner> generatevirtualwanvpnserverconfigurationvpnprofileAsync(String resourceGroupName, String virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, final ServiceCallback<VpnProfileResponseInner> serviceCallback) {
return ServiceFuture.fromResponse(generatev... | ServiceFuture<VpnProfileResponseInner> function(String resourceGroupName, String virtualWANName, VirtualWanVpnProfileParameters vpnClientParams, final ServiceCallback<VpnProfileResponseInner> serviceCallback) { return ServiceFuture.fromResponse(generatevirtualwanvpnserverconfigurationvpnprofileWithServiceResponseAsync(... | /**
* Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group.
*
* @param resourceGroupName The resource group name.
* @param virtualWANName The name of the VirtualWAN whose associated VpnServerConfigurations is ... | Generates a unique VPN profile for P2S clients for VirtualWan and associated VpnServerConfiguration combination in the specified resource group | generatevirtualwanvpnserverconfigurationvpnprofileAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/NetworkManagementClientImpl.java",
"license": "mit",
"size": 221650
} | [
"com.microsoft.azure.management.network.v2020_03_01.VirtualWanVpnProfileParameters",
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.azure.management.network.v2020_03_01.VirtualWanVpnProfileParameters; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.azure.management.network.v2020_03_01.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,480,011 |
private List<String> getObjectsByType(String typeName) throws SQLException {
return jdbcTemplate.queryForStringList("SELECT OBJECT_NAME FROM ALL_OBJECTS WHERE OWNER = ? AND OBJECT_TYPE = ?",
name, typeName);
} | List<String> function(String typeName) throws SQLException { return jdbcTemplate.queryForStringList(STR, name, typeName); } | /**
* Get the list of database objects of this type.
*
* @param typeName The type of database objects.
* @return The list of such objects in the schema.
* @throws SQLException when the drop statements could not be generated.
*/ | Get the list of database objects of this type | getObjectsByType | {
"repo_name": "Muni10/flyway",
"path": "flyway-core/src/main/java/org/flywaydb/core/internal/dbsupport/oracle/OracleSchema.java",
"license": "apache-2.0",
"size": 22712
} | [
"java.sql.SQLException",
"java.util.List"
] | import java.sql.SQLException; import java.util.List; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 2,012,918 |
public XYItemRendererState initialise(Graphics2D g2,
Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
PlotRenderingInfo info) {
Sta... | XYItemRendererState function(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info) { State state = new State(info); state.seriesPath = new GeneralPath(); return state; } | /**
* Initialises the renderer.
* <P>
* This method will be called before the first item is rendered, giving the
* renderer an opportunity to initialise any state information it wants to
* maintain. The renderer can do nothing if it chooses.
*
* @param g2 the graphics device.... | Initialises the renderer. This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses | initialise | {
"repo_name": "integrated/jfreechart",
"path": "source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java",
"license": "lgpl-2.1",
"size": 48215
} | [
"java.awt.Graphics2D",
"java.awt.geom.GeneralPath",
"java.awt.geom.Rectangle2D",
"org.jfree.chart.plot.PlotRenderingInfo",
"org.jfree.chart.plot.XYPlot",
"org.jfree.data.xy.XYDataset"
] | import java.awt.Graphics2D; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset; | import java.awt.*; import java.awt.geom.*; import org.jfree.chart.plot.*; import org.jfree.data.xy.*; | [
"java.awt",
"org.jfree.chart",
"org.jfree.data"
] | java.awt; org.jfree.chart; org.jfree.data; | 1,067,977 |
public void setOptionsService(OptionsService optionsService) {
this.optionsService = optionsService;
}
| void function(OptionsService optionsService) { this.optionsService = optionsService; } | /**
* use this to return the "Expenditures/Expense" financial object type code from the options table this must be done by fiscal
* year, so unfortunately we have to make one call to OJB whenever one of the methods that needs this constant is called.
*
* @param optionsService
*/ | use this to return the "Expenditures/Expense" financial object type code from the options table this must be done by fiscal year, so unfortunately we have to make one call to OJB whenever one of the methods that needs this constant is called | setOptionsService | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/bc/document/service/impl/BenefitsCalculationServiceImpl.java",
"license": "agpl-3.0",
"size": 11444
} | [
"org.kuali.kfs.sys.service.OptionsService"
] | import org.kuali.kfs.sys.service.OptionsService; | import org.kuali.kfs.sys.service.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 2,829,268 |
@Override
protected void writeAuthor(final FacesContext context, final ResponseWriter w, final UIForumPost c) throws IOException {
UIComponent avatar = c.getFacet(UIForumPost.FACET_AUTHAVATAR);
UIComponent name = c.getFacet(UIForumPost.FACET_AUTHNAME);
UIComponent meta = c.getFacet(UIForumPost.FACET_POSTMETA)... | void function(final FacesContext context, final ResponseWriter w, final UIForumPost c) throws IOException { UIComponent avatar = c.getFacet(UIForumPost.FACET_AUTHAVATAR); UIComponent name = c.getFacet(UIForumPost.FACET_AUTHNAME); UIComponent meta = c.getFacet(UIForumPost.FACET_POSTMETA); if(avatar != null) { w.startEle... | /**
* Due to the nature of the theme's structure where user info is in both "user" and "body", this opens a div that is later closed by the content. It's weird.
*/ | Due to the nature of the theme's structure where user info is in both "user" and "body", this opens a div that is later closed by the content. It's weird | writeAuthor | {
"repo_name": "jesse-gallagher/Miscellany",
"path": "frostillicus.wrapbootstrap.ace_1.3/src/frostillicus/wrapbootstrap/ace1_3/renderkit/data/AceForumPostRenderer.java",
"license": "apache-2.0",
"size": 5776
} | [
"com.ibm.commons.util.StringUtil",
"com.ibm.xsp.extlib.component.data.UIForumPost",
"java.io.IOException",
"javax.faces.component.UIComponent",
"javax.faces.context.FacesContext",
"javax.faces.context.ResponseWriter"
] | import com.ibm.commons.util.StringUtil; import com.ibm.xsp.extlib.component.data.UIForumPost; import java.io.IOException; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; | import com.ibm.commons.util.*; import com.ibm.xsp.extlib.component.data.*; import java.io.*; import javax.faces.component.*; import javax.faces.context.*; | [
"com.ibm.commons",
"com.ibm.xsp",
"java.io",
"javax.faces"
] | com.ibm.commons; com.ibm.xsp; java.io; javax.faces; | 478,820 |
public int insert(String table, String key, HashMap<String,ByteIterator> values)
{
delay();
if (verbose)
{
System.out.print("INSERT "+table+" "+key+" [ ");
if (values!=null)
{
for (String k : values.keySet())
{
System.out.print(k+"="+values.get(k)+" ");
}
}
System.out.println... | int function(String table, String key, HashMap<String,ByteIterator> values) { delay(); if (verbose) { System.out.print(STR+table+" "+key+STR); if (values!=null) { for (String k : values.keySet()) { System.out.print(k+"="+values.get(k)+" "); } } System.out.println("]"); } return 0; } | /**
* Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified
* record key.
*
* @param table The name of the table
* @param key The record key of the record to insert.
* @param values A HashMap of field/value pairs to insert i... | Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key | insert | {
"repo_name": "netbear/CloudAnts",
"path": "yscb/src/com/yahoo/ycsb/BasicDB.java",
"license": "apache-2.0",
"size": 8517
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,642,669 |
@Override
public void sendHtmlMail(String from, String subject, String message, Collection<String> toAddresses) {
this.sendHtmlMail(from, subject, message, toAddresses.toArray(new String[0]));
} | void function(String from, String subject, String message, Collection<String> toAddresses) { this.sendHtmlMail(from, subject, message, toAddresses.toArray(new String[0])); } | /**
* Notify users by email of something.
*
* @param from
* @param subject
* @param message
* @param toAddresses
*/ | Notify users by email of something | sendHtmlMail | {
"repo_name": "culmat/gitblit",
"path": "src/main/java/com/gitblit/manager/NotificationManager.java",
"license": "apache-2.0",
"size": 5770
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,717,652 |
private static List<File> resolveAndArchive(FileSystem fs, Path baseArchiveDir,
Collection<File> toArchive, long start) throws IOException {
// short circuit if no files to move
if (toArchive.size() == 0) return Collections.emptyList();
if (LOG.isTraceEnabled()) LOG.trace("moving files to the archi... | static List<File> function(FileSystem fs, Path baseArchiveDir, Collection<File> toArchive, long start) throws IOException { if (toArchive.size() == 0) return Collections.emptyList(); if (LOG.isTraceEnabled()) LOG.trace(STR + baseArchiveDir); if (!fs.exists(baseArchiveDir)) { if (!fs.mkdirs(baseArchiveDir)) { throw new ... | /**
* Resolve any conflict with an existing archive file via timestamp-append
* renaming of the existing file and then archive the passed in files.
* @param fs {@link FileSystem} on which to archive the files
* @param baseArchiveDir base archive directory to store the files. If any of
* the file... | Resolve any conflict with an existing archive file via timestamp-append renaming of the existing file and then archive the passed in files | resolveAndArchive | {
"repo_name": "Guavus/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java",
"license": "apache-2.0",
"size": 26785
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Collections",
"java.util.List",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 598,442 |
public static RtNetlink decode(byte[] buffer, int start, int length)
throws DeserializationException {
checkInput(buffer, start, length, RT_NETLINK_LENGTH);
ByteBuffer bb = ByteBuffer.wrap(buffer, start, length);
short addressFamily = (short) (bb.get() & MASK);
int dstL... | static RtNetlink function(byte[] buffer, int start, int length) throws DeserializationException { checkInput(buffer, start, length, RT_NETLINK_LENGTH); ByteBuffer bb = ByteBuffer.wrap(buffer, start, length); short addressFamily = (short) (bb.get() & MASK); int dstLength = bb.get() & MASK; int srcLength = bb.get() & MAS... | /**
* Decodes an rtnetlink message from an input buffer.
*
* @param buffer input buffer
* @param start starting position the rtnetlink message
* @param length length of the message
* @return rtnetlink message
* @throws DeserializationException if an rtnetlink message could not be
... | Decodes an rtnetlink message from an input buffer | decode | {
"repo_name": "osinstom/onos",
"path": "apps/routing/fpm/app/src/main/java/org/onosproject/routing/fpm/protocol/RtNetlink.java",
"license": "apache-2.0",
"size": 7251
} | [
"java.nio.ByteBuffer",
"java.util.ArrayList",
"java.util.List",
"org.onlab.packet.DeserializationException",
"org.onlab.packet.PacketUtils"
] | import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import org.onlab.packet.DeserializationException; import org.onlab.packet.PacketUtils; | import java.nio.*; import java.util.*; import org.onlab.packet.*; | [
"java.nio",
"java.util",
"org.onlab.packet"
] | java.nio; java.util; org.onlab.packet; | 1,925,116 |
protected WebElement getColumnHidingToggle(GridElement grid, String caption) {
WebElement sidebar = getSidebar(grid);
List<WebElement> elements = sidebar.findElements(By
.className("column-hiding-toggle"));
for (WebElement e : elements) {
if (caption.equalsIgnoreC... | WebElement function(GridElement grid, String caption) { WebElement sidebar = getSidebar(grid); List<WebElement> elements = sidebar.findElements(By .className(STR)); for (WebElement e : elements) { if (caption.equalsIgnoreCase(e.getText())) { return e; } } return null; } | /**
* Returns the toggle inside the sidebar for hiding the column at the given
* index, or null if not found.
*/ | Returns the toggle inside the sidebar for hiding the column at the given index, or null if not found | getColumnHidingToggle | {
"repo_name": "jdahlstrom/vaadin.react",
"path": "uitest/src/test/java/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java",
"license": "apache-2.0",
"size": 3021
} | [
"com.vaadin.testbench.elements.GridElement",
"java.util.List",
"org.openqa.selenium.By",
"org.openqa.selenium.WebElement"
] | import com.vaadin.testbench.elements.GridElement; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; | import com.vaadin.testbench.elements.*; import java.util.*; import org.openqa.selenium.*; | [
"com.vaadin.testbench",
"java.util",
"org.openqa.selenium"
] | com.vaadin.testbench; java.util; org.openqa.selenium; | 464,401 |
public static void deleteFiles(final File... files) {
for (final File f : files) {
if (!f.delete()) {
System.err.println("Could not delete file " + f);
}
}
} | static void function(final File... files) { for (final File f : files) { if (!f.delete()) { System.err.println(STR + f); } } } | /**
* Delete a list of files, and write a warning message if one could not be deleted.
*
* @param files Files to be deleted.
*/ | Delete a list of files, and write a warning message if one could not be deleted | deleteFiles | {
"repo_name": "xubo245/CloudSW",
"path": "src/main/java/htsjdk/samtools/util/IOUtil.java",
"license": "gpl-2.0",
"size": 35992
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,869,258 |
public static FunctionIdentifier findInternalCoreAggregateFunction(FunctionSignature fs) {
String internalName = getInternalCoreAggregateFunctionName(fs);
if (internalName == null) {
return null;
}
FunctionIdentifier fi = new FunctionIdentifier(FunctionConstants.ASTERIX_N... | static FunctionIdentifier function(FunctionSignature fs) { String internalName = getInternalCoreAggregateFunctionName(fs); if (internalName == null) { return null; } FunctionIdentifier fi = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, internalName, fs.getArity()); IFunctionInfo finfo = FunctionUtil.getFunctionI... | /**
* Returns a function identifier of an internal core aggregate function
* that this SQL++ core aggregate function maps to.
* Returns {@code null} if given function is not a SQL++ core aggregate function
*
* @param fs the function signature.
*/ | Returns a function identifier of an internal core aggregate function that this SQL++ core aggregate function maps to. Returns null if given function is not a SQL++ core aggregate function | findInternalCoreAggregateFunction | {
"repo_name": "apache/incubator-asterixdb",
"path": "asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/util/FunctionMapUtil.java",
"license": "apache-2.0",
"size": 9264
} | [
"org.apache.asterix.common.functions.FunctionConstants",
"org.apache.asterix.common.functions.FunctionSignature",
"org.apache.asterix.lang.common.util.FunctionUtil",
"org.apache.asterix.om.functions.BuiltinFunctions",
"org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier",
"org.apache.h... | import org.apache.asterix.common.functions.FunctionConstants; import org.apache.asterix.common.functions.FunctionSignature; import org.apache.asterix.lang.common.util.FunctionUtil; import org.apache.asterix.om.functions.BuiltinFunctions; import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier; im... | import org.apache.asterix.common.functions.*; import org.apache.asterix.lang.common.util.*; import org.apache.asterix.om.functions.*; import org.apache.hyracks.algebricks.core.algebra.functions.*; | [
"org.apache.asterix",
"org.apache.hyracks"
] | org.apache.asterix; org.apache.hyracks; | 1,760,617 |
public void stopStream() {
if (streaming) {
streaming = false;
stopStreamRtp();
}
if (!recordController.isRecording()) {
onPreview = !isBackground;
if (audioInitialized) microphoneManager.stop();
if (glInterface != null) {
glInterface.removeMediaCodecSurface();
... | void function() { if (streaming) { streaming = false; stopStreamRtp(); } if (!recordController.isRecording()) { onPreview = !isBackground; if (audioInitialized) microphoneManager.stop(); if (glInterface != null) { glInterface.removeMediaCodecSurface(); if (glInterface instanceof OffScreenGlThread) { glInterface.stop();... | /**
* Stop stream started with @startStream.
*/ | Stop stream started with @startStream | stopStream | {
"repo_name": "pedroSG94/rtmp-streamer-java",
"path": "rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera2Base.java",
"license": "apache-2.0",
"size": 30857
} | [
"com.pedro.rtplibrary.view.OffScreenGlThread"
] | import com.pedro.rtplibrary.view.OffScreenGlThread; | import com.pedro.rtplibrary.view.*; | [
"com.pedro.rtplibrary"
] | com.pedro.rtplibrary; | 2,122,975 |
public void addPremadeTemplate(String templateName) throws Exception {
URL testDataResource = getClass().getResource(TESTDATA_DIRECTORY);
// If we're running this test in IJ, then this path doesn't exist. Fall back to one that does
if (testDataResource != null && testDataResource.getPath().contains(".jar"... | void function(String templateName) throws Exception { URL testDataResource = getClass().getResource(TESTDATA_DIRECTORY); if (testDataResource != null && testDataResource.getPath().contains(".jar")) { this.addTemplateToWorkspace(testDataResource, templateName); } else { Path templatePath = FileSystems.getDefault() .getP... | /**
* Copies the template directory of a premade template, contained in endtoend/testdata, stripping
* the suffix from files with suffix .fixture, and not copying files with suffix .expected
*/ | Copies the template directory of a premade template, contained in endtoend/testdata, stripping the suffix from files with suffix .fixture, and not copying files with suffix .expected | addPremadeTemplate | {
"repo_name": "clonetwin26/buck",
"path": "test/com/facebook/buck/testutil/endtoend/EndToEndWorkspace.java",
"license": "apache-2.0",
"size": 12687
} | [
"java.nio.file.FileSystems",
"java.nio.file.Path"
] | import java.nio.file.FileSystems; import java.nio.file.Path; | import java.nio.file.*; | [
"java.nio"
] | java.nio; | 1,203,269 |
public IVec[] intersectPlane(IVecI planeDir, IVecI planePt, int segmentResolution){
ArrayList<IVec> itxns = new ArrayList<IVec>();
if(deg()>1){
IVec prevPt = pt(u(0,0.0));
double prevDot = prevPt.dif(planePt).dot(planeDir);
if(prevDot==0) itxns.add(prevPt);
for(int i=0; i<epNum(); i++){
int ... | IVec[] function(IVecI planeDir, IVecI planePt, int segmentResolution){ ArrayList<IVec> itxns = new ArrayList<IVec>(); if(deg()>1){ IVec prevPt = pt(u(0,0.0)); double prevDot = prevPt.dif(planePt).dot(planeDir); if(prevDot==0) itxns.add(prevPt); for(int i=0; i<epNum(); i++){ int j=0; if(i==0) j=1; for(;j<segmentResoluti... | /** intersection of curve and plane.
@param segmentResolution segmentation resolution per EP count in degree >= 1 curve. */ | intersection of curve and plane | intersectPlane | {
"repo_name": "sghr/iGeo",
"path": "ICurveGeo.java",
"license": "lgpl-3.0",
"size": 44873
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,856,750 |
public int getSubFolderCount()
throws IOException, PSTException
{
this.initSubfoldersTable();
if (this.subfoldersTable != null)
return this.subfoldersTable.getRowCount();
else
return 0;
}
| int function() throws IOException, PSTException { this.initSubfoldersTable(); if (this.subfoldersTable != null) return this.subfoldersTable.getRowCount(); else return 0; } | /**
* the number of child folders in this folder
* @return number of subfolders as counted
* @throws IOException
* @throws PSTException
*/ | the number of child folders in this folder | getSubFolderCount | {
"repo_name": "casimirenslip/java-libpst",
"path": "com/pff/objects/PSTFolder.java",
"license": "apache-2.0",
"size": 13704
} | [
"com.pff.exceptions.PSTException",
"java.io.IOException"
] | import com.pff.exceptions.PSTException; import java.io.IOException; | import com.pff.exceptions.*; import java.io.*; | [
"com.pff.exceptions",
"java.io"
] | com.pff.exceptions; java.io; | 1,061,061 |
public ITreeNode<IArea> getNext( )
{
initParent( );
if ( parent == null )
{
return null;
}
IArea next = getChildValue( parent.getValue( ), index + 1 );
if ( next != null )
{
return new AreaTreeNode( parent, index + 1, next );
}
return null;
} | ITreeNode<IArea> function( ) { initParent( ); if ( parent == null ) { return null; } IArea next = getChildValue( parent.getValue( ), index + 1 ); if ( next != null ) { return new AreaTreeNode( parent, index + 1, next ); } return null; } | /**
* get the next sibling of current node.
*
* @return
*/ | get the next sibling of current node | getNext | {
"repo_name": "sguan-actuate/birt",
"path": "engine/org.eclipse.birt.report.engine.emitter.pptx/src/org/eclipse/birt/report/engine/emitter/pptx/TableVisitor.java",
"license": "epl-1.0",
"size": 4024
} | [
"org.eclipse.birt.report.engine.nLayout.area.IArea"
] | import org.eclipse.birt.report.engine.nLayout.area.IArea; | import org.eclipse.birt.report.engine.*; | [
"org.eclipse.birt"
] | org.eclipse.birt; | 1,222,426 |
public static Set<ReferenceDescriptor> mergeReferences(ClassDescriptor original,
ClassDescriptor merge) throws ModelMergerException {
Set<ReferenceDescriptor> newSet = new HashSet<ReferenceDescriptor>();
newSet.addAll(cloneReferenceDescriptors(original.getReferenceDescriptors()));
... | static Set<ReferenceDescriptor> function(ClassDescriptor original, ClassDescriptor merge) throws ModelMergerException { Set<ReferenceDescriptor> newSet = new HashSet<ReferenceDescriptor>(); newSet.addAll(cloneReferenceDescriptors(original.getReferenceDescriptors())); for (ReferenceDescriptor merg : merge.getReferenceDe... | /**
* Merge the references of a target model class descriptor <code>original</code> with
* the references present in class descriptor <code>merge</code>. Returns a new set of
* ReferenceDescriptors.
*
* @param original the target model class descriptor
* @param merge the additions
* @... | Merge the references of a target model class descriptor <code>original</code> with the references present in class descriptor <code>merge</code>. Returns a new set of ReferenceDescriptors | mergeReferences | {
"repo_name": "elsiklab/intermine",
"path": "intermine/objectstore/main/src/org/intermine/modelproduction/ModelMerger.java",
"license": "lgpl-2.1",
"size": 24374
} | [
"java.util.HashSet",
"java.util.Set",
"org.apache.commons.lang.StringUtils",
"org.intermine.metadata.ClassDescriptor",
"org.intermine.metadata.ReferenceDescriptor"
] | import java.util.HashSet; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.intermine.metadata.ClassDescriptor; import org.intermine.metadata.ReferenceDescriptor; | import java.util.*; import org.apache.commons.lang.*; import org.intermine.metadata.*; | [
"java.util",
"org.apache.commons",
"org.intermine.metadata"
] | java.util; org.apache.commons; org.intermine.metadata; | 2,599,851 |
public @Nonnull ClassLoader getClassLoader() {
return classLoader;
} | @Nonnull ClassLoader function() { return classLoader; } | /**
* Application class loader.
*
* @return Application class loader.
*/ | Application class loader | getClassLoader | {
"repo_name": "jooby-project/jooby",
"path": "jooby/src/main/java/io/jooby/Environment.java",
"license": "apache-2.0",
"size": 12935
} | [
"javax.annotation.Nonnull"
] | import javax.annotation.Nonnull; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 1,692,092 |
public CacheConfiguration<K, V> setQueryEntities(Collection<QueryEntity> qryEntities) {
if (this.qryEntities == null)
this.qryEntities = new ArrayList<>(qryEntities);
else if (indexedTypes != null)
this.qryEntities.addAll(qryEntities);
else
throw new Cache... | CacheConfiguration<K, V> function(Collection<QueryEntity> qryEntities) { if (this.qryEntities == null) this.qryEntities = new ArrayList<>(qryEntities); else if (indexedTypes != null) this.qryEntities.addAll(qryEntities); else throw new CacheException(STR); return this; } | /**
* Sets query entities configuration.
*
* @param qryEntities Query entities.
* @return {@code this} for chaining.
*/ | Sets query entities configuration | setQueryEntities | {
"repo_name": "apacheignite/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java",
"license": "apache-2.0",
"size": 91348
} | [
"java.util.ArrayList",
"java.util.Collection",
"javax.cache.CacheException",
"org.apache.ignite.cache.QueryEntity"
] | import java.util.ArrayList; import java.util.Collection; import javax.cache.CacheException; import org.apache.ignite.cache.QueryEntity; | import java.util.*; import javax.cache.*; import org.apache.ignite.cache.*; | [
"java.util",
"javax.cache",
"org.apache.ignite"
] | java.util; javax.cache; org.apache.ignite; | 1,381,598 |
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName); | @ServiceMethod(returns = ReturnType.SINGLE) Mono<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName); | /**
* Retrieves the details of a vpn connection.
*
* @param resourceGroupName The resource group name of the VpnGateway.
* @param gatewayName The name of the gateway.
* @param connectionName The name of the vpn connection.
* @throws IllegalArgumentException thrown if parameters fail the va... | Retrieves the details of a vpn connection | getAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/VpnConnectionsClient.java",
"license": "mit",
"size": 38268
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.network.fluent.models.VpnConnectionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.VpnConnectionInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,513,492 |
@Override
public void runOptimization(ProblemXMLData problemData,
ComponentXMLData representationData, ComponentXMLData rankingData,
Hashtable<String, XMLFieldEntry> properties) {
// load parameters
loadparameters();
// get possible maximum fitness if possible
double maxfitness = Double.MAX_VALUE;
... | void function(ProblemXMLData problemData, ComponentXMLData representationData, ComponentXMLData rankingData, Hashtable<String, XMLFieldEntry> properties) { loadparameters(); double maxfitness = Double.MAX_VALUE; try { AbstractProblem problem = problemData.getNewProblemInstance(); if (problem instanceof AbstractSinglePr... | /**
* Runs the optimization method
*
* @param problemData
* defines the problem class and its configuration
* @param representationData
* defines the representation class and its configuration
* @param rankingData
* defines the ranking class and its configuration
* @p... | Runs the optimization method | runOptimization | {
"repo_name": "vzhikserg/FREVO",
"path": "Components/Methods/NoveltySearch/fehervari/noveltysearch/NoveltySearch.java",
"license": "gpl-3.0",
"size": 10698
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.Hashtable"
] | import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 1,635,985 |
public static List<EditLogFile> matchEditLogs(File logDir) throws IOException {
return matchEditLogs(FileUtil.listFiles(logDir));
} | static List<EditLogFile> function(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } | /**
* returns matching edit logs via the log directory. Simple helper function
* that lists the files in the logDir and calls matchEditLogs(File[])
*
* @param logDir
* directory to match edit logs in
* @return matched edit logs
* @throws IOException
* IOException thrown for i... | returns matching edit logs via the log directory. Simple helper function that lists the files in the logDir and calls matchEditLogs(File[]) | matchEditLogs | {
"repo_name": "plusplusjiajia/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java",
"license": "apache-2.0",
"size": 24718
} | [
"java.io.File",
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.fs.FileUtil"
] | import java.io.File; import java.io.IOException; import java.util.List; import org.apache.hadoop.fs.FileUtil; | import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; | [
"java.io",
"java.util",
"org.apache.hadoop"
] | java.io; java.util; org.apache.hadoop; | 2,571,901 |
public static Builder dataWriteError() {
return dataWriteError(null);
}
/**
* Wraps the passed exception inside a data write error.
* <p>The cause message will be used unless {@link Builder#message(String, Object...)} is called.
* <p>If the wrapped exception is, or wraps, a user exception it will be... | static Builder function() { return dataWriteError(null); } /** * Wraps the passed exception inside a data write error. * <p>The cause message will be used unless {@link Builder#message(String, Object...)} is called. * <p>If the wrapped exception is, or wraps, a user exception it will be returned by {@link Builder#build... | /**
* Creates a new user exception builder .
*
* @see org.apache.drill.exec.proto.UserBitShared.DrillPBError.ErrorType#DATA_WRITE
* @return user exception builder
*/ | Creates a new user exception builder | dataWriteError | {
"repo_name": "superbstreak/drill",
"path": "common/src/main/java/org/apache/drill/common/exceptions/UserException.java",
"license": "apache-2.0",
"size": 29694
} | [
"org.slf4j.Logger"
] | import org.slf4j.Logger; | import org.slf4j.*; | [
"org.slf4j"
] | org.slf4j; | 2,855,317 |
private synchronized void removeConnection(Connection c) {
connections.remove(c);
}
private class Connection implements Runnable {
private final Socket socket;
public Connection(Socket socket) {
this.socket = socket;
}
/**
* Adds ... | synchronized void function(Connection c) { connections.remove(c); } private class Connection implements Runnable { private final Socket socket; public Connection(Socket socket) { this.socket = socket; } /** * Adds a connection and sends the request's {@link Socket} | /**
* Removed a {@link Connection} from our {@link Set}.
*
* @param c the connection.
*/ | Removed a <code>Connection</code> from our <code>Set</code> | removeConnection | {
"repo_name": "argyakrivos/eos-http-server",
"path": "src/main/java/com/akrivos/eos/http/SocketConnector.java",
"license": "mit",
"size": 6558
} | [
"java.net.Socket"
] | import java.net.Socket; | import java.net.*; | [
"java.net"
] | java.net; | 1,256,552 |
public SearchSourceBuilder postFilter(Map postFilter) {
try {
XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE);
builder.map(postFilter);
return postFilter(builder);
} catch (IOException e) {
throw new ElasticsearchGenerat... | SearchSourceBuilder function(Map postFilter) { try { XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE); builder.map(postFilter); return postFilter(builder); } catch (IOException e) { throw new ElasticsearchGenerationException(STR + postFilter + "]", e); } } | /**
* Constructs a new search source builder with a query from a map.
*/ | Constructs a new search source builder with a query from a map | postFilter | {
"repo_name": "vrkansagara/elasticsearch",
"path": "src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java",
"license": "apache-2.0",
"size": 29545
} | [
"java.io.IOException",
"java.util.Map",
"org.elasticsearch.ElasticsearchGenerationException",
"org.elasticsearch.client.Requests",
"org.elasticsearch.common.xcontent.XContentBuilder",
"org.elasticsearch.common.xcontent.XContentFactory"
] | import java.io.IOException; import java.util.Map; import org.elasticsearch.ElasticsearchGenerationException; import org.elasticsearch.client.Requests; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; | import java.io.*; import java.util.*; import org.elasticsearch.*; import org.elasticsearch.client.*; import org.elasticsearch.common.xcontent.*; | [
"java.io",
"java.util",
"org.elasticsearch",
"org.elasticsearch.client",
"org.elasticsearch.common"
] | java.io; java.util; org.elasticsearch; org.elasticsearch.client; org.elasticsearch.common; | 1,823,529 |
protected synchronized void complete(final Try<V> result) {
if (!noCompletionPromises) {
completeAsyncPromise = Promise.createInternal();
completeUiPromise = Promise.createInternal();
}
if (result instanceof Try.Success) {
Try.Success<V> success = (Try.Su... | synchronized void function(final Try<V> result) { if (!noCompletionPromises) { completeAsyncPromise = Promise.createInternal(); completeUiPromise = Promise.createInternal(); } if (result instanceof Try.Success) { Try.Success<V> success = (Try.Success<V>) result; value = success.getValue(); } else if (result instanceof ... | /**
* Sends the result to the UI thread callbacks, if any.
*/ | Sends the result to the UI thread callbacks, if any | complete | {
"repo_name": "pfn/android-futures",
"path": "src/main/java/com/hanhuy/android/concurrent/Promise.java",
"license": "apache-2.0",
"size": 11709
} | [
"android.os.Looper"
] | import android.os.Looper; | import android.os.*; | [
"android.os"
] | android.os; | 1,000,911 |
private File getDataFile(int i)
{
String dataFile = (packageNames[i].indexOf('.') != -1) ? packageNames[i] : packageNames[i] + ".xml";
File file = new File(dataFile);
return file;
}
| File function(int i) { String dataFile = (packageNames[i].indexOf('.') != -1) ? packageNames[i] : packageNames[i] + ".xml"; File file = new File(dataFile); return file; } | /**
* Get the xml import file
*
* @return the package file
*/ | Get the xml import file | getDataFile | {
"repo_name": "Alfresco/alfresco-repository",
"path": "src/main/java/org/alfresco/tools/Import.java",
"license": "lgpl-3.0",
"size": 18692
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,802,656 |
private synchronized void fillRequirementArrays() {
int numChildren = target.getComponentCount();
if (horRequirements == null || horRequirements.length != numChildren) {
horRequirements = new SizeRequirements[numChildren];
vertRequirements = new SizeRequirements[numChildren];... | synchronized void function() { int numChildren = target.getComponentCount(); if (horRequirements == null horRequirements.length != numChildren) { horRequirements = new SizeRequirements[numChildren]; vertRequirements = new SizeRequirements[numChildren]; for (int iChild = 0; iChild < numChildren; iChild++) { horRequireme... | /**
* fills arrays with target's subcomponents data
* required in futher calculations
*/ | fills arrays with target's subcomponents data required in futher calculations | fillRequirementArrays | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/swing/src/main/java/common/javax/swing/LayoutParameters.java",
"license": "apache-2.0",
"size": 8826
} | [
"java.awt.Component",
"java.awt.Dimension"
] | import java.awt.Component; import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,469,830 |
public static String checkPath(String path) {
if (!path.endsWith(FileUtils.SEPARATOR_STRING)) {
path += FileUtils.SEPARATOR_STRING; // local modification
}
return path;
} | static String function(String path) { if (!path.endsWith(FileUtils.SEPARATOR_STRING)) { path += FileUtils.SEPARATOR_STRING; } return path; } | /**
* Checks the given path.
*
* @param path the path to be checked
* @return a modified path if required
*/ | Checks the given path | checkPath | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/EASy-Producer/de.uni_hildesheim.sse.EASy-Producer.persistence/src/net/ssehub/easy/producer/core/persistence/Configuration.java",
"license": "apache-2.0",
"size": 13364
} | [
"net.ssehub.easy.producer.core.persistence.internal.util.FileUtils"
] | import net.ssehub.easy.producer.core.persistence.internal.util.FileUtils; | import net.ssehub.easy.producer.core.persistence.internal.util.*; | [
"net.ssehub.easy"
] | net.ssehub.easy; | 1,384,425 |
public void failOnInsert(
Map<TableRow, List<TableDataInsertAllResponse.InsertErrors>> insertErrors) {
synchronized (tables) {
for (Map.Entry<TableRow, List<TableDataInsertAllResponse.InsertErrors>> entry :
insertErrors.entrySet()) {
List<String> errorStrings = Lists.newArrayList();
... | void function( Map<TableRow, List<TableDataInsertAllResponse.InsertErrors>> insertErrors) { synchronized (tables) { for (Map.Entry<TableRow, List<TableDataInsertAllResponse.InsertErrors>> entry : insertErrors.entrySet()) { List<String> errorStrings = Lists.newArrayList(); for (TableDataInsertAllResponse.InsertErrors er... | /**
* Cause a given {@link TableRow} object to fail when it's inserted. The errors link the list will
* be returned on subsequent retries, and the insert will succeed when the errors run out.
*/ | Cause a given <code>TableRow</code> object to fail when it's inserted. The errors link the list will be returned on subsequent retries, and the insert will succeed when the errors run out | failOnInsert | {
"repo_name": "RyanSkraba/beam",
"path": "sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/testing/FakeDatasetService.java",
"license": "apache-2.0",
"size": 13007
} | [
"com.google.api.services.bigquery.model.TableDataInsertAllResponse",
"com.google.api.services.bigquery.model.TableRow",
"java.util.List",
"java.util.Map",
"org.apache.beam.sdk.io.gcp.bigquery.BigQueryHelpers",
"org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists"
] | import com.google.api.services.bigquery.model.TableDataInsertAllResponse; import com.google.api.services.bigquery.model.TableRow; import java.util.List; import java.util.Map; import org.apache.beam.sdk.io.gcp.bigquery.BigQueryHelpers; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists; | import com.google.api.services.bigquery.model.*; import java.util.*; import org.apache.beam.sdk.io.gcp.bigquery.*; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.*; | [
"com.google.api",
"java.util",
"org.apache.beam"
] | com.google.api; java.util; org.apache.beam; | 1,496,549 |
public Executable getInstance(String keyName, ParameterStack parameters) throws IllegalAccessException, InvocationTargetException, InstantiationException
{
return (Executable) map.get(keyName).newInstance(parameters);
} | Executable function(String keyName, ParameterStack parameters) throws IllegalAccessException, InvocationTargetException, InstantiationException { return (Executable) map.get(keyName).newInstance(parameters); } | /**
* Get an instance of a keyword given the name of the keyword and the parameters
* @param keyName the name of the keyword
* @param parameters the parameters to supply to the keyword
* @return an instance of a keyword
*/ | Get an instance of a keyword given the name of the keyword and the parameters | getInstance | {
"repo_name": "chrisco210/CryspScript",
"path": "src/cf/rachlinski/cryspscript/prerun/parsing/accessors/CommandList.java",
"license": "mit",
"size": 3486
} | [
"cf.rachlinski.cryspscript.runtime.dataStructs.stack.ParameterStack",
"cf.rachlinski.cryspscript.runtime.exec.Executable",
"java.lang.reflect.InvocationTargetException"
] | import cf.rachlinski.cryspscript.runtime.dataStructs.stack.ParameterStack; import cf.rachlinski.cryspscript.runtime.exec.Executable; import java.lang.reflect.InvocationTargetException; | import cf.rachlinski.cryspscript.runtime.*; import cf.rachlinski.cryspscript.runtime.exec.*; import java.lang.reflect.*; | [
"cf.rachlinski.cryspscript",
"java.lang"
] | cf.rachlinski.cryspscript; java.lang; | 1,528,530 |
public void writeTo(final ZipArchiveOutputStream target) throws IOException {
backingStore.closeForWriting();
try (final InputStream data = backingStore.getInputStream()) {
for (final CompressedEntry compressedEntry : items) {
try (final BoundedInputStream rawStream = new... | void function(final ZipArchiveOutputStream target) throws IOException { backingStore.closeForWriting(); try (final InputStream data = backingStore.getInputStream()) { for (final CompressedEntry compressedEntry : items) { try (final BoundedInputStream rawStream = new BoundedInputStream(data, compressedEntry.compressedSi... | /**
* Write the contents of this scatter stream to a target archive.
*
* @param target The archive to receive the contents of this {@link ScatterZipOutputStream}.
* @throws IOException If writing fails
* @see #zipEntryWriter()
*/ | Write the contents of this scatter stream to a target archive | writeTo | {
"repo_name": "apache/commons-compress",
"path": "src/main/java/org/apache/commons/compress/archivers/zip/ScatterZipOutputStream.java",
"license": "apache-2.0",
"size": 9673
} | [
"java.io.Closeable",
"java.io.IOException",
"java.io.InputStream",
"java.util.Iterator",
"org.apache.commons.compress.utils.BoundedInputStream"
] | import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.util.Iterator; import org.apache.commons.compress.utils.BoundedInputStream; | import java.io.*; import java.util.*; import org.apache.commons.compress.utils.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 2,554,043 |
public void endElement(String namespaceURI,
String localName,
String qName) throws SAXException {
if (localName.equals(KEY_TAG)) {
this.itemHandler.setKey(getCurrentText());
this.rootHandler.popSubHandler();
this.root... | void function(String namespaceURI, String localName, String qName) throws SAXException { if (localName.equals(KEY_TAG)) { this.itemHandler.setKey(getCurrentText()); this.rootHandler.popSubHandler(); this.rootHandler.pushSubHandler( new ValueHandler(this.rootHandler, this.itemHandler) ); } else { throw new SAXException(... | /**
* The end of an element.
*
* @param namespaceURI the namespace.
* @param localName the element name.
* @param qName the element name.
*
* @throws SAXException for errors.
*/ | The end of an element | endElement | {
"repo_name": "djun100/afreechart",
"path": "src/org/afree/data/xml/KeyHandler.java",
"license": "lgpl-3.0",
"size": 5121
} | [
"org.xml.sax.SAXException"
] | import org.xml.sax.SAXException; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 2,618,408 |
public Element resolve(ElementMetadata<?, ?> metadata, ValidationContext vc) {
// Return immediately if the metadata is null, no resolve necessary.
if (metadata == null) {
return this;
}
Element narrowed = narrow(metadata, vc);
narrowed.validate(metadata, vc);
// Resolve all child ele... | Element function(ElementMetadata<?, ?> metadata, ValidationContext vc) { if (metadata == null) { return this; } Element narrowed = narrow(metadata, vc); narrowed.validate(metadata, vc); Iterator<Element> childIterator = narrowed.getElementIterator(); if (childIterator.hasNext()) { List<Pair<Element, Element>> replaceme... | /**
* Resolve this element's state against the metadata. Accumulates
* errors in caller's validation context.
*
* @param vc validation context
* @return the narrowed element if narrowing took place.
*/ | Resolve this element's state against the metadata. Accumulates errors in caller's validation context | resolve | {
"repo_name": "simonrrr/gdata-java-client",
"path": "java/src/com/google/gdata/model/Element.java",
"license": "apache-2.0",
"size": 47721
} | [
"com.google.common.collect.Lists",
"com.google.gdata.util.common.base.Pair",
"java.util.Iterator",
"java.util.List"
] | import com.google.common.collect.Lists; import com.google.gdata.util.common.base.Pair; import java.util.Iterator; import java.util.List; | import com.google.common.collect.*; import com.google.gdata.util.common.base.*; import java.util.*; | [
"com.google.common",
"com.google.gdata",
"java.util"
] | com.google.common; com.google.gdata; java.util; | 2,179,661 |
@SuppressWarnings("unchecked")
@Test
public void testNestedAsyncConcat() throws Throwable {
Observer<String> observer = mock(Observer.class);
final TestObservable<String> o1 = new TestObservable<String>("one", "two", "three");
final TestObservable<String> o2 = new TestObservable<Str... | @SuppressWarnings(STR) void function() throws Throwable { Observer<String> observer = mock(Observer.class); final TestObservable<String> o1 = new TestObservable<String>("one", "two", "three"); final TestObservable<String> o2 = new TestObservable<String>("four", "five", "six"); final TestObservable<String> o3 = new Test... | /**
* Test an async Observable that emits more async Observables
*/ | Test an async Observable that emits more async Observables | testNestedAsyncConcat | {
"repo_name": "jtulach/RxJava",
"path": "src/test/java/rx/internal/operators/OperatorConcatTest.java",
"license": "apache-2.0",
"size": 27700
} | [
"java.util.concurrent.CountDownLatch",
"java.util.concurrent.atomic.AtomicReference",
"org.mockito.Mockito"
] | import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; import org.mockito.Mockito; | import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.mockito.*; | [
"java.util",
"org.mockito"
] | java.util; org.mockito; | 2,298,547 |
public synchronized void close() throws IOException {
if (journalWriter == null) {
return; // already closed
}
for (Entry entry : new ArrayList<Entry>(lruEntries.values())) {
if (entry.currentEditor != null) {
entry.currentEditor.abort();
}... | synchronized void function() throws IOException { if (journalWriter == null) { return; } for (Entry entry : new ArrayList<Entry>(lruEntries.values())) { if (entry.currentEditor != null) { entry.currentEditor.abort(); } } trimToSize(); journalWriter.close(); journalWriter = null; } | /**
* Closes this cache. Stored values will remain on the filesystem.
*/ | Closes this cache. Stored values will remain on the filesystem | close | {
"repo_name": "msdgwzhy6/AndroidDemo",
"path": "app/src/main/java/com/socks/androiddemo/utils/cache/DiskLruCache.java",
"license": "apache-2.0",
"size": 33905
} | [
"java.io.IOException",
"java.util.ArrayList"
] | import java.io.IOException; import java.util.ArrayList; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 555,474 |
public CreateBucketResult createRedundantBucket(int bucketId, boolean isRebalance,
InternalDistributedMember moveSource) {
// recurse down to create each tier of children after creating leader bucket
return grabBucket(bucketId, moveSource, true, false, isRebalance, null, false);
} | CreateBucketResult function(int bucketId, boolean isRebalance, InternalDistributedMember moveSource) { return grabBucket(bucketId, moveSource, true, false, isRebalance, null, false); } | /**
* Create a new backup of the bucket, allowing redundancy to be exceeded. All colocated child
* buckets will also be created.
*
* @param bucketId the bucket to create
* @param isRebalance true if bucket creation is directed by rebalancing
* @return true if the bucket and its colocated chain of chil... | Create a new backup of the bucket, allowing redundancy to be exceeded. All colocated child buckets will also be created | createRedundantBucket | {
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java",
"license": "apache-2.0",
"size": 123871
} | [
"org.apache.geode.distributed.internal.membership.InternalDistributedMember"
] | import org.apache.geode.distributed.internal.membership.InternalDistributedMember; | import org.apache.geode.distributed.internal.membership.*; | [
"org.apache.geode"
] | org.apache.geode; | 548,276 |
public void testIsLocallyRenderableWithOnlyServersideRenderers() throws QuickFixException {
T baseComponentDef = define(baseTag, "", "Body: Has just text. Text component has a java renderer.");
assertEquals("Rendering detection logic is not on.", RenderType.AUTO, baseComponentDef.getRender());
... | void function() throws QuickFixException { T baseComponentDef = define(baseTag, STRBody: Has just text. Text component has a java renderer.STRRendering detection logic is not on.STRWhen a component has only server renderers, the component should be serverside renderable.", baseComponentDef.isLocallyRenderable()); } | /**
* isLocallyRenderable is true when component includes an interface as facet, the interface has a Javascript
* provider. Test method for {@link BaseComponentDef#isLocallyRenderable()}.
*/ | isLocallyRenderable is true when component includes an interface as facet, the interface has a Javascript provider. Test method for <code>BaseComponentDef#isLocallyRenderable()</code> | testIsLocallyRenderableWithOnlyServersideRenderers | {
"repo_name": "badlogicmanpreet/aura",
"path": "aura-impl/src/test/java/org/auraframework/impl/root/component/BaseComponentDefTest.java",
"license": "apache-2.0",
"size": 99025
} | [
"org.auraframework.throwable.quickfix.QuickFixException"
] | import org.auraframework.throwable.quickfix.QuickFixException; | import org.auraframework.throwable.quickfix.*; | [
"org.auraframework.throwable"
] | org.auraframework.throwable; | 1,618,620 |
private TableViewer createAttachmentsViewer( Composite parent ) {
TableViewer viewer = new TableViewer( parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER );
viewer.setContentProvider( ArrayContentProvider.getInstance());
viewer.setLabelProvider( new FilesLabelProvider());
... | TableViewer function( Composite parent ) { TableViewer viewer = new TableViewer( parent, SWT.MULTI SWT.H_SCROLL SWT.V_SCROLL SWT.FULL_SELECTION SWT.BORDER ); viewer.setContentProvider( ArrayContentProvider.getInstance()); viewer.setLabelProvider( new FilesLabelProvider()); TableLayout layout = new TableLayout(); layout... | /**
* Creates a viewer for message attachments.
* @param parent the parent
* @return a table viewer with the right columns
*/ | Creates a viewer for message attachments | createAttachmentsViewer | {
"repo_name": "vincent-zurczak/petals-service-client",
"path": "src/main/java/org/ow2/petals/client/swt/tabs/MessageComposite.java",
"license": "lgpl-2.1",
"size": 15560
} | [
"org.eclipse.jface.viewers.ArrayContentProvider",
"org.eclipse.jface.viewers.ColumnWeightData",
"org.eclipse.jface.viewers.TableLayout",
"org.eclipse.jface.viewers.TableViewer",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.widgets.Composite",
"org.ow2.petals.client.swt.viewers.FilesLabelProvider"... | import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.ColumnWeightData; import org.eclipse.jface.viewers.TableLayout; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.ow2.petals.client.swt.viewers... | import org.eclipse.jface.viewers.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.ow2.petals.client.swt.viewers.*; | [
"org.eclipse.jface",
"org.eclipse.swt",
"org.ow2.petals"
] | org.eclipse.jface; org.eclipse.swt; org.ow2.petals; | 2,005,976 |
public static String resourceOriginalPath(CmsObject cms, String resourceName) {
CmsProject proj = cms.getRequestContext().getCurrentProject();
try {
CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL);
String result = cms.getSitePath(resource);
... | static String function(CmsObject cms, String resourceName) { CmsProject proj = cms.getRequestContext().getCurrentProject(); try { CmsResource resource = cms.readResource(resourceName, CmsResourceFilter.ALL); String result = cms.getSitePath(resource); cms.getRequestContext().setCurrentProject(cms.readProject(CmsProject.... | /**
* Returns the original path of given resource, that is the online path for the resource.
* If it differs from the offline path, the resource has been moved.<p>
*
* @param cms the cms context
* @param resourceName a site relative resource name
*
* @return the online path, or <code>... | Returns the original path of given resource, that is the online path for the resource. If it differs from the offline path, the resource has been moved | resourceOriginalPath | {
"repo_name": "ggiudetti/opencms-core",
"path": "src-modules/org/opencms/workplace/commons/CmsUndoChanges.java",
"license": "lgpl-2.1",
"size": 19929
} | [
"org.opencms.file.CmsObject",
"org.opencms.file.CmsProject",
"org.opencms.file.CmsResource",
"org.opencms.file.CmsResourceFilter",
"org.opencms.main.CmsException"
] | import org.opencms.file.CmsObject; import org.opencms.file.CmsProject; import org.opencms.file.CmsResource; import org.opencms.file.CmsResourceFilter; import org.opencms.main.CmsException; | import org.opencms.file.*; import org.opencms.main.*; | [
"org.opencms.file",
"org.opencms.main"
] | org.opencms.file; org.opencms.main; | 2,850,836 |
public boolean isAuthorized(SecurityContext context, Request request);
| boolean function(SecurityContext context, Request request); | /**
* Checks if user is assigned a role that may perform the request.
*
* @param context security context, usually container-provided
* @param request SQL Resource request
* @return true if user is authorized (or authorization is disabled), false otherwise
*/ | Checks if user is assigned a role that may perform the request | isAuthorized | {
"repo_name": "Connexity/restsql",
"path": "src/org/restsql/security/Authorizer.java",
"license": "mit",
"size": 1316
} | [
"org.restsql.core.Request"
] | import org.restsql.core.Request; | import org.restsql.core.*; | [
"org.restsql.core"
] | org.restsql.core; | 1,747,235 |
public Builder setHttpHandlers(HttpHandler... handlers) {
return setHttpHandlers(Arrays.asList(handlers));
} | Builder function(HttpHandler... handlers) { return setHttpHandlers(Arrays.asList(handlers)); } | /**
* Add HttpHandlers that service the request.
*
* @param handlers a list of {@link HttpHandler}s to add
* @return instance of {@code Builder}.
*/ | Add HttpHandlers that service the request | setHttpHandlers | {
"repo_name": "cdapio/netty-http",
"path": "src/main/java/io/cdap/http/NettyHttpService.java",
"license": "apache-2.0",
"size": 29175
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 360,154 |
public static void join(@Nullable Thread t) throws IgniteInterruptedCheckedException {
if (t == null)
return;
try {
t.join();
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IgniteInterruptedCheckedExc... | static void function(@Nullable Thread t) throws IgniteInterruptedCheckedException { if (t == null) return; try { t.join(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IgniteInterruptedCheckedException(e); } } | /**
* Joins thread.
*
* @param t Thread.
* @throws org.apache.ignite.internal.IgniteInterruptedCheckedException Wrapped {@link InterruptedException}.
*/ | Joins thread | join | {
"repo_name": "ascherbakoff/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 385578
} | [
"org.apache.ignite.internal.IgniteInterruptedCheckedException",
"org.jetbrains.annotations.Nullable"
] | import org.apache.ignite.internal.IgniteInterruptedCheckedException; import org.jetbrains.annotations.Nullable; | import org.apache.ignite.internal.*; import org.jetbrains.annotations.*; | [
"org.apache.ignite",
"org.jetbrains.annotations"
] | org.apache.ignite; org.jetbrains.annotations; | 2,273,661 |
public static Map<String, Module> getLoadedModulesMap() {
if (loadedModules == null) {
loadedModules = new WeakHashMap<String, Module>();
}
return loadedModules;
}
| static Map<String, Module> function() { if (loadedModules == null) { loadedModules = new WeakHashMap<String, Module>(); } return loadedModules; } | /**
* Returns all modules found/loaded into the system (started and not started) in the form of a
* map<ModuleId, Module>
*
* @return map<ModuleId, Module>
*/ | Returns all modules found/loaded into the system (started and not started) in the form of a map | getLoadedModulesMap | {
"repo_name": "naraink/openmrs-core",
"path": "api/src/main/java/org/openmrs/module/ModuleFactory.java",
"license": "mpl-2.0",
"size": 56127
} | [
"java.util.Map",
"java.util.WeakHashMap"
] | import java.util.Map; import java.util.WeakHashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,322,082 |
public static void sendRanges(Enumeration<ByteRange> byteRanges, File outFile)
throws IOException {
int BUFFER_SIZE = 16384;
byte[] buffer = new byte[BUFFER_SIZE];
RandomAccessFile randAccess = null;
try {
randAccess = new RandomAccessFile(outFile, "rw");
while (byteRanges.hasMoreElemen... | static void function(Enumeration<ByteRange> byteRanges, File outFile) throws IOException { int BUFFER_SIZE = 16384; byte[] buffer = new byte[BUFFER_SIZE]; RandomAccessFile randAccess = null; try { randAccess = new RandomAccessFile(outFile, "rw"); while (byteRanges.hasMoreElements()) { ByteRange byteRange = byteRanges.n... | /**
* Inserts the data from each DataRange into the output File, at the appropriate offset
*
* @param byteRanges The Enumeration of Range/InputStream pairs parsed from the Upload's dataStream
* @param outFile The output File being assembled
* @throws IOException
*/ | Inserts the data from each DataRange into the output File, at the appropriate offset | sendRanges | {
"repo_name": "FullMetal210/milton2",
"path": "milton-client/src/main/java/io/milton/zsync/UploadReader.java",
"license": "agpl-3.0",
"size": 15433
} | [
"io.milton.http.Range",
"java.io.File",
"java.io.IOException",
"java.io.InputStream",
"java.io.RandomAccessFile",
"java.util.Enumeration"
] | import io.milton.http.Range; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile; import java.util.Enumeration; | import io.milton.http.*; import java.io.*; import java.util.*; | [
"io.milton.http",
"java.io",
"java.util"
] | io.milton.http; java.io; java.util; | 2,142,996 |
ServiceCall<Basic> getNotProvidedAsync(final ServiceCallback<Basic> serviceCallback) throws IllegalArgumentException; | ServiceCall<Basic> getNotProvidedAsync(final ServiceCallback<Basic> serviceCallback) throws IllegalArgumentException; | /**
* Get a basic complex type while the server doesn't provide a response payload.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if callback is null
* @return the {@link ServiceCall} object
*/ | Get a basic complex type while the server doesn't provide a response payload | getNotProvidedAsync | {
"repo_name": "yaqiyang/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodycomplex/Basics.java",
"license": "mit",
"size": 5824
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,564,494 |
public void flush(TableName tableName) throws IOException {
getMiniHBaseCluster().flushcache(tableName);
} | void function(TableName tableName) throws IOException { getMiniHBaseCluster().flushcache(tableName); } | /**
* Flushes all caches in the mini hbase cluster
* @throws IOException
*/ | Flushes all caches in the mini hbase cluster | flush | {
"repo_name": "StackVista/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 142672
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,238,559 |
public void removeCorruptionMarker() throws IOException {
ensureOpen();
final Directory directory = directory();
IOException firstException = null;
final String[] files = directory.listAll();
for (String file : files) {
if (file.startsWith(CORRUPTED_MARKER_NAME_PR... | void function() throws IOException { ensureOpen(); final Directory directory = directory(); IOException firstException = null; final String[] files = directory.listAll(); for (String file : files) { if (file.startsWith(CORRUPTED_MARKER_NAME_PREFIX)) { try { directory.deleteFile(file); } catch (IOException ex) { if (fir... | /**
* Deletes all corruption markers from this store.
*/ | Deletes all corruption markers from this store | removeCorruptionMarker | {
"repo_name": "EvilMcJerkface/crate",
"path": "server/src/main/java/org/elasticsearch/index/store/Store.java",
"license": "apache-2.0",
"size": 78110
} | [
"java.io.IOException",
"org.apache.lucene.store.Directory"
] | import java.io.IOException; import org.apache.lucene.store.Directory; | import java.io.*; import org.apache.lucene.store.*; | [
"java.io",
"org.apache.lucene"
] | java.io; org.apache.lucene; | 2,831,924 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.