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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@SuppressWarnings("unchecked")
public List<Integer> getListIdFromJSON(Object data) {
JSONArray jsonArray = JSONArray.fromObject(data);
List<Integer> idClientes = (List<Integer>) JSONArray.toCollection(
jsonArray, Integer.class);
return idClientes;
}
| @SuppressWarnings(STR) List<Integer> function(Object data) { JSONArray jsonArray = JSONArray.fromObject(data); List<Integer> idClientes = (List<Integer>) JSONArray.toCollection( jsonArray, Integer.class); return idClientes; } | /**
* Tranform array of numbers in json data format into list of Integer
*
* @param data
* - json data from request
* @return
*/ | Tranform array of numbers in json data format into list of Integer | getListIdFromJSON | {
"repo_name": "osmaroi/touchBar",
"path": "touchbar/src/es/bootools/touchbar/converter/ClienteConverter.java",
"license": "gpl-3.0",
"size": 2121
} | [
"java.util.List",
"net.sf.json.JSONArray"
] | import java.util.List; import net.sf.json.JSONArray; | import java.util.*; import net.sf.json.*; | [
"java.util",
"net.sf.json"
] | java.util; net.sf.json; | 621,686 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<RulesEngineInner> createOrUpdateAsync(
String resourceGroupName,
String frontDoorName,
String rulesEngineName,
RulesEngineInner rulesEngineParameters) {
return beginCreateOrUpdateAsync(resourceGroupName, frontDoorNa... | @ServiceMethod(returns = ReturnType.SINGLE) Mono<RulesEngineInner> function( String resourceGroupName, String frontDoorName, String rulesEngineName, RulesEngineInner rulesEngineParameters) { return beginCreateOrUpdateAsync(resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) .last() .flatMap(this.c... | /**
* Creates a new Rules Engine Configuration with the specified name within the specified Front Door.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param frontDoorName Name of the Front Door which is globally unique.
* @param rulesEngineName Name of... | Creates a new Rules Engine Configuration with the specified name within the specified Front Door | createOrUpdateAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/implementation/RulesEnginesClientImpl.java",
"license": "mit",
"size": 60120
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.frontdoor.fluent.models.RulesEngineInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.frontdoor.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,145,425 |
public SnuggleSnapshot createSnapshot() {
return new SnuggleSnapshot(engine, packages,
(SessionConfiguration) configuration.clone(),
(DOMOutputOptions) defaultDOMOutputOptions.clone(),
(XMLStringOutputOptions) defaultXMLStringOutputOptions.clone(),
... | SnuggleSnapshot function() { return new SnuggleSnapshot(engine, packages, (SessionConfiguration) configuration.clone(), (DOMOutputOptions) defaultDOMOutputOptions.clone(), (XMLStringOutputOptions) defaultXMLStringOutputOptions.clone(), new ArrayList<InputError>(errors), new HashMap<String, UserDefinedCommand>(userComma... | /**
* Creates a {@link SnuggleSnapshot} Object holding the current state of this session that can
* be later used to recreate a session having exactly the same state.
*/ | Creates a <code>SnuggleSnapshot</code> Object holding the current state of this session that can be later used to recreate a session having exactly the same state | createSnapshot | {
"repo_name": "ktisha/snuggletex",
"path": "snuggletex-core/src/main/java/uk/ac/ed/ph/snuggletex/SnuggleSession.java",
"license": "bsd-3-clause",
"size": 30198
} | [
"java.util.ArrayList",
"java.util.HashMap",
"uk.ac.ed.ph.snuggletex.definitions.UserDefinedCommand",
"uk.ac.ed.ph.snuggletex.definitions.UserDefinedEnvironment",
"uk.ac.ed.ph.snuggletex.tokens.FlowToken"
] | import java.util.ArrayList; import java.util.HashMap; import uk.ac.ed.ph.snuggletex.definitions.UserDefinedCommand; import uk.ac.ed.ph.snuggletex.definitions.UserDefinedEnvironment; import uk.ac.ed.ph.snuggletex.tokens.FlowToken; | import java.util.*; import uk.ac.ed.ph.snuggletex.definitions.*; import uk.ac.ed.ph.snuggletex.tokens.*; | [
"java.util",
"uk.ac.ed"
] | java.util; uk.ac.ed; | 1,068,701 |
@Override
public void exitIndexedExpression(IndexedExpressionContext ctx) {
boolean isRowLower = (ctx.rowLower != null && !ctx.rowLower.isEmpty() && (ctx.rowLower.info.expr != null));
boolean isRowUpper = (ctx.rowUpper != null && !ctx.rowUpper.isEmpty() && (ctx.rowUpper.info.expr != null));
boolean isColLower... | void function(IndexedExpressionContext ctx) { boolean isRowLower = (ctx.rowLower != null && !ctx.rowLower.isEmpty() && (ctx.rowLower.info.expr != null)); boolean isRowUpper = (ctx.rowUpper != null && !ctx.rowUpper.isEmpty() && (ctx.rowUpper.info.expr != null)); boolean isColLower = (ctx.colLower != null && !ctx.colLowe... | /**
* PyDML uses 0-based indexing, so we increment lower indices by 1
* when translating to DML.
*
* @param ctx the parse tree
*/ | PyDML uses 0-based indexing, so we increment lower indices by 1 when translating to DML | exitIndexedExpression | {
"repo_name": "nakul02/systemml",
"path": "src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java",
"license": "apache-2.0",
"size": 68234
} | [
"java.util.ArrayList",
"org.apache.sysml.parser.BuiltinFunctionExpression",
"org.apache.sysml.parser.DataIdentifier",
"org.apache.sysml.parser.Expression",
"org.apache.sysml.parser.IndexedIdentifier",
"org.apache.sysml.parser.IntIdentifier",
"org.apache.sysml.parser.common.ExpressionInfo",
"org.apache... | import java.util.ArrayList; import org.apache.sysml.parser.BuiltinFunctionExpression; import org.apache.sysml.parser.DataIdentifier; import org.apache.sysml.parser.Expression; import org.apache.sysml.parser.IndexedIdentifier; import org.apache.sysml.parser.IntIdentifier; import org.apache.sysml.parser.common.Expression... | import java.util.*; import org.apache.sysml.parser.*; import org.apache.sysml.parser.common.*; import org.apache.sysml.parser.pydml.*; | [
"java.util",
"org.apache.sysml"
] | java.util; org.apache.sysml; | 1,543,836 |
public SortedSet<WVnfInstance> getAllVnfInstances()
{
return n.getResources().stream().filter(r -> !r.getType().contains(WNetConstants.LISTSEPARATORANDINVALIDNAMECHARACTER)).map(r -> new WVnfInstance(r)).collect(Collectors.toCollection(TreeSet::new));
} | SortedSet<WVnfInstance> function() { return n.getResources().stream().filter(r -> !r.getType().contains(WNetConstants.LISTSEPARATORANDINVALIDNAMECHARACTER)).map(r -> new WVnfInstance(r)).collect(Collectors.toCollection(TreeSet::new)); } | /**
* Returns all the VNF instances in this node, of any type
* @return see above
*/ | Returns all the VNF instances in this node, of any type | getAllVnfInstances | {
"repo_name": "girtel/Net2Plan",
"path": "Net2Plan-Core/src/main/java/com/net2plan/niw/WNode.java",
"license": "bsd-2-clause",
"size": 34848
} | [
"java.util.SortedSet",
"java.util.TreeSet",
"java.util.stream.Collectors"
] | import java.util.SortedSet; import java.util.TreeSet; import java.util.stream.Collectors; | import java.util.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 692,462 |
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")... | Observable<ServiceResponse<Void>> function(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (virtualNetworkName == null) { throw new IllegalArgumentException(STR); } if (virtualNetworkPeeringName == nu... | /**
* Deletes the specified virtual network peering.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @param virtualNetworkPeeringName The name of the virtual network peering.
* @throws IllegalArgumentException thro... | Deletes the specified virtual network peering | beginDeleteWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/network/v2019_08_01/implementation/VirtualNetworkPeeringsInner.java",
"license": "mit",
"size": 48368
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,372,181 |
public byte[] prepareEncrypt(Field field, Map<String, String> context) {
context.put(SDC_FIELD_TYPE, field.getType().name());
if (field.getType() == Field.Type.BYTE_ARRAY) {
return field.getValueAsByteArray();
} else {
// Treat all other data as strings
return field.getValueAsString().g... | byte[] function(Field field, Map<String, String> context) { context.put(SDC_FIELD_TYPE, field.getType().name()); if (field.getType() == Field.Type.BYTE_ARRAY) { return field.getValueAsByteArray(); } else { return field.getValueAsString().getBytes(Charsets.UTF_8); } } | /**
* Does data type conversions in preparation for encryption.
*
* @param field {@link Field} to encrypt
* @param context (AAD)
* @return byte array to encrypt
*/ | Does data type conversions in preparation for encryption | prepareEncrypt | {
"repo_name": "rockmkd/datacollector",
"path": "crypto-lib/src/main/java/com/streamsets/pipeline/stage/processor/crypto/FieldEncrypter.java",
"license": "apache-2.0",
"size": 10106
} | [
"com.google.common.base.Charsets",
"com.streamsets.pipeline.api.Field",
"java.util.Map"
] | import com.google.common.base.Charsets; import com.streamsets.pipeline.api.Field; import java.util.Map; | import com.google.common.base.*; import com.streamsets.pipeline.api.*; import java.util.*; | [
"com.google.common",
"com.streamsets.pipeline",
"java.util"
] | com.google.common; com.streamsets.pipeline; java.util; | 1,363,547 |
public static ViewDragHelper create(ViewGroup forParent, float sensitivity, Callback cb) {
final ViewDragHelper helper = create(forParent, cb);
helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity));
return helper;
}
private ViewDragHelper(Context context, ViewGroup ... | static ViewDragHelper function(ViewGroup forParent, float sensitivity, Callback cb) { final ViewDragHelper helper = create(forParent, cb); helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity)); return helper; } private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) { if (forParent == null... | /**
* Factory method to create a new ViewDragHelper.
*
* @param forParent Parent view to monitor
* @param sensitivity Multiplier for how sensitive the helper should be
* about detecting the start of a drag. Larger values are more
* sensitive. 1.0f is... | Factory method to create a new ViewDragHelper | create | {
"repo_name": "ccrama/Slide",
"path": "app/src/main/java/me/ccrama/redditslide/SwipeLayout/ViewDragHelper.java",
"license": "gpl-3.0",
"size": 62368
} | [
"android.content.Context",
"android.view.ViewConfiguration",
"android.view.ViewGroup",
"android.widget.OverScroller"
] | import android.content.Context; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.widget.OverScroller; | import android.content.*; import android.view.*; import android.widget.*; | [
"android.content",
"android.view",
"android.widget"
] | android.content; android.view; android.widget; | 2,054,710 |
public boolean onForwardedEvent(MotionEvent event, int activePointerId) {
boolean handledEvent = true;
boolean clearPressedItem = false;
final int actionMasked = MotionEventCompat.getActionMasked(event);
switch (actionMasked) {
case MotionEvent.AC... | boolean function(MotionEvent event, int activePointerId) { boolean handledEvent = true; boolean clearPressedItem = false; final int actionMasked = MotionEventCompat.getActionMasked(event); switch (actionMasked) { case MotionEvent.ACTION_CANCEL: handledEvent = false; break; case MotionEvent.ACTION_UP: handledEvent = fal... | /**
* Handles forwarded events.
*
* @param activePointerId id of the pointer that activated forwarding
* @return whether the event was handled
*/ | Handles forwarded events | onForwardedEvent | {
"repo_name": "rey5137/material",
"path": "material/src/main/java/com/rey/material/widget/ListPopupWindow.java",
"license": "apache-2.0",
"size": 68088
} | [
"android.view.MotionEvent",
"android.view.View",
"androidx.core.view.MotionEventCompat",
"androidx.core.widget.ListViewAutoScrollHelper"
] | import android.view.MotionEvent; import android.view.View; import androidx.core.view.MotionEventCompat; import androidx.core.widget.ListViewAutoScrollHelper; | import android.view.*; import androidx.core.view.*; import androidx.core.widget.*; | [
"android.view",
"androidx.core"
] | android.view; androidx.core; | 433,256 |
public static ENamedElement getElement(IAdaptable hint) {
Object type = hint.getAdapter(IElementType.class);
if (elements == null) {
elements = new IdentityHashMap<IElementType, ENamedElement>();
elements.put(DataMapperRoot_1000, DataMapperPackage.eINSTANCE.getDataMapperRoot());
elements.put(Input_200... | static ENamedElement function(IAdaptable hint) { Object type = hint.getAdapter(IElementType.class); if (elements == null) { elements = new IdentityHashMap<IElementType, ENamedElement>(); elements.put(DataMapperRoot_1000, DataMapperPackage.eINSTANCE.getDataMapperRoot()); elements.put(Input_2002, DataMapperPackage.eINSTA... | /**
* Returns 'type' of the ecore object associated with the hint.
*
* @generated
*/ | Returns 'type' of the ecore object associated with the hint | getElement | {
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.visualdatamapper.diagram/src/org/wso2/developerstudio/datamapper/diagram/providers/DataMapperElementTypes.java",
"license": "apache-2.0",
"size": 28249
} | [
"java.util.IdentityHashMap",
"org.eclipse.core.runtime.IAdaptable",
"org.eclipse.emf.ecore.ENamedElement",
"org.eclipse.gmf.runtime.emf.type.core.IElementType",
"org.wso2.developerstudio.datamapper.DataMapperPackage"
] | import java.util.IdentityHashMap; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.ENamedElement; import org.eclipse.gmf.runtime.emf.type.core.IElementType; import org.wso2.developerstudio.datamapper.DataMapperPackage; | import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.emf.ecore.*; import org.eclipse.gmf.runtime.emf.type.core.*; import org.wso2.developerstudio.datamapper.*; | [
"java.util",
"org.eclipse.core",
"org.eclipse.emf",
"org.eclipse.gmf",
"org.wso2.developerstudio"
] | java.util; org.eclipse.core; org.eclipse.emf; org.eclipse.gmf; org.wso2.developerstudio; | 2,637,383 |
List<Object> execute(final Pipeline pipeline); | List<Object> execute(final Pipeline pipeline); | /**
* execute using Redis Pipeline.
*
* @param pipeline
* Jedis Pipeline
*/ | execute using Redis Pipeline | execute | {
"repo_name": "cycle-chen/RedisSentinelCache",
"path": "src/main/java/com/redis/sentinel/cache/jedis/JedisPipelinedCallback.java",
"license": "apache-2.0",
"size": 398
} | [
"java.util.List",
"redis.clients.jedis.Pipeline"
] | import java.util.List; import redis.clients.jedis.Pipeline; | import java.util.*; import redis.clients.jedis.*; | [
"java.util",
"redis.clients.jedis"
] | java.util; redis.clients.jedis; | 2,662,514 |
public String doMoveDownAttribute( HttpServletRequest request ) throws AccessDeniedException
{
String strIdAttribute = request.getParameter( PARAMETER_ID_ATTRIBUTE );
if ( StringUtils.isNotBlank( strIdAttribute ) && StringUtils.isNumeric( strIdAttribute ) )
{
if ( !SecurityT... | String function( HttpServletRequest request ) throws AccessDeniedException { String strIdAttribute = request.getParameter( PARAMETER_ID_ATTRIBUTE ); if ( StringUtils.isNotBlank( strIdAttribute ) && StringUtils.isNumeric( strIdAttribute ) ) { if ( !SecurityTokenService.getInstance( ).validate( request, AdminDashboardJsp... | /**
* Move down the position of the attribute field
*
* @param request
* HttpServletRequest
* @return The Jsp URL of the process result
* @throws AccessDeniedException
* if the security token is invalid
*/ | Move down the position of the attribute field | doMoveDownAttribute | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/java/fr/paris/lutece/portal/web/user/attribute/AttributeJspBean.java",
"license": "bsd-3-clause",
"size": 16220
} | [
"fr.paris.lutece.portal.business.user.attribute.IAttribute",
"fr.paris.lutece.portal.service.admin.AccessDeniedException",
"fr.paris.lutece.portal.service.security.SecurityTokenService",
"fr.paris.lutece.portal.web.dashboard.AdminDashboardJspBean",
"java.util.Iterator",
"java.util.List",
"javax.servlet.... | import fr.paris.lutece.portal.business.user.attribute.IAttribute; import fr.paris.lutece.portal.service.admin.AccessDeniedException; import fr.paris.lutece.portal.service.security.SecurityTokenService; import fr.paris.lutece.portal.web.dashboard.AdminDashboardJspBean; import java.util.Iterator; import java.util.List; i... | import fr.paris.lutece.portal.business.user.attribute.*; import fr.paris.lutece.portal.service.admin.*; import fr.paris.lutece.portal.service.security.*; import fr.paris.lutece.portal.web.dashboard.*; import java.util.*; import javax.servlet.http.*; import org.apache.commons.lang3.*; | [
"fr.paris.lutece",
"java.util",
"javax.servlet",
"org.apache.commons"
] | fr.paris.lutece; java.util; javax.servlet; org.apache.commons; | 926,555 |
protected void addPositioningCssTo(final MarkupContainer markupContainer, final List<LinkAndLabel> entityActionLinks) {
CssClassAppender.appendCssClassTo(markupContainer, determinePropParamLayoutCss(getModel()));
CssClassAppender.appendCssClassTo(markupContainer, determineActionLayoutPositioningCss(... | void function(final MarkupContainer markupContainer, final List<LinkAndLabel> entityActionLinks) { CssClassAppender.appendCssClassTo(markupContainer, determinePropParamLayoutCss(getModel())); CssClassAppender.appendCssClassTo(markupContainer, determineActionLayoutPositioningCss(entityActionLinks)); } | /**
* Applies the {@literal @}{@link org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacet} and also CSS based on
* whether any of the associated actions have {@literal @}{@link org.apache.isis.applib.annotation.ActionLayout layout} positioned to
* the {@link org.apache.isis.applib.annot... | Applies the @<code>org.apache.isis.core.metamodel.facets.objectvalue.labelat.LabelAtFacet</code> and also CSS based on whether any of the associated actions have @<code>org.apache.isis.applib.annotation.ActionLayout layout</code> positioned to the <code>org.apache.isis.applib.annotation.ActionLayout.Position#RIGHT righ... | addPositioningCssTo | {
"repo_name": "oscarbou/isis",
"path": "core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java",
"license": "apache-2.0",
"size": 13822
} | [
"java.util.List",
"org.apache.isis.viewer.wicket.model.links.LinkAndLabel",
"org.apache.isis.viewer.wicket.ui.util.CssClassAppender",
"org.apache.wicket.MarkupContainer"
] | import java.util.List; import org.apache.isis.viewer.wicket.model.links.LinkAndLabel; import org.apache.isis.viewer.wicket.ui.util.CssClassAppender; import org.apache.wicket.MarkupContainer; | import java.util.*; import org.apache.isis.viewer.wicket.model.links.*; import org.apache.isis.viewer.wicket.ui.util.*; import org.apache.wicket.*; | [
"java.util",
"org.apache.isis",
"org.apache.wicket"
] | java.util; org.apache.isis; org.apache.wicket; | 1,475,513 |
public Iterator<T> take(int n) {
if (n < 0 || n + first > values.length) {
throw new NoSuchElementException();
}
if (n > 0) {
take(n, first, values.length - 1);
first += n;
return Arrays.asList(values).subList(first - n, first).iterator();
... | Iterator<T> function(int n) { if (n < 0 n + first > values.length) { throw new NoSuchElementException(); } if (n > 0) { take(n, first, values.length - 1); first += n; return Arrays.asList(values).subList(first - n, first).iterator(); } else { return Collections.<T>emptySet().iterator(); } } | /**
* Returns the <code>n</code>-th smallest values remaining in this
* <code>Rank</code>.
*
* @param n Number of values to return
* @return An iterator containing the next <code>n</code> smallest values.
* @throws NoSuchElementException if this <code>Rank</code> has not enough
* ... | Returns the <code>n</code>-th smallest values remaining in this <code>Rank</code> | take | {
"repo_name": "apache/jackrabbit",
"path": "jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/flat/Rank.java",
"license": "apache-2.0",
"size": 10512
} | [
"java.util.Arrays",
"java.util.Collections",
"java.util.Iterator",
"java.util.NoSuchElementException"
] | import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,692,919 |
public Rect getFramingRect() {
MIN_FRAME_WIDTH = DeviceInfo.WIDTH / 3;
MIN_FRAME_HEIGHT = MIN_FRAME_WIDTH;
MAX_FRAME_WIDTH = DeviceInfo.WIDTH/2;
MAX_FRAME_HEIGHT = MAX_FRAME_WIDTH;
Point screenResolution = configManager.getScreenResolution();
if (framingRect == null) {
if (camera == null) {
retu... | Rect function() { MIN_FRAME_WIDTH = DeviceInfo.WIDTH / 3; MIN_FRAME_HEIGHT = MIN_FRAME_WIDTH; MAX_FRAME_WIDTH = DeviceInfo.WIDTH/2; MAX_FRAME_HEIGHT = MAX_FRAME_WIDTH; Point screenResolution = configManager.getScreenResolution(); if (framingRect == null) { if (camera == null) { return null; } int width = screenResoluti... | /**
* Calculates the framing rect which the UI should draw to show the user where to place the
* barcode. This target helps with alignment as well as forces the user to hold the device
* far enough away to ensure the image will be in focus.
*
* @return The rectangle to draw on screen in window coordinates.
... | Calculates the framing rect which the UI should draw to show the user where to place the barcode. This target helps with alignment as well as forces the user to hold the device far enough away to ensure the image will be in focus | getFramingRect | {
"repo_name": "lingshuo/Partner",
"path": "Android/Partner/src/com/hhr360/partner/zxing/CameraManager.java",
"license": "gpl-2.0",
"size": 11037
} | [
"android.graphics.Point",
"android.graphics.Rect",
"android.util.Log",
"com.hhr360.partner.utils.DeviceInfo"
] | import android.graphics.Point; import android.graphics.Rect; import android.util.Log; import com.hhr360.partner.utils.DeviceInfo; | import android.graphics.*; import android.util.*; import com.hhr360.partner.utils.*; | [
"android.graphics",
"android.util",
"com.hhr360.partner"
] | android.graphics; android.util; com.hhr360.partner; | 1,348,628 |
public static void doWithFields(Class<?> clazz, FieldCallback fc, FieldFilter ff) {
// Keep backing up the inheritance hierarchy.
Class<?> targetClass = clazz;
do {
Field[] fields = getDeclaredFields(targetClass);
for (Field field : fields) {
if (ff != null && !ff.matches(field)) {
continue;
... | static void function(Class<?> clazz, FieldCallback fc, FieldFilter ff) { Class<?> targetClass = clazz; do { Field[] fields = getDeclaredFields(targetClass); for (Field field : fields) { if (ff != null && !ff.matches(field)) { continue; } try { fc.doWith(field); } catch (IllegalAccessException ex) { throw new IllegalSta... | /**
* Invoke the given callback on all fields in the target class, going up the
* class hierarchy to get all declared fields.
* @param clazz the target class to analyze
* @param fc the callback to invoke for each field
* @param ff the filter that determines the fields to apply the callback to
*/ | Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields | doWithFields | {
"repo_name": "shivpun/spring-framework",
"path": "spring-core/src/main/java/org/springframework/util/ReflectionUtils.java",
"license": "apache-2.0",
"size": 29419
} | [
"java.lang.reflect.Field"
] | import java.lang.reflect.Field; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,786,613 |
private boolean isUserOwnerOrInitiator(WorkflowTask task, String username)
{
boolean result = false;
String owner = (String)task.getProperties().get(ContentModel.PROP_OWNER);
if (username.equals(owner))
{
// user owns the task
result = true;
... | boolean function(WorkflowTask task, String username) { boolean result = false; String owner = (String)task.getProperties().get(ContentModel.PROP_OWNER); if (username.equals(owner)) { result = true; } else if (username.equals(getWorkflowInitiatorUsername(task))) { result = true; } return result; } | /**
* Determines if the given user is the owner of the given task or
* the initiator of the workflow the task is part of
*
* @param task The task to check
* @param username The username to check
* @return true if the user is the owner or the workflow initiator
*/ | Determines if the given user is the owner of the given task or the initiator of the workflow the task is part of | isUserOwnerOrInitiator | {
"repo_name": "Alfresco/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/workflow/WorkflowServiceImpl.java",
"license": "lgpl-3.0",
"size": 54579
} | [
"org.alfresco.model.ContentModel",
"org.alfresco.service.cmr.workflow.WorkflowTask"
] | import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.workflow.WorkflowTask; | import org.alfresco.model.*; import org.alfresco.service.cmr.workflow.*; | [
"org.alfresco.model",
"org.alfresco.service"
] | org.alfresco.model; org.alfresco.service; | 2,526,630 |
static final byte CHAR_CR = 13;
static final byte CHAR_LF = 10;
public byte[] getPreviewChunkBytes(int chkIdx) {
if (chkIdx >= nChunks())
throw new H2OIllegalArgumentException("Asked for chunk index beyond the number of chunks.");
if (chkIdx == 0)
return chunkForChunkIdx(chkIdx)._mem;
els... | static final byte CHAR_CR = 13; static final byte CHAR_LF = 10; byte[] function(int chkIdx) { if (chkIdx >= nChunks()) throw new H2OIllegalArgumentException(STR); if (chkIdx == 0) return chunkForChunkIdx(chkIdx)._mem; else { byte[] mem = chunkForChunkIdx(chkIdx)._mem; int i = 0, j = mem.length-1; while (i < mem.length ... | /** Get all the bytes of a given chunk.
* Useful for previewing sections of files.
*
* @param chkIdx index of desired chunk
* @return array of initial bytes
*/ | Get all the bytes of a given chunk. Useful for previewing sections of files | getPreviewChunkBytes | {
"repo_name": "YzPaul3/h2o-3",
"path": "h2o-core/src/main/java/water/fvec/ByteVec.java",
"license": "apache-2.0",
"size": 3466
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,737,441 |
public final void save()
{
if (! isValid())
return;
try {
if (! _isModified && ! _manager.getAlwaysSaveSession())
return;
if (! _manager.isPersistenceEnabled())
return;
_isModified = false;
TempOutputStream os = new TempOutputStream();
SessionSerialize... | final void function() { if (! isValid()) return; try { if (! _isModified && ! _manager.getAlwaysSaveSession()) return; if (! _manager.isPersistenceEnabled()) return; _isModified = false; TempOutputStream os = new TempOutputStream(); SessionSerializer out = _manager.createSessionSerializer(os); store(out); out.close(); ... | /**
* Saves changes to the session.
*/ | Saves changes to the session | save | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/server/session/SessionImpl.java",
"license": "gpl-2.0",
"size": 30394
} | [
"com.caucho.vfs.TempOutputStream",
"java.util.logging.Level"
] | import com.caucho.vfs.TempOutputStream; import java.util.logging.Level; | import com.caucho.vfs.*; import java.util.logging.*; | [
"com.caucho.vfs",
"java.util"
] | com.caucho.vfs; java.util; | 59,765 |
@Override
@GwtIncompatible("java.io.Reader")
public Reader getCodeReader() throws IOException {
if (hasSourceInMemory()) {
return super.getCodeReader();
} else {
// If we haven't pulled the code into memory yet, don't.
return Files.newReader(file, StandardCharsets.UTF_8);... | @GwtIncompatible(STR) Reader function() throws IOException { if (hasSourceInMemory()) { return super.getCodeReader(); } else { return Files.newReader(file, StandardCharsets.UTF_8); } } | /**
* Gets a reader for the code in this source file.
*/ | Gets a reader for the code in this source file | getCodeReader | {
"repo_name": "anneupsc/closure-compiler",
"path": "src/com/google/javascript/jscomp/SourceFile.java",
"license": "apache-2.0",
"size": 15992
} | [
"com.google.common.annotations.GwtIncompatible",
"com.google.common.io.Files",
"java.io.IOException",
"java.io.Reader",
"java.nio.charset.StandardCharsets"
] | import com.google.common.annotations.GwtIncompatible; import com.google.common.io.Files; import java.io.IOException; import java.io.Reader; import java.nio.charset.StandardCharsets; | import com.google.common.annotations.*; import com.google.common.io.*; import java.io.*; import java.nio.charset.*; | [
"com.google.common",
"java.io",
"java.nio"
] | com.google.common; java.io; java.nio; | 515,247 |
private static Collection<Object> joinStringValues(Collection<Object> values) {
StringBuilder buffer = new StringBuilder();
List<Object> betterValues = new ArrayList<>();
for (Object value : values) {
if (value instanceof String) {
if (buffer.length() > 0) {
buffer.append(" ");
}
buffer.ap... | static Collection<Object> function(Collection<Object> values) { StringBuilder buffer = new StringBuilder(); List<Object> betterValues = new ArrayList<>(); for (Object value : values) { if (value instanceof String) { if (buffer.length() > 0) { buffer.append(" "); } buffer.append((String) value); } else { betterValues.ad... | /**
* Join the String values while preserving the non-String values. It
* shouldn't affect the score, and it produces better snippets.
*/ | Join the String values while preserving the non-String values. It shouldn't affect the score, and it produces better snippets | joinStringValues | {
"repo_name": "vivo-project/Vitro",
"path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/searchengine/solr/SolrConversionUtils.java",
"license": "bsd-3-clause",
"size": 6869
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 93,256 |
private SpinnerNumberModel buildMultiCastPortSpinnerAdapter()
{
return new NumberSpinnerModelAdapter(buildMultiCastPortHolder(), 0, 32768, 1);
} | SpinnerNumberModel function() { return new NumberSpinnerModelAdapter(buildMultiCastPortHolder(), 0, 32768, 1); } | /**
* Creates the <code>SpinnerModel</code> that keeps the value from the
* spinner in sync with the value in the model and vice versa.
*
* @return A new <code>SpinnerNumberModel</code>
*/ | Creates the <code>SpinnerModel</code> that keeps the value from the spinner in sync with the value in the model and vice versa | buildMultiCastPortSpinnerAdapter | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "utils/eclipselink.utils.workbench/scplugin/source/org/eclipse/persistence/tools/workbench/scplugin/ui/session/clustering/RCMRMIPane.java",
"license": "epl-1.0",
"size": 25116
} | [
"javax.swing.SpinnerNumberModel",
"org.eclipse.persistence.tools.workbench.uitools.app.swing.NumberSpinnerModelAdapter"
] | import javax.swing.SpinnerNumberModel; import org.eclipse.persistence.tools.workbench.uitools.app.swing.NumberSpinnerModelAdapter; | import javax.swing.*; import org.eclipse.persistence.tools.workbench.uitools.app.swing.*; | [
"javax.swing",
"org.eclipse.persistence"
] | javax.swing; org.eclipse.persistence; | 2,784,676 |
public void initialize(Scheduler scheduler)
throws SchedulerConfigException {
this.scheduler = scheduler;
}
/**
* <p>
* Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} | void function(Scheduler scheduler) throws SchedulerConfigException { this.scheduler = scheduler; } /** * <p> * Called by the <class>{@link org.quartz.core.QuartzSchedulerThread} | /**
* <p>
* Initialize the factory, providing a handle to the <code>Scheduler</code>
* that should be made available within the <code>JobRunShell</code> and
* the <code>JobExecutionContext</code> s within it, and a handle to the
* <code>SchedulingContext</code> that the shell will use in its ow... | Initialize the factory, providing a handle to the <code>Scheduler</code> that should be made available within the <code>JobRunShell</code> and the <code>JobExecutionContext</code> s within it, and a handle to the <code>SchedulingContext</code> that the shell will use in its own operations with the <code>JobStore</code>... | initialize | {
"repo_name": "dumptruckman/Pail",
"path": "lib/quartz-2.0.1/quartz/src/main/java/org/quartz/ee/jta/JTAJobRunShellFactory.java",
"license": "gpl-2.0",
"size": 2990
} | [
"org.quartz.Scheduler",
"org.quartz.SchedulerConfigException"
] | import org.quartz.Scheduler; import org.quartz.SchedulerConfigException; | import org.quartz.*; | [
"org.quartz"
] | org.quartz; | 841,761 |
private void initialize() {
Map<String, ReliabilityFunction> reliabilityFunctions = new HashMap<>();
ReliabilityFunction function = new ExponentialReliabilityFunction(0.1);
reliabilityFunctions.put(component1, function);
reliabilityFunctions.put(component2, function);
reliabilityFunctions.put(component3, f... | void function() { Map<String, ReliabilityFunction> reliabilityFunctions = new HashMap<>(); ReliabilityFunction function = new ExponentialReliabilityFunction(0.1); reliabilityFunctions.put(component1, function); reliabilityFunctions.put(component2, function); reliabilityFunctions.put(component3, function); transformer =... | /**
* Initializes the {@link Transformer} of the TMR.
*/ | Initializes the <code>Transformer</code> of the TMR | initialize | {
"repo_name": "felixreimann/jreliability",
"path": "src/main/java/org/jreliability/tutorial/tmr/TMR.java",
"license": "lgpl-3.0",
"size": 4015
} | [
"java.util.HashMap",
"java.util.Map",
"org.jreliability.function.ReliabilityFunction",
"org.jreliability.function.common.ExponentialReliabilityFunction",
"org.jreliability.function.common.SimpleFunctionTransformer"
] | import java.util.HashMap; import java.util.Map; import org.jreliability.function.ReliabilityFunction; import org.jreliability.function.common.ExponentialReliabilityFunction; import org.jreliability.function.common.SimpleFunctionTransformer; | import java.util.*; import org.jreliability.function.*; import org.jreliability.function.common.*; | [
"java.util",
"org.jreliability.function"
] | java.util; org.jreliability.function; | 2,600,694 |
public List<AbstractRing> getInterior() {
if (interior == null) {
interior = new ArrayList<AbstractRing>();
}
return interior;
} | List<AbstractRing> function() { if (interior == null) { interior = new ArrayList<AbstractRing>(); } return interior; } | /**
* Retrieve the inner border
*
* @return the list of border rings
*/ | Retrieve the inner border | getInterior | {
"repo_name": "icyerasor/rome-modules",
"path": "src/main/java/com/rometools/modules/georss/geometries/Polygon.java",
"license": "apache-2.0",
"size": 3118
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 447,100 |
protected Class requiredContextClass() {
return ApplicationContext.class;
} | Class function() { return ApplicationContext.class; } | /**
* Determine the context class that any context passed to
* <code>setApplicationContext</code> must be an instance of.
* Can be overridden in subclasses.
* @see #setApplicationContext
*/ | Determine the context class that any context passed to <code>setApplicationContext</code> must be an instance of. Can be overridden in subclasses | requiredContextClass | {
"repo_name": "mattxia/spring-2.5-analysis",
"path": "src/org/springframework/context/support/ApplicationObjectSupport.java",
"license": "apache-2.0",
"size": 5510
} | [
"org.springframework.context.ApplicationContext"
] | import org.springframework.context.ApplicationContext; | import org.springframework.context.*; | [
"org.springframework.context"
] | org.springframework.context; | 1,349,914 |
public static Set<ServerStatus> getServerStatusSet(final short i) {
final Set<ServerStatus> statusSet = EnumSet.noneOf(ServerStatus.class);
for (final ServerStatus value : ServerStatus.values()) {
if ((i & value.getBitmapFlag()) == value.getBitmapFlag()) {
statusSet.add(v... | static Set<ServerStatus> function(final short i) { final Set<ServerStatus> statusSet = EnumSet.noneOf(ServerStatus.class); for (final ServerStatus value : ServerStatus.values()) { if ((i & value.getBitmapFlag()) == value.getBitmapFlag()) { statusSet.add(value); } } return statusSet; } | /**
* creates an enum set of the bitmasked field i
*
* @param i the bitmasked field
* @return an enum set with the flags defined by i
*/ | creates an enum set of the bitmasked field i | getServerStatusSet | {
"repo_name": "properssl/sslcertx",
"path": "src/main/java/org/properssl/sslcertx/mariadb/jdbc/internal/common/ServerStatus.java",
"license": "mit",
"size": 3644
} | [
"java.util.EnumSet",
"java.util.Set"
] | import java.util.EnumSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 553,447 |
preBuild();
// cache entry point
entryPoint = getEntryPoint();
// Configure the Proxy for URL Connection if necessary
IApiTestClientConfiguration clientConfiguration = getClientConfiguration();
if (clientConfiguration != null && clientConfiguration.isProxyEnabled()) {
System.setProperty("http.proxyHost... | preBuild(); entryPoint = getEntryPoint(); IApiTestClientConfiguration clientConfiguration = getClientConfiguration(); if (clientConfiguration != null && clientConfiguration.isProxyEnabled()) { System.setProperty(STR, clientConfiguration.getProxyHost()); System.setProperty(STR, clientConfiguration.getProxyHost()); Syste... | /**
* Template method responsible for initializing the API test class.
*/ | Template method responsible for initializing the API test class | build | {
"repo_name": "probedock/java-api-test",
"path": "src/main/java/io/probedock/api/test/AbstractApiTest.java",
"license": "mit",
"size": 21297
} | [
"io.probedock.api.test.client.IApiTestClientConfiguration",
"io.probedock.api.test.rules.ApiTestClientRule",
"io.probedock.api.test.rules.ApiTestHeaderConfigurationRule",
"io.probedock.api.test.rules.ApiTestHeadersManagerRule",
"org.junit.rules.RuleChain",
"org.junit.rules.TestRule"
] | import io.probedock.api.test.client.IApiTestClientConfiguration; import io.probedock.api.test.rules.ApiTestClientRule; import io.probedock.api.test.rules.ApiTestHeaderConfigurationRule; import io.probedock.api.test.rules.ApiTestHeadersManagerRule; import org.junit.rules.RuleChain; import org.junit.rules.TestRule; | import io.probedock.api.test.client.*; import io.probedock.api.test.rules.*; import org.junit.rules.*; | [
"io.probedock.api",
"org.junit.rules"
] | io.probedock.api; org.junit.rules; | 775,813 |
public static <T> boolean isSuperset(final Set<T> setA, final Set<T> setB) {
return setA.containsAll(setB);
} | static <T> boolean function(final Set<T> setA, final Set<T> setB) { return setA.containsAll(setB); } | /**
* Is setA a superset of setB.
* @param <T> The generic type of the sets used.
* @param setA the (potential) superset.
* @param setB setB the original set.
* @return true if setA is a superset of setB
*/ | Is setA a superset of setB | isSuperset | {
"repo_name": "EPICScotland/Broadwick",
"path": "src/main/java/broadwick/math/SetOperations.java",
"license": "apache-2.0",
"size": 3641
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,816,288 |
DecoratorContext saveMeasure(Measure measure); | DecoratorContext saveMeasure(Measure measure); | /**
* Add a measure on the current resource. It can not be executed from children contexts.
*
* @return the same context
*/ | Add a measure on the current resource. It can not be executed from children contexts | saveMeasure | {
"repo_name": "jmecosta/sonar",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java",
"license": "lgpl-3.0",
"size": 4342
} | [
"org.sonar.api.measures.Measure"
] | import org.sonar.api.measures.Measure; | import org.sonar.api.measures.*; | [
"org.sonar.api"
] | org.sonar.api; | 1,752,545 |
private static ObjectStreamField[] getSerialFields(Class<?> cl)
throws InvalidClassException
{
ObjectStreamField[] fields;
if (Serializable.class.isAssignableFrom(cl) &&
!Externalizable.class.isAssignableFrom(cl) &&
!Proxy.isProxyClass(cl) &&
!cl.isInt... | static ObjectStreamField[] function(Class<?> cl) throws InvalidClassException { ObjectStreamField[] fields; if (Serializable.class.isAssignableFrom(cl) && !Externalizable.class.isAssignableFrom(cl) && !Proxy.isProxyClass(cl) && !cl.isInterface()) { if ((fields = getDeclaredSerialFields(cl)) == null) { fields = getDefau... | /**
* Returns ObjectStreamField array describing the serializable fields of
* the given class. Serializable fields backed by an actual field of the
* class are represented by ObjectStreamFields with corresponding non-null
* Field objects. Throws InvalidClassException if the (explicitly
* decl... | Returns ObjectStreamField array describing the serializable fields of the given class. Serializable fields backed by an actual field of the class are represented by ObjectStreamFields with corresponding non-null Field objects. Throws InvalidClassException if the (explicitly declared) serializable fields are invalid | getSerialFields | {
"repo_name": "openjdk-mirror/jdk7u-jdk",
"path": "src/share/classes/java/io/ObjectStreamClass.java",
"license": "gpl-2.0",
"size": 87089
} | [
"java.lang.reflect.Proxy",
"java.util.Arrays"
] | import java.lang.reflect.Proxy; import java.util.Arrays; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 2,513,264 |
protected boolean isPersisted(Resource resource) {
boolean result = false;
try {
InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
if (stream != null) {
result = true;
stream.close();
}
}
catch (IOException e) {
// Ignore
}
ret... | boolean function(Resource resource) { boolean result = false; try { InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); if (stream != null) { result = true; stream.close(); } } catch (IOException e) { } return result; } | /**
* This returns whether something has been persisted to the URI of the specified resource.
* The implementation uses the URI converter from the editor's resource set to try to open an input stream.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns whether something has been persisted to the URI of the specified resource. The implementation uses the URI converter from the editor's resource set to try to open an input stream. | isPersisted | {
"repo_name": "KAMP-Research/KAMP",
"path": "bundles/Toometa/de.uka.ipd.sdq.dsexplore.qml.profile.editor/src/de/uka/ipd/sdq/dsexplore/qml/profile/presentation/ProfileEditor.java",
"license": "apache-2.0",
"size": 62840
} | [
"java.io.IOException",
"java.io.InputStream",
"org.eclipse.emf.ecore.resource.Resource"
] | import java.io.IOException; import java.io.InputStream; import org.eclipse.emf.ecore.resource.Resource; | import java.io.*; import org.eclipse.emf.ecore.resource.*; | [
"java.io",
"org.eclipse.emf"
] | java.io; org.eclipse.emf; | 650,132 |
public ByteBuffer encode(boolean whirlpool) throws IOException {
return encode(whirlpool, null, null);
} | ByteBuffer function(boolean whirlpool) throws IOException { return encode(whirlpool, null, null); } | /**
* Encodes this {@link ChecksumTable}.
*
* @param whirlpool
* If whirlpool digests should be encoded.
* @return The encoded {@link ByteBuffer}.
* @throws IOException
* if an I/O error occurs.
*/ | Encodes this <code>ChecksumTable</code> | encode | {
"repo_name": "itsgreco/VirtueRS3",
"path": "src/org/virtue/cache/ChecksumTable.java",
"license": "mit",
"size": 10290
} | [
"java.io.IOException",
"java.nio.ByteBuffer"
] | import java.io.IOException; import java.nio.ByteBuffer; | import java.io.*; import java.nio.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,243,776 |
@Override
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
} | void function(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); } | /**
* Write a object instance to data output stream
*
* @param o
* the instance to be marshaled
* @param dataOut
* the output stream
* @throws IOException
* thrown if an error occurs
*/ | Write a object instance to data output stream | tightMarshal2 | {
"repo_name": "apache/activemq-openwire",
"path": "openwire-legacy/src/main/java/org/apache/activemq/openwire/codec/v9/OpenWireBytesMessageMarshaller.java",
"license": "apache-2.0",
"size": 3569
} | [
"java.io.DataOutput",
"java.io.IOException",
"org.apache.activemq.openwire.codec.BooleanStream",
"org.apache.activemq.openwire.codec.OpenWireFormat"
] | import java.io.DataOutput; import java.io.IOException; import org.apache.activemq.openwire.codec.BooleanStream; import org.apache.activemq.openwire.codec.OpenWireFormat; | import java.io.*; import org.apache.activemq.openwire.codec.*; | [
"java.io",
"org.apache.activemq"
] | java.io; org.apache.activemq; | 1,085,594 |
private void fixMode() throws EV3LibraryException{
String currMode = getMode();
if (!currMode.equals(mode)){
if (autoSwitchMode){
setMode(mode);
} else {
throw new EV3LibraryException("[Auto Switch Mode Off] You cannot use this function of mode " + mode + " with the current mode: " + ... | void function() throws EV3LibraryException{ String currMode = getMode(); if (!currMode.equals(mode)){ if (autoSwitchMode){ setMode(mode); } else { throw new EV3LibraryException(STR + mode + STR + currMode); } } } | /**
* Check mode and switch automatically if <code>autoSwitchMode</code> is <code>false</code><br>
* Otherwise, <code>EV3LibraryException will be thrown<code>.<br>
* <br>
* Formerly called Fix Mode.
* @throws EV3LibraryException
*/ | Check mode and switch automatically if <code>autoSwitchMode</code> is <code>false</code> Otherwise, <code>EV3LibraryException will be thrown<code>. Formerly called Fix Mode | fixMode | {
"repo_name": "mob41/ev3dev-lang-java",
"path": "src/main/java/org/ev3dev/hardware/sensors/charmedlabs/PixyCmucam5Sensor.java",
"license": "mit",
"size": 13445
} | [
"org.ev3dev.exception.EV3LibraryException"
] | import org.ev3dev.exception.EV3LibraryException; | import org.ev3dev.exception.*; | [
"org.ev3dev.exception"
] | org.ev3dev.exception; | 835,337 |
@WebResult(name = "out", targetNamespace = "")
@RequestWrapper(localName = "ListOfPossibleTasks", targetNamespace = "http://ehealth.eu/StorageComponent/", className = "eu.ehealth.db.storagecomponent.ListOfPossibleTasks")
@WebMethod(operationName = "ListOfPossibleTasks", action = "http://ehealth.eu/StorageComponent... | @WebResult(name = "out", targetNamespace = STRListOfPossibleTasksSTRhttp: @WebMethod(operationName = STR, action = STRListOfPossibleTasksResponseSTRhttp: java.util.List<eu.ehealth.db.xsd.SystemParameter> function( @WebParam(name = "userTypeSTR") int userType); | /**
* The ListOfPossibleTasks method receives the user type (userType) and
* returns a list of permitted tasks for this user type.
*/ | The ListOfPossibleTasks method receives the user type (userType) and returns a list of permitted tasks for this user type | listOfPossibleTasks | {
"repo_name": "SeaCloudsEU/SoftCare-Case-Study",
"path": "softcare-ws/src/main/java/eu/ehealth/StorageComponent.java",
"license": "apache-2.0",
"size": 66574
} | [
"java.util.List",
"javax.jws.WebMethod",
"javax.jws.WebParam",
"javax.jws.WebResult"
] | import java.util.List; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; | import java.util.*; import javax.jws.*; | [
"java.util",
"javax.jws"
] | java.util; javax.jws; | 676,393 |
protected void showSimpleMessageDialog(String message, boolean reload) {
AsyncDialogFragment newFragment = SimpleMessageDialog.newInstance(message, reload);
showAsyncDialogFragment(newFragment);
} | void function(String message, boolean reload) { AsyncDialogFragment newFragment = SimpleMessageDialog.newInstance(message, reload); showAsyncDialogFragment(newFragment); } | /**
* Show a simple message dialog, dismissing the message without taking any further action when OK button is pressed.
* If a DialogFragment cannot be shown due to the Activity being stopped then the message is shown in the
* notification bar instead.
*
* @param message
* @param reload fl... | Show a simple message dialog, dismissing the message without taking any further action when OK button is pressed. If a DialogFragment cannot be shown due to the Activity being stopped then the message is shown in the notification bar instead | showSimpleMessageDialog | {
"repo_name": "greyhillman/Anki-Android",
"path": "AnkiDroid/src/main/java/com/ichi2/anki/AnkiActivity.java",
"license": "gpl-3.0",
"size": 15141
} | [
"com.ichi2.anki.dialogs.AsyncDialogFragment",
"com.ichi2.anki.dialogs.SimpleMessageDialog"
] | import com.ichi2.anki.dialogs.AsyncDialogFragment; import com.ichi2.anki.dialogs.SimpleMessageDialog; | import com.ichi2.anki.dialogs.*; | [
"com.ichi2.anki"
] | com.ichi2.anki; | 1,467,766 |
public FieldVector createVector(BufferAllocator allocator) {
FieldVector vector = fieldType.createNewSingleVector(this, allocator, null);
vector.initializeChildrenFromFields(children);
return vector;
} | FieldVector function(BufferAllocator allocator) { FieldVector vector = fieldType.createNewSingleVector(this, allocator, null); vector.initializeChildrenFromFields(children); return vector; } | /**
* Construct a new vector of this type using the given allocator.
*/ | Construct a new vector of this type using the given allocator | createVector | {
"repo_name": "majetideepak/arrow",
"path": "java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Field.java",
"license": "apache-2.0",
"size": 11634
} | [
"org.apache.arrow.memory.BufferAllocator",
"org.apache.arrow.vector.FieldVector"
] | import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.vector.FieldVector; | import org.apache.arrow.memory.*; import org.apache.arrow.vector.*; | [
"org.apache.arrow"
] | org.apache.arrow; | 1,189,545 |
public Double getDouble(String attr) {
return StringUtils.isEmpty(this.getStr(attr))?0:Double.parseDouble(this.get(attr).toString());
} | Double function(String attr) { return StringUtils.isEmpty(this.getStr(attr))?0:Double.parseDouble(this.get(attr).toString()); } | /**
* Get attribute of mysql type: real, double
*/ | Get attribute of mysql type: real, double | getDouble | {
"repo_name": "smart-vole/web-project-parent",
"path": "web-service-contract/src/main/java/com/epai/contract/page/FormMap.java",
"license": "apache-2.0",
"size": 3603
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,895,033 |
EOperation getServiceLocation__IsAppropriate_checkCsp_FWD__CSP(); | EOperation getServiceLocation__IsAppropriate_checkCsp_FWD__CSP(); | /**
* Returns the meta object for the '{@link rgse.ttc17.emoflon.tgg.task2.Rules.ServiceLocation#isAppropriate_checkCsp_FWD(org.moflon.tgg.language.csp.CSP) <em>Is Appropriate check Csp FWD</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Is Appropriate ... | Returns the meta object for the '<code>rgse.ttc17.emoflon.tgg.task2.Rules.ServiceLocation#isAppropriate_checkCsp_FWD(org.moflon.tgg.language.csp.CSP) Is Appropriate check Csp FWD</code>' operation. | getServiceLocation__IsAppropriate_checkCsp_FWD__CSP | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.emoflon.tgg.task2/gen/rgse/ttc17/emoflon/tgg/task2/Rules/RulesPackage.java",
"license": "mit",
"size": 437406
} | [
"org.eclipse.emf.ecore.EOperation"
] | import org.eclipse.emf.ecore.EOperation; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,727,664 |
public static final String addTagValue( String tag, String val, boolean cr, String... attributes ) {
StringBuffer value;
Encoder encoder = ESAPI.encoder();
value = new StringBuffer( "<" );
value.append( tag );
for ( int i = 0; i < attributes.length; i += 2 ) {
value.append( " " ).append( en... | static final String function( String tag, String val, boolean cr, String... attributes ) { StringBuffer value; Encoder encoder = ESAPI.encoder(); value = new StringBuffer( "<" ); value.append( tag ); for ( int i = 0; i < attributes.length; i += 2 ) { value.append( " " ).append( encoder.encodeForXMLAttribute( attributes... | /**
* Build an XML string for a certain tag String value
*
* @param tag
* The XML tag
* @param val
* The String value of the tag
* @param cr
* true if a carriage return is desired after the ending tag.
* @return The XML String for the tag.
*/ | Build an XML string for a certain tag String value | addTagValue | {
"repo_name": "rfellows/pentaho-kettle",
"path": "core/src/org/pentaho/di/core/xml/XMLHandler.java",
"license": "apache-2.0",
"size": 36261
} | [
"org.owasp.esapi.ESAPI",
"org.owasp.esapi.Encoder",
"org.pentaho.di.core.Const"
] | import org.owasp.esapi.ESAPI; import org.owasp.esapi.Encoder; import org.pentaho.di.core.Const; | import org.owasp.esapi.*; import org.pentaho.di.core.*; | [
"org.owasp.esapi",
"org.pentaho.di"
] | org.owasp.esapi; org.pentaho.di; | 1,368,413 |
public boolean voidIt()
{
log.info(toString());
// Before Void
m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID);
if (m_processMsg != null)
return false;
MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID);
for (int i = 0; i < line... | boolean function() { log.info(toString()); m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; MOrderLine[] lines = getLines(true, MOrderLine.COLUMNNAME_M_Product_ID); for (int i = 0; i < lines.length; i++) { MOrderLine line = lines... | /**
* Void Document.
* Set Qtys to 0 - Sales: reverse all documents
* @return true if success
*/ | Void Document. Set Qtys to 0 - Sales: reverse all documents | voidIt | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/MOrder.java",
"license": "gpl-2.0",
"size": 72218
} | [
"java.math.BigDecimal",
"org.compiere.util.Env",
"org.compiere.util.Msg"
] | import java.math.BigDecimal; import org.compiere.util.Env; import org.compiere.util.Msg; | import java.math.*; import org.compiere.util.*; | [
"java.math",
"org.compiere.util"
] | java.math; org.compiere.util; | 475,741 |
protected static Ptg calcImArgument( Ptg[] operands )
{
if( operands.length < 1 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "ImArgument" );
String complexString = StringTool.allTrim( operands[0].getString() );
Complex c;
try
{
c = imParseComplexNumber( complexString ... | static Ptg function( Ptg[] operands ) { if( operands.length < 1 ) { return new PtgErr( PtgErr.ERROR_NULL ); } debugOperands( operands, STR ); String complexString = StringTool.allTrim( operands[0].getString() ); Complex c; try { c = imParseComplexNumber( complexString ); } catch( Exception e ) { return new PtgErr( PtgE... | /**
* IMARGUMENT
* Returns the argument theta, an angle expressed in radians
*/ | IMARGUMENT Returns the argument theta, an angle expressed in radians | calcImArgument | {
"repo_name": "Maxels88/openxls",
"path": "src/main/java/org/openxls/formats/XLS/formulas/EngineeringCalculator.java",
"license": "gpl-3.0",
"size": 74340
} | [
"org.openxls.toolkit.StringTool"
] | import org.openxls.toolkit.StringTool; | import org.openxls.toolkit.*; | [
"org.openxls.toolkit"
] | org.openxls.toolkit; | 1,573,826 |
final PriorityQueue<SweepLineVertex> initialize(Vector2[] points) {
// initialize the DCEL
this.dcel = new DoubleEdgeList(points);
// get the number points
int size = points.length;
// create a priority queue for the vertices
PriorityQueue<SweepLineVertex> queue = new PriorityQueue<SweepLineVertex>... | final PriorityQueue<SweepLineVertex> initialize(Vector2[] points) { this.dcel = new DoubleEdgeList(points); int size = points.length; PriorityQueue<SweepLineVertex> queue = new PriorityQueue<SweepLineVertex>(size); SweepLineVertex rootVertex = null; SweepLineVertex prevVertex = null; SweepLineEdge rootEdge = null; Swee... | /**
* Returns a priority queue of the points in the given array and initializes
* the Binary Tree and DCEL for the SweepLine algorithm.
* @param points the array of polygon points
* @return PriorityQueue<{@link SweepLineVertex}>
*/ | Returns a priority queue of the points in the given array and initializes the Binary Tree and DCEL for the SweepLine algorithm | initialize | {
"repo_name": "dmitrykolesnikovich/dyn4j",
"path": "src/org/dyn4j/geometry/decompose/SweepLineState.java",
"license": "bsd-3-clause",
"size": 7841
} | [
"java.util.PriorityQueue",
"org.dyn4j.geometry.Vector2"
] | import java.util.PriorityQueue; import org.dyn4j.geometry.Vector2; | import java.util.*; import org.dyn4j.geometry.*; | [
"java.util",
"org.dyn4j.geometry"
] | java.util; org.dyn4j.geometry; | 2,058,022 |
void clearJsonpConnectionInfo(String filePrefix, AsyncCallback<Void> callback); | void clearJsonpConnectionInfo(String filePrefix, AsyncCallback<Void> callback); | /**
* See {@link LaunchService#clearJsonpConnectionInfo(String)}.
*/ | See <code>LaunchService#clearJsonpConnectionInfo(String)</code> | clearJsonpConnectionInfo | {
"repo_name": "tvomf/appinventor-mapps",
"path": "appinventor/appengine/src/com/google/appinventor/shared/rpc/launch/LaunchServiceAsync.java",
"license": "apache-2.0",
"size": 1052
} | [
"com.google.gwt.user.client.rpc.AsyncCallback"
] | import com.google.gwt.user.client.rpc.AsyncCallback; | import com.google.gwt.user.client.rpc.*; | [
"com.google.gwt"
] | com.google.gwt; | 2,133,506 |
private void givenTwoTaskWithOneCommonDependantTaskWithTwoDependantTasks(
int daysTask1, int daysTask2, int daysSubtask1, int daysFinalTask1, int daysFinalTask2) {
diagramGraphExample = createNiceMock(ICriticalPathCalculable.class);
ITaskFundamentalProperties task1 = createTask(START, ... | void function( int daysTask1, int daysTask2, int daysSubtask1, int daysFinalTask1, int daysFinalTask2) { diagramGraphExample = createNiceMock(ICriticalPathCalculable.class); ITaskFundamentalProperties task1 = createTask(START, daysTask1); ITaskFundamentalProperties task2 = createTask(START, daysTask2); ITaskFundamental... | /**
* <pre>
* #### T1 #### ----| |---- #### F1 ####
* | |
* |---- #### S1 #### ----|
* | |
* #### T2 #### ----| |---- #### F2 ####
* </pre>
*/ | <code> #### T1 #### ----| |---- #### F1 #### | | |---- #### S1 #### ----| | | #### T2 #### ----| |---- #### F2 #### </code> | givenTwoTaskWithOneCommonDependantTaskWithTwoDependantTasks | {
"repo_name": "PaulLuchyn/libreplan",
"path": "ganttzk/src/test/java/org/zkoss/ganttz/data/criticalpath/CriticalPathCalculatorTest.java",
"license": "agpl-3.0",
"size": 132940
} | [
"java.util.Arrays",
"java.util.Collections",
"java.util.HashSet",
"java.util.List",
"org.easymock.EasyMock",
"org.zkoss.ganttz.data.ITaskFundamentalProperties"
] | import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import org.easymock.EasyMock; import org.zkoss.ganttz.data.ITaskFundamentalProperties; | import java.util.*; import org.easymock.*; import org.zkoss.ganttz.data.*; | [
"java.util",
"org.easymock",
"org.zkoss.ganttz"
] | java.util; org.easymock; org.zkoss.ganttz; | 424,963 |
ContentType getFormat(); | ContentType getFormat(); | /**
* Returns resource representation format.
*
* @return the configured format (or default if not specified).
* @see org.apache.olingo.client.api.Configuration#getDefaultPubFormat()
*/ | Returns resource representation format | getFormat | {
"repo_name": "rareddy/olingo-odata4",
"path": "lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/streamed/ODataStreamedEntityRequest.java",
"license": "apache-2.0",
"size": 1940
} | [
"org.apache.olingo.commons.api.format.ContentType"
] | import org.apache.olingo.commons.api.format.ContentType; | import org.apache.olingo.commons.api.format.*; | [
"org.apache.olingo"
] | org.apache.olingo; | 2,616,206 |
//-----------------------------------------------------------------------
public MetaProperty<TradeInfo> info() {
return info;
} | MetaProperty<TradeInfo> function() { return info; } | /**
* The meta-property for the {@code info} property.
* @return the meta-property, not null
*/ | The meta-property for the info property | info | {
"repo_name": "OpenGamma/Strata",
"path": "modules/product/src/main/java/com/opengamma/strata/product/fxopt/ResolvedFxSingleBarrierOptionTrade.java",
"license": "apache-2.0",
"size": 14549
} | [
"com.opengamma.strata.product.TradeInfo",
"org.joda.beans.MetaProperty"
] | import com.opengamma.strata.product.TradeInfo; import org.joda.beans.MetaProperty; | import com.opengamma.strata.product.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 1,547,523 |
private static void registerKeyForClient(DistributedMember clientId, Object key) {
try {
ClientSession cs = server.getClientSession(clientId);
if (cs.isPrimary()) {
cs.registerInterest(SEPARATOR + REGION_NAME, key, InterestResultPolicy.KEYS_VALUES,
false);
}
} catch (Exce... | static void function(DistributedMember clientId, Object key) { try { ClientSession cs = server.getClientSession(clientId); if (cs.isPrimary()) { cs.registerInterest(SEPARATOR + REGION_NAME, key, InterestResultPolicy.KEYS_VALUES, false); } } catch (Exception ex) { Assert.fail(STR + key + ")", ex); } } | /**
* exercises the ClientSession interface to register interest in a server on behalf of a client
*
* @param clientId the DM of the client
* @param key the key that the client is interested in
*/ | exercises the ClientSession interface to register interest in a server on behalf of a client | registerKeyForClient | {
"repo_name": "jdeppe-pivotal/geode",
"path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/InterestListDUnitTest.java",
"license": "apache-2.0",
"size": 43900
} | [
"org.apache.geode.cache.ClientSession",
"org.apache.geode.cache.InterestResultPolicy",
"org.apache.geode.distributed.DistributedMember",
"org.apache.geode.test.dunit.Assert",
"org.junit.Assert"
] | import org.apache.geode.cache.ClientSession; import org.apache.geode.cache.InterestResultPolicy; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.test.dunit.Assert; import org.junit.Assert; | import org.apache.geode.cache.*; import org.apache.geode.distributed.*; import org.apache.geode.test.dunit.*; import org.junit.*; | [
"org.apache.geode",
"org.junit"
] | org.apache.geode; org.junit; | 2,769,978 |
public void setInvocationListeners(List<InvocationListener> listeners);
| void function(List<InvocationListener> listeners); | /**
* Sets list of InvocationListener instances
*/ | Sets list of InvocationListener instances | setInvocationListeners | {
"repo_name": "jsdjayanga/wso2-axis2",
"path": "modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointInvocationContext.java",
"license": "apache-2.0",
"size": 3225
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,647,217 |
public long minPriority()
throws NoSuchElementException
{
return minNode().priority;
}
/////////////////////////////////////////////////////////
// Inner classes
/////////////////////////////////////////////////////////
class PriorityQueueNode {
public long priority;
public int pos;... | long function() throws NoSuchElementException { return minNode().priority; } class PriorityQueueNode { public long priority; public int pos; public Object value; public PriorityQueueNode(long p, Object v) { priority = p; value = v; } } | /**
* Non-destructively return the priority of the top data element in the
* queu.
*
* @return the priority of the top data element in the queue.
* @throws NoSuchElementException if the queue is empty.
*/ | Non-destructively return the priority of the top data element in the queu | minPriority | {
"repo_name": "kgibm/open-liberty",
"path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/PriorityQueue.java",
"license": "epl-1.0",
"size": 8945
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 2,011,088 |
@Transactional
public void addContractToHRTable(Map<String,String> contract) {
TestContractResource resource = new TestContractResource();
resource.setId(contract.get("extId"));
resource.setState(null);
resource.setWorkposition(contract.get("workPosition"));
resource.setPositions(contract.get("contractTyp... | void function(Map<String,String> contract) { TestContractResource resource = new TestContractResource(); resource.setId(contract.get("extId")); resource.setState(null); resource.setWorkposition(contract.get(STR)); resource.setPositions(contract.get(STR)); resource.setValidFrom(LocalDate.parse(contract.get(STR))); resou... | /**
* Method for insertion of a new record into corresponding database table
*/ | Method for insertion of a new record into corresponding database table | addContractToHRTable | {
"repo_name": "bcvsolutions/CzechIdMng",
"path": "Realization/backend/acc/src/test/java/eu/bcvsolutions/idm/acc/integration/ComplexHrProcessIntegrationTest.java",
"license": "mit",
"size": 78405
} | [
"eu.bcvsolutions.idm.acc.entity.TestContractResource",
"java.time.LocalDate",
"java.time.ZonedDateTime",
"java.util.Map"
] | import eu.bcvsolutions.idm.acc.entity.TestContractResource; import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.Map; | import eu.bcvsolutions.idm.acc.entity.*; import java.time.*; import java.util.*; | [
"eu.bcvsolutions.idm",
"java.time",
"java.util"
] | eu.bcvsolutions.idm; java.time; java.util; | 259,056 |
private void setDoctors(final Doctor doctor1, final Doctor doctor2) {
patient.setDoctors(asList(doctor1, doctor2));
} | void function(final Doctor doctor1, final Doctor doctor2) { patient.setDoctors(asList(doctor1, doctor2)); } | /**
* Hastaya hekim atar
*
* @param doctor1
* 1. hekim
* @param doctor2
* 2. hekim
*/ | Hastaya hekim atar | setDoctors | {
"repo_name": "omerozkan/vipera",
"path": "vipera-business/src/test/java/info/ozkan/vipera/business/notification/NotificationGeneratorTest.java",
"license": "gpl-3.0",
"size": 5633
} | [
"info.ozkan.vipera.entities.Doctor"
] | import info.ozkan.vipera.entities.Doctor; | import info.ozkan.vipera.entities.*; | [
"info.ozkan.vipera"
] | info.ozkan.vipera; | 2,712,607 |
public static MonitoringController createMonitoringControllerWithNamedPipe(final String pipeName,
final Properties additionalProperties) {
final Configuration configuration = ConfigurationFactory.createDefaultConfiguration();
configuration.setProperty(ConfigurationFactory.METADATA, "false");
configuration.s... | static MonitoringController function(final String pipeName, final Properties additionalProperties) { final Configuration configuration = ConfigurationFactory.createDefaultConfiguration(); configuration.setProperty(ConfigurationFactory.METADATA, "false"); configuration.setProperty(ConfigurationFactory.WRITER_CLASSNAME, ... | /**
* Creates a new {@link MonitoringController} instance with the writer being a {@link PipeWriter} with the given
* name. Additional configuration properties can be passed.
*
* @param pipeName
* The name of the pipe to use.
* @param additionalProperties
* additional configuration p... | Creates a new <code>MonitoringController</code> instance with the writer being a <code>PipeWriter</code> with the given name. Additional configuration properties can be passed | createMonitoringControllerWithNamedPipe | {
"repo_name": "leadwire-apm/leadwire-javaagent",
"path": "leadwire-monitoring/test/kieker/test/monitoring/util/NamedPipeFactory.java",
"license": "apache-2.0",
"size": 5119
} | [
"java.util.Map",
"java.util.Properties"
] | import java.util.Map; import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 324,854 |
public interface OnFilter<R> extends Filter<R> {
default Filter<? super R> optimize(final Optimization optimization) {
final List<Expression<? super R, ?>> expressions = getExpressions();
@SuppressWarnings({"unchecked", "rawtypes"})
final Expression<? super R, ?>... | interface OnFilter<R> extends Filter<R> { default Filter<? super R> function(final Optimization optimization) { final List<Expression<? super R, ?>> expressions = getExpressions(); @SuppressWarnings({STR, STR}) final Expression<? super R, ?>[] effective = new Expression[expressions.size()]; boolean unchanged = true; bo... | /**
* Tries to optimize this filter. The default implementation performs the following steps:
*
* <ul>
* <li>If all expressions are literals, evaluate this filter immediately.</li>
* <li>Otherwise if at least one child expression can be optimized,
* {@link... | Tries to optimize this filter. The default implementation performs the following steps: If all expressions are literals, evaluate this filter immediately. Otherwise if at least one child expression can be optimized, #recreate(Expression[]) recreate the filter. Otherwise returns this. | optimize | {
"repo_name": "apache/sis",
"path": "core/sis-feature/src/main/java/org/apache/sis/filter/Optimization.java",
"license": "apache-2.0",
"size": 22499
} | [
"java.util.List",
"org.apache.sis.internal.geoapi.filter.Literal"
] | import java.util.List; import org.apache.sis.internal.geoapi.filter.Literal; | import java.util.*; import org.apache.sis.internal.geoapi.filter.*; | [
"java.util",
"org.apache.sis"
] | java.util; org.apache.sis; | 1,090,182 |
@WebMethod(operationName = "generatetoken")
public String generatetoken(@WebParam(name = "groupid") int groupid) {
Statement stmt = null;
ResultSet rs = null;
Connection conn = null;
StringBuilder returnstr = new StringBuilder();
try {
try {
Cl... | @WebMethod(operationName = STR) String function(@WebParam(name = STR) int groupid) { Statement stmt = null; ResultSet rs = null; Connection conn = null; StringBuilder returnstr = new StringBuilder(); try { try { Class.forName(STR).newInstance(); } catch (Exception ex) { } conn = DriverManager.getConnection(STRSELECT * ... | /**
* Web service operation
*/ | Web service operation | generatetoken | {
"repo_name": "x414e54/grouping-proof",
"path": "NetBeansProjects/ProofServer/src/java/com/group/group/verify/GroupVerify.java",
"license": "bsd-3-clause",
"size": 5590
} | [
"java.sql.Connection",
"java.sql.DriverManager",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement",
"javax.jws.WebMethod",
"javax.jws.WebParam"
] | import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.jws.WebMethod; import javax.jws.WebParam; | import java.sql.*; import javax.jws.*; | [
"java.sql",
"javax.jws"
] | java.sql; javax.jws; | 1,854,287 |
public void setActions(List<Action> actions){
this.actions = actions;
}
| void function(List<Action> actions){ this.actions = actions; } | /**
* Sets the action set the planner should use.
* @param actions the actions the planner should use.
*/ | Sets the action set the planner should use | setActions | {
"repo_name": "jmacglashan/affordances_code",
"path": "src/burlap/behavior/singleagent/planning/OOMDPPlanner.java",
"license": "lgpl-3.0",
"size": 9582
} | [
"burlap.oomdp.singleagent.Action",
"java.util.List"
] | import burlap.oomdp.singleagent.Action; import java.util.List; | import burlap.oomdp.singleagent.*; import java.util.*; | [
"burlap.oomdp.singleagent",
"java.util"
] | burlap.oomdp.singleagent; java.util; | 1,178,969 |
@Test
public void getSubImageXandWidthBiggerImageSizeTest() {
ImageUtils.getSubImage(srcImage, 400, -4 , 200, 100);
Mockito.verify(srcImage).getSubimage(0, 0, 200, 100);
} | void function() { ImageUtils.getSubImage(srcImage, 400, -4 , 200, 100); Mockito.verify(srcImage).getSubimage(0, 0, 200, 100); } | /**
* Tests method getSubImageTest scenarios x coordinate plus wanted width is bigger than image width.
*/ | Tests method getSubImageTest scenarios x coordinate plus wanted width is bigger than image width | getSubImageXandWidthBiggerImageSizeTest | {
"repo_name": "SirmaITT/conservation-space-1.7.0",
"path": "docker/sirma-platform/platform/seip-parent/platform/domain-model/instance-export/src/test/java/com/sirma/sep/export/renders/utils/ImageUtilsTest.java",
"license": "lgpl-3.0",
"size": 2012
} | [
"com.sirma.sep.export.renders.utils.ImageUtils",
"org.mockito.Mockito"
] | import com.sirma.sep.export.renders.utils.ImageUtils; import org.mockito.Mockito; | import com.sirma.sep.export.renders.utils.*; import org.mockito.*; | [
"com.sirma.sep",
"org.mockito"
] | com.sirma.sep; org.mockito; | 836,070 |
private ProjectDependencyAnalyzer analyzer(
final ProjectDependencyAnalysis analysis) throws Exception {
final ProjectDependencyAnalyzer analyzer =
Mockito.mock(ProjectDependencyAnalyzer.class);
Mockito.doReturn(analysis).when(analyzer)
.analyze(Mockito.any(MavenProje... | ProjectDependencyAnalyzer function( final ProjectDependencyAnalysis analysis) throws Exception { final ProjectDependencyAnalyzer analyzer = Mockito.mock(ProjectDependencyAnalyzer.class); Mockito.doReturn(analysis).when(analyzer) .analyze(Mockito.any(MavenProject.class)); return analyzer; } | /**
* Create analyzer object.
* @param analysis The analysis object
* @return The object
* @throws Exception If something wrong happens inside
*/ | Create analyzer object | analyzer | {
"repo_name": "prahladyeri/qulice",
"path": "qulice-maven-plugin/src/test/java/com/qulice/maven/DependenciesValidatorTest.java",
"license": "bsd-3-clause",
"size": 5413
} | [
"org.apache.maven.project.MavenProject",
"org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis",
"org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer",
"org.mockito.Mockito"
] | import org.apache.maven.project.MavenProject; import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis; import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer; import org.mockito.Mockito; | import org.apache.maven.project.*; import org.apache.maven.shared.dependency.analyzer.*; import org.mockito.*; | [
"org.apache.maven",
"org.mockito"
] | org.apache.maven; org.mockito; | 363,584 |
@Nullable
Activity getActivity() {
return director != null ? director.getActivity() : null;
} | Activity getActivity() { return director != null ? director.getActivity() : null; } | /**
* Return the {@link Activity} this {@code Stage} is currently associated with.
*/ | Return the <code>Activity</code> this Stage is currently associated with | getActivity | {
"repo_name": "seven332/Stage",
"path": "stage/src/main/java/com/hippo/stage/Stage.java",
"license": "apache-2.0",
"size": 29724
} | [
"android.app.Activity"
] | import android.app.Activity; | import android.app.*; | [
"android.app"
] | android.app; | 2,223,703 |
public void loadEntries(InputStream stream, OBFTable table, boolean overwrite) throws IOException; | void function(InputStream stream, OBFTable table, boolean overwrite) throws IOException; | /**
* Loads all entries located in a stream into an OBFTable.
*
* @param stream The stream to load from.
* @param table The table to write to.
* @param overwrite If true overwrite existing mappings.
*/ | Loads all entries located in a stream into an OBFTable | loadEntries | {
"repo_name": "warriordog/OBFUtil",
"path": "src/net/acomputerdog/OBFUtil/parse/StreamParser.java",
"license": "bsd-3-clause",
"size": 926
} | [
"java.io.IOException",
"java.io.InputStream",
"net.acomputerdog.OBFUtil"
] | import java.io.IOException; import java.io.InputStream; import net.acomputerdog.OBFUtil; | import java.io.*; import net.acomputerdog.*; | [
"java.io",
"net.acomputerdog"
] | java.io; net.acomputerdog; | 253,512 |
public Set<Plotter> getPlotters() {
return Collections.unmodifiableSet(plotters);
} | Set<Plotter> function() { return Collections.unmodifiableSet(plotters); } | /**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
*
* @return
*/ | Gets an unmodifiable set of the plotter objects in the graph | getPlotters | {
"repo_name": "InsomniaxGaming/TransporterReloaded",
"path": "src/com/frdfsnlght/transporter/Metrics.java",
"license": "gpl-2.0",
"size": 20420
} | [
"java.util.Collections",
"java.util.Set"
] | import java.util.Collections; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 633,184 |
void setAriaValueminProperty(Element element, Number value); | void setAriaValueminProperty(Element element, Number value); | /**
* Sets the
* <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-valuemin">
* aria-valuemin</a> attribute for the {@code element} to the given {@code value}.
*/ | Sets the aria-valuemin attribute for the element to the given value | setAriaValueminProperty | {
"repo_name": "syntelos/gwtcc",
"path": "src/com/google/gwt/aria/client/RangeRole.java",
"license": "apache-2.0",
"size": 4091
} | [
"com.google.gwt.dom.client.Element"
] | import com.google.gwt.dom.client.Element; | import com.google.gwt.dom.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,401,155 |
ExtendedBlock getNextBlockToScan() {
ExtendedBlock block;
try {
block = curBlockIter.nextBlock();
} catch (IOException e) {
// There was an error listing the next block in the volume. This is a
// serious issue.
LOG.warn("{}: nextBlock error on {}", this, curBlockIter);
// O... | ExtendedBlock getNextBlockToScan() { ExtendedBlock block; try { block = curBlockIter.nextBlock(); } catch (IOException e) { LOG.warn(STR, this, curBlockIter); return null; } if (block == null) { LOG.info(STR, this, curBlockIter.getBlockPoolId()); saveBlockIterator(curBlockIter); return null; } else if (conf.skipRecentA... | /**
* Get next block and check if it's needed to scan.
*
* @return the candidate block.
*/ | Get next block and check if it's needed to scan | getNextBlockToScan | {
"repo_name": "nandakumar131/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/VolumeScanner.java",
"license": "apache-2.0",
"size": 27388
} | [
"java.io.File",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.attribute.BasicFileAttributes",
"java.util.concurrent.TimeUnit",
"org.apache.hadoop.hdfs.protocol.BlockLocalPathInfo",
"org.apache.hadoop.hdfs.protocol.ExtendedBlock"
] | import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.attribute.BasicFileAttributes; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdfs.protocol.BlockLocalPathInfo; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; | import java.io.*; import java.nio.file.*; import java.nio.file.attribute.*; import java.util.concurrent.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"java.nio",
"java.util",
"org.apache.hadoop"
] | java.io; java.nio; java.util; org.apache.hadoop; | 581,821 |
public void removeEntry(SnmpOid rowOid)
throws SnmpStatusException {
int pos = findObject(rowOid);
if (pos == -1)
return;
removeEntry(pos,null);
} | void function(SnmpOid rowOid) throws SnmpStatusException { int pos = findObject(rowOid); if (pos == -1) return; removeEntry(pos,null); } | /**
* Remove the specified entry from the table.
* Also triggers the removeEntryCB() callback of the
* {@link com.sun.jmx.snmp.agent.SnmpTableEntryFactory} interface
* if this node is bound to a factory.
*
* <p>
* @param rowOid The <CODE>SnmpOid</CODE> identifying the table
* ... | Remove the specified entry from the table. Also triggers the removeEntryCB() callback of the <code>com.sun.jmx.snmp.agent.SnmpTableEntryFactory</code> interface if this node is bound to a factory. | removeEntry | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpMibTable.java",
"license": "mit",
"size": 99678
} | [
"com.sun.jmx.snmp.SnmpOid",
"com.sun.jmx.snmp.SnmpStatusException"
] | import com.sun.jmx.snmp.SnmpOid; import com.sun.jmx.snmp.SnmpStatusException; | import com.sun.jmx.snmp.*; | [
"com.sun.jmx"
] | com.sun.jmx; | 1,816,995 |
public double getOptionalDoubleAttribute(String attrName, HashMap<String, String> attrMap, double defaultValue)
{
String attrValue = attrMap.get(attrName);
if (attrValue != null)
{
attrMap.remove(attrName);
return Double.parseDouble(attrValue);
}
... | double function(String attrName, HashMap<String, String> attrMap, double defaultValue) { String attrValue = attrMap.get(attrName); if (attrValue != null) { attrMap.remove(attrName); return Double.parseDouble(attrValue); } else { return defaultValue; } } | /**
* Like getOptionalAttribute, but with the result converted to an double.
*/ | Like getOptionalAttribute, but with the result converted to an double | getOptionalDoubleAttribute | {
"repo_name": "jankolkmeier/HmiCore",
"path": "HmiXml/src/hmi/xml/XMLStructureAdapter.java",
"license": "mit",
"size": 97309
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,900,952 |
private static Collection<String> findUnresolvedDependencies(
@NonNull Collection<SyncIssue> syncIssues) {
List<String> unresolvedDependencies = Lists.newArrayList();
for (SyncIssue issue : syncIssues) {
if (issue.getType() == SyncIssue.TYPE_UNRESOLVED_DEPENDENCY) {
... | static Collection<String> function( @NonNull Collection<SyncIssue> syncIssues) { List<String> unresolvedDependencies = Lists.newArrayList(); for (SyncIssue issue : syncIssues) { if (issue.getType() == SyncIssue.TYPE_UNRESOLVED_DEPENDENCY) { unresolvedDependencies.add(issue.getData()); } } return unresolvedDependencies;... | /**
* Return the unresolved dependencies in SyncIssues
*/ | Return the unresolved dependencies in SyncIssues | findUnresolvedDependencies | {
"repo_name": "consulo/consulo-android",
"path": "tools-base/build-system/gradle-core/src/main/groovy/com/android/build/gradle/internal/model/ModelBuilder.java",
"license": "apache-2.0",
"size": 25181
} | [
"com.android.annotations.NonNull",
"com.android.builder.model.SyncIssue",
"com.google.common.collect.Lists",
"java.util.Collection",
"java.util.List"
] | import com.android.annotations.NonNull; import com.android.builder.model.SyncIssue; import com.google.common.collect.Lists; import java.util.Collection; import java.util.List; | import com.android.annotations.*; import com.android.builder.model.*; import com.google.common.collect.*; import java.util.*; | [
"com.android.annotations",
"com.android.builder",
"com.google.common",
"java.util"
] | com.android.annotations; com.android.builder; com.google.common; java.util; | 1,141,964 |
public static void singleClickView(Instrumentation instrumentation, View v) {
int x = v.getWidth() / 2;
int y = v.getHeight() / 2;
singleClickView(instrumentation, v, x, y);
} | static void function(Instrumentation instrumentation, View v) { int x = v.getWidth() / 2; int y = v.getHeight() / 2; singleClickView(instrumentation, v, x, y); } | /**
* Sends (synchronously) a single click to the center of the View.
*
* @param instrumentation Instrumentation object used by the test.
* @param v The view the coordinates are relative to.
*/ | Sends (synchronously) a single click to the center of the View | singleClickView | {
"repo_name": "jaruba/chromium.src",
"path": "content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestTouchUtils.java",
"license": "bsd-3-clause",
"size": 8916
} | [
"android.app.Instrumentation",
"android.view.View"
] | import android.app.Instrumentation; import android.view.View; | import android.app.*; import android.view.*; | [
"android.app",
"android.view"
] | android.app; android.view; | 2,784,900 |
Path pathModel;
InputStream inputStream;
ZipInputStream zipInputStream;
ZipEntry zipEntry;
try {
IntegrationTestSuite.printTestCategoryHeader("GenericRootModuleVersionJobInvokerTool org.azyva.dragom.job.MergeMain MergeMainToolHelp.txt | Basic tests");
IntegrationTestSuite.resetTestWorkspac... | Path pathModel; InputStream inputStream; ZipInputStream zipInputStream; ZipEntry zipEntry; try { IntegrationTestSuite.printTestCategoryHeader(STR); IntegrationTestSuite.resetTestWorkspace(); try { pathModel = IntegrationTestSuite.pathTestWorkspace.resolve(STR); inputStream = IntegrationTestSuite.class.getResourceAsStre... | /*********************************************************************************
* Tests CreateStaticVersionTool.
* <p>
* Basic tests.
*********************************************************************************/ | Tests CreateStaticVersionTool. Basic tests | testMergeMainToolBase | {
"repo_name": "azyva/dragom-cli-tools",
"path": "dragom-cli-tools/src/test/java/org/azyva/dragom/test/integration/IntegrationTestSuiteMergeMainToolBase.java",
"license": "agpl-3.0",
"size": 11075
} | [
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.nio.file.Files",
"java.nio.file.Path",
"java.nio.file.StandardCopyOption",
"java.util.zip.ZipEntry",
"java.util.zip.ZipInputStream"
] | import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; | import java.io.*; import java.nio.file.*; import java.util.zip.*; | [
"java.io",
"java.nio",
"java.util"
] | java.io; java.nio; java.util; | 1,708,622 |
String getSearchUrlForPromotion() {
String searchUrl = getSearchUrl();
URL url;
try {
url = new URL(searchUrl.replaceAll(CTXS_PARAM_PATTERN, CTXR_PARAM));
} catch (MalformedURLException e) {
url = null;
}
return url != null ? url.toString() :... | String getSearchUrlForPromotion() { String searchUrl = getSearchUrl(); URL url; try { url = new URL(searchUrl.replaceAll(CTXS_PARAM_PATTERN, CTXR_PARAM)); } catch (MalformedURLException e) { url = null; } return url != null ? url.toString() : null; } | /**
* Returns the formatted Search URL, replacing the ctxs param with the ctxr param, so that
* the SearchBox will becomes visible, while preserving the Answers Mode.
*
* @return The formatted Search URL.
*/ | Returns the formatted Search URL, replacing the ctxs param with the ctxr param, so that the SearchBox will becomes visible, while preserving the Answers Mode | getSearchUrlForPromotion | {
"repo_name": "hujiajie/chromium-crosswalk",
"path": "chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRequest.java",
"license": "bsd-3-clause",
"size": 8625
} | [
"java.net.MalformedURLException"
] | import java.net.MalformedURLException; | import java.net.*; | [
"java.net"
] | java.net; | 308,433 |
private Document loadVLXTemplate(String templateResource){
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
mBuilder = null;
Document document = null;
//Get the VLX template file resource
URL url = VLXGenerator.class.getResource(templateResource);
try{
factory.setNamespaceAwar... | Document function(String templateResource){ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); mBuilder = null; Document document = null; URL url = VLXGenerator.class.getResource(templateResource); try{ factory.setNamespaceAware(true); mBuilder = factory.newDocumentBuilder(); InputStream stream = ur... | /**
* Loads up the VLX template into a Document object
*
* @return VLX template as a DOM Document
*/ | Loads up the VLX template into a Document object | loadVLXTemplate | {
"repo_name": "jamilshehzad/MeteorBackEnd",
"path": "CIN_IXV/WEB-INF/classes/com/VDK/JavaSample/VLXGenerator.java",
"license": "apache-2.0",
"size": 20411
} | [
"java.io.InputStream",
"javax.xml.parsers.DocumentBuilderFactory",
"org.w3c.dom.Document"
] | import java.io.InputStream; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; | import java.io.*; import javax.xml.parsers.*; import org.w3c.dom.*; | [
"java.io",
"javax.xml",
"org.w3c.dom"
] | java.io; javax.xml; org.w3c.dom; | 1,697,022 |
@ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY )
@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@Basic( optional = true )
@JoinColumn(name = "enrollmentid", nullable = true )
public Enrollment getEnrollmentid() {
return this.en... | @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY ) @org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE}) @Basic( optional = true ) @JoinColumn(name = STR, nullable = true ) Enrollment function() { return this.enrollmentid; } | /**
* Return the value associated with the column: enrollmentid.
* @return A Enrollment object (this.enrollmentid)
*/ | Return the value associated with the column: enrollmentid | getEnrollmentid | {
"repo_name": "servinglynk/hmis-lynk-open-source",
"path": "hmis-model-v2016/src/main/java/com/servinglynk/hmis/warehouse/model/v2016/Incomeandsources.java",
"license": "mpl-2.0",
"size": 41587
} | [
"javax.persistence.Basic",
"javax.persistence.CascadeType",
"javax.persistence.FetchType",
"javax.persistence.JoinColumn",
"javax.persistence.ManyToOne"
] | import javax.persistence.Basic; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; | import javax.persistence.*; | [
"javax.persistence"
] | javax.persistence; | 484,997 |
public HighlightBuilder highlightQuery(QueryBuilder highlightQuery) {
this.highlightQuery = highlightQuery;
return this;
} | HighlightBuilder function(QueryBuilder highlightQuery) { this.highlightQuery = highlightQuery; return this; } | /**
* Sets a query to be used for highlighting all fields instead of the search query.
*/ | Sets a query to be used for highlighting all fields instead of the search query | highlightQuery | {
"repo_name": "0359xiaodong/elasticsearch",
"path": "src/main/java/org/elasticsearch/search/highlight/HighlightBuilder.java",
"license": "apache-2.0",
"size": 22037
} | [
"org.elasticsearch.index.query.QueryBuilder"
] | import org.elasticsearch.index.query.QueryBuilder; | import org.elasticsearch.index.query.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 2,443,215 |
@Override
public void sessionCreated(NextFilter nextFilter, IoSession session)
throws Exception {
for (Map.Entry<String, Object> e : attributes.entrySet()) {
session.setAttribute(e.getKey(), e.getValue());
}
nextFilter.sessionCreated(session);
} | void function(NextFilter nextFilter, IoSession session) throws Exception { for (Map.Entry<String, Object> e : attributes.entrySet()) { session.setAttribute(e.getKey(), e.getValue()); } nextFilter.sessionCreated(session); } | /**
* Puts all pre-configured attributes into the actual session attribute
* map and forward the event to the next filter.
*/ | Puts all pre-configured attributes into the actual session attribute map and forward the event to the next filter | sessionCreated | {
"repo_name": "chao-sun-kaazing/gateway",
"path": "mina.core/core/src/main/java/org/apache/mina/filter/util/SessionAttributeInitializingFilter.java",
"license": "apache-2.0",
"size": 4882
} | [
"java.util.Map",
"org.apache.mina.core.session.IoSession"
] | import java.util.Map; import org.apache.mina.core.session.IoSession; | import java.util.*; import org.apache.mina.core.session.*; | [
"java.util",
"org.apache.mina"
] | java.util; org.apache.mina; | 97,175 |
@Test(groups={"ut"})
public void testScenarioExactText(ITestContext testNGCtx) throws URISyntaxException {
try {
System.setProperty("cucumberTests", "core_3,core_4");
initThreadContext(testNGCtx);
CustomTestNGCucumberRunner runner = new CustomTestNGCucumberRunner(this.getClass());
Object[][] sce... | @Test(groups={"ut"}) void function(ITestContext testNGCtx) throws URISyntaxException { try { System.setProperty(STR, STR); initThreadContext(testNGCtx); CustomTestNGCucumberRunner runner = new CustomTestNGCucumberRunner(this.getClass()); Object[][] scenarios = runner.provideScenarios(); Assert.assertEquals(scenarios.le... | /**
* Check that we can get test from scenario
* @param testNGCtx
*/ | Check that we can get test from scenario | testScenarioExactText | {
"repo_name": "bhecquet/seleniumRobot",
"path": "core/src/test/java/com/seleniumtests/ut/core/runner/TestCucumberRunner.java",
"license": "apache-2.0",
"size": 6092
} | [
"com.seleniumtests.core.runner.CustomTestNGCucumberRunner",
"java.net.URISyntaxException",
"org.testng.Assert",
"org.testng.ITestContext",
"org.testng.annotations.Test"
] | import com.seleniumtests.core.runner.CustomTestNGCucumberRunner; import java.net.URISyntaxException; import org.testng.Assert; import org.testng.ITestContext; import org.testng.annotations.Test; | import com.seleniumtests.core.runner.*; import java.net.*; import org.testng.*; import org.testng.annotations.*; | [
"com.seleniumtests.core",
"java.net",
"org.testng",
"org.testng.annotations"
] | com.seleniumtests.core; java.net; org.testng; org.testng.annotations; | 1,094,478 |
@RequestMapping(value = "/floorplan/mapping/{floorplanId}", method = RequestMethod.POST)
public @ResponseBody
FloorplanMapping setFloorplanMapping(
@PathVariable("floorplanId") String floorplanId,
@RequestParam("floorplan") String floorplanjson,
@RequestParam("mapping") String mappingjson) throws Exceptio... | @RequestMapping(value = STR, method = RequestMethod.POST) FloorplanMapping function( @PathVariable(STR) String floorplanId, @RequestParam(STR) String floorplanjson, @RequestParam(STR) String mappingjson) throws Exception { Floorplan fp = floorplanMarshaller_.fromString(floorplanjson); FloorplanImageMapping mapping = im... | /**
* This endpoint is used to save a floorplan and its associated image and
* mapping of locations to coordinates on the image.
*
* @param floorplanId
* @return
*/ | This endpoint is used to save a floorplan and its associated image and mapping of locations to coordinates on the image | setFloorplanMapping | {
"repo_name": "adozenlines/Backend",
"path": "src/main/java/org/magnum/mcc/controllers/NavController.java",
"license": "apache-2.0",
"size": 20701
} | [
"org.magnum.mcc.building.Floorplan",
"org.magnum.mcc.building.FloorplanImageMapping",
"org.magnum.mcc.building.FloorplanMapping",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"or... | import org.magnum.mcc.building.Floorplan; import org.magnum.mcc.building.FloorplanImageMapping; import org.magnum.mcc.building.FloorplanMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.Requ... | import org.magnum.mcc.building.*; import org.springframework.web.bind.annotation.*; | [
"org.magnum.mcc",
"org.springframework.web"
] | org.magnum.mcc; org.springframework.web; | 2,723,311 |
handler = new Handler();
}
private final int index;
String locationProvider = LocationManager.GPS_PROVIDER;
//String locationProvider = LocationManager.NETWORK_PROVIDER;
private LocationManager locationManager;
private SensorManager sensorManager;
private WindowManager windowManager;
private Se... | handler = new Handler(); } private final int index; String locationProvider = LocationManager.GPS_PROVIDER; private LocationManager locationManager; private SensorManager sensorManager; private WindowManager windowManager; private Sensor accelerometer; private double acceleration; private static boolean queriedLocation... | /**
* Global initialization of the class. Must be called from the main
* event thread, because the Handler object must be bound to that
* thread.
*/ | Global initialization of the class. Must be called from the main event thread, because the Handler object must be bound to that thread | Initialize | {
"repo_name": "DRNadler/DRN_TopHat",
"path": "android/src/InternalGPS.java",
"license": "gpl-2.0",
"size": 9140
} | [
"android.content.Context",
"android.content.Intent",
"android.hardware.Sensor",
"android.hardware.SensorManager",
"android.location.LocationManager",
"android.os.Handler",
"android.provider.Settings",
"android.view.WindowManager"
] | import android.content.Context; import android.content.Intent; import android.hardware.Sensor; import android.hardware.SensorManager; import android.location.LocationManager; import android.os.Handler; import android.provider.Settings; import android.view.WindowManager; | import android.content.*; import android.hardware.*; import android.location.*; import android.os.*; import android.provider.*; import android.view.*; | [
"android.content",
"android.hardware",
"android.location",
"android.os",
"android.provider",
"android.view"
] | android.content; android.hardware; android.location; android.os; android.provider; android.view; | 1,537,793 |
public static void merge(Directory srcIndexDir, Directory srcTaxDir,
OrdinalMap map, IndexWriter destIndexWriter,
DirectoryTaxonomyWriter destTaxWriter) throws IOException {
// merge the taxonomies
destTaxWriter.addTaxonomy(srcTaxDir, map);
PayloadP... | static void function(Directory srcIndexDir, Directory srcTaxDir, OrdinalMap map, IndexWriter destIndexWriter, DirectoryTaxonomyWriter destTaxWriter) throws IOException { destTaxWriter.addTaxonomy(srcTaxDir, map); PayloadProcessorProvider payloadProcessor = new FacetsPayloadProcessorProvider( srcIndexDir, map.getMap(), ... | /**
* Merges the given taxonomy and index directories and commits the changes to
* the given writers.
*/ | Merges the given taxonomy and index directories and commits the changes to the given writers | merge | {
"repo_name": "bighaidao/lucene",
"path": "lucene-facet/src/test/java/org/apache/lucene/facet/example/merge/TaxonomyMergeUtils.java",
"license": "apache-2.0",
"size": 4491
} | [
"java.io.IOException",
"org.apache.lucene.facet.index.FacetsPayloadProcessorProvider",
"org.apache.lucene.facet.index.params.DefaultFacetIndexingParams",
"org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter",
"org.apache.lucene.index.IndexReader",
"org.apache.lucene.index.IndexWriter",
"o... | import java.io.IOException; import org.apache.lucene.facet.index.FacetsPayloadProcessorProvider; import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams; import org.apache.lucene.facet.taxonomy.directory.DirectoryTaxonomyWriter; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.I... | import java.io.*; import org.apache.lucene.facet.index.*; import org.apache.lucene.facet.index.params.*; import org.apache.lucene.facet.taxonomy.directory.*; import org.apache.lucene.index.*; import org.apache.lucene.store.*; | [
"java.io",
"org.apache.lucene"
] | java.io; org.apache.lucene; | 202,584 |
public boolean setTxPowerLevel(int powLevel){
boolean bStatus = true;
int err = FmReceiverJNI.setTxPowerLevelNative( sFd, powLevel );
if( err < 0 ){
Log.d(TAG,"setTxPowerLevel is failure");
return false;
}
return bStatus;
} | boolean function(int powLevel){ boolean bStatus = true; int err = FmReceiverJNI.setTxPowerLevelNative( sFd, powLevel ); if( err < 0 ){ Log.d(TAG,STR); return false; } return bStatus; } | /**
* Sets the transmitter power level.
*
* <p>
* This is a function used for setting the power level of
* Tx device.
* <p>
* @param powLevel The Tx power level value to be set. The value should be
* in range 0-7.If input is -ve level will be set to 0
* ... | Sets the transmitter power level. This is a function used for setting the power level of Tx device. | setTxPowerLevel | {
"repo_name": "ChepKun/android_device_huawei_msm7x27a",
"path": "hardware/fmradio/qcom/fmradio/FmTransmitter.java",
"license": "apache-2.0",
"size": 35657
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 1,022,105 |
private void processSmallRightIcon(Icon smallIcon, RemoteViews contentView) {
if (!isLegacy()) {
contentView.setDrawableParameters(R.id.right_icon, false, -1,
0xFFFFFFFF,
PorterDuff.Mode.SRC_ATOP, -1);
}
final bo... | void function(Icon smallIcon, RemoteViews contentView) { if (!isLegacy()) { contentView.setDrawableParameters(R.id.right_icon, false, -1, 0xFFFFFFFF, PorterDuff.Mode.SRC_ATOP, -1); } final boolean gray = isLegacy() && smallIcon.getType() == Icon.TYPE_RESOURCE && mColorUtil.isGrayscaleIcon(mContext, smallIcon.getResId()... | /**
* Recolor small icons when used in the R.id.right_icon slot.
*/ | Recolor small icons when used in the R.id.right_icon slot | processSmallRightIcon | {
"repo_name": "OmniEvo/android_frameworks_base",
"path": "core/java/android/app/Notification.java",
"license": "gpl-3.0",
"size": 218144
} | [
"android.graphics.PorterDuff",
"android.graphics.drawable.Icon",
"android.widget.RemoteViews"
] | import android.graphics.PorterDuff; import android.graphics.drawable.Icon; import android.widget.RemoteViews; | import android.graphics.*; import android.graphics.drawable.*; import android.widget.*; | [
"android.graphics",
"android.widget"
] | android.graphics; android.widget; | 1,912,544 |
@Override
public Identifier toPhysicalTableName(Identifier tableIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix);
} | Identifier function(Identifier tableIdentifier, JdbcEnvironment context) { return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix); } | /**
* Converts table names to lower case and limits the length if necessary.
*/ | Converts table names to lower case and limits the length if necessary | toPhysicalTableName | {
"repo_name": "buehner/shogun2",
"path": "src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java",
"license": "apache-2.0",
"size": 4592
} | [
"org.hibernate.boot.model.naming.Identifier",
"org.hibernate.engine.jdbc.env.spi.JdbcEnvironment"
] | import org.hibernate.boot.model.naming.Identifier; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; | import org.hibernate.boot.model.naming.*; import org.hibernate.engine.jdbc.env.spi.*; | [
"org.hibernate.boot",
"org.hibernate.engine"
] | org.hibernate.boot; org.hibernate.engine; | 442,588 |
public static ProductBrand createBrand(@Nullable String brand) {
ProductBrand productBrand = new ProductBrand();
productBrand.setValue(brand);
return productBrand;
} | static ProductBrand function(@Nullable String brand) { ProductBrand productBrand = new ProductBrand(); productBrand.setValue(brand); return productBrand; } | /**
* Creates a new ProductBrand.
*
* @param brand may be null if creating an "other" dimension
*/ | Creates a new ProductBrand | createBrand | {
"repo_name": "gawkermedia/googleads-java-lib",
"path": "modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201601/shopping/ProductDimensions.java",
"license": "apache-2.0",
"size": 6364
} | [
"com.google.api.ads.adwords.axis.v201601.cm.ProductBrand",
"javax.annotation.Nullable"
] | import com.google.api.ads.adwords.axis.v201601.cm.ProductBrand; import javax.annotation.Nullable; | import com.google.api.ads.adwords.axis.v201601.cm.*; import javax.annotation.*; | [
"com.google.api",
"javax.annotation"
] | com.google.api; javax.annotation; | 924,187 |
private void initMultipartResolver(ApplicationContext context) {
try {
this.multipartResolver = (MultipartResolver)
context.getBean(MULTIPART_RESOLVER_BEAN_NAME, MultipartResolver.class);
if (logger.isDebugEnabled()) {
logger.debug("Using MultipartResolver [" + this.multipartResolver + "]");
}
... | void function(ApplicationContext context) { try { this.multipartResolver = (MultipartResolver) context.getBean(MULTIPART_RESOLVER_BEAN_NAME, MultipartResolver.class); if (logger.isDebugEnabled()) { logger.debug(STR + this.multipartResolver + "]"); } } catch (NoSuchBeanDefinitionException ex) { this.multipartResolver = ... | /**
* Initialize the MultipartResolver used by this class.
* <p>If no bean is defined with the given name in the BeanFactory
* for this namespace, no multipart handling is provided.
*/ | Initialize the MultipartResolver used by this class. If no bean is defined with the given name in the BeanFactory for this namespace, no multipart handling is provided | initMultipartResolver | {
"repo_name": "mattxia/spring-2.5-analysis",
"path": "src/org/springframework/web/servlet/DispatcherServlet.java",
"license": "apache-2.0",
"size": 51288
} | [
"org.springframework.beans.factory.NoSuchBeanDefinitionException",
"org.springframework.context.ApplicationContext",
"org.springframework.web.multipart.MultipartResolver"
] | import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.context.ApplicationContext; import org.springframework.web.multipart.MultipartResolver; | import org.springframework.beans.factory.*; import org.springframework.context.*; import org.springframework.web.multipart.*; | [
"org.springframework.beans",
"org.springframework.context",
"org.springframework.web"
] | org.springframework.beans; org.springframework.context; org.springframework.web; | 2,786,080 |
@ObjectiveCName("changeGroupNotificationsEnabled:")
public void changeGroupNotificationsEnabled(boolean val) {
modules.getSettingsModule().changeGroupNotificationsEnabled(val);
} | @ObjectiveCName(STR) void function(boolean val) { modules.getSettingsModule().changeGroupNotificationsEnabled(val); } | /**
* Change group notifications enabled
*
* @param val is group notifications enabled
*/ | Change group notifications enabled | changeGroupNotificationsEnabled | {
"repo_name": "luoxiaoshenghustedu/actor-platform",
"path": "actor-apps/core/src/main/java/im/actor/core/Messenger.java",
"license": "mit",
"size": 52564
} | [
"com.google.j2objc.annotations.ObjectiveCName"
] | import com.google.j2objc.annotations.ObjectiveCName; | import com.google.j2objc.annotations.*; | [
"com.google.j2objc"
] | com.google.j2objc; | 48,168 |
public synchronized static Path recoverJobHistoryFile(JobConf conf,
Path logFilePath)
throws IOException {
Path ret;
String logFileName = logFilePath.getName();
String tmpFilename = getSecondaryJobHistoryFile(logFileName);
Path ... | synchronized static Path function(JobConf conf, Path logFilePath) throws IOException { Path ret; String logFileName = logFilePath.getName(); String tmpFilename = getSecondaryJobHistoryFile(logFileName); Path logDir = logFilePath.getParent(); Path tmpFilePath = new Path(logDir, tmpFilename); if (LOGDIR_FS.exists(logFile... | /** Selects one of the two files generated as a part of recovery.
* The thumb rule is that always select the oldest file.
* This call makes sure that only one file is left in the end.
* @param conf job conf
* @param logFilePath Path of the log file
* @throws IOException
*/ | Selects one of the two files generated as a part of recovery. The thumb rule is that always select the oldest file. This call makes sure that only one file is left in the end | recoverJobHistoryFile | {
"repo_name": "leonhong/hadoop-20-warehouse",
"path": "src/mapred/org/apache/hadoop/mapred/JobHistory.java",
"license": "apache-2.0",
"size": 81651
} | [
"java.io.IOException",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path"
] | import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; | import java.io.*; import org.apache.hadoop.fs.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,349,962 |
public static boolean checkTinkersBroken(@Nullable final ItemStack stack)
{
if (stack.hasTag())
{
final CompoundNBT tags = stack.getTag();
if (tags.contains(STATS))
{
final CompoundNBT stats = tags.getCompound(STATS);
return sta... | static boolean function(@Nullable final ItemStack stack) { if (stack.hasTag()) { final CompoundNBT tags = stack.getTag(); if (tags.contains(STATS)) { final CompoundNBT stats = tags.getCompound(STATS); return stats.getBoolean(BROKEN); } } return false; } | /**
* Checks to see if STACK is a tinker's tool, and if it is, it checks it's NBT tags to see if it's broken.
*
* @param stack the item in question.
* @return boolean whether the stack is broken or not.
*/ | Checks to see if STACK is a tinker's tool, and if it is, it checks it's NBT tags to see if it's broken | checkTinkersBroken | {
"repo_name": "Minecolonies/minecolonies",
"path": "src/api/java/com/minecolonies/api/compatibility/tinkers/ToolBrokenCheck.java",
"license": "gpl-3.0",
"size": 1021
} | [
"net.minecraft.item.ItemStack",
"net.minecraft.nbt.CompoundNBT",
"org.jetbrains.annotations.Nullable"
] | import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import org.jetbrains.annotations.Nullable; | import net.minecraft.item.*; import net.minecraft.nbt.*; import org.jetbrains.annotations.*; | [
"net.minecraft.item",
"net.minecraft.nbt",
"org.jetbrains.annotations"
] | net.minecraft.item; net.minecraft.nbt; org.jetbrains.annotations; | 1,266,687 |
public final boolean driveMecanum(Joystick left, Joystick right, boolean squared) {
if (isTraction)
return false;
double yMove = left.getY()*FORWARD_SENSITIVITY;
double xMove = left.getX()*STRAFE_SENSITIVITY;
double zRot = -right.getX()*TURN_SENSITIVITY;
driveIndependent(yMove+zRot+xMove, yMove-zRot-xMo... | final boolean function(Joystick left, Joystick right, boolean squared) { if (isTraction) return false; double yMove = left.getY()*FORWARD_SENSITIVITY; double xMove = left.getX()*STRAFE_SENSITIVITY; double zRot = -right.getX()*TURN_SENSITIVITY; driveIndependent(yMove+zRot+xMove, yMove-zRot-xMove, yMove+zRot-xMove, yMove... | /**
* This is a convenience method, so that it is easy to make the robot move
* based on a joystick. This is where the joystick drives the robot in a way
* that it is able to strafe left/right as well as being able to move forward
* and turn.
* @param joy The joystick to use for driving
* @param squared Squ... | This is a convenience method, so that it is easy to make the robot move based on a joystick. This is where the joystick drives the robot in a way that it is able to strafe left/right as well as being able to move forward and turn | driveMecanum | {
"repo_name": "Team-2502/RobotCode2014",
"path": "src/com/team2502/subsystems/DriveSubsystem.java",
"license": "bsd-3-clause",
"size": 10005
} | [
"edu.wpi.first.wpilibj.Joystick"
] | import edu.wpi.first.wpilibj.Joystick; | import edu.wpi.first.wpilibj.*; | [
"edu.wpi.first"
] | edu.wpi.first; | 278,362 |
protected final void procSearchVolumeLabel(SMBSrvPacket smbPkt)
throws IOException, SMBSrvException {
// Get the virtual circuit for the request
VirtualCircuit vc = m_sess.findVirtualCircuit( smbPkt.getUserId());
if ( vc == null) {
m_sess.sendErrorResponseSMB( smbPkt, SMBStatus.NTInvalidParameter, SMBSt... | final void function(SMBSrvPacket smbPkt) throws IOException, SMBSrvException { VirtualCircuit vc = m_sess.findVirtualCircuit( smbPkt.getUserId()); if ( vc == null) { m_sess.sendErrorResponseSMB( smbPkt, SMBStatus.NTInvalidParameter, SMBStatus.SRVNonSpecificError, SMBStatus.ErrSrv); return; } int treeId = smbPkt.getTree... | /**
* Process a search request that is for the volume label.
*
* @param smbPkt SMBSrvPacket
*/ | Process a search request that is for the volume label | procSearchVolumeLabel | {
"repo_name": "arcusys/Liferay-CIFS",
"path": "source/java/org/alfresco/jlan/smb/server/CoreProtocolHandler.java",
"license": "gpl-3.0",
"size": 106242
} | [
"java.io.IOException",
"org.alfresco.jlan.debug.Debug",
"org.alfresco.jlan.server.core.InvalidDeviceInterfaceException",
"org.alfresco.jlan.server.filesys.DiskDeviceContext",
"org.alfresco.jlan.server.filesys.DiskInterface",
"org.alfresco.jlan.server.filesys.TreeConnection",
"org.alfresco.jlan.server.fi... | import java.io.IOException; import org.alfresco.jlan.debug.Debug; import org.alfresco.jlan.server.core.InvalidDeviceInterfaceException; import org.alfresco.jlan.server.filesys.DiskDeviceContext; import org.alfresco.jlan.server.filesys.DiskInterface; import org.alfresco.jlan.server.filesys.TreeConnection; import org.alf... | import java.io.*; import org.alfresco.jlan.debug.*; import org.alfresco.jlan.server.core.*; import org.alfresco.jlan.server.filesys.*; import org.alfresco.jlan.smb.*; | [
"java.io",
"org.alfresco.jlan"
] | java.io; org.alfresco.jlan; | 87,637 |
TypedFieldId getValueVectorId(SchemaPath path); | TypedFieldId getValueVectorId(SchemaPath path); | /**
* Get the value vector type and id for the given schema path. The TypedFieldId
* should store a fieldId which is the same as the ordinal position of the field
* within the Iterator provided this classes implementation of Iterable<ValueVector>.
*
* @param path the path where the vector should be locat... | Get the value vector type and id for the given schema path. The TypedFieldId should store a fieldId which is the same as the ordinal position of the field within the Iterator provided this classes implementation of Iterable | getValueVectorId | {
"repo_name": "KulykRoman/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorAccessible.java",
"license": "apache-2.0",
"size": 2197
} | [
"org.apache.drill.common.expression.SchemaPath"
] | import org.apache.drill.common.expression.SchemaPath; | import org.apache.drill.common.expression.*; | [
"org.apache.drill"
] | org.apache.drill; | 720,669 |
@Override
public boolean setLogLevels(final long logLevels) throws EEException {
return nativeSetLogLevels( pointer, logLevels);
} | boolean function(final long logLevels) throws EEException { return nativeSetLogLevels( pointer, logLevels); } | /**
* Set the log levels to be used when logging in this engine
* @param logLevels Levels to set
* @throws EEException
* @returns true on success false on failure
*/ | Set the log levels to be used when logging in this engine | setLogLevels | {
"repo_name": "apavlo/h-store",
"path": "src/frontend/org/voltdb/jni/ExecutionEngineJNI.java",
"license": "gpl-3.0",
"size": 40744
} | [
"org.voltdb.exceptions.EEException"
] | import org.voltdb.exceptions.EEException; | import org.voltdb.exceptions.*; | [
"org.voltdb.exceptions"
] | org.voltdb.exceptions; | 1,222,629 |
@Override
public void save(final String inTitle, final String inText, final Integer inType, final String inAuthor,
final String inCoAuthor, final String inSubTitle, final String inPublisher, final String inYear,
final String inJournal, final String inPages, final Integer inArticleVolume, final Integer inAr... | void function(final String inTitle, final String inText, final Integer inType, final String inAuthor, final String inCoAuthor, final String inSubTitle, final String inPublisher, final String inYear, final String inJournal, final String inPages, final Integer inArticleVolume, final Integer inArticleNumber, final String ... | /**
* Overrides super class implementation.
*/ | Overrides super class implementation | save | {
"repo_name": "aktion-hip/relations",
"path": "org.elbe.relations.data/src/org/elbe/relations/data/internal/bom/JoinRelatedText.java",
"license": "gpl-3.0",
"size": 3553
} | [
"org.elbe.relations.data.bom.BOMException",
"org.elbe.relations.data.bom.BOMHelper",
"org.elbe.relations.data.bom.Text",
"org.hip.kernel.exc.VException"
] | import org.elbe.relations.data.bom.BOMException; import org.elbe.relations.data.bom.BOMHelper; import org.elbe.relations.data.bom.Text; import org.hip.kernel.exc.VException; | import org.elbe.relations.data.bom.*; import org.hip.kernel.exc.*; | [
"org.elbe.relations",
"org.hip.kernel"
] | org.elbe.relations; org.hip.kernel; | 1,901,470 |
void moveUserExtSource(PerunSession perunSession, User sourceUser, User targetUser, UserExtSource userExtSource) throws UserExtSourceNotExistsException, UserNotExistsException, PrivilegeException; | void moveUserExtSource(PerunSession perunSession, User sourceUser, User targetUser, UserExtSource userExtSource) throws UserExtSourceNotExistsException, UserNotExistsException, PrivilegeException; | /**
* Take UserExtSource from sourceUser and move it to the targetUser.
*
* It removes old UserExtSource with all it's attributes from sourceUser and creates and assigns the new one with
* the same settings to target user.
*
* @param perunSession
* @param sourceUser user with UserExtSource to move
* @pa... | Take UserExtSource from sourceUser and move it to the targetUser. It removes old UserExtSource with all it's attributes from sourceUser and creates and assigns the new one with the same settings to target user | moveUserExtSource | {
"repo_name": "balcirakpeter/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/api/UsersManager.java",
"license": "bsd-2-clause",
"size": 50685
} | [
"cz.metacentrum.perun.core.api.exceptions.PrivilegeException",
"cz.metacentrum.perun.core.api.exceptions.UserExtSourceNotExistsException",
"cz.metacentrum.perun.core.api.exceptions.UserNotExistsException"
] | import cz.metacentrum.perun.core.api.exceptions.PrivilegeException; import cz.metacentrum.perun.core.api.exceptions.UserExtSourceNotExistsException; import cz.metacentrum.perun.core.api.exceptions.UserNotExistsException; | import cz.metacentrum.perun.core.api.exceptions.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 257,859 |
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback);
} | ServiceFuture<Void> function(String resourceGroupName, String virtualNetworkName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); } | /**
* Deletes the specified virtual network.
*
* @param resourceGroupName The name of the resource group.
* @param virtualNetworkName The name of the virtual network.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentExce... | Deletes the specified virtual network | deleteAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_05_01/src/main/java/com/microsoft/azure/management/network/v2020_05_01/implementation/VirtualNetworksInner.java",
"license": "mit",
"size": 90099
} | [
"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; | 2,866,672 |
public static IPv4RangeAggregatorBuilder ipRange(String name) {
return new IPv4RangeAggregatorBuilder(name);
} | static IPv4RangeAggregatorBuilder function(String name) { return new IPv4RangeAggregatorBuilder(name); } | /**
* Create a new {@link IPv4RangeAggregatorBuilder} aggregation with the
* given name.
*/ | Create a new <code>IPv4RangeAggregatorBuilder</code> aggregation with the given name | ipRange | {
"repo_name": "nomoa/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/search/aggregations/AggregationBuilders.java",
"license": "apache-2.0",
"size": 13337
} | [
"org.elasticsearch.search.aggregations.bucket.range.ipv4.IPv4RangeAggregatorBuilder"
] | import org.elasticsearch.search.aggregations.bucket.range.ipv4.IPv4RangeAggregatorBuilder; | import org.elasticsearch.search.aggregations.bucket.range.ipv4.*; | [
"org.elasticsearch.search"
] | org.elasticsearch.search; | 2,171,775 |
private String CatBagToString(CategoryBag categoryBag) {
StringBuilder sb = new StringBuilder();
if (categoryBag == null) {
return "no data";
}
for (int i = 0; i < categoryBag.getKeyedReference().size(); i++) {
... | String function(CategoryBag categoryBag) { StringBuilder sb = new StringBuilder(); if (categoryBag == null) { return STR; } for (int i = 0; i < categoryBag.getKeyedReference().size(); i++) { sb.append(KeyedReferenceToString(categoryBag.getKeyedReference().get(i))); } for (int i = 0; i < categoryBag.getKeyedReferenceGro... | /**
* Converts category bags of tmodels to a readable string
*
* @param categoryBag
* @return
*/ | Converts category bags of tmodels to a readable string | CatBagToString | {
"repo_name": "apache/juddi",
"path": "juddi-examples/simple-browse/src/main/java/org/apache/juddi/example/browse/SimpleBrowse.java",
"license": "apache-2.0",
"size": 19055
} | [
"org.uddi.api_v3.CategoryBag"
] | import org.uddi.api_v3.CategoryBag; | import org.uddi.api_v3.*; | [
"org.uddi.api_v3"
] | org.uddi.api_v3; | 1,122,557 |
@Override
public BusinessObjectType fetchById(Integer id) throws SQLException
{
this.beforeFetch();
BusinessObjectType bo = dao.queryForId(id);
this.afterFetch(bo);
return bo;
} | BusinessObjectType function(Integer id) throws SQLException { this.beforeFetch(); BusinessObjectType bo = dao.queryForId(id); this.afterFetch(bo); return bo; } | /**
* Gets the BusinessObject by ID
*
* @param id the id of the BusinessObject
*
* @return The BusinessObject with the provided id or null, if not found
*
* @throws SQLException
*/ | Gets the BusinessObject by ID | fetchById | {
"repo_name": "IAP12-16B/jManagr",
"path": "src/ch/jmanagr/dal/AbstractDAL.java",
"license": "gpl-3.0",
"size": 9296
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 484,973 |
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private boolean requestAudioFocus() {
//Request audio focus for playback
int result = audioManager.requestAudioFocus(
this,
AudioManager.STREAM_MUSIC,
AudioManager.AUDIOFOCUS_GAIN);
//Check if audio focus wa... | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) boolean function() { int result = audioManager.requestAudioFocus( this, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); return (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED); } | /**
* Asks the AudioManager for our application to
* have the audio focus.
*
* @return If we have it.
*/ | Asks the AudioManager for our application to have the audio focus | requestAudioFocus | {
"repo_name": "feminefa/femis-open-player",
"path": "src/femi/com/ng/kure/musicplayer/services/ServicePlayMusic.java",
"license": "gpl-3.0",
"size": 35874
} | [
"android.annotation.TargetApi",
"android.media.AudioManager",
"android.os.Build"
] | import android.annotation.TargetApi; import android.media.AudioManager; import android.os.Build; | import android.annotation.*; import android.media.*; import android.os.*; | [
"android.annotation",
"android.media",
"android.os"
] | android.annotation; android.media; android.os; | 2,764,746 |
protected void updateWebXML(JarOutputStream newWarOutputStream, ZipInputStream warInputStream, ZipEntry entry)
throws IOException {
ZipEntry newEntry = new ZipEntry(WEBXML_PATH);
newWarOutputStream.putNextEntry(newEntry);
// can't just pass the stream to the parser, as the parser will close the stream.
I... | void function(JarOutputStream newWarOutputStream, ZipInputStream warInputStream, ZipEntry entry) throws IOException { ZipEntry newEntry = new ZipEntry(WEBXML_PATH); newWarOutputStream.putNextEntry(newEntry); InputStream copyInputStream = copyToByteArrayInputStream(warInputStream); Document doc = parseWebXml(copyInputSt... | /**
* Given the web.xml from the war file, update the file and write it to the new war file.
*
* @param newWarOutputStream
* new war file
* @param warInputStream
* existing war file
* @param entry
* web.xml entry
* @throws IOException
*... | Given the web.xml from the war file, update the file and write it to the new war file | updateWebXML | {
"repo_name": "lamsfoundation/lams",
"path": "lams_tool_deploy/src/java/org/lamsfoundation/lams/tool/deploy/UpdateWarTask.java",
"license": "gpl-2.0",
"size": 19472
} | [
"java.io.IOException",
"java.io.InputStream",
"java.util.jar.JarOutputStream",
"java.util.zip.ZipEntry",
"java.util.zip.ZipInputStream",
"org.w3c.dom.Document"
] | import java.io.IOException; import java.io.InputStream; import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.w3c.dom.Document; | import java.io.*; import java.util.jar.*; import java.util.zip.*; import org.w3c.dom.*; | [
"java.io",
"java.util",
"org.w3c.dom"
] | java.io; java.util; org.w3c.dom; | 407,616 |
void onDone() {
if (!col.isEmpty())
ldr.addDataInternal(col);
}
}
private static class LoadCacheClosure<K, V> implements Callable<Void>, Externalizable {
private static final long serialVersionUID = 0L;
private String cacheName... | void onDone() { if (!col.isEmpty()) ldr.addDataInternal(col); } } private static class LoadCacheClosure<K, V> implements Callable<Void>, Externalizable { private static final long serialVersionUID = 0L; private String cacheName; private IgniteBiPredicate<K, V> p; private Object[] args; private Ignite ignite; private Ex... | /**
* Adds remaining data to loader.
*/ | Adds remaining data to loader | onDone | {
"repo_name": "mcherkasov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java",
"license": "apache-2.0",
"size": 215084
} | [
"java.io.Externalizable",
"java.util.concurrent.Callable",
"javax.cache.expiry.ExpiryPolicy",
"org.apache.ignite.Ignite",
"org.apache.ignite.lang.IgniteBiPredicate",
"org.jetbrains.annotations.Nullable"
] | import java.io.Externalizable; import java.util.concurrent.Callable; import javax.cache.expiry.ExpiryPolicy; import org.apache.ignite.Ignite; import org.apache.ignite.lang.IgniteBiPredicate; import org.jetbrains.annotations.Nullable; | import java.io.*; import java.util.concurrent.*; import javax.cache.expiry.*; import org.apache.ignite.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; | [
"java.io",
"java.util",
"javax.cache",
"org.apache.ignite",
"org.jetbrains.annotations"
] | java.io; java.util; javax.cache; org.apache.ignite; org.jetbrains.annotations; | 131,421 |
private static Set<String> getForIteratorVariables(DetailAST ast) {
final Set<String> iteratorVariables = new HashSet<>();
final DetailAST forIteratorAST = ast.findFirstToken(TokenTypes.FOR_ITERATOR);
final DetailAST forUpdateListAST = forIteratorAST.findFirstToken(TokenTypes.ELIST);
... | static Set<String> function(DetailAST ast) { final Set<String> iteratorVariables = new HashSet<>(); final DetailAST forIteratorAST = ast.findFirstToken(TokenTypes.FOR_ITERATOR); final DetailAST forUpdateListAST = forIteratorAST.findFirstToken(TokenTypes.ELIST); for (DetailAST iteratingExpressionAST : findChildrenOfExpr... | /**
* Get all variables which for loop iterating part change in every loop.
* @param ast for loop literal(TokenTypes.LITERAL_FOR)
* @return names of variables change in iterating part of for
*/ | Get all variables which for loop iterating part change in every loop | getForIteratorVariables | {
"repo_name": "another-dave/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java",
"license": "lgpl-2.1",
"size": 13991
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST",
"com.puppycrawl.tools.checkstyle.api.TokenTypes",
"java.util.HashSet",
"java.util.Set"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.util.HashSet; import java.util.Set; | import com.puppycrawl.tools.checkstyle.api.*; import java.util.*; | [
"com.puppycrawl.tools",
"java.util"
] | com.puppycrawl.tools; java.util; | 2,704,560 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.