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 List<NameValuePair> values() {
return this.values;
} | List<NameValuePair> function() { return this.values; } | /**
* Get the values value.
*
* @return the values value
*/ | Get the values value | values | {
"repo_name": "pomortaz/azure-sdk-for-java",
"path": "azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/ResizeError.java",
"license": "mit",
"size": 2068
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 431,892 |
@Nonnull Context setUser(@Nullable Object user); | @Nonnull Context setUser(@Nullable Object user); | /**
* Set current user.
*
* @param user Current user.
* @return This context.
*/ | Set current user | setUser | {
"repo_name": "jooby-project/jooby",
"path": "jooby/src/main/java/io/jooby/Context.java",
"license": "apache-2.0",
"size": 41138
} | [
"javax.annotation.Nonnull",
"javax.annotation.Nullable"
] | import javax.annotation.Nonnull; import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,850,234 |
private static String getDeviceName() {
String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL;
if (model.startsWith(manufacturer)) {
return model;
} else {
return manufacturer + StringUtils.SPACE + model;
}
} | static String function() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; if (model.startsWith(manufacturer)) { return model; } else { return manufacturer + StringUtils.SPACE + model; } } | /**
* Forked from http://stackoverflow.com/a/12707479
*/ | Forked from HREF | getDeviceName | {
"repo_name": "floating-cat/S1-Next",
"path": "app/src/main/java/cl/monsoon/s1next/util/DeviceUtil.java",
"license": "unlicense",
"size": 1049
} | [
"android.os.Build",
"org.apache.commons.lang3.StringUtils"
] | import android.os.Build; import org.apache.commons.lang3.StringUtils; | import android.os.*; import org.apache.commons.lang3.*; | [
"android.os",
"org.apache.commons"
] | android.os; org.apache.commons; | 1,024,178 |
private static void executeForNonServiceFailure(final ModelControllerClient client, final ModelNode operation) {
try {
final ModelNode result = client.execute(operation);
if (! result.hasDefined("outcome") && ! ModelDescriptionConstants.FAILED.equals(result.get("outcome").asString())... | static void function(final ModelControllerClient client, final ModelNode operation) { try { final ModelNode result = client.execute(operation); if (! result.hasDefined(STR) && ! ModelDescriptionConstants.FAILED.equals(result.get(STR).asString())) { Assert.fail(STR + result.get(STR).asString()); } System.out.println(STR... | /**
* Assert that the operation failed, but not with the failure message that indicates a service start problem.
* Use this to check that problems that should be detected in the OSH and not in the service are properly
* detected.
*
* @param client the client to use to execute the operation
... | Assert that the operation failed, but not with the failure message that indicates a service start problem. Use this to check that problems that should be detected in the OSH and not in the service are properly detected | executeForNonServiceFailure | {
"repo_name": "yersan/wildfly-core",
"path": "server/src/test/java/org/jboss/as/server/test/InterfaceManagementUnitTestCase.java",
"license": "lgpl-2.1",
"size": 24763
} | [
"java.io.IOException",
"org.jboss.as.controller.client.ModelControllerClient",
"org.jboss.as.controller.descriptions.ModelDescriptionConstants",
"org.jboss.as.controller.logging.ControllerLogger",
"org.jboss.dmr.ModelNode",
"org.junit.Assert"
] | import java.io.IOException; import org.jboss.as.controller.client.ModelControllerClient; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.logging.ControllerLogger; import org.jboss.dmr.ModelNode; import org.junit.Assert; | import java.io.*; import org.jboss.as.controller.client.*; import org.jboss.as.controller.descriptions.*; import org.jboss.as.controller.logging.*; import org.jboss.dmr.*; import org.junit.*; | [
"java.io",
"org.jboss.as",
"org.jboss.dmr",
"org.junit"
] | java.io; org.jboss.as; org.jboss.dmr; org.junit; | 1,642,197 |
EList<SystemFault> getItsFaults(); | EList<SystemFault> getItsFaults(); | /**
* Returns the value of the '<em><b>Its Faults</b></em>' containment reference list.
* The list contents are of type {@link WTSpec4M.SystemFault}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Its Faults</em>' containment reference list isn't clear,
* there really should be more of a descr... | Returns the value of the 'Its Faults' containment reference list. The list contents are of type <code>WTSpec4M.SystemFault</code>. If the meaning of the 'Its Faults' containment reference list isn't clear, there really should be more of a description here... | getItsFaults | {
"repo_name": "mondo-project/mondo-demo-wt",
"path": "DSL-tao/org.mondo.wt.cstudy/src/WTSpec4M/WT.java",
"license": "epl-1.0",
"size": 6994
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,355,917 |
public RectF getLimits() {
return limits;
} | RectF function() { return limits; } | /**
* Gets the bounding rectangle for the SVG that was computed upon parsing. It may not be entirely accurate for certain curves or transformations, but is often better than nothing.
* @return rectangle representing the computed bounds.
*/ | Gets the bounding rectangle for the SVG that was computed upon parsing. It may not be entirely accurate for certain curves or transformations, but is often better than nothing | getLimits | {
"repo_name": "b2renger/PdDroidPublisher",
"path": "svg-android/src/com/larvalabs/svgandroid/SVG.java",
"license": "gpl-3.0",
"size": 3728
} | [
"android.graphics.RectF"
] | import android.graphics.RectF; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,031,851 |
void applyTextStyle(StyleRange styleRange, Color annotationColor);
} | void applyTextStyle(StyleRange styleRange, Color annotationColor); } | /**
* Applies a text style on the given <code>StyleRange</code>.
*
* @param styleRange the style range on which to apply the text style
* @param annotationColor the color of the annotation
*/ | Applies a text style on the given <code>StyleRange</code> | applyTextStyle | {
"repo_name": "neelance/jface4ruby",
"path": "jface4ruby/src/org/eclipse/jface/text/source/AnnotationPainter.java",
"license": "epl-1.0",
"size": 53878
} | [
"org.eclipse.swt.custom.StyleRange",
"org.eclipse.swt.graphics.Color"
] | import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.graphics.Color; | import org.eclipse.swt.custom.*; import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 201,437 |
@Override
public List<Quota> getQuotaByAdElementId(Guid adElementId, Guid storagePoolId) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource();
quotaParameterSource.addValue("ad_element_id", adElementId);
quotaParameterSource.addValue("storage_pool_id", storageP... | List<Quota> function(Guid adElementId, Guid storagePoolId) { MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource(); quotaParameterSource.addValue(STR, adElementId); quotaParameterSource.addValue(STR, storagePoolId); List<Quota> quotaEntityList = getCallsHandler().executeReadList(STR, getQuotaMet... | /**
* Get list of <code>Quotas</code> which are consumed by ad element id in storage pool (if not storage pool id not
* null).
*
* @param adElementId
* - The user ID or group ID.
* @param storagePoolId
* - The storage pool Id to search the quotas in (If null sear... | Get list of <code>Quotas</code> which are consumed by ad element id in storage pool (if not storage pool id not null) | getQuotaByAdElementId | {
"repo_name": "derekhiggins/ovirt-engine",
"path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/QuotaDAODbFacadeImpl.java",
"license": "apache-2.0",
"size": 23067
} | [
"java.util.List",
"org.ovirt.engine.core.common.businessentities.Quota",
"org.ovirt.engine.core.compat.Guid",
"org.springframework.jdbc.core.namedparam.MapSqlParameterSource"
] | import java.util.List; import org.ovirt.engine.core.common.businessentities.Quota; import org.ovirt.engine.core.compat.Guid; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; | import java.util.*; import org.ovirt.engine.core.common.businessentities.*; import org.ovirt.engine.core.compat.*; import org.springframework.jdbc.core.namedparam.*; | [
"java.util",
"org.ovirt.engine",
"org.springframework.jdbc"
] | java.util; org.ovirt.engine; org.springframework.jdbc; | 1,530,092 |
public final void setNoView(boolean noView)
{
annot.setFlag(COSName.F, FLAG_NO_VIEW, noView);
} | final void function(boolean noView) { annot.setFlag(COSName.F, FLAG_NO_VIEW, noView); } | /**
* Set the noView flag.
*
* @param noView The new noView flag.
*/ | Set the noView flag | setNoView | {
"repo_name": "TomRoush/PdfBox-Android",
"path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/fdf/FDFAnnotation.java",
"license": "apache-2.0",
"size": 27928
} | [
"com.tom_roush.pdfbox.cos.COSName"
] | import com.tom_roush.pdfbox.cos.COSName; | import com.tom_roush.pdfbox.cos.*; | [
"com.tom_roush.pdfbox"
] | com.tom_roush.pdfbox; | 2,905,606 |
public Optional<MasterSlaveRule> findMasterSlaveRule(final String dataSourceName) {
for (MasterSlaveRule each : masterSlaveRules) {
if (each.containDataSourceName(dataSourceName)) {
return Optional.of(each);
}
}
return Optional.absent();
} | Optional<MasterSlaveRule> function(final String dataSourceName) { for (MasterSlaveRule each : masterSlaveRules) { if (each.containDataSourceName(dataSourceName)) { return Optional.of(each); } } return Optional.absent(); } | /**
* Find master slave rule.
*
* @param dataSourceName data source name
* @return master slave rule
*/ | Find master slave rule | findMasterSlaveRule | {
"repo_name": "dangdangdotcom/sharding-jdbc",
"path": "sharding-core/src/main/java/io/shardingsphere/core/rule/ShardingRule.java",
"license": "apache-2.0",
"size": 16890
} | [
"com.google.common.base.Optional"
] | import com.google.common.base.Optional; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,737,146 |
public static String formatHostnameForHttp(InetSocketAddress addr) {
String hostString = NetUtil.getHostname(addr);
if (NetUtil.isValidIpV6Address(hostString)) {
if (!addr.isUnresolved()) {
hostString = NetUtil.toAddressString(addr.getAddress());
}
... | static String function(InetSocketAddress addr) { String hostString = NetUtil.getHostname(addr); if (NetUtil.isValidIpV6Address(hostString)) { if (!addr.isUnresolved()) { hostString = NetUtil.toAddressString(addr.getAddress()); } return '[' + hostString + ']'; } return hostString; } | /**
* Formats the host string of an address so it can be used for computing an HTTP component
* such as an URL or a Host header
*
* @param addr the address
* @return the formatted String
*/ | Formats the host string of an address so it can be used for computing an HTTP component such as an URL or a Host header | formatHostnameForHttp | {
"repo_name": "fengjiachun/netty",
"path": "codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java",
"license": "apache-2.0",
"size": 23036
} | [
"io.netty.util.NetUtil",
"java.net.InetSocketAddress"
] | import io.netty.util.NetUtil; import java.net.InetSocketAddress; | import io.netty.util.*; import java.net.*; | [
"io.netty.util",
"java.net"
] | io.netty.util; java.net; | 1,940,281 |
private boolean readAliasForm(RunData data, SessionState state)
{
// read the form
String id = StringUtils.trimToNull(data.getParameters().getString("id"));
String target = StringUtils.trimToNull(data.getParameters().getString("target"));
// get the alias
AliasEdit alias = (AliasEdit) state.getAttribut... | boolean function(RunData data, SessionState state) { String id = StringUtils.trimToNull(data.getParameters().getString("id")); String target = StringUtils.trimToNull(data.getParameters().getString(STR)); AliasEdit alias = (AliasEdit) state.getAttribute("alias"); if (alias == null) { try { alias = AliasService.add(id); ... | /**
* Read the alias form and update the alias in state.
*
* @return true if the form is accepted, false if there's a validation error (an alertMessage will be set)
*/ | Read the alias form and update the alias in state | readAliasForm | {
"repo_name": "eemirtekin/Sakai-10.6-TR",
"path": "alias/alias-tool/tool/src/java/org/sakaiproject/alias/tool/AliasesAction.java",
"license": "apache-2.0",
"size": 16119
} | [
"org.apache.commons.lang.StringUtils",
"org.sakaiproject.alias.api.AliasEdit",
"org.sakaiproject.alias.cover.AliasService",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState",
"org.sakaiproject.exception.IdInvalidException",
"org.sakaiproject.exception.IdUsedException",
"or... | import org.apache.commons.lang.StringUtils; import org.sakaiproject.alias.api.AliasEdit; import org.sakaiproject.alias.cover.AliasService; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.exception.IdInvalidException; import org.sakaiproject.exception.IdU... | import org.apache.commons.lang.*; import org.sakaiproject.alias.api.*; import org.sakaiproject.alias.cover.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.exception.*; | [
"org.apache.commons",
"org.sakaiproject.alias",
"org.sakaiproject.cheftool",
"org.sakaiproject.event",
"org.sakaiproject.exception"
] | org.apache.commons; org.sakaiproject.alias; org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.exception; | 158,007 |
public static CustomExpression getExpression( QName elName ) {
return getCustomExpressions().get( elName );
} | static CustomExpression function( QName elName ) { return getCustomExpressions().get( elName ); } | /**
* Returns the {@link CustomExpression} for the given element name.
*
* @param elName
* name of the element, must not be <code>null</code>
* @return custom expression instance, or <code>null</code> if there is no expression with this name
*/ | Returns the <code>CustomExpression</code> for the given element name | getExpression | {
"repo_name": "deegree/deegree3",
"path": "deegree-core/deegree-core-base/src/main/java/org/deegree/filter/expression/custom/CustomExpressionManager.java",
"license": "lgpl-2.1",
"size": 3680
} | [
"javax.xml.namespace.QName"
] | import javax.xml.namespace.QName; | import javax.xml.namespace.*; | [
"javax.xml"
] | javax.xml; | 492,022 |
@Override
public Post getLastPostFor(Branch branch) {
List<Post> posts = (List<Post>) session()
.getNamedQuery("getLastPostForBranch")
.setParameter("branchId", branch.getId())
.setMaxResults(1)
.list();
if (!posts.isEmpty()) {
... | Post function(Branch branch) { List<Post> posts = (List<Post>) session() .getNamedQuery(STR) .setParameter(STR, branch.getId()) .setMaxResults(1) .list(); if (!posts.isEmpty()) { return posts.get(0); } return null; } /** * {@inheritDoc} | /**
* Get last post that was posted in a topic of branch.
* Uses hibernate criteria instead of invoking {@link #getLastPostsFor} method that uses hql query.
* Done for better performance results. This solution can return only one last post so method
* {@link #getLastPostsFor} stay without changes.
... | Get last post that was posted in a topic of branch. Uses hibernate criteria instead of invoking <code>#getLastPostsFor</code> method that uses hql query. Done for better performance results. This solution can return only one last post so method <code>#getLastPostsFor</code> stay without changes | getLastPostFor | {
"repo_name": "Noctrunal/jcommune",
"path": "jcommune-model/src/main/java/org/jtalks/jcommune/model/dao/hibernate/PostHibernateDao.java",
"license": "lgpl-2.1",
"size": 5134
} | [
"java.util.List",
"org.jtalks.jcommune.model.entity.Branch",
"org.jtalks.jcommune.model.entity.Post"
] | import java.util.List; import org.jtalks.jcommune.model.entity.Branch; import org.jtalks.jcommune.model.entity.Post; | import java.util.*; import org.jtalks.jcommune.model.entity.*; | [
"java.util",
"org.jtalks.jcommune"
] | java.util; org.jtalks.jcommune; | 149,795 |
public static void set18CompilerOptions(IJavaProject project) {
Map options = project.getOptions(false);
set18CompilerOptions(options);
project.setOptions(options);
} | static void function(IJavaProject project) { Map options = project.getOptions(false); set18CompilerOptions(options); project.setOptions(options); } | /**
* Sets the compiler options to 1.8 for the given project.
*
* @param project the java project
* @since 3.10
*/ | Sets the compiler options to 1.8 for the given project | set18CompilerOptions | {
"repo_name": "gazarenkov/che-sketch",
"path": "plugins/plugin-java/che-plugin-java-ext-lang-server/src/test/java/org/eclipse/che/plugin/java/server/jdt/testplugin/JavaProjectHelper.java",
"license": "epl-1.0",
"size": 39409
} | [
"java.util.Map",
"org.eclipse.jdt.core.IJavaProject"
] | import java.util.Map; import org.eclipse.jdt.core.IJavaProject; | import java.util.*; import org.eclipse.jdt.core.*; | [
"java.util",
"org.eclipse.jdt"
] | java.util; org.eclipse.jdt; | 732,872 |
protected void checkThreshold(int count) throws IOException
{
if (!thresholdExceeded && written + count > threshold)
{
thresholdExceeded = true;
thresholdReached();
}
} | void function(int count) throws IOException { if (!thresholdExceeded && written + count > threshold) { thresholdExceeded = true; thresholdReached(); } } | /**
* Checks to see if writing the specified number of bytes would cause the
* configured threshold to be exceeded. If so, triggers an event to allow
* a concrete implementation to take action on this.
*
* @param count The number of bytes about to be written to the underlying
* ... | Checks to see if writing the specified number of bytes would cause the configured threshold to be exceeded. If so, triggers an event to allow a concrete implementation to take action on this | checkThreshold | {
"repo_name": "wspeirs/sop4j-base",
"path": "src/main/java/com/sop4j/base/apache/io/output/ThresholdingOutputStream.java",
"license": "apache-2.0",
"size": 7237
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,048,324 |
private synchronized void retireMap(TaskInProgress tip) {
// Since a list for running maps is maintained if speculation is 'ON'
if (hasSpeculativeMaps) {
if (runningMapCache == null) {
LOG.warn("Running cache for maps missing!! " + "Job details are missing.");
... | synchronized void function(TaskInProgress tip) { if (hasSpeculativeMaps) { if (runningMapCache == null) { LOG.warn(STR + STR); return; } String[] splitLocations = tip.getSplitLocations(); if (splitLocations.length == 0) { nonLocalRunningMaps.remove(tip); return; } for (String host : splitLocations) { Node node = jobtra... | /**
* Remove a map TIP from the lists for running maps. Called when a map
* fails/completes (note if a map is killed, it won't be present in the list
* since it was completed earlier)
*
* @param tip
* the tip that needs to be retired
*/ | Remove a map TIP from the lists for running maps. Called when a map fails/completes (note if a map is killed, it won't be present in the list since it was completed earlier) | retireMap | {
"repo_name": "dongpf/hadoop-0.19.1",
"path": "src/mapred/org/apache/hadoop/mapred/JobInProgress.java",
"license": "apache-2.0",
"size": 91919
} | [
"java.util.Set",
"org.apache.hadoop.net.Node"
] | import java.util.Set; import org.apache.hadoop.net.Node; | import java.util.*; import org.apache.hadoop.net.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,123,038 |
@Override
public Set<String> smembers(final String key) {
checkIsInMultiOrPipeline();
client.smembers(key);
final List<String> members = client.getMultiBulkReply();
return SetFromList.of(members);
} | Set<String> function(final String key) { checkIsInMultiOrPipeline(); client.smembers(key); final List<String> members = client.getMultiBulkReply(); return SetFromList.of(members); } | /**
* Return all the members (elements) of the set value stored at key. This is just syntax glue for
* {@link #sinter(String...) SINTER}.
* <p>
* Time complexity O(N)
* @param key
* @return Multi bulk reply
*/ | Return all the members (elements) of the set value stored at key. This is just syntax glue for <code>#sinter(String...) SINTER</code>. Time complexity O(N) | smembers | {
"repo_name": "yapei123/jedis",
"path": "src/main/java/redis/clients/jedis/Jedis.java",
"license": "mit",
"size": 127680
} | [
"java.util.List",
"java.util.Set"
] | import java.util.List; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,780,399 |
public void exitApplication(boolean forceQuit, boolean exit)
{
if (!forceQuit) {
List<AgentInfo> agents = (List<AgentInfo>)
registry.lookup(LookupNames.AGENTS);
Iterator<AgentInfo> i = agents.iterator();
AgentInfo agentInfo;
Agent a;
//Agents termination phase.
i = agents.iterator();
List... | void function(boolean forceQuit, boolean exit) { if (!forceQuit) { List<AgentInfo> agents = (List<AgentInfo>) registry.lookup(LookupNames.AGENTS); Iterator<AgentInfo> i = agents.iterator(); AgentInfo agentInfo; Agent a; i = agents.iterator(); List<AgentInfo> notTerminated = new ArrayList<AgentInfo>(); while (i.hasNext(... | /** Shuts the services down and exits the application.
*
* @param forceQuit Pass <code>true</code> to force i.e. do not check if
* the application can terminate,
* <code>false</code> otherwise.
* @param exit Pass <code>true</code> to quit, <code>false</code> to
* only shut down the services... | Shuts the services down and exits the application | exitApplication | {
"repo_name": "aleksandra-tarkowska/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/DataServicesFactory.java",
"license": "gpl-2.0",
"size": 28581
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"org.openmicroscopy.shoola.env.Agent",
"org.openmicroscopy.shoola.env.Environment",
"org.openmicroscopy.shoola.env.LookupNames",
"org.openmicroscopy.shoola.env.cache.CacheServiceFactory",
"org.openmicroscopy.shoola.env.config.AgentInfo",
... | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.openmicroscopy.shoola.env.Agent; import org.openmicroscopy.shoola.env.Environment; import org.openmicroscopy.shoola.env.LookupNames; import org.openmicroscopy.shoola.env.cache.CacheServiceFactory; import org.openmicroscopy.shoola.e... | import java.util.*; import org.openmicroscopy.shoola.env.*; import org.openmicroscopy.shoola.env.cache.*; import org.openmicroscopy.shoola.env.config.*; import org.openmicroscopy.shoola.util.ui.*; | [
"java.util",
"org.openmicroscopy.shoola"
] | java.util; org.openmicroscopy.shoola; | 2,895,050 |
private void invokeBinaryValueDialog(TableItem item, String attributeName, int column, int rowNum) {
Dialog dialog = new MessageDialog(
Display.getDefault().getActiveShell(),
"Binary attribute",
AwsToolkitCore.getDefault().getImageRegis... | void function(TableItem item, String attributeName, int column, int rowNum) { Dialog dialog = new MessageDialog( Display.getDefault().getActiveShell(), STR, AwsToolkitCore.getDefault().getImageRegistry().get(AwsToolkitCore.IMAGE_AWS_ICON), STR + STR, MessageDialog.NONE, new String[] { STR, STR }, 0); int result = dialo... | /**
* Invokes a dialog showing a binary value or set of values.
*/ | Invokes a dialog showing a binary value or set of values | invokeBinaryValueDialog | {
"repo_name": "aws/aws-toolkit-eclipse",
"path": "bundles/com.amazonaws.eclipse.dynamodb/src/com/amazonaws/eclipse/dynamodb/editor/DynamoDBTableEditor.java",
"license": "apache-2.0",
"size": 64097
} | [
"com.amazonaws.eclipse.core.AwsToolkitCore",
"org.eclipse.jface.dialogs.Dialog",
"org.eclipse.jface.dialogs.MessageDialog",
"org.eclipse.swt.dnd.Clipboard",
"org.eclipse.swt.dnd.TextTransfer",
"org.eclipse.swt.dnd.Transfer",
"org.eclipse.swt.widgets.Display",
"org.eclipse.swt.widgets.TableItem"
] | import com.amazonaws.eclipse.core.AwsToolkitCore; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.wi... | import com.amazonaws.eclipse.core.*; import org.eclipse.jface.dialogs.*; import org.eclipse.swt.dnd.*; import org.eclipse.swt.widgets.*; | [
"com.amazonaws.eclipse",
"org.eclipse.jface",
"org.eclipse.swt"
] | com.amazonaws.eclipse; org.eclipse.jface; org.eclipse.swt; | 1,066,225 |
public void construct()
{
Node actualNode = root;
ArrayList<Node> recNodes = new ArrayList<Node>();
trainedList.add(actualNode);
while (actualNode != null)
{
if (actualNode.classes.size() > 1)
{
// Compute the distances to the center node (mean center)
double[] dist = distances(actualNode);... | void function() { Node actualNode = root; ArrayList<Node> recNodes = new ArrayList<Node>(); trainedList.add(actualNode); while (actualNode != null) { if (actualNode.classes.size() > 1) { double[] dist = distances(actualNode); TreeMap<Double, List<Integer>> map = new TreeMap<Double, List<Integer>>(); for(int i = 0; i < ... | /**
* It constructs the balanced binary tree
*/ | It constructs the balanced binary tree | construct | {
"repo_name": "triguero/Keel3.0",
"path": "src/keel/Algorithms/Decision_Trees/C45_Binarization/BTS.java",
"license": "gpl-3.0",
"size": 13026
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"java.util.TreeMap"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.TreeMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,855,453 |
protected void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_)
{
this.averageGroundLvl = tagCompound.getInteger("HPos");
this.villagersSpawned = tagCompound.getInteger("VCount");
this.structureType = tagCompound.getByt... | void function(NBTTagCompound tagCompound, TemplateManager p_143011_2_) { this.averageGroundLvl = tagCompound.getInteger("HPos"); this.villagersSpawned = tagCompound.getInteger(STR); this.structureType = tagCompound.getByte("Type"); if (tagCompound.getBoolean(STR)) { this.structureType = 1; } this.isZombieInfested = tag... | /**
* (abstract) Helper method to read subclass data from NBT
*/ | (abstract) Helper method to read subclass data from NBT | readStructureFromNBT | {
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraft/world/gen/structure/StructureVillagePieces.java",
"license": "lgpl-2.1",
"size": 136606
} | [
"net.minecraft.nbt.NBTTagCompound",
"net.minecraft.world.gen.structure.template.TemplateManager"
] | import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.gen.structure.template.TemplateManager; | import net.minecraft.nbt.*; import net.minecraft.world.gen.structure.template.*; | [
"net.minecraft.nbt",
"net.minecraft.world"
] | net.minecraft.nbt; net.minecraft.world; | 166,095 |
List<Ehitised> findENEhitiseOtsing(BigInteger aadressId) throws XRoadServiceConsumptionException; | List<Ehitised> findENEhitiseOtsing(BigInteger aadressId) throws XRoadServiceConsumptionException; | /**
* Find list of {@link Ehitised} objects by specified address id
*
* @param aadressId Aadressi ID
* @return list of {@link Ehitised} objects
* @throws XRoadServiceConsumptionException
*/ | Find list of <code>Ehitised</code> objects by specified address id | findENEhitiseOtsing | {
"repo_name": "nortal/j-road",
"path": "client-service/ehr/src/main/java/com/nortal/jroad/client/ehr/EhrXTeeService.java",
"license": "apache-2.0",
"size": 2898
} | [
"com.nortal.jroad.client.ehr.types.ee.riik.xtee.ehr.producers.producer.ehr.ENEhitiseOtsingResponse",
"com.nortal.jroad.client.exception.XRoadServiceConsumptionException",
"java.math.BigInteger",
"java.util.List"
] | import com.nortal.jroad.client.ehr.types.ee.riik.xtee.ehr.producers.producer.ehr.ENEhitiseOtsingResponse; import com.nortal.jroad.client.exception.XRoadServiceConsumptionException; import java.math.BigInteger; import java.util.List; | import com.nortal.jroad.client.ehr.types.ee.riik.xtee.ehr.producers.producer.ehr.*; import com.nortal.jroad.client.exception.*; import java.math.*; import java.util.*; | [
"com.nortal.jroad",
"java.math",
"java.util"
] | com.nortal.jroad; java.math; java.util; | 2,736,965 |
public static Name fromConstantString(String s) {
try {
return fromString(s, null);
} catch (TextParseException e) {
throw new IllegalArgumentException("Invalid name '" + s + "'");
}
}
public Name(DNSInput in) throws WireParseException {
int len, pos;
boolean done = false;
byte[] label = new b... | static Name function(String s) { try { return fromString(s, null); } catch (TextParseException e) { throw new IllegalArgumentException(STR + s + "'"); } } public Name(DNSInput in) throws WireParseException { int len, pos; boolean done = false; byte[] label = new byte[MAXLABEL + 1]; boolean savedState = false; while (!d... | /**
* Create a new name from a constant string. This should only be used when
* the name is known to be good - that is, when it is constant.
*
* @param s
* The string to be converted
* @return the name
*/ | Create a new name from a constant string. This should only be used when the name is known to be good - that is, when it is constant | fromConstantString | {
"repo_name": "confluxtoo/finflux_automation_test",
"path": "browsermob-proxy/src/main/java/org/xbill/DNS/Name.java",
"license": "mpl-2.0",
"size": 24035
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,236,830 |
public void saveNewGroupWithAcls(DBGroup group, List<DBAcl> acls)
throws InvalidRequestException, SQLException {
// verify that the acls actually apply correctly to group
validateGroupAcls(group, acls);
// The requestor must be able to edit secrets in the new group
Set<Integer> groupAdmins = ge... | void function(DBGroup group, List<DBAcl> acls) throws InvalidRequestException, SQLException { validateGroupAcls(group, acls); Set<Integer> groupAdmins = getFirstLevelUsers(acls, DBAcl.modifyGroupSecretsAccess()); if (!groupAdmins.contains(identity.getId())) { throw new InvalidRequestException(STR + identity.getName() +... | /**
* Saves a new group with new acls, if this user has permission and the group and ACLs
* are valid. This will throw an exception if the group and ACLs already exist.
*/ | Saves a new group with new acls, if this user has permission and the group and ACLs are valid. This will throw an exception if the group and ACLs already exist | saveNewGroupWithAcls | {
"repo_name": "ssgeejr/mitropm",
"path": "mitro-core/java/server/src/co/mitro/core/accesscontrol/AuthenticatedDB.java",
"license": "gpl-3.0",
"size": 20789
} | [
"co.mitro.core.exceptions.InvalidRequestException",
"co.mitro.core.server.data.DBAcl",
"co.mitro.core.server.data.DBGroup",
"java.sql.SQLException",
"java.util.List",
"java.util.Set"
] | import co.mitro.core.exceptions.InvalidRequestException; import co.mitro.core.server.data.DBAcl; import co.mitro.core.server.data.DBGroup; import java.sql.SQLException; import java.util.List; import java.util.Set; | import co.mitro.core.exceptions.*; import co.mitro.core.server.data.*; import java.sql.*; import java.util.*; | [
"co.mitro.core",
"java.sql",
"java.util"
] | co.mitro.core; java.sql; java.util; | 2,768,550 |
public void exitAnd_predicate(SQLParser.And_predicateContext ctx) { } | public void exitAnd_predicate(SQLParser.And_predicateContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterAnd_predicate | {
"repo_name": "HEIG-GAPS/slasher",
"path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java",
"license": "mit",
"size": 73849
} | [
"ch.gaps.slasher.corrector.SQLParser"
] | import ch.gaps.slasher.corrector.SQLParser; | import ch.gaps.slasher.corrector.*; | [
"ch.gaps.slasher"
] | ch.gaps.slasher; | 761,199 |
public void setValue(double theValue) throws StandardException
{
throwLangSetMismatch("double");
} | void function(double theValue) throws StandardException { throwLangSetMismatch(STR); } | /**
* Set the value of this DataValueDescriptor to the given double value
* At DataType level just throws an error lower classes will override
*
* @param theValue The value to set this DataValueDescriptor to
*
* @exception StandardException Thrown on error
*/ | Set the value of this DataValueDescriptor to the given double value At DataType level just throws an error lower classes will override | setValue | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/iapi/types/DataType.java",
"license": "apache-2.0",
"size": 34458
} | [
"org.apache.derby.iapi.error.StandardException"
] | import org.apache.derby.iapi.error.StandardException; | import org.apache.derby.iapi.error.*; | [
"org.apache.derby"
] | org.apache.derby; | 339,406 |
@ReturnNullAsFalse
public LongValue size(Env env)
{
try {
return LongValue.create(_javaCollection.size());
} catch (Exception ex) {
log.log(Level.FINE, ex.toString(), ex);
return null;
}
} | LongValue function(Env env) { try { return LongValue.create(_javaCollection.size()); } catch (Exception ex) { log.log(Level.FINE, ex.toString(), ex); return null; } } | /**
* Returns size of the collection
*/ | Returns size of the collection | size | {
"repo_name": "dwango/quercus",
"path": "src/main/java/com/caucho/quercus/lib/db/OracleOciCollection.java",
"license": "gpl-2.0",
"size": 7128
} | [
"com.caucho.quercus.env.Env",
"com.caucho.quercus.env.LongValue",
"java.util.logging.Level"
] | import com.caucho.quercus.env.Env; import com.caucho.quercus.env.LongValue; import java.util.logging.Level; | import com.caucho.quercus.env.*; import java.util.logging.*; | [
"com.caucho.quercus",
"java.util"
] | com.caucho.quercus; java.util; | 298,287 |
public void calculateLogLikelihoods(BigDecimal[] partials, double[] frequencies, double[] outLogLikelihoods)
{
BigDecimal[] freqs = new BigDecimal[frequencies.length];
for (int i = 0; i < freqs.length; i++) {
freqs[i] = new BigDecimal(frequencies[i], precision);
}
in... | void function(BigDecimal[] partials, double[] frequencies, double[] outLogLikelihoods) { BigDecimal[] freqs = new BigDecimal[frequencies.length]; for (int i = 0; i < freqs.length; i++) { freqs[i] = new BigDecimal(frequencies[i], precision); } int v = 0; for (int k = 0; k < patternCount; k++) { BigDecimal sum = BigDecim... | /**
* Calculates patten log likelihoods at a node.
* @param partials the partials used to calculate the likelihoods
* @param frequencies an array of state frequencies
* @param outLogLikelihoods an array into which the likelihoods will go
*/ | Calculates patten log likelihoods at a node | calculateLogLikelihoods | {
"repo_name": "whdc/ieo-beast",
"path": "src/dr/evomodel/treelikelihood/ArbitraryPrecisionLikelihoodCore.java",
"license": "lgpl-2.1",
"size": 17270
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 429,376 |
public List<String> getCreateAuthorizedLayersExclude() {
return createAuthorizedLayersExclude;
} | List<String> function() { return createAuthorizedLayersExclude; } | /**
* List of regular expressions of to exclude layers in which features can be created.
*
* @return list of regular expressions
*/ | List of regular expressions of to exclude layers in which features can be created | getCreateAuthorizedLayersExclude | {
"repo_name": "geomajas/geomajas-project-server",
"path": "plugin/staticsecurity/staticsecurity/src/main/java/org/geomajas/plugin/staticsecurity/configuration/LayerAuthorizationInfo.java",
"license": "agpl-3.0",
"size": 7689
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,754,791 |
private boolean isEnumeration(SemType type) {
if (type instanceof SemClass) {
Class<?> nativeClass = ((SemClass) type).getNativeClass();
if (nativeClass != null && nativeClass.isEnum()) return true;
return heuristicEnum((SemClass) type);
}
return false;
} | boolean function(SemType type) { if (type instanceof SemClass) { Class<?> nativeClass = ((SemClass) type).getNativeClass(); if (nativeClass != null && nativeClass.isEnum()) return true; return heuristicEnum((SemClass) type); } return false; } | /**
* Test whether a type is an enumeration type; if so, its translation is integer (at least for now).
* @param type the type to test
* @return true if it is an an enumeration
*/ | Test whether a type is an enumeration type; if so, its translation is integer (at least for now) | isEnumeration | {
"repo_name": "querycert/qcert",
"path": "compiler/parsingJava/jrulesParser/src/org/qcert/camp/translator/SemRule2CAMP.java",
"license": "apache-2.0",
"size": 70950
} | [
"com.ibm.rules.engine.lang.semantics.SemClass",
"com.ibm.rules.engine.lang.semantics.SemType"
] | import com.ibm.rules.engine.lang.semantics.SemClass; import com.ibm.rules.engine.lang.semantics.SemType; | import com.ibm.rules.engine.lang.semantics.*; | [
"com.ibm.rules"
] | com.ibm.rules; | 1,273,877 |
int paintUnselected(Graphics g, int start, int end, int x, int y)
throws BadLocationException; | int paintUnselected(Graphics g, int start, int end, int x, int y) throws BadLocationException; | /**
* Paints unselected range of text.
*
* @param g graphics to paint on.
* @param start the start of the unselected range.
* @param end the end of the unselected range.
* @param x the <var>x</var> coordinate of the text.
* @param y the <var>y</var> coordin... | Paints unselected range of text | paintUnselected | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/swing/src/main/java/common/javax/swing/text/TextInterval.java",
"license": "apache-2.0",
"size": 10411
} | [
"java.awt.Graphics"
] | import java.awt.Graphics; | import java.awt.*; | [
"java.awt"
] | java.awt; | 294,270 |
public IScope scope_MParameterValueRefObject_object(MParameterSWPSPSwitchCase switchCase, EReference reference)
{
MParameterSWPSPSwitch parameter = (MParameterSWPSPSwitch) switchCase.eContainer();
MSwPackage swp = (MSwPackage)parameter.eContainer();
Set<MParameter> params = mesputil.getParameters(swp);
... | IScope function(MParameterSWPSPSwitchCase switchCase, EReference reference) { MParameterSWPSPSwitch parameter = (MParameterSWPSPSwitch) switchCase.eContainer(); MSwPackage swp = (MSwPackage)parameter.eContainer(); Set<MParameter> params = mesputil.getParameters(swp); for (MAbstractSwPackage aswp : swp.getInherits()) { ... | /**
* Provides the scope for the referenceable objects that can be used
* in the default value assignment expressions of parameter
* depending on the supported platforms.
*
* @param pvaSwitchCase the platform-dependent value assignment expression.
* @param reference the object representing the reference wi... | Provides the scope for the referenceable objects that can be used in the default value assignment expressions of parameter depending on the supported platforms | scope_MParameterValueRefObject_object | {
"repo_name": "parraman/micobs",
"path": "mesp/es.uah.aut.srg.micobs.mesp.editor.swp/src/es/uah/aut/srg/micobs/mesp/lang/scoping/SWPScopeProvider.java",
"license": "epl-1.0",
"size": 45945
} | [
"es.uah.aut.srg.micobs.common.MParameter",
"es.uah.aut.srg.micobs.mesp.mespswi.MSwInterface",
"es.uah.aut.srg.micobs.mesp.mespswp.MAbstractSwPackage",
"es.uah.aut.srg.micobs.mesp.mespswp.MEnumParamSWPSPSwitch",
"es.uah.aut.srg.micobs.mesp.mespswp.MParameterSWPSPSwitch",
"es.uah.aut.srg.micobs.mesp.mespswp... | import es.uah.aut.srg.micobs.common.MParameter; import es.uah.aut.srg.micobs.mesp.mespswi.MSwInterface; import es.uah.aut.srg.micobs.mesp.mespswp.MAbstractSwPackage; import es.uah.aut.srg.micobs.mesp.mespswp.MEnumParamSWPSPSwitch; import es.uah.aut.srg.micobs.mesp.mespswp.MParameterSWPSPSwitch; import es.uah.aut.srg.mi... | import es.uah.aut.srg.micobs.common.*; import es.uah.aut.srg.micobs.mesp.mespswi.*; import es.uah.aut.srg.micobs.mesp.mespswp.*; import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.scoping.*; | [
"es.uah.aut",
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] | es.uah.aut; java.util; org.eclipse.emf; org.eclipse.xtext; | 2,320,468 |
public static String doGet(String coapURI) {
// create a Coap client to make a request to the URI
if (coapURI == null) {
return null;
}
CoapClient client = new CoapClient(coapURI);
CoapResponse response = client.get(MediaTypeRegistry.APPLICATION_JSON);
// if the Coap request succeed, return the payl... | static String function(String coapURI) { if (coapURI == null) { return null; } CoapClient client = new CoapClient(coapURI); CoapResponse response = client.get(MediaTypeRegistry.APPLICATION_JSON); if (response.isSuccess()) { System.out.println(STR + coapURI); return response.getResponseText(); } else { System.out.printl... | /**
* method for performing a GET COAP request
*
* @param coapUri
* - Uri for the coap request
* @param returns
* the Coap response
*/ | method for performing a GET COAP request | doGet | {
"repo_name": "mertenats/heia",
"path": "internet-applications/TP4/CoapProxy/src/ch/heiafr/tic/CoapWrapper.java",
"license": "gpl-3.0",
"size": 5558
} | [
"org.eclipse.californium.core.CoapClient",
"org.eclipse.californium.core.CoapResponse",
"org.eclipse.californium.core.coap.MediaTypeRegistry"
] | import org.eclipse.californium.core.CoapClient; import org.eclipse.californium.core.CoapResponse; import org.eclipse.californium.core.coap.MediaTypeRegistry; | import org.eclipse.californium.core.*; import org.eclipse.californium.core.coap.*; | [
"org.eclipse.californium"
] | org.eclipse.californium; | 78,945 |
@Override
public boolean registerTaskManager(final ResourceID resourceID) {
componentMainThreadExecutor.assertRunningInMainThread();
log.debug("Register new TaskExecutor {}.", resourceID);
return registeredTaskManagers.add(resourceID);
} | boolean function(final ResourceID resourceID) { componentMainThreadExecutor.assertRunningInMainThread(); log.debug(STR, resourceID); return registeredTaskManagers.add(resourceID); } | /**
* Register TaskManager to this pool, only those slots come from registered TaskManager will be considered valid.
* Also it provides a way for us to keep "dead" or "abnormal" TaskManagers out of this pool.
*
* @param resourceID The id of the TaskManager
*/ | Register TaskManager to this pool, only those slots come from registered TaskManager will be considered valid. Also it provides a way for us to keep "dead" or "abnormal" TaskManagers out of this pool | registerTaskManager | {
"repo_name": "gyfora/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPoolImpl.java",
"license": "apache-2.0",
"size": 49781
} | [
"org.apache.flink.runtime.clusterframework.types.ResourceID"
] | import org.apache.flink.runtime.clusterframework.types.ResourceID; | import org.apache.flink.runtime.clusterframework.types.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,727,028 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<StreamResponse> submitBatchWithResponseAsync(
String containerName,
long contentLength,
String multipartContentType,
Flux<ByteBuffer> body,
Integer timeout,
String requestId,
... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<StreamResponse> function( String containerName, long contentLength, String multipartContentType, Flux<ByteBuffer> body, Integer timeout, String requestId, Context context) { final String restype = STR; final String comp = "batch"; final String accept = STR; return servic... | /**
* The Batch operation allows multiple API calls to be embedded into a single HTTP request.
*
* @param containerName The container name.
* @param contentLength The length of the request.
* @param multipartContentType Required. The value of this header must be multipart/mixed with a batch bou... | The Batch operation allows multiple API calls to be embedded into a single HTTP request | submitBatchWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java",
"license": "mit",
"size": 69007
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.StreamResponse",
"com.azure.core.util.Context",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.StreamResponse; import com.azure.core.util.Context; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
] | com.azure.core; java.nio; | 1,743,604 |
private void scheduleNextChunk() {
synchronized (this) {
if (scheduled) {
// Dispatch task is already scheduled.
return;
}
// Schedule the next response chunk if there is one.
Chunk nextChunk = chunks.peek();
if (nextChunk != null) {
sched... | void function() { synchronized (this) { if (scheduled) { return; } Chunk nextChunk = chunks.peek(); if (nextChunk != null) { scheduled = true; executor.schedule(dispatchTask, nextChunk.delayMicroseconds, TimeUnit.MICROSECONDS); return; } } if (isInputComplete) { responseStream.onCompleted(); } } } | /**
* Schedules the next response chunk to be dispatched. If all input has been received and there
* are no more chunks in the queue, the stream is closed.
*/ | Schedules the next response chunk to be dispatched. If all input has been received and there are no more chunks in the queue, the stream is closed | scheduleNextChunk | {
"repo_name": "mingfly/grpc-java",
"path": "interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java",
"license": "bsd-3-clause",
"size": 15306
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 2,696,353 |
public static <T extends NamedElement> ElementMatcher.Junction<T> namedIgnoreCase(String name) {
return new NameMatcher<T>(new StringMatcher(name, StringMatcher.Mode.EQUALS_FULLY_IGNORE_CASE));
} | static <T extends NamedElement> ElementMatcher.Junction<T> function(String name) { return new NameMatcher<T>(new StringMatcher(name, StringMatcher.Mode.EQUALS_FULLY_IGNORE_CASE)); } | /**
* Matches a {@link NamedElement} for its name. The name's
* capitalization is ignored.
*
* @param name The expected name.
* @param <T> The type of the matched object.
* @return An element matcher for a named element's name.
*/ | Matches a <code>NamedElement</code> for its name. The name's capitalization is ignored | namedIgnoreCase | {
"repo_name": "DALDEI/byte-buddy",
"path": "byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ElementMatchers.java",
"license": "apache-2.0",
"size": 103880
} | [
"net.bytebuddy.description.NamedElement"
] | import net.bytebuddy.description.NamedElement; | import net.bytebuddy.description.*; | [
"net.bytebuddy.description"
] | net.bytebuddy.description; | 1,827,766 |
public static <T> T getAt(List<T> self, int idx) {
int size = self.size();
int i = normaliseIndex(idx, size);
if (i < size) {
return self.get(i);
} else {
return null;
}
} | static <T> T function(List<T> self, int idx) { int size = self.size(); int i = normaliseIndex(idx, size); if (i < size) { return self.get(i); } else { return null; } } | /**
* Support the subscript operator for a List.
* <pre class="groovyTestCase">def list = [2, "a", 5.3]
* assert list[1] == "a"</pre>
*
* @param self a List
* @param idx an index
* @return the value at the given index
* @since 1.0
*/ | Support the subscript operator for a List. def list = [2, "a", 5.3] assert list[1] == "a"</code> | getAt | {
"repo_name": "armsargis/groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 698233
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,497,077 |
@Override
public Integer save(TOptionSettingsBean optionSettingsBean) {
Criteria criteria = new Criteria();
if (optionSettingsBean!=null && optionSettingsBean.getObjectID()==null
&& optionSettingsBean.getConfig()!=null) {
criteria.add(CONFIG, optionSettingsBean.getConfig());
if (optionSettingsBean.g... | Integer function(TOptionSettingsBean optionSettingsBean) { Criteria criteria = new Criteria(); if (optionSettingsBean!=null && optionSettingsBean.getObjectID()==null && optionSettingsBean.getConfig()!=null) { criteria.add(CONFIG, optionSettingsBean.getConfig()); if (optionSettingsBean.getParameterCode()==null) { criter... | /**
* Saves an optionSettingsBean in the TOptionSettings table
* @param optionSettingsBean
* @return
*/ | Saves an optionSettingsBean in the TOptionSettings table | save | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/TOptionSettingsPeer.java",
"license": "gpl-3.0",
"size": 8743
} | [
"com.aurel.track.beans.TOptionSettingsBean",
"org.apache.torque.TorqueException",
"org.apache.torque.util.Criteria"
] | import com.aurel.track.beans.TOptionSettingsBean; import org.apache.torque.TorqueException; import org.apache.torque.util.Criteria; | import com.aurel.track.beans.*; import org.apache.torque.*; import org.apache.torque.util.*; | [
"com.aurel.track",
"org.apache.torque"
] | com.aurel.track; org.apache.torque; | 1,303,837 |
private boolean processCas(Object aCas) {
if (!(aCas instanceof CasData)) // || skipIfCasEmpty == null)
{
return false;
}
if (DATACasUtils.isCasEmpty((CasData) aCas)) {
return false; // dont process empty CAS'es
}
return hasFeature((CasData) aCas);
} | boolean function(Object aCas) { if (!(aCas instanceof CasData)) { return false; } if (DATACasUtils.isCasEmpty((CasData) aCas)) { return false; } return hasFeature((CasData) aCas); } | /**
* Checks if a given Cas has required features.
*
* @param aCas
* - Cas instance to check
*
* @return - true if feature is in the Cas, false otherwise
*/ | Checks if a given Cas has required features | processCas | {
"repo_name": "apache/uima-uimaj",
"path": "uimaj-cpe/src/main/java/org/apache/uima/collection/impl/cpm/container/ProcessingContainer_Impl.java",
"license": "apache-2.0",
"size": 60623
} | [
"org.apache.uima.cas_data.CasData",
"org.apache.uima.collection.impl.cpm.vinci.DATACasUtils"
] | import org.apache.uima.cas_data.CasData; import org.apache.uima.collection.impl.cpm.vinci.DATACasUtils; | import org.apache.uima.cas_data.*; import org.apache.uima.collection.impl.cpm.vinci.*; | [
"org.apache.uima"
] | org.apache.uima; | 2,832,763 |
@Override
public List<HSSFHyperlink> getHyperlinkList() {
final List<HSSFHyperlink> hyperlinkList = new ArrayList<>();
for (RecordBase rec : _sheet.getRecords()) {
if (rec instanceof HyperlinkRecord) {
HyperlinkRecord link = (HyperlinkRecord) rec;
hype... | List<HSSFHyperlink> function() { final List<HSSFHyperlink> hyperlinkList = new ArrayList<>(); for (RecordBase rec : _sheet.getRecords()) { if (rec instanceof HyperlinkRecord) { HyperlinkRecord link = (HyperlinkRecord) rec; hyperlinkList.add(new HSSFHyperlink(link)); } } return hyperlinkList; } | /**
* Get a list of Hyperlinks in this sheet
*
* @return Hyperlinks for the sheet
*/ | Get a list of Hyperlinks in this sheet | getHyperlinkList | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/poi/org/apache/poi/hssf/usermodel/HSSFSheet.java",
"license": "gpl-2.0",
"size": 94953
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.poi.hssf.record.HyperlinkRecord",
"org.apache.poi.hssf.record.RecordBase"
] | import java.util.ArrayList; import java.util.List; import org.apache.poi.hssf.record.HyperlinkRecord; import org.apache.poi.hssf.record.RecordBase; | import java.util.*; import org.apache.poi.hssf.record.*; | [
"java.util",
"org.apache.poi"
] | java.util; org.apache.poi; | 2,619,538 |
public Observable<ServiceResponse<Page<SqlVirtualMachineGroupInner>>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<SqlVirtualMachineGroupInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all SQL virtual machine groups in a resource group.
*
ServiceResponse<PageImpl<SqlVirtualMachineGroupInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return th... | Gets all SQL virtual machine groups in a resource group | listByResourceGroupNextSinglePageAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/sqlvirtualmachine/mgmt-v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sqlvirtualmachine/v2017_03_01_preview/implementation/SqlVirtualMachineGroupsInner.java",
"license": "mit",
"size": 82749
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 526,124 |
@Asynchronous
public void loadOntologies(List<OntologyBean> setupOntologyList, boolean clear, User currentUser, Identity identity) {
CurrentUserFactory currentUserFactory =
(CurrentUserFactory) Component.getInstance("currentUserFactory");
currentUserFactory.setCurrentUser(currentUser);
SystemStatus... | void function(List<OntologyBean> setupOntologyList, boolean clear, User currentUser, Identity identity) { CurrentUserFactory currentUserFactory = (CurrentUserFactory) Component.getInstance(STR); currentUserFactory.setCurrentUser(currentUser); SystemStatus status = new SystemStatus(STR); status.setId(STR); status.setPro... | /**
* Imports ontologies into the system. The currentUser and the identity MUST be
* given as a parameter to ensure, that the importer has the correct user, otherwise
* the anonymous user would be used to import ontologies.
*
* @param setupOntologyList
* @param clear
* @param currentUser
* @param ide... | Imports ontologies into the system. The currentUser and the identity MUST be given as a parameter to ensure, that the importer has the correct user, otherwise the anonymous user would be used to import ontologies | loadOntologies | {
"repo_name": "fregaham/KiWi",
"path": "src/action/kiwi/action/setup/AsynchronousOntologyLoader.java",
"license": "bsd-3-clause",
"size": 7496
} | [
"java.io.InputStream",
"java.util.List",
"javax.transaction.HeuristicMixedException",
"javax.transaction.HeuristicRollbackException",
"javax.transaction.NotSupportedException",
"javax.transaction.RollbackException",
"javax.transaction.SystemException",
"kiwi.api.reasoning.ReasoningService",
"kiwi.ap... | import java.io.InputStream; import java.util.List; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.NotSupportedException; import javax.transaction.RollbackException; import javax.transaction.SystemException; import kiwi.api.reasoning.Reason... | import java.io.*; import java.util.*; import javax.transaction.*; import kiwi.api.reasoning.*; import kiwi.api.setup.*; import kiwi.context.*; import kiwi.model.status.*; import kiwi.model.user.*; import kiwi.service.importexport.*; import kiwi.service.transaction.*; import org.jboss.seam.*; import org.jboss.seam.secur... | [
"java.io",
"java.util",
"javax.transaction",
"kiwi.api.reasoning",
"kiwi.api.setup",
"kiwi.context",
"kiwi.model.status",
"kiwi.model.user",
"kiwi.service.importexport",
"kiwi.service.transaction",
"org.jboss.seam"
] | java.io; java.util; javax.transaction; kiwi.api.reasoning; kiwi.api.setup; kiwi.context; kiwi.model.status; kiwi.model.user; kiwi.service.importexport; kiwi.service.transaction; org.jboss.seam; | 352,468 |
public static Set<Double> toSet(double... array) {
PreCon.notNull(array);
HashSet<Double> result = new HashSet<>(array.length + 5);
for (double b : array) {
result.add(b);
}
return result;
} | static Set<Double> function(double... array) { PreCon.notNull(array); HashSet<Double> result = new HashSet<>(array.length + 5); for (double b : array) { result.add(b); } return result; } | /**
* Convert an array to a {@link java.util.Set}.
*
* @param array The array to convert.
*/ | Convert an array to a <code>java.util.Set</code> | toSet | {
"repo_name": "JCThePants/NucleusFramework",
"path": "src/com/jcwhatever/nucleus/utils/ArrayUtils.java",
"license": "mit",
"size": 83295
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,472,208 |
public static boolean allowListExport() {
return getBooleanProperty(DynamoConstants.SP_ALLOW_LIST_EXPORT, null);
} | static boolean function() { return getBooleanProperty(DynamoConstants.SP_ALLOW_LIST_EXPORT, null); } | /**
* Returns whether export of grid contents to Excel/CSV is allowed. This system
* property can be used to either enable or disable this on the application
* level.
*
* @return
*/ | Returns whether export of grid contents to Excel/CSV is allowed. This system property can be used to either enable or disable this on the application level | allowListExport | {
"repo_name": "opencirclesolutions/dynamo",
"path": "dynamo-api/src/main/java/com/ocs/dynamo/util/SystemPropertyUtils.java",
"license": "apache-2.0",
"size": 11653
} | [
"com.ocs.dynamo.constants.DynamoConstants"
] | import com.ocs.dynamo.constants.DynamoConstants; | import com.ocs.dynamo.constants.*; | [
"com.ocs.dynamo"
] | com.ocs.dynamo; | 1,349,555 |
public RexNode and(Iterable<? extends RexNode> operands) {
return RexUtil.composeConjunction(cluster.getRexBuilder(), operands);
} | RexNode function(Iterable<? extends RexNode> operands) { return RexUtil.composeConjunction(cluster.getRexBuilder(), operands); } | /** Creates an AND.
*
* <p>Simplifies the expression a little:
* {@code e AND TRUE} becomes {@code e};
* {@code e AND e2 AND NOT e} becomes {@code e2}. */ | Creates an AND. Simplifies the expression a little: e AND TRUE becomes e | and | {
"repo_name": "nishantmonu51/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveSubQRemoveRelBuilder.java",
"license": "apache-2.0",
"size": 62589
} | [
"org.apache.calcite.rex.RexNode",
"org.apache.calcite.rex.RexUtil"
] | import org.apache.calcite.rex.RexNode; import org.apache.calcite.rex.RexUtil; | import org.apache.calcite.rex.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,519,194 |
@Override
public Adapter createApplicationInstanceAdapter() {
if (applicationInstanceItemProvider == null) {
applicationInstanceItemProvider = new ApplicationInstanceItemProvider(this);
}
return applicationInstanceItemProvider;
}
protected RequestItemProvider requestItemProvider; | Adapter function() { if (applicationInstanceItemProvider == null) { applicationInstanceItemProvider = new ApplicationInstanceItemProvider(this); } return applicationInstanceItemProvider; } protected RequestItemProvider requestItemProvider; | /**
* This creates an adapter for a {@link org.eclipse.incquery.examples.cps.cyberPhysicalSystem.ApplicationInstance}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This creates an adapter for a <code>org.eclipse.incquery.examples.cps.cyberPhysicalSystem.ApplicationInstance</code>. | createApplicationInstanceAdapter | {
"repo_name": "ZsoltKovari/incquery-examples-cps",
"path": "domains/org.eclipse.incquery.examples.cps.model.edit/src/org/eclipse/incquery/examples/cps/cyberPhysicalSystem/provider/CyberPhysicalSystemItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 13614
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,239,743 |
public CountDownLatch getEntityAsync(String entityListFullName, String id, AsyncCallback<com.fasterxml.jackson.databind.JsonNode> callback) throws Exception
{
return getEntityAsync( entityListFullName, id, null, callback);
} | CountDownLatch function(String entityListFullName, String id, AsyncCallback<com.fasterxml.jackson.databind.JsonNode> callback) throws Exception { return getEntityAsync( entityListFullName, id, null, callback); } | /**
* Retrieves an entity with an associated entity list and context level at tenant, master catalog, catalog, or site.
* <p><pre><code>
* Entity entity = new Entity();
* CountDownLatch latch = entity.getEntity( entityListFullName, id, callback );
* latch.await() * </code></pre></p>
* @param entityListFu... | Retrieves an entity with an associated entity list and context level at tenant, master catalog, catalog, or site. <code><code> Entity entity = new Entity(); CountDownLatch latch = entity.getEntity( entityListFullName, id, callback ); latch.await() * </code></code> | getEntityAsync | {
"repo_name": "sanjaymandadi/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/platform/entitylists/EntityResource.java",
"license": "mit",
"size": 19390
} | [
"com.mozu.api.AsyncCallback",
"java.util.concurrent.CountDownLatch"
] | import com.mozu.api.AsyncCallback; import java.util.concurrent.CountDownLatch; | import com.mozu.api.*; import java.util.concurrent.*; | [
"com.mozu.api",
"java.util"
] | com.mozu.api; java.util; | 190,137 |
RemoteAsyncResult exportObject() throws RemoteException {
ivObjectID = ivRemoteRuntime.activateAsyncResult((Servant) createTie());
return ivRemoteRuntime.getAsyncResultReference(ivObjectID);
} | RemoteAsyncResult exportObject() throws RemoteException { ivObjectID = ivRemoteRuntime.activateAsyncResult((Servant) createTie()); return ivRemoteRuntime.getAsyncResultReference(ivObjectID); } | /**
* Export this object so that it is remotely accessible.
*
* <p>This method must be called before the async work is scheduled.
*/ | Export this object so that it is remotely accessible. This method must be called before the async work is scheduled | exportObject | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.ejbcontainer.async/src/com/ibm/ws/ejbcontainer/async/osgi/internal/RemoteAsyncResultImpl.java",
"license": "epl-1.0",
"size": 10999
} | [
"com.ibm.ejs.container.RemoteAsyncResult",
"java.rmi.RemoteException",
"org.omg.PortableServer"
] | import com.ibm.ejs.container.RemoteAsyncResult; import java.rmi.RemoteException; import org.omg.PortableServer; | import com.ibm.ejs.container.*; import java.rmi.*; import org.omg.*; | [
"com.ibm.ejs",
"java.rmi",
"org.omg"
] | com.ibm.ejs; java.rmi; org.omg; | 481,490 |
@Test(expected = AccountNotFoundException.class)
public void isExceptionThrownWhenTryModifyAccountThatDoesntExist()
throws AccountAlreadyExistsException, AccountNotFoundException {
instance.updateAccount(USERNAME, NONEXISTENT, walletAccount);
} | @Test(expected = AccountNotFoundException.class) void function() throws AccountAlreadyExistsException, AccountNotFoundException { instance.updateAccount(USERNAME, NONEXISTENT, walletAccount); } | /**
* Method updateAccount should throws AccountNotFoundException when the account with given name
* doesn't exist.
*
* @throws AccountAlreadyExistsException
* @throws AccountNotFoundException
*/ | Method updateAccount should throws AccountNotFoundException when the account with given name doesn't exist | isExceptionThrownWhenTryModifyAccountThatDoesntExist | {
"repo_name": "mariuszfoltak/my-budget",
"path": "server/src/test/java/pl/foltak/mybudget/server/dao/MyBudgetDaoAccountTest.java",
"license": "gpl-2.0",
"size": 7237
} | [
"org.junit.Test",
"pl.foltak.mybudget.server.dao.exception.AccountAlreadyExistsException",
"pl.foltak.mybudget.server.dao.exception.AccountNotFoundException"
] | import org.junit.Test; import pl.foltak.mybudget.server.dao.exception.AccountAlreadyExistsException; import pl.foltak.mybudget.server.dao.exception.AccountNotFoundException; | import org.junit.*; import pl.foltak.mybudget.server.dao.exception.*; | [
"org.junit",
"pl.foltak.mybudget"
] | org.junit; pl.foltak.mybudget; | 847,177 |
static <K, V> void populateMap(Map<K, V> map, ObjectInputStream stream,
int size) throws IOException, ClassNotFoundException {
for (int i = 0; i < size; i++) {
@SuppressWarnings("unchecked") // reading data stored by writeMap
K key = (K) stream.readObject();
@SuppressWarnings("unchecked") ... | static <K, V> void populateMap(Map<K, V> map, ObjectInputStream stream, int size) throws IOException, ClassNotFoundException { for (int i = 0; i < size; i++) { @SuppressWarnings(STR) K key = (K) stream.readObject(); @SuppressWarnings(STR) V value = (V) stream.readObject(); map.put(key, value); } } | /**
* Populates a map by reading an input stream, as part of deserialization.
* See {@link #writeMap} for the data format. The size is determined by a
* prior call to {@link #readCount}.
*/ | Populates a map by reading an input stream, as part of deserialization. See <code>#writeMap</code> for the data format. The size is determined by a prior call to <code>#readCount</code> | populateMap | {
"repo_name": "mike10004/appengine-imaging",
"path": "gaecompat-awt-imaging/src/common/com/gaecompat/repackaged/com/google/common/collect/Serialization.java",
"license": "apache-2.0",
"size": 8363
} | [
"java.io.IOException",
"java.io.ObjectInputStream",
"java.util.Map"
] | import java.io.IOException; import java.io.ObjectInputStream; import java.util.Map; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 216,307 |
private void refreshMetadataCache(final Queue<MetadataSystem> metadataSystemCache, final DecompilerSettings settings)
{
metadataSystemCache.clear();
for (int i = 0; i < this.getNumberOfThreads(); i++)
{
metadataSystemCache.add(new NoRetryMetadataSystem(settings.getTypeLoader(... | void function(final Queue<MetadataSystem> metadataSystemCache, final DecompilerSettings settings) { metadataSystemCache.clear(); for (int i = 0; i < this.getNumberOfThreads(); i++) { metadataSystemCache.add(new NoRetryMetadataSystem(settings.getTypeLoader())); } } private class DecompileExecutor extends Thread { privat... | /**
* The metadata cache can become huge over time. This simply flushes it periodically.
*/ | The metadata cache can become huge over time. This simply flushes it periodically | refreshMetadataCache | {
"repo_name": "OndraZizka/windup",
"path": "decompiler/impl-procyon/src/main/java/org/jboss/windup/decompiler/procyon/ProcyonDecompiler.java",
"license": "epl-1.0",
"size": 29948
} | [
"com.strobel.assembler.metadata.MetadataSystem",
"com.strobel.assembler.metadata.NoRetryMetadataSystem",
"com.strobel.decompiler.DecompilerSettings",
"java.io.File",
"java.util.Queue"
] | import com.strobel.assembler.metadata.MetadataSystem; import com.strobel.assembler.metadata.NoRetryMetadataSystem; import com.strobel.decompiler.DecompilerSettings; import java.io.File; import java.util.Queue; | import com.strobel.assembler.metadata.*; import com.strobel.decompiler.*; import java.io.*; import java.util.*; | [
"com.strobel.assembler",
"com.strobel.decompiler",
"java.io",
"java.util"
] | com.strobel.assembler; com.strobel.decompiler; java.io; java.util; | 453,937 |
omitProperties = true;
return this;
}
/**
* Tells GSON to parse properties in a {@link Message}
*
* @return the newly configured {@link MessageTypeAdapterFactory} | omitProperties = true; return this; } /** * Tells GSON to parse properties in a {@link Message} * * @return the newly configured {@link MessageTypeAdapterFactory} | /**
* Tells GSON to skip parsing properties in a {@link Message}
*
* @return the newly configured {@link MessageTypeAdapterFactory}
*/ | Tells GSON to skip parsing properties in a <code>Message</code> | omitParsingProperties | {
"repo_name": "zoozooll/MyExercise",
"path": "meep/Meep/src/com/oregonscientific/meep/msm/internal/MessageTypeAdapterFactory.java",
"license": "apache-2.0",
"size": 6455
} | [
"com.oregonscientific.meep.msm.Message"
] | import com.oregonscientific.meep.msm.Message; | import com.oregonscientific.meep.msm.*; | [
"com.oregonscientific.meep"
] | com.oregonscientific.meep; | 910,916 |
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String name, Boolean forceDelete) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (nam... | Observable<ServiceResponse<Void>> function(String resourceGroupName, String name, Boolean forceDelete) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (name == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentExcepti... | /**
* Delete an App Service Environment.
* Delete an App Service Environment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @param forceDelete Specify <code>true</code> to force the de... | Delete an App Service Environment. Delete an App Service Environment | beginDeleteWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java",
"license": "mit",
"size": 595166
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,234,474 |
public void addChangeListener(ChangeListener l) {
changeListeners.add(l);
} | void function(ChangeListener l) { changeListeners.add(l); } | /**
* Adds the listener to the internal set of listeners. Gets notified when
* the option string changes.
*
* @param l the listener to add
*/ | Adds the listener to the internal set of listeners. Gets notified when the option string changes | addChangeListener | {
"repo_name": "gditzler/MassiveOnlineAnalysis",
"path": "moa/src/moa-2013.08-sources/moa-src/src/main/java/moa/gui/ClassOptionEditComponent.java",
"license": "gpl-3.0",
"size": 4390
} | [
"javax.swing.event.ChangeListener"
] | import javax.swing.event.ChangeListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 34,060 |
public boolean onCustomEvent(DiscoveryCustomMessage msg, AffinityTopologyVersion topVer, ClusterNode node) {
if (msg instanceof SchemaAbstractDiscoveryMessage) {
ctx.query().onDiscovery((SchemaAbstractDiscoveryMessage)msg);
return false;
}
if (msg instanceof CacheAf... | boolean function(DiscoveryCustomMessage msg, AffinityTopologyVersion topVer, ClusterNode node) { if (msg instanceof SchemaAbstractDiscoveryMessage) { ctx.query().onDiscovery((SchemaAbstractDiscoveryMessage)msg); return false; } if (msg instanceof CacheAffinityChangeMessage) return sharedCtx.affinity().onCustomEvent(((C... | /**
* Callback invoked from discovery thread when discovery custom message is received.
*
* @param msg Customer message.
* @param topVer Current topology version.
* @param node Node sent message.
* @return {@code True} if minor topology version should be increased.
*/ | Callback invoked from discovery thread when discovery custom message is received | onCustomEvent | {
"repo_name": "SomeFire/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java",
"license": "apache-2.0",
"size": 207339
} | [
"org.apache.ignite.cluster.ClusterNode",
"org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage",
"org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
"org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage",
"org.apache.ignite.internal.... | import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage; import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage; import org.apache.ig... | import org.apache.ignite.cluster.*; import org.apache.ignite.internal.managers.discovery.*; import org.apache.ignite.internal.processors.affinity.*; import org.apache.ignite.internal.processors.cache.persistence.snapshot.*; import org.apache.ignite.internal.processors.query.schema.message.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,420,351 |
public BlockInputStreams getTmpInputStreams(Block b, long blkoff, long ckoff)
throws IOException;
static class BlockWriteStreams {
OutputStream dataOut;
OutputStream checksumOut;
BlockWriteStreams(OutputStream dOut, OutputStream cOut) {
dataOut = dOut;
checksu... | BlockInputStreams function(Block b, long blkoff, long ckoff) throws IOException; static class BlockWriteStreams { OutputStream dataOut; OutputStream checksumOut; BlockWriteStreams(OutputStream dOut, OutputStream cOut) { dataOut = dOut; checksumOut = cOut; } } static class BlockInputStreams implements Closeable { final ... | /**
* Returns an input stream at specified offset of the specified block
* The block is still in the tmp directory and is not finalized
* @param b
* @param blkoff
* @param ckoff
* @return an input stream to read the contents of the specified block,
* starting at the offset
* @throws IOException... | Returns an input stream at specified offset of the specified block The block is still in the tmp directory and is not finalized | getTmpInputStreams | {
"repo_name": "baggioss/hadoop-with-transparentcompress",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDatasetInterface.java",
"license": "apache-2.0",
"size": 8180
} | [
"java.io.Closeable",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"org.apache.hadoop.hdfs.protocol.Block"
] | import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import org.apache.hadoop.hdfs.protocol.Block; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 597,426 |
Collection<TPolicy> list(); | Collection<TPolicy> list(); | /**
* List the policies
*
* @return policy list
*/ | List the policies | list | {
"repo_name": "KromatikSolutions/dasshy",
"path": "dasshy-server/src/main/java/com/kromatik/dasshy/server/dao/PolicyDao.java",
"license": "gpl-3.0",
"size": 1619
} | [
"com.kromatik.dasshy.thrift.model.TPolicy",
"java.util.Collection"
] | import com.kromatik.dasshy.thrift.model.TPolicy; import java.util.Collection; | import com.kromatik.dasshy.thrift.model.*; import java.util.*; | [
"com.kromatik.dasshy",
"java.util"
] | com.kromatik.dasshy; java.util; | 1,719,922 |
public int compare(final Object a_program1, final Object a_program2) {
IGPProgram progOne = (IGPProgram) a_program1;
IGPProgram progTwo = (IGPProgram) a_program2;
if (m_fitnessEvaluator.isFitter(progOne, progTwo)) {
return -1;
}
else if (m_fitnessEvaluator.isFitter(progTwo, progOne)) {... | int function(final Object a_program1, final Object a_program2) { IGPProgram progOne = (IGPProgram) a_program1; IGPProgram progTwo = (IGPProgram) a_program2; if (m_fitnessEvaluator.isFitter(progOne, progTwo)) { return -1; } else if (m_fitnessEvaluator.isFitter(progTwo, progOne)) { return 1; } else { return 0; } } | /**
* Compares two programs by using a FitnessEvaluator.
*
* @param a_program1 the first program to compare
* @param a_program2 the second program to compare
* @return -1 if a_program1 is fitter than a_program2, 1 if it is the other
* way round and 0 if both are equal
*
* @author Klaus M... | Compares two programs by using a FitnessEvaluator | compare | {
"repo_name": "jsubercaze/parallelJGAP",
"path": "src/main/java/org/jgap/gp/impl/GPProgramFitnessComparator.java",
"license": "lgpl-2.1",
"size": 2381
} | [
"org.jgap.gp.IGPProgram"
] | import org.jgap.gp.IGPProgram; | import org.jgap.gp.*; | [
"org.jgap.gp"
] | org.jgap.gp; | 90,145 |
@FIXVersion(introduced = "4.3")
@TagNumRef(tagNum = TagNum.SettlType)
public String getSettlType() {
return settlType;
} | @FIXVersion(introduced = "4.3") @TagNumRef(tagNum = TagNum.SettlType) String function() { return settlType; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getSettlType | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/group/QuoteRequestRejectGroup.java",
"license": "gpl-3.0",
"size": 50378
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,896,676 |
public static ClusterGroupEmptyCheckedException emptyTopologyException() {
return new ClusterGroupEmptyCheckedException("Cluster group is empty.");
} | static ClusterGroupEmptyCheckedException function() { return new ClusterGroupEmptyCheckedException(STR); } | /**
* Creates appropriate empty projection exception.
*
* @return Empty projection exception.
*/ | Creates appropriate empty projection exception | emptyTopologyException | {
"repo_name": "apache/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 387878
} | [
"org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException"
] | import org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException; | import org.apache.ignite.internal.cluster.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,234,754 |
public static void deleteTable( Connection con, String schema, String table )
{
LOG.log( Level.INFO, () -> "Deleting " + schema + "." + table );
try( Statement s = con.createStatement() ) {
s.execute( "DELETE FROM " + schema + "." + table );
}
catch( SQLException ex )... | static void function( Connection con, String schema, String table ) { LOG.log( Level.INFO, () -> STR + schema + "." + table ); try( Statement s = con.createStatement() ) { s.execute( STR + schema + "." + table ); } catch( SQLException ex ) { throw new UncheckedSQLException( ex ); } } | /**
* Delete the contents of a table
* <p>
* @param con Connection
* @param schema Database schema
* @param table Table name
*/ | Delete the contents of a table | deleteTable | {
"repo_name": "peter-mount/opendata-common",
"path": "core/src/main/java/uk/trainwatch/util/sql/SQL.java",
"license": "apache-2.0",
"size": 15799
} | [
"java.sql.Connection",
"java.sql.SQLException",
"java.sql.Statement",
"java.util.logging.Level"
] | import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.logging.Level; | import java.sql.*; import java.util.logging.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 74,809 |
protected static void setDistributionManagerType(int vmType) {
switch (vmType) {
case NORMAL_DM_TYPE:
case LONER_DM_TYPE:
case ADMIN_ONLY_DM_TYPE:
case LOCATOR_DM_TYPE:
distributionManagerType.set(Integer.valueOf(vmType));
break;
default:
throw new IllegalArgumentException... | static void function(int vmType) { switch (vmType) { case NORMAL_DM_TYPE: case LONER_DM_TYPE: case ADMIN_ONLY_DM_TYPE: case LOCATOR_DM_TYPE: distributionManagerType.set(Integer.valueOf(vmType)); break; default: throw new IllegalArgumentException(LocalizedStrings.DistributionManager_UNKNOWN_DISTRIBUTIONMANAGERTYPE_0.toL... | /**
* Sets the distribution manager's type (using an InheritableThreadLocal).
*
* @since 3.5
*/ | Sets the distribution manager's type (using an InheritableThreadLocal) | setDistributionManagerType | {
"repo_name": "fengshao0907/incubator-geode",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/DistributionManager.java",
"license": "apache-2.0",
"size": 176212
} | [
"com.gemstone.gemfire.internal.i18n.LocalizedStrings"
] | import com.gemstone.gemfire.internal.i18n.LocalizedStrings; | import com.gemstone.gemfire.internal.i18n.*; | [
"com.gemstone.gemfire"
] | com.gemstone.gemfire; | 2,507,981 |
long averageLong(Queryable<T> source,
FunctionExpression<LongFunction1<T>> selector); | long averageLong(Queryable<T> source, FunctionExpression<LongFunction1<T>> selector); | /**
* Computes the average of a sequence of long values
* that is obtained by invoking a projection function on each
* element of the input sequence.
*/ | Computes the average of a sequence of long values that is obtained by invoking a projection function on each element of the input sequence | averageLong | {
"repo_name": "YrAuYong/incubator-calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/QueryableFactory.java",
"license": "apache-2.0",
"size": 27890
} | [
"org.apache.calcite.linq4j.function.LongFunction1",
"org.apache.calcite.linq4j.tree.FunctionExpression"
] | import org.apache.calcite.linq4j.function.LongFunction1; import org.apache.calcite.linq4j.tree.FunctionExpression; | import org.apache.calcite.linq4j.function.*; import org.apache.calcite.linq4j.tree.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,326,802 |
String command = (String) msg;
if (command.startsWith("get ")) {
String key = command.substring("get ".length());
BinaryMemcacheRequest req = new DefaultBinaryMemcacheRequest(key);
req.setOpcode(BinaryMemcacheOpcodes.GET);
req.setKeyLength((short) key.length());
... | String command = (String) msg; if (command.startsWith(STR)) { String key = command.substring(STR.length()); BinaryMemcacheRequest req = new DefaultBinaryMemcacheRequest(key); req.setOpcode(BinaryMemcacheOpcodes.GET); req.setKeyLength((short) key.length()); req.setTotalBodyLength(key.length()); ctx.write(req, promise); ... | /**
* Transforms basic string requests to binary memcache requests
*/ | Transforms basic string requests to binary memcache requests | write | {
"repo_name": "XClouded/t4f-core",
"path": "java/io/src/main/tmp/netty5/memcache/binary/MemcacheClientHandler.java",
"license": "apache-2.0",
"size": 3251
} | [
"io.netty.buffer.ByteBuf",
"io.netty.buffer.Unpooled",
"io.netty.handler.codec.memcache.binary.BinaryMemcacheOpcodes",
"io.netty.handler.codec.memcache.binary.BinaryMemcacheRequest",
"io.netty.handler.codec.memcache.binary.DefaultBinaryMemcacheRequest",
"io.netty.handler.codec.memcache.binary.DefaultFullB... | import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.handler.codec.memcache.binary.BinaryMemcacheOpcodes; import io.netty.handler.codec.memcache.binary.BinaryMemcacheRequest; import io.netty.handler.codec.memcache.binary.DefaultBinaryMemcacheRequest; import io.netty.handler.codec.memcache.bi... | import io.netty.buffer.*; import io.netty.handler.codec.memcache.binary.*; import io.netty.util.*; | [
"io.netty.buffer",
"io.netty.handler",
"io.netty.util"
] | io.netty.buffer; io.netty.handler; io.netty.util; | 2,106,552 |
private int addNewTerminalView(TerminalBridge bridge) {
// let them know about our prompt handler services
bridge.promptHelper.setHandler(promptHandler);
// inflate each terminal view
RelativeLayout view = (RelativeLayout) inflater.inflate(R.layout.item_terminal, flip, false);
... | int function(TerminalBridge bridge) { bridge.promptHelper.setHandler(promptHandler); RelativeLayout view = (RelativeLayout) inflater.inflate(R.layout.item_terminal, flip, false); TextView overlay = (TextView) view.findViewById(R.id.terminal_overlay); overlay.setText(bridge.host.getNickname()); TerminalView terminal = n... | /**
* Adds a new TerminalBridge to the current set of views in our ViewFlipper.
*
* @param bridge
* TerminalBridge to add to our ViewFlipper
* @return the child index of the new view in the ViewFlipper
*/ | Adds a new TerminalBridge to the current set of views in our ViewFlipper | addNewTerminalView | {
"repo_name": "ddrown/irssiconnectbot",
"path": "src/org/woltage/irssiconnectbot/ConsoleActivity.java",
"license": "apache-2.0",
"size": 49405
} | [
"android.widget.RelativeLayout",
"android.widget.TextView",
"org.woltage.irssiconnectbot.service.TerminalBridge"
] | import android.widget.RelativeLayout; import android.widget.TextView; import org.woltage.irssiconnectbot.service.TerminalBridge; | import android.widget.*; import org.woltage.irssiconnectbot.service.*; | [
"android.widget",
"org.woltage.irssiconnectbot"
] | android.widget; org.woltage.irssiconnectbot; | 2,848,253 |
public static java.util.List extractEDPrescriptionList(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EDPrescriptionVoCollection voCollection)
{
return extractEDPrescriptionList(domainFactory, voCollection, null, new HashMap());
}
| static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.EDPrescriptionVoCollection voCollection) { return extractEDPrescriptionList(domainFactory, voCollection, null, new HashMap()); } | /**
* Create the ims.emergency.domain.objects.EDPrescription list from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/ | Create the ims.emergency.domain.objects.EDPrescription list from the value object collection | extractEDPrescriptionList | {
"repo_name": "FreudianNM/openMAXIMS",
"path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/EDPrescriptionVoAssembler.java",
"license": "agpl-3.0",
"size": 22100
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,038,763 |
@Override
public int compareTo(Pattern o) {
List<ItemAbstractionPair> elementsOfGreaterPattern, elementOfSmallerPattern;
if (getElements().size() >= o.getElements().size()) {
elementsOfGreaterPattern = getElements();
elementOfSmallerPattern = o.getElements();
} el... | int function(Pattern o) { List<ItemAbstractionPair> elementsOfGreaterPattern, elementOfSmallerPattern; if (getElements().size() >= o.getElements().size()) { elementsOfGreaterPattern = getElements(); elementOfSmallerPattern = o.getElements(); } else { elementOfSmallerPattern = getElements(); elementsOfGreaterPattern = o... | /**
* Check if this pattern is equal to another according to the lexicographic order.
* @param o the other pattern
* @return 0 if equal, -1 if smaller, 1 otherwise
*/ | Check if this pattern is equal to another according to the lexicographic order | compareTo | {
"repo_name": "Quanhua-Guan/spmf",
"path": "ca/pfv/spmf/algorithms/sequentialpatterns/clospan_AGP/items/patterns/Pattern.java",
"license": "gpl-3.0",
"size": 10633
} | [
"ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.items.abstractions.ItemAbstractionPair",
"java.util.List"
] | import ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.items.abstractions.ItemAbstractionPair; import java.util.List; | import ca.pfv.spmf.algorithms.sequentialpatterns.*; import java.util.*; | [
"ca.pfv.spmf",
"java.util"
] | ca.pfv.spmf; java.util; | 473,692 |
public static void unregister() {
synchronized (monitor) {
checkState(handler != null, "Jaeger exporter is not registered.");
unregister(Tracing.getExportComponent().getSpanExporter());
handler = null;
}
} | static void function() { synchronized (monitor) { checkState(handler != null, STR); unregister(Tracing.getExportComponent().getSpanExporter()); handler = null; } } | /**
* Unregisters the {@link JaegerTraceExporter} from the OpenCensus library.
*
* @throws IllegalStateException if a Jaeger exporter is not registered.
* @since 0.13
*/ | Unregisters the <code>JaegerTraceExporter</code> from the OpenCensus library | unregister | {
"repo_name": "songy23/instrumentation-java",
"path": "exporters/trace/jaeger/src/main/java/io/opencensus/exporter/trace/jaeger/JaegerTraceExporter.java",
"license": "apache-2.0",
"size": 5631
} | [
"com.google.common.base.Preconditions",
"io.opencensus.trace.Tracing"
] | import com.google.common.base.Preconditions; import io.opencensus.trace.Tracing; | import com.google.common.base.*; import io.opencensus.trace.*; | [
"com.google.common",
"io.opencensus.trace"
] | com.google.common; io.opencensus.trace; | 2,837,571 |
@Test()
public void testOnlyTimestamp()
throws Exception
{
// Get a timestamp that doesn't include milliseconds.
Date d = new Date();
GregorianCalendar c = new GregorianCalendar();
c.setTime(d);
c.set(GregorianCalendar.MILLISECOND, 0);
d = c.getTime();
SimpleDateFormat f = ne... | @Test() void function() throws Exception { Date d = new Date(); GregorianCalendar c = new GregorianCalendar(); c.setTime(d); c.set(GregorianCalendar.MILLISECOND, 0); d = c.getTime(); SimpleDateFormat f = new SimpleDateFormat(STR); String s = f.format(d); UnbindRequestAccessLogMessage m = new UnbindRequestAccessLogMessa... | /**
* Tests the ability to create a log message from a string containing only a
* timestamp.
*
* @throws Exception If an unexpected problem occurs.
*/ | Tests the ability to create a log message from a string containing only a timestamp | testOnlyTimestamp | {
"repo_name": "UnboundID/ldapsdk",
"path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/logs/UnbindRequestAccessLogMessageTestCase.java",
"license": "gpl-2.0",
"size": 8725
} | [
"java.text.SimpleDateFormat",
"java.util.Date",
"java.util.GregorianCalendar",
"org.testng.annotations.Test"
] | import java.text.SimpleDateFormat; import java.util.Date; import java.util.GregorianCalendar; import org.testng.annotations.Test; | import java.text.*; import java.util.*; import org.testng.annotations.*; | [
"java.text",
"java.util",
"org.testng.annotations"
] | java.text; java.util; org.testng.annotations; | 1,868,454 |
private void recreate(InputStream inputStream, InternalDistributedMember imageTarget)
throws TimeoutException, IOException, ClassNotFoundException {
String thePath = getFullPath();
Region newRegion = null;
// recreate new region with snapshot data
try {
LocalRegion parent = parentRegion;
... | void function(InputStream inputStream, InternalDistributedMember imageTarget) throws TimeoutException, IOException, ClassNotFoundException { String thePath = getFullPath(); Region newRegion = null; try { LocalRegion parent = parentRegion; if (diskStoreImpl != null && diskStoreImpl.getName().equals(DiskStoreFactory.DEFA... | /**
* must be holding destroy lock
*/ | must be holding destroy lock | recreate | {
"repo_name": "davebarnes97/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java",
"license": "apache-2.0",
"size": 394235
} | [
"java.io.IOException",
"java.io.InputStream",
"org.apache.geode.InternalGemFireError",
"org.apache.geode.cache.DiskStoreFactory",
"org.apache.geode.cache.Region",
"org.apache.geode.cache.RegionAttributes",
"org.apache.geode.cache.RegionExistsException",
"org.apache.geode.cache.TimeoutException",
"or... | import java.io.IOException; import java.io.InputStream; import org.apache.geode.InternalGemFireError; import org.apache.geode.cache.DiskStoreFactory; import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionAttributes; import org.apache.geode.cache.RegionExistsException; import org.apache.geode.cache.T... | import java.io.*; import org.apache.geode.*; import org.apache.geode.cache.*; import org.apache.geode.distributed.internal.membership.*; | [
"java.io",
"org.apache.geode"
] | java.io; org.apache.geode; | 1,785,492 |
public BigDecimal getCostAverageCumQty();
public static final String COLUMNNAME_CostStandard = "CostStandard"; | BigDecimal function(); public static final String COLUMNNAME_CostStandard = STR; | /** Get Average Cost Quantity Sum.
* Cumulative average cost quantities (internal)
*/ | Get Average Cost Quantity Sum. Cumulative average cost quantities (internal) | getCostAverageCumQty | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/I_M_Product_Costing.java",
"license": "gpl-2.0",
"size": 9567
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 66,715 |
private synchronized <T> T executeRequest(HttpMethod method, String url, Object contentObject, Class<T> result)
throws GardenaException {
try {
if (logger.isTraceEnabled()) {
logger.trace("{} request: {}", method, url);
if (contentObject != null) {
... | synchronized <T> T function(HttpMethod method, String url, Object contentObject, Class<T> result) throws GardenaException { try { if (logger.isTraceEnabled()) { logger.trace(STR, method, url); if (contentObject != null) { logger.trace(STR, method, gson.toJson(contentObject)); } } Request request = httpClient.newRequest... | /**
* Communicates with Gardena Smart Home and parses the result.
*/ | Communicates with Gardena Smart Home and parses the result | executeRequest | {
"repo_name": "aogorek/openhab2-addons",
"path": "addons/binding/org.openhab.binding.gardena/src/main/java/org/openhab/binding/gardena/internal/GardenaSmartImpl.java",
"license": "epl-1.0",
"size": 24299
} | [
"java.util.concurrent.ExecutionException",
"java.util.concurrent.TimeUnit",
"org.eclipse.jetty.client.HttpResponseException",
"org.eclipse.jetty.client.api.ContentResponse",
"org.eclipse.jetty.client.api.Request",
"org.eclipse.jetty.client.util.StringContentProvider",
"org.eclipse.jetty.http.HttpHeader"... | import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.client.HttpResponseException; import org.eclipse.jetty.client.api.ContentResponse; import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.util.StringContentProvider; import org.eclipse.je... | import java.util.concurrent.*; import org.eclipse.jetty.client.*; import org.eclipse.jetty.client.api.*; import org.eclipse.jetty.client.util.*; import org.eclipse.jetty.http.*; import org.openhab.binding.gardena.internal.exception.*; import org.openhab.binding.gardena.internal.model.*; | [
"java.util",
"org.eclipse.jetty",
"org.openhab.binding"
] | java.util; org.eclipse.jetty; org.openhab.binding; | 1,154,583 |
@Test
public void parsesYamlConfigWhenBroken() throws Exception {
MatcherAssert.assertThat(
new YamlXML("a: alpha\nb:\nc:\n - beta").get(),
XhtmlMatchers.hasXPaths(
"/p/entry[@key='a' and .='alpha']",
"/p/entry[@key='b' and .='']",
... | void function() throws Exception { MatcherAssert.assertThat( new YamlXML(STR).get(), XhtmlMatchers.hasXPaths( STR, STR, STR ) ); } | /**
* YamlXML can parse a broken text.
* @throws Exception In case of error.
*/ | YamlXML can parse a broken text | parsesYamlConfigWhenBroken | {
"repo_name": "dalifreire/rultor",
"path": "src/test/java/com/rultor/profiles/YamlXMLTest.java",
"license": "bsd-3-clause",
"size": 3606
} | [
"com.jcabi.matchers.XhtmlMatchers",
"org.hamcrest.MatcherAssert"
] | import com.jcabi.matchers.XhtmlMatchers; import org.hamcrest.MatcherAssert; | import com.jcabi.matchers.*; import org.hamcrest.*; | [
"com.jcabi.matchers",
"org.hamcrest"
] | com.jcabi.matchers; org.hamcrest; | 2,669,232 |
@Test
public void shouldNotLoadWithNullKeyUsingGetAll() {
RecordingCacheLoader<String> cacheLoader = new RecordingCacheLoader<String>();
cacheLoaderServer.setCacheLoader(cacheLoader);
//construct a set of keys
HashSet<String> keys = new HashSet<String>();
keys.add("gudday");
keys.add("hello... | void function() { RecordingCacheLoader<String> cacheLoader = new RecordingCacheLoader<String>(); cacheLoaderServer.setCacheLoader(cacheLoader); HashSet<String> keys = new HashSet<String>(); keys.add(STR); keys.add("hello"); keys.add("howdy"); keys.add(STR); keys.add(null); try { Map<String, String> map = cache.getAll(k... | /**
* Ensure that a {@link Cache#getAll(java.util.Set)} using one or more
* <code>null</code> keys will not load anything.
*/ | Ensure that a <code>Cache#getAll(java.util.Set)</code> using one or more <code>null</code> keys will not load anything | shouldNotLoadWithNullKeyUsingGetAll | {
"repo_name": "headissue/cache2k",
"path": "cache2k-jcache-tests/src/test/java/org/jsr107/tck/integration/CacheLoaderWithoutReadThroughTest.java",
"license": "gpl-3.0",
"size": 27230
} | [
"java.util.HashSet",
"java.util.Map",
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] | import java.util.HashSet; import java.util.Map; import org.hamcrest.CoreMatchers; import org.junit.Assert; | import java.util.*; import org.hamcrest.*; import org.junit.*; | [
"java.util",
"org.hamcrest",
"org.junit"
] | java.util; org.hamcrest; org.junit; | 918,130 |
public void setKualiModuleService(KualiModuleService kualiModuleService) {
this.kualiModuleService = kualiModuleService;
} | void function(KualiModuleService kualiModuleService) { this.kualiModuleService = kualiModuleService; } | /**
* Sets the kualiModuleService attribute value.
*
* @param kualiModuleService The kualiModuleService to set.
*/ | Sets the kualiModuleService attribute value | setKualiModuleService | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/sys/batch/service/impl/FiscalYearMakerServiceImpl.java",
"license": "agpl-3.0",
"size": 20881
} | [
"org.kuali.kfs.krad.service.KualiModuleService"
] | import org.kuali.kfs.krad.service.KualiModuleService; | import org.kuali.kfs.krad.service.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 1,223,533 |
public TroubleTicketState getTroubleTicketState() {
return m_delegate.getTTicketState();
} | TroubleTicketState function() { return m_delegate.getTTicketState(); } | /**
* <p>Getter for the field <code>troubleTicketState</code>.</p>
*
* @return a {@link org.opennms.netmgt.model.TroubleTicketState} object.
*/ | Getter for the field <code>troubleTicketState</code> | getTroubleTicketState | {
"repo_name": "peternixon/opennms-mirror",
"path": "opennms-webapp/src/main/java/org/opennms/web/alarm/Alarm.java",
"license": "gpl-2.0",
"size": 9542
} | [
"org.opennms.netmgt.model.TroubleTicketState"
] | import org.opennms.netmgt.model.TroubleTicketState; | import org.opennms.netmgt.model.*; | [
"org.opennms.netmgt"
] | org.opennms.netmgt; | 1,998,695 |
public void writeInt32NoTag (final int value) throws IOException {
if (value >= 0) {
writeRawVarint32 (value);
} else {
// Must sign-extend.
writeRawVarint64 (value);
}
} | void function (final int value) throws IOException { if (value >= 0) { writeRawVarint32 (value); } else { writeRawVarint64 (value); } } | /**
* Write an {@code int32} field to the stream.
*/ | Write an int32 field to the stream | writeInt32NoTag | {
"repo_name": "CodeBrig/Beam",
"path": "src/com/google/protobuf/CodedOutputStream.java",
"license": "mit",
"size": 49129
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,606,981 |
public String getPandocPath() {
// first, get the filepath, which is in relation to the zkn-path
Element el = settingsFile.getRootElement().getChild(SETTING_PANDOCPATH);
// create an empty string as return value
String value = "";
// is the element exists, copy the text to th... | String function() { Element el = settingsFile.getRootElement().getChild(SETTING_PANDOCPATH); String value = ""; if (el != null) { value = el.getText(); } if (value.isEmpty()) { return null; } return value; } | /**
* Retrieves the filepath for the external converter tool "pandoc"
*
* @return the filepath for the external converter tool "pandoc"
*/ | Retrieves the filepath for the external converter tool "pandoc" | getPandocPath | {
"repo_name": "RalfBarkow/Zettelkasten",
"path": "src/main/java/de/danielluedecke/zettelkasten/database/Settings.java",
"license": "gpl-3.0",
"size": 218921
} | [
"org.jdom2.Element"
] | import org.jdom2.Element; | import org.jdom2.*; | [
"org.jdom2"
] | org.jdom2; | 897,823 |
protected static List<URL> getResources(String path) throws IOException {
return Collections.list(Thread.currentThread().getContextClassLoader().getResources(path));
} | static List<URL> function(String path) throws IOException { return Collections.list(Thread.currentThread().getContextClassLoader().getResources(path)); } | /**
* Get a list of {@link URL}s from the context classloader for all the resources found at the
* specified path.
*
* @param path The resource path.
* @return A list of {@link URL}s, as returned by {@link ClassLoader#getResources(String)}.
* @throws IOException If I/O errors occur
*/ | Get a list of <code>URL</code>s from the context classloader for all the resources found at the specified path | getResources | {
"repo_name": "rodrigodealer/mybatis-crlf-fixed",
"path": "src/main/java/org/apache/ibatis/io/VFS.java",
"license": "apache-2.0",
"size": 7344
} | [
"java.io.IOException",
"java.util.Collections",
"java.util.List"
] | import java.io.IOException; import java.util.Collections; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,938,889 |
public String getSQLOutput( String schemaName, String tableName, RowMetaInterface fields, Object[] r,
String dateFormat ) throws KettleDatabaseException {
StringBuilder ins = new StringBuilder( 128 );
try {
String schemaTable = databaseMeta.getQuotedSchemaTableCombination(... | String function( String schemaName, String tableName, RowMetaInterface fields, Object[] r, String dateFormat ) throws KettleDatabaseException { StringBuilder ins = new StringBuilder( 128 ); try { String schemaTable = databaseMeta.getQuotedSchemaTableCombination( schemaName, tableName ); ins.append( STR ).append( schema... | /**
* Return SQL statement (INSERT INTO TableName ...
*
* @param schemaName tableName The schema
* @param tableName
* @param fields
* @param dateFormat date format of field
* @throws KettleDatabaseException
*/ | Return SQL statement (INSERT INTO TableName .. | getSQLOutput | {
"repo_name": "pavel-sakun/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/database/Database.java",
"license": "apache-2.0",
"size": 170347
} | [
"java.util.Date",
"org.pentaho.di.core.exception.KettleDatabaseException",
"org.pentaho.di.core.row.RowMetaInterface",
"org.pentaho.di.core.row.ValueMetaInterface",
"org.pentaho.di.core.util.Utils"
] | import java.util.Date; import org.pentaho.di.core.exception.KettleDatabaseException; import org.pentaho.di.core.row.RowMetaInterface; import org.pentaho.di.core.row.ValueMetaInterface; import org.pentaho.di.core.util.Utils; | import java.util.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.row.*; import org.pentaho.di.core.util.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 2,830,640 |
public void addImageCache(FragmentManager fragmentManager,
ImageCache.ImageCacheParams cacheParams) {
mImageCacheParams = cacheParams;
mImageCache = ImageCache.getInstance(fragmentManager, mImageCacheParams);
new CacheAsyncTask().execute(MESSAGE_INIT_DISK_CACHE);
} | void function(FragmentManager fragmentManager, ImageCache.ImageCacheParams cacheParams) { mImageCacheParams = cacheParams; mImageCache = ImageCache.getInstance(fragmentManager, mImageCacheParams); new CacheAsyncTask().execute(MESSAGE_INIT_DISK_CACHE); } | /**
* Adds an {@link ImageCache} to this {@link ImageWorker} to handle disk and memory bitmap
* caching.
* @param fragmentManager
* @param cacheParams The cache parameters to use for the image cache.
*/ | Adds an <code>ImageCache</code> to this <code>ImageWorker</code> to handle disk and memory bitmap caching | addImageCache | {
"repo_name": "Nowdone/fanxin",
"path": "src/com/fanxin/app/video/util/ImageWorker.java",
"license": "mit",
"size": 16297
} | [
"android.support.v4.app.FragmentManager"
] | import android.support.v4.app.FragmentManager; | import android.support.v4.app.*; | [
"android.support"
] | android.support; | 1,875,589 |
@Override
public PasswordGroupField getField()
{
return (PasswordGroupField) super.getField();
} | PasswordGroupField function() { return (PasswordGroupField) super.getField(); } | /**
* Returns the field.
*
* @return the field
*/ | Returns the field | getField | {
"repo_name": "Murdock01/izpack",
"path": "izpack-panel/src/main/java/com/izforge/izpack/panels/userinput/console/password/ConsolePasswordGroupField.java",
"license": "apache-2.0",
"size": 3574
} | [
"com.izforge.izpack.panels.userinput.field.password.PasswordGroupField"
] | import com.izforge.izpack.panels.userinput.field.password.PasswordGroupField; | import com.izforge.izpack.panels.userinput.field.password.*; | [
"com.izforge.izpack"
] | com.izforge.izpack; | 219,887 |
@SuppressWarnings("unchecked")
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
final int count = in.readInt();
if (count > 3) {
delegateMap = createDelegateMap();
}
for (int i = count; i ... | @SuppressWarnings(STR) void function(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final int count = in.readInt(); if (count > 3) { delegateMap = createDelegateMap(); } for (int i = count; i > 0; i--) { put((K) in.readObject(), (V) in.readObject()); } } | /**
* Read the map in using a custom routine.
*/ | Read the map in using a custom routine | readObject | {
"repo_name": "krivachy/compgs03_mutation_testing",
"path": "src/main/java/org/apache/commons/collections4/map/Flat3Map.java",
"license": "apache-2.0",
"size": 39790
} | [
"java.io.IOException",
"java.io.ObjectInputStream"
] | import java.io.IOException; import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,758,750 |
public LocatorConnector createInstance() throws Exception {
// JUnitDoclet begin method testcase.createInstance
return new LocatorConnector();
// JUnitDoclet end method testcase.createInstance
}
| LocatorConnector function() throws Exception { return new LocatorConnector(); } | /**
* Factory method for instances of the class to be tested.
*/ | Factory method for instances of the class to be tested | createInstance | {
"repo_name": "samskivert/jhotdraw6",
"path": "src/test/java/org/jhotdraw/test/standard/LocatorConnectorTest.java",
"license": "lgpl-2.1",
"size": 5307
} | [
"org.jhotdraw.standard.LocatorConnector"
] | import org.jhotdraw.standard.LocatorConnector; | import org.jhotdraw.standard.*; | [
"org.jhotdraw.standard"
] | org.jhotdraw.standard; | 1,027,480 |
private void prepareDataSource() throws InternalException {
// Binary predicates that will be offered to the data source.
List<List<TBinaryPredicate>> offeredPredicates = Lists.newArrayList();
// The index into conjuncts_ for each element in offeredPredicates.
List<Integer> conjunctsIdx = Lists.newArr... | void function() throws InternalException { List<List<TBinaryPredicate>> offeredPredicates = Lists.newArrayList(); List<Integer> conjunctsIdx = Lists.newArrayList(); for (int i = 0; i < conjuncts_.size(); ++i) { Expr conjunct = conjuncts_.get(i); List<TBinaryPredicate> disjuncts = getDisjuncts(conjunct); if (disjuncts !... | /**
* Calls prepare() on the data source to determine accepted predicates and get
* stats. The accepted predicates are moved from conjuncts_ into acceptedConjuncts_
* and the associated TBinaryPredicates are set in acceptedPredicates_.
*/ | Calls prepare() on the data source to determine accepted predicates and get stats. The accepted predicates are moved from conjuncts_ into acceptedConjuncts_ and the associated TBinaryPredicates are set in acceptedPredicates_ | prepareDataSource | {
"repo_name": "924060929/impala-frontend",
"path": "fe/src/main/java/org/apache/impala/planner/DataSourceScanNode.java",
"license": "apache-2.0",
"size": 15638
} | [
"com.google.common.base.Joiner",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.Lists",
"java.util.List",
"org.apache.impala.analysis.Expr",
"org.apache.impala.catalog.DataSource",
"org.apache.impala.common.InternalException",
"org.apache.impala.extdatasource.ExternalDataSourceE... | import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.util.List; import org.apache.impala.analysis.Expr; import org.apache.impala.catalog.DataSource; import org.apache.impala.common.InternalException; import org.apache.impala.extdatasou... | import com.google.common.base.*; import com.google.common.collect.*; import java.util.*; import org.apache.impala.analysis.*; import org.apache.impala.catalog.*; import org.apache.impala.common.*; import org.apache.impala.extdatasource.*; import org.apache.impala.extdatasource.thrift.*; import org.apache.impala.service... | [
"com.google.common",
"java.util",
"org.apache.impala"
] | com.google.common; java.util; org.apache.impala; | 2,043,432 |
public static String generateActivationKey() {
return RandomStringUtils.randomNumeric(DEF_COUNT);
} | static String function() { return RandomStringUtils.randomNumeric(DEF_COUNT); } | /**
* Generate an activation key.
*
* @return the generated activation key
*/ | Generate an activation key | generateActivationKey | {
"repo_name": "kalnee/trivor",
"path": "gateway/src/main/java/org/kalnee/trivor/gateway/service/util/RandomUtil.java",
"license": "mit",
"size": 895
} | [
"org.apache.commons.lang3.RandomStringUtils"
] | import org.apache.commons.lang3.RandomStringUtils; | import org.apache.commons.lang3.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,900,978 |
private void loadIntegration(Class<AbstractIntegration> clazz) {
try {
Constructor<AbstractIntegration> constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
AbstractIntegration integration = constructor.newInstance();
integrations.add(integration);
bundledIn... | void function(Class<AbstractIntegration> clazz) { try { Constructor<AbstractIntegration> constructor = clazz.getDeclaredConstructor(); constructor.setAccessible(true); AbstractIntegration integration = constructor.newInstance(); integrations.add(integration); bundledIntegrations.put(integration.key(), false); } catch (... | /**
* Instantiates an instance of {@link AbstractIntegration} for the given class. The {@link
* AbstractIntegration} *MUST* have an empty constructor. This will also update the {@code
* bundledIntegrations} map so that events for this integration aren't sent server side.
* <p/>
* This will not initialize... | Instantiates an instance of <code>AbstractIntegration</code> for the given class. The <code>AbstractIntegration</code> *MUST* have an empty constructor. This will also update the bundledIntegrations map so that events for this integration aren't sent server side. This will not initialize the integration | loadIntegration | {
"repo_name": "palaniyappanBala/analytics-android",
"path": "analytics-core/src/main/java/com/segment/analytics/IntegrationManager.java",
"license": "mit",
"size": 18687
} | [
"com.segment.analytics.internal.AbstractIntegration",
"java.lang.reflect.Constructor"
] | import com.segment.analytics.internal.AbstractIntegration; import java.lang.reflect.Constructor; | import com.segment.analytics.internal.*; import java.lang.reflect.*; | [
"com.segment.analytics",
"java.lang"
] | com.segment.analytics; java.lang; | 568,610 |
public void setMetadata(PDMetadata meta)
{
stream.setItem(COSName.METADATA, meta);
} | void function(PDMetadata meta) { stream.setItem(COSName.METADATA, meta); } | /**
* Set the metadata for this object. This can be null.
*
* @param meta
* The meta data for this object.
*/ | Set the metadata for this object. This can be null | setMetadata | {
"repo_name": "myrridin/qz-print",
"path": "pdfbox_1.8.4_qz/src/org/apache/pdfbox/pdmodel/common/PDStream.java",
"license": "lgpl-2.1",
"size": 18077
} | [
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 279,776 |
public static int advance(Iterator<?> iterator, int numberToAdvance) {
checkNotNull(iterator);
checkArgument(numberToAdvance >= 0, "numberToAdvance must be nonnegative");
int i;
for (i = 0; i < numberToAdvance && iterator.hasNext(); i++) {
iterator.next();
}
return i;
} | static int function(Iterator<?> iterator, int numberToAdvance) { checkNotNull(iterator); checkArgument(numberToAdvance >= 0, STR); int i; for (i = 0; i < numberToAdvance && iterator.hasNext(); i++) { iterator.next(); } return i; } | /**
* Calls {@code next()} on {@code iterator}, either {@code numberToAdvance} times
* or until {@code hasNext()} returns {@code false}, whichever comes first.
*
* @return the number of elements the iterator was advanced
* @since 13.0 (since 3.0 as {@code Iterators.skip})
*/ | Calls next() on iterator, either numberToAdvance times or until hasNext() returns false, whichever comes first | advance | {
"repo_name": "liyazhou/guava",
"path": "guava/src/com/google/common/collect/Iterators.java",
"license": "apache-2.0",
"size": 46112
} | [
"com.google.common.base.Preconditions",
"java.util.Iterator"
] | import com.google.common.base.Preconditions; import java.util.Iterator; | import com.google.common.base.*; import java.util.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 1,537,343 |
public TimeZone getTimeZone()
{
return calendar.getTimeZone();
} | TimeZone function() { return calendar.getTimeZone(); } | /**
* Gets the time zone.
* This method is equivalent to the following call.
* <blockquote><pre>{@code
* getCalendar().getTimeZone()
* }</pre></blockquote>
*
* @return the time zone associated with the calendar of DateFormat.
*/ | Gets the time zone. This method is equivalent to the following call. <code>getCalendar().getTimeZone() </code> | getTimeZone | {
"repo_name": "dmlloyd/openjdk-modules",
"path": "jdk/src/java.base/share/classes/java/text/DateFormat.java",
"license": "gpl-2.0",
"size": 41671
} | [
"java.util.TimeZone"
] | import java.util.TimeZone; | import java.util.*; | [
"java.util"
] | java.util; | 1,802,842 |
public ImageResult queryImagedata(int id) throws SQLException{
String query = "SELECT * FROM IMAGES WHERE ID = "+id;
ResultSet rs = query(query);
int x;
int y;
int width;
int height;
String url;
rs.next();
url =(String) rs.getObject("URL");
x =(Integer) rs.getObject("X");
y =(Integ... | ImageResult function(int id) throws SQLException{ String query = STR+id; ResultSet rs = query(query); int x; int y; int width; int height; String url; rs.next(); url =(String) rs.getObject("URL"); x =(Integer) rs.getObject("X"); y =(Integer) rs.getObject("Y"); height =(Integer) rs.getObject(STR); width =(Integer) rs.ge... | /**
* Returns all information about an Image stored in the DB
* @param query
* @return
* @throws SQLException
*/ | Returns all information about an Image stored in the DB | queryImagedata | {
"repo_name": "topahl/StoryBear",
"path": "StoryBear/src/com/opticalcobra/storybear/db/Database.java",
"license": "gpl-3.0",
"size": 17966
} | [
"java.sql.ResultSet",
"java.sql.SQLException"
] | import java.sql.ResultSet; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,640,498 |
public void widgetSelected(SelectionEvent e) {
String command = (String) ((MenuItem) e.getSource()).getData();
if (command.equals(PROPERTIES_COMMAND)) {
attemptEditChartProperties();
}
else if (command.equals(SAVE_COMMAND)) {
try {
doSaveAs();
... | void function(SelectionEvent e) { String command = (String) ((MenuItem) e.getSource()).getData(); if (command.equals(PROPERTIES_COMMAND)) { attemptEditChartProperties(); } else if (command.equals(SAVE_COMMAND)) { try { doSaveAs(); } catch (IOException ex) { ex.printStackTrace(); } } else if (command.equals(PRINT_COMMAN... | /**
* Handles action events generated by the popup menu.
*
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(
* org.eclipse.swt.events.SelectionEvent)
*/ | Handles action events generated by the popup menu | widgetSelected | {
"repo_name": "raincs13/phd",
"path": "swt/org/jfree/experimental/chart/swt/ChartComposite.java",
"license": "lgpl-2.1",
"size": 69511
} | [
"java.io.IOException",
"org.eclipse.swt.events.SelectionEvent",
"org.eclipse.swt.widgets.MenuItem"
] | import java.io.IOException; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.MenuItem; | import java.io.*; import org.eclipse.swt.events.*; import org.eclipse.swt.widgets.*; | [
"java.io",
"org.eclipse.swt"
] | java.io; org.eclipse.swt; | 1,964,957 |
public float getCurrent() {
if (Build.VERSION.SDK_INT >= 19) {
return ((AccessibilityNodeInfo.RangeInfo) mInfo).getCurrent();
} else {
return 0;
}
} | float function() { if (Build.VERSION.SDK_INT >= 19) { return ((AccessibilityNodeInfo.RangeInfo) mInfo).getCurrent(); } else { return 0; } } | /**
* Gets the current value.
*
* @return The current value.
*/ | Gets the current value | getCurrent | {
"repo_name": "AndroidX/androidx",
"path": "core/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java",
"license": "apache-2.0",
"size": 160272
} | [
"android.os.Build",
"android.view.accessibility.AccessibilityNodeInfo"
] | import android.os.Build; import android.view.accessibility.AccessibilityNodeInfo; | import android.os.*; import android.view.accessibility.*; | [
"android.os",
"android.view"
] | android.os; android.view; | 10,911 |
public static AIInfo makeGuess(ArrayList<String> possibleColours,
int numOfPegs, ArrayList<String> coloursInCode,
ArrayList<String> coloursNotChecked) {
ArrayList<String> guess = new ArrayList<String>();
// Has the program worked out which colours are in the code.
... | static AIInfo function(ArrayList<String> possibleColours, int numOfPegs, ArrayList<String> coloursInCode, ArrayList<String> coloursNotChecked) { ArrayList<String> guess = new ArrayList<String>(); if (numOfPegs != coloursInCode.size()) { String colourGuessed = coloursNotChecked.get(0); if (!coloursInCode.isEmpty()) { fo... | /**
* Attempts to make an intelligent guess based off parameters passed in.
*
* @param possibleColours
* Possible colours to choose from when guessing code.
* @param numOfPegs
* The length of the code.
* @param coloursInCode
* The colours the program kn... | Attempts to make an intelligent guess based off parameters passed in | makeGuess | {
"repo_name": "1orwell/Mastermind",
"path": "AI.java",
"license": "gpl-3.0",
"size": 3113
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,392,384 |
private List<Method> findMethods(Method[] methods, Collection params,
String beanifiedMethod) throws XmlRpcFault {
List<Method> toReturn = new ArrayList<Method>();
//Loop through the methods array and find the one we are trying to call.
for (int i = 0; i < methods.length; ... | List<Method> function(Method[] methods, Collection params, String beanifiedMethod) throws XmlRpcFault { List<Method> toReturn = new ArrayList<Method>(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().equals(beanifiedMethod)) { int numberOfParams = methods[i].getParameterTypes().length; if (numberOf... | /**
* Private method to find the method in the java class that is being called
* via xml-rpc
* @param methods The methods contained in the class
* @param params The parameters sent to us via xml-rpc
* @param beanifiedMethod The method name we are looking for
* @return The matching method w... | Private method to find the method in the java class that is being called via xml-rpc | findMethods | {
"repo_name": "ogajduse/spacewalk",
"path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/BaseHandler.java",
"license": "gpl-2.0",
"size": 18478
} | [
"java.lang.reflect.Method",
"java.util.ArrayList",
"java.util.Collection",
"java.util.Iterator",
"java.util.List"
] | import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 2,367,902 |
public static boolean isLegalWorkspaceName(String name) {
Matcher matcher = LEGAL_WORKSPACE_NAME.matcher(name);
return matcher.matches();
} | static boolean function(String name) { Matcher matcher = LEGAL_WORKSPACE_NAME.matcher(name); return matcher.matches(); } | /**
* Returns true if the given name is a valid workspace name.
*/ | Returns true if the given name is a valid workspace name | isLegalWorkspaceName | {
"repo_name": "dslomov/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/WorkspaceGlobals.java",
"license": "apache-2.0",
"size": 12965
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 611,925 |
private static byte[] convertCharsToBytes(char[] chars) {
CharBuffer charBuffer = CharBuffer.wrap(chars);
ByteBuffer byteBuffer = Charset.forName("UTF-8").encode(charBuffer);
return Arrays.copyOfRange(byteBuffer.array(),
byteBuffer.position(), byteBuffer.limit());
} | static byte[] function(char[] chars) { CharBuffer charBuffer = CharBuffer.wrap(chars); ByteBuffer byteBuffer = Charset.forName("UTF-8").encode(charBuffer); return Arrays.copyOfRange(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit()); } | /**
* Returns a {@code byte[]} containing the value of the provided {@code char[]} without using {@code new String(chars).getBytes()} which would put sensitive data (the password) in the String pool.
*
* @param chars the characters to convert
* @return the byte[]
*/ | Returns a byte[] containing the value of the provided char[] without using new String(chars).getBytes() which would put sensitive data (the password) in the String pool | convertCharsToBytes | {
"repo_name": "jskora/nifi",
"path": "nifi-commons/nifi-security-utils/src/main/java/org/apache/nifi/security/kms/CryptoUtils.java",
"license": "apache-2.0",
"size": 23246
} | [
"java.nio.ByteBuffer",
"java.nio.CharBuffer",
"java.nio.charset.Charset",
"java.util.Arrays"
] | import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.util.Arrays; | import java.nio.*; import java.nio.charset.*; import java.util.*; | [
"java.nio",
"java.util"
] | java.nio; java.util; | 1,006,019 |
protected void sequence_InfoBox(EObject context, InfoBox semanticObject) {
if(errorAcceptor != null) {
if(transientValues.isValueTransient(semanticObject, MMDSLPackage.eINSTANCE.getInfoBox_Title()) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MMDSL... | void function(EObject context, InfoBox semanticObject) { if(errorAcceptor != null) { if(transientValues.isValueTransient(semanticObject, MMDSLPackage.eINSTANCE.getInfoBox_Title()) == ValueTransient.YES) errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, MMDSLPackage.eINSTANCE.getInfoBox_T... | /**
* Constraint:
* (title=STRING text=STRING)
*/ | Constraint: (title=STRING text=STRING) | sequence_InfoBox | {
"repo_name": "niksavis/mm-dsl",
"path": "org.xtext.nv.dsl/src-gen/org/xtext/nv/dsl/serializer/MMDSLSemanticSequencer.java",
"license": "epl-1.0",
"size": 190481
} | [
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.serializer.acceptor.SequenceFeeder",
"org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider",
"org.eclipse.xtext.serializer.sequencer.ITransientValueService",
"org.xtext.nv.dsl.mMDSL.InfoBox",
"org.xtext.nv.dsl.mMDSL.MMDSLPackage",
"org.xtext.nv... | import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider; import org.eclipse.xtext.serializer.sequencer.ITransientValueService; import org.xtext.nv.dsl.mMDSL.InfoBox; import org.xtext.nv.dsl.mMDSL.MMDSLPackage;... | import org.eclipse.emf.ecore.*; import org.eclipse.xtext.serializer.acceptor.*; import org.eclipse.xtext.serializer.sequencer.*; import org.xtext.nv.dsl.*; | [
"org.eclipse.emf",
"org.eclipse.xtext",
"org.xtext.nv"
] | org.eclipse.emf; org.eclipse.xtext; org.xtext.nv; | 1,125,862 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.