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 boolean validateMessageHeader(BytesReference buffer) throws IOException {
final int sizeHeaderLength = TcpHeader.MARKER_BYTES_SIZE + TcpHeader.MESSAGE_LENGTH_SIZE;
if (buffer.length() < sizeHeaderLength) {
throw new IllegalStateException("message size must be >= to the head... | static boolean function(BytesReference buffer) throws IOException { final int sizeHeaderLength = TcpHeader.MARKER_BYTES_SIZE + TcpHeader.MESSAGE_LENGTH_SIZE; if (buffer.length() < sizeHeaderLength) { throw new IllegalStateException(STR); } int offset = 0; if (buffer.get(offset) != 'E' buffer.get(offset + 1) != 'S') { i... | /**
* Validates the first N bytes of the message header and returns <code>false</code> if the message is
* a ping message and has no payload ie. isn't a real user level message.
*
* @throws IllegalStateException if the message is too short, less than the header or less that the header plus the messa... | Validates the first N bytes of the message header and returns <code>false</code> if the message is a ping message and has no payload ie. isn't a real user level message | validateMessageHeader | {
"repo_name": "fforbeck/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/transport/TcpTransport.java",
"license": "apache-2.0",
"size": 76717
} | [
"java.io.IOException",
"java.io.StreamCorruptedException",
"org.elasticsearch.common.bytes.BytesReference",
"org.elasticsearch.common.io.stream.StreamInput",
"org.elasticsearch.common.unit.ByteSizeValue"
] | import java.io.IOException; import java.io.StreamCorruptedException; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.unit.ByteSizeValue; | import java.io.*; import org.elasticsearch.common.bytes.*; import org.elasticsearch.common.io.stream.*; import org.elasticsearch.common.unit.*; | [
"java.io",
"org.elasticsearch.common"
] | java.io; org.elasticsearch.common; | 1,149,038 |
private void writeSkeletonDispatchCase(IndentingWriter p, int opnum)
throws IOException
{
RemoteClass.Method method = remoteMethods[opnum];
Identifier methodName = method.getName();
Type methodType = method.getType();
Type paramTypes[] = methodType.getArgumentTypes();
... | void function(IndentingWriter p, int opnum) throws IOException { RemoteClass.Method method = remoteMethods[opnum]; Identifier methodName = method.getName(); Type methodType = method.getType(); Type paramTypes[] = methodType.getArgumentTypes(); String paramNames[] = nameParameters(paramTypes); Type returnType = methodTy... | /**
* Write the case block for the skeleton's dispatch method for
* the remote method with the given "opnum".
*/ | Write the case block for the skeleton's dispatch method for the remote method with the given "opnum" | writeSkeletonDispatchCase | {
"repo_name": "greghaskins/openjdk-jdk7u-jdk",
"path": "src/share/classes/sun/rmi/rmic/RMIGenerator.java",
"license": "gpl-2.0",
"size": 49131
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,980,158 |
@Test
@EnvTestTagsRequired(tags = {}, skipOnFlavors = {IronPythonSdkFlavor.class})
public void testNonAsciiMessage() {
runPythonTest(new PyUnitTestProcessWithConsoleTestTask("testRunner/env/unit/nonAscii", "test_test.py") { | @EnvTestTagsRequired(tags = {}, skipOnFlavors = {IronPythonSdkFlavor.class}) void function() { runPythonTest(new PyUnitTestProcessWithConsoleTestTask(STR, STR) { | /**
* check non-ascii (127+) chars are supported in skip messaged
*/ | check non-ascii (127+) chars are supported in skip messaged | testNonAsciiMessage | {
"repo_name": "ingokegel/intellij-community",
"path": "python/testSrc/com/jetbrains/env/python/testing/PythonUnitTestingTest.java",
"license": "apache-2.0",
"size": 38945
} | [
"com.jetbrains.env.EnvTestTagsRequired",
"com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor"
] | import com.jetbrains.env.EnvTestTagsRequired; import com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor; | import com.jetbrains.env.*; import com.jetbrains.python.sdk.flavors.*; | [
"com.jetbrains.env",
"com.jetbrains.python"
] | com.jetbrains.env; com.jetbrains.python; | 2,732,970 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add
(createChildParameter
(GmlPackage.eINSTANCE.getVerticalCRSType_UsesVerticalCS(),
GmlFactory.eINSTANCE.c... | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (GmlPackage.eINSTANCE.getVerticalCRSType_UsesVerticalCS(), GmlFactory.eINSTANCE.createVerticalCSRefType())); newChildDescriptors.add (create... | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "markus1978/citygml4emf",
"path": "de.hub.citygml.emf.ecore.edit/src/net/opengis/gml/provider/VerticalCRSTypeItemProvider.java",
"license": "apache-2.0",
"size": 7006
} | [
"java.util.Collection",
"net.opengis.gml.GmlFactory",
"net.opengis.gml.GmlPackage"
] | import java.util.Collection; import net.opengis.gml.GmlFactory; import net.opengis.gml.GmlPackage; | import java.util.*; import net.opengis.gml.*; | [
"java.util",
"net.opengis.gml"
] | java.util; net.opengis.gml; | 2,287,709 |
default CxfRsEndpointProducerBuilder resourceClasses(
List<Class<Object>> resourceClasses) {
doSetProperty("resourceClasses", resourceClasses);
return this;
} | default CxfRsEndpointProducerBuilder resourceClasses( List<Class<Object>> resourceClasses) { doSetProperty(STR, resourceClasses); return this; } | /**
* The resource classes which you want to export as REST service.
* Multiple classes can be separated by comma.
*
* The option is a:
* <code>java.util.List&lt;java.lang.Class&lt;java.lang.Object&gt;&gt;</code> type.
*
* Grou... | The resource classes which you want to export as REST service. Multiple classes can be separated by comma. The option is a: <code>java.util.List&lt;java.lang.Class&lt;java.lang.Object&gt;&gt;</code> type. Group: common | resourceClasses | {
"repo_name": "nikhilvibhav/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 87052
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 43,311 |
public Builder setMediaSources(boolean resetPosition, MediaSource... sources) {
return apply(new Action.SetMediaItemsResetPosition(tag, resetPosition, sources));
} | Builder function(boolean resetPosition, MediaSource... sources) { return apply(new Action.SetMediaItemsResetPosition(tag, resetPosition, sources)); } | /**
* Schedules a set media items action to be executed.
*
* @param resetPosition Whether the playback position should be reset.
* @return The builder, for convenience.
*/ | Schedules a set media items action to be executed | setMediaSources | {
"repo_name": "androidx/media",
"path": "libraries/test_utils/src/main/java/androidx/media3/test/utils/ActionSchedule.java",
"license": "apache-2.0",
"size": 27300
} | [
"androidx.media3.exoplayer.source.MediaSource"
] | import androidx.media3.exoplayer.source.MediaSource; | import androidx.media3.exoplayer.source.*; | [
"androidx.media3"
] | androidx.media3; | 1,646,117 |
@ResponseBody
@PreAuthorize("hasAuthority('" + CoreGroupPermission.TREENODE_UPDATE + "')")
@RequestMapping(value = "/{backendId}/form-value", method = { RequestMethod.POST } )
@ApiOperation(
value = "TreeNode form definition - save value",
nickname = "postTreeNodeFormValue",
tags = { IdmTreeNodeControl... | @PreAuthorize(STR + CoreGroupPermission.TREENODE_UPDATE + "')") @RequestMapping(value = STR, method = { RequestMethod.POST } ) @ApiOperation( value = STR, nickname = STR, tags = { IdmTreeNodeController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(sc... | /**
* Save entity's form value
*
* @param backendId
* @param formValues
* @return
* @since 9.4.0
*/ | Save entity's form value | saveFormValue | {
"repo_name": "bcvsolutions/CzechIdMng",
"path": "Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/rest/impl/IdmTreeNodeController.java",
"license": "mit",
"size": 32753
} | [
"eu.bcvsolutions.idm.core.api.config.swagger.SwaggerConfig",
"eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission",
"eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission",
"io.swagger.annotations.ApiOperation",
"io.swagger.annotations.Authorization",
"io.swagger.annotations.AuthorizationSc... | import eu.bcvsolutions.idm.core.api.config.swagger.SwaggerConfig; import eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission; import eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.Authorization; import io.swagger.annotation... | import eu.bcvsolutions.idm.core.api.config.swagger.*; import eu.bcvsolutions.idm.core.model.domain.*; import eu.bcvsolutions.idm.core.security.api.domain.*; import io.swagger.annotations.*; import org.springframework.security.access.prepost.*; import org.springframework.web.bind.annotation.*; | [
"eu.bcvsolutions.idm",
"io.swagger.annotations",
"org.springframework.security",
"org.springframework.web"
] | eu.bcvsolutions.idm; io.swagger.annotations; org.springframework.security; org.springframework.web; | 1,962,827 |
private static String buildSearchUrlByCode(ConnectionData connectionData, String transactionCode)
throws PagSeguroServiceException {
return connectionData.getTransactionSearchUrl() + "/" + transactionCode + "?"
+ connectionData.getCredentialsUrlQuery();
} | static String function(ConnectionData connectionData, String transactionCode) throws PagSeguroServiceException { return connectionData.getTransactionSearchUrl() + "/" + transactionCode + "?" + connectionData.getCredentialsUrlQuery(); } | /**
* Build Search Url By Code
*
* @param connectionData
* @param transactionCode
* @return
* @throws PagSeguroServiceException
*/ | Build Search Url By Code | buildSearchUrlByCode | {
"repo_name": "pagseguro/java",
"path": "source/pagseguro-api/src/br/com/uol/pagseguro/service/TransactionSearchService.java",
"license": "apache-2.0",
"size": 10862
} | [
"br.com.uol.pagseguro.exception.PagSeguroServiceException"
] | import br.com.uol.pagseguro.exception.PagSeguroServiceException; | import br.com.uol.pagseguro.exception.*; | [
"br.com.uol"
] | br.com.uol; | 1,118,532 |
public BlocksWithLocations getBlocks(DatanodeInfo datanode, long size)
throws IOException; | BlocksWithLocations function(DatanodeInfo datanode, long size) throws IOException; | /** Get a list of blocks belonged to <code>datanode</code>
* whose total size is equal to <code>size</code>
* @param datanode a data node
* @param size requested size
* @return a list of blocks & their locations
* @throws RemoteException if size is less than or equal to 0 or
... | Get a list of blocks belonged to <code>datanode</code> whose total size is equal to <code>size</code> | getBlocks | {
"repo_name": "rhli/hadoop-EAR",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/protocol/NamenodeProtocol.java",
"license": "apache-2.0",
"size": 4455
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo"
] | import java.io.IOException; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 2,642,575 |
Organization save(Organization organization); | Organization save(Organization organization); | /**
* Save a organization.
*
* @param organization the entity to save
* @return the persisted entity
*/ | Save a organization | save | {
"repo_name": "smalldatalab/omh-dsu",
"path": "ohmageomh-manage-server/src/main/java/io/smalldata/ohmageomh/service/OrganizationService.java",
"license": "apache-2.0",
"size": 1218
} | [
"io.smalldata.ohmageomh.domain.Organization"
] | import io.smalldata.ohmageomh.domain.Organization; | import io.smalldata.ohmageomh.domain.*; | [
"io.smalldata.ohmageomh"
] | io.smalldata.ohmageomh; | 949,319 |
public void dumpImage( File imageFile ) throws IOException {
this.imageFile = imageFile;
dumpToImage = true;
} | void function( File imageFile ) throws IOException { this.imageFile = imageFile; dumpToImage = true; } | /**
* Dump image to file.
*
* @param imageFile the file.
* @throws IOException if something goes wrong.
*/ | Dump image to file | dumpImage | {
"repo_name": "gabrielmancilla/mtisig",
"path": "geopaparazzilibrary/src/eu/geopaparazzi/library/sketch/DrawingSurface.java",
"license": "gpl-3.0",
"size": 6585
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 878,224 |
@SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT", justification = "Its ok in this case")
public static Result of(Iterable<BlueTestResult> results) {
long skipped = 0;
long passed = 0;
long failed = 0;
long regressions = 0;
long existingFailed... | @SuppressFBWarnings(value = STR, justification = STR) static Result function(Iterable<BlueTestResult> results) { long skipped = 0; long passed = 0; long failed = 0; long regressions = 0; long existingFailedTotal = 0; long fixedTotal = 0; long total = 0; Link parent = null; for (BlueTestResult result : results) { if(par... | /**
* Calculates a summary from the provided results
* @param results to report
* @return result
*/ | Calculates a summary from the provided results | of | {
"repo_name": "kzantow/blueocean-plugin",
"path": "blueocean-rest/src/main/java/io/jenkins/blueocean/rest/factory/BlueTestResultFactory.java",
"license": "mit",
"size": 5218
} | [
"edu.umd.cs.findbugs.annotations.SuppressFBWarnings",
"io.jenkins.blueocean.rest.hal.Link",
"io.jenkins.blueocean.rest.model.BlueTestResult",
"io.jenkins.blueocean.rest.model.BlueTestSummary"
] | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.jenkins.blueocean.rest.hal.Link; import io.jenkins.blueocean.rest.model.BlueTestResult; import io.jenkins.blueocean.rest.model.BlueTestSummary; | import edu.umd.cs.findbugs.annotations.*; import io.jenkins.blueocean.rest.hal.*; import io.jenkins.blueocean.rest.model.*; | [
"edu.umd.cs",
"io.jenkins.blueocean"
] | edu.umd.cs; io.jenkins.blueocean; | 1,297,020 |
private void handleCellSelection(CellDisplay cell, WellImageSet well,
List<DataObject> results)
{
String description = cell.getDescription();
Color c = cell.getHighlight();
WellData data = (WellData) well.getHierarchyObject();
data.setWellType(description);
well.setDescription(description);
results.a... | void function(CellDisplay cell, WellImageSet well, List<DataObject> results) { String description = cell.getDescription(); Color c = cell.getHighlight(); WellData data = (WellData) well.getHierarchyObject(); data.setWellType(description); well.setDescription(description); results.add(data); if (c == null !cell.isSpecif... | /**
* Handles the selection of a cell
*
* @param cell The selected cell.
* @param well The well to handle.
* @param results The collection of objects to update.
*/ | Handles the selection of a cell | handleCellSelection | {
"repo_name": "stelfrich/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/WellsModel.java",
"license": "gpl-2.0",
"size": 22166
} | [
"java.awt.Color",
"java.awt.Dimension",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.HashSet",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"java.util.Set",
"org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserTranslator",
"org.openmicroscopy.shoola.agents.dataBrowser.T... | import java.awt.Color; import java.awt.Dimension; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.openmicroscopy.shoola.agents.dataBrowser.DataBrowserTranslator; import org.openmicros... | import java.awt.*; import java.util.*; import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.util.ui.*; import org.openmicroscopy.shoola.util.ui.colourpicker.*; | [
"java.awt",
"java.util",
"org.openmicroscopy.shoola"
] | java.awt; java.util; org.openmicroscopy.shoola; | 1,688,795 |
@Override
public Value callMethod(Env env,
StringValue methodName, int hash,
Value a1, Value a2, Value a3, Value a4, Value a5)
{
AbstractFunction fun = _methodMap.get(methodName, hash);
return fun.callMethod(env, _quercusClass, this, a1, a2, a3, a4, a5)... | Value function(Env env, StringValue methodName, int hash, Value a1, Value a2, Value a3, Value a4, Value a5) { AbstractFunction fun = _methodMap.get(methodName, hash); return fun.callMethod(env, _quercusClass, this, a1, a2, a3, a4, a5); } | /**
* calls the function.
*/ | calls the function | callMethod | {
"repo_name": "smba/oak",
"path": "quercus/src/main/java/com/caucho/quercus/env/ObjectExtValue.java",
"license": "lgpl-3.0",
"size": 36400
} | [
"com.caucho.quercus.function.AbstractFunction"
] | import com.caucho.quercus.function.AbstractFunction; | import com.caucho.quercus.function.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 1,881,734 |
public static void setLogErrStreamFile(String path)
{
File f = new File(path);
try
{
LogErrStream = new PrintStream(new FileOutputStream(f));
}
catch (Exception e)
{
System.err.println("Failed to open '" + f.getAbsolutePath()
+ "' for writing, reverting to standard err.");
LogErrStream = S... | static void function(String path) { File f = new File(path); try { LogErrStream = new PrintStream(new FileOutputStream(f)); } catch (Exception e) { System.err.println(STR + f.getAbsolutePath() + STR); LogErrStream = System.err; } } | /**
* Redirect error stream to a file
*
* @param path
* Path to output file
*/ | Redirect error stream to a file | setLogErrStreamFile | {
"repo_name": "Progressive-Learning-Platform/PLPTool",
"path": "src/plptool/Msg.java",
"license": "gpl-3.0",
"size": 13061
} | [
"java.io.File",
"java.io.FileOutputStream",
"java.io.PrintStream"
] | import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,511,611 |
public void fireLifecycleEvent(String type, Object data) {
LifecycleEvent event = new LifecycleEvent(lifecycle, type, data);
LifecycleListener interested[] = listeners;
for (int i = 0; i < interested.length; i++)
interested[i].lifecycleEvent(event);
} | void function(String type, Object data) { LifecycleEvent event = new LifecycleEvent(lifecycle, type, data); LifecycleListener interested[] = listeners; for (int i = 0; i < interested.length; i++) interested[i].lifecycleEvent(event); } | /**
* Notify all lifecycle event listeners that a particular event has
* occurred for this Container. The default implementation performs
* this notification synchronously using the calling thread.
*
* @param type Event type
* @param data Event data
*/ | Notify all lifecycle event listeners that a particular event has occurred for this Container. The default implementation performs this notification synchronously using the calling thread | fireLifecycleEvent | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.0/LifecycleSupport.java",
"license": "mit",
"size": 4413
} | [
"org.apache.catalina.LifecycleEvent",
"org.apache.catalina.LifecycleListener"
] | import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 1,826,493 |
public void removeListener(SlideDownPrefsPanelToggleListener listener)
{
m_listeners.remove(listener);
} | void function(SlideDownPrefsPanelToggleListener listener) { m_listeners.remove(listener); } | /**
* Removes a SlideDownPrefsPanelToggleListener from the list of listeners
*
* @param listener the listener to remove
*/ | Removes a SlideDownPrefsPanelToggleListener from the list of listeners | removeListener | {
"repo_name": "spiffyui/spiffyui",
"path": "spiffyui/src/main/java/org/spiffyui/client/widgets/SlideDownPrefsPanel.java",
"license": "apache-2.0",
"size": 5967
} | [
"org.spiffyui.client.widgets.listener.SlideDownPrefsPanelToggleListener"
] | import org.spiffyui.client.widgets.listener.SlideDownPrefsPanelToggleListener; | import org.spiffyui.client.widgets.listener.*; | [
"org.spiffyui.client"
] | org.spiffyui.client; | 1,363,793 |
public Map<String, String> getProperties() {
return properties;
} | Map<String, String> function() { return properties; } | /**
* These are typically HTTP headers from the original HttpServletRequest sent by the user's
* browser.
*/ | These are typically HTTP headers from the original HttpServletRequest sent by the user's browser | getProperties | {
"repo_name": "jhelmer-unicon/uPortal",
"path": "uPortal-soffit/src/main/java/org/apereo/portal/soffit/model/v1_0/PortalRequest.java",
"license": "apache-2.0",
"size": 6080
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,087,127 |
@Test
public void testGetIdentityByPowerSearch_Login() {
String login = "pow-2-" + UUID.randomUUID().toString();
Identity id = JunitTestHelper.createAndPersistIdentityAsUser(login);
dbInstance.commitAndCloseSession();
SearchIdentityParams params = new SearchIdentityParams();
params.setLogin(login);
... | void function() { String login = STR + UUID.randomUUID().toString(); Identity id = JunitTestHelper.createAndPersistIdentityAsUser(login); dbInstance.commitAndCloseSession(); SearchIdentityParams params = new SearchIdentityParams(); params.setLogin(login); List<Identity> ids = securityManager.getIdentitiesByPowerSearch(... | /**
* Check the method @see getIdentitiesByPowerSearch
* with a login as parameter.<br/>
* getIdentitiesByPowerSearch is a dynamic generated query and we need
* to test some aspects of it.
*/ | Check the method @see getIdentitiesByPowerSearch with a login as parameter. getIdentitiesByPowerSearch is a dynamic generated query and we need to test some aspects of it | testGetIdentityByPowerSearch_Login | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/test/java/org/olat/basesecurity/BaseSecurityManagerTest.java",
"license": "apache-2.0",
"size": 45118
} | [
"java.util.List",
"java.util.UUID",
"org.junit.Assert",
"org.olat.core.id.Identity",
"org.olat.test.JunitTestHelper"
] | import java.util.List; import java.util.UUID; import org.junit.Assert; import org.olat.core.id.Identity; import org.olat.test.JunitTestHelper; | import java.util.*; import org.junit.*; import org.olat.core.id.*; import org.olat.test.*; | [
"java.util",
"org.junit",
"org.olat.core",
"org.olat.test"
] | java.util; org.junit; org.olat.core; org.olat.test; | 492,579 |
public void setActiveRuleTemplateAttributes(List<RuleTemplateAttributeBo> ruleTemplateAttributes) {
throw new UnsupportedOperationException("setActiveRuleTemplateAttributes is not implemented");
} | void function(List<RuleTemplateAttributeBo> ruleTemplateAttributes) { throw new UnsupportedOperationException(STR); } | /**
* This is implemented to allow us to use this collection on the inquiry for RuleTemplate. In the
* KNS code it does an explicit check that the property is writable.
*/ | This is implemented to allow us to use this collection on the inquiry for RuleTemplate. In the KNS code it does an explicit check that the property is writable | setActiveRuleTemplateAttributes | {
"repo_name": "bhutchinson/rice",
"path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/rule/bo/RuleTemplateBo.java",
"license": "apache-2.0",
"size": 13080
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,046,241 |
@JsonIgnore
public List<NifiProperty> getSensitiveProperties() {
return getProperties().stream()
.filter(nifiProperty -> nifiProperty.isSensitive() && (!nifiProperty.isInputProperty() || (nifiProperty.isInputProperty()
... | List<NifiProperty> function() { return getProperties().stream() .filter(nifiProperty -> nifiProperty.isSensitive() && (!nifiProperty.isInputProperty() (nifiProperty.isInputProperty() && nifiProperty.getProcessorType().equals(this.getInputProcessorType())))) .collect(Collectors.toList()); } | /**
* Return the properties for this feed that are marked as being sensitive
*/ | Return the properties for this feed that are marked as being sensitive | getSensitiveProperties | {
"repo_name": "peter-gergely-horvath/kylo",
"path": "services/feed-manager-service/feed-manager-rest-model/src/main/java/com/thinkbiganalytics/feedmgr/rest/model/FeedMetadata.java",
"license": "apache-2.0",
"size": 14442
} | [
"com.thinkbiganalytics.nifi.rest.model.NifiProperty",
"java.util.List",
"java.util.stream.Collectors"
] | import com.thinkbiganalytics.nifi.rest.model.NifiProperty; import java.util.List; import java.util.stream.Collectors; | import com.thinkbiganalytics.nifi.rest.model.*; import java.util.*; import java.util.stream.*; | [
"com.thinkbiganalytics.nifi",
"java.util"
] | com.thinkbiganalytics.nifi; java.util; | 1,872,032 |
public String getQueryFieldMappingJsString() {
String queryFieldMappingJs = "{";
for (String queryField : queryFieldMapping.keySet()) {
if (!StringUtils.equals(queryFieldMappingJs, "{")) {
queryFieldMappingJs += ",";
}
queryFieldMappingJs += "\""... | String function() { String queryFieldMappingJs = "{"; for (String queryField : queryFieldMapping.keySet()) { if (!StringUtils.equals(queryFieldMappingJs, "{")) { queryFieldMappingJs += ","; } queryFieldMappingJs += "\"STR\":\"STR\STR}"; return queryFieldMappingJs; } | /**
* Builds String for passing the queryFieldMapping Map as a Javascript object
* parameter
*
* @return String js parameter string
*/ | Builds String for passing the queryFieldMapping Map as a Javascript object parameter | getQueryFieldMappingJsString | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-kns/src/main/java/org/kuali/kfs/krad/uif/field/AttributeQuery.java",
"license": "agpl-3.0",
"size": 15331
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,487,871 |
@Test
public void configureWithCertAuthByPath() throws Exception {
KubernetesCloudPoolConfig conf = new KubernetesCloudPoolConfig(API_SERVER_URL, CERT_AUTH_BY_PATH, RC_POD_POOL,
null, null);
JsonObject config = JsonUtils.toJson(conf).getAsJsonObject();
this.cloudPool.conf... | void function() throws Exception { KubernetesCloudPoolConfig conf = new KubernetesCloudPoolConfig(API_SERVER_URL, CERT_AUTH_BY_PATH, RC_POD_POOL, null, null); JsonObject config = JsonUtils.toJson(conf).getAsJsonObject(); this.cloudPool.configure(config); assertThat(this.cloudPool.getConfiguration().get(), is(config)); ... | /**
* Set a configuration specifying client cert auth via file system paths.
*/ | Set a configuration specifying client cert auth via file system paths | configureWithCertAuthByPath | {
"repo_name": "Eeemil/scale.cloudpool",
"path": "kubernetes/src/test/java/com/elastisys/scale/cloudpool/kubernetes/TestKubernetesCloudPoolConfiguration.java",
"license": "apache-2.0",
"size": 13021
} | [
"com.elastisys.scale.cloudpool.kubernetes.config.KubernetesCloudPoolConfig",
"com.elastisys.scale.commons.json.JsonUtils",
"com.google.gson.JsonObject",
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] | import com.elastisys.scale.cloudpool.kubernetes.config.KubernetesCloudPoolConfig; import com.elastisys.scale.commons.json.JsonUtils; import com.google.gson.JsonObject; import org.hamcrest.CoreMatchers; import org.junit.Assert; | import com.elastisys.scale.cloudpool.kubernetes.config.*; import com.elastisys.scale.commons.json.*; import com.google.gson.*; import org.hamcrest.*; import org.junit.*; | [
"com.elastisys.scale",
"com.google.gson",
"org.hamcrest",
"org.junit"
] | com.elastisys.scale; com.google.gson; org.hamcrest; org.junit; | 2,212,535 |
static public boolean loadImages(Image[] images)
{
boolean value = true;
ImageLoader loaders[] = new ImageLoader[images.length];
for (int i = 0; i < images.length; i++)
{
loaders[i] = new ImageLoader(images[i]);
loaders[i].start();
}
for (int i = 0; i < images.length; i++)
... | static boolean function(Image[] images) { boolean value = true; ImageLoader loaders[] = new ImageLoader[images.length]; for (int i = 0; i < images.length; i++) { loaders[i] = new ImageLoader(images[i]); loaders[i].start(); } for (int i = 0; i < images.length; i++) value = (value && loaders[i].waitFor()); return value; ... | /**
* Synchronously loads multiple images.
* @return true if all images loaded successfully, false if any failed
*/ | Synchronously loads multiple images | loadImages | {
"repo_name": "adamrduffy/trinidad-1.0.x",
"path": "trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/painter/ImageUtils.java",
"license": "apache-2.0",
"size": 11563
} | [
"java.awt.Image"
] | import java.awt.Image; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,204,963 |
public static double regularizedBeta(double x, final double a,
final double b, double epsilon, int maxIterations) throws MathException
{
double ret;
if (Double.isNaN(x) || Double.isNaN(a) || Double.isNaN(b) || (x < 0) ||
(x > 1) || (a <= 0.0) || (b <= 0.0))
{
... | static double function(double x, final double a, final double b, double epsilon, int maxIterations) throws MathException { double ret; if (Double.isNaN(x) Double.isNaN(a) Double.isNaN(b) (x < 0) (x > 1) (a <= 0.0) (b <= 0.0)) { ret = Double.NaN; } else if (x > (a + 1.0) / (a + b + 2.0)) { ret = 1.0 - regularizedBeta(1.... | /**
* Returns the regularized beta function I(x, a, b).
*
* The implementation of this method is based on:
* <ul>
* <li>
* <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
* Regularized Beta Function</a>.</li>
* <li>
* <a href="http://functions.wolfram.c... | Returns the regularized beta function I(x, a, b). The implementation of this method is based on: Regularized Beta Function. Regularized Beta Function. | regularizedBeta | {
"repo_name": "muhd7rosli/desmoj",
"path": "org/apache/commons/math/special/Beta.java",
"license": "apache-2.0",
"size": 7405
} | [
"org.apache.commons.math.MathException",
"org.apache.commons.math.util.ContinuedFraction"
] | import org.apache.commons.math.MathException; import org.apache.commons.math.util.ContinuedFraction; | import org.apache.commons.math.*; import org.apache.commons.math.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,839,476 |
try {
CLICommand c = CLICommand.getCurrent();
if (c==null) throw new IllegalStateException("Not executing a CLI command");
String[] envs = c.channel.call(new GetCharacteristicEnvironmentVariables());
if (envs[0]==null || envs[1]==null)
throw new CmdLin... | try { CLICommand c = CLICommand.getCurrent(); if (c==null) throw new IllegalStateException(STR); String[] envs = c.channel.call(new GetCharacteristicEnvironmentVariables()); if (envs[0]==null envs[1]==null) throw new CmdLineException(STR); Job j = Hudson.getInstance().getItemByFullName(envs[0],Job.class); if (j==null) ... | /**
* This method makes sense only when called from within the build kicked by Hudson.
* We use the environment variables that Hudson sets to determine the build that is being run.
*/ | This method makes sense only when called from within the build kicked by Hudson. We use the environment variables that Hudson sets to determine the build that is being run | getCurrentlyBuilding | {
"repo_name": "cnopens/hudson",
"path": "hudson-core/src/main/java/hudson/cli/CommandDuringBuild.java",
"license": "mit",
"size": 3401
} | [
"hudson.model.Hudson",
"hudson.model.Job",
"hudson.model.Run",
"java.io.IOException",
"org.kohsuke.args4j.CmdLineException"
] | import hudson.model.Hudson; import hudson.model.Job; import hudson.model.Run; import java.io.IOException; import org.kohsuke.args4j.CmdLineException; | import hudson.model.*; import java.io.*; import org.kohsuke.args4j.*; | [
"hudson.model",
"java.io",
"org.kohsuke.args4j"
] | hudson.model; java.io; org.kohsuke.args4j; | 2,853,632 |
public void createTask(TaskModel model) throws Exception {
assert model != null;
ListClient client = getListsClient();
SPList list = client.getList(Constants.SHAREPOINT_LIST_NAME).get();
client.insertListItem(model.getListItem(), list).get();
} | void function(TaskModel model) throws Exception { assert model != null; ListClient client = getListsClient(); SPList list = client.getList(Constants.SHAREPOINT_LIST_NAME).get(); client.insertListItem(model.getListItem(), list).get(); } | /**
* Makes a blocking call to the Sharepoint API to create a new Task based on the
* model passed in argument.
*
* @param model
* @throws Exception
*/ | Makes a blocking call to the Sharepoint API to create a new Task based on the model passed in argument | createTask | {
"repo_name": "stinethebean/DevCampTraining",
"path": "06.Hook into SharePoint APIs with Android/src/o365-tasks/app/src/main/java/com/microsoft/o365_tasks/data/TaskListItemDataSource.java",
"license": "apache-2.0",
"size": 4135
} | [
"com.microsoft.o365_tasks.Constants",
"com.microsoft.sharepointservices.ListClient",
"com.microsoft.sharepointservices.SPList"
] | import com.microsoft.o365_tasks.Constants; import com.microsoft.sharepointservices.ListClient; import com.microsoft.sharepointservices.SPList; | import com.microsoft.o365_tasks.*; import com.microsoft.sharepointservices.*; | [
"com.microsoft.o365_tasks",
"com.microsoft.sharepointservices"
] | com.microsoft.o365_tasks; com.microsoft.sharepointservices; | 1,637,415 |
public static String getOsDetails()
{
StringBuffer result = new StringBuffer();
result.append("OS_NAME=").append(OS_NAME).append(NL);
if (IS_UNIX)
{
if (IS_LINUX)
{
result.append(getLinuxDistribution()).append(NL);
}
... | static String function() { StringBuffer result = new StringBuffer(); result.append(STR).append(OS_NAME).append(NL); if (IS_UNIX) { if (IS_LINUX) { result.append(getLinuxDistribution()).append(NL); } else { try { result.append(FileUtil.getFileContent(getReleaseFileName())).append(NL); } catch (IOException e) { LOGGER.lo... | /**
* returns a String which contains details of known OSs
*
* @return the details
*/ | returns a String which contains details of known OSs | getOsDetails | {
"repo_name": "codehaus/izpack",
"path": "izpack-tools/src/main/java/com/izforge/izpack/util/OsVersion.java",
"license": "apache-2.0",
"size": 10462
} | [
"java.io.IOException",
"java.util.logging.Level"
] | import java.io.IOException; import java.util.logging.Level; | import java.io.*; import java.util.logging.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,805,058 |
private void invokeBeforeLock(
NodeRef nodeRef,
LockType lockType)
{
if (!nodeService.exists(nodeRef))
{
return;
}
List<QName> classes = getInvokeClasses(nodeRef);
for (QName invokeClass : classes)
{
... | void function( NodeRef nodeRef, LockType lockType) { if (!nodeService.exists(nodeRef)) { return; } List<QName> classes = getInvokeClasses(nodeRef); for (QName invokeClass : classes) { Collection<BeforeLock> policies = beforeLock.getList(invokeClass); for (BeforeLock policy : policies) { policy.beforeLock(nodeRef, lockT... | /**
* Invoke the before log policy
*
* @param nodeRef the node to be locked
* @param lockType the lock type
*/ | Invoke the before log policy | invokeBeforeLock | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/lock/LockServiceImpl.java",
"license": "lgpl-3.0",
"size": 34732
} | [
"java.util.Collection",
"java.util.List",
"org.alfresco.repo.lock.LockServicePolicies",
"org.alfresco.service.cmr.lock.LockType",
"org.alfresco.service.cmr.repository.NodeRef",
"org.alfresco.service.namespace.QName"
] | import java.util.Collection; import java.util.List; import org.alfresco.repo.lock.LockServicePolicies; import org.alfresco.service.cmr.lock.LockType; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; | import java.util.*; import org.alfresco.repo.lock.*; import org.alfresco.service.cmr.lock.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*; | [
"java.util",
"org.alfresco.repo",
"org.alfresco.service"
] | java.util; org.alfresco.repo; org.alfresco.service; | 491,024 |
private void processNodeInputs(ValueNode node, FixedNode insertBefore, BlockT state, GraphEffectList effects) {
VirtualUtil.trace(node.getOptions(), debug, "processing nodewithstate: %s", node);
for (Node input : node.inputs()) {
if (input instanceof ValueNode) {
ValueNod... | void function(ValueNode node, FixedNode insertBefore, BlockT state, GraphEffectList effects) { VirtualUtil.trace(node.getOptions(), debug, STR, node); for (Node input : node.inputs()) { if (input instanceof ValueNode) { ValueNode alias = getAlias((ValueNode) input); if (alias instanceof VirtualObjectNode) { int id = ((... | /**
* This replaces all inputs that point to virtual or materialized values with the actual value,
* materializing if necessary. Also takes care of frame states, adding the necessary
* {@link VirtualObjectState}.
*/ | This replaces all inputs that point to virtual or materialized values with the actual value, materializing if necessary. Also takes care of frame states, adding the necessary <code>VirtualObjectState</code> | processNodeInputs | {
"repo_name": "md-5/jdk10",
"path": "src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java",
"license": "gpl-2.0",
"size": 60745
} | [
"org.graalvm.compiler.graph.Node",
"org.graalvm.compiler.nodes.FixedNode",
"org.graalvm.compiler.nodes.ValueNode",
"org.graalvm.compiler.nodes.spi.NodeWithState",
"org.graalvm.compiler.nodes.virtual.VirtualObjectNode"
] | import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.nodes.FixedNode; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.spi.NodeWithState; import org.graalvm.compiler.nodes.virtual.VirtualObjectNode; | import org.graalvm.compiler.graph.*; import org.graalvm.compiler.nodes.*; import org.graalvm.compiler.nodes.spi.*; import org.graalvm.compiler.nodes.virtual.*; | [
"org.graalvm.compiler"
] | org.graalvm.compiler; | 2,309,667 |
public int getInteger(String key) {
Integer i = getInteger(key, null);
if (i != null) {
return i.intValue();
} else {
throw new NoSuchElementException('\'' + key + "' doesn't map to an existing object");
}
}
| int function(String key) { Integer i = getInteger(key, null); if (i != null) { return i.intValue(); } else { throw new NoSuchElementException('\'' + key + STR); } } | /**
* Get a int associated with the given configuration key.
*
* @param key The configuration key.
* @return The associated int.
* @throws NoSuchElementException is thrown if the key doesn't
* map to an existing object.
* @throws ClassCastException is thrown if the key maps to ... | Get a int associated with the given configuration key | getInteger | {
"repo_name": "sabob/ratel",
"path": "ratel/src/org/apache/commons/collections/ExtendedProperties.java",
"license": "apache-2.0",
"size": 58798
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 2,517,775 |
EReference getSingleAssignment_RightValue(); | EReference getSingleAssignment_RightValue(); | /**
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.parser.epatch.epatchTestLanguage.SingleAssignment#getRightValue <em>Right Value</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Right Value</em>'.
*... | Returns the meta object for the containment reference '<code>org.eclipse.xtext.parser.epatch.epatchTestLanguage.SingleAssignment#getRightValue Right Value</code>'. | getSingleAssignment_RightValue | {
"repo_name": "miklossy/xtext-core",
"path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parser/epatch/epatchTestLanguage/EpatchTestLanguagePackage.java",
"license": "epl-1.0",
"size": 81411
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 199,370 |
public static class StartTransition
implements SingleArcTransition<DAGImpl, DAGEvent> {
@Override
public void transition(DAGImpl dag, DAGEvent event) {
DAGEventStartDag startEvent = (DAGEventStartDag) event;
DAGStartedEvent historyStartEvent = startEvent.getDagStartedEvent();
if (histor... | static class StartTransition implements SingleArcTransition<DAGImpl, DAGEvent> { public void function(DAGImpl dag, DAGEvent event) { DAGEventStartDag startEvent = (DAGEventStartDag) event; DAGStartedEvent historyStartEvent = startEvent.getDagStartedEvent(); if (historyStartEvent != null) { dag.startTime = historyStartE... | /**
* This transition executes in the event-dispatcher thread, though it's
* triggered in MRAppMaster's startJobs() method.
*/ | This transition executes in the event-dispatcher thread, though it's triggered in MRAppMaster's startJobs() method | transition | {
"repo_name": "zjffdu/tez",
"path": "tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java",
"license": "apache-2.0",
"size": 85048
} | [
"java.util.List",
"org.apache.hadoop.yarn.state.SingleArcTransition",
"org.apache.tez.dag.app.dag.event.DAGEvent",
"org.apache.tez.dag.app.dag.event.DAGEventStartDag",
"org.apache.tez.dag.history.events.DAGStartedEvent",
"org.apache.tez.dag.utils.RelocalizationUtils"
] | import java.util.List; import org.apache.hadoop.yarn.state.SingleArcTransition; import org.apache.tez.dag.app.dag.event.DAGEvent; import org.apache.tez.dag.app.dag.event.DAGEventStartDag; import org.apache.tez.dag.history.events.DAGStartedEvent; import org.apache.tez.dag.utils.RelocalizationUtils; | import java.util.*; import org.apache.hadoop.yarn.state.*; import org.apache.tez.dag.app.dag.event.*; import org.apache.tez.dag.history.events.*; import org.apache.tez.dag.utils.*; | [
"java.util",
"org.apache.hadoop",
"org.apache.tez"
] | java.util; org.apache.hadoop; org.apache.tez; | 928,379 |
public static @Nullable <T> T parse(@Nullable final BufferedSource source) {
if (source == null) return null;
final JsonReader reader = new JsonReader(source);
try {
final JsonReader.Token token = nextToken(reader);
if (token == null) return null;
switch (token) {
case BEGIN_OBJE... | static @Nullable <T> T function(@Nullable final BufferedSource source) { if (source == null) return null; final JsonReader reader = new JsonReader(source); try { final JsonReader.Token token = nextToken(reader); if (token == null) return null; switch (token) { case BEGIN_OBJECT: { try { reader.beginObject(); } catch (f... | /**
* Converts a json string to its object representation. The representation is using
* {@link java.util.Map}s for json objects and {@link java.util.List}s for json arrays.
* @param source the json string as an okio source.
* @param <T> List<?> or Map<String, ?>.
* @return the object represe... | Converts a json string to its object representation. The representation is using <code>java.util.Map</code>s for json objects and <code>java.util.List</code>s for json arrays | parse | {
"repo_name": "programingjd/okjson",
"path": "src/main/java/info/jdavid/ok/json/Parser.java",
"license": "apache-2.0",
"size": 12877
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.HashMap",
"javax.annotation.Nullable"
] | import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import javax.annotation.Nullable; | import java.io.*; import java.util.*; import javax.annotation.*; | [
"java.io",
"java.util",
"javax.annotation"
] | java.io; java.util; javax.annotation; | 2,388,692 |
public void printStackTrace(PrintWriter out) {
super.printStackTrace(out);
if (cause != null) {
synchronized (out) {
out.println("* Nested Exception (Underlying Cause) ---------------");
cause.printStackTrace(out);
}
}
} | void function(PrintWriter out) { super.printStackTrace(out); if (cause != null) { synchronized (out) { out.println(STR); cause.printStackTrace(out); } } } | /**
* <P>
* Print a stack trace to the specified writer.
* </P>
*
* <P>
* This overridden version will print the nested stack trace if available,
* otherwise it prints this exception's stack.
* </P>
*
* @param out
* the writer to which the stack traces w... | Print a stack trace to the specified writer. This overridden version will print the nested stack trace if available, otherwise it prints this exception's stack. | printStackTrace | {
"repo_name": "feigeai/opensymphony-quartz-backup",
"path": "trunk/src/java/org/quartz/SchedulerException.java",
"license": "apache-2.0",
"size": 9161
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 189,979 |
public Builder addAllPaymentMethodType(List<String> elements) {
if (this.paymentMethodTypes == null) {
this.paymentMethodTypes = new ArrayList<>();
}
this.paymentMethodTypes.addAll(elements);
return this;
} | Builder function(List<String> elements) { if (this.paymentMethodTypes == null) { this.paymentMethodTypes = new ArrayList<>(); } this.paymentMethodTypes.addAll(elements); return this; } | /**
* Add all elements to `paymentMethodTypes` list. A list is initialized for the first
* `add/addAll` call, and subsequent calls adds additional elements to the original list. See
* {@link PaymentIntentUpdateParams#paymentMethodTypes} for the field documentation.
*/ | Add all elements to `paymentMethodTypes` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See <code>PaymentIntentUpdateParams#paymentMethodTypes</code> for the field documentation | addAllPaymentMethodType | {
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/param/PaymentIntentUpdateParams.java",
"license": "mit",
"size": 323121
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 495,691 |
public static void configurePeriodicSync(Context context, int syncInterval, int flexTime) {
Account account = getSyncAccount(context);
String authority = context.getString(R.string.content_authority);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// we can enable ine... | static void function(Context context, int syncInterval, int flexTime) { Account account = getSyncAccount(context); String authority = context.getString(R.string.content_authority); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { SyncRequest request = new SyncRequest.Builder(). syncPeriodic(syncInterval, flex... | /**
* Helper method to schedule the sync adapter periodic execution
*/ | Helper method to schedule the sync adapter periodic execution | configurePeriodicSync | {
"repo_name": "OlgaKuklina/SunShine",
"path": "app/src/main/java/com/example/android/sunshine/app/sync/SunshineSyncAdapter.java",
"license": "apache-2.0",
"size": 32409
} | [
"android.accounts.Account",
"android.content.ContentResolver",
"android.content.Context",
"android.content.SyncRequest",
"android.os.Build",
"android.os.Bundle"
] | import android.accounts.Account; import android.content.ContentResolver; import android.content.Context; import android.content.SyncRequest; import android.os.Build; import android.os.Bundle; | import android.accounts.*; import android.content.*; import android.os.*; | [
"android.accounts",
"android.content",
"android.os"
] | android.accounts; android.content; android.os; | 1,203,232 |
public static void checkArgumentNotNull(Object reference) {
if (reference == null) {
throw ValidatorLogger.LOG.argumentNull();
}
} | static void function(Object reference) { if (reference == null) { throw ValidatorLogger.LOG.argumentNull(); } } | /**
* Throws {@link IllegalArgumentException} if the reference is null. This method should only be used for methods with single argument.
*
* @param reference the reference to be checked
*/ | Throws <code>IllegalArgumentException</code> if the reference is null. This method should only be used for methods with single argument | checkArgumentNotNull | {
"repo_name": "antoinesd/weld-core",
"path": "impl/src/main/java/org/jboss/weld/util/Preconditions.java",
"license": "apache-2.0",
"size": 2591
} | [
"org.jboss.weld.logging.ValidatorLogger"
] | import org.jboss.weld.logging.ValidatorLogger; | import org.jboss.weld.logging.*; | [
"org.jboss.weld"
] | org.jboss.weld; | 1,478,277 |
public static void distillAndView(
WebContents sourceWebContents, WebContents destinationWebContents) {
nativeDistillAndView(sourceWebContents, destinationWebContents);
} | static void function( WebContents sourceWebContents, WebContents destinationWebContents) { nativeDistillAndView(sourceWebContents, destinationWebContents); } | /**
* Starts distillation in the source @{link WebContents} while navigating the destination
* {@link WebContents} to view the distilled content. This does not take ownership of any
* of the WebContents.
*
* @param sourceWebContents the WebContents to distill.
* @param destinationWebConten... | Starts distillation in the source @{link WebContents} while navigating the destination <code>WebContents</code> to view the distilled content. This does not take ownership of any of the WebContents | distillAndView | {
"repo_name": "js0701/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/DomDistillerTabUtils.java",
"license": "bsd-3-clause",
"size": 2688
} | [
"org.chromium.content_public.browser.WebContents"
] | import org.chromium.content_public.browser.WebContents; | import org.chromium.content_public.browser.*; | [
"org.chromium.content_public"
] | org.chromium.content_public; | 923,288 |
@ApiModelProperty(example = "null", value = "")
public GetUniverseStargatesStargateIdPosition getPosition() {
return position;
} | @ApiModelProperty(example = "null", value = "") GetUniverseStargatesStargateIdPosition function() { return position; } | /**
* Get position
* @return position
**/ | Get position | getPosition | {
"repo_name": "Tmin10/EVE-Security-Service",
"path": "server-api/src/main/java/ru/tmin10/EVESecurityService/serverApi/model/GetUniverseStargatesStargateIdOk.java",
"license": "gpl-3.0",
"size": 5841
} | [
"io.swagger.annotations.ApiModelProperty",
"ru.tmin10.EVESecurityService"
] | import io.swagger.annotations.ApiModelProperty; import ru.tmin10.EVESecurityService; | import io.swagger.annotations.*; import ru.tmin10.*; | [
"io.swagger.annotations",
"ru.tmin10"
] | io.swagger.annotations; ru.tmin10; | 2,480,344 |
public void testPartitionedRegionProfileWithAccessor() throws Exception {
final String regionName = getTestName() + "Region";
// Create a region using off-heap
Host.getHost(0).getVM(0).invoke(new CacheSerializableRunnable("createRegionNoException") {
private static final long serialVersionUID = 1L; | void function() throws Exception { final String regionName = getTestName() + STR; Host.getHost(0).getVM(0).invoke(new CacheSerializableRunnable(STR) { private static final long serialVersionUID = 1L; | /**
* Asserts that creating a region on two members, with one being off-heap with local
* storage and the other being on-heap without local storage, will not cause an
* exception.
*/ | Asserts that creating a region on two members, with one being off-heap with local storage and the other being on-heap without local storage, will not cause an exception | testPartitionedRegionProfileWithAccessor | {
"repo_name": "papicella/snappy-store",
"path": "tests/core/src/main/java/com/gemstone/gemfire/internal/cache/DistrbutedRegionProfileOffHeapDUnitTest.java",
"license": "apache-2.0",
"size": 9310
} | [
"com.gemstone.gemfire.cache30.CacheSerializableRunnable"
] | import com.gemstone.gemfire.cache30.CacheSerializableRunnable; | import com.gemstone.gemfire.cache30.*; | [
"com.gemstone.gemfire"
] | com.gemstone.gemfire; | 2,481,942 |
public Currency getCurrency() {
return _payments[0].getCurrency();
} | Currency function() { return _payments[0].getCurrency(); } | /**
* Return the currency of the annuity.
*
* @return The currency.
*/ | Return the currency of the annuity | getCurrency | {
"repo_name": "McLeodMoores/starling",
"path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/instrument/annuity/AnnuityDefinition.java",
"license": "apache-2.0",
"size": 8774
} | [
"com.opengamma.util.money.Currency"
] | import com.opengamma.util.money.Currency; | import com.opengamma.util.money.*; | [
"com.opengamma.util"
] | com.opengamma.util; | 2,887,465 |
public static String loadResourceJson(Context context, int resource) throws IOException {
InputStream is = context.getResources().openRawResource(resource);
Writer writer = new StringWriter();
char[] buffer = new char[1024];
try {
Reader reader = new BufferedReader(new In... | static String function(Context context, int resource) throws IOException { InputStream is = context.getResources().openRawResource(resource); Writer writer = new StringWriter(); char[] buffer = new char[1024]; try { Reader reader = new BufferedReader(new InputStreamReader(is, "UTF-8")); int n; while ((n = reader.read(b... | /**
* Loads the JSON text resource with the given ID and returns the JSON content.
*/ | Loads the JSON text resource with the given ID and returns the JSON content | loadResourceJson | {
"repo_name": "javaBin/AndroiditoJZ12",
"path": "android/src/main/java/com/google/android/apps/iosched/io/JSONHandler.java",
"license": "apache-2.0",
"size": 2074
} | [
"android.content.Context",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.io.Reader",
"java.io.StringWriter",
"java.io.Writer"
] | import android.content.Context; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; import java.io.Writer; | import android.content.*; import java.io.*; | [
"android.content",
"java.io"
] | android.content; java.io; | 127,999 |
private String getStatusUrl(CMnDbBuildData build, int status) {
StringBuffer url = new StringBuffer();
url.append(statusUrl + "?");
url.append(IMnBuildForm.BUILD_ID_LABEL + "=" + build.getId());
url.append("&");
url.append(CMnBuildStatusForm.STATUS_LABEL + "=" + CMnBuildStatu... | String function(CMnDbBuildData build, int status) { StringBuffer url = new StringBuffer(); url.append(statusUrl + "?"); url.append(IMnBuildForm.BUILD_ID_LABEL + "=" + build.getId()); url.append("&"); url.append(CMnBuildStatusForm.STATUS_LABEL + "=" + CMnBuildStatusForm.statusKeys[status]); return url.toString(); } | /**
* Return the status notes URL for a specific build.
*
* @param build Build to be queried on the URL
* @param status Status to query
*
* @return Link to the build status notes
*/ | Return the status notes URL for a specific build | getStatusUrl | {
"repo_name": "ModelN/build-management",
"path": "mn-build-webapp/src/main/java/com/modeln/build/ctrl/forms/CMnReleaseListForm.java",
"license": "mit",
"size": 12688
} | [
"com.modeln.testfw.reporting.CMnDbBuildData"
] | import com.modeln.testfw.reporting.CMnDbBuildData; | import com.modeln.testfw.reporting.*; | [
"com.modeln.testfw"
] | com.modeln.testfw; | 1,041,813 |
void unpackJars( File directory, FileFilter pack200FileFilter )
throws IOException; | void unpackJars( File directory, FileFilter pack200FileFilter ) throws IOException; | /**
* UnPacks from the given {@code directory}, all files matched by the filter.
*
* @param directory the location of the directory containing files to unpack
* @param pack200FileFilter the fileter to determin which files to unpakc
* @throws IOException TODO
*/ | UnPacks from the given directory, all files matched by the filter | unpackJars | {
"repo_name": "doychin/webstart",
"path": "webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/pack200/Pack200Tool.java",
"license": "mit",
"size": 4220
} | [
"java.io.File",
"java.io.FileFilter",
"java.io.IOException"
] | import java.io.File; import java.io.FileFilter; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 593,145 |
public void logp(Level level, String sourceClass, String sourceMethod,
Supplier<String> msgSupplier) {
if (!isLoggable(level)) {
return;
}
LogRecord lr = new LogRecord(level, msgSupplier.get());
lr.setSourceClassName(sourceClass);
lr.setSource... | void function(Level level, String sourceClass, String sourceMethod, Supplier<String> msgSupplier) { if (!isLoggable(level)) { return; } LogRecord lr = new LogRecord(level, msgSupplier.get()); lr.setSourceClassName(sourceClass); lr.setSourceMethodName(sourceMethod); doLog(lr); } | /**
* Log a lazily constructed message, specifying source class and method,
* with no arguments.
* <p>
* If the logger is currently enabled for the given message
* level then the message is constructed by invoking the provided
* supplier function and forwarded to all the registered output
... | Log a lazily constructed message, specifying source class and method, with no arguments. If the logger is currently enabled for the given message level then the message is constructed by invoking the provided supplier function and forwarded to all the registered output Handler objects | logp | {
"repo_name": "34benma/openjdk",
"path": "jdk/src/java.logging/share/classes/java/util/logging/Logger.java",
"license": "gpl-2.0",
"size": 93266
} | [
"java.util.function.Supplier"
] | import java.util.function.Supplier; | import java.util.function.*; | [
"java.util"
] | java.util; | 116,842 |
void setController(Controller controller); | void setController(Controller controller); | /**
* Sets the controller.
*
* @param controller
* the new controller
*/ | Sets the controller | setController | {
"repo_name": "jspare-projects/jspare-framework",
"path": "jspare-server/src/main/java/org/jspare/server/Request.java",
"license": "apache-2.0",
"size": 3309
} | [
"org.jspare.server.controller.Controller"
] | import org.jspare.server.controller.Controller; | import org.jspare.server.controller.*; | [
"org.jspare.server"
] | org.jspare.server; | 1,779,601 |
ReceiveQueueMessageResult receiveQueueMessage(String queuePath,
ReceiveMessageOptions options) throws ServiceException; | ReceiveQueueMessageResult receiveQueueMessage(String queuePath, ReceiveMessageOptions options) throws ServiceException; | /**
* Receives a queue message using the specified receive message options.
*
* @param queuePath
* A <code>String</code> object that represents the name of the
* queue from which to receive the message.
* @param options
* A <code>ReceiveMessageOptions... | Receives a queue message using the specified receive message options | receiveQueueMessage | {
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "services/azure-servicebus/src/main/java/com/microsoft/windowsazure/services/servicebus/ServiceBusContract.java",
"license": "apache-2.0",
"size": 23765
} | [
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.services.servicebus.models.ReceiveMessageOptions",
"com.microsoft.windowsazure.services.servicebus.models.ReceiveQueueMessageResult"
] | import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.services.servicebus.models.ReceiveMessageOptions; import com.microsoft.windowsazure.services.servicebus.models.ReceiveQueueMessageResult; | import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.services.servicebus.models.*; | [
"com.microsoft.windowsazure"
] | com.microsoft.windowsazure; | 330,659 |
int getAttributeAsInteger(String paramName) throws ConfigurationException; | int getAttributeAsInteger(String paramName) throws ConfigurationException; | /**
* Return the <code>int</code> value of the specified attribute contained
* in this node.
*/ | Return the <code>int</code> value of the specified attribute contained in this node | getAttributeAsInteger | {
"repo_name": "vthriller/opensymphony-compass-backup",
"path": "src/main/src/org/compass/core/util/config/ConfigurationHelper.java",
"license": "apache-2.0",
"size": 6393
} | [
"org.compass.core.config.ConfigurationException"
] | import org.compass.core.config.ConfigurationException; | import org.compass.core.config.*; | [
"org.compass.core"
] | org.compass.core; | 1,516,842 |
public synchronized void removeNodeFromDeadNodeDetector(
DFSInputStream dfsInputStream, DatanodeInfo datanodeInfo) {
Set<DatanodeInfo> datanodeInfos = suspectAndDeadNodes.get(dfsInputStream);
if (datanodeInfos != null) {
datanodeInfos.remove(datanodeInfo);
dfsInputStream.removeFromLocalDeadN... | synchronized void function( DFSInputStream dfsInputStream, DatanodeInfo datanodeInfo) { Set<DatanodeInfo> datanodeInfos = suspectAndDeadNodes.get(dfsInputStream); if (datanodeInfos != null) { datanodeInfos.remove(datanodeInfo); dfsInputStream.removeFromLocalDeadNodes(datanodeInfo); if (datanodeInfos.isEmpty()) { suspec... | /**
* Remove suspect and dead node from suspectAndDeadNodes#dfsInputStream and
* local deadNodes.
*/ | Remove suspect and dead node from suspectAndDeadNodes#dfsInputStream and local deadNodes | removeNodeFromDeadNodeDetector | {
"repo_name": "JingchengDu/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DeadNodeDetector.java",
"license": "apache-2.0",
"size": 21278
} | [
"java.util.Set",
"org.apache.hadoop.hdfs.protocol.DatanodeInfo"
] | import java.util.Set; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; | import java.util.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 1,185,834 |
public BigFraction add(final BigInteger bg) throws NullArgumentException {
MathUtils.checkNotNull(bg);
return new BigFraction(numerator.add(denominator.multiply(bg)), denominator);
} | BigFraction function(final BigInteger bg) throws NullArgumentException { MathUtils.checkNotNull(bg); return new BigFraction(numerator.add(denominator.multiply(bg)), denominator); } | /**
* <p>
* Adds the value of this fraction to the passed {@link BigInteger},
* returning the result in reduced form.
* </p>
*
* @param bg
* the {@link BigInteger} to add, must'nt be <code>null</code>.
* @return a <code>BigFraction</code> instance with the resulting va... | Adds the value of this fraction to the passed <code>BigInteger</code>, returning the result in reduced form. | add | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_1/src/main/java/org/apache/commons/math3/fraction/BigFraction.java",
"license": "gpl-2.0",
"size": 38568
} | [
"java.math.BigInteger",
"org.apache.commons.math3.exception.NullArgumentException",
"org.apache.commons.math3.util.MathUtils"
] | import java.math.BigInteger; import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.util.MathUtils; | import java.math.*; import org.apache.commons.math3.exception.*; import org.apache.commons.math3.util.*; | [
"java.math",
"org.apache.commons"
] | java.math; org.apache.commons; | 1,217,110 |
@Deactivate
protected void deactivate(ComponentContext context) {
log.debug("******* Registry Properties UI Management bundle is deactivated ******* ");
} | void function(ComponentContext context) { log.debug(STR); } | /**
* Method to trigger when the OSGI component become inactive.
*
* @param context the component context
*/ | Method to trigger when the OSGI component become inactive | deactivate | {
"repo_name": "wso2/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.properties/src/main/java/org/wso2/carbon/registry/properties/internal/RegistryMgtUIPropertiesServiceComponent.java",
"license": "apache-2.0",
"size": 3047
} | [
"org.osgi.service.component.ComponentContext"
] | import org.osgi.service.component.ComponentContext; | import org.osgi.service.component.*; | [
"org.osgi.service"
] | org.osgi.service; | 2,412,469 |
public void eraseTargetFeedback(Request request) {
if (isActive()) {
EditPolicyIterator iter = getEditPolicyIterator();
while (iter.hasNext())
iter.next().eraseTargetFeedback(request);
}
} | void function(Request request) { if (isActive()) { EditPolicyIterator iter = getEditPolicyIterator(); while (iter.hasNext()) iter.next().eraseTargetFeedback(request); } } | /**
* Erases target feedback for the given <code>Request</code>. By default,
* this responsibility is delegated to this part's EditPolicies. Subclasses
* should rarely extend this method.
* <P>
* <table>
* <tr>
* <td><img src="../doc-files/important.gif"/>
* <td>It is recommended that feedback be handle... | Erases target feedback for the given <code>Request</code>. By default, this responsibility is delegated to this part's EditPolicies. Subclasses should rarely extend this method. It is recommended that feedback be handled by EditPolicies, and not directly by the EditPart. | eraseTargetFeedback | {
"repo_name": "ghillairet/gef-gwt",
"path": "src/main/java/org/eclipse/gef/editparts/AbstractEditPart.java",
"license": "epl-1.0",
"size": 34812
} | [
"org.eclipse.gef.Request"
] | import org.eclipse.gef.Request; | import org.eclipse.gef.*; | [
"org.eclipse.gef"
] | org.eclipse.gef; | 2,459,612 |
@Test
public void pageParameters()
{
String expectedEncrypted = "L7ExSNbPC4sb6TPJDblCAopL53TWmZP5y7BQEaJSJAC05HXod5M5U7gT2yNT0lK5L6L09ZAOoZkGyUhseyPrC4S5tqUUrV6zipc4_Ni877FDOOoE5C_Cd7YCyK1xSScpVhno6LeBz2wiu5oWyf7hB1RKcv6zkhEBmbx8vU7K7-e4xe1_LO8Y3fhEjMSQyU9BVh7Uz4HKzkR2OxFo5LaDzQ/L7E59/yPr6a/5L6ae/OxF2c";
Page... | void function() { String expectedEncrypted = STR; PageParameters expectedParameters = new PageParameters(); expectedParameters.add(STR, STR); expectedParameters.add(STR, STR); expectedParameters.set(0, STR); expectedParameters.set(1, STR); RenderPageRequestHandler renderPageRequestHandler = new RenderPageRequestHandler... | /**
* Tests that named and indexed parameters are properly (en|de)crypted
*/ | Tests that named and indexed parameters are properly (en|de)crypted | pageParameters | {
"repo_name": "dashorst/wicket",
"path": "wicket-core/src/test/java/org/apache/wicket/core/request/mapper/CryptoMapperTest.java",
"license": "apache-2.0",
"size": 24885
} | [
"org.apache.wicket.core.request.handler.PageProvider",
"org.apache.wicket.core.request.handler.RenderPageRequestHandler",
"org.apache.wicket.request.IRequestHandler",
"org.apache.wicket.request.Request",
"org.apache.wicket.request.Url",
"org.apache.wicket.request.mapper.parameter.PageParameters",
"org.h... | import org.apache.wicket.core.request.handler.PageProvider; import org.apache.wicket.core.request.handler.RenderPageRequestHandler; import org.apache.wicket.request.IRequestHandler; import org.apache.wicket.request.Request; import org.apache.wicket.request.Url; import org.apache.wicket.request.mapper.parameter.PagePara... | import org.apache.wicket.core.request.handler.*; import org.apache.wicket.request.*; import org.apache.wicket.request.mapper.parameter.*; import org.hamcrest.*; | [
"org.apache.wicket",
"org.hamcrest"
] | org.apache.wicket; org.hamcrest; | 2,267,634 |
public static boolean isPassed(@NonNull String state) {
return state.equals(STATE_PASSED);
} | static boolean function(@NonNull String state) { return state.equals(STATE_PASSED); } | /**
* Checks whether the state passed or not
*
* @param state State
* @return True, if state is passed. False otherwise
*/ | Checks whether the state passed or not | isPassed | {
"repo_name": "dkhmelenko/Varis-Android",
"path": "app/src/main/java/com/khmelenko/lab/varis/converter/BuildStateHelper.java",
"license": "apache-2.0",
"size": 3719
} | [
"android.support.annotation.NonNull"
] | import android.support.annotation.NonNull; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 1,371,320 |
private void startRefreshThread() {
refreshThreadFuture = scheduler.scheduleWithFixedDelay(refreshDevicesThread, 6, config.getRefresh(),
TimeUnit.SECONDS);
} | void function() { refreshThreadFuture = scheduler.scheduleWithFixedDelay(refreshDevicesThread, 6, config.getRefresh(), TimeUnit.SECONDS); } | /**
* Schedules the device refresh thread.
*/ | Schedules the device refresh thread | startRefreshThread | {
"repo_name": "Jamstah/openhab2-addons",
"path": "addons/binding/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java",
"license": "epl-1.0",
"size": 21929
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,202,157 |
default SearchResponse search(Map<String, Object> request, RequestOptions options) throws ElasticsearchException {
return search(request, emptyMap(), options);
} | default SearchResponse search(Map<String, Object> request, RequestOptions options) throws ElasticsearchException { return search(request, emptyMap(), options); } | /**
* Performs a search operation
* @param request the search request
* @param options the request options
* @return the search response
* @throws ElasticsearchException if there is any error executing the search
*/ | Performs a search operation | search | {
"repo_name": "craftercms/search",
"path": "crafter-search-elasticsearch/src/main/java/org/craftercms/search/elasticsearch/ElasticsearchWrapper.java",
"license": "gpl-3.0",
"size": 5278
} | [
"java.util.Collections",
"java.util.Map",
"org.craftercms.search.elasticsearch.exception.ElasticsearchException",
"org.elasticsearch.action.search.SearchResponse",
"org.elasticsearch.client.RequestOptions"
] | import java.util.Collections; import java.util.Map; import org.craftercms.search.elasticsearch.exception.ElasticsearchException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.client.RequestOptions; | import java.util.*; import org.craftercms.search.elasticsearch.exception.*; import org.elasticsearch.action.search.*; import org.elasticsearch.client.*; | [
"java.util",
"org.craftercms.search",
"org.elasticsearch.action",
"org.elasticsearch.client"
] | java.util; org.craftercms.search; org.elasticsearch.action; org.elasticsearch.client; | 1,769,559 |
GetMappingsRequestBuilder prepareGetMappings(String... indices); | GetMappingsRequestBuilder prepareGetMappings(String... indices); | /**
* Get the complete mappings of one or more types
*/ | Get the complete mappings of one or more types | prepareGetMappings | {
"repo_name": "robin13/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/client/IndicesAdminClient.java",
"license": "apache-2.0",
"size": 26479
} | [
"org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequestBuilder"
] | import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequestBuilder; | import org.elasticsearch.action.admin.indices.mapping.get.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 1,814,335 |
public GameLog vote(GameLog gameLog, String playerId, boolean vote) {
Preconditions.checkNotNull(gameLog);
Preconditions.checkNotNull(gameLog.getDraw());
Preconditions.checkNotNull(gameLog.getDraw().getUndo());
PBF pbf = pbfCollection.findOneById(gameLog.getPbfId());
Playerh... | GameLog function(GameLog gameLog, String playerId, boolean vote) { Preconditions.checkNotNull(gameLog); Preconditions.checkNotNull(gameLog.getDraw()); Preconditions.checkNotNull(gameLog.getDraw().getUndo()); PBF pbf = pbfCollection.findOneById(gameLog.getPbfId()); Playerhand playerhand = getPlayerhandByPlayerId(playerI... | /**
* Will perform vote, and if all votes are successfull, item is put back in the deck
* <p>
* A vote must have already been initiated
*
* @param gameLog
* @param playerId
* @param vote
* @return
*/ | Will perform vote, and if all votes are successfull, item is put back in the deck A vote must have already been initiated | vote | {
"repo_name": "cash1981/civilization-boardgame-rest",
"path": "src/main/java/no/asgari/civilization/server/action/UndoAction.java",
"license": "apache-2.0",
"size": 14046
} | [
"com.google.common.base.Preconditions",
"java.util.Optional",
"javax.ws.rs.WebApplicationException",
"javax.ws.rs.core.Response",
"no.asgari.civilization.server.model.GameLog",
"no.asgari.civilization.server.model.Playerhand"
] | import com.google.common.base.Preconditions; import java.util.Optional; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import no.asgari.civilization.server.model.GameLog; import no.asgari.civilization.server.model.Playerhand; | import com.google.common.base.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import no.asgari.civilization.server.model.*; | [
"com.google.common",
"java.util",
"javax.ws",
"no.asgari.civilization"
] | com.google.common; java.util; javax.ws; no.asgari.civilization; | 1,514,603 |
public PhotoList getNotInSet(int perPage, int page) throws IOException, FlickrException, JSONException {
List<Parameter> parameters = new ArrayList<Parameter>();
parameters.add(new Parameter("method", PhotosInterface.METHOD_GET_NOT_IN_SET));
parameters.add(new Parameter(OAuthInterface.PARAM_... | PhotoList function(int perPage, int page) throws IOException, FlickrException, JSONException { List<Parameter> parameters = new ArrayList<Parameter>(); parameters.add(new Parameter(STR, PhotosInterface.METHOD_GET_NOT_IN_SET)); parameters.add(new Parameter(OAuthInterface.PARAM_OAUTH_CONSUMER_KEY, apiKey)); RequestContex... | /**
* Return a collection of Photo objects not in part of any sets.
*
* This method requires authentication with 'read' permission.
*
* @param perPage The per page
* @param page The page
* @return The collection of Photo objects
* @throws IOException
* @throws FlickrExceptio... | Return a collection of Photo objects not in part of any sets. This method requires authentication with 'read' permission | getNotInSet | {
"repo_name": "0570dev/flickr-glass",
"path": "src/com/googlecode/flickrjandroid/photos/PhotosInterface.java",
"license": "apache-2.0",
"size": 57549
} | [
"com.googlecode.flickrjandroid.FlickrException",
"com.googlecode.flickrjandroid.Parameter",
"com.googlecode.flickrjandroid.RequestContext",
"com.googlecode.flickrjandroid.Response",
"com.googlecode.flickrjandroid.oauth.OAuthInterface",
"com.googlecode.flickrjandroid.oauth.OAuthUtils",
"com.googlecode.fl... | import com.googlecode.flickrjandroid.FlickrException; import com.googlecode.flickrjandroid.Parameter; import com.googlecode.flickrjandroid.RequestContext; import com.googlecode.flickrjandroid.Response; import com.googlecode.flickrjandroid.oauth.OAuthInterface; import com.googlecode.flickrjandroid.oauth.OAuthUtils; impo... | import com.googlecode.flickrjandroid.*; import com.googlecode.flickrjandroid.oauth.*; import com.googlecode.flickrjandroid.util.*; import java.io.*; import java.util.*; import org.json.*; | [
"com.googlecode.flickrjandroid",
"java.io",
"java.util",
"org.json"
] | com.googlecode.flickrjandroid; java.io; java.util; org.json; | 1,101,696 |
public void testSerialization() {
final RectangleAnchor a1 = RectangleAnchor.RIGHT;
RectangleAnchor a2 = null;
try {
final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
final ObjectOutput out = new ObjectOutputStream(buffer);
out.wr... | void function() { final RectangleAnchor a1 = RectangleAnchor.RIGHT; RectangleAnchor a2 = null; try { final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(a1); out.close(); final ObjectInput in = new ObjectInputStream(new ByteArrayInpu... | /**
* Serialize an instance, restore it, and check for identity.
*/ | Serialize an instance, restore it, and check for identity | testSerialization | {
"repo_name": "Mr-Steve/LTSpice_Library_Manager",
"path": "libs/jcommon-1.0.20/source/org/jfree/ui/junit/RectangleAnchorTests.java",
"license": "gpl-2.0",
"size": 3520
} | [
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"java.io.ObjectInput",
"java.io.ObjectInputStream",
"java.io.ObjectOutput",
"java.io.ObjectOutputStream",
"org.jfree.ui.RectangleAnchor"
] | import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import org.jfree.ui.RectangleAnchor; | import java.io.*; import org.jfree.ui.*; | [
"java.io",
"org.jfree.ui"
] | java.io; org.jfree.ui; | 2,372,873 |
private void parseTableExtraSpanRows( ContainerArea table )
{
int additionalrowheight = 0;
int additionalrowspan = 0;
boolean fistrowrun = true;
for ( int rowidx = table.getChildrenCount( ) - 1; rowidx >= 0; rowidx-- )
{
ContainerArea child = (ContainerArea) table
.getChild( rowidx );
if ( chil... | void function( ContainerArea table ) { int additionalrowheight = 0; int additionalrowspan = 0; boolean fistrowrun = true; for ( int rowidx = table.getChildrenCount( ) - 1; rowidx >= 0; rowidx-- ) { ContainerArea child = (ContainerArea) table .getChild( rowidx ); if ( child instanceof TableGroupArea ) { parseTableExtraS... | /**
* precond: TableGroupArea do not have outside merging in
* @param table
*/ | precond: TableGroupArea do not have outside merging in | parseTableExtraSpanRows | {
"repo_name": "sguan-actuate/birt",
"path": "engine/org.eclipse.birt.report.engine.emitter.pptx/src/org/eclipse/birt/report/engine/emitter/pptx/TableWriter.java",
"license": "epl-1.0",
"size": 25352
} | [
"java.util.Iterator",
"org.eclipse.birt.report.engine.nLayout.area.IArea",
"org.eclipse.birt.report.engine.nLayout.area.impl.CellArea",
"org.eclipse.birt.report.engine.nLayout.area.impl.ContainerArea",
"org.eclipse.birt.report.engine.nLayout.area.impl.RowArea",
"org.eclipse.birt.report.engine.nLayout.area... | import java.util.Iterator; import org.eclipse.birt.report.engine.nLayout.area.IArea; import org.eclipse.birt.report.engine.nLayout.area.impl.CellArea; import org.eclipse.birt.report.engine.nLayout.area.impl.ContainerArea; import org.eclipse.birt.report.engine.nLayout.area.impl.RowArea; import org.eclipse.birt.report.en... | import java.util.*; import org.eclipse.birt.report.engine.*; | [
"java.util",
"org.eclipse.birt"
] | java.util; org.eclipse.birt; | 1,080,925 |
public static void sendTextMessage
(
Session session,
String from,
String to,
String[] cc,
String[] bcc,
String subject,
String content
)
throws MessagingException {
String[] recipient = null;
if ... | static void function ( Session session, String from, String to, String[] cc, String[] bcc, String subject, String content ) throws MessagingException { String[] recipient = null; if (to != null) { recipient = new String[]{to}; } sendMessage(session, from, recipient, cc, bcc, subject, content, STR); } | /**
* This method overrides the sendTextMessage to specify
* one receiver and mulitple cc recipients.
*
* @param from e-mail address of sender
* @param to e-mail addresses of recipients
* @param subject subject of e-mail
* @param content the body of the e-mail
* @throws M... | This method overrides the sendTextMessage to specify one receiver and mulitple cc recipients | sendTextMessage | {
"repo_name": "doomdagger/CompetitionHub",
"path": "src/main/java/com/djtu/signExam/util/MailUtil.java",
"license": "gpl-2.0",
"size": 10873
} | [
"javax.mail.MessagingException",
"javax.mail.Session"
] | import javax.mail.MessagingException; import javax.mail.Session; | import javax.mail.*; | [
"javax.mail"
] | javax.mail; | 1,674,806 |
private static Class<? extends ItemBlock> getItemBlockConstructor( final Block block )
{
if( block instanceof AEBaseBlock )
{
final AEBaseBlock aeBaseBlock = (AEBaseBlock) block;
return aeBaseBlock.getItemBlockClass();
}
return ItemBlock.class;
}
/**
* Actually construct an instance of {@link It... | static Class<? extends ItemBlock> function( final Block block ) { if( block instanceof AEBaseBlock ) { final AEBaseBlock aeBaseBlock = (AEBaseBlock) block; return aeBaseBlock.getItemBlockClass(); } return ItemBlock.class; } /** * Actually construct an instance of {@link Item} with the block and earlier determined const... | /**
* Returns the constructor to use.
*
* Either {@link ItemBlock} or in case of an {@link AEBaseBlock} the class returned by
* AEBaseBlock.getItemBlockClass().
*
* @param block the block used to determine the used constructor.
*
* @return a {@link Class} extending ItemBlock
*/ | Returns the constructor to use. Either <code>ItemBlock</code> or in case of an <code>AEBaseBlock</code> the class returned by AEBaseBlock.getItemBlockClass() | getItemBlockConstructor | {
"repo_name": "itachi1706/Applied-Energistics-2",
"path": "src/main/java/appeng/core/features/BlockDefinition.java",
"license": "gpl-3.0",
"size": 5052
} | [
"net.minecraft.block.Block",
"net.minecraft.item.Item",
"net.minecraft.item.ItemBlock"
] | import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; | import net.minecraft.block.*; import net.minecraft.item.*; | [
"net.minecraft.block",
"net.minecraft.item"
] | net.minecraft.block; net.minecraft.item; | 1,048,583 |
public SecurityRuleAccess access() {
return this.access;
} | SecurityRuleAccess function() { return this.access; } | /**
* Get the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny'.
*
* @return the access value
*/ | Get the network traffic is allowed or denied. Possible values include: 'Allow', 'Deny' | access | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/SecurityRuleInner.java",
"license": "mit",
"size": 16948
} | [
"com.microsoft.azure.management.network.v2019_11_01.SecurityRuleAccess"
] | import com.microsoft.azure.management.network.v2019_11_01.SecurityRuleAccess; | import com.microsoft.azure.management.network.v2019_11_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,296,310 |
public static Collection<ArchivedJson> getArchivedJsons(Path file) throws IOException {
try (FSDataInputStream input = file.getFileSystem().open(file);
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
IOUtils.copyBytes(input, output);
JsonNode archive = mapper.readTree(output.toByteArray());... | static Collection<ArchivedJson> function(Path file) throws IOException { try (FSDataInputStream input = file.getFileSystem().open(file); ByteArrayOutputStream output = new ByteArrayOutputStream()) { IOUtils.copyBytes(input, output); JsonNode archive = mapper.readTree(output.toByteArray()); Collection<ArchivedJson> arch... | /**
* Reads the given archive file and returns a {@link Collection} of contained {@link ArchivedJson}.
*
* @param file archive to extract
* @return collection of archived jsons
* @throws IOException if the file can't be opened, read or doesn't contain valid json
*/ | Reads the given archive file and returns a <code>Collection</code> of contained <code>ArchivedJson</code> | getArchivedJsons | {
"repo_name": "mylog00/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/history/FsJobArchivist.java",
"license": "apache-2.0",
"size": 6295
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Collection",
"org.apache.flink.core.fs.FSDataInputStream",
"org.apache.flink.core.fs.Path",
"org.apache.flink.runtime.webmonitor.history.ArchivedJson",
"org.apache.flink.shaded.jackson2.com.fasterxml.jackson.data... | import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import org.apache.flink.core.fs.FSDataInputStream; import org.apache.flink.core.fs.Path; import org.apache.flink.runtime.webmonitor.history.ArchivedJson; import org.apache.flink.shaded.jackson2.com... | import java.io.*; import java.util.*; import org.apache.flink.core.fs.*; import org.apache.flink.runtime.webmonitor.history.*; import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.*; import org.apache.flink.util.*; | [
"java.io",
"java.util",
"org.apache.flink"
] | java.io; java.util; org.apache.flink; | 1,248,844 |
public static void processFilesInResourcesFolder(File jettyHome, Map<String,File> files)
{
String logbackConf = System.getProperty("logback.configurationFile");
if (logbackConf != null)
{
File confFile = new File(logbackConf);
if (confFile.exists())
{
//assume logback was... | static void function(File jettyHome, Map<String,File> files) { String logbackConf = System.getProperty(STR); if (logbackConf != null) { File confFile = new File(logbackConf); if (confFile.exists()) { return; } } File logConf = isPDEDevelopment() ? files.get(STR) : null; if (logConf == null) { logConf = files.get(STR); ... | /**
* Follow the configuration for logback.
* unless the system propery was set in which case it
* was assume it was already setup.
*/ | Follow the configuration for logback. unless the system propery was set in which case it was assume it was already setup | processFilesInResourcesFolder | {
"repo_name": "jamiepg1/jetty.project",
"path": "jetty-osgi/jetty-osgi-boot-logback/src/main/java/org/eclipse/jetty/osgi/boot/logback/internal/LogbackInitializer.java",
"license": "apache-2.0",
"size": 3380
} | [
"ch.qos.logback.classic.LoggerContext",
"ch.qos.logback.classic.joran.JoranConfigurator",
"ch.qos.logback.core.joran.JoranConfiguratorBase",
"ch.qos.logback.core.joran.spi.JoranException",
"ch.qos.logback.core.util.StatusPrinter",
"java.io.File",
"java.util.Map",
"org.slf4j.LoggerFactory"
] | import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.joran.JoranConfigurator; import ch.qos.logback.core.joran.JoranConfiguratorBase; import ch.qos.logback.core.joran.spi.JoranException; import ch.qos.logback.core.util.StatusPrinter; import java.io.File; import java.util.Map; import org.slf4j.Logg... | import ch.qos.logback.classic.*; import ch.qos.logback.classic.joran.*; import ch.qos.logback.core.joran.*; import ch.qos.logback.core.joran.spi.*; import ch.qos.logback.core.util.*; import java.io.*; import java.util.*; import org.slf4j.*; | [
"ch.qos.logback",
"java.io",
"java.util",
"org.slf4j"
] | ch.qos.logback; java.io; java.util; org.slf4j; | 2,087,435 |
Optional<List<Long>> getLongList(DataQuery path); | Optional<List<Long>> getLongList(DataQuery path); | /**
* Gets the {@link List} of {@link Long} by path, if available.
*
* <p>If a {@link List} of {@link Long} does not exist, or the data
* residing at the path is not an instance of a {@link List} of
* {@link Long}, an absent is returned.</p>
*
* @param path The path of the value to ge... | Gets the <code>List</code> of <code>Long</code> by path, if available. If a <code>List</code> of <code>Long</code> does not exist, or the data residing at the path is not an instance of a <code>List</code> of <code>Long</code>, an absent is returned | getLongList | {
"repo_name": "ryantheleach/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/data/DataView.java",
"license": "mit",
"size": 17130
} | [
"java.util.List",
"java.util.Optional"
] | import java.util.List; import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 668,074 |
public static void igniteUuidToBytes(IgniteUuid uuid, byte[] out, int off) {
assert uuid != null;
longToBytes(uuid.globalId().getMostSignificantBits(), out, off);
longToBytes(uuid.globalId().getLeastSignificantBits(), out, off + 8);
longToBytes(uuid.localId(), out, off + 16);
} | static void function(IgniteUuid uuid, byte[] out, int off) { assert uuid != null; longToBytes(uuid.globalId().getMostSignificantBits(), out, off); longToBytes(uuid.globalId().getLeastSignificantBits(), out, off + 8); longToBytes(uuid.localId(), out, off + 16); } | /**
* Converts {@link IgniteUuid} to bytes.
*
* @param uuid {@link IgniteUuid} to convert.
* @param out Output array to write to.
* @param off Offset from which to write.
*/ | Converts <code>IgniteUuid</code> to bytes | igniteUuidToBytes | {
"repo_name": "SomeFire/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 374177
} | [
"org.apache.ignite.lang.IgniteUuid"
] | import org.apache.ignite.lang.IgniteUuid; | import org.apache.ignite.lang.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 211,358 |
public static FileDecrypter create() {
return FileDecrypter.from(
new BufferedBlockCipher(new CBCBlockCipher(new AESEngine())),
new SHA1Digest());
} | static FileDecrypter function() { return FileDecrypter.from( new BufferedBlockCipher(new CBCBlockCipher(new AESEngine())), new SHA1Digest()); } | /**
* Returns a new instance.
*
* @return a new instance, not null
*/ | Returns a new instance | create | {
"repo_name": "horrorho/LiquidDonkey",
"path": "src/main/java/com/github/horrorho/liquiddonkey/cloud/file/FileDecrypter.java",
"license": "mit",
"size": 9006
} | [
"org.bouncycastle.crypto.BufferedBlockCipher",
"org.bouncycastle.crypto.digests.SHA1Digest",
"org.bouncycastle.crypto.engines.AESEngine",
"org.bouncycastle.crypto.modes.CBCBlockCipher"
] | import org.bouncycastle.crypto.BufferedBlockCipher; import org.bouncycastle.crypto.digests.SHA1Digest; import org.bouncycastle.crypto.engines.AESEngine; import org.bouncycastle.crypto.modes.CBCBlockCipher; | import org.bouncycastle.crypto.*; import org.bouncycastle.crypto.digests.*; import org.bouncycastle.crypto.engines.*; import org.bouncycastle.crypto.modes.*; | [
"org.bouncycastle.crypto"
] | org.bouncycastle.crypto; | 1,617,866 |
public double calculateMaxColWidth(int index) {
TableRowElement row = TableRowElement.as(root
.getFirstChildElement());
double maxWidth = 0;
while (row != null) {
final TableCellElement cell = row.getCells().getItem(index);
... | double function(int index) { TableRowElement row = TableRowElement.as(root .getFirstChildElement()); double maxWidth = 0; while (row != null) { final TableCellElement cell = row.getCells().getItem(index); final boolean isVisible = !cell.getStyle().getDisplay() .equals(Display.NONE.getCssName()); if (isVisible) { maxWid... | /**
* Iterates through all the cells in a column and returns the width of
* the widest element in this RowContainer.
*
* @param index
* the index of the column to inspect
* @return the pixel width of the widest element in the indicated column
*/ | Iterates through all the cells in a column and returns the width of the widest element in this RowContainer | calculateMaxColWidth | {
"repo_name": "mittop/vaadin",
"path": "client/src/com/vaadin/client/widgets/Escalator.java",
"license": "apache-2.0",
"size": 271337
} | [
"com.google.gwt.dom.client.Style",
"com.google.gwt.dom.client.TableCellElement",
"com.google.gwt.dom.client.TableRowElement",
"com.vaadin.client.WidgetUtil"
] | import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.dom.client.TableRowElement; import com.vaadin.client.WidgetUtil; | import com.google.gwt.dom.client.*; import com.vaadin.client.*; | [
"com.google.gwt",
"com.vaadin.client"
] | com.google.gwt; com.vaadin.client; | 690,616 |
@Test(expected = NullPointerException.class)
public void testCreateFailNullNumeratorDegreesOfFreedom() {
FDistribution.<Character>builder()
.denominatorDegreesOfFreedom(10.0)
.build();
} | @Test(expected = NullPointerException.class) void function() { FDistribution.<Character>builder() .denominatorDegreesOfFreedom(10.0) .build(); } | /**
* Creating with null denominator fails
*/ | Creating with null denominator fails | testCreateFailNullNumeratorDegreesOfFreedom | {
"repo_name": "JMBattista/Bioinformatics",
"path": "sequence.generator/src/test/java/com/vitreoussoftware/bioinformatics/sequence/generator/distribution/continuous/FDistributionTest.java",
"license": "mit",
"size": 1397
} | [
"org.junit.Test"
] | import org.junit.Test; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,370,797 |
protected void filterPackageRoot(final PackageRoot packageRoot) {
packageRoot.getRaw().remove("_id"); // TODO: why? Original code did this too
packageRoot.getRaw().remove("_rev"); // TODO: why? Original code did this too
for (PackageVersion packageVersion : packageRoot.getVersions().values()) {
filt... | void function(final PackageRoot packageRoot) { packageRoot.getRaw().remove("_id"); packageRoot.getRaw().remove("_rev"); for (PackageVersion packageVersion : packageRoot.getVersions().values()) { filterPackageVersion(packageVersion); } } | /**
* Removes unwanted fields from JSON document and invokes {@link #filterPackageVersion(PackageVersion)} on each
* version of the passed in package root.
*/ | Removes unwanted fields from JSON document and invokes <code>#filterPackageVersion(PackageVersion)</code> on each version of the passed in package root | filterPackageRoot | {
"repo_name": "scmod/nexus-public",
"path": "plugins/npm/nexus-npm-repository-plugin/src/main/java/com/bolyuba/nexus/plugin/npm/service/internal/GeneratorSupport.java",
"license": "epl-1.0",
"size": 8019
} | [
"com.bolyuba.nexus.plugin.npm.service.PackageRoot",
"com.bolyuba.nexus.plugin.npm.service.PackageVersion"
] | import com.bolyuba.nexus.plugin.npm.service.PackageRoot; import com.bolyuba.nexus.plugin.npm.service.PackageVersion; | import com.bolyuba.nexus.plugin.npm.service.*; | [
"com.bolyuba.nexus"
] | com.bolyuba.nexus; | 1,327,778 |
public boolean hasDuplicatedAliases() {
HashSet<String> newAliases = new HashSet<String>();
for(Alias alias : this.aliases){
if(newAliases.contains(alias.alias)){
return true;
}
newAliases.add(alias.alias);
}
return false;
}
}
| boolean function() { HashSet<String> newAliases = new HashSet<String>(); for(Alias alias : this.aliases){ if(newAliases.contains(alias.alias)){ return true; } newAliases.add(alias.alias); } return false; } } | /**
* Controlla se l'array ha degli alias duplicati
* @return true se ci sono alias duplicati, false altrimenti
*/ | Controlla se l'array ha degli alias duplicati | hasDuplicatedAliases | {
"repo_name": "sistemi-territoriali/StatPortalOpenData",
"path": "OpenDataProxy/src/it/sister/statportal/odata/proxy/serviceoperation/GetAliases.java",
"license": "gpl-3.0",
"size": 11853
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 912,802 |
public void bookmarkTree(String attr, String value, Tags.Generator body) {
tag(_bookmarkTree, attr, value, null, null, body);
} | void function(String attr, String value, Tags.Generator body) { tag(_bookmarkTree, attr, value, null, null, body); } | /**
* Create a @code{fo:bookmark-tree} tag with one attribute
* @param attr name of the attribute.
* @param value value of the attribute.
* @param body the body generator for the tag.
*/ | Create a @code{fo:bookmark-tree} tag with one attribute | bookmarkTree | {
"repo_name": "bckfnn/taggersty",
"path": "xslfo/src/main/java/io/github/bckfnn/xslfo/XslfoTags.java",
"license": "apache-2.0",
"size": 171836
} | [
"io.github.bckfnn.taggersty.Tags"
] | import io.github.bckfnn.taggersty.Tags; | import io.github.bckfnn.taggersty.*; | [
"io.github.bckfnn"
] | io.github.bckfnn; | 1,749,444 |
public static List<MRange> collapseRange(List<MRange> range)
{
Collections.sort(range);
for (int i = 0; i < range.size() - 1; i++)
{
MRange cur = range.get(i);
MRange next = range.get(i + 1);
if (cur.getEnd... | static List<MRange> function(List<MRange> range) { Collections.sort(range); for (int i = 0; i < range.size() - 1; i++) { MRange cur = range.get(i); MRange next = range.get(i + 1); if (cur.getEndSlot() + 1 >= next.getStartSlot()) { range.remove(next); MRange nm = new MRange(cur.getStartSlot(), next.getEndSlot() > cur.ge... | /**
* Collapse ranges by removing collapsing overlapping or directly
* sequential ranges to a single range.
*
* @param range list of ranges
* @return collapsed ranges
*/ | Collapse ranges by removing collapsing overlapping or directly sequential ranges to a single range | collapseRange | {
"repo_name": "sahara-labs/scheduling-server",
"path": "Bookings/src/au/edu/uts/eng/remotelabs/schedserver/bookings/impl/slotsengine/MRange.java",
"license": "bsd-3-clause",
"size": 8969
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,486,357 |
public void setSsl(SslContext ssl) {
ArgAssert.check(ssl == null || !ssl.isClient(), "SSL context must be configured in server mode.");
this.ssl = ssl;
} | void function(SslContext ssl) { ArgAssert.check(ssl == null !ssl.isClient(), STR); this.ssl = ssl; } | /**
* Sets the SSL context that should be used to secure all network communications.
*
* <p>
* This parameter is optional and if not specified then no encryption will be applied.
* </p>
*
* <p>
* <b>Note:</b> If SSL is configured for the server then it should be configured on the... | Sets the SSL context that should be used to secure all network communications. This parameter is optional and if not specified then no encryption will be applied. Note: If SSL is configured for the server then it should be configured on the client side too (see <code>NettyClientFactory#setSsl(SslContext)</code>). | setSsl | {
"repo_name": "hekate-io/hekate",
"path": "hekate-core/src/main/java/io/hekate/network/netty/NettyServerFactory.java",
"license": "apache-2.0",
"size": 7535
} | [
"io.hekate.core.internal.util.ArgAssert",
"io.netty.handler.ssl.SslContext"
] | import io.hekate.core.internal.util.ArgAssert; import io.netty.handler.ssl.SslContext; | import io.hekate.core.internal.util.*; import io.netty.handler.ssl.*; | [
"io.hekate.core",
"io.netty.handler"
] | io.hekate.core; io.netty.handler; | 986,310 |
public Connection getConnection(InternalDistributedMember memberAddress,
final boolean preserveOrder, boolean retry, long startTime, long ackTimeout,
long ackSATimeout) throws java.io.IOException, DistributedSystemDisconnectedException {
// final boolean preserveOrder = (processorType == DistributionM... | Connection function(InternalDistributedMember memberAddress, final boolean preserveOrder, boolean retry, long startTime, long ackTimeout, long ackSATimeout) throws java.io.IOException, DistributedSystemDisconnectedException { if (stopped) { throw new DistributedSystemDisconnectedException( LocalizedStrings.TCPConduit_T... | /**
* Return a connection to the given member. This method must continue to attempt to create a
* connection to the given member as long as that member is in the membership view and the system
* is not shutting down.
*
* @param memberAddress the IDS associated with the remoteId
* @param preserveOrder... | Return a connection to the given member. This method must continue to attempt to create a connection to the given member as long as that member is in the membership view and the system is not shutting down | getConnection | {
"repo_name": "pivotal-amurmann/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java",
"license": "apache-2.0",
"size": 42254
} | [
"java.io.IOException",
"org.apache.geode.CancelException",
"org.apache.geode.distributed.DistributedSystemDisconnectedException",
"org.apache.geode.distributed.internal.membership.InternalDistributedMember",
"org.apache.geode.internal.i18n.LocalizedStrings",
"org.apache.geode.internal.logging.log4j.AlertA... | import java.io.IOException; import org.apache.geode.CancelException; import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.internal.i18n.LocalizedStrings; import org.apache.geode.internal.log... | import java.io.*; import org.apache.geode.*; import org.apache.geode.distributed.*; import org.apache.geode.distributed.internal.membership.*; import org.apache.geode.internal.i18n.*; import org.apache.geode.internal.logging.log4j.*; | [
"java.io",
"org.apache.geode"
] | java.io; org.apache.geode; | 2,137,569 |
@Test
public void testWriteRowToFile_initFileStreamWriter() throws Exception {
// SETUP
textFileOutput =
new TextFileOutputTestHandler( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0,
stepMockHelper.transMeta,
stepMockHelper.trans );
TextFileOutputMeta mockTFOMeta =... | void function() throws Exception { textFileOutput = new TextFileOutputTestHandler( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); TextFileOutputMeta mockTFOMeta = mock( TextFileOutputMeta.class ); when( mockTFOMeta.isServletOutput() ).thenReturn( false );... | /**
* Test for writeRowToFile not to call #initFileStreamWriter() if a variable is set.
* Normal behavior, if not set, call #initFileStreamWriter.
* see BACKLOG-28333 for more information.
*/ | Test for writeRowToFile not to call #initFileStreamWriter() if a variable is set. Normal behavior, if not set, call #initFileStreamWriter. see BACKLOG-28333 for more information | testWriteRowToFile_initFileStreamWriter | {
"repo_name": "ddiroma/pentaho-kettle",
"path": "engine/src/test/java/org/pentaho/di/trans/steps/textfileoutput/TextFileOutputTest.java",
"license": "apache-2.0",
"size": 35236
} | [
"java.nio.file.Files",
"java.nio.file.Path",
"org.junit.Assert",
"org.mockito.Mockito"
] | import java.nio.file.Files; import java.nio.file.Path; import org.junit.Assert; import org.mockito.Mockito; | import java.nio.file.*; import org.junit.*; import org.mockito.*; | [
"java.nio",
"org.junit",
"org.mockito"
] | java.nio; org.junit; org.mockito; | 2,705,101 |
@Override
public void execute(Frame frame) {
Integer key = (Integer) frame.getOperandStack().pop();
findTargetAndSwitch(frame, key);
}
| void function(Frame frame) { Integer key = (Integer) frame.getOperandStack().pop(); findTargetAndSwitch(frame, key); } | /**
* Execute the instruction.
* @param frame The currently executed frame.
*/ | Execute the instruction | execute | {
"repo_name": "wwu-pi/muggl",
"path": "muggl-core/src/de/wwu/muggl/instructions/bytecode/Lookupswitch.java",
"license": "gpl-3.0",
"size": 6037
} | [
"de.wwu.muggl.vm.Frame"
] | import de.wwu.muggl.vm.Frame; | import de.wwu.muggl.vm.*; | [
"de.wwu.muggl"
] | de.wwu.muggl; | 2,462,010 |
List<String> makeAttributeList(); | List<String> makeAttributeList(); | /**
* Returns a list of attribute labels. This list must have the same length as
* the feature vector generated for every {@link Synset} pair.
*/ | Returns a list of attribute labels. This list must have the same length as the feature vector generated for every <code>Synset</code> pair | makeAttributeList | {
"repo_name": "fozziethebeat/C-Cat",
"path": "wordnet/src/main/java/gov/llnl/ontology/wordnet/feature/SynsetPairFeatureMaker.java",
"license": "gpl-2.0",
"size": 2014
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,842,652 |
public int read(InputStream in) throws IOException {
readId(in, "RIFF");
int numBytes = readInt(in) - 36;
readId(in, "WAVE");
readId(in, "fmt ");
if (16 != readInt(in)) throw new IOException("fmt chunk length not 16");
mFormat = readShort(in);
... | int function(InputStream in) throws IOException { readId(in, "RIFF"); int numBytes = readInt(in) - 36; readId(in, "WAVE"); readId(in, STR); if (16 != readInt(in)) throw new IOException(STR); mFormat = readShort(in); mNumChannels = readShort(in); mSampleRate = readInt(in); int byteRate = readInt(in); short blockAlign = ... | /**
* Read and initialize a WaveHeader.
*
* @param in {@link InputStream} to read from.
* @return number of bytes consumed.
* @throws IOException
*/ | Read and initialize a WaveHeader | read | {
"repo_name": "prefanatic/Hermes",
"path": "hermes-core/src/main/java/edu/uri/egr/hermes/manipulators/WaveHeader.java",
"license": "apache-2.0",
"size": 8311
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 664,436 |
public void expandNodes(List<String[]> exPaths) {
for (Iterator<String[]> it = exPaths.iterator(); it.hasNext();) {
String[] sp = it.next();
TreePath tp = stringPath2TreePath(sp);
if (tp != null) {
showPath(tp);
}
}
}
| void function(List<String[]> exPaths) { for (Iterator<String[]> it = exPaths.iterator(); it.hasNext();) { String[] sp = it.next(); TreePath tp = stringPath2TreePath(sp); if (tp != null) { showPath(tp); } } } | /** Expands all the paths, when exists
*/ | Expands all the paths, when exists | expandNodes | {
"repo_name": "tusharvjoshi/nbtaskfocus",
"path": "com.nbtaskfocus.core/src/com/nbtaskfocus/core/ui/CustomTreeView.java",
"license": "mit",
"size": 4916
} | [
"java.util.Iterator",
"java.util.List",
"javax.swing.tree.TreePath"
] | import java.util.Iterator; import java.util.List; import javax.swing.tree.TreePath; | import java.util.*; import javax.swing.tree.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 543,817 |
public void incrementAndGetTestLogic(SimpleAtomicLong simpleAtomicLong,
long preValue, long resultValue, long postValue) {
long pre = simpleAtomicLong.get();
long result = simpleAtomicLong.incrementAndGet();
long post = simpleAtomicLong.get();
... | void function(SimpleAtomicLong simpleAtomicLong, long preValue, long resultValue, long postValue) { long pre = simpleAtomicLong.get(); long result = simpleAtomicLong.incrementAndGet(); long post = simpleAtomicLong.get(); assertEquals(pre + 1, result); assertEquals(result, post); compareResults(pre, preValue, result, re... | /**
* The Logic of testing incrementAndGet
*
* @param simpleAtomicLong
* The SimpleAtomicLong to be tested
* @param preValue
* The expected 'pre' value
* @param resultValue
* The expected 'result' value
* @param postValue
* ... | The Logic of testing incrementAndGet | incrementAndGetTestLogic | {
"repo_name": "mbabic/POSA",
"path": "src/hw1/SimpleAtomicLongSingleThreadedTest.java",
"license": "unlicense",
"size": 7683
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,388,632 |
@Override
@Transactional("entityManager")
public ConfirmEmailAuth getConfirmEmailAuthByAuthcode (final String authcode) {
HashMap<String, String> m = new HashMap<String, String>();
m.put("authcode", authcode);
List<ConfirmEmailAuth> results = this.findByMap(m);
if (results.size() == 0) ... | @Transactional(STR) ConfirmEmailAuth function (final String authcode) { HashMap<String, String> m = new HashMap<String, String>(); m.put(STR, authcode); List<ConfirmEmailAuth> results = this.findByMap(m); if (results.size() == 0) { ConfirmEmailAuth rt = new ConfirmEmailAuth(); return rt; } return results.get(0); } | /**
* getConfirmEmailAuthByAuthcode(final String authcode)
*
* @param final String authcode
*
* @return confirmEmailAuth
*/ | getConfirmEmailAuthByAuthcode(final String authcode) | getConfirmEmailAuthByAuthcode | {
"repo_name": "WASP-System/central",
"path": "wasp-core/src/main/java/edu/yu/einstein/wasp/dao/impl/ConfirmEmailAuthDaoImpl.java",
"license": "agpl-3.0",
"size": 2676
} | [
"edu.yu.einstein.wasp.model.ConfirmEmailAuth",
"java.util.HashMap",
"java.util.List",
"org.springframework.transaction.annotation.Transactional"
] | import edu.yu.einstein.wasp.model.ConfirmEmailAuth; import java.util.HashMap; import java.util.List; import org.springframework.transaction.annotation.Transactional; | import edu.yu.einstein.wasp.model.*; import java.util.*; import org.springframework.transaction.annotation.*; | [
"edu.yu.einstein",
"java.util",
"org.springframework.transaction"
] | edu.yu.einstein; java.util; org.springframework.transaction; | 2,092,679 |
public ArrayList<MBeanMethodParameter> getMethodParams()
{
return MethodParams;
}
| ArrayList<MBeanMethodParameter> function() { return MethodParams; } | /**
* <p>
* Helper method to retrieve the parameters for the method to invoke
* </p>
*/ | Helper method to retrieve the parameters for the method to invoke | getMethodParams | {
"repo_name": "Microsoft/BeanSpy",
"path": "source/code/JEE/Common/src/com/interopbridges/scx/xml/InvokeDecoder.java",
"license": "apache-2.0",
"size": 9412
} | [
"com.interopbridges.scx.mbeans.MBeanMethodParameter",
"java.util.ArrayList"
] | import com.interopbridges.scx.mbeans.MBeanMethodParameter; import java.util.ArrayList; | import com.interopbridges.scx.mbeans.*; import java.util.*; | [
"com.interopbridges.scx",
"java.util"
] | com.interopbridges.scx; java.util; | 1,452,948 |
public void testMatchBrowser() {
ArrayList pattern = new ArrayList(useragent.length);
for (int i = 0; i < useragent.length; i++) {
pattern.add(Pattern.compile(useragent[i]));
}
for (int i = 0; i < sampleagent.length; i++) {
for (int j = 0; j < pattern.size();... | void function() { ArrayList pattern = new ArrayList(useragent.length); for (int i = 0; i < useragent.length; i++) { pattern.add(Pattern.compile(useragent[i])); } for (int i = 0; i < sampleagent.length; i++) { for (int j = 0; j < pattern.size(); j++) { boolean matches = ((Pattern)pattern.get(j)).matcher(sampleagent[i]).... | /**
* Tests the browser matching regular expressions.<p>
*/ | Tests the browser matching regular expressions | testMatchBrowser | {
"repo_name": "victos/opencms-core",
"path": "test/org/opencms/util/TestCmsBrowserMatcher.java",
"license": "lgpl-2.1",
"size": 4705
} | [
"java.util.ArrayList",
"java.util.regex.Pattern"
] | import java.util.ArrayList; import java.util.regex.Pattern; | import java.util.*; import java.util.regex.*; | [
"java.util"
] | java.util; | 2,860,037 |
public void failIfErrors(String testName) {
List<Throwable> errors = new ArrayList<>(this.errors);
this.errors.clear();
if (errors.size() == 1 && errors.get(0) instanceof AssertionError) {
throw (AssertionError) errors.get(0);
}
if (!errors.isEmpty()) {
String message = String.format(... | void function(String testName) { List<Throwable> errors = new ArrayList<>(this.errors); this.errors.clear(); if (errors.size() == 1 && errors.get(0) instanceof AssertionError) { throw (AssertionError) errors.get(0); } if (!errors.isEmpty()) { String message = String.format(STR, testName); throw new SoftAssertionError(m... | /**
* 1. Clears all collected errors, and
* 2. throws SoftAssertionError if there were some errors
*
* @param testName any string, usually name of current test
*/ | 1. Clears all collected errors, and 2. throws SoftAssertionError if there were some errors | failIfErrors | {
"repo_name": "codeborne/selenide",
"path": "src/main/java/com/codeborne/selenide/logevents/ErrorsCollector.java",
"license": "mit",
"size": 1960
} | [
"com.codeborne.selenide.ex.SoftAssertionError",
"java.util.ArrayList",
"java.util.List"
] | import com.codeborne.selenide.ex.SoftAssertionError; import java.util.ArrayList; import java.util.List; | import com.codeborne.selenide.ex.*; import java.util.*; | [
"com.codeborne.selenide",
"java.util"
] | com.codeborne.selenide; java.util; | 342,694 |
ClassToInstanceMap<Object> getServices(); | ClassToInstanceMap<Object> getServices(); | /**
* Get services present in this context
* @return context services
*/ | Get services present in this context | getServices | {
"repo_name": "xicmiah/see",
"path": "src/main/java/see/evaluation/Context.java",
"license": "apache-2.0",
"size": 953
} | [
"com.google.common.collect.ClassToInstanceMap"
] | import com.google.common.collect.ClassToInstanceMap; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 2,475,808 |
@Override
public List<UnitHolder> getContainedUnits(Village pVillage) {
List<UnitHolder> contained = new ArrayList<>();
for(UnitHolder unit: DataHolder.getSingleton().getUnits()) {
if(getElementForUnit(unit).getTroopsAmount(pVillage) > 0) {
contained.add(unit);
... | List<UnitHolder> function(Village pVillage) { List<UnitHolder> contained = new ArrayList<>(); for(UnitHolder unit: DataHolder.getSingleton().getUnits()) { if(getElementForUnit(unit).getTroopsAmount(pVillage) > 0) { contained.add(unit); } } return contained; } | /**
* Returns all Contained Units for sending from that Village
* @return all contained Units
* checks all units against -1 and 0
*/ | Returns all Contained Units for sending from that Village | getContainedUnits | {
"repo_name": "Patschke/dsworkbench",
"path": "Core/src/main/java/de/tor/tribes/io/TroopAmountDynamic.java",
"license": "apache-2.0",
"size": 13220
} | [
"de.tor.tribes.types.ext.Village",
"java.util.ArrayList",
"java.util.List"
] | import de.tor.tribes.types.ext.Village; import java.util.ArrayList; import java.util.List; | import de.tor.tribes.types.ext.*; import java.util.*; | [
"de.tor.tribes",
"java.util"
] | de.tor.tribes; java.util; | 2,141,395 |
public void testRemoveOperationPresentedForDataEntryForAtomic() throws Exception {
runRemoveOperationTest(CacheAtomicityMode.ATOMIC);
} | void function() throws Exception { runRemoveOperationTest(CacheAtomicityMode.ATOMIC); } | /**
* Test if DELETE operation can be found for atomic cache after mixed cache operations including remove().
*
* @throws Exception if failed.
*/ | Test if DELETE operation can be found for atomic cache after mixed cache operations including remove() | testRemoveOperationPresentedForDataEntryForAtomic | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/reader/IgniteWalReaderTest.java",
"license": "apache-2.0",
"size": 47676
} | [
"org.apache.ignite.cache.CacheAtomicityMode"
] | import org.apache.ignite.cache.CacheAtomicityMode; | import org.apache.ignite.cache.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,468,577 |
protected final void setHeaderScroll(int value) {
if (DEBUG) {
Log.d(LOG_TAG, "setHeaderScroll: " + value);
}
// Clamp value to with pull scroll range
final int maximumPullScroll = getMaximumPullScroll();
value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value));
if (mLayoutVisibilityC... | final void function(int value) { if (DEBUG) { Log.d(LOG_TAG, STR + value); } final int maximumPullScroll = getMaximumPullScroll(); value = Math.min(maximumPullScroll, Math.max(-maximumPullScroll, value)); if (mLayoutVisibilityChangesEnabled) { if (value < 0) { mHeaderLayout.setVisibility(View.VISIBLE); } else if (value... | /**
* Helper method which just calls scrollTo() in the correct scrolling
* direction.
*
* @param value - New Scroll value
*/ | Helper method which just calls scrollTo() in the correct scrolling direction | setHeaderScroll | {
"repo_name": "yun2win/yun2win-sdk-android",
"path": "yun2winDemo/uikit/src/main/java/com/y2w/uikit/customcontrols/listview/PullToRefreshBase.java",
"license": "mit",
"size": 46333
} | [
"android.util.Log",
"android.view.View",
"com.y2w.uikit.customcontrols.listview.internal.ViewCompat"
] | import android.util.Log; import android.view.View; import com.y2w.uikit.customcontrols.listview.internal.ViewCompat; | import android.util.*; import android.view.*; import com.y2w.uikit.customcontrols.listview.internal.*; | [
"android.util",
"android.view",
"com.y2w.uikit"
] | android.util; android.view; com.y2w.uikit; | 1,112,594 |
private static byte[] generateSeed() {
try {
ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream();
DataOutputStream seedBufferOut = new DataOutputStream(seedBuffer);
seedBufferOut.writeLong(System.currentTimeMillis());
seedBuf... | static byte[] function() { try { ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream(); DataOutputStream seedBufferOut = new DataOutputStream(seedBuffer); seedBufferOut.writeLong(System.currentTimeMillis()); seedBufferOut.writeLong(System.nanoTime()); seedBufferOut.writeInt(Process.myPid()); seedBufferOut.writ... | /**
* Generates a device- and invocation-specific seed to be mixed into the
* Linux PRNG.
*/ | Generates a device- and invocation-specific seed to be mixed into the Linux PRNG | generateSeed | {
"repo_name": "Suxsem/Domo-Android",
"path": "app/src/main/java/com/suxsem/domo/AesCbcWithIntegrity.java",
"license": "mit",
"size": 35989
} | [
"android.os.Process",
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException"
] | import android.os.Process; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; | import android.os.*; import java.io.*; | [
"android.os",
"java.io"
] | android.os; java.io; | 2,899,875 |
public void getStatusResponseCallback(final GetStatusResponse result)
{ } | void function(final GetStatusResponse result) { } | /**
* Method to override to receive the response from an get status operation
* call.
*
* @param response response from call
*/ | Method to override to receive the response from an get status operation call | getStatusResponseCallback | {
"repo_name": "jeking3/scheduling-server",
"path": "RigProvider/src/au/edu/uts/eng/remotelabs/schedserver/rigprovider/proxy/RigClientAsyncServiceCallbackHandler.java",
"license": "bsd-3-clause",
"size": 12492
} | [
"au.edu.uts.eng.remotelabs.schedserver.rigprovider.proxy.intf.types.GetStatusResponse"
] | import au.edu.uts.eng.remotelabs.schedserver.rigprovider.proxy.intf.types.GetStatusResponse; | import au.edu.uts.eng.remotelabs.schedserver.rigprovider.proxy.intf.types.*; | [
"au.edu.uts"
] | au.edu.uts; | 1,276,859 |
Set<? extends BpmnNodeEntitySpecification> findInclusiveGatewayNotInState(String piId, String state); | Set<? extends BpmnNodeEntitySpecification> findInclusiveGatewayNotInState(String piId, String state); | /**
* Returns all inclusive gateways of the given process which are not in the given state.
*
* @param piId the process instance id
* @param state the state instance
* @return Set
*/ | Returns all inclusive gateways of the given process which are not in the given state | findInclusiveGatewayNotInState | {
"repo_name": "christian-weber/arrow",
"path": "arrow-runtime/src/main/java/org/arrow/runtime/execution/service/data/GatewayRepository.java",
"license": "gpl-3.0",
"size": 1192
} | [
"java.util.Set",
"org.arrow.runtime.api.BpmnNodeEntitySpecification"
] | import java.util.Set; import org.arrow.runtime.api.BpmnNodeEntitySpecification; | import java.util.*; import org.arrow.runtime.api.*; | [
"java.util",
"org.arrow.runtime"
] | java.util; org.arrow.runtime; | 2,159,032 |
public void actionPerformed(ActionEvent event)
{
// first we filter the following events:
// - control characters
// - key events with the ALT modifier (FIXME: filter that too!)
int cp = event.getActionCommand().codePointAt(0);
if (Character.isISOControl(cp))
return;
... | void function(ActionEvent event) { int cp = event.getActionCommand().codePointAt(0); if (Character.isISOControl(cp)) return; JTextComponent t = getTextComponent(event); if (t != null && t.isEnabled() && t.isEditable()) t.replaceSelection(event.getActionCommand()); } } public static class InsertBreakAction extends TextA... | /**
* Performs the <code>Action</code>.
*
* @param event the action event describing the user action
*/ | Performs the <code>Action</code> | actionPerformed | {
"repo_name": "shaotuanchen/sunflower_exp",
"path": "tools/source/gcc-4.2.4/libjava/classpath/javax/swing/text/DefaultEditorKit.java",
"license": "bsd-3-clause",
"size": 42175
} | [
"java.awt.event.ActionEvent"
] | import java.awt.event.ActionEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 2,242,286 |
public static String byteArrayToSQLBitString(byte[] bytes, int bitCount) {
char[] s = new char[bitCount + 3];
s[0] = 'B';
s[1] = '\'';
int pos = 2;
for (int j = 0; j < bitCount; j++) {
byte b = bytes[j / 8];
s[pos++] = BitMap.isSet(b, j % 8) ? '1'... | static String function(byte[] bytes, int bitCount) { char[] s = new char[bitCount + 3]; s[0] = 'B'; s[1] = '\''; int pos = 2; for (int j = 0; j < bitCount; j++) { byte b = bytes[j / 8]; s[pos++] = BitMap.isSet(b, j % 8) ? '1' : '0'; } s[pos] = '\''; return new String(s); } | /**
* Converts a byte array into an SQL binary string
*
*
* @param bytes byte array
* @param bitCount number of bits
* @return hex string
*/ | Converts a byte array into an SQL binary string | byteArrayToSQLBitString | {
"repo_name": "Alvise88/RabbitSQL",
"path": "RabbitSQL/src/main/java/org/wildjava/rabbitsql/lib/StringConverter.java",
"license": "lgpl-3.0",
"size": 24006
} | [
"org.wildjava.rabbitsql.map.BitMap"
] | import org.wildjava.rabbitsql.map.BitMap; | import org.wildjava.rabbitsql.map.*; | [
"org.wildjava.rabbitsql"
] | org.wildjava.rabbitsql; | 500,527 |
@Override
public void monitorProcedure(String instanceId, AsRunReplayResult result, IProgressMonitor monitor) throws LoadFailed
{
attachToRemoteProcedure(instanceId, ClientMode.MONITOR, result, monitor);
} | void function(String instanceId, AsRunReplayResult result, IProgressMonitor monitor) throws LoadFailed { attachToRemoteProcedure(instanceId, ClientMode.MONITOR, result, monitor); } | /***************************************************************************
* Attach an existing procedure instance in monitoring mode.
*
* @param instanceId
* The procedure identifier, no instance number info
* @throws LoadFailed
* if the procedure could not be attached
*********... | Attach an existing procedure instance in monitoring mode | monitorProcedure | {
"repo_name": "Spacecraft-Code/SPELL",
"path": "src/spel-gui/com.astra.ses.spell.gui.procs/src/com/astra/ses/spell/gui/procs/services/ProcedureManager.java",
"license": "lgpl-3.0",
"size": 75372
} | [
"com.astra.ses.spell.gui.core.model.types.ClientMode",
"com.astra.ses.spell.gui.procs.exceptions.LoadFailed",
"com.astra.ses.spell.gui.procs.interfaces.model.AsRunReplayResult",
"org.eclipse.core.runtime.IProgressMonitor"
] | import com.astra.ses.spell.gui.core.model.types.ClientMode; import com.astra.ses.spell.gui.procs.exceptions.LoadFailed; import com.astra.ses.spell.gui.procs.interfaces.model.AsRunReplayResult; import org.eclipse.core.runtime.IProgressMonitor; | import com.astra.ses.spell.gui.core.model.types.*; import com.astra.ses.spell.gui.procs.exceptions.*; import com.astra.ses.spell.gui.procs.interfaces.model.*; import org.eclipse.core.runtime.*; | [
"com.astra.ses",
"org.eclipse.core"
] | com.astra.ses; org.eclipse.core; | 856,948 |
public void test(TestHarness harness)
{
// flag that is set when exception is caught
boolean caught = false;
try {
throw new NullPointerException("NullPointerException");
}
catch (NullPointerException e) {
// correct exception was caught
... | void function(TestHarness harness) { boolean caught = false; try { throw new NullPointerException(STR); } catch (NullPointerException e) { caught = true; } harness.check(caught); } | /**
* Runs the test using the specified harness.
*
* @param harness the test harness (<code>null</code> not permitted).
*/ | Runs the test using the specified harness | test | {
"repo_name": "niloc132/mauve-gwt",
"path": "src/main/java/gnu/testlet/java/lang/NullPointerException/TryCatch.java",
"license": "gpl-2.0",
"size": 1721
} | [
"gnu.testlet.TestHarness",
"java.lang.NullPointerException"
] | import gnu.testlet.TestHarness; import java.lang.NullPointerException; | import gnu.testlet.*; import java.lang.*; | [
"gnu.testlet",
"java.lang"
] | gnu.testlet; java.lang; | 2,085,897 |
@Test
public void testCancelTransaction() throws Exception {
// Without Transaction
ReadTxContext rtc = getReadTxContext();
rtc.cancelTransaction();
ReadTransaction rtx = rtc.getTransaction();
verifyNoMoreInteractions(rtx);
assertEquals(rtx, getFieldValue(rtc, Rea... | void function() throws Exception { ReadTxContext rtc = getReadTxContext(); rtc.cancelTransaction(); ReadTransaction rtx = rtc.getTransaction(); verifyNoMoreInteractions(rtx); assertEquals(rtx, getFieldValue(rtc, ReadOnlyTransaction.class, STR)); rtc.cancelTransaction(); assertEquals(null, getFieldValue(rtc, ReadOnlyTra... | /**
* Test case for {@link ReadTxContext#cancelTransaction()}.
*
* @throws Exception An error occurred.
*/ | Test case for <code>ReadTxContext#cancelTransaction()</code> | testCancelTransaction | {
"repo_name": "opendaylight/vtn",
"path": "manager/implementation/src/test/java/org/opendaylight/vtn/manager/internal/util/tx/ReadTxContextTest.java",
"license": "epl-1.0",
"size": 8000
} | [
"org.mockito.Mockito",
"org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction",
"org.opendaylight.controller.md.sal.binding.api.ReadTransaction"
] | import org.mockito.Mockito; import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; import org.opendaylight.controller.md.sal.binding.api.ReadTransaction; | import org.mockito.*; import org.opendaylight.controller.md.sal.binding.api.*; | [
"org.mockito",
"org.opendaylight.controller"
] | org.mockito; org.opendaylight.controller; | 527,473 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.