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 void log(PaxosValue value) {
// Is this is a proposal or a commutative set?
String key = null;
if(value instanceof Proposal) {
key = "proposal";
}
else {
key = "set";
}
log(key, value);
} | void function(PaxosValue value) { String key = null; if(value instanceof Proposal) { key = STR; } else { key = "set"; } log(key, value); } | /**
* Log the value with the default label. The default
* label changes depending on the value type.
*
* @param value Value to log
*/ | Log the value with the default label. The default label changes depending on the value type | log | {
"repo_name": "jhorey/Paja",
"path": "src/gov/ornl/paja/roles/PaxosRecovery.java",
"license": "apache-2.0",
"size": 4750
} | [
"gov.ornl.paja.proto.PaxosValue",
"gov.ornl.paja.proto.Proposal"
] | import gov.ornl.paja.proto.PaxosValue; import gov.ornl.paja.proto.Proposal; | import gov.ornl.paja.proto.*; | [
"gov.ornl.paja"
] | gov.ornl.paja; | 429,048 |
protected void importSerializedRule(String serializedRule) {
try {
String[] values = serializedRule.split(Character.toString(SERIALIZATION_SEPARATOR), 4);
int userId = Integer.parseInt(values[0]);
AccessRule rule = AccessRule.valueOf(values[1]);
String nodeNam... | void function(String serializedRule) { try { String[] values = serializedRule.split(Character.toString(SERIALIZATION_SEPARATOR), 4); int userId = Integer.parseInt(values[0]); AccessRule rule = AccessRule.valueOf(values[1]); String nodeName = new String(Base64.decodeBase64(values[2])); URI uri = new URI(values[3], true)... | /**
* Import a rule from a serialized representation. The rule should have been exported via the
* {@link #exportSerializedRules()} method.
*
* @param serializedRule the serialized rule
*/ | Import a rule from a serialized representation. The rule should have been exported via the <code>#exportSerializedRules()</code> method | importSerializedRule | {
"repo_name": "zapbot/zap-extensions",
"path": "addOns/accessControl/src/main/java/org/zaproxy/zap/extension/accessControl/ContextAccessRulesManager.java",
"license": "apache-2.0",
"size": 14131
} | [
"org.apache.commons.codec.binary.Base64",
"org.zaproxy.zap.extension.accessControl.widgets.SiteTreeNode"
] | import org.apache.commons.codec.binary.Base64; import org.zaproxy.zap.extension.accessControl.widgets.SiteTreeNode; | import org.apache.commons.codec.binary.*; import org.zaproxy.zap.extension.*; | [
"org.apache.commons",
"org.zaproxy.zap"
] | org.apache.commons; org.zaproxy.zap; | 1,892,506 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<RevisionInner>> getRevisionWithResponseAsync(
String resourceGroupName, String containerAppName, String name, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<RevisionInner>> function( String resourceGroupName, String containerAppName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(n... | /**
* Get a revision of a Container App.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param containerAppName Name of the Container App.
* @param name Name of the Container App Revision.
* @param context The context to associate with this operati... | Get a revision of a Container App | getRevisionWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ContainerAppsRevisionsClientImpl.java",
"license": "mit",
"size": 51756
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.appservice.fluent.models.RevisionInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.appservice.fluent.models.RevisionInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.appservice.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 527,287 |
void setValue(Object aValue,boolean isSelected);
Component getComponent(); | void setValue(Object aValue,boolean isSelected); Component getComponent(); | /**
* Returns the component used to render the value.
*
* @return the Component responsible for displaying the value
*/ | Returns the component used to render the value | getComponent | {
"repo_name": "flyzsd/java-code-snippets",
"path": "ibm.jdk8/src/javax/swing/Renderer.java",
"license": "mit",
"size": 1350
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,616,398 |
public ModelMap getModelMap() {
if (this.model == null) {
this.model = new ModelMap();
}
return this.model;
} | ModelMap function() { if (this.model == null) { this.model = new ModelMap(); } return this.model; } | /**
* Return the underlying {@code ModelMap} instance (never {@code null}).
*/ | Return the underlying ModelMap instance (never null) | getModelMap | {
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/spring/org/springframework/web/servlet/ModelAndView.java",
"license": "gpl-2.0",
"size": 10708
} | [
"org.springframework.ui.ModelMap"
] | import org.springframework.ui.ModelMap; | import org.springframework.ui.*; | [
"org.springframework.ui"
] | org.springframework.ui; | 2,009,860 |
private static void toString(SBLimitedLength buf, Class<?> cls, Object val) {
if (val == null) {
buf.a("null");
return;
}
if (cls == null)
cls = val.getClass();
if (cls.isPrimitive()) {
buf.a(val);
return;
}
... | static void function(SBLimitedLength buf, Class<?> cls, Object val) { if (val == null) { buf.a("null"); return; } if (cls == null) cls = val.getClass(); if (cls.isPrimitive()) { buf.a(val); return; } IdentityHashMap<Object, EntryReference> svdObjs = savedObjects.get(); if (handleRecursion(buf, val, cls, svdObjs)) retur... | /**
* Print value with length limitation.
*
* @param buf buffer to print to.
* @param cls value class.
* @param val value to print.
*/ | Print value with length limitation | toString | {
"repo_name": "nizhikov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java",
"license": "apache-2.0",
"size": 66364
} | [
"java.util.Collection",
"java.util.IdentityHashMap",
"java.util.Map"
] | import java.util.Collection; import java.util.IdentityHashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 43,085 |
public void process(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents, ExprEvaluatorContext exprEvaluatorContext)
{
if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled()))
{
log.debug(".process Received update, " +
" newDat... | void function(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents, ExprEvaluatorContext exprEvaluatorContext) { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(STR + STR + ((newEvents == null) ? 0 : newEvents.size()) + STR + ((oldEvents == null) ? 0 : oldEvents.size(... | /**
* This process (update) method is for participation in a join.
* @param newEvents - new events
* @param oldEvents - old events
*/ | This process (update) method is for participation in a join | process | {
"repo_name": "intelie/esper",
"path": "esper/src/main/java/com/espertech/esper/epl/view/OutputProcessViewSnapshot.java",
"license": "gpl-2.0",
"size": 9077
} | [
"com.espertech.esper.client.EventBean",
"com.espertech.esper.collection.MultiKey",
"com.espertech.esper.epl.expression.ExprEvaluatorContext",
"com.espertech.esper.util.ExecutionPathDebugLog",
"java.util.Set"
] | import com.espertech.esper.client.EventBean; import com.espertech.esper.collection.MultiKey; import com.espertech.esper.epl.expression.ExprEvaluatorContext; import com.espertech.esper.util.ExecutionPathDebugLog; import java.util.Set; | import com.espertech.esper.client.*; import com.espertech.esper.collection.*; import com.espertech.esper.epl.expression.*; import com.espertech.esper.util.*; import java.util.*; | [
"com.espertech.esper",
"java.util"
] | com.espertech.esper; java.util; | 987,935 |
private void releaseEvaluatorContextIfEmpty(DriverState driverState, EvaluatorContext ctx, String folder)
{
synchronized(driverState.contextMap)
{
if(ctx != null)
{
if(ctx.getScenarioInstances().size() > 0)
{
}
... | void function(DriverState driverState, EvaluatorContext ctx, String folder) { synchronized(driverState.contextMap) { if(ctx != null) { if(ctx.getScenarioInstances().size() > 0) { } else { driverState.contextMap.remove(folder); } } } } | /**
* Release the evaluator context if there are no active scenarios.
* @param driverState DriverState
* @param ctx EvaluatorContext
* @param folder String
*/ | Release the evaluator context if there are no active scenarios | releaseEvaluatorContextIfEmpty | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/filesys/repo/NonTransactionalRuleContentDiskDriver.java",
"license": "lgpl-3.0",
"size": 23798
} | [
"org.alfresco.filesys.repo.rules.EvaluatorContext"
] | import org.alfresco.filesys.repo.rules.EvaluatorContext; | import org.alfresco.filesys.repo.rules.*; | [
"org.alfresco.filesys"
] | org.alfresco.filesys; | 106,574 |
public List<HostRoleCommand> getAllTasksByRequestIds(Collection<Long> requestIds); | List<HostRoleCommand> function(Collection<Long> requestIds); | /**
* Given a list of request ids, get all the tasks that belong to these requests
*/ | Given a list of request ids, get all the tasks that belong to these requests | getAllTasksByRequestIds | {
"repo_name": "alexryndin/ambari",
"path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java",
"license": "apache-2.0",
"size": 7966
} | [
"java.util.Collection",
"java.util.List"
] | import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 452,665 |
private static void closeStream(Closeable stream)
{
if(stream != null)
{
try
{
stream.close();
}
catch(IOException e)
{
// Ignore
}
}
} | static void function(Closeable stream) { if(stream != null) { try { stream.close(); } catch(IOException e) { } } } | /**
* Closes the specified stream.
*
* @param stream The stream to close.
*/ | Closes the specified stream | closeStream | {
"repo_name": "ivanovpv/darksms",
"path": "psm/src/main/java/ru/ivanovpv/gorets/psm/Eula.java",
"license": "apache-2.0",
"size": 4736
} | [
"java.io.Closeable",
"java.io.IOException"
] | import java.io.Closeable; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,736,466 |
public void testObjectMixin( ObjectWriterTester<BaseClass> writer ) {
BaseClass bean = new BaseClass( "a", "b" );
String json = writer.write( bean );
assertEquals( "{\"b\":\"b\",\"hashCode\":" + bean.hashCode() + "}", json );
} | void function( ObjectWriterTester<BaseClass> writer ) { BaseClass bean = new BaseClass( "a", "b" ); String json = writer.write( bean ); assertEquals( "{\"b\":\"b\",\"hashCode\":" + bean.hashCode() + "}", json ); } | /**
* Unit test for verifying that it is actually possible to attach
* mix-in annotations to basic <code>Object.class</code>. This
* will essentially apply to any and all Objects.
*/ | Unit test for verifying that it is actually possible to attach mix-in annotations to basic <code>Object.class</code>. This will essentially apply to any and all Objects | testObjectMixin | {
"repo_name": "nmorel/gwt-jackson",
"path": "gwt-jackson/src/test/java/com/github/nmorel/gwtjackson/shared/mixins/MixinSerForMethodsTester.java",
"license": "apache-2.0",
"size": 5788
} | [
"com.github.nmorel.gwtjackson.shared.ObjectWriterTester"
] | import com.github.nmorel.gwtjackson.shared.ObjectWriterTester; | import com.github.nmorel.gwtjackson.shared.*; | [
"com.github.nmorel"
] | com.github.nmorel; | 1,166,569 |
void writeContainerEnd() throws IOException; | void writeContainerEnd() throws IOException; | /**
* End writing a container.
*/ | End writing a container | writeContainerEnd | {
"repo_name": "jdubrule/bond",
"path": "java/core/src/main/java/org/bondlib/ProtocolWriter.java",
"license": "mit",
"size": 4355
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,665,704 |
T visitParExpression(@NotNull JavaParser.ParExpressionContext ctx); | T visitParExpression(@NotNull JavaParser.ParExpressionContext ctx); | /**
* Visit a parse tree produced by {@link JavaParser#parExpression}.
* @param ctx the parse tree
* @return the visitor result
*/ | Visit a parse tree produced by <code>JavaParser#parExpression</code> | visitParExpression | {
"repo_name": "hgkmail/HelloJava",
"path": "src/cn/hgk/hellojava/JavaVisitor.java",
"license": "gpl-2.0",
"size": 22753
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,380,627 |
public void execute(TaskExecutionContext context) throws RuntimeException {
Process p;
try {
p = exec();
} catch (IOException e) {
throw new RuntimeException(toString() + " cannot be started", e);
}
InputStream in = buildInputStream(stdinFile);
OutputStream out = buildOutputStream(stdoutFile);
Ou... | void function(TaskExecutionContext context) throws RuntimeException { Process p; try { p = exec(); } catch (IOException e) { throw new RuntimeException(toString() + STR, e); } InputStream in = buildInputStream(stdinFile); OutputStream out = buildOutputStream(stdoutFile); OutputStream err = buildOutputStream(stderrFile)... | /**
* Implements {@link Task#execute(TaskExecutionContext)}. Runs the given
* command as a separate process and waits for its end.
*/ | Implements <code>Task#execute(TaskExecutionContext)</code>. Runs the given command as a separate process and waits for its end | execute | {
"repo_name": "ZobsDope/bankbot.old",
"path": "src/main/java/it/sauronsoftware/cron4j/ProcessTask.java",
"license": "gpl-2.0",
"size": 10623
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream"
] | import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,889,166 |
void deleteSelectedExpenses(List<ExpenseDetail> expenses, RequestContext ctx);
| void deleteSelectedExpenses(List<ExpenseDetail> expenses, RequestContext ctx); | /**
* Delete selected expenses.
*
* @param expenses
* @param ctx
*/ | Delete selected expenses | deleteSelectedExpenses | {
"repo_name": "arunkpatra/expense-tracker",
"path": "src/main/java/com/exp/tracker/services/api/ExpenseService.java",
"license": "apache-2.0",
"size": 3143
} | [
"com.exp.tracker.data.model.ExpenseDetail",
"java.util.List",
"org.springframework.webflow.execution.RequestContext"
] | import com.exp.tracker.data.model.ExpenseDetail; import java.util.List; import org.springframework.webflow.execution.RequestContext; | import com.exp.tracker.data.model.*; import java.util.*; import org.springframework.webflow.execution.*; | [
"com.exp.tracker",
"java.util",
"org.springframework.webflow"
] | com.exp.tracker; java.util; org.springframework.webflow; | 1,678,249 |
Set<ConfiguredPropertyDescriptor> getConfiguredPropertiesByType(Class<?> type, boolean includeArrays); | Set<ConfiguredPropertyDescriptor> getConfiguredPropertiesByType(Class<?> type, boolean includeArrays); | /**
* Gets all configuration properties of a particular type (including
* subtypes)
*
* @see Configured
*
* @param type
* the type of property to look for
* @param includeArrays
* a boolean indicating whether or not configuration properties
* ... | Gets all configuration properties of a particular type (including subtypes) | getConfiguredPropertiesByType | {
"repo_name": "datacleaner/DataCleaner",
"path": "api/src/main/java/org/datacleaner/descriptors/ComponentDescriptor.java",
"license": "lgpl-3.0",
"size": 7033
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,366,501 |
private void processSelectedProduct() {
Product selectedProduct = getSelectedProduct();
if (selectedProduct != null) {
boolean isSentinel2 = StringHelper.startsWithIgnoreCase(selectedProduct.getProductType(), "S2_MSI_Level");
boolean isSpot = StringHelper.startsWithIgnoreCase... | void function() { Product selectedProduct = getSelectedProduct(); if (selectedProduct != null) { boolean isSentinel2 = StringHelper.startsWithIgnoreCase(selectedProduct.getProductType(), STR); boolean isSpot = StringHelper.startsWithIgnoreCase(selectedProduct.getProductType(), STR); BindingContext bindingContext = getB... | /**
* Sets the incidence angle and the quantification value according to the selected product.
*/ | Sets the incidence angle and the quantification value according to the selected product | processSelectedProduct | {
"repo_name": "oscarpicas/s2tbx",
"path": "s2tbx-reflectance-to-radiance-ui/src/main/java/org/esa/s2tbx/reflectance2radiance/ReflectanceTargetProductDialog.java",
"license": "gpl-3.0",
"size": 4126
} | [
"com.bc.ceres.binding.PropertySet",
"com.bc.ceres.swing.binding.BindingContext",
"org.esa.snap.core.datamodel.Product",
"org.esa.snap.utils.StringHelper"
] | import com.bc.ceres.binding.PropertySet; import com.bc.ceres.swing.binding.BindingContext; import org.esa.snap.core.datamodel.Product; import org.esa.snap.utils.StringHelper; | import com.bc.ceres.binding.*; import com.bc.ceres.swing.binding.*; import org.esa.snap.core.datamodel.*; import org.esa.snap.utils.*; | [
"com.bc.ceres",
"org.esa.snap"
] | com.bc.ceres; org.esa.snap; | 345,304 |
public void addHook(String hook, Hook func) {
if (!hooks.containsKey(hook) || hooks.get(hook) == null) {
hooks.put(hook, new ArrayList<Hook>());
}
boolean found = false;
for (Hook h : hooks.get(hook)) {
if (func.equals(h)) {
found = true;
... | void function(String hook, Hook func) { if (!hooks.containsKey(hook) hooks.get(hook) == null) { hooks.put(hook, new ArrayList<Hook>()); } boolean found = false; for (Hook h : hooks.get(hook)) { if (func.equals(h)) { found = true; break; } } if (!found) { hooks.get(hook).add(func); } } | /**
* Add a function to hook. Ignore if already on hook.
*
* @param hook The name of the hook.
* @param func A class implements interface Hook and contains the function to add.
*/ | Add a function to hook. Ignore if already on hook | addHook | {
"repo_name": "vstabile/chinese-flashcards-android",
"path": "src/com/hichinaschool/flashcards/libanki/hooks/Hooks.java",
"license": "gpl-3.0",
"size": 5148
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,338,007 |
@POST
@Produces(MediaType.APPLICATION_JSON)
public Response addCondicionesZona(@HeaderParam("condicion") String condicion, @HeaderParam("zona") String zona,@HeaderParam("usuarioId")Long usuarioId) {
condicion=condicion.replaceAll(RotondAndesTM.SPACE, " ");
zona=zona.replaceAll(RotondAndesTM.SPACE, " ");
... | @Produces(MediaType.APPLICATION_JSON) Response function(@HeaderParam(STR) String condicion, @HeaderParam("zona") String zona,@HeaderParam(STR)Long usuarioId) { condicion=condicion.replaceAll(RotondAndesTM.SPACE, " "); zona=zona.replaceAll(RotondAndesTM.SPACE, " "); RotondAndesTM tm = new RotondAndesTM(getPath()); try {... | /**
* Metodo que expone servicio REST usando POST que agrega la zona que recibe en Json
* <b>URL: </b> http://"ip o nombre de host":8080/CondicionesZonaAndes/rest/zonas/zona
* @param zona - zona a agregar
* @param condicion - condición a agregar
* @param usuarioId Id del usuario que realiz... | Metodo que expone servicio REST usando POST que agrega la zona que recibe en Json | addCondicionesZona | {
"repo_name": "js-diaz/sistrans",
"path": "src/rest/CondicionZonaServices.java",
"license": "mit",
"size": 11093
} | [
"javax.ws.rs.HeaderParam",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response"
] | import javax.ws.rs.HeaderParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; | import javax.ws.rs.*; import javax.ws.rs.core.*; | [
"javax.ws"
] | javax.ws; | 835,509 |
public void setDefaultText(String v)
{
if (!ObjectUtils.equals(this.defaultText, v))
{
this.defaultText = v;
setModified(true);
}
} | void function(String v) { if (!ObjectUtils.equals(this.defaultText, v)) { this.defaultText = v; setModified(true); } } | /**
* Set the value of DefaultText
*
* @param v new value
*/ | Set the value of DefaultText | setDefaultText | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTTextBoxSettings.java",
"license": "gpl-3.0",
"size": 59636
} | [
"org.apache.commons.lang.ObjectUtils"
] | import org.apache.commons.lang.ObjectUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,001,098 |
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
} | void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } | /**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object. | collectNewChildDescriptors | {
"repo_name": "FraunhoferESK/ernest-eclipse-integration",
"path": "de.fraunhofer.esk.ernest.core.analysismodel.edit/src/ernest/architecture/provider/ActuatorItemProvider.java",
"license": "epl-1.0",
"size": 3167
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,561,207 |
public Boxing withIntent(Context context, Class<?> cls, ArrayList<? extends BaseMedia> selectedMedias) {
mIntent.setClass(context, cls);
if (selectedMedias != null && !selectedMedias.isEmpty()) {
mIntent.putExtra(EXTRA_SELECTED_MEDIA, selectedMedias);
}
return this;
} | Boxing function(Context context, Class<?> cls, ArrayList<? extends BaseMedia> selectedMedias) { mIntent.setClass(context, cls); if (selectedMedias != null && !selectedMedias.isEmpty()) { mIntent.putExtra(EXTRA_SELECTED_MEDIA, selectedMedias); } return this; } | /**
* {@link Intent#setClass(Context, Class)} with input medias.
*/ | <code>Intent#setClass(Context, Class)</code> with input medias | withIntent | {
"repo_name": "backustech/boxing",
"path": "boxing/src/main/java/com/bilibili/boxing/Boxing.java",
"license": "apache-2.0",
"size": 8562
} | [
"android.content.Context",
"com.bilibili.boxing.model.entity.BaseMedia",
"java.util.ArrayList"
] | import android.content.Context; import com.bilibili.boxing.model.entity.BaseMedia; import java.util.ArrayList; | import android.content.*; import com.bilibili.boxing.model.entity.*; import java.util.*; | [
"android.content",
"com.bilibili.boxing",
"java.util"
] | android.content; com.bilibili.boxing; java.util; | 1,690,295 |
public Field getExtraField(); | Field function(); | /**
*
* get extra field
*
* @return
*/ | get extra field | getExtraField | {
"repo_name": "mztaylor/rice-git",
"path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/lookup/Lookupable.java",
"license": "apache-2.0",
"size": 8341
} | [
"org.kuali.rice.kns.web.ui.Field"
] | import org.kuali.rice.kns.web.ui.Field; | import org.kuali.rice.kns.web.ui.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 737,504 |
@Override
public DataDrivenParameterArray calculateParameterArray(final String className, final DataDrivenParameterArray inputParameterArray) {
//need to have input array
DataDrivenParameterArray transferArray = inputParameterArray; //need to change it, as we cannot touch the input array
... | DataDrivenParameterArray function(final String className, final DataDrivenParameterArray inputParameterArray) { DataDrivenParameterArray transferArray = inputParameterArray; if (transferArray == null) { transferArray = new DataDrivenParameterArray(); String[] parameterNames = new String[1]; parameterNames[0] = STR; tra... | /**
* This Data Feeder just multiplies the data as many times as requested in the parameter.
* @param className is the name of the caller test class
* @param inputParameterArray is the original data parameter array
* @return with the updated data parameter array
*/ | This Data Feeder just multiplies the data as many times as requested in the parameter | calculateParameterArray | {
"repo_name": "epam/Wilma",
"path": "wilma-functionaltest/src/main/java/com/epam/gepard/datadriven/feeders/BruteMultiplierDataFeeder.java",
"license": "gpl-3.0",
"size": 4145
} | [
"com.epam.gepard.datadriven.DataDrivenParameterArray"
] | import com.epam.gepard.datadriven.DataDrivenParameterArray; | import com.epam.gepard.datadriven.*; | [
"com.epam.gepard"
] | com.epam.gepard; | 683,644 |
DiskImage getAncestor(Guid id, Guid userID, boolean isFiltered); | DiskImage getAncestor(Guid id, Guid userID, boolean isFiltered); | /**
* Retrieves the ancestor of the given image (or the image itself, if it has no ancestors).
*
* @param id
* the id of the image to get the ancestor for.
* @param userID
* the ID of the user requesting the information
* @param isFiltered
* Wheth... | Retrieves the ancestor of the given image (or the image itself, if it has no ancestors) | getAncestor | {
"repo_name": "OpenUniversity/ovirt-engine",
"path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDao.java",
"license": "apache-2.0",
"size": 4296
} | [
"org.ovirt.engine.core.common.businessentities.storage.DiskImage",
"org.ovirt.engine.core.compat.Guid"
] | import org.ovirt.engine.core.common.businessentities.storage.DiskImage; import org.ovirt.engine.core.compat.Guid; | import org.ovirt.engine.core.common.businessentities.storage.*; import org.ovirt.engine.core.compat.*; | [
"org.ovirt.engine"
] | org.ovirt.engine; | 2,423,616 |
private void storeKeys(String key, String secret) {
// Save the access key for later
SharedPreferences prefs = mContext.getSharedPreferences(ACCOUNT_PREFS_NAME, 0);
Editor edit = prefs.edit();
edit.putString(ACCESS_KEY_NAME, key);
edit.putString(ACCESS_SECRET_NAME, secret)... | void function(String key, String secret) { SharedPreferences prefs = mContext.getSharedPreferences(ACCOUNT_PREFS_NAME, 0); Editor edit = prefs.edit(); edit.putString(ACCESS_KEY_NAME, key); edit.putString(ACCESS_SECRET_NAME, secret); edit.commit(); } | /**
* Shows keeping the access keys returned from Trusted Authenticator in a local
* store, rather than storing user name & password, and re-authenticating each
* time (which is not to be done, ever).
*/ | Shows keeping the access keys returned from Trusted Authenticator in a local store, rather than storing user name & password, and re-authenticating each time (which is not to be done, ever) | storeKeys | {
"repo_name": "Git-Host/DropboxText",
"path": "src/com/dropBoxText/alexVasquez/DropBox.java",
"license": "mit",
"size": 12076
} | [
"android.content.SharedPreferences"
] | import android.content.SharedPreferences; | import android.content.*; | [
"android.content"
] | android.content; | 989,911 |
public static Builder builder(KeyStoreConfig keystore) {
return new Builder(keystore);
}
public static class Builder {
private final Configurable<? extends Configuration> jaxrsConfig;
private final KeyStoreConfig keyStoreConfig;
private int socketTimeoutMs = DEFAULT_SOCKET... | static Builder function(KeyStoreConfig keystore) { return new Builder(keystore); } public static class Builder { private final Configurable<? extends Configuration> jaxrsConfig; private final KeyStoreConfig keyStoreConfig; private int socketTimeoutMs = DEFAULT_SOCKET_TIMEOUT_MS; private int connectTimeoutMs = DEFAULT_C... | /**
* Build a new {@link ClientConfiguration}.
*/ | Build a new <code>ClientConfiguration</code> | builder | {
"repo_name": "digipost/signature-api-client-java",
"path": "src/main/java/no/digipost/signature/client/ClientConfiguration.java",
"license": "apache-2.0",
"size": 18599
} | [
"java.time.Clock",
"java.util.ArrayList",
"java.util.List",
"java.util.Optional",
"javax.ws.rs.core.Configurable",
"javax.ws.rs.core.Configuration",
"no.digipost.signature.client.asice.DocumentBundleProcessor",
"no.digipost.signature.client.core.Sender",
"no.digipost.signature.client.security.Certif... | import java.time.Clock; import java.util.ArrayList; import java.util.List; import java.util.Optional; import javax.ws.rs.core.Configurable; import javax.ws.rs.core.Configuration; import no.digipost.signature.client.asice.DocumentBundleProcessor; import no.digipost.signature.client.core.Sender; import no.digipost.signat... | import java.time.*; import java.util.*; import javax.ws.rs.core.*; import no.digipost.signature.client.asice.*; import no.digipost.signature.client.core.*; import no.digipost.signature.client.security.*; import org.glassfish.jersey.client.*; import org.glassfish.jersey.logging.*; | [
"java.time",
"java.util",
"javax.ws",
"no.digipost.signature",
"org.glassfish.jersey"
] | java.time; java.util; javax.ws; no.digipost.signature; org.glassfish.jersey; | 943,174 |
public static String getDateAndTime(long date) {
GregorianCalendar g = new GregorianCalendar();
g.setTimeInMillis(date);
int year = g.get(Calendar.YEAR);
int month = g.get(Calendar.MONTH) + 1;
int day = g.get(Calendar.DAY_OF_MONTH);
int hour = g.get(Calendar.HOUR_OF_DAY);
int min = g.get(Calenda... | static String function(long date) { GregorianCalendar g = new GregorianCalendar(); g.setTimeInMillis(date); int year = g.get(Calendar.YEAR); int month = g.get(Calendar.MONTH) + 1; int day = g.get(Calendar.DAY_OF_MONTH); int hour = g.get(Calendar.HOUR_OF_DAY); int min = g.get(Calendar.MINUTE); int sec = g.get(Calendar.S... | /**
* Get a date string in local format for a specific date.
*
* @param date
* The date in millis.
* @return The formatted date string.
*/ | Get a date string in local format for a specific date | getDateAndTime | {
"repo_name": "dtag-dbu/speechalyzer",
"path": "src/FelixUtil/src/com/felix/util/Util.java",
"license": "lgpl-2.1",
"size": 19087
} | [
"java.util.Calendar",
"java.util.GregorianCalendar"
] | import java.util.Calendar; import java.util.GregorianCalendar; | import java.util.*; | [
"java.util"
] | java.util; | 2,914,310 |
public String[] searchSubreddits(String startswith, boolean withNSFW) throws RedditEngineException{
StringBuilder path = new StringBuilder();
path.append("/api/search_reddit_names");
String url = UrlUtils.getGetUrl(path.toString());
List<NameValuePair> params = new ArrayList<NameValuePair>();
if (starts... | String[] function(String startswith, boolean withNSFW) throws RedditEngineException{ StringBuilder path = new StringBuilder(); path.append(STR); String url = UrlUtils.getGetUrl(path.toString()); List<NameValuePair> params = new ArrayList<NameValuePair>(); if (startswith != null) { params.add(new BasicNameValuePair("que... | /**
* List subreddit names that begin with a query string
*
* @param startswith a string up to 50 characters long, consisting of printable characters
* @param withNSFW boolean value
* @return subreddit names
* @throws RedditEngineException
*/ | List subreddit names that begin with a query string | searchSubreddits | {
"repo_name": "fizzl/RedditEngine",
"path": "src/net/fizzl/redditengine/impl/SubredditsApi.java",
"license": "lgpl-3.0",
"size": 14459
} | [
"java.io.IOException",
"java.io.InputStream",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"net.fizzl.redditengine.data.GsonTemplate",
"org.apache.http.NameValuePair",
"org.apache.http.client.ClientProtocolException",
"org.apache.http.message.BasicNameValuePair"
] | import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Map; import net.fizzl.redditengine.data.GsonTemplate; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.message.BasicNameValuePair... | import java.io.*; import java.util.*; import net.fizzl.redditengine.data.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.message.*; | [
"java.io",
"java.util",
"net.fizzl.redditengine",
"org.apache.http"
] | java.io; java.util; net.fizzl.redditengine; org.apache.http; | 334,470 |
void remove(String key) throws UnexplainableDatabaseServiceException;
| void remove(String key) throws UnexplainableDatabaseServiceException; | /**
* Remove data.
*
* @param key
*/ | Remove data | remove | {
"repo_name": "clement-elbaz/somedamnmusic",
"path": "src/main/java/com/somedamnmusic/apis/DatabaseService.java",
"license": "apache-2.0",
"size": 1038
} | [
"com.somedamnmusic.database.UnexplainableDatabaseServiceException"
] | import com.somedamnmusic.database.UnexplainableDatabaseServiceException; | import com.somedamnmusic.database.*; | [
"com.somedamnmusic.database"
] | com.somedamnmusic.database; | 1,652,271 |
public List<Class> getAnnotationTypes()
{
List<Class> types = new ArrayList<Class>();
Iterator<JCheckBox> i = annotationTypes.keySet().iterator();
JCheckBox box;
if (!withAnnotation.isSelected()) {
while (i.hasNext()) {
box = i.next();
types.add(annotationTypes.get(box));... | List<Class> function() { List<Class> types = new ArrayList<Class>(); Iterator<JCheckBox> i = annotationTypes.keySet().iterator(); JCheckBox box; if (!withAnnotation.isSelected()) { while (i.hasNext()) { box = i.next(); types.add(annotationTypes.get(box)); } } else { while (i.hasNext()) { box = i.next(); if (!box.isSele... | /**
* Returns the types of annotations to keep.
*
* @return See above.
*/ | Returns the types of annotations to keep | getAnnotationTypes | {
"repo_name": "simleo/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/DeleteBox.java",
"license": "gpl-2.0",
"size": 12271
} | [
"java.util.ArrayList",
"java.util.Iterator",
"java.util.List",
"javax.swing.JCheckBox"
] | import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.swing.JCheckBox; | import java.util.*; import javax.swing.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 1,750,376 |
Stream<TargetType> map(Collection<? extends SourceType> source, Supplier<TargetType> supplier); | Stream<TargetType> map(Collection<? extends SourceType> source, Supplier<TargetType> supplier); | /**
* Do map if you have collection of source objects.
*
* @param source
* @param supplier
* supplier eg. Target::new
* @return Stream of target objects
*/ | Do map if you have collection of source objects | map | {
"repo_name": "rpridal/J8Mapper",
"path": "src/main/java/cz/rpridal/j8mapper/mapper/Mapper.java",
"license": "gpl-2.0",
"size": 1893
} | [
"java.util.Collection",
"java.util.function.Supplier",
"java.util.stream.Stream"
] | import java.util.Collection; import java.util.function.Supplier; import java.util.stream.Stream; | import java.util.*; import java.util.function.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 2,200,664 |
public void close() {
serialPort.removeEventListener();
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
serialPort.close();
}
}
public static class PollJob implements Job { | void function() { serialPort.removeEventListener(); IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(outputStream); serialPort.close(); } } public static class PollJob implements Job { | /**
* Close this serial device
*/ | Close this serial device | close | {
"repo_name": "falkena/openhab",
"path": "bundles/binding/org.openhab.binding.oceanic/src/main/java/org/openhab/binding/oceanic/internal/OceanicBinding.java",
"license": "epl-1.0",
"size": 23830
} | [
"org.apache.commons.io.IOUtils",
"org.quartz.Job"
] | import org.apache.commons.io.IOUtils; import org.quartz.Job; | import org.apache.commons.io.*; import org.quartz.*; | [
"org.apache.commons",
"org.quartz"
] | org.apache.commons; org.quartz; | 2,140,540 |
public RelBuilder scan(String... tableNames) {
return scan(ImmutableList.copyOf(tableNames));
} | RelBuilder function(String... tableNames) { return scan(ImmutableList.copyOf(tableNames)); } | /** Creates a {@link TableScan} of the table
* with a given name.
*
* <p>Throws if the table does not exist.
*
* <p>Returns this builder.
*
* @param tableNames Name of table (can optionally be qualified)
*/ | Creates a <code>TableScan</code> of the table with a given name. Throws if the table does not exist. Returns this builder | scan | {
"repo_name": "xhoong/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/tools/RelBuilder.java",
"license": "apache-2.0",
"size": 108300
} | [
"com.google.common.collect.ImmutableList"
] | import com.google.common.collect.ImmutableList; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,988,045 |
protected static boolean isHashCodeMethod(Method method)
{
return method.getReturnType() == int.class && method.getParameterTypes().length == 0 &&
method.getName().equals("hashCode");
} | static boolean function(Method method) { return method.getReturnType() == int.class && method.getParameterTypes().length == 0 && method.getName().equals(STR); } | /**
* Checks if the method is derived from Object.hashCode()
*
* @param method
* method being tested
* @return true if the method is defined from Object.hashCode(), false otherwise
*/ | Checks if the method is derived from Object.hashCode() | isHashCodeMethod | {
"repo_name": "astubbs/wicket.get-portals2",
"path": "wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java",
"license": "apache-2.0",
"size": 14116
} | [
"java.lang.reflect.Method"
] | import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,143,697 |
private static String readResourcesFile(final String fileName) throws IOException {
final InputStream inputStream = TestUtils.class.getResourceAsStream(fileName);
final ByteArrayOutputStream result = new ByteArrayOutputStream();
final byte[] buffer = new byte[1024];
int length;
... | static String function(final String fileName) throws IOException { final InputStream inputStream = TestUtils.class.getResourceAsStream(fileName); final ByteArrayOutputStream result = new ByteArrayOutputStream(); final byte[] buffer = new byte[1024]; int length; while ((length = inputStream.read(buffer)) != -1) { result... | /**
* This method can only load a resource placed in the same package as this java file
* inside the test resources folder
* @param fileName Name of the file to read from disk
* @return Text representation of the contents of the file
* @throws IOException In case something went wrong reading th... | This method can only load a resource placed in the same package as this java file inside the test resources folder | readResourcesFile | {
"repo_name": "sebaslogen/Blendletje",
"path": "app/src/testShared/java/utils/TestUtils.java",
"license": "mit",
"size": 2101
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.io.InputStream"
] | import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,985,132 |
public void checkDatabase() {
try {
this.getConnection().createStatement().execute("CREATE TABLE IF NOT EXISTS permissionDataP(uuid VARCHAR(255), groupname VARCHAR(255), selfpermissions LONGTEXT)");
this.getConnection().createStatement().execute("CREATE TABLE IF NOT EXISTS permission... | void function() { try { this.getConnection().createStatement().execute(STR); this.getConnection().createStatement().execute(STR); ResultSet rs = this.getPreparedStatement(STR).executeQuery(); rs.next(); if (rs.getInt(1) == 0) { this.getConnection().createStatement().execute(STR); } ResultSet rs1 = this.getPreparedState... | /**
* Check the Database
*/ | Check the Database | checkDatabase | {
"repo_name": "ModernDayPlayer/Permissions",
"path": "src/main/java/me/legitmodern/PermissionsAPI/Utils/SQL/DatabaseManager.java",
"license": "mit",
"size": 7766
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.logging.Level",
"me.legitmodern.PermissionsAPI"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import me.legitmodern.PermissionsAPI; | import java.sql.*; import java.util.logging.*; import me.legitmodern.*; | [
"java.sql",
"java.util",
"me.legitmodern"
] | java.sql; java.util; me.legitmodern; | 415,941 |
protected Options setOptions() {
Options options = setBaseOptions(new Options());
// Note:
// Command line options already provided by RBNBBase include:
// -h "Print help"
// -s "RBNB Server Hostname"
// -p "RBNB Server Port Number"
// -S "RBNB Source Name"
... | Options function() { Options options = setBaseOptions(new Options()); options.addOption("H", true, STR + getHostName()); options.addOption("C", true, STR + getRBNBChannelName()); options.addOption("s", true, STR); options.addOption("p", true, STR); return options; } | /**
* A method that sets the command line options for this class. This method
* calls the <code>RBNBSource.setBaseOptions()</code> method in order to set
* properties such as the sourceHostName, sourceHostPort, serverName, and
* serverPort.
*
* @return options The command line options bei... | A method that sets the command line options for this class. This method calls the <code>RBNBSource.setBaseOptions()</code> method in order to set properties such as the sourceHostName, sourceHostPort, serverName, and serverPort | setOptions | {
"repo_name": "csjx/realtime-data",
"path": "src/main/java/edu/hawaii/soest/hioos/storx/StorXDispatcher.java",
"license": "gpl-2.0",
"size": 43862
} | [
"org.apache.commons.cli.Options"
] | import org.apache.commons.cli.Options; | import org.apache.commons.cli.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,693,623 |
@Deprecated public static <K, V> ListMultimap<K, V> unmodifiableListMultimap(
ImmutableListMultimap<K, V> delegate) {
return checkNotNull(delegate);
} | @Deprecated static <K, V> ListMultimap<K, V> function( ImmutableListMultimap<K, V> delegate) { return checkNotNull(delegate); } | /**
* Simply returns its argument.
*
* @deprecated no need to use this
* @since 10.0
*/ | Simply returns its argument | unmodifiableListMultimap | {
"repo_name": "user234/setyon-guava-libraries-clone",
"path": "guava/src/com/google/common/collect/Multimaps.java",
"license": "apache-2.0",
"size": 95760
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 497,080 |
return Sync4jModule;
}
private Sync4jConnector Sync4jConnector; | return Sync4jModule; } private Sync4jConnector Sync4jConnector; | /**
* Returns property Sync4jModule
*/ | Returns property Sync4jModule | getSync4jModule | {
"repo_name": "accesstest3/cfunambol",
"path": "admin-suite/admin/src/com/funambol/admin/module/nodes/SyncSourceExceptionNode.java",
"license": "agpl-3.0",
"size": 9173
} | [
"com.funambol.framework.server.Sync4jConnector",
"com.funambol.framework.server.Sync4jModule"
] | import com.funambol.framework.server.Sync4jConnector; import com.funambol.framework.server.Sync4jModule; | import com.funambol.framework.server.*; | [
"com.funambol.framework"
] | com.funambol.framework; | 2,321,521 |
public void downloadFile(final String path, final DownloadListener downloadListener)
throws IOException, ServerException {
Link link = cloudApi.getDownloadLink(path);
new RestClientIO(client, credentials.getHeaders())
.downloadUrl(link.getHref(), downloadListener);
} | void function(final String path, final DownloadListener downloadListener) throws IOException, ServerException { Link link = cloudApi.getDownloadLink(path); new RestClientIO(client, credentials.getHeaders()) .downloadUrl(link.getHref(), downloadListener); } | /**
* Downloading a file from Disk
*
* @see <p>API reference <a href="http://api.yandex.com/disk/api/reference/content.xml">english</a>,
* <a href="https://tech.yandex.ru/disk/api/reference/content-docpage/">russian</a></p>
*/ | Downloading a file from Disk | downloadFile | {
"repo_name": "yandex-disk/yandex-disk-restapi-java",
"path": "disk-restapi-sdk/src/main/java/com/yandex/disk/rest/RestClient.java",
"license": "apache-2.0",
"size": 19562
} | [
"com.yandex.disk.rest.exceptions.ServerException",
"com.yandex.disk.rest.json.Link",
"java.io.IOException"
] | import com.yandex.disk.rest.exceptions.ServerException; import com.yandex.disk.rest.json.Link; import java.io.IOException; | import com.yandex.disk.rest.exceptions.*; import com.yandex.disk.rest.json.*; import java.io.*; | [
"com.yandex.disk",
"java.io"
] | com.yandex.disk; java.io; | 307,194 |
public void stop()
throws Exception {
log.info("Stopping...");
serviceLocator.getService(EmbeddedJetty.class).stop();
log.info("Stopped");
}
| void function() throws Exception { log.info(STR); serviceLocator.getService(EmbeddedJetty.class).stop(); log.info(STR); } | /**
* Informs the server to stop.
* @throws Exception Stop error.
*/ | Informs the server to stop | stop | {
"repo_name": "expanset/expanset",
"path": "samples/samples-getting-started/src/main/java/com/expanset/samples/getstart/App.java",
"license": "apache-2.0",
"size": 3413
} | [
"com.expanset.jersey.jetty.EmbeddedJetty"
] | import com.expanset.jersey.jetty.EmbeddedJetty; | import com.expanset.jersey.jetty.*; | [
"com.expanset.jersey"
] | com.expanset.jersey; | 235,605 |
public final List<String> getLastLogs(int count)
{
if (count > m_logList.size())
{
count = m_logList.size();
}
if (m_logList.size() == 0)
{
return new ArrayList<>(0);
}
else
{
final ArrayDeque<String> list = new ... | final List<String> function(int count) { if (count > m_logList.size()) { count = m_logList.size(); } if (m_logList.size() == 0) { return new ArrayList<>(0); } else { final ArrayDeque<String> list = new ArrayDeque<>(count); count--; int start = m_logList.size() - 1; int end = start - count; for (int i = start; i >= end;... | /**
* Return a {@link List} with the last count of log statements. If there haven't been any yet, an empty list is returned.
*/ | Return a <code>List</code> with the last count of log statements. If there haven't been any yet, an empty list is returned | getLastLogs | {
"repo_name": "iDevicesInc/SweetBlue",
"path": "library/src/main/java/com/idevicesinc/sweetblue/utils/DebugLogger.java",
"license": "gpl-3.0",
"size": 5181
} | [
"java.util.ArrayDeque",
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayDeque; import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 134,331 |
@Test
public void shouldReturnDifferenceBetwenOfTwoArgumentsPassed() {
Calculator calculator = new Calculator();
calculator.substruct(11.0, 6.5);
assertThat(calculator.getResult(), is(4.5));
} | void function() { Calculator calculator = new Calculator(); calculator.substruct(11.0, 6.5); assertThat(calculator.getResult(), is(4.5)); } | /**
* Test substruct.
*/ | Test substruct | shouldReturnDifferenceBetwenOfTwoArgumentsPassed | {
"repo_name": "AleksVira/apetrov",
"path": "chapter_001/src/test/java/ru/job4j/CalculatorTest.java",
"license": "apache-2.0",
"size": 1190
} | [
"org.hamcrest.core.Is",
"org.junit.Assert"
] | import org.hamcrest.core.Is; import org.junit.Assert; | import org.hamcrest.core.*; import org.junit.*; | [
"org.hamcrest.core",
"org.junit"
] | org.hamcrest.core; org.junit; | 2,888,076 |
public void putFrame()
{
if (currImage != null)
{
super.putFrame(currImage, objectRects, new Scalar(0, 255, 0), 0);
}
} //putFrame | void function() { if (currImage != null) { super.putFrame(currImage, objectRects, new Scalar(0, 255, 0), 0); } } | /**
* This method update the video stream with the detected targets overlay on the image as rectangles.
*/ | This method update the video stream with the detected targets overlay on the image as rectangles | putFrame | {
"repo_name": "trc492/Frc2017FirstSteamWorks",
"path": "src/frclib/FrcVisionTarget.java",
"license": "mit",
"size": 6100
} | [
"org.opencv.core.Scalar"
] | import org.opencv.core.Scalar; | import org.opencv.core.*; | [
"org.opencv.core"
] | org.opencv.core; | 2,085,614 |
public Key getKey()
{
return keyImpl;
} | Key function() { return keyImpl; } | /**
* Returns the key data.
*
* @return key
*/ | Returns the key data | getKey | {
"repo_name": "chenxiuheng/rtsp-proxy",
"path": "src/main/java/gov/nist/javax/sdp/SessionDescriptionImpl.java",
"license": "gpl-2.0",
"size": 26046
} | [
"javax.sdp.Key"
] | import javax.sdp.Key; | import javax.sdp.*; | [
"javax.sdp"
] | javax.sdp; | 105,765 |
protected void createMarkerColumn(int aModelIdx)
{
// add Marker Column
int colSize = 40;
TableColumn newColumn = new TableColumn(aModelIdx, colSize, createMarkerRenderer(), null);
newColumn.setHeaderValue("");
newColumn.setMaxWidth(colSize);newColumn.setMinWidth(colSize);
newColu... | void function(int aModelIdx) { int colSize = 40; TableColumn newColumn = new TableColumn(aModelIdx, colSize, createMarkerRenderer(), null); newColumn.setHeaderValue(""); newColumn.setMaxWidth(colSize);newColumn.setMinWidth(colSize); newColumn.setWidth(colSize); this.addColumn(newColumn); } | /**
* Set the first column as a marker
*
*/ | Set the first column as a marker | createMarkerColumn | {
"repo_name": "schnurlei/jdynameta",
"path": "jdy/jdy.view.swing/src/main/java/de/jdynameta/metainfoview/metainfo/table/ClassInfoColumnModel.java",
"license": "apache-2.0",
"size": 11814
} | [
"javax.swing.table.TableColumn"
] | import javax.swing.table.TableColumn; | import javax.swing.table.*; | [
"javax.swing"
] | javax.swing; | 936,108 |
QueryService getQueryService(); | QueryService getQueryService(); | /**
* Return the QueryService for this region service. For a region service in a client the returned
* QueryService will execute queries on the server. For a region service not in a client the
* returned QueryService will execute queries on the local and peer regions.
*/ | Return the QueryService for this region service. For a region service in a client the returned QueryService will execute queries on the server. For a region service not in a client the returned QueryService will execute queries on the local and peer regions | getQueryService | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/main/java/org/apache/geode/cache/RegionService.java",
"license": "apache-2.0",
"size": 5548
} | [
"org.apache.geode.cache.query.QueryService"
] | import org.apache.geode.cache.query.QueryService; | import org.apache.geode.cache.query.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,611,790 |
private void setFilters(Map<String, Object> configProps) throws WIMSystemException {
// If no ldap type configured, return
if (iLdapType == null)
return;
// Determine the Ldap type configured.
//name under which filters are put
String key = null;
if (iLda... | void function(Map<String, Object> configProps) throws WIMSystemException { if (iLdapType == null) return; String key = null; if (iLdapType.equalsIgnoreCase(LdapConstants.AD_LDAP_SERVER)) { key = ConfigConstants.CONFIG_ACTIVE_DIRECTORY_FILTERS; } else if (iLdapType.equalsIgnoreCase(LdapConstants.CUSTOM_LDAP_SERVER)) { k... | /**
* Set the filters depending on the ldap type selected.
*
* @param configProps
*/ | Set the filters depending on the ldap type selected | setFilters | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConfigManager.java",
"license": "epl-1.0",
"size": 143111
} | [
"com.ibm.websphere.ras.Tr",
"com.ibm.websphere.security.wim.ConfigConstants",
"com.ibm.websphere.security.wim.ras.WIMMessageHelper",
"com.ibm.websphere.security.wim.ras.WIMMessageKey",
"com.ibm.ws.config.xml.internal.nester.Nester",
"com.ibm.wsspi.security.wim.SchemaConstants",
"com.ibm.wsspi.security.w... | import com.ibm.websphere.ras.Tr; import com.ibm.websphere.security.wim.ConfigConstants; import com.ibm.websphere.security.wim.ras.WIMMessageHelper; import com.ibm.websphere.security.wim.ras.WIMMessageKey; import com.ibm.ws.config.xml.internal.nester.Nester; import com.ibm.wsspi.security.wim.SchemaConstants; import com.... | import com.ibm.websphere.ras.*; import com.ibm.websphere.security.wim.*; import com.ibm.websphere.security.wim.ras.*; import com.ibm.ws.config.xml.internal.nester.*; import com.ibm.wsspi.security.wim.*; import com.ibm.wsspi.security.wim.exception.*; import java.util.*; | [
"com.ibm.websphere",
"com.ibm.ws",
"com.ibm.wsspi",
"java.util"
] | com.ibm.websphere; com.ibm.ws; com.ibm.wsspi; java.util; | 1,739,580 |
public ServiceFuture<VirtualHubInner> createOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback<VirtualHubInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubNam... | ServiceFuture<VirtualHubInner> function(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters, final ServiceCallback<VirtualHubInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters), serv... | /**
* Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
*
* @param resourceGroupName The resource group name of the VirtualHub.
* @param virtualHubName The name of the VirtualHub.
* @param virtualHubParameters Parameters supplied to create or update Virtual... | Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub | createOrUpdateAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualHubsInner.java",
"license": "mit",
"size": 72294
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 906,713 |
@MXBeanDescription("Direct send buffer.")
public boolean isDirectSendBuffer(); | @MXBeanDescription(STR) boolean function(); | /**
* Gets flag defining whether direct send buffer should be used.
*
* @return {@code True} if direct buffers should be used.
*/ | Gets flag defining whether direct send buffer should be used | isDirectSendBuffer | {
"repo_name": "tkpanther/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java",
"license": "apache-2.0",
"size": 9304
} | [
"org.apache.ignite.mxbean.MXBeanDescription"
] | import org.apache.ignite.mxbean.MXBeanDescription; | import org.apache.ignite.mxbean.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 82,521 |
public Set<Edge> getColumnData (final Object columnObj); | Set<Edge> function (final Object columnObj); | /**
* get the edges associated with a particular column object
* In a directed graph these will be the edges where the node is the sink
* In an undirected (symmetric) graph these will be edges where the node is either source or sink
* @param columnObj
* @return Set<Edge> a set of edges for the ... | get the edges associated with a particular column object In a directed graph these will be the edges where the node is the sink In an undirected (symmetric) graph these will be edges where the node is either source or sink | getColumnData | {
"repo_name": "martingraham/JSwingPlus",
"path": "src/model/matrix/MatrixTableModel.java",
"license": "apache-2.0",
"size": 1748
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 876,970 |
public static BufferedImage chartImage(ChartType type, ChartData data, int pixelWidth, int pixelHeight) {
return new JFreeChartGenerator(data, pixelWidth, pixelHeight).image(type);
}
| static BufferedImage function(ChartType type, ChartData data, int pixelWidth, int pixelHeight) { return new JFreeChartGenerator(data, pixelWidth, pixelHeight).image(type); } | /**
* Generate an image of a chart.
* @param data
* @param pixelWidth
* @param pixelHeight
* @return
*/ | Generate an image of a chart | chartImage | {
"repo_name": "skyvers/skyve",
"path": "skyve-ext/src/main/java/org/skyve/EXT.java",
"license": "lgpl-2.1",
"size": 15079
} | [
"java.awt.image.BufferedImage",
"org.skyve.impl.generate.charts.JFreeChartGenerator",
"org.skyve.impl.metadata.view.widget.Chart",
"org.skyve.metadata.view.model.chart.ChartData"
] | import java.awt.image.BufferedImage; import org.skyve.impl.generate.charts.JFreeChartGenerator; import org.skyve.impl.metadata.view.widget.Chart; import org.skyve.metadata.view.model.chart.ChartData; | import java.awt.image.*; import org.skyve.impl.generate.charts.*; import org.skyve.impl.metadata.view.widget.*; import org.skyve.metadata.view.model.chart.*; | [
"java.awt",
"org.skyve.impl",
"org.skyve.metadata"
] | java.awt; org.skyve.impl; org.skyve.metadata; | 1,434,247 |
public void testInvalidKeyUpdate() throws Exception {
startClientVMs(1, 0, null);
startServerVMs(1, 0, "SG1");
clientSQLExecute(1, "create table t1(id int not null, primary key(id))");
// avoid default colocation/partitioning else update will fail due to
// update on partitioning column
clie... | void function() throws Exception { startClientVMs(1, 0, null); startServerVMs(1, 0, "SG1"); clientSQLExecute(1, STR); clientSQLExecute(1, STR + STR + STR); clientSQLExecute(1, STR); clientSQLExecute(1, STR); addExpectedException(new int[] { 1 }, new int[] { 1 }, new Object[] { FunctionExecutionException.class, STR, Fun... | /**
* Test update to an invalid foreign key.
*/ | Test update to an invalid foreign key | testInvalidKeyUpdate | {
"repo_name": "gemxd/gemfirexd-oss",
"path": "gemfirexd/tools/src/dunit/java/com/pivotal/gemfirexd/insert/InsertUpdateForeignKeyDUnit.java",
"license": "apache-2.0",
"size": 26394
} | [
"com.gemstone.gemfire.cache.execute.FunctionException",
"com.pivotal.gemfirexd.internal.engine.distributed.FunctionExecutionException"
] | import com.gemstone.gemfire.cache.execute.FunctionException; import com.pivotal.gemfirexd.internal.engine.distributed.FunctionExecutionException; | import com.gemstone.gemfire.cache.execute.*; import com.pivotal.gemfirexd.internal.engine.distributed.*; | [
"com.gemstone.gemfire",
"com.pivotal.gemfirexd"
] | com.gemstone.gemfire; com.pivotal.gemfirexd; | 200,044 |
public JsonFluentAssert matches(Matcher<?> matcher) {
internalMatcher.matches(matcher);
return this;
}
public static class ArrayAssert {
private final InternalMatcher.ArrayMatcher arrayMatcher;
ArrayAssert(InternalMatcher.ArrayMatcher arrayMatcher) {
this.... | JsonFluentAssert function(Matcher<?> matcher) { internalMatcher.matches(matcher); return this; } public static class ArrayAssert { private final InternalMatcher.ArrayMatcher arrayMatcher; ArrayAssert(InternalMatcher.ArrayMatcher arrayMatcher) { this.arrayMatcher = arrayMatcher; } | /**
* Matches the node using Hamcrest internalMatcher.
*
* <ul>
* <li>Numbers are mapped to BigDecimal</li>
* <li>Arrays are mapped to a Collection</li>
* <li>Objects are mapped to a map so you can use json(Part)Equals or a Map internalMatcher</li>
* </ul>
*
* @p... | Matches the node using Hamcrest internalMatcher. Numbers are mapped to BigDecimal Arrays are mapped to a Collection Objects are mapped to a map so you can use json(Part)Equals or a Map internalMatcher | matches | {
"repo_name": "lukas-krecan/JsonUnit",
"path": "json-unit-fluent/src/main/java/net/javacrumbs/jsonunit/fluent/JsonFluentAssert.java",
"license": "apache-2.0",
"size": 13282
} | [
"net.javacrumbs.jsonunit.core.internal.matchers.InternalMatcher",
"org.hamcrest.Matcher"
] | import net.javacrumbs.jsonunit.core.internal.matchers.InternalMatcher; import org.hamcrest.Matcher; | import net.javacrumbs.jsonunit.core.internal.matchers.*; import org.hamcrest.*; | [
"net.javacrumbs.jsonunit",
"org.hamcrest"
] | net.javacrumbs.jsonunit; org.hamcrest; | 2,523,673 |
public static float norm1(final float[][] x) {
// squareCheck(x);
final int n = x.length;
final int m = x[0].length;
int j;
float amax, norm = 0;
for (int i = 0; i < m; norm = max(norm, amax), i++)
for (amax = 0, j = 0; j < n; amax += abs(x[j][i]), j++) ;
return norm;
} | static float function(final float[][] x) { final int n = x.length; final int m = x[0].length; int j; float amax, norm = 0; for (int i = 0; i < m; norm = max(norm, amax), i++) for (amax = 0, j = 0; j < n; amax += abs(x[j][i]), j++) ; return norm; } | /**
* L1 (column) norm of a NxM matrix.
*
* @param x float[][] the matrix
* @return float the norm
*/ | L1 (column) norm of a NxM matrix | norm1 | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-external/src/main/java/de/lab4inf/math/lapack/LinearAlgebra.java",
"license": "gpl-3.0",
"size": 103733
} | [
"java.lang.Math"
] | import java.lang.Math; | import java.lang.*; | [
"java.lang"
] | java.lang; | 23,494 |
LibraryFactory getLibraryFactory();
interface Literals {
EEnum BOOK_CATEGORY = eINSTANCE.getBookCategory();
}
| LibraryFactory getLibraryFactory(); interface Literals { EEnum BOOK_CATEGORY = eINSTANCE.getBookCategory(); } | /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the factory that creates the instances of the model.
* @generated
*/ | Returns the factory that creates the instances of the model. | getLibraryFactory | {
"repo_name": "planger/collaborative-modeling-tutorial",
"path": "org.eclipse.papyrus.training.library.profile/src/org/eclipse/papyrus/training/library/profile/library/LibraryPackage.java",
"license": "epl-1.0",
"size": 3420
} | [
"org.eclipse.emf.ecore.EEnum"
] | import org.eclipse.emf.ecore.EEnum; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,036,975 |
public List<Qualifier> getQualifiers() {
return qualifiers;
} | List<Qualifier> function() { return qualifiers; } | /**
* The qualifiers associated with this source reference.
*
* @return The qualifiers associated with this source reference.
*/ | The qualifiers associated with this source reference | getQualifiers | {
"repo_name": "FamilySearch/fs-platform-android",
"path": "fs-android/src/main/java/org/gedcomx/source/SourceReference.java",
"license": "apache-2.0",
"size": 3139
} | [
"java.util.List",
"org.gedcomx.common.Qualifier"
] | import java.util.List; import org.gedcomx.common.Qualifier; | import java.util.*; import org.gedcomx.common.*; | [
"java.util",
"org.gedcomx.common"
] | java.util; org.gedcomx.common; | 1,616,708 |
public Enumeration<String> getFileParameterNames() {
return new IteratorEnumeration(this.files.keySet().iterator());
} | Enumeration<String> function() { return new IteratorEnumeration(this.files.keySet().iterator()); } | /**
* Fetches the names of all file parameters in the request. Note that these are not the file
* names, but the names given to the form fields in which the files are specified.
*
* @return the names of all file parameters in the request.
*/ | Fetches the names of all file parameters in the request. Note that these are not the file names, but the names given to the form fields in which the files are specified | getFileParameterNames | {
"repo_name": "scarcher2/stripes",
"path": "stripes/src/net/sourceforge/stripes/controller/multipart/CommonsMultipartWrapper.java",
"license": "apache-2.0",
"size": 9495
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 1,982,376 |
public Date getAlarmbegin() {
return alarmbegin;
} | Date function() { return alarmbegin; } | /**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column nfjd502.dbo.BAlarmData.AlarmBegin
*
* @return the value of nfjd502.dbo.BAlarmData.AlarmBegin
*
* @mbggenerated Thu Mar 02 11:23:21 CST 2017
*/ | This method was generated by MyBatis Generator. This method returns the value of the database column nfjd502.dbo.BAlarmData.AlarmBegin | getAlarmbegin | {
"repo_name": "xtwxy/cassandra-tests",
"path": "mstar-server-dao/src/main/java/com/wincom/mstar/domain/BAlarmData.java",
"license": "apache-2.0",
"size": 25523
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,661,627 |
double readTos() throws IOException {
byte[] buffer = new byte[2];
int readedBytes = this.read(3,buffer, 0, 2);
log.trace("readTos readedBytes: " + readedBytes);
if(readedBytes>0) log.trace("BUFFER0:"+ buffer[0]);;
if(readedBytes>1) log.trace("BUFFER1:"+ buffer[1]);;
... | double readTos() throws IOException { byte[] buffer = new byte[2]; int readedBytes = this.read(3,buffer, 0, 2); log.trace(STR + readedBytes); if(readedBytes>0) log.trace(STR+ buffer[0]);; if(readedBytes>1) log.trace(STR+ buffer[1]);; return convertBytesToTemperatur(buffer); } | /**
* read current Tos-Status from register 03
* @return
* @throws IOException
*/ | read current Tos-Status from register 03 | readTos | {
"repo_name": "eddi888/ultra-pi2c",
"path": "src/main/java/org/atomspace/pi2c/device/lm75/Lm75.java",
"license": "apache-2.0",
"size": 5890
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,666,725 |
public String getInput() {
return input;
}
}
public static class JSONParseException extends ParseException {
public JSONParseException(String input, JSONException e) {
super(input, e);
}
}
| String function() { return input; } } public static class JSONParseException extends ParseException { public JSONParseException(String input, JSONException e) { super(input, e); } } | /**
* Returns the original text that failed to be parsed
*/ | Returns the original text that failed to be parsed | getInput | {
"repo_name": "tmalahie/aQuery",
"path": "main/java/aquery/com/aquery/$Utils.java",
"license": "lgpl-3.0",
"size": 65615
} | [
"org.json.JSONException"
] | import org.json.JSONException; | import org.json.*; | [
"org.json"
] | org.json; | 2,280,444 |
Annotation createWeakWarningAnnotation(@NotNull ASTNode node, @Nullable String message); | Annotation createWeakWarningAnnotation(@NotNull ASTNode node, @Nullable String message); | /**
* Creates an annotation with severity {@link HighlightSeverity#WEAK_WARNING} ('weak warning') with the specified
* message over the specified AST node.
*
* @param node the node over which the annotation is created.
* @param message the info message.
* @return the annotation (which can be modifi... | Creates an annotation with severity <code>HighlightSeverity#WEAK_WARNING</code> ('weak warning') with the specified message over the specified AST node | createWeakWarningAnnotation | {
"repo_name": "akosyakov/intellij-community",
"path": "platform/analysis-api/src/com/intellij/lang/annotation/AnnotationHolder.java",
"license": "apache-2.0",
"size": 7924
} | [
"com.intellij.lang.ASTNode",
"org.jetbrains.annotations.NotNull",
"org.jetbrains.annotations.Nullable"
] | import com.intellij.lang.ASTNode; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; | import com.intellij.lang.*; import org.jetbrains.annotations.*; | [
"com.intellij.lang",
"org.jetbrains.annotations"
] | com.intellij.lang; org.jetbrains.annotations; | 118,044 |
private void copyConfigurationFiles() throws IOException {
for (Entry<String, String> entry : filePathMap.entrySet()) {
String sourceFileName = entry.getKey();
String fileDestinationPath = entry.getValue();
File file;
if (SolrConstants.SOLR_HOME.equals(fileDe... | void function() throws IOException { for (Entry<String, String> entry : filePathMap.entrySet()) { String sourceFileName = entry.getKey(); String fileDestinationPath = entry.getValue(); File file; if (SolrConstants.SOLR_HOME.equals(fileDestinationPath)) { file = new File(solrHome, sourceFileName); } else if (SolrConstan... | /**
* Copy solr configuration files in resource folder to solr home folder.
* @throws IOException
*/ | Copy solr configuration files in resource folder to solr home folder | copyConfigurationFiles | {
"repo_name": "arunasujith/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.indexing/src/main/java/org/wso2/carbon/registry/indexing/solr/SolrClient.java",
"license": "apache-2.0",
"size": 53679
} | [
"java.io.File",
"java.io.IOException",
"java.util.Map",
"org.wso2.carbon.registry.indexing.SolrConstants"
] | import java.io.File; import java.io.IOException; import java.util.Map; import org.wso2.carbon.registry.indexing.SolrConstants; | import java.io.*; import java.util.*; import org.wso2.carbon.registry.indexing.*; | [
"java.io",
"java.util",
"org.wso2.carbon"
] | java.io; java.util; org.wso2.carbon; | 1,722,424 |
boolean isUserOwner()
{
long userID = ImViewerAgent.getUserDetails().getId();
return EditorUtil.isUserOwner(getImage(), userID);
}
| boolean isUserOwner() { long userID = ImViewerAgent.getUserDetails().getId(); return EditorUtil.isUserOwner(getImage(), userID); } | /**
* Returns <code>true</code> if the user logged in is the owner of the
* image, <code>false</code> otherwise.
*
* @return See above.
*/ | Returns <code>true</code> if the user logged in is the owner of the image, <code>false</code> otherwise | isUserOwner | {
"repo_name": "stelfrich/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java",
"license": "gpl-2.0",
"size": 80456
} | [
"org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent",
"org.openmicroscopy.shoola.agents.util.EditorUtil"
] | import org.openmicroscopy.shoola.agents.imviewer.ImViewerAgent; import org.openmicroscopy.shoola.agents.util.EditorUtil; | import org.openmicroscopy.shoola.agents.imviewer.*; import org.openmicroscopy.shoola.agents.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 592,084 |
@Deprecated
public void setScanDir (File dir)
{
_scanDirs = new ArrayList();
_scanDirs.add(dir);
} | void function (File dir) { _scanDirs = new ArrayList(); _scanDirs.add(dir); } | /**
* Set the location of the directory to scan.
* @param dir
* @deprecated use setScanDirs(List dirs) instead
*/ | Set the location of the directory to scan | setScanDir | {
"repo_name": "mabrek/jetty",
"path": "jetty-util/src/main/java/org/eclipse/jetty/util/Scanner.java",
"license": "apache-2.0",
"size": 13694
} | [
"java.io.File",
"java.util.ArrayList"
] | import java.io.File; import java.util.ArrayList; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,843,242 |
private void updateVmsOfInstanceType() {
if (!isInstanceType()) {
return;
}
// get vms from db
List<VM> vmsToUpdate = getVmDao().getVmsListByInstanceType(getVmTemplateId());
for (VM vm : vmsToUpdate) {
VmManagementParametersBase params = new VmManagem... | void function() { if (!isInstanceType()) { return; } List<VM> vmsToUpdate = getVmDao().getVmsListByInstanceType(getVmTemplateId()); for (VM vm : vmsToUpdate) { VmManagementParametersBase params = new VmManagementParametersBase(vm); params.setApplyChangesLater(true); runInternalAction(VdcActionType.UpdateVm, params); } ... | /**
* only in case of InstanceType update, update all vms that are bound to it
*/ | only in case of InstanceType update, update all vms that are bound to it | updateVmsOfInstanceType | {
"repo_name": "yingyun001/ovirt-engine",
"path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java",
"license": "apache-2.0",
"size": 23352
} | [
"java.util.List",
"org.ovirt.engine.core.common.action.VdcActionType",
"org.ovirt.engine.core.common.action.VmManagementParametersBase"
] | import java.util.List; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.action.VmManagementParametersBase; | import java.util.*; import org.ovirt.engine.core.common.action.*; | [
"java.util",
"org.ovirt.engine"
] | java.util; org.ovirt.engine; | 2,849,615 |
private boolean isPublicOrProtected(DetailAST aAST)
{
final DetailAST modifiersAST =
aAST.findFirstToken(TokenTypes.MODIFIERS);
final DetailAST publicAST =
modifiersAST.findFirstToken(TokenTypes.LITERAL_PUBLIC);
final DetailAST protectedAST =
modifiers... | boolean function(DetailAST aAST) { final DetailAST modifiersAST = aAST.findFirstToken(TokenTypes.MODIFIERS); final DetailAST publicAST = modifiersAST.findFirstToken(TokenTypes.LITERAL_PUBLIC); final DetailAST protectedAST = modifiersAST.findFirstToken(TokenTypes.LITERAL_PROTECTED); return (publicAST != null) (protected... | /**
* Checks if given method declared as public or
* protected and non-static.
* @param aAST method definition node
* @return true if given method is declared as public or protected
*/ | Checks if given method declared as public or protected and non-static | isPublicOrProtected | {
"repo_name": "gkzhong/checkstyle",
"path": "src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/JUnitTestCaseCheck.java",
"license": "lgpl-2.1",
"size": 7836
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 2,255,383 |
public void ping(InetAddress host, long timeout, int retries, int packetsize, int sequenceId, PingResponseCallback cb) throws Exception; | void function(InetAddress host, long timeout, int retries, int packetsize, int sequenceId, PingResponseCallback cb) throws Exception; | /**
* This method is used to ping a remote host to test for ICMP support. Calls
* the callback method upon success or error.
*
* @param host The {@link java.net.InetAddress} address to poll.
* @param timeout The time to wait between each retry.
* @param retries The number of times to retr... | This method is used to ping a remote host to test for ICMP support. Calls the callback method upon success or error | ping | {
"repo_name": "bugcy013/opennms-tmp-tools",
"path": "opennms-icmp/opennms-icmp-api/src/main/java/org/opennms/netmgt/icmp/Pinger.java",
"license": "gpl-2.0",
"size": 6042
} | [
"java.net.InetAddress"
] | import java.net.InetAddress; | import java.net.*; | [
"java.net"
] | java.net; | 2,394,301 |
@Override
protected Size2D arrangeFN(Graphics2D g2, double w) {
g2.setFont(getFont());
FontMetrics fm = g2.getFontMetrics(getFont());
Rectangle2D bounds = TextUtilities.getTextBounds(getText(), g2, fm);
if (bounds.getWidth() <= w) {
return new Size2D(w, bounds.getHeig... | Size2D function(Graphics2D g2, double w) { g2.setFont(getFont()); FontMetrics fm = g2.getFontMetrics(getFont()); Rectangle2D bounds = TextUtilities.getTextBounds(getText(), g2, fm); if (bounds.getWidth() <= w) { return new Size2D(w, bounds.getHeight()); } else { return new Size2D(0.0, 0.0); } } | /**
* Arranges the content for this title assuming a fixed width and no bounds
* on the height, and returns the required size. This will reflect the
* fact that a text title positioned on the left or right of a chart will
* be rotated by 90 degrees.
*
* @param g2 the graphics target.
... | Arranges the content for this title assuming a fixed width and no bounds on the height, and returns the required size. This will reflect the fact that a text title positioned on the left or right of a chart will be rotated by 90 degrees | arrangeFN | {
"repo_name": "hongliangpan/manydesigns.cn",
"path": "trunk/portofino-chart/jfreechat.src/org/jfree/chart/title/ShortTextTitle.java",
"license": "lgpl-3.0",
"size": 8222
} | [
"java.awt.FontMetrics",
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"org.jfree.text.TextUtilities",
"org.jfree.ui.Size2D"
] | import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import org.jfree.text.TextUtilities; import org.jfree.ui.Size2D; | import java.awt.*; import java.awt.geom.*; import org.jfree.text.*; import org.jfree.ui.*; | [
"java.awt",
"org.jfree.text",
"org.jfree.ui"
] | java.awt; org.jfree.text; org.jfree.ui; | 2,551,796 |
public void onClick(ClickEvent event) {
if (isEnabled()) {
if (!m_item.getCheckBox().isChecked()) {
if (m_isSingleSelection) {
deselectAll(m_item.getId());
m_singleResult = m_item.getId();
... | void function(ClickEvent event) { if (isEnabled()) { if (!m_item.getCheckBox().isChecked()) { if (m_isSingleSelection) { deselectAll(m_item.getId()); m_singleResult = m_item.getId(); } else { Iterator<Widget> it = m_scrollList.iterator(); while (it.hasNext()) { selectAllParents((CmsTreeItem)it.next(), m_item.getId()); ... | /**
* Is triggered if the DataValue widget is clicked.<p>
* If its check box was selected the click will deselect this box otherwise it will select it.
*
* @param event The event that is triggered
* */ | Is triggered if the DataValue widget is clicked. If its check box was selected the click will deselect this box otherwise it will select it | onClick | {
"repo_name": "victos/opencms-core",
"path": "src-gwt/org/opencms/gwt/client/ui/input/category/CmsCategoryTree.java",
"license": "lgpl-2.1",
"size": 39765
} | [
"com.google.gwt.event.dom.client.ClickEvent",
"com.google.gwt.user.client.ui.Widget",
"java.util.Iterator",
"org.opencms.gwt.client.ui.tree.CmsTreeItem"
] | import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.user.client.ui.Widget; import java.util.Iterator; import org.opencms.gwt.client.ui.tree.CmsTreeItem; | import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.ui.*; import java.util.*; import org.opencms.gwt.client.ui.tree.*; | [
"com.google.gwt",
"java.util",
"org.opencms.gwt"
] | com.google.gwt; java.util; org.opencms.gwt; | 242,122 |
public FeedMetaDataHolder getHolder()
{
return holder;
}
| FeedMetaDataHolder function() { return holder; } | /**
* Returns holder to fill with information.
*
* @return holder to fill.
*/ | Returns holder to fill with information | getHolder | {
"repo_name": "pitosalas/blogbridge",
"path": "src/com/salas/bb/discovery/MDDiscoveryRequest.java",
"license": "gpl-2.0",
"size": 4426
} | [
"com.salas.bb.domain.FeedMetaDataHolder"
] | import com.salas.bb.domain.FeedMetaDataHolder; | import com.salas.bb.domain.*; | [
"com.salas.bb"
] | com.salas.bb; | 1,157,269 |
public static Properties load(String name) throws IOException
{
return load(ClassUtils.getDefaultClassLoader().getResourceAsStream(Objects.requireNonNull(name)));
} | static Properties function(String name) throws IOException { return load(ClassUtils.getDefaultClassLoader().getResourceAsStream(Objects.requireNonNull(name))); } | /**
* Returns a {@link Properties} loaded by a given properties file.
*
* @param name
* The path of the {@link Properties} file to be loaded. Might not be <code>null</code>.
* @return The {@link Properties} load of the given file.
* @throws IOException
* If the... | Returns a <code>Properties</code> loaded by a given properties file | load | {
"repo_name": "alessandroleite/greenapi",
"path": "core/src/main/java/greenapi/core/common/base/PropertiesUtils.java",
"license": "mit",
"size": 6269
} | [
"java.io.IOException",
"java.util.Objects",
"java.util.Properties"
] | import java.io.IOException; import java.util.Objects; import java.util.Properties; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 675,029 |
public TProcessor wrapNonAssumingProcessor(TProcessor processor) {
return new TUGIAssumingProcessor(processor, secretManager, false);
}
final static ThreadLocal<InetAddress> remoteAddress =
new ThreadLocal<InetAddress>() { | TProcessor function(TProcessor processor) { return new TUGIAssumingProcessor(processor, secretManager, false); } final static ThreadLocal<InetAddress> remoteAddress = new ThreadLocal<InetAddress>() { | /**
* Wrap a TProcessor to capture the client information like connecting userid, ip etc
*/ | Wrap a TProcessor to capture the client information like connecting userid, ip etc | wrapNonAssumingProcessor | {
"repo_name": "b-slim/hive",
"path": "standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/security/HadoopThriftAuthBridge.java",
"license": "apache-2.0",
"size": 26866
} | [
"java.net.InetAddress",
"org.apache.thrift.TProcessor"
] | import java.net.InetAddress; import org.apache.thrift.TProcessor; | import java.net.*; import org.apache.thrift.*; | [
"java.net",
"org.apache.thrift"
] | java.net; org.apache.thrift; | 2,033,023 |
public List<FrameworkField> getAnnotatedFields(
Class<? extends Annotation> annotationClass) {
return Collections.unmodifiableList(getAnnotatedMembers(fieldsForAnnotations, annotationClass, false));
} | List<FrameworkField> function( Class<? extends Annotation> annotationClass) { return Collections.unmodifiableList(getAnnotatedMembers(fieldsForAnnotations, annotationClass, false)); } | /**
* Returns, efficiently, all the non-overridden fields in this class and its
* superclasses that are annotated with {@code annotationClass}.
*/ | Returns, efficiently, all the non-overridden fields in this class and its superclasses that are annotated with annotationClass | getAnnotatedFields | {
"repo_name": "mekwin87/junit4",
"path": "src/main/java/org/junit/runners/model/TestClass.java",
"license": "epl-1.0",
"size": 11602
} | [
"java.lang.annotation.Annotation",
"java.util.Collections",
"java.util.List"
] | import java.lang.annotation.Annotation; import java.util.Collections; import java.util.List; | import java.lang.annotation.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 818,643 |
ChronoLocalDate getMinimumLocalDate(); | ChronoLocalDate getMinimumLocalDate(); | /**
* Get the minimum value for the column.
* @return minimum value as a LocalDate
*/ | Get the minimum value for the column | getMinimumLocalDate | {
"repo_name": "omalley/orc",
"path": "java/core/src/java/org/apache/orc/DateColumnStatistics.java",
"license": "apache-2.0",
"size": 1884
} | [
"java.time.chrono.ChronoLocalDate"
] | import java.time.chrono.ChronoLocalDate; | import java.time.chrono.*; | [
"java.time"
] | java.time; | 1,847,579 |
public static TestResult generateTAPTestResult(ITestResult testResult,
Integer number, boolean yaml) {
final TestResult tapTestResult = new TestResult();
String testResultDescription = generateTAPTestResultDescription(testResult);
tapT... | static TestResult function(ITestResult testResult, Integer number, boolean yaml) { final TestResult tapTestResult = new TestResult(); String testResultDescription = generateTAPTestResultDescription(testResult); tapTestResult.setDescription(testResultDescription); TapTestNGUtil.setTapTestResultStatus(tapTestResult, test... | /**
* Generates a TAP TestResult from a given TestNG TestResult.
*
* @param testResult TestNG Test Result
* @param number TAP Test Number
* @param yaml whether YAML is enabled or not
* @return TAP TestResult
*/ | Generates a TAP TestResult from a given TestNG TestResult | generateTAPTestResult | {
"repo_name": "s2oBCN/tap4j",
"path": "tap4j-ext/src/main/java/org/tap4j/ext/testng/util/TapTestNGUtil.java",
"license": "mit",
"size": 10461
} | [
"org.tap4j.model.TestResult",
"org.testng.ITestResult"
] | import org.tap4j.model.TestResult; import org.testng.ITestResult; | import org.tap4j.model.*; import org.testng.*; | [
"org.tap4j.model",
"org.testng"
] | org.tap4j.model; org.testng; | 1,334,316 |
public static boolean contentEquals(Reader input1, Reader input2)
throws IOException {
if (!(input1 instanceof BufferedReader)) {
input1 = new BufferedReader(input1);
}
if (!(input2 instanceof BufferedReader)) {
input2 = new BufferedReader(input2);
... | static boolean function(Reader input1, Reader input2) throws IOException { if (!(input1 instanceof BufferedReader)) { input1 = new BufferedReader(input1); } if (!(input2 instanceof BufferedReader)) { input2 = new BufferedReader(input2); } int ch = input1.read(); while (-1 != ch) { int ch2 = input2.read(); if (ch != ch2... | /**
* Compare the contents of two Readers to determine if they are equal or
* not.
* <p>
* This method buffers the input internally using
* <code>BufferedReader</code> if they are not already buffered.
*
* @param input1 the first reader
* @param input2 the second reader... | Compare the contents of two Readers to determine if they are equal or not. This method buffers the input internally using <code>BufferedReader</code> if they are not already buffered | contentEquals | {
"repo_name": "rytina/dukecon_appsgenerator",
"path": "org.apache.commons.io/source-bundle/org/apache/commons/io/IOUtils.java",
"license": "epl-1.0",
"size": 62217
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.Reader"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 531,411 |
private void saveModels(Workbook wb, I_State state) {
Sheet sheet = wb.getSheetAt(MODEL_SHEET);
List<Integer> modelsToDelete = new ArrayList<Integer>();
for (Row row : sheet) {
if (row.getRowNum() == 0 || isRowEmpty(row))
continue;
if (row.getCell(MODEL_STATE_ID).getNumericCellValue() == state.... | void function(Workbook wb, I_State state) { Sheet sheet = wb.getSheetAt(MODEL_SHEET); List<Integer> modelsToDelete = new ArrayList<Integer>(); for (Row row : sheet) { if (row.getRowNum() == 0 isRowEmpty(row)) continue; if (row.getCell(MODEL_STATE_ID).getNumericCellValue() == state.getTid()) { boolean isModelFound = fal... | /**
* Saves the associated demand models contained within a state. Removed
* models will be deleted from the data source, changed models will be
* updated, and added models will assigned a new TID and be inserted.
*
* @param wb the workbook
* @param state the state
*/ | Saves the associated demand models contained within a state. Removed models will be deleted from the data source, changed models will be updated, and added models will assigned a new TID and be inserted | saveModels | {
"repo_name": "ptgrogan/spacenet",
"path": "src/main/java/edu/mit/spacenet/data/Spreadsheet_2_5.java",
"license": "apache-2.0",
"size": 99299
} | [
"edu.mit.spacenet.domain.element.State",
"edu.mit.spacenet.domain.model.DemandModelType",
"edu.mit.spacenet.domain.model.SparingByMassDemandModel",
"java.util.ArrayList",
"java.util.List",
"org.apache.poi.ss.usermodel.Row",
"org.apache.poi.ss.usermodel.Sheet",
"org.apache.poi.ss.usermodel.Workbook"
] | import edu.mit.spacenet.domain.element.State; import edu.mit.spacenet.domain.model.DemandModelType; import edu.mit.spacenet.domain.model.SparingByMassDemandModel; import java.util.ArrayList; import java.util.List; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss... | import edu.mit.spacenet.domain.element.*; import edu.mit.spacenet.domain.model.*; import java.util.*; import org.apache.poi.ss.usermodel.*; | [
"edu.mit.spacenet",
"java.util",
"org.apache.poi"
] | edu.mit.spacenet; java.util; org.apache.poi; | 461,933 |
public void setMonth(int month) {
if(month<DatatypeConstants.JANUARY || DatatypeConstants.DECEMBER<month)
if(month!=DatatypeConstants.FIELD_UNDEFINED)
invalidFieldValue(MONTH, month);
this.month = month;
} | void function(int month) { if(month<DatatypeConstants.JANUARY DatatypeConstants.DECEMBER<month) if(month!=DatatypeConstants.FIELD_UNDEFINED) invalidFieldValue(MONTH, month); this.month = month; } | /**
* <p>Set month.</p>
*
* <p>Unset this field by invoking the setter with a parameter value of {@link DatatypeConstants#FIELD_UNDEFINED}.</p>
*
* @param month value constraints summarized in <a href="#datetimefield-month">month field of date/time field mapping table</a>.
*
* @throws... | Set month. Unset this field by invoking the setter with a parameter value of <code>DatatypeConstants#FIELD_UNDEFINED</code> | setMonth | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java",
"license": "apache-2.0",
"size": 115945
} | [
"javax.xml.datatype.DatatypeConstants"
] | import javax.xml.datatype.DatatypeConstants; | import javax.xml.datatype.*; | [
"javax.xml"
] | javax.xml; | 548,704 |
public RatioValue getAsRatio(String[] settings, String defaultValue) throws SettingsException {
return RatioValue.parseRatioValue(get(settings, defaultValue));
} | RatioValue function(String[] settings, String defaultValue) throws SettingsException { return RatioValue.parseRatioValue(get(settings, defaultValue)); } | /**
* Returns the setting value (as a RatioValue) associated with the setting key. Provided values can
* either be a percentage value (eg. 23%), or expressed as a floating point number (eg. 0.23). If
* it does not exist, parses the default value provided.
*/ | Returns the setting value (as a RatioValue) associated with the setting key. Provided values can either be a percentage value (eg. 23%), or expressed as a floating point number (eg. 0.23). If it does not exist, parses the default value provided | getAsRatio | {
"repo_name": "mapr/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/common/settings/Settings.java",
"license": "apache-2.0",
"size": 49124
} | [
"org.elasticsearch.common.unit.RatioValue"
] | import org.elasticsearch.common.unit.RatioValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 2,888,316 |
public void runEndOfStreamTest() throws Exception {
final int elementCount = 300;
final String topic = writeSequence("testEndOfStream", elementCount, 1, 1);
// read using custom schema
final StreamExecutionEnvironment env1 = StreamExecutionEnvironment.getExecutionEnvironment();
env1.setParallelism(1);
... | void function() throws Exception { final int elementCount = 300; final String topic = writeSequence(STR, elementCount, 1, 1); final StreamExecutionEnvironment env1 = StreamExecutionEnvironment.getExecutionEnvironment(); env1.setParallelism(1); env1.getConfig().setRestartStrategy(RestartStrategies.noRestart()); env1.get... | /**
* Test that ensures that DeserializationSchema.isEndOfStream() is properly evaluated.
*
* @throws Exception
*/ | Test that ensures that DeserializationSchema.isEndOfStream() is properly evaluated | runEndOfStreamTest | {
"repo_name": "hongyuhong/flink",
"path": "flink-connectors/flink-connector-kafka-base/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaConsumerTestBase.java",
"license": "apache-2.0",
"size": 80465
} | [
"java.util.Properties",
"org.apache.flink.api.common.restartstrategy.RestartStrategies",
"org.apache.flink.streaming.api.environment.StreamExecutionEnvironment"
] | import java.util.Properties; import org.apache.flink.api.common.restartstrategy.RestartStrategies; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; | import java.util.*; import org.apache.flink.api.common.restartstrategy.*; import org.apache.flink.streaming.api.environment.*; | [
"java.util",
"org.apache.flink"
] | java.util; org.apache.flink; | 759,512 |
public Model getModel2() {
return models[1];
} | Model function() { return models[1]; } | /**
* Gets the model2.
*
* @return the model2
*/ | Gets the model2 | getModel2 | {
"repo_name": "cortical-io/java-client-sdk",
"path": "retina-service-java-api-client/src/main/java/io/cortical/services/Compare.java",
"license": "bsd-2-clause",
"size": 4859
} | [
"io.cortical.rest.model.Model"
] | import io.cortical.rest.model.Model; | import io.cortical.rest.model.*; | [
"io.cortical.rest"
] | io.cortical.rest; | 1,727,847 |
public void setIndividualProviders(
Set<IndividualProvider> invividualProviders) {
this.individualProviders = invividualProviders;
} | void function( Set<IndividualProvider> invividualProviders) { this.individualProviders = invividualProviders; } | /**
* Sets the individual providers.
*
* @param invividualProviders the new individual providers
*/ | Sets the individual providers | setIndividualProviders | {
"repo_name": "tlin-fei/ds4p",
"path": "DS4P/consent2share/core/src/main/java/gov/samhsa/consent2share/service/dto/PatientProfileDto.java",
"license": "bsd-3-clause",
"size": 13597
} | [
"gov.samhsa.consent2share.domain.provider.IndividualProvider",
"java.util.Set"
] | import gov.samhsa.consent2share.domain.provider.IndividualProvider; import java.util.Set; | import gov.samhsa.consent2share.domain.provider.*; import java.util.*; | [
"gov.samhsa.consent2share",
"java.util"
] | gov.samhsa.consent2share; java.util; | 1,454,952 |
public Collection<OpenstackPort> getPorts() {
Invocation.Builder builder = getClientBuilder(neutronUrl, URI_PORTS);
if (builder == null) {
log.warn("Failed to get ports");
return Collections.EMPTY_LIST;
}
String response = builder.accept(MediaType.APPLICATION... | Collection<OpenstackPort> function() { Invocation.Builder builder = getClientBuilder(neutronUrl, URI_PORTS); if (builder == null) { log.warn(STR); return Collections.EMPTY_LIST; } String response = builder.accept(MediaType.APPLICATION_JSON_TYPE). header(HEADER_AUTH_TOKEN, getToken()).get(String.class); ObjectMapper map... | /**
* Returns port information stored in Neutron.
*
* @return List of OpenstackPort
*/ | Returns port information stored in Neutron | getPorts | {
"repo_name": "wuwenbin2/onos_bgp_evpn",
"path": "apps/openstackinterface/app/src/main/java/org/onosproject/openstackinterface/impl/OpenstackInterfaceManager.java",
"license": "apache-2.0",
"size": 21924
} | [
"com.fasterxml.jackson.databind.ObjectMapper",
"com.fasterxml.jackson.databind.node.ArrayNode",
"com.fasterxml.jackson.databind.node.ObjectNode",
"com.google.common.collect.Lists",
"java.io.IOException",
"java.util.Collection",
"java.util.Collections",
"java.util.List",
"javax.ws.rs.client.Invocatio... | import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.collect.Lists; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.List; import ja... | import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.node.*; import com.google.common.collect.*; import java.io.*; import java.util.*; import javax.ws.rs.client.*; import javax.ws.rs.core.*; import org.onosproject.openstackinterface.*; import org.onosproject.openstackinterface.web.*; | [
"com.fasterxml.jackson",
"com.google.common",
"java.io",
"java.util",
"javax.ws",
"org.onosproject.openstackinterface"
] | com.fasterxml.jackson; com.google.common; java.io; java.util; javax.ws; org.onosproject.openstackinterface; | 2,753,893 |
@Test
public void testSingleHostByIdFetch() {
final ProviderId pid = new ProviderId("of", "foo");
final MacAddress mac1 = MacAddress.valueOf("00:00:11:00:00:01");
final Set<IpAddress> ips1 = ImmutableSet.of(IpAddress.valueOf("1111:1111:1111:1::"));
final Host host1 =
... | void function() { final ProviderId pid = new ProviderId("of", "foo"); final MacAddress mac1 = MacAddress.valueOf(STR); final Set<IpAddress> ips1 = ImmutableSet.of(IpAddress.valueOf(STR)); final Host host1 = new DefaultHost(pid, HostId.hostId(mac1), valueOf(1), vlanId((short) 1), new HostLocation(DeviceId.deviceId("1"),... | /**
* Tests fetch of one host by Id.
*/ | Tests fetch of one host by Id | testSingleHostByIdFetch | {
"repo_name": "ravikumaran2015/ravikumaran201504",
"path": "web/api/src/test/java/org/onosproject/rest/HostResourceTest.java",
"license": "apache-2.0",
"size": 12752
} | [
"com.eclipsesource.json.JsonObject",
"com.google.common.collect.ImmutableSet",
"com.sun.jersey.api.client.WebResource",
"java.util.Set",
"org.easymock.EasyMock",
"org.junit.Assert",
"org.onlab.packet.IpAddress",
"org.onlab.packet.MacAddress",
"org.onlab.packet.VlanId",
"org.onosproject.net.Default... | import com.eclipsesource.json.JsonObject; import com.google.common.collect.ImmutableSet; import com.sun.jersey.api.client.WebResource; import java.util.Set; import org.easymock.EasyMock; import org.junit.Assert; import org.onlab.packet.IpAddress; import org.onlab.packet.MacAddress; import org.onlab.packet.VlanId; impor... | import com.eclipsesource.json.*; import com.google.common.collect.*; import com.sun.jersey.api.client.*; import java.util.*; import org.easymock.*; import org.junit.*; import org.onlab.packet.*; import org.onosproject.net.*; import org.onosproject.net.provider.*; | [
"com.eclipsesource.json",
"com.google.common",
"com.sun.jersey",
"java.util",
"org.easymock",
"org.junit",
"org.onlab.packet",
"org.onosproject.net"
] | com.eclipsesource.json; com.google.common; com.sun.jersey; java.util; org.easymock; org.junit; org.onlab.packet; org.onosproject.net; | 1,921,228 |
public void setQueryParams(Map<String, String> queryParams) {
m_queryParams = queryParams;
}
| void function(Map<String, String> queryParams) { m_queryParams = queryParams; } | /**
* Sets the query parameters.
* @param queryParams NV maps with query parameters.
*/ | Sets the query parameters | setQueryParams | {
"repo_name": "vthangathurai/SOA-Runtime",
"path": "soa-server/src/main/java/org/ebayopensource/turmeric/runtime/spf/pipeline/RequestMetaContext.java",
"license": "apache-2.0",
"size": 4324
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 936,123 |
public void setEntryPoint(CFunctionPointer fnptr) {
entryPoint = fnptr;
} | void function(CFunctionPointer fnptr) { entryPoint = fnptr; } | /**
* Sets the native address for the {@code native} method represented by this object.
*/ | Sets the native address for the native method represented by this object | setEntryPoint | {
"repo_name": "smarr/Truffle",
"path": "substratevm/src/com.oracle.svm.jni/src/com/oracle/svm/jni/access/JNINativeLinkage.java",
"license": "gpl-2.0",
"size": 7921
} | [
"org.graalvm.nativeimage.c.function.CFunctionPointer"
] | import org.graalvm.nativeimage.c.function.CFunctionPointer; | import org.graalvm.nativeimage.c.function.*; | [
"org.graalvm.nativeimage"
] | org.graalvm.nativeimage; | 1,093,494 |
public void setRouteTemplates(List<RouteTemplateDefinition> routeTemplates) {
this.routeTemplates = routeTemplates;
} | void function(List<RouteTemplateDefinition> routeTemplates) { this.routeTemplates = routeTemplates; } | /**
* Contains the Camel route templates
*/ | Contains the Camel route templates | setRouteTemplates | {
"repo_name": "adessaigne/camel",
"path": "components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java",
"license": "apache-2.0",
"size": 49808
} | [
"java.util.List",
"org.apache.camel.model.RouteTemplateDefinition"
] | import java.util.List; import org.apache.camel.model.RouteTemplateDefinition; | import java.util.*; import org.apache.camel.model.*; | [
"java.util",
"org.apache.camel"
] | java.util; org.apache.camel; | 2,695,765 |
public static Object readFully(final Object self, final Object file) throws IOException {
File f = null;
if (file instanceof File) {
f = (File)file;
} else if (JSType.isString(file)) {
f = new java.io.File(((CharSequence)file).toString());
}
if (f ==... | static Object function(final Object self, final Object file) throws IOException { File f = null; if (file instanceof File) { f = (File)file; } else if (JSType.isString(file)) { f = new java.io.File(((CharSequence)file).toString()); } if (f == null !f.isFile()) { throw typeError(STR, ScriptRuntime.safeToString(file)); }... | /**
* Nashorn extension: Read the entire contents of a text file and return as String.
*
* @param self self reference
* @param file The input file whose content is read.
*
* @return String content of the input file.
*
* @throws IOException if an exception occurs
*/ | Nashorn extension: Read the entire contents of a text file and return as String | readFully | {
"repo_name": "md-5/jdk10",
"path": "src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptingFunctions.java",
"license": "gpl-2.0",
"size": 9309
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 677,364 |
ReceiveSubscriptionMessageResult receiveSubscriptionMessage(
String topicPath, String subscriptionName) throws ServiceException; | ReceiveSubscriptionMessageResult receiveSubscriptionMessage( String topicPath, String subscriptionName) throws ServiceException; | /**
* Receives a subscription message.
*
* @param topicPath
* A <code>String</code> object that represents the name of the
* topic to receive.
* @param subscriptionName
* A <code>String</code> object that represents the name of the
* s... | Receives a subscription message | receiveSubscriptionMessage | {
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "services/azure-servicebus/src/main/java/com/microsoft/windowsazure/services/servicebus/ServiceBusContract.java",
"license": "apache-2.0",
"size": 23765
} | [
"com.microsoft.windowsazure.exception.ServiceException",
"com.microsoft.windowsazure.services.servicebus.models.ReceiveSubscriptionMessageResult"
] | import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.services.servicebus.models.ReceiveSubscriptionMessageResult; | import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.services.servicebus.models.*; | [
"com.microsoft.windowsazure"
] | com.microsoft.windowsazure; | 330,661 |
protected void addCatalogNamePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CreateProcedureType_catalogName_feature"),
getString("_UI_Prope... | void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getCreateProcedureType_CatalogName(), true, false, false, ItemProper... | /**
* This adds a property descriptor for the Catalog Name feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This adds a property descriptor for the Catalog Name feature. | addCatalogNamePropertyDescriptor | {
"repo_name": "dzonekl/LiquibaseEditor",
"path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/CreateProcedureTypeItemProvider.java",
"license": "mit",
"size": 13404
} | [
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.liquibase.xml.ns.dbchangelog.DbchangelogPackage"
] | import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage; | import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*; | [
"org.eclipse.emf",
"org.liquibase.xml"
] | org.eclipse.emf; org.liquibase.xml; | 2,429,374 |
public Map<Contributor,Integer> getMapOfGlycanSequenceCountByContributor()
{
return Contributor.getMapOfGlycanSequenceCountByContributor();
} | Map<Contributor,Integer> function() { return Contributor.getMapOfGlycanSequenceCountByContributor(); } | /**
* Returns a {@link Map} of {@link Contributor}s to the number of {@link GlycanSequence}s
* they have contributed.
*/ | Returns a <code>Map</code> of <code>Contributor</code>s to the number of <code>GlycanSequence</code>s they have contributed | getMapOfGlycanSequenceCountByContributor | {
"repo_name": "glycoinfo/eurocarbdb",
"path": "application/Eurocarbdb/src/java/org/eurocarbdb/action/core/ShowContributor.java",
"license": "gpl-3.0",
"size": 4401
} | [
"java.util.Map",
"org.eurocarbdb.dataaccess.core.Contributor"
] | import java.util.Map; import org.eurocarbdb.dataaccess.core.Contributor; | import java.util.*; import org.eurocarbdb.dataaccess.core.*; | [
"java.util",
"org.eurocarbdb.dataaccess"
] | java.util; org.eurocarbdb.dataaccess; | 881,243 |
@ServiceMethod(returns = ReturnType.SINGLE)
public ServerDnsAliasInner createOrUpdate(String resourceGroupName, String serverName, String dnsAliasName) {
return createOrUpdateAsync(resourceGroupName, serverName, dnsAliasName).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) ServerDnsAliasInner function(String resourceGroupName, String serverName, String dnsAliasName) { return createOrUpdateAsync(resourceGroupName, serverName, dnsAliasName).block(); } | /**
* Creates a server dns alias.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serverName The name of the server that the alias is pointing to.
* @param dn... | Creates a server dns alias | createOrUpdate | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/implementation/ServerDnsAliasesClientImpl.java",
"license": "mit",
"size": 72569
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.sql.fluent.models.ServerDnsAliasInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.sql.fluent.models.ServerDnsAliasInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.sql.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,912,107 |
Iterator<EncryptionProperty> getEncryptionProperties(); | Iterator<EncryptionProperty> getEncryptionProperties(); | /**
* Returns an <code>Iterator</code> over all the
* <code>EncryptionPropterty</code> elements contained in this
* <code>EncryptionProperties</code>.
*
* @return an <code>Iterator</code> over all the encryption properties.
*/ | Returns an <code>Iterator</code> over all the <code>EncryptionPropterty</code> elements contained in this <code>EncryptionProperties</code> | getEncryptionProperties | {
"repo_name": "apache/santuario-java",
"path": "src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java",
"license": "apache-2.0",
"size": 2552
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,510,076 |
public static List<String> linesOf(File file, Charset charset) {
return Files.linesOf(file, charset);
} | static List<String> function(File file, Charset charset) { return Files.linesOf(file, charset); } | /**
* Loads the text content of a file into a list of strings, each string corresponding to a line.
* The line endings are either \n, \r or \r\n.
*
* @param file the file.
* @param charset the character set to use.
* @return the content of the file.
* @throws NullPointerException if the given chars... | Loads the text content of a file into a list of strings, each string corresponding to a line. The line endings are either \n, \r or \r\n | linesOf | {
"repo_name": "xasx/assertj-core",
"path": "src/main/java/org/assertj/core/api/Assertions.java",
"license": "apache-2.0",
"size": 123012
} | [
"java.io.File",
"java.nio.charset.Charset",
"java.util.List",
"org.assertj.core.util.Files"
] | import java.io.File; import java.nio.charset.Charset; import java.util.List; import org.assertj.core.util.Files; | import java.io.*; import java.nio.charset.*; import java.util.*; import org.assertj.core.util.*; | [
"java.io",
"java.nio",
"java.util",
"org.assertj.core"
] | java.io; java.nio; java.util; org.assertj.core; | 2,081,955 |
private static String addKeyIdCheckToWhereStatement(String whereStatement,
long id) {
String newWhereStatement;
if (TextUtils.isEmpty(whereStatement))
newWhereStatement = "";
else
newWhereStatement = whereState... | static String function(String whereStatement, long id) { String newWhereStatement; if (TextUtils.isEmpty(whereStatement)) newWhereStatement = STR AND STR = 'STR'"; } | /**
* Helper method that appends a given key id to the end of the
* WHERE statement parameter.
*/ | Helper method that appends a given key id to the end of the WHERE statement parameter | addKeyIdCheckToWhereStatement | {
"repo_name": "geniusgeek/mobilecloud-15",
"path": "ex/HobbitContentProvider/app/src/main/java/vandy/mooc/provider/HobbitProviderSQLite.java",
"license": "apache-2.0",
"size": 10464
} | [
"android.text.TextUtils"
] | import android.text.TextUtils; | import android.text.*; | [
"android.text"
] | android.text; | 2,297,140 |
@Internal
public Hyphenation getHresiOld()
{
return field_40_hresiOld;
} | Hyphenation function() { return field_40_hresiOld; } | /**
* Get the hresiOld field for the CHP record.
*/ | Get the hresiOld field for the CHP record | getHresiOld | {
"repo_name": "rmage/gnvc-ims",
"path": "stratchpad/org/apache/poi/hwpf/model/types/CHPAbstractType.java",
"license": "lgpl-3.0",
"size": 92260
} | [
"org.apache.poi.hwpf.model.Hyphenation"
] | import org.apache.poi.hwpf.model.Hyphenation; | import org.apache.poi.hwpf.model.*; | [
"org.apache.poi"
] | org.apache.poi; | 357,837 |
public static void main(String [] args) {
boolean useRepo = false;
File directory = null;
ContentName userNamespace = null;
boolean publishKeysToRepo = true;
Flosser flosser = null;
String [] userNames = null;
CreateUserData td = null;
int arg = 0;
if (args.length < 2) {
usage();
retur... | static void function(String [] args) { boolean useRepo = false; File directory = null; ContentName userNamespace = null; boolean publishKeysToRepo = true; Flosser flosser = null; String [] userNames = null; CreateUserData td = null; int arg = 0; if (args.length < 2) { usage(); return; } if (args[arg].equals("-f")) { ar... | /**
* Command-line driver to generate key data.
*/ | Command-line driver to generate key data | main | {
"repo_name": "MobileCloudNetworking/icnaas",
"path": "mcn-ccn-router/ccnx-0.8.2/javasrc/src/main/org/ccnx/ccn/utils/CreateUserData.java",
"license": "apache-2.0",
"size": 20969
} | [
"java.io.File",
"org.ccnx.ccn.config.UserConfiguration",
"org.ccnx.ccn.protocol.ContentName",
"org.ccnx.ccn.utils.Flosser"
] | import java.io.File; import org.ccnx.ccn.config.UserConfiguration; import org.ccnx.ccn.protocol.ContentName; import org.ccnx.ccn.utils.Flosser; | import java.io.*; import org.ccnx.ccn.config.*; import org.ccnx.ccn.protocol.*; import org.ccnx.ccn.utils.*; | [
"java.io",
"org.ccnx.ccn"
] | java.io; org.ccnx.ccn; | 2,520,355 |
protected Set<IPrimitive> postProcess(Changeset cs, ProgressMonitor monitor) {
if (monitor == null) {
monitor = NullProgressMonitor.INSTANCE;
}
try {
monitor.beginTask("Postprocessing uploaded data ...");
monitor.setTicksCount(primitives.size());
... | Set<IPrimitive> function(Changeset cs, ProgressMonitor monitor) { if (monitor == null) { monitor = NullProgressMonitor.INSTANCE; } try { monitor.beginTask(STR); monitor.setTicksCount(primitives.size()); monitor.setTicks(0); for (IPrimitive p : primitives) { monitor.worked(1); DiffResultEntry entry = diffResults.get(p.g... | /**
* Postprocesses the diff result read and parsed from the server.
*
* Uploaded objects are assigned their new id (if they got assigned a new
* id by the server), their new version (if the version was incremented),
* and the id of the changeset to which they were uploaded.
*
* @para... | Postprocesses the diff result read and parsed from the server. Uploaded objects are assigned their new id (if they got assigned a new id by the server), their new version (if the version was incremented), and the id of the changeset to which they were uploaded | postProcess | {
"repo_name": "CURocketry/Ground_Station_GUI",
"path": "src/org/openstreetmap/josm/io/DiffResultProcessor.java",
"license": "gpl-3.0",
"size": 6950
} | [
"java.util.Set",
"org.openstreetmap.josm.data.osm.Changeset",
"org.openstreetmap.josm.data.osm.IPrimitive",
"org.openstreetmap.josm.gui.progress.NullProgressMonitor",
"org.openstreetmap.josm.gui.progress.ProgressMonitor",
"org.xml.sax.Locator",
"org.xml.sax.helpers.DefaultHandler"
] | import java.util.Set; import org.openstreetmap.josm.data.osm.Changeset; import org.openstreetmap.josm.data.osm.IPrimitive; import org.openstreetmap.josm.gui.progress.NullProgressMonitor; import org.openstreetmap.josm.gui.progress.ProgressMonitor; import org.xml.sax.Locator; import org.xml.sax.helpers.DefaultHandler; | import java.util.*; import org.openstreetmap.josm.data.osm.*; import org.openstreetmap.josm.gui.progress.*; import org.xml.sax.*; import org.xml.sax.helpers.*; | [
"java.util",
"org.openstreetmap.josm",
"org.xml.sax"
] | java.util; org.openstreetmap.josm; org.xml.sax; | 2,782,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.