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
|
|---|---|---|---|---|---|---|---|---|---|---|---|
protected void onSetTimeSetByOffTimer(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}
|
protected void onSetTimeSetByOffTimer(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}
|
/**
* Property name : OFF timer reservation setting<br>
* <br>
* EPC : 0x94<br>
* <br>
* Contents of property :<br>
* Reservation ON/OFF<br>
* <br>
* Value range (decimal notation) :<br>
* ON=0x41, OFF=0x42<br>
* <br>
* Data type : unsigned char<br>
* <br>
* Data size : 1
byte<br>
* <br>
* Unit : .<br>
* <br>
* Access rule :<br>
* Announce - undefined<br>
* Set - optional<br>
* Get - optional<br>
*/
|
Property name : OFF timer reservation setting EPC : 0x94 Contents of property : Reservation ON/OFF Value range (decimal notation) : ON=0x41, OFF=0x42 Data type : unsigned char Data size : 1 Unit : . Access rule : Announce - undefined Set - optional Get - optional
|
onGetOffTimerReservationSetting
|
{
"repo_name": "kogaken1/OpenECHO",
"path": "src/com/sonycsl/echo/eoj/device/housingfacilities/FloorHeater.java",
"license": "mit",
"size": 93555
}
|
[
"com.sonycsl.echo.EchoProperty",
"com.sonycsl.echo.eoj.EchoObject"
] |
import com.sonycsl.echo.EchoProperty; import com.sonycsl.echo.eoj.EchoObject;
|
import com.sonycsl.echo.*; import com.sonycsl.echo.eoj.*;
|
[
"com.sonycsl.echo"
] |
com.sonycsl.echo;
| 369,443
|
File subtaskSpecificCheckpointDirectory(long checkpointId);
|
File subtaskSpecificCheckpointDirectory(long checkpointId);
|
/**
* Returns the local state directory for the specific operator subtask and the given checkpoint id w.r.t. our
* rotation over all available root dirs. This directory is contained in the directory returned by
* {@link #subtaskBaseDirectory(long)} for the same checkpoint id.
*/
|
Returns the local state directory for the specific operator subtask and the given checkpoint id w.r.t. our rotation over all available root dirs. This directory is contained in the directory returned by <code>#subtaskBaseDirectory(long)</code> for the same checkpoint id
|
subtaskSpecificCheckpointDirectory
|
{
"repo_name": "hequn8128/flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/state/LocalRecoveryDirectoryProvider.java",
"license": "apache-2.0",
"size": 3405
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 111,711
|
private boolean displayList(final View base, final LayoutInflater inflater, ItemEntries<T> items) {
// Get the view and the radio group
View root = inflater.inflate(R.layout.property_value_list_list, null);
RadioGroup grp = (RadioGroup) root.findViewById(R.id.values);
// Get the current value
T curr = get();
final AlertDialog dialog = new AlertDialog.Builder(inflater.getContext()).setView(root).create();
|
boolean function(final View base, final LayoutInflater inflater, ItemEntries<T> items) { View root = inflater.inflate(R.layout.property_value_list_list, null); RadioGroup grp = (RadioGroup) root.findViewById(R.id.values); T curr = get(); final AlertDialog dialog = new AlertDialog.Builder(inflater.getContext()).setView(root).create();
|
/**
* Called to display a list of values for this property.
*
* @param base Specific view that was clicked
* @param inflater LayoutInflater
* @param items All list items
* @return
*/
|
Called to display a list of values for this property
|
displayList
|
{
"repo_name": "Grunthos/Book-Catalogue",
"path": "src/com/eleybourn/bookcatalogue/properties/ListProperty.java",
"license": "gpl-3.0",
"size": 8865
}
|
[
"android.app.AlertDialog",
"android.view.LayoutInflater",
"android.view.View",
"android.widget.RadioGroup"
] |
import android.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.RadioGroup;
|
import android.app.*; import android.view.*; import android.widget.*;
|
[
"android.app",
"android.view",
"android.widget"
] |
android.app; android.view; android.widget;
| 1,592,000
|
public static TemplateQueryBuilder templateQuery(String template, Map<String, Object> vars) {
return new TemplateQueryBuilder(template, vars);
}
|
static TemplateQueryBuilder function(String template, Map<String, Object> vars) { return new TemplateQueryBuilder(template, vars); }
|
/**
* Facilitates creating template query requests using an inline script
*/
|
Facilitates creating template query requests using an inline script
|
templateQuery
|
{
"repo_name": "vrkansagara/elasticsearch",
"path": "src/main/java/org/elasticsearch/index/query/QueryBuilders.java",
"license": "apache-2.0",
"size": 22729
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,082,006
|
public void scrollToStart() {
scrollToRow(0, ScrollDestination.START);
}
|
void function() { scrollToRow(0, ScrollDestination.START); }
|
/**
* Scrolls to the beginning of the very first row.
*/
|
Scrolls to the beginning of the very first row
|
scrollToStart
|
{
"repo_name": "travisfw/vaadin",
"path": "client/src/com/vaadin/client/widgets/Grid.java",
"license": "apache-2.0",
"size": 285859
}
|
[
"com.vaadin.shared.ui.grid.ScrollDestination"
] |
import com.vaadin.shared.ui.grid.ScrollDestination;
|
import com.vaadin.shared.ui.grid.*;
|
[
"com.vaadin.shared"
] |
com.vaadin.shared;
| 2,033,140
|
public static Map<String, BeanDefinition> getBeanDefinitions(
final DefaultListableBeanFactory beanFactory,
final Class<?>... excludes) {
final Map<String, BeanDefinition> defs = new HashMap<String, BeanDefinition>();
// if there is a factory add all the definitions available
if (beanFactory != null) {
// add all the defs defined
for (final String defName : beanFactory.getBeanDefinitionNames()) {
final BeanDefinition def = beanFactory
.getBeanDefinition(defName);
// get the class of the bean
Class<?> beanClass;
try {
final String className = def.getBeanClassName();
if (className != null) {
beanClass = ClassUtils.forName(className,
ClassUtils.getDefaultClassLoader());
} else {
beanClass = null;
}
} catch (final ClassNotFoundException e) {
if (LOG.isWarnEnabled()) {
LOG.warn(
"Unable to determine exclusion of bean of type '"
+ def.getBeanClassName()
+ "', because the resolving led to an error.",
e);
}
beanClass = null;
}
// check if we have to skip it
boolean skip = false;
if (excludes != null && beanClass != null) {
for (final Class<?> exclude : excludes) {
if (exclude.isAssignableFrom(beanClass)) {
skip = true;
break;
}
}
}
// add it if it isn't skipped
if (!skip) {
defs.put(defName, def);
}
}
}
return defs;
}
|
static Map<String, BeanDefinition> function( final DefaultListableBeanFactory beanFactory, final Class<?>... excludes) { final Map<String, BeanDefinition> defs = new HashMap<String, BeanDefinition>(); if (beanFactory != null) { for (final String defName : beanFactory.getBeanDefinitionNames()) { final BeanDefinition def = beanFactory .getBeanDefinition(defName); Class<?> beanClass; try { final String className = def.getBeanClassName(); if (className != null) { beanClass = ClassUtils.forName(className, ClassUtils.getDefaultClassLoader()); } else { beanClass = null; } } catch (final ClassNotFoundException e) { if (LOG.isWarnEnabled()) { LOG.warn( STR + def.getBeanClassName() + STR, e); } beanClass = null; } boolean skip = false; if (excludes != null && beanClass != null) { for (final Class<?> exclude : excludes) { if (exclude.isAssignableFrom(beanClass)) { skip = true; break; } } } if (!skip) { defs.put(defName, def); } } } return defs; }
|
/**
* Gets all the <code>BeanDefinition</code> instances of the passed
* <code>beanFactory</code>.
*
* @param beanFactory
* the <code>DefaultListableBeanFactory</code> to get all the
* <code>BeanDefinitions</code> from
* @param excludes
* a array of <code>Classes</code> which should be excluded, i.e.
* the classes are checked to be a super-class or super-interface
* as well
*
* @return all the <code>BeanDefinition</code> of the
* <code>beanFactory</code> which do not define excluded classes.
*/
|
Gets all the <code>BeanDefinition</code> instances of the passed <code>beanFactory</code>
|
getBeanDefinitions
|
{
"repo_name": "pmeisen/gen-sbconfigurator",
"path": "src/net/meisen/general/sbconfigurator/helper/SpringHelper.java",
"license": "mit",
"size": 7870
}
|
[
"java.util.HashMap",
"java.util.Map",
"org.springframework.beans.factory.config.BeanDefinition",
"org.springframework.beans.factory.support.DefaultListableBeanFactory",
"org.springframework.util.ClassUtils"
] |
import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.util.ClassUtils;
|
import java.util.*; import org.springframework.beans.factory.config.*; import org.springframework.beans.factory.support.*; import org.springframework.util.*;
|
[
"java.util",
"org.springframework.beans",
"org.springframework.util"
] |
java.util; org.springframework.beans; org.springframework.util;
| 2,773,421
|
private Bitmap createOriginalImage(ImageView v, Canvas canvas) {
final Drawable d = v.getDrawable();
final Bitmap b = Bitmap.createBitmap(
d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
canvas.setBitmap(b);
canvas.save();
d.draw(canvas);
canvas.restore();
canvas.setBitmap(null);
return b;
}
|
Bitmap function(ImageView v, Canvas canvas) { final Drawable d = v.getDrawable(); final Bitmap b = Bitmap.createBitmap( d.getIntrinsicWidth(), d.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); canvas.setBitmap(b); canvas.save(); d.draw(canvas); canvas.restore(); canvas.setBitmap(null); return b; }
|
/**
* Creates a copy of the original image.
*/
|
Creates a copy of the original image
|
createOriginalImage
|
{
"repo_name": "craigacgomez/flaming_monkey_packages_apps_Launcher2",
"path": "src/com/android/launcher2/HolographicViewHelper.java",
"license": "apache-2.0",
"size": 3457
}
|
[
"android.graphics.Bitmap",
"android.graphics.Canvas",
"android.graphics.drawable.Drawable",
"android.widget.ImageView"
] |
import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.widget.ImageView;
|
import android.graphics.*; import android.graphics.drawable.*; import android.widget.*;
|
[
"android.graphics",
"android.widget"
] |
android.graphics; android.widget;
| 645,771
|
public static void startActivityForResult(@NonNull final Activity activity,
@NonNull final Class<? extends Activity> clz,
final int requestCode,
@AnimRes final int enterAnim,
@AnimRes final int exitAnim) {
startActivityForResult(activity, null, activity.getPackageName(), clz.getName(),
requestCode, getOptionsBundle(activity, enterAnim, exitAnim));
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
activity.overridePendingTransition(enterAnim, exitAnim);
}
}
|
static void function(@NonNull final Activity activity, @NonNull final Class<? extends Activity> clz, final int requestCode, @AnimRes final int enterAnim, @AnimRes final int exitAnim) { startActivityForResult(activity, null, activity.getPackageName(), clz.getName(), requestCode, getOptionsBundle(activity, enterAnim, exitAnim)); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { activity.overridePendingTransition(enterAnim, exitAnim); } }
|
/**
* Start the activity.
*
* @param activity The activity.
* @param clz The activity class.
* @param requestCode if >= 0, this code will be returned in
* onActivityResult() when the activity exits.
* @param enterAnim A resource ID of the animation resource to use for the
* incoming activity.
* @param exitAnim A resource ID of the animation resource to use for the
* outgoing activity.
*/
|
Start the activity
|
startActivityForResult
|
{
"repo_name": "didi/DoraemonKit",
"path": "Android/dokit-util/src/main/java/com/didichuxing/doraemonkit/util/ActivityUtils.java",
"license": "apache-2.0",
"size": 90700
}
|
[
"android.app.Activity",
"android.os.Build",
"androidx.annotation.AnimRes",
"androidx.annotation.NonNull"
] |
import android.app.Activity; import android.os.Build; import androidx.annotation.AnimRes; import androidx.annotation.NonNull;
|
import android.app.*; import android.os.*; import androidx.annotation.*;
|
[
"android.app",
"android.os",
"androidx.annotation"
] |
android.app; android.os; androidx.annotation;
| 2,638,868
|
public GridNioFuture<?> sendSystem(GridNioSession ses,
Message msg,
@Nullable IgniteInClosure<? super IgniteInternalFuture<?>> lsnr) {
assert ses instanceof GridSelectorNioSessionImpl;
GridSelectorNioSessionImpl impl = (GridSelectorNioSessionImpl)ses;
NioOperationFuture<?> fut = new NioOperationFuture<Void>(impl, NioOperation.REQUIRE_WRITE, msg,
skipRecoveryPred.apply(msg));
if (lsnr != null) {
fut.listen(lsnr);
assert !fut.isDone();
}
send0(impl, fut, true);
return fut;
}
|
GridNioFuture<?> function(GridNioSession ses, Message msg, @Nullable IgniteInClosure<? super IgniteInternalFuture<?>> lsnr) { assert ses instanceof GridSelectorNioSessionImpl; GridSelectorNioSessionImpl impl = (GridSelectorNioSessionImpl)ses; NioOperationFuture<?> fut = new NioOperationFuture<Void>(impl, NioOperation.REQUIRE_WRITE, msg, skipRecoveryPred.apply(msg)); if (lsnr != null) { fut.listen(lsnr); assert !fut.isDone(); } send0(impl, fut, true); return fut; }
|
/**
* Adds message at the front of the queue without acquiring back pressure semaphore.
*
* @param ses Session.
* @param msg Message.
* @param lsnr Future listener notified from the session thread.
* @return Future.
*/
|
Adds message at the front of the queue without acquiring back pressure semaphore
|
sendSystem
|
{
"repo_name": "apacheignite/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java",
"license": "apache-2.0",
"size": 79747
}
|
[
"org.apache.ignite.internal.IgniteInternalFuture",
"org.apache.ignite.lang.IgniteInClosure",
"org.apache.ignite.plugin.extensions.communication.Message",
"org.jetbrains.annotations.Nullable"
] |
import org.apache.ignite.internal.IgniteInternalFuture; import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.plugin.extensions.communication.Message; import org.jetbrains.annotations.Nullable;
|
import org.apache.ignite.internal.*; import org.apache.ignite.lang.*; import org.apache.ignite.plugin.extensions.communication.*; import org.jetbrains.annotations.*;
|
[
"org.apache.ignite",
"org.jetbrains.annotations"
] |
org.apache.ignite; org.jetbrains.annotations;
| 854,828
|
public static Locator startLocator(int port, File logFile, InetAddress bindAddress)
throws IOException {
return startLocator(port, logFile, false, bindAddress, (Properties) null, true, true, null);
}
|
static Locator function(int port, File logFile, InetAddress bindAddress) throws IOException { return startLocator(port, logFile, false, bindAddress, (Properties) null, true, true, null); }
|
/**
* Starts a new distribution locator host by this VM. The locator will look for a
* gemfire.properties file, or equivalent system properties to fill in the gaps in its
* configuration.
* <p>
* The locator will not start a distributed system. The locator will provide peer location
* services only.
*
* @param port The port on which the locator will listen for membership information requests from
* new members
* @param logFile The file to which the locator logs information. The directory that contains the
* log file is used as the output directory of the locator (see <code>-dir</code> option to
* the <code>gemfire</code> command).
* @param bindAddress The IP address to which the locator's socket binds
*
* @throws IllegalArgumentException If <code>port</code> is not in the range 0 to 65536
* @throws org.apache.geode.SystemIsRunningException If another locator is already running in
* <code>outputDir</code>
* @throws org.apache.geode.GemFireIOException If the directory containing the
* <code>logFile</code> does not exist or cannot be written to
* @throws IOException If the locator cannot be started
* @deprecated as of 7.0 use startLocatorAndDS instead.
*/
|
Starts a new distribution locator host by this VM. The locator will look for a gemfire.properties file, or equivalent system properties to fill in the gaps in its configuration. The locator will not start a distributed system. The locator will provide peer location services only
|
startLocator
|
{
"repo_name": "davebarnes97/geode",
"path": "geode-core/src/main/java/org/apache/geode/distributed/Locator.java",
"license": "apache-2.0",
"size": 19069
}
|
[
"java.io.File",
"java.io.IOException",
"java.net.InetAddress",
"java.util.Properties"
] |
import java.io.File; import java.io.IOException; import java.net.InetAddress; import java.util.Properties;
|
import java.io.*; import java.net.*; import java.util.*;
|
[
"java.io",
"java.net",
"java.util"
] |
java.io; java.net; java.util;
| 2,521,965
|
protected MetadataElement addAbstractedMetadataHeader(MetadataElement root) {
MetadataElement absRoot;
if (root == null) {
absRoot = new MetadataElement(OPTICAL_METADATA_ROOT);
} else {
absRoot = root.getElement(OPTICAL_METADATA_ROOT);
if (absRoot == null) {
absRoot = new MetadataElement(OPTICAL_METADATA_ROOT);
root.addElementAt(absRoot, 0);
}
}
MetadataAttribute att = addAbstractedAttribute(absRoot, abstracted_metadata_version, ProductData.TYPE_ASCII, "", "AbsMetadata version");
att.getData().setElems(METADATA_VERSION);
return absRoot;
}
|
MetadataElement function(MetadataElement root) { MetadataElement absRoot; if (root == null) { absRoot = new MetadataElement(OPTICAL_METADATA_ROOT); } else { absRoot = root.getElement(OPTICAL_METADATA_ROOT); if (absRoot == null) { absRoot = new MetadataElement(OPTICAL_METADATA_ROOT); root.addElementAt(absRoot, 0); } } MetadataAttribute att = addAbstractedAttribute(absRoot, abstracted_metadata_version, ProductData.TYPE_ASCII, STRAbsMetadata version"); att.getData().setElems(METADATA_VERSION); return absRoot; }
|
/**
* Abstract common metadata from products to be used uniformly by all operators
*
* @param root the product metadata root
* @return abstracted metadata root
*/
|
Abstract common metadata from products to be used uniformly by all operators
|
addAbstractedMetadataHeader
|
{
"repo_name": "arraydev/snap-engine",
"path": "snap-engine-utilities/src/main/java/org/esa/snap/datamodel/metadata/AbstractMetadataOptical.java",
"license": "gpl-3.0",
"size": 3631
}
|
[
"org.esa.snap.framework.datamodel.MetadataAttribute",
"org.esa.snap.framework.datamodel.MetadataElement",
"org.esa.snap.framework.datamodel.ProductData"
] |
import org.esa.snap.framework.datamodel.MetadataAttribute; import org.esa.snap.framework.datamodel.MetadataElement; import org.esa.snap.framework.datamodel.ProductData;
|
import org.esa.snap.framework.datamodel.*;
|
[
"org.esa.snap"
] |
org.esa.snap;
| 2,134,945
|
@Parameterized.Parameters
public static Collection parameters() {
return Arrays.asList(
new Object[]{
ClientType.Implicit,
Scope.ROLE_ADMIN,
false
},
new Object[]{
ClientType.Implicit,
Scope.ROLE,
false
},
new Object[]{
ClientType.Implicit,
Scope.ROLE_ADMIN,
true
},
new Object[]{
ClientType.Implicit,
Scope.ROLE,
true
},
new Object[]{
ClientType.ClientCredentials,
Scope.ROLE_ADMIN,
false
},
new Object[]{
ClientType.ClientCredentials,
Scope.ROLE,
false
});
}
|
@Parameterized.Parameters static Collection function() { return Arrays.asList( new Object[]{ ClientType.Implicit, Scope.ROLE_ADMIN, false }, new Object[]{ ClientType.Implicit, Scope.ROLE, false }, new Object[]{ ClientType.Implicit, Scope.ROLE_ADMIN, true }, new Object[]{ ClientType.Implicit, Scope.ROLE, true }, new Object[]{ ClientType.ClientCredentials, Scope.ROLE_ADMIN, false }, new Object[]{ ClientType.ClientCredentials, Scope.ROLE, false }); }
|
/**
* Test parameters.
*
* @return The parameters passed to this test during every run.
*/
|
Test parameters
|
parameters
|
{
"repo_name": "kangaroo-server/kangaroo",
"path": "kangaroo-server-authz/src/test/java/net/krotscheck/kangaroo/authz/admin/v1/resource/RoleServiceSearchTest.java",
"license": "apache-2.0",
"size": 8740
}
|
[
"java.util.Arrays",
"java.util.Collection",
"net.krotscheck.kangaroo.authz.admin.Scope",
"net.krotscheck.kangaroo.authz.common.database.entity.ClientType",
"org.junit.runners.Parameterized"
] |
import java.util.Arrays; import java.util.Collection; import net.krotscheck.kangaroo.authz.admin.Scope; import net.krotscheck.kangaroo.authz.common.database.entity.ClientType; import org.junit.runners.Parameterized;
|
import java.util.*; import net.krotscheck.kangaroo.authz.admin.*; import net.krotscheck.kangaroo.authz.common.database.entity.*; import org.junit.runners.*;
|
[
"java.util",
"net.krotscheck.kangaroo",
"org.junit.runners"
] |
java.util; net.krotscheck.kangaroo; org.junit.runners;
| 1,488,256
|
Executor getExecutor();
|
Executor getExecutor();
|
/**
* Executor to use for this cache instance.
*
* @throws IllegalStateException if this method is called within the supplier of
* the time reference or executor.
*/
|
Executor to use for this cache instance
|
getExecutor
|
{
"repo_name": "cache2k/cache2k",
"path": "cache2k-api/src/main/java/org/cache2k/config/CacheBuildContext.java",
"license": "apache-2.0",
"size": 2089
}
|
[
"java.util.concurrent.Executor"
] |
import java.util.concurrent.Executor;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 1,106,112
|
public void showSearchBar(final ActionListener callback) {
SearchBar s = new SearchBar(Toolbar.this, searchIconSize) {
|
void function(final ActionListener callback) { SearchBar s = new SearchBar(Toolbar.this, searchIconSize) {
|
/**
* Shows the search bar manually which is useful for use cases of popping
* up search from code
*
* @param callback gets the search string callbacks
*/
|
Shows the search bar manually which is useful for use cases of popping up search from code
|
showSearchBar
|
{
"repo_name": "diamonddevgroup/CodenameOne",
"path": "CodenameOne/src/com/codename1/ui/Toolbar.java",
"license": "gpl-2.0",
"size": 113924
}
|
[
"com.codename1.ui.events.ActionListener"
] |
import com.codename1.ui.events.ActionListener;
|
import com.codename1.ui.events.*;
|
[
"com.codename1.ui"
] |
com.codename1.ui;
| 2,489,357
|
public static List<ClimbSession> climbsToSessions(List<Climb> climbs) {
// TODO: only works when the received list is sorted from oldest to latest. Re-write to be order agnostic.
List<ClimbSession> sessions = new ArrayList<ClimbSession>();
ClimbSession session = null;
for(Climb climb : climbs) {
if(null == session) {
session = new ClimbSession(climb.getDate());
session.addClimb(climb);
} else if (climb.getDate().getTime() - session.getDate().getTime() < TIME_BETWEEN_2_SESSIONS) {
session.addClimb(climb);
} else {
sessions.add(session);
session = new ClimbSession(climb.getDate());
session.addClimb(climb);
}
}
sessions.add(session);
// we built a list in the wrong order, reverse it
List<ClimbSession> sessionsReversed = new ArrayList<ClimbSession>();
for(ClimbSession session1 : sessions) {
sessionsReversed.add(0, session1);
}
return sessionsReversed;
}
|
static List<ClimbSession> function(List<Climb> climbs) { List<ClimbSession> sessions = new ArrayList<ClimbSession>(); ClimbSession session = null; for(Climb climb : climbs) { if(null == session) { session = new ClimbSession(climb.getDate()); session.addClimb(climb); } else if (climb.getDate().getTime() - session.getDate().getTime() < TIME_BETWEEN_2_SESSIONS) { session.addClimb(climb); } else { sessions.add(session); session = new ClimbSession(climb.getDate()); session.addClimb(climb); } } sessions.add(session); List<ClimbSession> sessionsReversed = new ArrayList<ClimbSession>(); for(ClimbSession session1 : sessions) { sessionsReversed.add(0, session1); } return sessionsReversed; }
|
/**
* Transforms a list of Climbs into a list of ClimSessions
* @param climbs list of climbs sorted by date
* @return List of sessions, sorted by newest first
*/
|
Transforms a list of Climbs into a list of ClimSessions
|
climbsToSessions
|
{
"repo_name": "google/climb-tracker",
"path": "mobile/src/main/java/fr/steren/climbtracker/ClimbSession.java",
"license": "apache-2.0",
"size": 3551
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 410,492
|
public void setEffectiveTime(Date effectiveTime);
|
void function(Date effectiveTime);
|
/**
* Sets the effective time.
*
* @param effectiveTime the effective time
*/
|
Sets the effective time
|
setEffectiveTime
|
{
"repo_name": "WestCoastInformatics/ihtsdo-refset-tool",
"path": "model/src/main/java/org/ihtsdo/otf/refset/rf2/Component.java",
"license": "apache-2.0",
"size": 2622
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,748,868
|
public static String hexToBase64(String value) throws DecoderException, UnsupportedEncodingException {
String base64Value = null;
if (value != null) {
base64Value = new String(Base64.encodeBase64(Hex.decodeHex(value.toCharArray())), "UTF-8");
}
return base64Value;
}
|
static String function(String value) throws DecoderException, UnsupportedEncodingException { String base64Value = null; if (value != null) { base64Value = new String(Base64.encodeBase64(Hex.decodeHex(value.toCharArray())), "UTF-8"); } return base64Value; }
|
/**
* Convert hex value to base64.
*
* @param value hex value
* @return base64 value
* @throws DecoderException on error
*/
|
Convert hex value to base64
|
hexToBase64
|
{
"repo_name": "digolo/davmail-enterprise",
"path": "davmail/src/main/java/davmail/util/StringUtil.java",
"license": "gpl-2.0",
"size": 16294
}
|
[
"java.io.UnsupportedEncodingException",
"org.apache.commons.codec.DecoderException",
"org.apache.commons.codec.binary.Base64",
"org.apache.commons.codec.binary.Hex"
] |
import java.io.UnsupportedEncodingException; import org.apache.commons.codec.DecoderException; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Hex;
|
import java.io.*; import org.apache.commons.codec.*; import org.apache.commons.codec.binary.*;
|
[
"java.io",
"org.apache.commons"
] |
java.io; org.apache.commons;
| 2,552,272
|
@Test
public void testNoArgTypesFactory() {
final Constructor constructor = new Constructor(NO_COMMENTS, "Whatever", Util.<Arg>list());
final StringSink sink = new StringSink("test");
try {
emitter.constructorFactory(sink, "SomeDataType", "SomeFactory", list("A", "B"), constructor);
} finally {
sink.close();
}
assertEquals(NO_ARG_TYPES_FACTORY, sink.result());
}
|
void function() { final Constructor constructor = new Constructor(NO_COMMENTS, STR, Util.<Arg>list()); final StringSink sink = new StringSink("test"); try { emitter.constructorFactory(sink, STR, STR, list("A", "B"), constructor); } finally { sink.close(); } assertEquals(NO_ARG_TYPES_FACTORY, sink.result()); }
|
/**
* If a factory has no args but does have type parameters it should be a constant with some warning suppression
*/
|
If a factory has no args but does have type parameters it should be a constant with some warning suppression
|
testNoArgTypesFactory
|
{
"repo_name": "JamesIry/jADT",
"path": "jADT-core/src/test/java/com/pogofish/jadt/emitter/ClassBodyEmitterTest.java",
"license": "apache-2.0",
"size": 18030
}
|
[
"com.pogofish.jadt.ast.Arg",
"com.pogofish.jadt.ast.Constructor",
"com.pogofish.jadt.sink.StringSink",
"com.pogofish.jadt.util.Util",
"org.junit.Assert"
] |
import com.pogofish.jadt.ast.Arg; import com.pogofish.jadt.ast.Constructor; import com.pogofish.jadt.sink.StringSink; import com.pogofish.jadt.util.Util; import org.junit.Assert;
|
import com.pogofish.jadt.ast.*; import com.pogofish.jadt.sink.*; import com.pogofish.jadt.util.*; import org.junit.*;
|
[
"com.pogofish.jadt",
"org.junit"
] |
com.pogofish.jadt; org.junit;
| 1,559,755
|
public void addPaths(List<String> additionalDirectories) {
for (String dir : additionalDirectories) {
addPath(dir);
}
}
|
void function(List<String> additionalDirectories) { for (String dir : additionalDirectories) { addPath(dir); } }
|
/**
* Add additional directories to the load path.
*
* @param additionalDirectories a List of additional dirs to append to the load path
*/
|
Add additional directories to the load path
|
addPaths
|
{
"repo_name": "rholder/jfss",
"path": "src/main/java/org/jruby/runtime/load/LoadService.java",
"license": "apache-2.0",
"size": 68631
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 235,061
|
public static Iterable<Method> getClosureOfMethodsOnInterface(Class<?> iface) {
checkNotNull(iface);
checkArgument(iface.isInterface());
ImmutableSet.Builder<Method> builder = ImmutableSet.builder();
Queue<Class<?>> interfacesToProcess = Queues.newArrayDeque();
interfacesToProcess.add(iface);
while (!interfacesToProcess.isEmpty()) {
Class<?> current = interfacesToProcess.remove();
builder.add(current.getMethods());
interfacesToProcess.addAll(Arrays.asList(current.getInterfaces()));
}
return builder.build();
}
|
static Iterable<Method> function(Class<?> iface) { checkNotNull(iface); checkArgument(iface.isInterface()); ImmutableSet.Builder<Method> builder = ImmutableSet.builder(); Queue<Class<?>> interfacesToProcess = Queues.newArrayDeque(); interfacesToProcess.add(iface); while (!interfacesToProcess.isEmpty()) { Class<?> current = interfacesToProcess.remove(); builder.add(current.getMethods()); interfacesToProcess.addAll(Arrays.asList(current.getInterfaces())); } return builder.build(); }
|
/**
* Returns all the methods visible from {@code iface}.
*
* @param iface The interface to use when searching for all its methods.
* @return An iterable of {@link Method}s which {@code iface} exposes.
*/
|
Returns all the methods visible from iface
|
getClosureOfMethodsOnInterface
|
{
"repo_name": "amitsela/incubator-beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/common/ReflectHelpers.java",
"license": "apache-2.0",
"size": 8973
}
|
[
"com.google.common.base.Preconditions",
"com.google.common.collect.ImmutableSet",
"com.google.common.collect.Queues",
"java.lang.reflect.Method",
"java.util.Arrays",
"java.util.Queue"
] |
import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Queues; import java.lang.reflect.Method; import java.util.Arrays; import java.util.Queue;
|
import com.google.common.base.*; import com.google.common.collect.*; import java.lang.reflect.*; import java.util.*;
|
[
"com.google.common",
"java.lang",
"java.util"
] |
com.google.common; java.lang; java.util;
| 610,215
|
protected CmsModuleManager getModuleManager() {
return m_moduleManager;
}
|
CmsModuleManager function() { return m_moduleManager; }
|
/**
* Returns the module manager.<p>
*
* @return the module manager
*/
|
Returns the module manager
|
getModuleManager
|
{
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/main/OpenCmsCore.java",
"license": "lgpl-2.1",
"size": 90779
}
|
[
"org.opencms.module.CmsModuleManager"
] |
import org.opencms.module.CmsModuleManager;
|
import org.opencms.module.*;
|
[
"org.opencms.module"
] |
org.opencms.module;
| 953,811
|
void setSwitchOnDate(Date value);
|
void setSwitchOnDate(Date value);
|
/**
* Sets the value of the '{@link CIM.IEC61970.Wires.ShuntCompensator#getSwitchOnDate <em>Switch On Date</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Switch On Date</em>' attribute.
* @see #getSwitchOnDate()
* @generated
*/
|
Sets the value of the '<code>CIM.IEC61970.Wires.ShuntCompensator#getSwitchOnDate Switch On Date</code>' attribute.
|
setSwitchOnDate
|
{
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Wires/ShuntCompensator.java",
"license": "mit",
"size": 23459
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,540,160
|
public final RenderableImage getWrappedImage() {
return im;
}
|
final RenderableImage function() { return im; }
|
/**
* Returns the reference to the external <code>RenderableImage</code>
* originally supplied to the constructor.
*
* @since JAI 1.1.2
*/
|
Returns the reference to the external <code>RenderableImage</code> originally supplied to the constructor
|
getWrappedImage
|
{
"repo_name": "MarinnaCole/LightZone",
"path": "lightcrafts/extsrc/com/lightcrafts/mediax/jai/RenderableImageAdapter.java",
"license": "bsd-3-clause",
"size": 11831
}
|
[
"java.awt.image.renderable.RenderableImage"
] |
import java.awt.image.renderable.RenderableImage;
|
import java.awt.image.renderable.*;
|
[
"java.awt"
] |
java.awt;
| 1,453,043
|
@Test
public void localServerTest() {
final ExchangeSpecification specification =
new ExchangeSpecification(RippleExchange.class.getName());
specification.setSslUri(""); // remove the default api.ripple.com connection
specification.setPlainTextUri(RippleExchange.REST_API_LOCALHOST_PLAIN_TEXT);
specification.setSecretKey("s****************************");
final Exchange exchange = ExchangeFactory.INSTANCE.createExchange(specification);
assertThat(exchange).isInstanceOf(RippleExchange.class);
assertThat(exchange.getExchangeSpecification().getSecretKey())
.isEqualTo("s****************************");
assertThat(exchange.getExchangeSpecification().getSslUri()).isEqualTo("");
assertThat(exchange.getExchangeSpecification().getPlainTextUri())
.isEqualTo(RippleExchange.REST_API_LOCALHOST_PLAIN_TEXT);
}
|
void function() { final ExchangeSpecification specification = new ExchangeSpecification(RippleExchange.class.getName()); specification.setSslUri(STRs****************************STRs****************************STR"); assertThat(exchange.getExchangeSpecification().getPlainTextUri()) .isEqualTo(RippleExchange.REST_API_LOCALHOST_PLAIN_TEXT); }
|
/**
* The recommended method for sending private transactions with a secret key is to use a trusted
* REST API server, e.g. one running locally.
*/
|
The recommended method for sending private transactions with a secret key is to use a trusted REST API server, e.g. one running locally
|
localServerTest
|
{
"repo_name": "chrisrico/XChange",
"path": "xchange-ripple/src/test/java/org/knowm/xchange/ripple/RippleServerTrustTest.java",
"license": "mit",
"size": 3437
}
|
[
"org.assertj.core.api.Assertions",
"org.knowm.xchange.ExchangeSpecification"
] |
import org.assertj.core.api.Assertions; import org.knowm.xchange.ExchangeSpecification;
|
import org.assertj.core.api.*; import org.knowm.xchange.*;
|
[
"org.assertj.core",
"org.knowm.xchange"
] |
org.assertj.core; org.knowm.xchange;
| 2,524,827
|
//#ifdef JAVA6
public RowId getRowId(int columnIndex) throws SQLException {
throw Util.notSupported();
}
//#endif JAVA6
|
RowId function(int columnIndex) throws SQLException { throw Util.notSupported(); }
|
/**
* Retrieves the value of the designated column in the current row of this
* <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java
* programming language.
*
* @param columnIndex the first column is 1, the second 2, ...
* @return the column value; if the value is a SQL <code>NULL</code> the
* value returned is <code>null</code>
* @throws SQLException if a database access error occurs
* or this method is called on a closed result set
* @exception SQLFeatureNotSupportedException if the JDBC driver does not support
* this method
* @since JDK 1.6, HSQLDB 1.9.0
*/
|
Retrieves the value of the designated column in the current row of this <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java programming language
|
getRowId
|
{
"repo_name": "apavlo/h-store",
"path": "src/hsqldb19b3/org/hsqldb/jdbc/JDBCResultSet.java",
"license": "gpl-3.0",
"size": 304688
}
|
[
"java.sql.RowId",
"java.sql.SQLException"
] |
import java.sql.RowId; import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,170,948
|
@Nullable
Loader<D> restartLoader(@IntRange(from = 0) int loaderId, @Nullable Bundle params);
|
Loader<D> restartLoader(@IntRange(from = 0) int loaderId, @Nullable Bundle params);
|
/**
* Re-starts a loader with the specified <var>loaderId</var> via the associated LoaderManager's
* {@link LoaderManager#restartLoader(int, android.os.Bundle, LoaderManager.LoaderCallbacks) restartLoader(int, Bundle, LoaderManager.LoaderCallbacks)}.
* <p>
* This assistant will be used as {@link LoaderManager.LoaderCallbacks} callback.
*
* @param loaderId Id of the desired loader to re-start.
* @param params The desired parameters for the loader.
* @return Re-started loader instance or {@code null} if this assistant does not create loader
* for the specified <var>id</var>.
* @see #startLoader(int, Bundle)
* @see #initLoader(int, Bundle)
* @see #destroyLoader(int)
*/
|
Re-starts a loader with the specified loaderId via the associated LoaderManager's <code>LoaderManager#restartLoader(int, android.os.Bundle, LoaderManager.LoaderCallbacks) restartLoader(int, Bundle, LoaderManager.LoaderCallbacks)</code>. This assistant will be used as <code>LoaderManager.LoaderCallbacks</code> callback
|
restartLoader
|
{
"repo_name": "android-libraries/android_database",
"path": "library/src/main/java/com/albedinsky/android/database/content/LoaderAssistant.java",
"license": "apache-2.0",
"size": 6250
}
|
[
"android.content.Loader",
"android.os.Bundle",
"android.support.annotation.IntRange",
"android.support.annotation.Nullable"
] |
import android.content.Loader; import android.os.Bundle; import android.support.annotation.IntRange; import android.support.annotation.Nullable;
|
import android.content.*; import android.os.*; import android.support.annotation.*;
|
[
"android.content",
"android.os",
"android.support"
] |
android.content; android.os; android.support;
| 196,065
|
public void start() {
LOG.info("Starting ZK Group for path: {}", path);
if (started.compareAndSet(false, true)) {
connected.set(client.getZookeeperClient().isConnected());
if (isConnected()) {
handleStateChange(ConnectionState.CONNECTED);
}
|
void function() { LOG.info(STR, path); if (started.compareAndSet(false, true)) { connected.set(client.getZookeeperClient().isConnected()); if (isConnected()) { handleStateChange(ConnectionState.CONNECTED); }
|
/**
* Start the cache. The cache is not started automatically. You must call this method.
*/
|
Start the cache. The cache is not started automatically. You must call this method
|
start
|
{
"repo_name": "Fabryprog/camel",
"path": "components/camel-zookeeper-master/src/main/java/org/apache/camel/component/zookeepermaster/group/internal/ZooKeeperGroup.java",
"license": "apache-2.0",
"size": 23461
}
|
[
"org.apache.curator.framework.state.ConnectionState"
] |
import org.apache.curator.framework.state.ConnectionState;
|
import org.apache.curator.framework.state.*;
|
[
"org.apache.curator"
] |
org.apache.curator;
| 1,305,279
|
public static boolean isConnectedWifi(Context context) {
NetworkInfo info = Connectivity.getNetworkInfo(context);
return (info != null && info.isConnected() && info
.getType() == ConnectivityManager.TYPE_WIFI);
}
|
static boolean function(Context context) { NetworkInfo info = Connectivity.getNetworkInfo(context); return (info != null && info.isConnected() && info .getType() == ConnectivityManager.TYPE_WIFI); }
|
/**
* Check if there is any connectivity to a Wifi network
*
* @param context
* @return
*/
|
Check if there is any connectivity to a Wifi network
|
isConnectedWifi
|
{
"repo_name": "dralagen/MyTargets",
"path": "app/src/main/java/de/dreier/mytargets/utils/Connectivity.java",
"license": "gpl-2.0",
"size": 4346
}
|
[
"android.content.Context",
"android.net.ConnectivityManager",
"android.net.NetworkInfo"
] |
import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo;
|
import android.content.*; import android.net.*;
|
[
"android.content",
"android.net"
] |
android.content; android.net;
| 473,391
|
public void testMultithreadedCreate() throws Exception {
Path dir = new Path(new Path(PRIMARY_URI), "/dir");
assert fs.mkdirs(dir);
final Path file = new Path(dir, "file");
fs.create(file).close();
final AtomicInteger cnt = new AtomicInteger();
final Collection<Integer> errs = new GridConcurrentHashSet<>(THREAD_CNT, 1.0f, THREAD_CNT);
final AtomicBoolean err = new AtomicBoolean();
|
void function() throws Exception { Path dir = new Path(new Path(PRIMARY_URI), "/dir"); assert fs.mkdirs(dir); final Path file = new Path(dir, "file"); fs.create(file).close(); final AtomicInteger cnt = new AtomicInteger(); final Collection<Integer> errs = new GridConcurrentHashSet<>(THREAD_CNT, 1.0f, THREAD_CNT); final AtomicBoolean err = new AtomicBoolean();
|
/**
* Ensure that when running in multithreaded mode only one create() operation succeed.
*
* @throws Exception If failed.
*/
|
Ensure that when running in multithreaded mode only one create() operation succeed
|
testMultithreadedCreate
|
{
"repo_name": "gargvish/ignite",
"path": "modules/hadoop/src/test/java/org/apache/ignite/igfs/IgniteHadoopFileSystemAbstractSelfTest.java",
"license": "apache-2.0",
"size": 78812
}
|
[
"java.util.Collection",
"java.util.concurrent.atomic.AtomicBoolean",
"java.util.concurrent.atomic.AtomicInteger",
"org.apache.hadoop.fs.Path",
"org.apache.ignite.internal.util.GridConcurrentHashSet"
] |
import java.util.Collection; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.hadoop.fs.Path; import org.apache.ignite.internal.util.GridConcurrentHashSet;
|
import java.util.*; import java.util.concurrent.atomic.*; import org.apache.hadoop.fs.*; import org.apache.ignite.internal.util.*;
|
[
"java.util",
"org.apache.hadoop",
"org.apache.ignite"
] |
java.util; org.apache.hadoop; org.apache.ignite;
| 383,242
|
public Set<Cache.Entry<K, V>> entrySet();
/**
* Gets set containing cache entries that belong to provided partition or {@code null}
|
Set<Cache.Entry<K, V>> function(); /** * Gets set containing cache entries that belong to provided partition or {@code null}
|
/**
* Gets set of all entries cached on this node. You can remove
* elements from this set, but you cannot add elements to this set.
* All removal operation will be reflected on the cache itself.
* <p>
* NOTE: this operation is not distributed and returns only the entries cached on this node.
*
* @return Entries that pass through key filter.
*/
|
Gets set of all entries cached on this node. You can remove elements from this set, but you cannot add elements to this set. All removal operation will be reflected on the cache itself.
|
entrySet
|
{
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java",
"license": "apache-2.0",
"size": 85622
}
|
[
"java.util.Set",
"javax.cache.Cache"
] |
import java.util.Set; import javax.cache.Cache;
|
import java.util.*; import javax.cache.*;
|
[
"java.util",
"javax.cache"
] |
java.util; javax.cache;
| 2,839,913
|
public static Value wrap(TObject data) {
return new Value(data);
}
|
static Value function(TObject data) { return new Value(data); }
|
/**
* Return a Value that is backed by {@code data}.
*
* @param data
* @return the Value
*/
|
Return a Value that is backed by data
|
wrap
|
{
"repo_name": "mAzurkovic/concourse",
"path": "concourse-server/src/main/java/org/cinchapi/concourse/server/model/Value.java",
"license": "apache-2.0",
"size": 9444
}
|
[
"org.cinchapi.concourse.thrift.TObject"
] |
import org.cinchapi.concourse.thrift.TObject;
|
import org.cinchapi.concourse.thrift.*;
|
[
"org.cinchapi.concourse"
] |
org.cinchapi.concourse;
| 2,734,911
|
BooleanWrapper unlockNodes(Set<String> urls);
|
BooleanWrapper unlockNodes(Set<String> urls);
|
/**
* Unlock nodes. The specified nodes become available to other users for computations.
* Real eligibility still depends on the Node state.
*
* Could be called only by node administrator, which is one of the following: rm admin,
* node source admin or node provider.
*
* @param urls is a set of nodes to be unlocked.
*
* @return {@code true} if all the nodes are unlocked with success, {@code false} otherwise.
*/
|
Unlock nodes. The specified nodes become available to other users for computations. Real eligibility still depends on the Node state. Could be called only by node administrator, which is one of the following: rm admin, node source admin or node provider
|
unlockNodes
|
{
"repo_name": "tobwiens/scheduling",
"path": "rm/rm-client/src/main/java/org/ow2/proactive/resourcemanager/frontend/ResourceManager.java",
"license": "agpl-3.0",
"size": 23500
}
|
[
"java.util.Set",
"org.objectweb.proactive.core.util.wrapper.BooleanWrapper"
] |
import java.util.Set; import org.objectweb.proactive.core.util.wrapper.BooleanWrapper;
|
import java.util.*; import org.objectweb.proactive.core.util.wrapper.*;
|
[
"java.util",
"org.objectweb.proactive"
] |
java.util; org.objectweb.proactive;
| 2,020,956
|
public static float constrainLessThan(
final float n,
final float m,
final @Nonnull String name)
throws ConstraintError
{
return (float) Constraints
.constrainLessThan((double) n, (double) m, name);
}
|
static float function( final float n, final float m, final @Nonnull String name) throws ConstraintError { return (float) Constraints .constrainLessThan((double) n, (double) m, name); }
|
/**
* Ensures the value <code>n</code> is less than the value <code>m</code>.
* The function throws {@link ConstraintError} iff this is not the case. The
* function returns <code>n</code>.
*
* @return <code>n</code>.
* @throws ConstraintError
* Iff <code>m >= n</code>.
*/
|
Ensures the value <code>n</code> is less than the value <code>m</code>. The function throws <code>ConstraintError</code> iff this is not the case. The function returns <code>n</code>
|
constrainLessThan
|
{
"repo_name": "io7m/jaux",
"path": "src/main/java/com/io7m/jaux/Constraints.java",
"license": "isc",
"size": 15793
}
|
[
"javax.annotation.Nonnull"
] |
import javax.annotation.Nonnull;
|
import javax.annotation.*;
|
[
"javax.annotation"
] |
javax.annotation;
| 1,868,003
|
private RemotableAttributeField createPeopleFlowIdField() {
String baseLookupUrl = LookupUtils.getBaseLookupUrl();
RemotableQuickFinder.Builder quickFinderBuilder =
RemotableQuickFinder.Builder.create(baseLookupUrl, PEOPLE_FLOW_BO_CLASS_NAME);
Map<String, String> lookup = new HashMap<String, String>();
lookup.put(ATTRIBUTE_FIELD_NAME, "id");
quickFinderBuilder.setLookupParameters(lookup);
Map<String,String> fieldConversions = new HashMap<String, String>();
fieldConversions.put("id", ATTRIBUTE_FIELD_NAME);
fieldConversions.put("name", NAME_ATTRIBUTE_FIELD);
quickFinderBuilder.setFieldConversions(fieldConversions);
RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create();
controlBuilder.setSize(Integer.valueOf(40));
controlBuilder.setWatermark("PeopleFlow ID");
RemotableAttributeLookupSettings.Builder lookupSettingsBuilder = RemotableAttributeLookupSettings.Builder.create();
lookupSettingsBuilder.setCaseSensitive(Boolean.TRUE);
lookupSettingsBuilder.setInCriteria(true);
lookupSettingsBuilder.setInResults(true);
lookupSettingsBuilder.setRanged(false);
RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(ATTRIBUTE_FIELD_NAME);
builder.setAttributeLookupSettings(lookupSettingsBuilder);
builder.setRequired(true);
builder.setDataType(DataType.STRING);
builder.setControl(controlBuilder);
builder.setLongLabel("PeopleFlow ID");
builder.setShortLabel("PeopleFlow ID");
builder.setMinLength(Integer.valueOf(1));
builder.setMaxLength(Integer.valueOf(40));
builder.setConstraintText("size 40");
builder.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(quickFinderBuilder));
return builder.build();
}
|
RemotableAttributeField function() { String baseLookupUrl = LookupUtils.getBaseLookupUrl(); RemotableQuickFinder.Builder quickFinderBuilder = RemotableQuickFinder.Builder.create(baseLookupUrl, PEOPLE_FLOW_BO_CLASS_NAME); Map<String, String> lookup = new HashMap<String, String>(); lookup.put(ATTRIBUTE_FIELD_NAME, "id"); quickFinderBuilder.setLookupParameters(lookup); Map<String,String> fieldConversions = new HashMap<String, String>(); fieldConversions.put("id", ATTRIBUTE_FIELD_NAME); fieldConversions.put("name", NAME_ATTRIBUTE_FIELD); quickFinderBuilder.setFieldConversions(fieldConversions); RemotableTextInput.Builder controlBuilder = RemotableTextInput.Builder.create(); controlBuilder.setSize(Integer.valueOf(40)); controlBuilder.setWatermark(STR); RemotableAttributeLookupSettings.Builder lookupSettingsBuilder = RemotableAttributeLookupSettings.Builder.create(); lookupSettingsBuilder.setCaseSensitive(Boolean.TRUE); lookupSettingsBuilder.setInCriteria(true); lookupSettingsBuilder.setInResults(true); lookupSettingsBuilder.setRanged(false); RemotableAttributeField.Builder builder = RemotableAttributeField.Builder.create(ATTRIBUTE_FIELD_NAME); builder.setAttributeLookupSettings(lookupSettingsBuilder); builder.setRequired(true); builder.setDataType(DataType.STRING); builder.setControl(controlBuilder); builder.setLongLabel(STR); builder.setShortLabel(STR); builder.setMinLength(Integer.valueOf(1)); builder.setMaxLength(Integer.valueOf(40)); builder.setConstraintText(STR); builder.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(quickFinderBuilder)); return builder.build(); }
|
/**
* Create the PeopleFlow Id input field
* @return RemotableAttributeField
*/
|
Create the PeopleFlow Id input field
|
createPeopleFlowIdField
|
{
"repo_name": "ricepanda/rice-git2",
"path": "rice-middleware/krms/impl/src/main/java/org/kuali/rice/krms/impl/peopleflow/PeopleFlowActionTypeService.java",
"license": "apache-2.0",
"size": 17456
}
|
[
"java.util.Collections",
"java.util.HashMap",
"java.util.Map",
"org.kuali.rice.core.api.data.DataType",
"org.kuali.rice.core.api.uif.RemotableAbstractWidget",
"org.kuali.rice.core.api.uif.RemotableAttributeField",
"org.kuali.rice.core.api.uif.RemotableAttributeLookupSettings",
"org.kuali.rice.core.api.uif.RemotableQuickFinder",
"org.kuali.rice.core.api.uif.RemotableTextInput",
"org.kuali.rice.krad.lookup.LookupUtils"
] |
import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.kuali.rice.core.api.data.DataType; import org.kuali.rice.core.api.uif.RemotableAbstractWidget; import org.kuali.rice.core.api.uif.RemotableAttributeField; import org.kuali.rice.core.api.uif.RemotableAttributeLookupSettings; import org.kuali.rice.core.api.uif.RemotableQuickFinder; import org.kuali.rice.core.api.uif.RemotableTextInput; import org.kuali.rice.krad.lookup.LookupUtils;
|
import java.util.*; import org.kuali.rice.core.api.data.*; import org.kuali.rice.core.api.uif.*; import org.kuali.rice.krad.lookup.*;
|
[
"java.util",
"org.kuali.rice"
] |
java.util; org.kuali.rice;
| 1,383,009
|
@Override
public synchronized List<FinalizedReplica> getFinalizedBlocksOnPersistentStorage(String bpid) {
ArrayList<FinalizedReplica> finalized =
new ArrayList<FinalizedReplica>(volumeMap.size(bpid));
for (ReplicaInfo b : volumeMap.replicas(bpid)) {
if(!b.getVolume().isTransientStorage() &&
b.getState() == ReplicaState.FINALIZED) {
finalized.add(new FinalizedReplica((FinalizedReplica)b));
}
}
return finalized;
}
|
synchronized List<FinalizedReplica> function(String bpid) { ArrayList<FinalizedReplica> finalized = new ArrayList<FinalizedReplica>(volumeMap.size(bpid)); for (ReplicaInfo b : volumeMap.replicas(bpid)) { if(!b.getVolume().isTransientStorage() && b.getState() == ReplicaState.FINALIZED) { finalized.add(new FinalizedReplica((FinalizedReplica)b)); } } return finalized; }
|
/**
* Get the list of finalized blocks from in-memory blockmap for a block pool.
*/
|
Get the list of finalized blocks from in-memory blockmap for a block pool
|
getFinalizedBlocksOnPersistentStorage
|
{
"repo_name": "f7753/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java",
"license": "apache-2.0",
"size": 113025
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hdfs.server.common.HdfsServerConstants",
"org.apache.hadoop.hdfs.server.datanode.FinalizedReplica",
"org.apache.hadoop.hdfs.server.datanode.ReplicaInfo"
] |
import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; import org.apache.hadoop.hdfs.server.datanode.FinalizedReplica; import org.apache.hadoop.hdfs.server.datanode.ReplicaInfo;
|
import java.util.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.datanode.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 767,840
|
public static RequestPostProcessor securityContext(SecurityContext securityContext) {
return new SecurityContextRequestPostProcessor(securityContext);
}
|
static RequestPostProcessor function(SecurityContext securityContext) { return new SecurityContextRequestPostProcessor(securityContext); }
|
/**
* Establish the specified {@link SecurityContext} to be used.
*
* <p>
* This works by associating the user to the {@link HttpServletRequest}. To
* associate the request to the {@link SecurityContextHolder} you need to
* ensure that the {@link SecurityContextPersistenceFilter} (i.e. Spring
* Security's FilterChainProxy will typically do this) is associated with
* the {@link MockMvc} instance.
* </p>
*/
|
Establish the specified <code>SecurityContext</code> to be used. This works by associating the user to the <code>HttpServletRequest</code>. To associate the request to the <code>SecurityContextHolder</code> you need to ensure that the <code>SecurityContextPersistenceFilter</code> (i.e. Spring Security's FilterChainProxy will typically do this) is associated with the <code>MockMvc</code> instance.
|
securityContext
|
{
"repo_name": "zhaoqin102/spring-security",
"path": "test/src/main/java/org/springframework/security/test/web/servlet/request/SecurityMockMvcRequestPostProcessors.java",
"license": "apache-2.0",
"size": 29306
}
|
[
"org.springframework.security.core.context.SecurityContext",
"org.springframework.test.web.servlet.request.RequestPostProcessor"
] |
import org.springframework.security.core.context.SecurityContext; import org.springframework.test.web.servlet.request.RequestPostProcessor;
|
import org.springframework.security.core.context.*; import org.springframework.test.web.servlet.request.*;
|
[
"org.springframework.security",
"org.springframework.test"
] |
org.springframework.security; org.springframework.test;
| 200,631
|
public String[] getUserRoles() throws BrokerManagerAdminException {
String[] roles;
QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance()
.getQueueManagerService();
try {
roles = queueManagerService.getBackendRoles();
} catch (QueueManagerException e) {
String errorMessage = e.getMessage();
log.error(errorMessage, e);
throw new BrokerManagerAdminException(errorMessage, e);
}
return roles;
}
/**
* Get all permission of the given queue name
*
* @param queueName Name of the queue
* @return Array of {@link org.wso2.carbon.andes.admin.internal.QueueRolePermission}
|
String[] function() throws BrokerManagerAdminException { String[] roles; QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance() .getQueueManagerService(); try { roles = queueManagerService.getBackendRoles(); } catch (QueueManagerException e) { String errorMessage = e.getMessage(); log.error(errorMessage, e); throw new BrokerManagerAdminException(errorMessage, e); } return roles; } /** * Get all permission of the given queue name * * @param queueName Name of the queue * @return Array of {@link org.wso2.carbon.andes.admin.internal.QueueRolePermission}
|
/**
* Get roles of the current logged user
* If user has admin role, then all available roles will be return
*
* @return Array of user roles.
* @throws BrokerManagerAdminException
*/
|
Get roles of the current logged user If user has admin role, then all available roles will be return
|
getUserRoles
|
{
"repo_name": "ThilankaBowala/carbon-business-messaging",
"path": "components/andes/org.wso2.carbon.andes.admin/src/main/java/org/wso2/carbon/andes/admin/AndesAdminService.java",
"license": "apache-2.0",
"size": 57298
}
|
[
"org.wso2.carbon.andes.admin.internal.Exception",
"org.wso2.carbon.andes.admin.internal.QueueRolePermission",
"org.wso2.carbon.andes.admin.util.AndesBrokerManagerAdminServiceDSHolder",
"org.wso2.carbon.andes.core.QueueManagerException",
"org.wso2.carbon.andes.core.QueueManagerService"
] |
import org.wso2.carbon.andes.admin.internal.Exception; import org.wso2.carbon.andes.admin.internal.QueueRolePermission; import org.wso2.carbon.andes.admin.util.AndesBrokerManagerAdminServiceDSHolder; import org.wso2.carbon.andes.core.QueueManagerException; import org.wso2.carbon.andes.core.QueueManagerService;
|
import org.wso2.carbon.andes.admin.internal.*; import org.wso2.carbon.andes.admin.util.*; import org.wso2.carbon.andes.core.*;
|
[
"org.wso2.carbon"
] |
org.wso2.carbon;
| 234,577
|
public static Long save(Connection conn, Flow flow) throws SQLException, ServletException {
// String sql = "INSERT INTO admin.flow " +
// "(name, flow_order, created_by, global_identifier_name) " +
// "VALUES (?,?,?,?)";
String sql = "INSERT INTO admin.flow " +
"(name, flow_order) " +
"VALUES (?,?)";
ArrayList values = new ArrayList();
values.add(flow.getName());
values.add(flow.getFlowOrder());
// values.add(flow.getCreatedBy());
// values.add(flow.getGlobalIdentifierName());
Long siteId = (Long) DatabaseUtils.create(conn, sql, values.toArray());
return siteId;
}
|
static Long function(Connection conn, Flow flow) throws SQLException, ServletException { String sql = STR + STR + STR; ArrayList values = new ArrayList(); values.add(flow.getName()); values.add(flow.getFlowOrder()); Long siteId = (Long) DatabaseUtils.create(conn, sql, values.toArray()); return siteId; }
|
/**
* Inserts a new flow
* @param conn
* @param site
* @return
* @throws SQLException
* @throws ServletException
*/
|
Inserts a new flow
|
save
|
{
"repo_name": "chrisekelley/zeprs",
"path": "src/zeprs/org/cidrz/webapp/dynasite/dao/FlowDAO.java",
"license": "apache-2.0",
"size": 3646
}
|
[
"java.sql.Connection",
"java.sql.SQLException",
"java.util.ArrayList",
"javax.servlet.ServletException",
"org.cidrz.webapp.dynasite.utils.DatabaseUtils",
"org.cidrz.webapp.dynasite.valueobject.Flow"
] |
import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import javax.servlet.ServletException; import org.cidrz.webapp.dynasite.utils.DatabaseUtils; import org.cidrz.webapp.dynasite.valueobject.Flow;
|
import java.sql.*; import java.util.*; import javax.servlet.*; import org.cidrz.webapp.dynasite.utils.*; import org.cidrz.webapp.dynasite.valueobject.*;
|
[
"java.sql",
"java.util",
"javax.servlet",
"org.cidrz.webapp"
] |
java.sql; java.util; javax.servlet; org.cidrz.webapp;
| 72,874
|
public boolean isWellDefined() {
List<TypeParameter> tps =
getDeclaration().getTypeParameters();
Type qt = getQualifyingType();
if (qt!=null &&
!qt.isWellDefined()) {
return false;
}
List<Type> tas = getTypeArgumentList();
for (int i=0; i<tps.size(); i++) {
Type at = tas.get(i);
TypeParameter tp = tps.get(i);
if ((!tp.isDefaulted() && at==null) ||
(at!=null && !at.isWellDefined())) {
return false;
}
}
return true;
}
|
boolean function() { List<TypeParameter> tps = getDeclaration().getTypeParameters(); Type qt = getQualifyingType(); if (qt!=null && !qt.isWellDefined()) { return false; } List<Type> tas = getTypeArgumentList(); for (int i=0; i<tps.size(); i++) { Type at = tas.get(i); TypeParameter tp = tps.get(i); if ((!tp.isDefaulted() && at==null) (at!=null && !at.isWellDefined())) { return false; } } return true; }
|
/**
* Is the type well-defined? Are any of its arguments
* garbage nulls?
*/
|
Is the type well-defined? Are any of its arguments garbage nulls
|
isWellDefined
|
{
"repo_name": "gijsleussink/ceylon",
"path": "model/src/com/redhat/ceylon/model/typechecker/model/Type.java",
"license": "apache-2.0",
"size": 157877
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 673,807
|
private void createLocale(String language) {
String lang = language.intern();
if (lang.length() == 0)
lang = LANGUAGE;
// Well known languages may be set with long names
if (lang == "russian")
lang = "ru";
else if (lang == "english")
lang = "en";
locale = new Locale(lang, "");
}
|
void function(String language) { String lang = language.intern(); if (lang.length() == 0) lang = LANGUAGE; if (lang == STR) lang = "ru"; else if (lang == STR) lang = "en"; locale = new Locale(lang, ""); }
|
/**
* Creates locale object for internal purpose
*/
|
Creates locale object for internal purpose
|
createLocale
|
{
"repo_name": "mozartframework/cms",
"path": "src/com/mozartframework/xml/newt/Calendar.java",
"license": "gpl-3.0",
"size": 15046
}
|
[
"java.util.Locale"
] |
import java.util.Locale;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 689,256
|
public com.google.common.util.concurrent.ListenableFuture<se.umu.cs.ads.fildil.proto.autogen.PeerInfo> poll(
se.umu.cs.ads.fildil.proto.autogen.PeerInfo request) {
return futureUnaryCall(
getChannel().newCall(METHOD_POLL, getCallOptions()), request);
}
}
private static final int METHODID_REQUEST_CHUNK = 0;
private static final int METHODID_POLL = 1;
private static class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final StreamerImplBase serviceImpl;
private final int methodId;
public MethodHandlers(StreamerImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
|
com.google.common.util.concurrent.ListenableFuture<se.umu.cs.ads.fildil.proto.autogen.PeerInfo> function( se.umu.cs.ads.fildil.proto.autogen.PeerInfo request) { return futureUnaryCall( getChannel().newCall(METHOD_POLL, getCallOptions()), request); } } private static final int METHODID_REQUEST_CHUNK = 0; private static final int METHODID_POLL = 1; private static class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final StreamerImplBase serviceImpl; private final int methodId; public MethodHandlers(StreamerImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; }
|
/**
* <pre>
*Exchange peer information
* </pre>
*/
|
<code> Exchange peer information </code>
|
poll
|
{
"repo_name": "Eeemil/fildil",
"path": "src/main/se/umu/cs/ads/fildil/proto/autogen/StreamerGrpc.java",
"license": "mit",
"size": 10280
}
|
[
"io.grpc.stub.ClientCalls"
] |
import io.grpc.stub.ClientCalls;
|
import io.grpc.stub.*;
|
[
"io.grpc.stub"
] |
io.grpc.stub;
| 2,743,426
|
private void buildXmlNameMaps( ) throws MetaDataException
{
// Build the element metadata.
// for extension element, the tag name is always "extended-item".
Iterator<IElementDefn> iter = elementNameMap.values( ).iterator( );
while ( iter.hasNext( ) )
{
ElementDefn tmpDefn = (ElementDefn) iter.next( );
String tmpXmlName = tmpDefn.getXmlName( );
// TODO: also check the validation of the element XML name and
// whether it is an extended item. If it is ROM elements, throw
// exception.Otherwise, just ignore extension XML name.
elementXmlNameMap.put( tmpXmlName, tmpDefn );
}
}
|
void function( ) throws MetaDataException { Iterator<IElementDefn> iter = elementNameMap.values( ).iterator( ); while ( iter.hasNext( ) ) { ElementDefn tmpDefn = (ElementDefn) iter.next( ); String tmpXmlName = tmpDefn.getXmlName( ); elementXmlNameMap.put( tmpXmlName, tmpDefn ); } }
|
/**
* Creates a map. The key is the element xml-name. The value is the element
* definition.
*/
|
Creates a map. The key is the element xml-name. The value is the element definition
|
buildXmlNameMaps
|
{
"repo_name": "Charling-Huang/birt",
"path": "model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/metadata/MetaDataDictionary.java",
"license": "epl-1.0",
"size": 35900
}
|
[
"java.util.Iterator",
"org.eclipse.birt.report.model.api.metadata.IElementDefn"
] |
import java.util.Iterator; import org.eclipse.birt.report.model.api.metadata.IElementDefn;
|
import java.util.*; import org.eclipse.birt.report.model.api.metadata.*;
|
[
"java.util",
"org.eclipse.birt"
] |
java.util; org.eclipse.birt;
| 394,740
|
public JSONArray put(Map<String, Object> value) {
this.put(new JSONObject(value));
return this;
}
|
JSONArray function(Map<String, Object> value) { this.put(new JSONObject(value)); return this; }
|
/**
* Put a value in the JSONArray, where the value will be a JSONObject which
* is produced from a Map.
*
* @param value A Map value.
* @return this.
*/
|
Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map
|
put
|
{
"repo_name": "Palehors68/Botnak",
"path": "src/main/java/lib/JSON/JSONArray.java",
"license": "mit",
"size": 29621
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,551,487
|
public static byte[] toBytes(BigDecimal val) {
byte[] valueBytes = val.unscaledValue().toByteArray();
byte[] result = new byte[valueBytes.length + SIZEOF_INT];
int offset = putInt(result, 0, val.scale());
putBytes(result, offset, valueBytes, 0, valueBytes.length);
return result;
}
|
static byte[] function(BigDecimal val) { byte[] valueBytes = val.unscaledValue().toByteArray(); byte[] result = new byte[valueBytes.length + SIZEOF_INT]; int offset = putInt(result, 0, val.scale()); putBytes(result, offset, valueBytes, 0, valueBytes.length); return result; }
|
/**
* Convert a BigDecimal value to a byte array
*
* @param val
* @return the byte array
*/
|
Convert a BigDecimal value to a byte array
|
toBytes
|
{
"repo_name": "juwi/hbase",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java",
"license": "apache-2.0",
"size": 81338
}
|
[
"java.math.BigDecimal"
] |
import java.math.BigDecimal;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 1,459,209
|
@Test
public void testT1RV8D3_T1LV4D3() {
test_id = getTestId("T1RV8D3", "T1LV4D3", "80");
String src = selectTRVD("T1RV8D3");
String dest = selectTLVD("T1LV4D3");
String result = ".";
try {
result = TRVD_TLVD_Action(src, dest);
} catch (RecognitionException e) {
e.printStackTrace();
} catch (TokenStreamException e) {
e.printStackTrace();
}
assertTrue(Success, checkResult_Success(src, dest, result));
GraphicalEditor editor = getActiveEditor();
if (editor != null) {
validateOrGenerateResults(editor, generateResults);
}
}
|
void function() { test_id = getTestId(STR, STR, "80"); String src = selectTRVD(STR); String dest = selectTLVD(STR); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(Success, checkResult_Success(src, dest, result)); GraphicalEditor editor = getActiveEditor(); if (editor != null) { validateOrGenerateResults(editor, generateResults); } }
|
/**
* Perform the test for the given matrix column (T1RV8D3) and row (T1LV4D3).
*
*/
|
Perform the test for the given matrix column (T1RV8D3) and row (T1LV4D3)
|
testT1RV8D3_T1LV4D3
|
{
"repo_name": "jason-rhodes/bridgepoint",
"path": "src/org.xtuml.bp.als.oal.test/src/org/xtuml/bp/als/oal/test/SingleDimensionFixedArrayAssigmentTest_16_Generics.java",
"license": "apache-2.0",
"size": 186177
}
|
[
"org.xtuml.bp.ui.graphics.editor.GraphicalEditor"
] |
import org.xtuml.bp.ui.graphics.editor.GraphicalEditor;
|
import org.xtuml.bp.ui.graphics.editor.*;
|
[
"org.xtuml.bp"
] |
org.xtuml.bp;
| 572,926
|
public void setConfigSource(ConfigSource configSource) {
this._configSource = configSource;
}
|
void function(ConfigSource configSource) { this._configSource = configSource; }
|
/**
* Sets the config source
* @param configSource the new value of the property
*/
|
Sets the config source
|
setConfigSource
|
{
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-Web/src/main/java/com/opengamma/web/historicaltimeseries/WebHistoricalTimeSeriesData.java",
"license": "apache-2.0",
"size": 17835
}
|
[
"com.opengamma.core.config.ConfigSource"
] |
import com.opengamma.core.config.ConfigSource;
|
import com.opengamma.core.config.*;
|
[
"com.opengamma.core"
] |
com.opengamma.core;
| 920,981
|
public ItemFile getById(Long id, boolean lock) {
return hbCrudDAO.getById(id, lock);
}
|
ItemFile function(Long id, boolean lock) { return hbCrudDAO.getById(id, lock); }
|
/**
* Get a item file by id.
*
* @see edu.ur.dao.CrudDAO#getById(java.lang.Long, boolean)
*/
|
Get a item file by id
|
getById
|
{
"repo_name": "nate-rcl/irplus",
"path": "ir_hibernate/src/edu/ur/hibernate/ir/item/db/HbItemFileDAO.java",
"license": "apache-2.0",
"size": 3290
}
|
[
"edu.ur.ir.item.ItemFile"
] |
import edu.ur.ir.item.ItemFile;
|
import edu.ur.ir.item.*;
|
[
"edu.ur.ir"
] |
edu.ur.ir;
| 866,835
|
Collection<String> getStatus();
|
Collection<String> getStatus();
|
/**
* Returns the full status of the MPD server as a <CODE>Collection</CODE> of Strings.
*
* @return the desired status information
*/
|
Returns the full status of the MPD server as a <code>Collection</code> of Strings
|
getStatus
|
{
"repo_name": "finnyb/javampd",
"path": "src/main/java/org/bff/javampd/server/ServerStatus.java",
"license": "gpl-2.0",
"size": 4939
}
|
[
"java.util.Collection"
] |
import java.util.Collection;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,348,611
|
private Response upsert(String clientId, ConsentRepresentation consent) {
checkAccountApiEnabled();
auth.requireOneOf(AccountRoles.MANAGE_ACCOUNT, AccountRoles.MANAGE_CONSENT);
event.event(EventType.GRANT_CONSENT);
ClientModel client = realm.getClientByClientId(clientId);
if (client == null) {
event.event(EventType.GRANT_CONSENT_ERROR);
String msg = String.format("No client with clientId: %s found.", clientId);
event.error(msg);
return Cors.add(request, Response.status(Response.Status.NOT_FOUND).entity(msg)).build();
}
try {
UserConsentModel grantedConsent = createConsent(client, consent);
if (session.users().getConsentByClient(realm, user.getId(), client.getId()) == null) {
session.users().addConsent(realm, user.getId(), grantedConsent);
} else {
session.users().updateConsent(realm, user.getId(), grantedConsent);
}
event.success();
grantedConsent = session.users().getConsentByClient(realm, user.getId(), client.getId());
return Cors.add(request, Response.ok(modelToRepresentation(grantedConsent))).build();
} catch (IllegalArgumentException e) {
return Cors.add(request, Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage())).build();
}
}
|
Response function(String clientId, ConsentRepresentation consent) { checkAccountApiEnabled(); auth.requireOneOf(AccountRoles.MANAGE_ACCOUNT, AccountRoles.MANAGE_CONSENT); event.event(EventType.GRANT_CONSENT); ClientModel client = realm.getClientByClientId(clientId); if (client == null) { event.event(EventType.GRANT_CONSENT_ERROR); String msg = String.format(STR, clientId); event.error(msg); return Cors.add(request, Response.status(Response.Status.NOT_FOUND).entity(msg)).build(); } try { UserConsentModel grantedConsent = createConsent(client, consent); if (session.users().getConsentByClient(realm, user.getId(), client.getId()) == null) { session.users().addConsent(realm, user.getId(), grantedConsent); } else { session.users().updateConsent(realm, user.getId(), grantedConsent); } event.success(); grantedConsent = session.users().getConsentByClient(realm, user.getId(), client.getId()); return Cors.add(request, Response.ok(modelToRepresentation(grantedConsent))).build(); } catch (IllegalArgumentException e) { return Cors.add(request, Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage())).build(); } }
|
/**
* Creates or updates the consent of the given, requested consent for
* the client with the given client id. Returns the appropriate REST response.
*
* @param clientId client id to set a consent for
* @param consent requested consent for the client
* @return response to return to the caller
*/
|
Creates or updates the consent of the given, requested consent for the client with the given client id. Returns the appropriate REST response
|
upsert
|
{
"repo_name": "mhajas/keycloak",
"path": "services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java",
"license": "apache-2.0",
"size": 22746
}
|
[
"javax.ws.rs.core.Response",
"org.keycloak.events.EventType",
"org.keycloak.models.AccountRoles",
"org.keycloak.models.ClientModel",
"org.keycloak.models.UserConsentModel",
"org.keycloak.representations.account.ConsentRepresentation",
"org.keycloak.services.resources.Cors"
] |
import javax.ws.rs.core.Response; import org.keycloak.events.EventType; import org.keycloak.models.AccountRoles; import org.keycloak.models.ClientModel; import org.keycloak.models.UserConsentModel; import org.keycloak.representations.account.ConsentRepresentation; import org.keycloak.services.resources.Cors;
|
import javax.ws.rs.core.*; import org.keycloak.events.*; import org.keycloak.models.*; import org.keycloak.representations.account.*; import org.keycloak.services.resources.*;
|
[
"javax.ws",
"org.keycloak.events",
"org.keycloak.models",
"org.keycloak.representations",
"org.keycloak.services"
] |
javax.ws; org.keycloak.events; org.keycloak.models; org.keycloak.representations; org.keycloak.services;
| 872,777
|
MultivariateFunction f = new MultivariateFunction() {
|
MultivariateFunction f = new MultivariateFunction() {
|
/**
* Test of interpolator for a plane.
* <p>
* y = 2 x<sub>1</sub> - 3 x<sub>2</sub> + 5
*/
|
Test of interpolator for a plane. y = 2 x1 - 3 x2 + 5
|
testLinearFunction2D
|
{
"repo_name": "tknandu/CommonsMath_Modifed",
"path": "math (trunk)/src/test/java/org/apache/commons/math3/analysis/interpolation/MicrosphereInterpolatorTest.java",
"license": "apache-2.0",
"size": 4464
}
|
[
"org.apache.commons.math3.analysis.MultivariateFunction"
] |
import org.apache.commons.math3.analysis.MultivariateFunction;
|
import org.apache.commons.math3.analysis.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 2,281,913
|
private String getPropertyForGetter(String getterName) {
if (getterName == null || getterName.length() == 0) return null;
if (getterName.startsWith("get")) {
String prop = getterName.substring(3);
return MetaClassHelper.convertPropertyName(prop);
}
if (getterName.startsWith("is")) {
String prop = getterName.substring(2);
return MetaClassHelper.convertPropertyName(prop);
}
return null;
}
|
String function(String getterName) { if (getterName == null getterName.length() == 0) return null; if (getterName.startsWith("get")) { String prop = getterName.substring(3); return MetaClassHelper.convertPropertyName(prop); } if (getterName.startsWith("is")) { String prop = getterName.substring(2); return MetaClassHelper.convertPropertyName(prop); } return null; }
|
/**
* Returns a property name equivalent for the given getter name or null if it is not a getter
*
* @param getterName The getter name
* @return The property name equivalent
*/
|
Returns a property name equivalent for the given getter name or null if it is not a getter
|
getPropertyForGetter
|
{
"repo_name": "paulk-asert/groovy",
"path": "src/main/java/groovy/lang/ExpandoMetaClass.java",
"license": "apache-2.0",
"size": 60706
}
|
[
"org.codehaus.groovy.runtime.MetaClassHelper"
] |
import org.codehaus.groovy.runtime.MetaClassHelper;
|
import org.codehaus.groovy.runtime.*;
|
[
"org.codehaus.groovy"
] |
org.codehaus.groovy;
| 2,841,658
|
@POST
@Path("/order/delete.json")
AcxOrder cancelOrder(
@FormParam("access_key") String accessKey,
@FormParam("tonce") long tonce,
@FormParam("id") String id,
@FormParam("signature") ParamsDigest signature)
throws IOException;
|
@Path(STR) AcxOrder cancelOrder( @FormParam(STR) String accessKey, @FormParam("tonce") long tonce, @FormParam("id") String id, @FormParam(STR) ParamsDigest signature) throws IOException;
|
/**
* Cancel an order.
*
* @param accessKey Access key.
* @param tonce Tonce is an integer represents the milliseconds elapsed since Unix epoch.
* @param id Unique order id.
* @param signature The signature of your request payload, generated using your secret key.
*/
|
Cancel an order
|
cancelOrder
|
{
"repo_name": "npomfret/XChange",
"path": "xchange-acx/src/main/java/org/known/xchange/acx/AcxApi.java",
"license": "mit",
"size": 5744
}
|
[
"java.io.IOException",
"javax.ws.rs.FormParam",
"javax.ws.rs.Path",
"org.known.xchange.acx.dto.marketdata.AcxOrder",
"si.mazi.rescu.ParamsDigest"
] |
import java.io.IOException; import javax.ws.rs.FormParam; import javax.ws.rs.Path; import org.known.xchange.acx.dto.marketdata.AcxOrder; import si.mazi.rescu.ParamsDigest;
|
import java.io.*; import javax.ws.rs.*; import org.known.xchange.acx.dto.marketdata.*; import si.mazi.rescu.*;
|
[
"java.io",
"javax.ws",
"org.known.xchange",
"si.mazi.rescu"
] |
java.io; javax.ws; org.known.xchange; si.mazi.rescu;
| 2,746,935
|
public NiFiPropertyDescriptorTransform getPropertyDescriptorTransform() {
return propertyDescriptorTransform;
}
|
NiFiPropertyDescriptorTransform function() { return propertyDescriptorTransform; }
|
/**
* Gets a transform for converting {@link NiFiPropertyDescriptor} objects to {@link PropertyDescriptorDTO}.
*
* @return the transform
*/
|
Gets a transform for converting <code>NiFiPropertyDescriptor</code> objects to <code>PropertyDescriptorDTO</code>
|
getPropertyDescriptorTransform
|
{
"repo_name": "claudiu-stanciu/kylo",
"path": "integrations/nifi/nifi-rest/nifi-rest-client/nifi-rest-client-api/src/main/java/com/thinkbiganalytics/nifi/rest/client/LegacyNifiRestClient.java",
"license": "apache-2.0",
"size": 64865
}
|
[
"com.thinkbiganalytics.nifi.rest.model.NiFiPropertyDescriptorTransform"
] |
import com.thinkbiganalytics.nifi.rest.model.NiFiPropertyDescriptorTransform;
|
import com.thinkbiganalytics.nifi.rest.model.*;
|
[
"com.thinkbiganalytics.nifi"
] |
com.thinkbiganalytics.nifi;
| 967,556
|
Predicate<DataHolder> getTargets();
|
Predicate<DataHolder> getTargets();
|
/**
* Gets a predicate to decide if a given {@link DataHolder} can have
* this attribute applied to it.
*
* @return A predicate to decide if this attribute can be applied
*/
|
Gets a predicate to decide if a given <code>DataHolder</code> can have this attribute applied to it
|
getTargets
|
{
"repo_name": "joshgarde/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/attribute/Attribute.java",
"license": "mit",
"size": 2357
}
|
[
"com.google.common.base.Predicate",
"org.spongepowered.api.data.DataHolder"
] |
import com.google.common.base.Predicate; import org.spongepowered.api.data.DataHolder;
|
import com.google.common.base.*; import org.spongepowered.api.data.*;
|
[
"com.google.common",
"org.spongepowered.api"
] |
com.google.common; org.spongepowered.api;
| 18,363
|
public void setMenuCellRenderer(ListCellRenderer menuCellRenderer) {
menuBar.setMenuCellRenderer(menuCellRenderer);
}
|
void function(ListCellRenderer menuCellRenderer) { menuBar.setMenuCellRenderer(menuCellRenderer); }
|
/**
* Determine the cell renderer used to render menu elements for themeing the
* look of the menu options
*
* @param menuCellRenderer the menu cell renderer
*/
|
Determine the cell renderer used to render menu elements for themeing the look of the menu options
|
setMenuCellRenderer
|
{
"repo_name": "angelorohit/lwuitstripped",
"path": "src/com/sun/lwuit/Form.java",
"license": "gpl-2.0",
"size": 105261
}
|
[
"com.sun.lwuit.list.ListCellRenderer"
] |
import com.sun.lwuit.list.ListCellRenderer;
|
import com.sun.lwuit.list.*;
|
[
"com.sun.lwuit"
] |
com.sun.lwuit;
| 695,895
|
public Registration addItemClickListener(ItemClickListener<T> listener) {
return addListener(ItemClick.class, listener, ITEM_CLICK_METHOD);
}
/**
* Sets the tree's selection mode.
* <p>
* The built-in selection modes are:
* <ul>
* <li>{@link SelectionMode#SINGLE} <b>the default model</b></li>
* <li>{@link SelectionMode#MULTI}</li>
* <li>{@link SelectionMode#NONE} preventing selection</li>
* </ul>
*
* @param selectionMode
* the selection mode to switch to, not {@code null}
|
Registration function(ItemClickListener<T> listener) { return addListener(ItemClick.class, listener, ITEM_CLICK_METHOD); } /** * Sets the tree's selection mode. * <p> * The built-in selection modes are: * <ul> * <li>{@link SelectionMode#SINGLE} <b>the default model</b></li> * <li>{@link SelectionMode#MULTI}</li> * <li>{@link SelectionMode#NONE} preventing selection</li> * </ul> * * @param selectionMode * the selection mode to switch to, not {@code null}
|
/**
* Adds an item click listener. The listener is called when an item of this
* {@code Tree} is clicked.
*
* @param listener
* the item click listener, not null
* @return a registration for the listener
*/
|
Adds an item click listener. The listener is called when an item of this Tree is clicked
|
addItemClickListener
|
{
"repo_name": "peterl1084/framework",
"path": "server/src/main/java/com/vaadin/ui/Tree.java",
"license": "apache-2.0",
"size": 21884
}
|
[
"com.vaadin.shared.Registration",
"com.vaadin.ui.Grid"
] |
import com.vaadin.shared.Registration; import com.vaadin.ui.Grid;
|
import com.vaadin.shared.*; import com.vaadin.ui.*;
|
[
"com.vaadin.shared",
"com.vaadin.ui"
] |
com.vaadin.shared; com.vaadin.ui;
| 1,421,069
|
public void launchEditPage(CompromisedCredential credential) {
Bundle fragmentArgs = new Bundle();
fragmentArgs.putParcelable(
PasswordCheckEditFragmentView.EXTRA_COMPROMISED_CREDENTIAL, credential);
mSettingsLauncher.launchSettingsActivity(
mContext, PasswordCheckEditFragmentView.class, fragmentArgs);
}
|
void function(CompromisedCredential credential) { Bundle fragmentArgs = new Bundle(); fragmentArgs.putParcelable( PasswordCheckEditFragmentView.EXTRA_COMPROMISED_CREDENTIAL, credential); mSettingsLauncher.launchSettingsActivity( mContext, PasswordCheckEditFragmentView.class, fragmentArgs); }
|
/**
* Launches a settings fragment to edit the given credential.
* @param credential A {@link CompromisedCredential} to change.
*/
|
Launches a settings fragment to edit the given credential
|
launchEditPage
|
{
"repo_name": "scheib/chromium",
"path": "chrome/browser/password_check/android/internal/java/src/org/chromium/chrome/browser/password_check/helper/PasswordCheckChangePasswordHelper.java",
"license": "bsd-3-clause",
"size": 7385
}
|
[
"android.os.Bundle",
"org.chromium.chrome.browser.password_check.CompromisedCredential",
"org.chromium.chrome.browser.password_check.PasswordCheckEditFragmentView"
] |
import android.os.Bundle; import org.chromium.chrome.browser.password_check.CompromisedCredential; import org.chromium.chrome.browser.password_check.PasswordCheckEditFragmentView;
|
import android.os.*; import org.chromium.chrome.browser.password_check.*;
|
[
"android.os",
"org.chromium.chrome"
] |
android.os; org.chromium.chrome;
| 730,221
|
EOperation getEcosystem__GetBrickd__String_int();
|
EOperation getEcosystem__GetBrickd__String_int();
|
/**
* Returns the meta object for the '{@link org.openhab.binding.tinkerforge.internal.model.Ecosystem#getBrickd(java.lang.String, int) <em>Get Brickd</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the '<em>Get Brickd</em>' operation.
* @see org.openhab.binding.tinkerforge.internal.model.Ecosystem#getBrickd(java.lang.String, int)
* @generated
*/
|
Returns the meta object for the '<code>org.openhab.binding.tinkerforge.internal.model.Ecosystem#getBrickd(java.lang.String, int) Get Brickd</code>' operation.
|
getEcosystem__GetBrickd__String_int
|
{
"repo_name": "gregfinley/openhab",
"path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java",
"license": "epl-1.0",
"size": 665067
}
|
[
"org.eclipse.emf.ecore.EOperation"
] |
import org.eclipse.emf.ecore.EOperation;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 63,856
|
public BlobDownloadHeaders setDateProperty(OffsetDateTime dateProperty) {
internalHeaders.setDateProperty(dateProperty);
return this;
}
|
BlobDownloadHeaders function(OffsetDateTime dateProperty) { internalHeaders.setDateProperty(dateProperty); return this; }
|
/**
* Set the dateProperty property: UTC date/time value generated by the service that indicates the time at which the
* response was initiated.
*
* @param dateProperty the dateProperty value to set.
* @return the BlobDownloadHeaders object itself.
*/
|
Set the dateProperty property: UTC date/time value generated by the service that indicates the time at which the response was initiated
|
setDateProperty
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobDownloadHeaders.java",
"license": "mit",
"size": 40344
}
|
[
"java.time.OffsetDateTime"
] |
import java.time.OffsetDateTime;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 2,542,893
|
@Test
public void backCompatWithJavaSDKOlderThan0110() {
// Arrange
final String messageTrackingValue = UUID.randomUUID().toString();
// until version 0.10.0 - we used to have Properties as HashMap<String,String>
// This specific combination is intended to test the back compat - with the new Properties type as HashMap<String, Object>
final HashMap<String, Object> applicationProperties = new HashMap<>();
applicationProperties.put("firstProperty", "value1");
applicationProperties.put("intProperty", "3");
// We want to ensure that we fetch the event data corresponding to this test and not some other test case.
applicationProperties.put(MESSAGE_TRACKING_ID, messageTrackingValue);
final Map<Symbol, Object> systemProperties = new HashMap<>();
systemProperties.put(getSymbol(OFFSET_ANNOTATION_NAME), "100");
systemProperties.put(getSymbol(ENQUEUED_TIME_UTC_ANNOTATION_NAME), Date.from(Instant.now()));
systemProperties.put(getSymbol(SEQUENCE_NUMBER_ANNOTATION_NAME), 15L);
final Message message = Proton.message();
message.setApplicationProperties(new ApplicationProperties(applicationProperties));
message.setBody(new Data(Binary.create(ByteBuffer.wrap(PAYLOAD.getBytes(UTF_8)))));
message.setMessageAnnotations(new MessageAnnotations(systemProperties));
final EventData eventData = serializer.deserialize(message, EventData.class);
// Act & Assert
StepVerifier.create(consumer.receiveFromPartition(PARTITION_ID, EventPosition.latest())
.filter(received -> isMatchingEvent(received, messageTrackingValue)).take(1))
.then(() -> producer.send(eventData, sendOptions).block(TIMEOUT))
.assertNext(event -> validateAmqpProperties(applicationProperties, event.getData()))
.expectComplete()
.verify(Duration.ofSeconds(45));
}
|
void function() { final String messageTrackingValue = UUID.randomUUID().toString(); final HashMap<String, Object> applicationProperties = new HashMap<>(); applicationProperties.put(STR, STR); applicationProperties.put(STR, "3"); applicationProperties.put(MESSAGE_TRACKING_ID, messageTrackingValue); final Map<Symbol, Object> systemProperties = new HashMap<>(); systemProperties.put(getSymbol(OFFSET_ANNOTATION_NAME), "100"); systemProperties.put(getSymbol(ENQUEUED_TIME_UTC_ANNOTATION_NAME), Date.from(Instant.now())); systemProperties.put(getSymbol(SEQUENCE_NUMBER_ANNOTATION_NAME), 15L); final Message message = Proton.message(); message.setApplicationProperties(new ApplicationProperties(applicationProperties)); message.setBody(new Data(Binary.create(ByteBuffer.wrap(PAYLOAD.getBytes(UTF_8))))); message.setMessageAnnotations(new MessageAnnotations(systemProperties)); final EventData eventData = serializer.deserialize(message, EventData.class); StepVerifier.create(consumer.receiveFromPartition(PARTITION_ID, EventPosition.latest()) .filter(received -> isMatchingEvent(received, messageTrackingValue)).take(1)) .then(() -> producer.send(eventData, sendOptions).block(TIMEOUT)) .assertNext(event -> validateAmqpProperties(applicationProperties, event.getData())) .expectComplete() .verify(Duration.ofSeconds(45)); }
|
/**
* Verifies test work with SDK versions before 0.11.0.
*/
|
Verifies test work with SDK versions before 0.11.0
|
backCompatWithJavaSDKOlderThan0110
|
{
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/BackCompatTest.java",
"license": "mit",
"size": 5094
}
|
[
"com.azure.messaging.eventhubs.TestUtils",
"com.azure.messaging.eventhubs.models.EventPosition",
"java.nio.ByteBuffer",
"java.time.Duration",
"java.time.Instant",
"java.util.Date",
"java.util.HashMap",
"java.util.Map",
"java.util.UUID",
"org.apache.qpid.proton.Proton",
"org.apache.qpid.proton.amqp.Binary",
"org.apache.qpid.proton.amqp.Symbol",
"org.apache.qpid.proton.amqp.messaging.ApplicationProperties",
"org.apache.qpid.proton.amqp.messaging.Data",
"org.apache.qpid.proton.amqp.messaging.MessageAnnotations",
"org.apache.qpid.proton.message.Message"
] |
import com.azure.messaging.eventhubs.TestUtils; import com.azure.messaging.eventhubs.models.EventPosition; import java.nio.ByteBuffer; import java.time.Duration; import java.time.Instant; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.qpid.proton.Proton; import org.apache.qpid.proton.amqp.Binary; import org.apache.qpid.proton.amqp.Symbol; import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; import org.apache.qpid.proton.amqp.messaging.Data; import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; import org.apache.qpid.proton.message.Message;
|
import com.azure.messaging.eventhubs.*; import com.azure.messaging.eventhubs.models.*; import java.nio.*; import java.time.*; import java.util.*; import org.apache.qpid.proton.*; import org.apache.qpid.proton.amqp.*; import org.apache.qpid.proton.amqp.messaging.*; import org.apache.qpid.proton.message.*;
|
[
"com.azure.messaging",
"java.nio",
"java.time",
"java.util",
"org.apache.qpid"
] |
com.azure.messaging; java.nio; java.time; java.util; org.apache.qpid;
| 120,927
|
public Collection<? extends BlockStoragePolicySpi> getAllStoragePolicies()
throws IOException {
throw new UnsupportedOperationException(getClass().getSimpleName()
+ " doesn't support getAllStoragePolicies");
}
// making it volatile to be able to do a double checked locking
private volatile static boolean FILE_SYSTEMS_LOADED = false;
private static final Map<String, Class<? extends FileSystem>>
SERVICE_FILE_SYSTEMS = new HashMap<String, Class<? extends FileSystem>>();
|
Collection<? extends BlockStoragePolicySpi> function() throws IOException { throw new UnsupportedOperationException(getClass().getSimpleName() + STR); } private volatile static boolean FILE_SYSTEMS_LOADED = false; private static final Map<String, Class<? extends FileSystem>> SERVICE_FILE_SYSTEMS = new HashMap<String, Class<? extends FileSystem>>();
|
/**
* Retrieve all the storage policies supported by this file system.
*
* @return all storage policies supported by this filesystem.
* @throws IOException
*/
|
Retrieve all the storage policies supported by this file system
|
getAllStoragePolicies
|
{
"repo_name": "ouyangjie/hadoop",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java",
"license": "apache-2.0",
"size": 116983
}
|
[
"java.io.IOException",
"java.util.Collection",
"java.util.HashMap",
"java.util.Map"
] |
import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.Map;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,213,149
|
public Builder setContentIntent(PendingIntent intent) {
mContentIntent = intent;
return this;
}
|
Builder function(PendingIntent intent) { mContentIntent = intent; return this; }
|
/**
* Supply a {@link PendingIntent} to send when the notification is clicked.
* If you do not supply an intent, you can now add PendingIntents to individual
* views to be launched when clicked by calling {@link RemoteViews#setOnClickPendingIntent
* RemoteViews.setOnClickPendingIntent(int,PendingIntent)}. Be sure to
* read {@link Notification#contentIntent Notification.contentIntent} for
* how to correctly use this.
*/
|
Supply a <code>PendingIntent</code> to send when the notification is clicked. If you do not supply an intent, you can now add PendingIntents to individual views to be launched when clicked by calling <code>RemoteViews#setOnClickPendingIntent RemoteViews.setOnClickPendingIntent(int,PendingIntent)</code>. Be sure to read <code>Notification#contentIntent Notification.contentIntent</code> for how to correctly use this
|
setContentIntent
|
{
"repo_name": "takuji31/android-app-base",
"path": "libs-src/support/android/support/v4/app/NotificationCompat.java",
"license": "apache-2.0",
"size": 27860
}
|
[
"android.app.PendingIntent"
] |
import android.app.PendingIntent;
|
import android.app.*;
|
[
"android.app"
] |
android.app;
| 884,277
|
public List<String> getCampusCodes(String attributeName, List<String> values);
|
List<String> function(String attributeName, List<String> values);
|
/**
* Gets the campus codes by the given given attribute values
*
* @param attributeName
* @param values
* @return
*/
|
Gets the campus codes by the given given attribute values
|
getCampusCodes
|
{
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/endow/dataaccess/KemidBenefittingOrganizationDao.java",
"license": "apache-2.0",
"size": 2757
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 293,546
|
@ServiceMethod(returns = ReturnType.SINGLE)
RemediationInner getAtManagementGroup(String managementGroupId, String remediationName);
|
@ServiceMethod(returns = ReturnType.SINGLE) RemediationInner getAtManagementGroup(String managementGroupId, String remediationName);
|
/**
* Gets an existing remediation at management group scope.
*
* @param managementGroupId Management group ID.
* @param remediationName The name of the remediation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return an existing remediation at management group scope.
*/
|
Gets an existing remediation at management group scope
|
getAtManagementGroup
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/policyinsights/azure-resourcemanager-policyinsights/src/main/java/com/azure/resourcemanager/policyinsights/fluent/RemediationsClient.java",
"license": "mit",
"size": 36342
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.policyinsights.fluent.models.RemediationInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.policyinsights.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 1,896,190
|
private List<RichAttribute> getMemberResourceAttributes(PerunSession sess, Vo vo, AttributeDefinition attrDef) throws AttributeNotExistsException, WrongAttributeAssignmentException, MemberResourceMismatchException {
List<RichAttribute> listOfRichAttributes = new ArrayList<>();
List<Resource> resources = getPerunBl().getResourcesManagerBl().getResources(sess, vo);
for (Resource resourceElement : resources) {
listOfRichAttributes.addAll(getMemberResourceAttributes(sess, resourceElement, attrDef));
}
listOfRichAttributes = new ArrayList<>(new HashSet<>(listOfRichAttributes));
return listOfRichAttributes;
}
|
List<RichAttribute> function(PerunSession sess, Vo vo, AttributeDefinition attrDef) throws AttributeNotExistsException, WrongAttributeAssignmentException, MemberResourceMismatchException { List<RichAttribute> listOfRichAttributes = new ArrayList<>(); List<Resource> resources = getPerunBl().getResourcesManagerBl().getResources(sess, vo); for (Resource resourceElement : resources) { listOfRichAttributes.addAll(getMemberResourceAttributes(sess, resourceElement, attrDef)); } listOfRichAttributes = new ArrayList<>(new HashSet<>(listOfRichAttributes)); return listOfRichAttributes; }
|
/**
* Returns all relevant MemberResource RichAttributes for given vo.
* That means, returns all MemberResource rich attributes for resources that belongs to the given vo and for members
* that can access those resource and are allowed.
* Each rich attribute is returned only once.
*
* @param sess session
* @param vo vo
* @param attrDef type of attribute that will be returned
* @return List of RichAttribute
*/
|
Returns all relevant MemberResource RichAttributes for given vo. That means, returns all MemberResource rich attributes for resources that belongs to the given vo and for members that can access those resource and are allowed. Each rich attribute is returned only once
|
getMemberResourceAttributes
|
{
"repo_name": "CESNET/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/blImpl/AttributesManagerBlImpl.java",
"license": "bsd-2-clause",
"size": 587965
}
|
[
"cz.metacentrum.perun.core.api.AttributeDefinition",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.Resource",
"cz.metacentrum.perun.core.api.RichAttribute",
"cz.metacentrum.perun.core.api.Vo",
"cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException",
"cz.metacentrum.perun.core.api.exceptions.MemberResourceMismatchException",
"cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException",
"java.util.ArrayList",
"java.util.HashSet",
"java.util.List"
] |
import cz.metacentrum.perun.core.api.AttributeDefinition; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.Resource; import cz.metacentrum.perun.core.api.RichAttribute; import cz.metacentrum.perun.core.api.Vo; import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException; import cz.metacentrum.perun.core.api.exceptions.MemberResourceMismatchException; import cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException; import java.util.ArrayList; import java.util.HashSet; import java.util.List;
|
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; import java.util.*;
|
[
"cz.metacentrum.perun",
"java.util"
] |
cz.metacentrum.perun; java.util;
| 1,076,309
|
public static Object lookupMandatoryBean(Exchange exchange, String name) throws NoSuchBeanException {
Object value = lookupBean(exchange, name);
if (value == null) {
throw new NoSuchBeanException(name);
}
return value;
}
|
static Object function(Exchange exchange, String name) throws NoSuchBeanException { Object value = lookupBean(exchange, name); if (value == null) { throw new NoSuchBeanException(name); } return value; }
|
/**
* Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
*
* @param exchange the exchange
* @param name the bean name
* @return the bean
* @throws NoSuchBeanException if no bean could be found in the registry
*/
|
Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
|
lookupMandatoryBean
|
{
"repo_name": "davidkarlsen/camel",
"path": "core/camel-support/src/main/java/org/apache/camel/support/ExchangeHelper.java",
"license": "apache-2.0",
"size": 41703
}
|
[
"org.apache.camel.Exchange",
"org.apache.camel.NoSuchBeanException"
] |
import org.apache.camel.Exchange; import org.apache.camel.NoSuchBeanException;
|
import org.apache.camel.*;
|
[
"org.apache.camel"
] |
org.apache.camel;
| 485,662
|
private void ensurePartitionSourceDataTypes() {
if (partitions != null) {
partitions.stream().forEach(partition -> {
Field field = getFieldForName(partition.getSourceField());
if (field != null) {
partition.setSourceDataType(field.getDataTypeWithPrecisionAndScale());
}
});
}
}
|
void function() { if (partitions != null) { partitions.stream().forEach(partition -> { Field field = getFieldForName(partition.getSourceField()); if (field != null) { partition.setSourceDataType(field.getDataTypeWithPrecisionAndScale()); } }); } }
|
/**
* Ensure that the partition sourceFieldDataType matches the referencing source datatype
* This is needed for the partitoins with the "val" as it needs to use that datatype
*/
|
Ensure that the partition sourceFieldDataType matches the referencing source datatype This is needed for the partitoins with the "val" as it needs to use that datatype
|
ensurePartitionSourceDataTypes
|
{
"repo_name": "rashidaligee/kylo",
"path": "services/feed-manager-service/feed-manager-rest-model/src/main/java/com/thinkbiganalytics/feedmgr/rest/model/schema/TableSetup.java",
"license": "apache-2.0",
"size": 19992
}
|
[
"com.thinkbiganalytics.discovery.schema.Field"
] |
import com.thinkbiganalytics.discovery.schema.Field;
|
import com.thinkbiganalytics.discovery.schema.*;
|
[
"com.thinkbiganalytics.discovery"
] |
com.thinkbiganalytics.discovery;
| 1,054,583
|
public void withdrawRoutes(BGPRoute... routes)
{
BGPPacket packet = new BGPPacket();
List<IPv4Prefix> prefixes = new LinkedList<IPv4Prefix>();
for (BGPRoute route : routes)
if (route.getPrefix() instanceof IPv4Prefix)
prefixes.add((IPv4Prefix) route.getPrefix());
BGPPathAttributeSequence sequence = new BGPPathAttributeSequence();
BGPUpdateMessage updateMessage = new BGPUpdateMessage(prefixes, null, sequence);
packet.addMessage(updateMessage);
sendPacket(packet);
}
|
void function(BGPRoute... routes) { BGPPacket packet = new BGPPacket(); List<IPv4Prefix> prefixes = new LinkedList<IPv4Prefix>(); for (BGPRoute route : routes) if (route.getPrefix() instanceof IPv4Prefix) prefixes.add((IPv4Prefix) route.getPrefix()); BGPPathAttributeSequence sequence = new BGPPathAttributeSequence(); BGPUpdateMessage updateMessage = new BGPUpdateMessage(prefixes, null, sequence); packet.addMessage(updateMessage); sendPacket(packet); }
|
/**
* Sends Update messages to the remote peer to withdraw previously announced
* routes.
*
* @param routes the routes to withdraw.
*/
|
Sends Update messages to the remote peer to withdraw previously announced routes
|
withdrawRoutes
|
{
"repo_name": "sspies8684/hoofprints",
"path": "src/net/decix/bgpstack/BGPPeerFSM.java",
"license": "gpl-3.0",
"size": 22650
}
|
[
"java.util.LinkedList",
"java.util.List",
"net.decix.bgpstack.types.BGPPacket",
"net.decix.bgpstack.types.BGPUpdateMessage",
"net.decix.bgpstack.types.IPv4Prefix",
"net.decix.bgpstack.types.pathattributes.BGPPathAttributeSequence"
] |
import java.util.LinkedList; import java.util.List; import net.decix.bgpstack.types.BGPPacket; import net.decix.bgpstack.types.BGPUpdateMessage; import net.decix.bgpstack.types.IPv4Prefix; import net.decix.bgpstack.types.pathattributes.BGPPathAttributeSequence;
|
import java.util.*; import net.decix.bgpstack.types.*; import net.decix.bgpstack.types.pathattributes.*;
|
[
"java.util",
"net.decix.bgpstack"
] |
java.util; net.decix.bgpstack;
| 1,668,232
|
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
this.parentAdapterFactory = parentAdapterFactory;
}
|
void function(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; }
|
/**
* This sets the composed adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This sets the composed adapter factory that contains this factory.
|
setParentAdapterFactory
|
{
"repo_name": "BaSys-PC1/models",
"path": "de.dfki.iui.basys.model.base.edit/src/de/dfki/iui/basys/model/base/provider/BaseItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 7799
}
|
[
"org.eclipse.emf.edit.provider.ComposedAdapterFactory"
] |
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
|
import org.eclipse.emf.edit.provider.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 887,764
|
protected void onStreamBytesRead(RTMPConnection conn, Channel channel, Header source, BytesRead streamBytesRead) {
conn.receivedBytesRead(streamBytesRead.getBytesRead());
}
|
void function(RTMPConnection conn, Channel channel, Header source, BytesRead streamBytesRead) { conn.receivedBytesRead(streamBytesRead.getBytesRead()); }
|
/**
* Stream bytes read event handler.
*
* @param conn
* Connection
* @param channel
* Channel
* @param source
* Header
* @param streamBytesRead
* Bytes read event context
*/
|
Stream bytes read event handler
|
onStreamBytesRead
|
{
"repo_name": "Red5/red5-server-common",
"path": "src/main/java/org/red5/server/net/rtmp/BaseRTMPHandler.java",
"license": "apache-2.0",
"size": 17328
}
|
[
"org.red5.server.net.rtmp.event.BytesRead",
"org.red5.server.net.rtmp.message.Header"
] |
import org.red5.server.net.rtmp.event.BytesRead; import org.red5.server.net.rtmp.message.Header;
|
import org.red5.server.net.rtmp.event.*; import org.red5.server.net.rtmp.message.*;
|
[
"org.red5.server"
] |
org.red5.server;
| 974,557
|
public RoundedTransformationBuilder borderWidthDp(float width) {
mBorderWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, mDisplayMetrics);
return this;
}
|
RoundedTransformationBuilder function(float width) { mBorderWidth = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, width, mDisplayMetrics); return this; }
|
/**
* Set the border width in density independent pixels.
*
* @param width border width in density independent pixels.
* @return the builder for chaining.
*/
|
Set the border width in density independent pixels
|
borderWidthDp
|
{
"repo_name": "hanqiongly/JCMusicPlayer",
"path": "app/src/main/java/com/jack/music/widgets/roundedimageview/RoundedTransformationBuilder.java",
"license": "apache-2.0",
"size": 5324
}
|
[
"android.util.TypedValue"
] |
import android.util.TypedValue;
|
import android.util.*;
|
[
"android.util"
] |
android.util;
| 1,781,360
|
@Override
public Optional<MobFileCache> getMobFileCache() {
return Optional.ofNullable(this.mobFileCache);
}
|
Optional<MobFileCache> function() { return Optional.ofNullable(this.mobFileCache); }
|
/**
* May be null if this is a master which not carry table.
*
* @return The cache for mob files used by the regionserver.
*/
|
May be null if this is a master which not carry table
|
getMobFileCache
|
{
"repo_name": "bijugs/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java",
"license": "apache-2.0",
"size": 150913
}
|
[
"java.util.Optional",
"org.apache.hadoop.hbase.mob.MobFileCache"
] |
import java.util.Optional; import org.apache.hadoop.hbase.mob.MobFileCache;
|
import java.util.*; import org.apache.hadoop.hbase.mob.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 1,306,620
|
public boolean isRunning() {
return !servicePool.isShutdown();
}
private static class RejectedPriorityService implements RejectedExecutionHandler {
|
boolean function() { return !servicePool.isShutdown(); } private static class RejectedPriorityService implements RejectedExecutionHandler {
|
/**
* Determines if this service pool is still running.
*
* @return true if the pool is still running.
*/
|
Determines if this service pool is still running
|
isRunning
|
{
"repo_name": "Carnewal/CastleClash",
"path": "src/server/core/PriorityServicePool.java",
"license": "gpl-3.0",
"size": 2671
}
|
[
"java.util.concurrent.RejectedExecutionHandler"
] |
import java.util.concurrent.RejectedExecutionHandler;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 2,415,206
|
public AccessUriInner grantAccess(String resourceGroupName, String diskName, GrantAccessData grantAccessData) {
return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().last().body();
}
|
AccessUriInner function(String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return grantAccessWithServiceResponseAsync(resourceGroupName, diskName, grantAccessData).toBlocking().last().body(); }
|
/**
* Grants access to a disk.
*
* @param resourceGroupName The name of the resource group.
* @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
* @param grantAccessData Access data object supplied in the body of the get disk access operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the AccessUriInner object if successful.
*/
|
Grants access to a disk
|
grantAccess
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/DisksInner.java",
"license": "mit",
"size": 88768
}
|
[
"com.microsoft.azure.management.compute.v2020_06_01.GrantAccessData"
] |
import com.microsoft.azure.management.compute.v2020_06_01.GrantAccessData;
|
import com.microsoft.azure.management.compute.v2020_06_01.*;
|
[
"com.microsoft.azure"
] |
com.microsoft.azure;
| 1,622,519
|
@Test
@Ignore("Postfix syntax for infix operators is currently not possible using EMFText.")
public void testMultiplyPositive02() throws Exception {
TestPerformer testPerformer;
String modelFileName;
String oclFileName;
oclFileName = "standardlibrary/real/multiplyPositive02.ocl";
modelFileName = "testmodel.uml";
testPerformer =
TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID,
AllStandardLibraryTests.MODEL_BUNDLE,
AllStandardLibraryTests.MODEL_DIRECTORY);
testPerformer.setModel(modelFileName);
testPerformer.parseFile(oclFileName);
}
|
@Ignore(STR) void function() throws Exception { TestPerformer testPerformer; String modelFileName; String oclFileName; oclFileName = STR; modelFileName = STR; testPerformer = TestPerformer.getInstance(AllStandardLibraryTests.META_MODEL_ID, AllStandardLibraryTests.MODEL_BUNDLE, AllStandardLibraryTests.MODEL_DIRECTORY); testPerformer.setModel(modelFileName); testPerformer.parseFile(oclFileName); }
|
/**
* <p>
* A test case testing the method <code>Real.*(Real)</code>.
* </p>
*/
|
A test case testing the method <code>Real.*(Real)</code>.
|
testMultiplyPositive02
|
{
"repo_name": "dresden-ocl/dresdenocl",
"path": "tests/org.dresdenocl.ocl2parser.test/src/org/dresdenocl/ocl2parser/test/standardlibrary/TestReal.java",
"license": "lgpl-3.0",
"size": 18193
}
|
[
"org.dresdenocl.ocl2parser.test.TestPerformer",
"org.junit.Ignore"
] |
import org.dresdenocl.ocl2parser.test.TestPerformer; import org.junit.Ignore;
|
import org.dresdenocl.ocl2parser.test.*; import org.junit.*;
|
[
"org.dresdenocl.ocl2parser",
"org.junit"
] |
org.dresdenocl.ocl2parser; org.junit;
| 2,802,314
|
public static class Builder {
public static interface Helper {
Package createFreshPackage(PackageIdentifier packageId, String runfilesPrefix);
|
static class Builder { public static interface Helper { Package function(PackageIdentifier packageId, String runfilesPrefix);
|
/**
* Returns a fresh {@link Package} instance that a {@link Builder} will internally mutate
* during package loading. Called by {@link PackageFactory}.
*/
|
Returns a fresh <code>Package</code> instance that a <code>Builder</code> will internally mutate during package loading. Called by <code>PackageFactory</code>
|
createFreshPackage
|
{
"repo_name": "UrbanCompass/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/Package.java",
"license": "apache-2.0",
"size": 52858
}
|
[
"com.google.devtools.build.lib.cmdline.PackageIdentifier"
] |
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
|
import com.google.devtools.build.lib.cmdline.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 2,437,495
|
public void setCacheManager(final CacheManager cacheManager) {
this.cacheManager = cacheManager;
}
|
void function(final CacheManager cacheManager) { this.cacheManager = cacheManager; }
|
/**
* Normally not used when using spring-boot then the cachemanager is
* autowired to the CacheManagerHolder, but for testing purposes.
*
* @param cacheManager
* the cache manager to set for the cache manager holder.
*/
|
Normally not used when using spring-boot then the cachemanager is autowired to the CacheManagerHolder, but for testing purposes
|
setCacheManager
|
{
"repo_name": "StBurcher/hawkbit",
"path": "hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/helper/CacheManagerHolder.java",
"license": "epl-1.0",
"size": 1688
}
|
[
"org.springframework.cache.CacheManager"
] |
import org.springframework.cache.CacheManager;
|
import org.springframework.cache.*;
|
[
"org.springframework.cache"
] |
org.springframework.cache;
| 824,023
|
public AdminService.BlockingInterface waitForMetaServerConnection(long timeout)
throws InterruptedException, NotAllMetaRegionsOnlineException, IOException {
return getMetaServerConnection(timeout);
}
|
AdminService.BlockingInterface function(long timeout) throws InterruptedException, NotAllMetaRegionsOnlineException, IOException { return getMetaServerConnection(timeout); }
|
/**
* Gets a connection to the server hosting meta, as reported by ZooKeeper,
* waiting up to the specified timeout for availability.
* @param timeout How long to wait on meta location
* @see #waitForMeta for additional information
* @return connection to server hosting meta
* @throws InterruptedException
* @throws NotAllMetaRegionsOnlineException if timed out waiting
* @throws IOException
* @deprecated Use #getMetaServerConnection(long)
*/
|
Gets a connection to the server hosting meta, as reported by ZooKeeper, waiting up to the specified timeout for availability
|
waitForMetaServerConnection
|
{
"repo_name": "lilonglai/hbase-0.96.2",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java",
"license": "apache-2.0",
"size": 18041
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException",
"org.apache.hadoop.hbase.protobuf.generated.AdminProtos"
] |
import java.io.IOException; import org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException; import org.apache.hadoop.hbase.protobuf.generated.AdminProtos;
|
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.protobuf.generated.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,911,493
|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
val = in.readInt();
strVal = (String)in.readObject();
enumVal = (TestEnum)in.readObject();
}
}
private static class ExternalizableObject extends PlaneObject implements Externalizable {
private static final long serialVersionUID = 0;
public ExternalizableObject() {
super(-1);
}
ExternalizableObject(int val) {
super(val);
}
|
void function(ObjectInputStream in) throws IOException, ClassNotFoundException { val = in.readInt(); strVal = (String)in.readObject(); enumVal = (TestEnum)in.readObject(); } } private static class ExternalizableObject extends PlaneObject implements Externalizable { private static final long serialVersionUID = 0; public ExternalizableObject() { super(-1); } ExternalizableObject(int val) { super(val); }
|
/**
* Custom deserialization of superclass because {@link PlaneObject} is non-serializable.
*
* @param in input stream
* @throws IOException if de-serialization failed.
* @throws ClassNotFoundException if de-serialization failed.
*/
|
Custom deserialization of superclass because <code>PlaneObject</code> is non-serializable
|
readObject
|
{
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteConfigVariationsAbstractTest.java",
"license": "apache-2.0",
"size": 19609
}
|
[
"java.io.Externalizable",
"java.io.IOException",
"java.io.ObjectInputStream"
] |
import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 860,601
|
@Test
public void testTwoSeparatorNames() throws Exception {
ContextImpl ctx = new ContextImpl();
Object obj = new Object();
ctx.bind("a/b.c.d/e", obj);
assertEquals(ctx.lookup("a/b/c/d/e"), obj);
assertEquals(ctx.lookup("a.b/c.d.e"), obj);
assertTrue(ctx.lookup("a.b.c.d") instanceof Context);
}
|
void function() throws Exception { ContextImpl ctx = new ContextImpl(); Object obj = new Object(); ctx.bind(STR, obj); assertEquals(ctx.lookup(STR), obj); assertEquals(ctx.lookup(STR), obj); assertTrue(ctx.lookup(STR) instanceof Context); }
|
/**
* Tests substitution of '.' with '/' when parsing string names.
*/
|
Tests substitution of '.' with '/' when parsing string names
|
testTwoSeparatorNames
|
{
"repo_name": "smgoller/geode",
"path": "geode-core/src/test/java/org/apache/geode/internal/jndi/ContextJUnitTest.java",
"license": "apache-2.0",
"size": 11271
}
|
[
"javax.naming.Context",
"org.junit.Assert"
] |
import javax.naming.Context; import org.junit.Assert;
|
import javax.naming.*; import org.junit.*;
|
[
"javax.naming",
"org.junit"
] |
javax.naming; org.junit;
| 212,719
|
public List<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>> getAllSystemEventListener()
{
List<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>>();
List<Node> nodeList = childNode.get("system-event-listener");
for(Node node: nodeList)
{
FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>> type = new FacesConfigSystemEventListenerTypeImpl<FacesConfigApplicationType<T>>(this, "system-event-listener", childNode, node);
list.add(type);
}
return list;
}
|
List<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>> function() { List<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>>>(); List<Node> nodeList = childNode.get(STR); for(Node node: nodeList) { FacesConfigSystemEventListenerType<FacesConfigApplicationType<T>> type = new FacesConfigSystemEventListenerTypeImpl<FacesConfigApplicationType<T>>(this, STR, childNode, node); list.add(type); } return list; }
|
/**
* Returns all <code>system-event-listener</code> elements
* @return list of <code>system-event-listener</code>
*/
|
Returns all <code>system-event-listener</code> elements
|
getAllSystemEventListener
|
{
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/FacesConfigApplicationTypeImpl.java",
"license": "epl-1.0",
"size": 32125
}
|
[
"java.util.ArrayList",
"java.util.List",
"org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigApplicationType",
"org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigSystemEventListenerType",
"org.jboss.shrinkwrap.descriptor.spi.node.Node"
] |
import java.util.ArrayList; import java.util.List; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigApplicationType; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigSystemEventListenerType; import org.jboss.shrinkwrap.descriptor.spi.node.Node;
|
import java.util.*; import org.jboss.shrinkwrap.descriptor.api.facesconfig20.*; import org.jboss.shrinkwrap.descriptor.spi.node.*;
|
[
"java.util",
"org.jboss.shrinkwrap"
] |
java.util; org.jboss.shrinkwrap;
| 498,047
|
protected String consumeBOM(InputStream stream, String encoding)
throws IOException {
byte[] b = new byte[3];
int count = 0;
stream.mark(3);
if (encoding.equals("UTF-8")) {
count = stream.read(b, 0, 3);
if (count == 3) {
final int b0 = b[0] & 0xFF;
final int b1 = b[1] & 0xFF;
final int b2 = b[2] & 0xFF;
if (b0 != 0xEF || b1 != 0xBB || b2 != 0xBF) {
// First three bytes are not BOM, so reset.
stream.reset();
}
}
else {
stream.reset();
}
}
else if (encoding.startsWith("UTF-16")) {
count = stream.read(b, 0, 2);
if (count == 2) {
final int b0 = b[0] & 0xFF;
final int b1 = b[1] & 0xFF;
if (b0 == 0xFE && b1 == 0xFF) {
return "UTF-16BE";
}
else if (b0 == 0xFF && b1 == 0xFE) {
return "UTF-16LE";
}
}
// First two bytes are not BOM, so reset.
stream.reset();
}
// We could do UTF-32, but since the getEncodingName() doesn't support that
// we won't support it here.
// To implement UTF-32, look for: 00 00 FE FF for big-endian
// or FF FE 00 00 for little-endian
return encoding;
}
|
String function(InputStream stream, String encoding) throws IOException { byte[] b = new byte[3]; int count = 0; stream.mark(3); if (encoding.equals("UTF-8")) { count = stream.read(b, 0, 3); if (count == 3) { final int b0 = b[0] & 0xFF; final int b1 = b[1] & 0xFF; final int b2 = b[2] & 0xFF; if (b0 != 0xEF b1 != 0xBB b2 != 0xBF) { stream.reset(); } } else { stream.reset(); } } else if (encoding.startsWith(STR)) { count = stream.read(b, 0, 2); if (count == 2) { final int b0 = b[0] & 0xFF; final int b1 = b[1] & 0xFF; if (b0 == 0xFE && b1 == 0xFF) { return STR; } else if (b0 == 0xFF && b1 == 0xFE) { return STR; } } stream.reset(); } return encoding; }
|
/**
* Removes the byte order mark from the stream, if
* it exists and returns the encoding name.
*
* @param stream
* @param encoding
* @throws IOException
*/
|
Removes the byte order mark from the stream, if it exists and returns the encoding name
|
consumeBOM
|
{
"repo_name": "itgeeker/jdk",
"path": "src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java",
"license": "apache-2.0",
"size": 20637
}
|
[
"java.io.IOException",
"java.io.InputStream"
] |
import java.io.IOException; import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,727,198
|
public static Rop opFilledNewArray(TypeBearer arrayType, int count) {
Type type = arrayType.getType();
Type elementType = type.getComponentType();
if (elementType.isCategory2()) {
return throwBadType(arrayType);
}
if (count < 0) {
throw new IllegalArgumentException("count < 0");
}
StdTypeList sourceTypes = new StdTypeList(count);
for (int i = 0; i < count; i++) {
sourceTypes.set(i, elementType);
}
// Note: The resulting rop is considered call-like.
return new Rop(RegOps.FILLED_NEW_ARRAY,
sourceTypes,
Exceptions.LIST_Error);
}
|
static Rop function(TypeBearer arrayType, int count) { Type type = arrayType.getType(); Type elementType = type.getComponentType(); if (elementType.isCategory2()) { return throwBadType(arrayType); } if (count < 0) { throw new IllegalArgumentException(STR); } StdTypeList sourceTypes = new StdTypeList(count); for (int i = 0; i < count; i++) { sourceTypes.set(i, elementType); } return new Rop(RegOps.FILLED_NEW_ARRAY, sourceTypes, Exceptions.LIST_Error); }
|
/**
* Returns the appropriate {@code filled-new-array} rop for the given
* type. The result may be a shared instance.
*
* @param arrayType {@code non-null;} type of array being created
* @param count {@code >= 0;} number of elements that the array should have
* @return {@code non-null;} an appropriate instance
*/
|
Returns the appropriate filled-new-array rop for the given type. The result may be a shared instance
|
opFilledNewArray
|
{
"repo_name": "raviagarwal7/buck",
"path": "third-party/java/dx/src/com/android/dx/rop/code/Rops.java",
"license": "apache-2.0",
"size": 82635
}
|
[
"com.android.dx.rop.type.StdTypeList",
"com.android.dx.rop.type.Type",
"com.android.dx.rop.type.TypeBearer"
] |
import com.android.dx.rop.type.StdTypeList; import com.android.dx.rop.type.Type; import com.android.dx.rop.type.TypeBearer;
|
import com.android.dx.rop.type.*;
|
[
"com.android.dx"
] |
com.android.dx;
| 837,873
|
public void setOwner(String src, String username, String group
) throws IOException {
synchronized (this) {
if (isInSafeMode())
throw new SafeModeException("Cannot set owner for " + src, safeMode);
FSPermissionChecker pc = checkOwner(src);
if (!pc.isSuper) {
if (username != null && !pc.user.equals(username)) {
throw new AccessControlException("Non-super user cannot change owner.");
}
if (group != null && !pc.containsGroup(group)) {
throw new AccessControlException("User does not belong to " + group
+ " .");
}
}
dir.setOwner(src, username, group);
}
getEditLog().logSync();
if (auditLog.isInfoEnabled() && isExternalInvocation()) {
final HdfsFileStatus stat = dir.getFileInfo(src);
logAuditEvent(UserGroupInformation.getCurrentUser(),
Server.getRemoteIp(),
"setOwner", src, null, stat);
}
}
|
void function(String src, String username, String group ) throws IOException { synchronized (this) { if (isInSafeMode()) throw new SafeModeException(STR + src, safeMode); FSPermissionChecker pc = checkOwner(src); if (!pc.isSuper) { if (username != null && !pc.user.equals(username)) { throw new AccessControlException(STR); } if (group != null && !pc.containsGroup(group)) { throw new AccessControlException(STR + group + STR); } } dir.setOwner(src, username, group); } getEditLog().logSync(); if (auditLog.isInfoEnabled() && isExternalInvocation()) { final HdfsFileStatus stat = dir.getFileInfo(src); logAuditEvent(UserGroupInformation.getCurrentUser(), Server.getRemoteIp(), STR, src, null, stat); } }
|
/**
* Set owner for an existing file.
* @throws IOException
*/
|
Set owner for an existing file
|
setOwner
|
{
"repo_name": "davidl1/hortonworks-extension",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java",
"license": "apache-2.0",
"size": 218585
}
|
[
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.HdfsFileStatus",
"org.apache.hadoop.ipc.Server",
"org.apache.hadoop.security.AccessControlException",
"org.apache.hadoop.security.UserGroupInformation"
] |
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.HdfsFileStatus; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.security.AccessControlException; import org.apache.hadoop.security.UserGroupInformation;
|
import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.security.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 1,232,220
|
private static boolean isValidColorMap(RenderedImage sourceImage,
ColorCube colorMap,
StringBuffer msg) {
SampleModel srcSampleModel = sourceImage.getSampleModel();
if(colorMap.getDataType() != srcSampleModel.getTransferType()) {
msg.append(JaiI18N.getString("OrderedDitherDescriptor3"));
return false;
} else if (colorMap.getNumBands() != srcSampleModel.getNumBands()) {
msg.append(JaiI18N.getString("OrderedDitherDescriptor4"));
return false;
}
return true;
}
|
static boolean function(RenderedImage sourceImage, ColorCube colorMap, StringBuffer msg) { SampleModel srcSampleModel = sourceImage.getSampleModel(); if(colorMap.getDataType() != srcSampleModel.getTransferType()) { msg.append(JaiI18N.getString(STR)); return false; } else if (colorMap.getNumBands() != srcSampleModel.getNumBands()) { msg.append(JaiI18N.getString(STR)); return false; } return true; }
|
/**
* Method to check the validity of the color map parameter. The supplied
* color cube must have the same data type and number of bands as the
* source image.
*
* @param sourceImage The source image of the operation.
* @param colorMap The color cube.
* @param msg The buffer to which messages should be appended.
*
* @return Whether the color map is valid.
*/
|
Method to check the validity of the color map parameter. The supplied color cube must have the same data type and number of bands as the source image
|
isValidColorMap
|
{
"repo_name": "MarinnaCole/LightZone",
"path": "lightcrafts/extsrc/com/lightcrafts/mediax/jai/operator/OrderedDitherDescriptor.java",
"license": "bsd-3-clause",
"size": 10413
}
|
[
"com.lightcrafts.mediax.jai.ColorCube",
"java.awt.image.RenderedImage",
"java.awt.image.SampleModel"
] |
import com.lightcrafts.mediax.jai.ColorCube; import java.awt.image.RenderedImage; import java.awt.image.SampleModel;
|
import com.lightcrafts.mediax.jai.*; import java.awt.image.*;
|
[
"com.lightcrafts.mediax",
"java.awt"
] |
com.lightcrafts.mediax; java.awt;
| 712,278
|
void registerNavigableEnds(List associationEnds) {
// System.out.println("registerNavigableEnds: " + name());
Iterator it = associationEnds.iterator();
while ( it.hasNext() ) {
MAssociationEnd aend = (MAssociationEnd) it.next();
// System.out.println("aend: " + aend.name());
fAssociationEnds.put(aend.name(), aend);
}
}
|
void registerNavigableEnds(List associationEnds) { Iterator it = associationEnds.iterator(); while ( it.hasNext() ) { MAssociationEnd aend = (MAssociationEnd) it.next(); fAssociationEnds.put(aend.name(), aend); } }
|
/**
* Registers all association ends as navigable from this
* class. This should be called by a MModel implementation when an
* association is added to the model.
*
* @param associationEnds List(MAssociationEnd)
* @see MModel#addAssociation
*/
|
Registers all association ends as navigable from this class. This should be called by a MModel implementation when an association is added to the model
|
registerNavigableEnds
|
{
"repo_name": "stormymauldin/stuff",
"path": "src/main/org/tzi/use/uml/mm/MClass.java",
"license": "gpl-2.0",
"size": 11956
}
|
[
"java.util.Iterator",
"java.util.List"
] |
import java.util.Iterator; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,162,742
|
private boolean shouldRunDailyTasks() {
final LocalSettings localSettings = handler.getSettingsServiceLocal().getLocalSettings();
final TimeZone timeZone = localSettings.getTimeZone();
// Use a localized formatter to get the time in the instance's local time zone
final SimpleDateFormat format = new SimpleDateFormat("HH");
if (timeZone != null) {
format.setTimeZone(timeZone);
}
final boolean runExtraTasks = localSettings.getSchedulingHour() == Integer.parseInt(format.format(time.getTime()));
return runExtraTasks;
}
|
boolean function() { final LocalSettings localSettings = handler.getSettingsServiceLocal().getLocalSettings(); final TimeZone timeZone = localSettings.getTimeZone(); final SimpleDateFormat format = new SimpleDateFormat("HH"); if (timeZone != null) { format.setTimeZone(timeZone); } final boolean runExtraTasks = localSettings.getSchedulingHour() == Integer.parseInt(format.format(time.getTime())); return runExtraTasks; }
|
/**
* Determines whether this execution should run daily tasks
*/
|
Determines whether this execution should run daily tasks
|
shouldRunDailyTasks
|
{
"repo_name": "robertoandrade/cyclos",
"path": "src/nl/strohalm/cyclos/scheduling/HourlyScheduledTasks.java",
"license": "gpl-2.0",
"size": 3641
}
|
[
"java.text.SimpleDateFormat",
"java.util.TimeZone",
"nl.strohalm.cyclos.entities.settings.LocalSettings"
] |
import java.text.SimpleDateFormat; import java.util.TimeZone; import nl.strohalm.cyclos.entities.settings.LocalSettings;
|
import java.text.*; import java.util.*; import nl.strohalm.cyclos.entities.settings.*;
|
[
"java.text",
"java.util",
"nl.strohalm.cyclos"
] |
java.text; java.util; nl.strohalm.cyclos;
| 289,942
|
public void fetchIntValues(String column, int[] inDocIds, int inStartPos, int length, int[] outValues, int outStartPos) {
Dictionary dictionary = getDictionaryForColumn(column);
if (dictionary != null) {
int[] dictIds = THREAD_LOCAL_DICT_IDS.get();
fetchSingleDictIds(column, inDocIds, inStartPos, length, dictIds, 0);
dictionary.readIntValues(dictIds, 0, length, outValues, outStartPos);
} else {
BlockValSet blockValSet = _columnToBlockValSetMap.get(column);
blockValSet.getIntValues(inDocIds, inStartPos, length, outValues, outStartPos);
}
}
|
void function(String column, int[] inDocIds, int inStartPos, int length, int[] outValues, int outStartPos) { Dictionary dictionary = getDictionaryForColumn(column); if (dictionary != null) { int[] dictIds = THREAD_LOCAL_DICT_IDS.get(); fetchSingleDictIds(column, inDocIds, inStartPos, length, dictIds, 0); dictionary.readIntValues(dictIds, 0, length, outValues, outStartPos); } else { BlockValSet blockValSet = _columnToBlockValSetMap.get(column); blockValSet.getIntValues(inDocIds, inStartPos, length, outValues, outStartPos); } }
|
/**
* Fetch the values for a single int value column.
*
* @param column column name.
* @param inDocIds doc Id array.
* @param inStartPos input start position.
* @param length input length.
* @param outValues value array buffer.
* @param outStartPos output start position.
*/
|
Fetch the values for a single int value column
|
fetchIntValues
|
{
"repo_name": "sajavadi/pinot",
"path": "pinot-core/src/main/java/com/linkedin/pinot/core/common/DataFetcher.java",
"license": "apache-2.0",
"size": 17587
}
|
[
"com.linkedin.pinot.core.segment.index.readers.Dictionary"
] |
import com.linkedin.pinot.core.segment.index.readers.Dictionary;
|
import com.linkedin.pinot.core.segment.index.readers.*;
|
[
"com.linkedin.pinot"
] |
com.linkedin.pinot;
| 1,657,481
|
public java.util.List<fr.lip6.move.pnml.symmetricnet.terms.hlapi.MultisetSortHLAPI> getInput_terms_MultisetSortHLAPI();
|
java.util.List<fr.lip6.move.pnml.symmetricnet.terms.hlapi.MultisetSortHLAPI> function();
|
/**
* This accessor return a list of encapsulated subelement, only of MultisetSortHLAPI kind.
* WARNING : this method can creates a lot of new object in memory.
*/
|
This accessor return a list of encapsulated subelement, only of MultisetSortHLAPI kind. WARNING : this method can creates a lot of new object in memory
|
getInput_terms_MultisetSortHLAPI
|
{
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/terms/hlapi/OperatorHLAPI.java",
"license": "epl-1.0",
"size": 21731
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 208,359
|
private static void registerAjaxOperation(final AjaxOperation operation) {
UIContext uic = UIContextHolder.getCurrentPrimaryUIContext();
if (uic == null) {
throw new SystemException("No User Context Available to Register AJAX Operations.");
}
Map<String, AjaxOperation> operations = (Map<String, AjaxOperation>) uic.getFwkAttribute(AJAX_OPERATIONS_SESSION_KEY);
if (operations == null) {
operations = new HashMap<>();
uic.setFwkAttribute(AJAX_OPERATIONS_SESSION_KEY, operations);
}
operations.put(operation.getTriggerId(), operation);
}
|
static void function(final AjaxOperation operation) { UIContext uic = UIContextHolder.getCurrentPrimaryUIContext(); if (uic == null) { throw new SystemException(STR); } Map<String, AjaxOperation> operations = (Map<String, AjaxOperation>) uic.getFwkAttribute(AJAX_OPERATIONS_SESSION_KEY); if (operations == null) { operations = new HashMap<>(); uic.setFwkAttribute(AJAX_OPERATIONS_SESSION_KEY, operations); } operations.put(operation.getTriggerId(), operation); }
|
/**
* The Ajax servlet needs access to the AjaxOperation Store the operation in the user context using the trigger Id,
* as this will be present in the Servlet HttpRequest. agreed key. The ajax id is passed in the url to the servlet
* so it can then access the context.
*
* @param operation the operation to register.
*/
|
The Ajax servlet needs access to the AjaxOperation Store the operation in the user context using the trigger Id, as this will be present in the Servlet HttpRequest. agreed key. The ajax id is passed in the url to the servlet so it can then access the context
|
registerAjaxOperation
|
{
"repo_name": "marksreeves/wcomponents",
"path": "wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java",
"license": "gpl-3.0",
"size": 7396
}
|
[
"com.github.bordertech.wcomponents.util.SystemException",
"java.util.HashMap",
"java.util.Map"
] |
import com.github.bordertech.wcomponents.util.SystemException; import java.util.HashMap; import java.util.Map;
|
import com.github.bordertech.wcomponents.util.*; import java.util.*;
|
[
"com.github.bordertech",
"java.util"
] |
com.github.bordertech; java.util;
| 522,056
|
private ParseException floatParseException(final NumberFormatException e) {
return parseException("Couldn't parse number: " + e.getMessage());
}
}
public static class ParseException extends IOException {
private static final long serialVersionUID = 3196188060225107702L;
public ParseException(final String message) {
callSuper(message);
}
}
|
ParseException function(final NumberFormatException e) { return parseException(STR + e.getMessage()); } } public static class ParseException extends IOException { private static final long serialVersionUID = 3196188060225107702L; public ParseException(final String message) { callSuper(message); } }
|
/**
* Constructs an appropriate {@link ParseException} for the given
* {@code NumberFormatException} when trying to parse a float or double.
*/
|
Constructs an appropriate <code>ParseException</code> for the given NumberFormatException when trying to parse a float or double
|
floatParseException
|
{
"repo_name": "jayli/kissy",
"path": "tools/module-compiler/src/com/google/protobuf/TextFormat.java",
"license": "mit",
"size": 45210
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,444,858
|
public static ExpectedCondition<Boolean> invisibilityOfAllElements(final List<WebElement> elements) {
return new ExpectedCondition<Boolean>() {
|
static ExpectedCondition<Boolean> function(final List<WebElement> elements) { return new ExpectedCondition<Boolean>() {
|
/**
* An expectation for checking all elements from given list to be invisible
*
* @param elements used to check their invisibility
* @return Boolean true when all elements are not visible anymore
*/
|
An expectation for checking all elements from given list to be invisible
|
invisibilityOfAllElements
|
{
"repo_name": "Ardesco/selenium",
"path": "java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java",
"license": "apache-2.0",
"size": 51442
}
|
[
"java.util.List",
"org.openqa.selenium.WebElement"
] |
import java.util.List; import org.openqa.selenium.WebElement;
|
import java.util.*; import org.openqa.selenium.*;
|
[
"java.util",
"org.openqa.selenium"
] |
java.util; org.openqa.selenium;
| 2,677,830
|
Range getParamValueRange(String parameterName);
|
Range getParamValueRange(String parameterName);
|
/**
* Returns the <code>Range</code> that represents the range of valid
* values for the specified parameter. Returns <code>null</code> if
* the parameter can take on any value or if the valid values are
* not representable as a Range.
*
* @param parameterName The name of the parameter whose valid range
* of values is to be determined.
*
* @throws IllegalArgumentException if <code>parameterName</code> is null
* or if the parameter does not exist.
*/
|
Returns the <code>Range</code> that represents the range of valid values for the specified parameter. Returns <code>null</code> if the parameter can take on any value or if the valid values are not representable as a Range
|
getParamValueRange
|
{
"repo_name": "RoProducts/rastertheque",
"path": "JAILibrary/src/javax/media/jai/ParameterListDescriptor.java",
"license": "gpl-2.0",
"size": 5420
}
|
[
"javax.media.jai.util.Range"
] |
import javax.media.jai.util.Range;
|
import javax.media.jai.util.*;
|
[
"javax.media"
] |
javax.media;
| 1,004,440
|
@Test
public void testGetFullPathNameAfterSetQuota() throws Exception {
long fileLen = 1024;
replication = 3;
Configuration conf = new Configuration();
MiniDFSCluster cluster = null;
try {
cluster =
new MiniDFSCluster.Builder(conf).numDataNodes(replication).build();
cluster.waitActive();
FSNamesystem fsn = cluster.getNamesystem();
FSDirectory fsdir = fsn.getFSDirectory();
DistributedFileSystem dfs = cluster.getFileSystem();
// Create a file for test
final Path dir = new Path("/dir");
final Path file = new Path(dir, "file");
DFSTestUtil.createFile(dfs, file, fileLen, replication, 0L);
// Check the full path name of the INode associating with the file
INode fnode = fsdir.getINode(file.toString());
assertEquals(file.toString(), fnode.getFullPathName());
// Call FSDirectory#unprotectedSetQuota which calls
// INodeDirectory#replaceChild
dfs.setQuota(dir, Long.MAX_VALUE - 1, replication * fileLen * 10);
INodeDirectory dirNode = getDir(fsdir, dir);
assertEquals(dir.toString(), dirNode.getFullPathName());
assertTrue(dirNode.isWithQuota());
final Path newDir = new Path("/newdir");
final Path newFile = new Path(newDir, "file");
// Also rename dir
dfs.rename(dir, newDir, Options.Rename.OVERWRITE);
// /dir/file now should be renamed to /newdir/file
fnode = fsdir.getINode(newFile.toString());
// getFullPathName can return correct result only if the parent field of
// child node is set correctly
assertEquals(newFile.toString(), fnode.getFullPathName());
} finally {
if (cluster != null) {
cluster.shutdown();
}
}
}
|
void function() throws Exception { long fileLen = 1024; replication = 3; Configuration conf = new Configuration(); MiniDFSCluster cluster = null; try { cluster = new MiniDFSCluster.Builder(conf).numDataNodes(replication).build(); cluster.waitActive(); FSNamesystem fsn = cluster.getNamesystem(); FSDirectory fsdir = fsn.getFSDirectory(); DistributedFileSystem dfs = cluster.getFileSystem(); final Path dir = new Path("/dir"); final Path file = new Path(dir, "file"); DFSTestUtil.createFile(dfs, file, fileLen, replication, 0L); INode fnode = fsdir.getINode(file.toString()); assertEquals(file.toString(), fnode.getFullPathName()); dfs.setQuota(dir, Long.MAX_VALUE - 1, replication * fileLen * 10); INodeDirectory dirNode = getDir(fsdir, dir); assertEquals(dir.toString(), dirNode.getFullPathName()); assertTrue(dirNode.isWithQuota()); final Path newDir = new Path(STR); final Path newFile = new Path(newDir, "file"); dfs.rename(dir, newDir, Options.Rename.OVERWRITE); fnode = fsdir.getINode(newFile.toString()); assertEquals(newFile.toString(), fnode.getFullPathName()); } finally { if (cluster != null) { cluster.shutdown(); } } }
|
/**
* FSDirectory#unprotectedSetQuota creates a new INodeDirectoryWithQuota to
* replace the original INodeDirectory. Before HDFS-4243, the parent field of
* all the children INodes of the target INodeDirectory is not changed to
* point to the new INodeDirectoryWithQuota. This testcase tests this
* scenario.
*/
|
FSDirectory#unprotectedSetQuota creates a new INodeDirectoryWithQuota to replace the original INodeDirectory. Before HDFS-4243, the parent field of all the children INodes of the target INodeDirectory is not changed to point to the new INodeDirectoryWithQuota. This testcase tests this scenario
|
testGetFullPathNameAfterSetQuota
|
{
"repo_name": "fyqls/hadoop-2.4.0",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestINodeFile.java",
"license": "apache-2.0",
"size": 39227
}
|
[
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.Options",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hdfs.DFSTestUtil",
"org.apache.hadoop.hdfs.DistributedFileSystem",
"org.apache.hadoop.hdfs.MiniDFSCluster",
"org.junit.Assert"
] |
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Options; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.junit.Assert;
|
import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.junit.*;
|
[
"org.apache.hadoop",
"org.junit"
] |
org.apache.hadoop; org.junit;
| 961,283
|
if (date == null) {
return "";
}
FastDateFormat format = getDateOutputFormat(language);
return format.format(date);
}
|
if (date == null) { return ""; } FastDateFormat format = getDateOutputFormat(language); return format.format(date); }
|
/**
* Display the date in a language specific standard format.
* @param date the date to convert.
* @param language The current user's language
* @return A String representation of the date in the language specific format.
*/
|
Display the date in a language specific standard format
|
dateToString
|
{
"repo_name": "NicolasEYSSERIC/Silverpeas-Core",
"path": "lib-core/src/main/java/com/stratelia/webactiv/util/DateUtil.java",
"license": "agpl-3.0",
"size": 25701
}
|
[
"org.apache.commons.lang3.time.FastDateFormat"
] |
import org.apache.commons.lang3.time.FastDateFormat;
|
import org.apache.commons.lang3.time.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 711,163
|
EReference getEdgeCreationDescription_InitialOperation();
|
EReference getEdgeCreationDescription_InitialOperation();
|
/**
* Returns the meta object for the containment reference '
* {@link org.eclipse.sirius.diagram.description.tool.EdgeCreationDescription#getInitialOperation
* <em>Initial Operation</em>}'. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @return the meta object for the containment reference '
* <em>Initial Operation</em>'.
* @see org.eclipse.sirius.diagram.description.tool.EdgeCreationDescription#getInitialOperation()
* @see #getEdgeCreationDescription()
* @generated
*/
|
Returns the meta object for the containment reference ' <code>org.eclipse.sirius.diagram.description.tool.EdgeCreationDescription#getInitialOperation Initial Operation</code>'.
|
getEdgeCreationDescription_InitialOperation
|
{
"repo_name": "FTSRG/iq-sirius-integration",
"path": "host/org.eclipse.sirius.diagram/src-gen/org/eclipse/sirius/diagram/description/tool/ToolPackage.java",
"license": "epl-1.0",
"size": 180886
}
|
[
"org.eclipse.emf.ecore.EReference"
] |
import org.eclipse.emf.ecore.EReference;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,445,842
|
@SmallTest
@Feature({"Cronet"})
@OnlyRunNativeCronet
public void testMockClientCertificateRequested() throws Exception {
TestUrlRequestCallback callback = startAndWaitForComplete(
MockUrlRequestJobFactory.getMockUrlForClientCertificateRequest());
assertNotNull(callback.mResponseInfo);
assertEquals(200, callback.mResponseInfo.getHttpStatusCode());
assertEquals("data", callback.mResponseAsString);
assertEquals(0, callback.mRedirectCount);
assertNull(callback.mError);
assertFalse(callback.mOnErrorCalled);
}
|
@Feature({STR}) void function() throws Exception { TestUrlRequestCallback callback = startAndWaitForComplete( MockUrlRequestJobFactory.getMockUrlForClientCertificateRequest()); assertNotNull(callback.mResponseInfo); assertEquals(200, callback.mResponseInfo.getHttpStatusCode()); assertEquals("data", callback.mResponseAsString); assertEquals(0, callback.mRedirectCount); assertNull(callback.mError); assertFalse(callback.mOnErrorCalled); }
|
/**
* Tests that request continues when client certificate is requested.
*/
|
Tests that request continues when client certificate is requested
|
testMockClientCertificateRequested
|
{
"repo_name": "ds-hwang/chromium-crosswalk",
"path": "components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestTest.java",
"license": "bsd-3-clause",
"size": 79493
}
|
[
"org.chromium.base.test.util.Feature"
] |
import org.chromium.base.test.util.Feature;
|
import org.chromium.base.test.util.*;
|
[
"org.chromium.base"
] |
org.chromium.base;
| 1,646,667
|
private void sendBroadcastUploadStarted(
UploadFileOperation upload) {
Intent start = new Intent(getUploadStartMessage());
start.putExtra(EXTRA_REMOTE_PATH, upload.getRemotePath()); // real remote
start.putExtra(EXTRA_OLD_FILE_PATH, upload.getOriginalStoragePath());
start.putExtra(ACCOUNT_NAME, upload.getAccount().name);
start.setPackage(getPackageName());
sendStickyBroadcast(start);
}
|
void function( UploadFileOperation upload) { Intent start = new Intent(getUploadStartMessage()); start.putExtra(EXTRA_REMOTE_PATH, upload.getRemotePath()); start.putExtra(EXTRA_OLD_FILE_PATH, upload.getOriginalStoragePath()); start.putExtra(ACCOUNT_NAME, upload.getAccount().name); start.setPackage(getPackageName()); sendStickyBroadcast(start); }
|
/**
* Sends a broadcast in order to the interested activities can update their
* view
*
* TODO - no more broadcasts, replace with a callback to subscribed listeners
*
* @param upload Finished upload operation
*/
|
Sends a broadcast in order to the interested activities can update their view TODO - no more broadcasts, replace with a callback to subscribed listeners
|
sendBroadcastUploadStarted
|
{
"repo_name": "jsrck/android",
"path": "src/main/java/com/owncloud/android/files/services/FileUploader.java",
"license": "gpl-2.0",
"size": 55361
}
|
[
"android.content.Intent",
"com.owncloud.android.operations.UploadFileOperation"
] |
import android.content.Intent; import com.owncloud.android.operations.UploadFileOperation;
|
import android.content.*; import com.owncloud.android.operations.*;
|
[
"android.content",
"com.owncloud.android"
] |
android.content; com.owncloud.android;
| 893,013
|
public JSONArray getStepResult(String stepName) {
return json().getJSONObject("results").getJSONArray(stepName);
}
|
JSONArray function(String stepName) { return json().getJSONObject(STR).getJSONArray(stepName); }
|
/**
* returns the assembly result of a particular step.
*
* @param stepName the name of the step.
* @return {@link JSONArray} the assembly result of the specified step.
*/
|
returns the assembly result of a particular step
|
getStepResult
|
{
"repo_name": "transloadit/java-sdk",
"path": "src/main/java/com/transloadit/sdk/response/AssemblyResponse.java",
"license": "mit",
"size": 4493
}
|
[
"org.json.JSONArray"
] |
import org.json.JSONArray;
|
import org.json.*;
|
[
"org.json"
] |
org.json;
| 213,069
|
public static void closeQuietly(Statement stmt)
{
if (stmt != null)
{
try
{
stmt.close();
}
catch (SQLException ignored)
{ }
}
}
|
static void function(Statement stmt) { if (stmt != null) { try { stmt.close(); } catch (SQLException ignored) { } } }
|
/**
* Closes the passed <code>ResultSet</code> ignoring exceptions. This is usually
* called in a <code>finally</code> block, and throwing an exception there would
* overwrite any exception thrown by the main code (and if there is an exception
* when closing, there probably was one there as well).
*/
|
Closes the passed <code>ResultSet</code> ignoring exceptions. This is usually called in a <code>finally</code> block, and throwing an exception there would overwrite any exception thrown by the main code (and if there is an exception when closing, there probably was one there as well)
|
closeQuietly
|
{
"repo_name": "sirinath/kdgcommons",
"path": "src/main/java/net/sf/kdgcommons/sql/JDBCUtil.java",
"license": "apache-2.0",
"size": 2623
}
|
[
"java.sql.SQLException",
"java.sql.Statement"
] |
import java.sql.SQLException; import java.sql.Statement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 779,232
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.