method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
|---|---|---|---|---|---|---|---|---|---|---|---|
public void setPeerEntityMetadata(EntityDescriptor metadata);
|
void function(EntityDescriptor metadata);
|
/**
* Sets the peer entity metadata.
*
* @param metadata peer entity metadata
*/
|
Sets the peer entity metadata
|
setPeerEntityMetadata
|
{
"repo_name": "Safewhere/kombit-service-java",
"path": "OpenSaml/src/org/opensaml/common/binding/SAMLMessageContext.java",
"license": "mit",
"size": 10786
}
|
[
"org.opensaml.saml2.metadata.EntityDescriptor"
] |
import org.opensaml.saml2.metadata.EntityDescriptor;
|
import org.opensaml.saml2.metadata.*;
|
[
"org.opensaml.saml2"
] |
org.opensaml.saml2;
| 1,124,877
|
public GitAddResponse add(File repositoryPath, List<File> files) throws JavaGitException,
IOException {
GitAddOptions options = null;
return add(repositoryPath, options, files);
}
|
GitAddResponse function(File repositoryPath, List<File> files) throws JavaGitException, IOException { GitAddOptions options = null; return add(repositoryPath, options, files); }
|
/**
* Adds a list of files with no GitAddOptions.
*/
|
Adds a list of files with no GitAddOptions
|
add
|
{
"repo_name": "bit-man/SwissArmyJavaGit",
"path": "javagit/src/main/java/edu/nyu/cs/javagit/client/cli/CliGitAdd.java",
"license": "lgpl-2.1",
"size": 10664
}
|
[
"edu.nyu.cs.javagit.api.JavaGitException",
"edu.nyu.cs.javagit.api.commands.GitAddOptions",
"edu.nyu.cs.javagit.api.commands.GitAddResponse",
"java.io.File",
"java.io.IOException",
"java.util.List"
] |
import edu.nyu.cs.javagit.api.JavaGitException; import edu.nyu.cs.javagit.api.commands.GitAddOptions; import edu.nyu.cs.javagit.api.commands.GitAddResponse; import java.io.File; import java.io.IOException; import java.util.List;
|
import edu.nyu.cs.javagit.api.*; import edu.nyu.cs.javagit.api.commands.*; import java.io.*; import java.util.*;
|
[
"edu.nyu.cs",
"java.io",
"java.util"
] |
edu.nyu.cs; java.io; java.util;
| 85,495
|
public static Function<? super Machine, Optional<Long>> requestAge(final DateTime now) {
return new RequestAge(now);
}
|
static Function<? super Machine, Optional<Long>> function(final DateTime now) { return new RequestAge(now); }
|
/**
* Optionally returns how many milliseconds ago a request was made.
*
* @param now
* The time to regard as the current time.
* @return A {@link Function} that given a {@link Machine} and the current
* time returns how many milliseconds ago it was requested from the
* underlying cloud infrastructure. Since not all clouds support
* reporting how old a request is, the return value is optional.
*/
|
Optionally returns how many milliseconds ago a request was made
|
requestAge
|
{
"repo_name": "Eeemil/scale.cloudpool",
"path": "api/src/main/java/com/elastisys/scale/cloudpool/api/types/Machine.java",
"license": "apache-2.0",
"size": 37731
}
|
[
"com.google.common.base.Function",
"com.google.common.base.Optional",
"org.joda.time.DateTime"
] |
import com.google.common.base.Function; import com.google.common.base.Optional; import org.joda.time.DateTime;
|
import com.google.common.base.*; import org.joda.time.*;
|
[
"com.google.common",
"org.joda.time"
] |
com.google.common; org.joda.time;
| 146,477
|
private void handleDrop(int x, int y) {
if (!mReorderHelper.hasReorderListener()) {
updateReorderStates(ReorderUtils.DRAG_STATE_NONE);
return;
}
if (mReorderHelper.isOverReorderingArea()) {
// Store the location of the drag shadow at where dragging stopped
// for animation if a reordering has just happened. Since the drag
// shadow is drawn as a WindowManager view, its coordinates are
// absolute. However, for views inside the grid, we need to operate
// with coordinate values that's relative to this grid, so we need
// to subtract the offset to absolute screen coordinates that have
// been added to mWindowParams.
final int left = mWindowParams.x - mOffsetToAbsoluteX;
final int top = mWindowParams.y - mOffsetToAbsoluteY;
mCachedDragViewRect = new Rect(
left, top, left + mDragView.getWidth(), top + mDragView.getHeight());
if (getChildCount() > 0) {
final View view = getChildAt(0);
final LayoutParams lp = (LayoutParams) view.getLayoutParams();
if (lp.position > mReorderHelper.getDraggedChildPosition()) {
// If the adapter position of the first child in view is
// greater than the position of the original dragged child,
// this means that the user has scrolled the child out of
// view. Those off screen views would have been recycled. If
// mFirstPosition is currently x, after the reordering
// operation, the child[mFirstPosition] will be
// at mFirstPosition-1. We want to adjust mFirstPosition so
// that we render the view in the correct location after
// reordering completes.
//
// If the user has not scrolled the original dragged child
// out of view, then the view has not been recycled and is
// still in view.
// When onLayout() gets called, we'll automatically fill in
// the empty space that the child leaves behind from the
// reordering operation.
mFirstPosition--;
}
}
// Get the current scroll position so that after reordering
// completes, we can restore the scroll position of mFirstPosition.
mCurrentScrollState = getScrollState();
}
final boolean reordered = mReorderHelper.handleDrop(new Point(x, y));
if (reordered) {
updateReorderStates(ReorderUtils.DRAG_STATE_RELEASED_REORDER);
} else {
updateReorderStates(ReorderUtils.DRAG_STATE_NONE);
}
}
|
void function(int x, int y) { if (!mReorderHelper.hasReorderListener()) { updateReorderStates(ReorderUtils.DRAG_STATE_NONE); return; } if (mReorderHelper.isOverReorderingArea()) { final int left = mWindowParams.x - mOffsetToAbsoluteX; final int top = mWindowParams.y - mOffsetToAbsoluteY; mCachedDragViewRect = new Rect( left, top, left + mDragView.getWidth(), top + mDragView.getHeight()); if (getChildCount() > 0) { final View view = getChildAt(0); final LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp.position > mReorderHelper.getDraggedChildPosition()) { mFirstPosition--; } } mCurrentScrollState = getScrollState(); } final boolean reordered = mReorderHelper.handleDrop(new Point(x, y)); if (reordered) { updateReorderStates(ReorderUtils.DRAG_STATE_RELEASED_REORDER); } else { updateReorderStates(ReorderUtils.DRAG_STATE_NONE); } }
|
/**
* Handle the the release of a dragged view.
* @param x The current x coordinate where the drag was released.
* @param y The current y coordinate where the drag was released.
*/
|
Handle the the release of a dragged view
|
handleDrop
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/DeskClock/src/com/android/deskclock/widget/sgv/StaggeredGridView.java",
"license": "gpl-3.0",
"size": 168058
}
|
[
"android.graphics.Point",
"android.graphics.Rect",
"android.view.View"
] |
import android.graphics.Point; import android.graphics.Rect; import android.view.View;
|
import android.graphics.*; import android.view.*;
|
[
"android.graphics",
"android.view"
] |
android.graphics; android.view;
| 2,178,860
|
Single<Long> remainTimeToLive(K key);
|
Single<Long> remainTimeToLive(K key);
|
/**
* Remaining time to live of map entry associated with a <code>key</code>.
*
* @param key - map key
* @return time in milliseconds
* -2 if the key does not exist.
* -1 if the key exists but has no associated expire.
*/
|
Remaining time to live of map entry associated with a <code>key</code>
|
remainTimeToLive
|
{
"repo_name": "mrniko/redisson",
"path": "redisson/src/main/java/org/redisson/api/RMapCacheRx.java",
"license": "apache-2.0",
"size": 9797
}
|
[
"io.reactivex.rxjava3.core.Single"
] |
import io.reactivex.rxjava3.core.Single;
|
import io.reactivex.rxjava3.core.*;
|
[
"io.reactivex.rxjava3"
] |
io.reactivex.rxjava3;
| 1,018,732
|
public static String getTypeKey(final DataBucketBean bucket, final ObjectMapper mapper) {
return Optional.ofNullable(bucket.data_schema())
.map(DataSchemaBean::search_index_schema)
.filter(s -> Optional.ofNullable(s.enabled()).orElse(true))
.map(DataSchemaBean.SearchIndexSchemaBean::technology_override_schema)
.map(t -> BeanTemplateUtils.from(mapper.convertValue(t, JsonNode.class), SearchIndexSchemaDefaultBean.class).get())
.<String>map(cfg -> {
return Patterns.match(cfg.collide_policy()).<String>andReturn()
.when(cp -> SearchIndexSchemaDefaultBean.CollidePolicy.error == cp,
__ -> Optional.ofNullable(cfg.type_name_or_prefix()).orElse(ElasticsearchIndexServiceConfigBean.DEFAULT_FIXED_TYPE_NAME)) // (ie falls through to default below)
.otherwise(__ -> null);
})
.orElse("_default_"); // (the default - "auto type")
}
/////////////////////////////////////////////////////////////////////
// MAPPINGS - DEFAULTS
|
static String function(final DataBucketBean bucket, final ObjectMapper mapper) { return Optional.ofNullable(bucket.data_schema()) .map(DataSchemaBean::search_index_schema) .filter(s -> Optional.ofNullable(s.enabled()).orElse(true)) .map(DataSchemaBean.SearchIndexSchemaBean::technology_override_schema) .map(t -> BeanTemplateUtils.from(mapper.convertValue(t, JsonNode.class), SearchIndexSchemaDefaultBean.class).get()) .<String>map(cfg -> { return Patterns.match(cfg.collide_policy()).<String>andReturn() .when(cp -> SearchIndexSchemaDefaultBean.CollidePolicy.error == cp, __ -> Optional.ofNullable(cfg.type_name_or_prefix()).orElse(ElasticsearchIndexServiceConfigBean.DEFAULT_FIXED_TYPE_NAME)) .otherwise(__ -> null); }) .orElse(STR); }
|
/** Returns either a specifc type name, or "_default_" if auto types are used
* @param bucket
* @return
*/
|
Returns either a specifc type name, or "_default_" if auto types are used
|
getTypeKey
|
{
"repo_name": "robgil/Aleph2-contrib",
"path": "aleph2_search_index_service_elasticsearch/src/com/ikanow/aleph2/search_service/elasticsearch/utils/ElasticsearchIndexUtils.java",
"license": "apache-2.0",
"size": 34925
}
|
[
"com.fasterxml.jackson.databind.JsonNode",
"com.fasterxml.jackson.databind.ObjectMapper",
"com.ikanow.aleph2.data_model.objects.data_import.DataBucketBean",
"com.ikanow.aleph2.data_model.objects.data_import.DataSchemaBean",
"com.ikanow.aleph2.data_model.utils.BeanTemplateUtils",
"com.ikanow.aleph2.data_model.utils.Patterns",
"com.ikanow.aleph2.search_service.elasticsearch.data_model.ElasticsearchIndexServiceConfigBean",
"java.util.Optional"
] |
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.ikanow.aleph2.data_model.objects.data_import.DataBucketBean; import com.ikanow.aleph2.data_model.objects.data_import.DataSchemaBean; import com.ikanow.aleph2.data_model.utils.BeanTemplateUtils; import com.ikanow.aleph2.data_model.utils.Patterns; import com.ikanow.aleph2.search_service.elasticsearch.data_model.ElasticsearchIndexServiceConfigBean; import java.util.Optional;
|
import com.fasterxml.jackson.databind.*; import com.ikanow.aleph2.data_model.objects.data_import.*; import com.ikanow.aleph2.data_model.utils.*; import com.ikanow.aleph2.search_service.elasticsearch.data_model.*; import java.util.*;
|
[
"com.fasterxml.jackson",
"com.ikanow.aleph2",
"java.util"
] |
com.fasterxml.jackson; com.ikanow.aleph2; java.util;
| 2,679,896
|
private boolean rootedInComponent(TypeElement eitherComponent) {
while (eitherComponent != null && !utils.isComponent(eitherComponent)) {
eitherComponent = componentToParentMap.get(eitherComponent);
}
return eitherComponent != null;
}
|
boolean function(TypeElement eitherComponent) { while (eitherComponent != null && !utils.isComponent(eitherComponent)) { eitherComponent = componentToParentMap.get(eitherComponent); } return eitherComponent != null; }
|
/**
* Returns whether the given (sub)component finally has a Component ancestor or itself is a
* component.
*/
|
Returns whether the given (sub)component finally has a Component ancestor or itself is a component
|
rootedInComponent
|
{
"repo_name": "googlearchive/tiger",
"path": "src/main/java/tiger/Tiger3ProcessorForComponent.java",
"license": "apache-2.0",
"size": 10366
}
|
[
"javax.lang.model.element.TypeElement"
] |
import javax.lang.model.element.TypeElement;
|
import javax.lang.model.element.*;
|
[
"javax.lang"
] |
javax.lang;
| 117,152
|
public static void checkOrder(double[] val, OrderDirection dir,
boolean strict) throws NonMonotonicSequenceException {
checkOrder(val, dir, strict, true);
}
|
static void function(double[] val, OrderDirection dir, boolean strict) throws NonMonotonicSequenceException { checkOrder(val, dir, strict, true); }
|
/**
* Check that the given array is sorted.
*
* @param val Values.
* @param dir Ordering direction.
* @param strict Whether the order should be strict.
* @throws NonMonotonicSequenceException if the array is not sorted.
* @since 2.2
*/
|
Check that the given array is sorted
|
checkOrder
|
{
"repo_name": "venkateshamurthy/java-quantiles",
"path": "src/main/java/org/apache/commons/math3/util/MathArrays.java",
"license": "apache-2.0",
"size": 68780
}
|
[
"org.apache.commons.math3.exception.NonMonotonicSequenceException"
] |
import org.apache.commons.math3.exception.NonMonotonicSequenceException;
|
import org.apache.commons.math3.exception.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 1,252,509
|
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
|
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
|
/**
* Sets list of Optional Tlvs in RP Object and returns its builder.
*
* @param llOptionalTlv list of Optional Tlvs
*/
|
Sets list of Optional Tlvs in RP Object and returns its builder
|
setOptionalTlv
|
{
"repo_name": "kuujo/onos",
"path": "protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepRPObject.java",
"license": "apache-2.0",
"size": 6389
}
|
[
"java.util.LinkedList",
"org.onosproject.pcepio.types.PcepValueType"
] |
import java.util.LinkedList; import org.onosproject.pcepio.types.PcepValueType;
|
import java.util.*; import org.onosproject.pcepio.types.*;
|
[
"java.util",
"org.onosproject.pcepio"
] |
java.util; org.onosproject.pcepio;
| 1,789,202
|
private void dispatchBundle(OSCBundle bundle)
{
Date timestamp = bundle.getTimestamp();
OSCPacket[] packets = bundle.getPackets();
for (int i = 0; i < packets.length; i++)
{
dispatchPacket(packets[i], timestamp);
}
}
|
void function(OSCBundle bundle) { Date timestamp = bundle.getTimestamp(); OSCPacket[] packets = bundle.getPackets(); for (int i = 0; i < packets.length; i++) { dispatchPacket(packets[i], timestamp); } }
|
/**
* Dispatch bundle.
*
* @param bundle
* the bundle
*/
|
Dispatch bundle
|
dispatchBundle
|
{
"repo_name": "synergynet/synergynet3.1",
"path": "synergynet3.1-parent/multiplicity3-input/src/main/java/com/illposed/osc/utility/OSCPacketDispatcher.java",
"license": "bsd-3-clause",
"size": 4275
}
|
[
"com.illposed.osc.OSCBundle",
"com.illposed.osc.OSCPacket",
"java.util.Date"
] |
import com.illposed.osc.OSCBundle; import com.illposed.osc.OSCPacket; import java.util.Date;
|
import com.illposed.osc.*; import java.util.*;
|
[
"com.illposed.osc",
"java.util"
] |
com.illposed.osc; java.util;
| 1,410,452
|
public void onCallHangUp(IMXCall call);
}
public enum CallClass {
CHROME_CLASS,
JINGLE_CLASS,
DEFAULT_CLASS
}
private MXSession mSession = null;
private Context mContext = null;
private CallRestClient mCallResClient = null;
private JsonElement mTurnServer = null;
private Timer mTurnServerTimer = null;
private Boolean mSuspendTurnServerRefresh = false;
private CallClass mPreferredCallClass = CallClass.JINGLE_CLASS;
// UI thread handler
final Handler mUIThreadHandler = new Handler();
// active calls
private HashMap<String, IMXCall> mCallsByCallId = new HashMap<String, IMXCall>();
// listeners
private ArrayList<MXCallsManagerListener> mListeners = new ArrayList<MXCallsManagerListener>();
// incoming calls
private ArrayList<String> mxPendingIncomingCallId = new ArrayList<String>();
public MXCallsManager(MXSession session, Context context) {
mSession = session;
mContext = context;
mCallResClient = mSession.getCallRestClient();
refreshTurnServer();
}
|
void function(IMXCall call); } public enum CallClass { CHROME_CLASS, JINGLE_CLASS, DEFAULT_CLASS } private MXSession mSession = null; private Context mContext = null; private CallRestClient mCallResClient = null; private JsonElement mTurnServer = null; private Timer mTurnServerTimer = null; private Boolean mSuspendTurnServerRefresh = false; private CallClass mPreferredCallClass = CallClass.JINGLE_CLASS; final Handler mUIThreadHandler = new Handler(); private HashMap<String, IMXCall> mCallsByCallId = new HashMap<String, IMXCall>(); private ArrayList<MXCallsManagerListener> mListeners = new ArrayList<MXCallsManagerListener>(); private ArrayList<String> mxPendingIncomingCallId = new ArrayList<String>(); public MXCallsManager(MXSession session, Context context) { mSession = session; mContext = context; mCallResClient = mSession.getCallRestClient(); refreshTurnServer(); }
|
/**
* Called when a called has been hung up
*/
|
Called when a called has been hung up
|
onCallHangUp
|
{
"repo_name": "Nehasing/Nehachat",
"path": "matrix-sdk/src/main/java/org/matrix/androidsdk/call/MXCallsManager.java",
"license": "apache-2.0",
"size": 17172
}
|
[
"android.content.Context",
"android.os.Handler",
"com.google.gson.JsonElement",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.Timer",
"org.matrix.androidsdk.MXSession",
"org.matrix.androidsdk.rest.client.CallRestClient"
] |
import android.content.Context; import android.os.Handler; import com.google.gson.JsonElement; import java.util.ArrayList; import java.util.HashMap; import java.util.Timer; import org.matrix.androidsdk.MXSession; import org.matrix.androidsdk.rest.client.CallRestClient;
|
import android.content.*; import android.os.*; import com.google.gson.*; import java.util.*; import org.matrix.androidsdk.*; import org.matrix.androidsdk.rest.client.*;
|
[
"android.content",
"android.os",
"com.google.gson",
"java.util",
"org.matrix.androidsdk"
] |
android.content; android.os; com.google.gson; java.util; org.matrix.androidsdk;
| 51,792
|
public Writer createOutput(final String name) throws IOException
{
final String fileName = toLowerSnakeCase(name) + ".rs";
final File targetFile = new File(srcDir, fileName);
return Files.newBufferedWriter(targetFile.toPath(), UTF_8);
}
|
Writer function(final String name) throws IOException { final String fileName = toLowerSnakeCase(name) + ".rs"; final File targetFile = new File(srcDir, fileName); return Files.newBufferedWriter(targetFile.toPath(), UTF_8); }
|
/**
* Create a new output which will be a rust source file in the given module.
* <p>
* The {@link java.io.Writer} should be closed once the caller has finished with it. The Writer is
* buffered for efficient IO operations.
*
* @param name the name of the rust struct.
* @return a {@link java.io.Writer} to which the source code should be written.
* @throws IOException if an issue occurs when creating the file.
*/
|
Create a new output which will be a rust source file in the given module. The <code>java.io.Writer</code> should be closed once the caller has finished with it. The Writer is buffered for efficient IO operations
|
createOutput
|
{
"repo_name": "PKRoma/simple-binary-encoding",
"path": "sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustOutputManager.java",
"license": "apache-2.0",
"size": 3733
}
|
[
"java.io.File",
"java.io.IOException",
"java.io.Writer",
"java.nio.file.Files",
"uk.co.real_logic.sbe.generation.rust.RustUtil"
] |
import java.io.File; import java.io.IOException; import java.io.Writer; import java.nio.file.Files; import uk.co.real_logic.sbe.generation.rust.RustUtil;
|
import java.io.*; import java.nio.file.*; import uk.co.real_logic.sbe.generation.rust.*;
|
[
"java.io",
"java.nio",
"uk.co.real_logic"
] |
java.io; java.nio; uk.co.real_logic;
| 1,258,336
|
protected void onCrafting(ItemStack par1ItemStack, int par2)
{
this.field_75228_b += par2;
this.onCrafting(par1ItemStack);
}
|
void function(ItemStack par1ItemStack, int par2) { this.field_75228_b += par2; this.onCrafting(par1ItemStack); }
|
/**
* the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an
* internal count then calls onCrafting(item).
*/
|
the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an internal count then calls onCrafting(item)
|
onCrafting
|
{
"repo_name": "NEMESIS13cz/Evercraft",
"path": "java/evercraft/NEMESIS13cz/TileEntity/Slot/SlotHighTemperatureFurnace.java",
"license": "gpl-3.0",
"size": 3254
}
|
[
"net.minecraft.item.ItemStack"
] |
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.*;
|
[
"net.minecraft.item"
] |
net.minecraft.item;
| 1,645,291
|
public static int[] getVersion() {
IntByReference minor = new IntByReference();
IntByReference major = new IntByReference();
IntByReference extra = new IntByReference();
rbd.rbd_version(minor, major, extra);
int[] returnValue = {minor.getValue(), major.getValue(), extra.getValue()};
return returnValue;
}
public Rbd(IoCTX io) {
this.io = io.getPointer();
}
|
static int[] function() { IntByReference minor = new IntByReference(); IntByReference major = new IntByReference(); IntByReference extra = new IntByReference(); rbd.rbd_version(minor, major, extra); int[] returnValue = {minor.getValue(), major.getValue(), extra.getValue()}; return returnValue; } public Rbd(IoCTX io) { this.io = io.getPointer(); }
|
/**
* Get the librbd version
*
* @return a int array with the minor, major and extra version
*/
|
Get the librbd version
|
getVersion
|
{
"repo_name": "ceph/rados-java",
"path": "src/main/java/com/ceph/rbd/Rbd.java",
"license": "apache-2.0",
"size": 11354
}
|
[
"com.ceph.rados.IoCTX",
"com.sun.jna.ptr.IntByReference"
] |
import com.ceph.rados.IoCTX; import com.sun.jna.ptr.IntByReference;
|
import com.ceph.rados.*; import com.sun.jna.ptr.*;
|
[
"com.ceph.rados",
"com.sun.jna"
] |
com.ceph.rados; com.sun.jna;
| 1,484,275
|
private void initForm()
{
theFrame = new JFrame(getName() + " (" + Debrief.GUI.VersionInfo.getVersion() + ")");
|
void function() { theFrame = new JFrame(getName() + STR + Debrief.GUI.VersionInfo.getVersion() + ")");
|
/**
* fill in the UI details
*/
|
fill in the UI details
|
initForm
|
{
"repo_name": "theanuradha/debrief",
"path": "org.mwc.debrief.legacy/src/Debrief/GUI/Frames/Swing/SwingApplication.java",
"license": "epl-1.0",
"size": 29752
}
|
[
"javax.swing.JFrame"
] |
import javax.swing.JFrame;
|
import javax.swing.*;
|
[
"javax.swing"
] |
javax.swing;
| 763,672
|
protected int toDto_price(final Car in) {
return in.getPrice();
}
|
int function(final Car in) { return in.getPrice(); }
|
/**
* Maps the property price from the given entity to dto property.
*
* @param in - The source entity
* @return the mapped value
*
*/
|
Maps the property price from the given entity to dto property
|
toDto_price
|
{
"repo_name": "lunifera/lunifera-dsl",
"path": "org.lunifera.dsl.entity.xtext.tests/src-gen/org/lunifera/dsl/entity/xtext/tests/model/testcarstore2/mapper/CarDtoMapper.java",
"license": "epl-1.0",
"size": 6149
}
|
[
"org.lunifera.dsl.entity.xtext.tests.model.testcarstore2.Car"
] |
import org.lunifera.dsl.entity.xtext.tests.model.testcarstore2.Car;
|
import org.lunifera.dsl.entity.xtext.tests.model.testcarstore2.*;
|
[
"org.lunifera.dsl"
] |
org.lunifera.dsl;
| 1,738,454
|
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof XYBarRenderer)) {
return false;
}
XYBarRenderer that = (XYBarRenderer) obj;
if (this.base != that.base) {
return false;
}
if (this.drawBarOutline != that.drawBarOutline) {
return false;
}
if (this.margin != that.margin) {
return false;
}
if (this.useYInterval != that.useYInterval) {
return false;
}
if (!ObjectUtilities.equal(this.gradientPaintTransformer,
that.gradientPaintTransformer)) {
return false;
}
if (!ShapeUtilities.equal(this.legendBar, that.legendBar)) {
return false;
}
if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback,
that.positiveItemLabelPositionFallback)) {
return false;
}
if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback,
that.negativeItemLabelPositionFallback)) {
return false;
}
if (!this.barPainter.equals(that.barPainter)) {
return false;
}
if (this.shadowsVisible != that.shadowsVisible) {
return false;
}
if (this.shadowXOffset != that.shadowXOffset) {
return false;
}
if (this.shadowYOffset != that.shadowYOffset) {
return false;
}
if (this.barAlignmentFactor != that.barAlignmentFactor) {
return false;
}
return super.equals(obj);
}
|
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof XYBarRenderer)) { return false; } XYBarRenderer that = (XYBarRenderer) obj; if (this.base != that.base) { return false; } if (this.drawBarOutline != that.drawBarOutline) { return false; } if (this.margin != that.margin) { return false; } if (this.useYInterval != that.useYInterval) { return false; } if (!ObjectUtilities.equal(this.gradientPaintTransformer, that.gradientPaintTransformer)) { return false; } if (!ShapeUtilities.equal(this.legendBar, that.legendBar)) { return false; } if (!ObjectUtilities.equal(this.positiveItemLabelPositionFallback, that.positiveItemLabelPositionFallback)) { return false; } if (!ObjectUtilities.equal(this.negativeItemLabelPositionFallback, that.negativeItemLabelPositionFallback)) { return false; } if (!this.barPainter.equals(that.barPainter)) { return false; } if (this.shadowsVisible != that.shadowsVisible) { return false; } if (this.shadowXOffset != that.shadowXOffset) { return false; } if (this.shadowYOffset != that.shadowYOffset) { return false; } if (this.barAlignmentFactor != that.barAlignmentFactor) { return false; } return super.equals(obj); }
|
/**
* Tests this renderer for equality with an arbitrary object.
*
* @param obj the object to test against (<code>null</code> permitted).
*
* @return A boolean.
*/
|
Tests this renderer for equality with an arbitrary object
|
equals
|
{
"repo_name": "aaronc/jfreechart",
"path": "source/org/jfree/chart/renderer/xy/XYBarRenderer.java",
"license": "lgpl-2.1",
"size": 45098
}
|
[
"org.jfree.util.ObjectUtilities",
"org.jfree.util.ShapeUtilities"
] |
import org.jfree.util.ObjectUtilities; import org.jfree.util.ShapeUtilities;
|
import org.jfree.util.*;
|
[
"org.jfree.util"
] |
org.jfree.util;
| 1,636,281
|
public Set<String> getUsersWithTickets(boolean nonExpiredOnly);
|
Set<String> function(boolean nonExpiredOnly);
|
/**
* Get set of users with tickets
*
* This may be lower than the ticket count, since a user can have more than one ticket/session
*
* @param nonExpiredOnly true for non expired tickets, false for all (including expired) tickets
* @return Set<String> set of users with (one or more) tickets
*/
|
Get set of users with tickets This may be lower than the ticket count, since a user can have more than one ticket/session
|
getUsersWithTickets
|
{
"repo_name": "daniel-he/community-edition",
"path": "projects/data-model/source/java/org/alfresco/repo/security/authentication/TicketComponent.java",
"license": "lgpl-3.0",
"size": 4282
}
|
[
"java.util.Set"
] |
import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,229,806
|
@Override
protected final ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)
throws Exception {
for (DelegateController delegate : delegates) {
if (delegate.canHandle(request, response)) {
return delegate.handleRequest(request, response);
}
}
return generateErrorView("INVALID_REQUEST", "INVALID_REQUEST", null);
}
|
final ModelAndView function(final HttpServletRequest request, final HttpServletResponse response) throws Exception { for (DelegateController delegate : delegates) { if (delegate.canHandle(request, response)) { return delegate.handleRequest(request, response); } } return generateErrorView(STR, STR, null); }
|
/**
* Handles the request.
* Ask all delegates if they can handle the current request.
* The first to answer true is elected as the delegate that will process the request.
* If no controller answers true, we redirect to the error page.
* @param request the request to handle
* @param response the response to write to
* @return the model and view object
* @throws Exception if an error occurs during request handling
*/
|
Handles the request. Ask all delegates if they can handle the current request. The first to answer true is elected as the delegate that will process the request. If no controller answers true, we redirect to the error page
|
handleRequestInternal
|
{
"repo_name": "mabes/cas",
"path": "cas-server-webapp-support/src/main/java/org/jasig/cas/web/DelegatingController.java",
"license": "apache-2.0",
"size": 3733
}
|
[
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.springframework.web.servlet.ModelAndView"
] |
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView;
|
import javax.servlet.http.*; import org.springframework.web.servlet.*;
|
[
"javax.servlet",
"org.springframework.web"
] |
javax.servlet; org.springframework.web;
| 2,088,905
|
private static boolean isInContext(DetailAST aAST, int[][] aContextSet)
{
for (int[] element : aContextSet) {
DetailAST current = aAST;
final int len = element.length;
for (int j = 0; j < len; j++) {
current = current.getParent();
final int expectedType = element[j];
if ((current == null) || (current.getType() != expectedType)) {
break;
}
if (j == len - 1) {
return true;
}
}
}
return false;
}
|
static boolean function(DetailAST aAST, int[][] aContextSet) { for (int[] element : aContextSet) { DetailAST current = aAST; final int len = element.length; for (int j = 0; j < len; j++) { current = current.getParent(); final int expectedType = element[j]; if ((current == null) (current.getType() != expectedType)) { break; } if (j == len - 1) { return true; } } } return false; }
|
/**
* Tests whether the provided AST is in
* one of the given contexts.
*
* @param aAST the AST from which to start walking towards root
* @param aContextSet the contexts to test against.
*
* @return whether the parents nodes of aAST match
* one of the allowed type paths
*/
|
Tests whether the provided AST is in one of the given contexts
|
isInContext
|
{
"repo_name": "maikelsteneker/checkstyle-throwsIndent",
"path": "src/checkstyle/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheck.java",
"license": "lgpl-2.1",
"size": 7542
}
|
[
"com.puppycrawl.tools.checkstyle.api.DetailAST"
] |
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
import com.puppycrawl.tools.checkstyle.api.*;
|
[
"com.puppycrawl.tools"
] |
com.puppycrawl.tools;
| 5,843
|
@Override
public synchronized void open() throws IOException {
open(maxIO, true);
}
|
synchronized void function() throws IOException { open(maxIO, true); }
|
/**
* this.maxIO represents the default maxIO.
* Some operations while initializing files on the journal may require a different maxIO
*/
|
this.maxIO represents the default maxIO. Some operations while initializing files on the journal may require a different maxIO
|
open
|
{
"repo_name": "gaohoward/activemq-artemis",
"path": "artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/nio/NIOSequentialFile.java",
"license": "apache-2.0",
"size": 12131
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 916,475
|
private static void createSymbolicLink(
java.nio.file.Path libPath, java.nio.file.Path symbolicLinkPath) throws IOException {
try {
Files.createSymbolicLink(symbolicLinkPath, libPath);
} catch (IOException e) {
LOG.warn(
"Create symbol link from {} to {} failed and copy instead.",
symbolicLinkPath,
libPath,
e);
Files.copy(libPath, symbolicLinkPath);
}
}
|
static void function( java.nio.file.Path libPath, java.nio.file.Path symbolicLinkPath) throws IOException { try { Files.createSymbolicLink(symbolicLinkPath, libPath); } catch (IOException e) { LOG.warn( STR, symbolicLinkPath, libPath, e); Files.copy(libPath, symbolicLinkPath); } }
|
/**
* Creates symbolLink in working directory for pyflink lib.
*
* @param libPath the pyflink lib file path.
* @param symbolicLinkPath the symbolic link to pyflink lib.
*/
|
Creates symbolLink in working directory for pyflink lib
|
createSymbolicLink
|
{
"repo_name": "aljoscha/flink",
"path": "flink-python/src/main/java/org/apache/flink/client/python/PythonEnvUtils.java",
"license": "apache-2.0",
"size": 17615
}
|
[
"java.io.IOException",
"java.nio.file.Files",
"org.apache.flink.core.fs.Path"
] |
import java.io.IOException; import java.nio.file.Files; import org.apache.flink.core.fs.Path;
|
import java.io.*; import java.nio.file.*; import org.apache.flink.core.fs.*;
|
[
"java.io",
"java.nio",
"org.apache.flink"
] |
java.io; java.nio; org.apache.flink;
| 1,372,413
|
public void unassociates(Variable variable) {
if (variable.getNbProps() > 0) {
throw new SolverException("Try to remove a variable (" + variable.getName() + ")which is still involved in at least one constraint");
}
int idx = 0;
for (; idx < vIdx; idx++) {
if (variable == vars[idx]) break;
}
System.arraycopy(vars, idx + 1, vars, idx + 1 - 1, vIdx - (idx + 1));
vars[--vIdx] = null;
switch ((variable.getTypeAndKind() & Variable.KIND)) {
case Variable.INT:
nbIntVar--;
break;
case Variable.BOOL:
nbBoolVar--;
break;
case Variable.SET:
nbSetVar--;
break;
case Variable.REAL:
nbRealVar--;
break;
}
}
|
void function(Variable variable) { if (variable.getNbProps() > 0) { throw new SolverException(STR + variable.getName() + STR); } int idx = 0; for (; idx < vIdx; idx++) { if (variable == vars[idx]) break; } System.arraycopy(vars, idx + 1, vars, idx + 1 - 1, vIdx - (idx + 1)); vars[--vIdx] = null; switch ((variable.getTypeAndKind() & Variable.KIND)) { case Variable.INT: nbIntVar--; break; case Variable.BOOL: nbBoolVar--; break; case Variable.SET: nbSetVar--; break; case Variable.REAL: nbRealVar--; break; } }
|
/**
* Unlink the variable from <code>this</code>.
* Should not be called by the user.
*
* @param variable variable to un-associate
*/
|
Unlink the variable from <code>this</code>. Should not be called by the user
|
unassociates
|
{
"repo_name": "chocoteam/choco3",
"path": "src/main/java/org/chocosolver/solver/Model.java",
"license": "bsd-3-clause",
"size": 34609
}
|
[
"org.chocosolver.solver.exception.SolverException",
"org.chocosolver.solver.variables.Variable"
] |
import org.chocosolver.solver.exception.SolverException; import org.chocosolver.solver.variables.Variable;
|
import org.chocosolver.solver.exception.*; import org.chocosolver.solver.variables.*;
|
[
"org.chocosolver.solver"
] |
org.chocosolver.solver;
| 2,477,099
|
public void insert(ServerRequestContext context, List registryObjects)
throws RegistryException {
List associations = new java.util.ArrayList();
List classifications = new java.util.ArrayList();
List externalIds = new java.util.ArrayList();
List extrinsicObjects = new java.util.ArrayList();
List packages = new java.util.ArrayList();
sortRegistryObjects(registryObjects, associations,
classifications, externalIds, extrinsicObjects, packages);
if (associations.size() > 0) {
AssociationDAO associationDAO = new AssociationDAO(context);
associationDAO.insert(associations);
}
if (classifications.size() > 0) {
ClassificationDAO classificationDAO = new ClassificationDAO(context);
classificationDAO.insert(classifications);
}
if (externalIds.size() > 0) {
ExternalIdentifierDAO externalIdentifierDAO = new ExternalIdentifierDAO(context);
externalIdentifierDAO.insert(externalIds);
}
if (extrinsicObjects.size() > 0) {
ExtrinsicObjectDAO extrinsicObjectDAO = new ExtrinsicObjectDAO(context);
extrinsicObjectDAO.insert(extrinsicObjects);
}
if (packages.size() > 0) {
RegistryPackageDAO registryPackageDAO = new RegistryPackageDAO(context);
registryPackageDAO.insert(packages);
}
}
|
void function(ServerRequestContext context, List registryObjects) throws RegistryException { List associations = new java.util.ArrayList(); List classifications = new java.util.ArrayList(); List externalIds = new java.util.ArrayList(); List extrinsicObjects = new java.util.ArrayList(); List packages = new java.util.ArrayList(); sortRegistryObjects(registryObjects, associations, classifications, externalIds, extrinsicObjects, packages); if (associations.size() > 0) { AssociationDAO associationDAO = new AssociationDAO(context); associationDAO.insert(associations); } if (classifications.size() > 0) { ClassificationDAO classificationDAO = new ClassificationDAO(context); classificationDAO.insert(classifications); } if (externalIds.size() > 0) { ExternalIdentifierDAO externalIdentifierDAO = new ExternalIdentifierDAO(context); externalIdentifierDAO.insert(externalIds); } if (extrinsicObjects.size() > 0) { ExtrinsicObjectDAO extrinsicObjectDAO = new ExtrinsicObjectDAO(context); extrinsicObjectDAO.insert(extrinsicObjects); } if (packages.size() > 0) { RegistryPackageDAO registryPackageDAO = new RegistryPackageDAO(context); registryPackageDAO.insert(packages); } }
|
/**
* Does a bulk insert of a heterogeneous Collection of RegistrObjects.
*
*/
|
Does a bulk insert of a heterogeneous Collection of RegistrObjects
|
insert
|
{
"repo_name": "kef/hieos",
"path": "src/omar/src/org/freebxml/omar/server/persistence/rdb/SQLPersistenceManagerImpl.java",
"license": "apache-2.0",
"size": 42960
}
|
[
"java.util.ArrayList",
"java.util.List",
"javax.xml.registry.RegistryException",
"org.freebxml.omar.server.common.ServerRequestContext"
] |
import java.util.ArrayList; import java.util.List; import javax.xml.registry.RegistryException; import org.freebxml.omar.server.common.ServerRequestContext;
|
import java.util.*; import javax.xml.registry.*; import org.freebxml.omar.server.common.*;
|
[
"java.util",
"javax.xml",
"org.freebxml.omar"
] |
java.util; javax.xml; org.freebxml.omar;
| 816,749
|
@Test
public void testInconsistentPeerType() throws Exception {
ClientBase.setupTestEnv();
// setup the logger to capture all logs
Layout layout =
Logger.getRootLogger().getAppender("CONSOLE").getLayout();
ByteArrayOutputStream os = new ByteArrayOutputStream();
WriterAppender appender = new WriterAppender(layout, os);
appender.setThreshold(Level.INFO);
Logger qlogger = Logger.getLogger("org.apache.zookeeper.server.quorum");
qlogger.addAppender(appender);
// test the most likely situation only: server is stated as observer in
// servers list, but there's no "peerType=observer" token in config
try {
final int CLIENT_PORT_QP1 = PortAssignment.unique();
final int CLIENT_PORT_QP2 = PortAssignment.unique();
final int CLIENT_PORT_QP3 = PortAssignment.unique();
String quorumCfgSection =
"server.1=127.0.0.1:" + PortAssignment.unique()
+ ":" + PortAssignment.unique()
+ "\nserver.2=127.0.0.1:" + PortAssignment.unique()
+ ":" + PortAssignment.unique()
+ "\nserver.3=127.0.0.1:" + PortAssignment.unique()
+ ":" + PortAssignment.unique() + ":observer";
MainThread q1 = new MainThread(1, CLIENT_PORT_QP1, quorumCfgSection);
MainThread q2 = new MainThread(2, CLIENT_PORT_QP2, quorumCfgSection);
MainThread q3 = new MainThread(3, CLIENT_PORT_QP3, quorumCfgSection);
q1.start();
q2.start();
q3.start();
Assert.assertTrue("waiting for server 1 being up",
ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT_QP1,
CONNECTION_TIMEOUT));
Assert.assertTrue("waiting for server 2 being up",
ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT_QP2,
CONNECTION_TIMEOUT));
Assert.assertTrue("waiting for server 3 being up",
ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT_QP3,
CONNECTION_TIMEOUT));
q1.shutdown();
q2.shutdown();
q3.shutdown();
Assert.assertTrue("waiting for server 1 down",
ClientBase.waitForServerDown("127.0.0.1:" + CLIENT_PORT_QP1,
ClientBase.CONNECTION_TIMEOUT));
Assert.assertTrue("waiting for server 2 down",
ClientBase.waitForServerDown("127.0.0.1:" + CLIENT_PORT_QP2,
ClientBase.CONNECTION_TIMEOUT));
Assert.assertTrue("waiting for server 3 down",
ClientBase.waitForServerDown("127.0.0.1:" + CLIENT_PORT_QP3,
ClientBase.CONNECTION_TIMEOUT));
} finally {
qlogger.removeAppender(appender);
}
LineNumberReader r = new LineNumberReader(new StringReader(os.toString()));
String line;
boolean warningPresent = false;
boolean defaultedToObserver = false;
Pattern pWarn =
Pattern.compile(".*Peer type from servers list.* doesn't match peerType.*");
Pattern pObserve = Pattern.compile(".*OBSERVING.*");
while ((line = r.readLine()) != null) {
if (pWarn.matcher(line).matches()) {
warningPresent = true;
}
if (pObserve.matcher(line).matches()) {
defaultedToObserver = true;
}
if (warningPresent && defaultedToObserver) {
break;
}
}
Assert.assertTrue("Should warn about inconsistent peer type",
warningPresent && defaultedToObserver);
}
|
void function() throws Exception { ClientBase.setupTestEnv(); Layout layout = Logger.getRootLogger().getAppender(STR).getLayout(); ByteArrayOutputStream os = new ByteArrayOutputStream(); WriterAppender appender = new WriterAppender(layout, os); appender.setThreshold(Level.INFO); Logger qlogger = Logger.getLogger(STR); qlogger.addAppender(appender); try { final int CLIENT_PORT_QP1 = PortAssignment.unique(); final int CLIENT_PORT_QP2 = PortAssignment.unique(); final int CLIENT_PORT_QP3 = PortAssignment.unique(); String quorumCfgSection = STR + PortAssignment.unique() + ":" + PortAssignment.unique() + STR + PortAssignment.unique() + ":" + PortAssignment.unique() + STR + PortAssignment.unique() + ":" + PortAssignment.unique() + STR; MainThread q1 = new MainThread(1, CLIENT_PORT_QP1, quorumCfgSection); MainThread q2 = new MainThread(2, CLIENT_PORT_QP2, quorumCfgSection); MainThread q3 = new MainThread(3, CLIENT_PORT_QP3, quorumCfgSection); q1.start(); q2.start(); q3.start(); Assert.assertTrue(STR, ClientBase.waitForServerUp(STR + CLIENT_PORT_QP1, CONNECTION_TIMEOUT)); Assert.assertTrue(STR, ClientBase.waitForServerUp(STR + CLIENT_PORT_QP2, CONNECTION_TIMEOUT)); Assert.assertTrue(STR, ClientBase.waitForServerUp(STR + CLIENT_PORT_QP3, CONNECTION_TIMEOUT)); q1.shutdown(); q2.shutdown(); q3.shutdown(); Assert.assertTrue(STR, ClientBase.waitForServerDown(STR + CLIENT_PORT_QP1, ClientBase.CONNECTION_TIMEOUT)); Assert.assertTrue(STR, ClientBase.waitForServerDown(STR + CLIENT_PORT_QP2, ClientBase.CONNECTION_TIMEOUT)); Assert.assertTrue(STR, ClientBase.waitForServerDown(STR + CLIENT_PORT_QP3, ClientBase.CONNECTION_TIMEOUT)); } finally { qlogger.removeAppender(appender); } LineNumberReader r = new LineNumberReader(new StringReader(os.toString())); String line; boolean warningPresent = false; boolean defaultedToObserver = false; Pattern pWarn = Pattern.compile(STR); Pattern pObserve = Pattern.compile(STR); while ((line = r.readLine()) != null) { if (pWarn.matcher(line).matches()) { warningPresent = true; } if (pObserve.matcher(line).matches()) { defaultedToObserver = true; } if (warningPresent && defaultedToObserver) { break; } } Assert.assertTrue(STR, warningPresent && defaultedToObserver); }
|
/**
* Verify handling of inconsistent peer type
*/
|
Verify handling of inconsistent peer type
|
testInconsistentPeerType
|
{
"repo_name": "shayhatsor/zookeeper",
"path": "src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java",
"license": "apache-2.0",
"size": 48384
}
|
[
"java.io.ByteArrayOutputStream",
"java.io.LineNumberReader",
"java.io.StringReader",
"java.util.regex.Pattern",
"org.apache.log4j.Layout",
"org.apache.log4j.Level",
"org.apache.log4j.Logger",
"org.apache.log4j.WriterAppender",
"org.apache.zookeeper.PortAssignment",
"org.apache.zookeeper.test.ClientBase",
"org.junit.Assert"
] |
import java.io.ByteArrayOutputStream; import java.io.LineNumberReader; import java.io.StringReader; import java.util.regex.Pattern; import org.apache.log4j.Layout; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.WriterAppender; import org.apache.zookeeper.PortAssignment; import org.apache.zookeeper.test.ClientBase; import org.junit.Assert;
|
import java.io.*; import java.util.regex.*; import org.apache.log4j.*; import org.apache.zookeeper.*; import org.apache.zookeeper.test.*; import org.junit.*;
|
[
"java.io",
"java.util",
"org.apache.log4j",
"org.apache.zookeeper",
"org.junit"
] |
java.io; java.util; org.apache.log4j; org.apache.zookeeper; org.junit;
| 975,076
|
public DumpParser getDumpParserForLogfile(InputStream dumpFileStream, Map threadStore, boolean withCurrentTimeStamp, int startCounter) {
BufferedReader bis = null;
int readAheadLimit = PrefManager.get().getStreamResetBuffer();
int lineCounter = 0;
DumpParser currentDumpParser = null;
try {
bis = new BufferedReader(new InputStreamReader(dumpFileStream));
// reset current dump parser
DateMatcher dm = new DateMatcher();
while (bis.ready() && (currentDumpParser == null)) {
bis.mark(readAheadLimit);
String line = bis.readLine();
dm.checkForDateMatch(line);
if (WrappedSunJDKParser.checkForSupportedThreadDump(line)) {
currentDumpParser = new WrappedSunJDKParser(bis, threadStore, lineCounter, withCurrentTimeStamp, startCounter, dm);
} else if (SunJDKParser.checkForSupportedThreadDump(line)) {
currentDumpParser = new SunJDKParser(bis, threadStore, lineCounter, withCurrentTimeStamp, startCounter, dm);
} else if (BeaJDKParser.checkForSupportedThreadDump(line)) {
currentDumpParser = new BeaJDKParser(bis, threadStore, lineCounter, dm);
}
lineCounter++;
}
LOGGER.debug("Selected Dump Parser:{}", currentDumpParser.getClass().getName());
if ((currentDumpParser != null) && (bis != null)) {
bis.reset();
}
} catch (IOException ex) {
ex.printStackTrace();
}
return currentDumpParser;
}
|
DumpParser function(InputStream dumpFileStream, Map threadStore, boolean withCurrentTimeStamp, int startCounter) { BufferedReader bis = null; int readAheadLimit = PrefManager.get().getStreamResetBuffer(); int lineCounter = 0; DumpParser currentDumpParser = null; try { bis = new BufferedReader(new InputStreamReader(dumpFileStream)); DateMatcher dm = new DateMatcher(); while (bis.ready() && (currentDumpParser == null)) { bis.mark(readAheadLimit); String line = bis.readLine(); dm.checkForDateMatch(line); if (WrappedSunJDKParser.checkForSupportedThreadDump(line)) { currentDumpParser = new WrappedSunJDKParser(bis, threadStore, lineCounter, withCurrentTimeStamp, startCounter, dm); } else if (SunJDKParser.checkForSupportedThreadDump(line)) { currentDumpParser = new SunJDKParser(bis, threadStore, lineCounter, withCurrentTimeStamp, startCounter, dm); } else if (BeaJDKParser.checkForSupportedThreadDump(line)) { currentDumpParser = new BeaJDKParser(bis, threadStore, lineCounter, dm); } lineCounter++; } LOGGER.debug(STR, currentDumpParser.getClass().getName()); if ((currentDumpParser != null) && (bis != null)) { bis.reset(); } } catch (IOException ex) { ex.printStackTrace(); } return currentDumpParser; }
|
/**
* parses the given logfile for thread dumps and return a proper jdk parser (either for Sun VM's or
* for JRockit/Bea VM's) and initializes the DumpParser with the stream.
*
* @param dumpFileStream the file stream to use for dump parsing.
* @param threadStore the map to store the found thread dumps.
* @param withCurrentTimeStamp only used by SunJDKParser for running in JConsole-Plugin-Mode, it then uses
* the current time stamp instead of a parsed one.
* @return a proper dump parser for the given log file, null if no proper parser was found.
*/
|
parses the given logfile for thread dumps and return a proper jdk parser (either for Sun VM's or for JRockit/Bea VM's) and initializes the DumpParser with the stream
|
getDumpParserForLogfile
|
{
"repo_name": "MGetmanov/tda",
"path": "tda/src/main/java/com/pironet/tda/DumpParserFactory.java",
"license": "lgpl-2.1",
"size": 4053
}
|
[
"com.pironet.tda.utils.DateMatcher",
"com.pironet.tda.utils.PrefManager",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStream",
"java.io.InputStreamReader",
"java.util.Map"
] |
import com.pironet.tda.utils.DateMatcher; import com.pironet.tda.utils.PrefManager; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Map;
|
import com.pironet.tda.utils.*; import java.io.*; import java.util.*;
|
[
"com.pironet.tda",
"java.io",
"java.util"
] |
com.pironet.tda; java.io; java.util;
| 1,785,336
|
public void drain() throws InterruptedException, IOException {
ClientImpl currentClient = this.getClient();
if (currentClient == null) {
throw new IOException("Client is unavailable for drain().");
}
currentClient.drain();
}
|
void function() throws InterruptedException, IOException { ClientImpl currentClient = this.getClient(); if (currentClient == null) { throw new IOException(STR); } currentClient.drain(); }
|
/**
* Block the current thread until all queued stored procedure invocations have received
* responses or there are no more connections to the cluster
*
* @throws InterruptedException
* @throws IOException
* @see Client#drain()
*/
|
Block the current thread until all queued stored procedure invocations have received responses or there are no more connections to the cluster
|
drain
|
{
"repo_name": "eoneil1942/voltdb-4.7fix",
"path": "src/frontend/org/voltdb/jdbc/JDBC4ClientConnection.java",
"license": "agpl-3.0",
"size": 18714
}
|
[
"java.io.IOException",
"org.voltdb.client.ClientImpl"
] |
import java.io.IOException; import org.voltdb.client.ClientImpl;
|
import java.io.*; import org.voltdb.client.*;
|
[
"java.io",
"org.voltdb.client"
] |
java.io; org.voltdb.client;
| 1,627,017
|
public Ngsi9Interface getNgsi9Core() {
return ngsi9Core;
}
|
Ngsi9Interface function() { return ngsi9Core; }
|
/**
* Returns a pointer to the component which receives NGSI 9 requests
* arriving at the controller.
*
* @return the ngsi9 core
*/
|
Returns a pointer to the component which receives NGSI 9 requests arriving at the controller
|
getNgsi9Core
|
{
"repo_name": "loretrisolini/Aeron",
"path": "eu.neclab.iotplatform.iotbroker.restcontroller/src/main/java/eu/neclab/iotplatform/iotbroker/restcontroller/RestProviderController.java",
"license": "bsd-3-clause",
"size": 51236
}
|
[
"eu.neclab.iotplatform.ngsi.api.ngsi9.Ngsi9Interface"
] |
import eu.neclab.iotplatform.ngsi.api.ngsi9.Ngsi9Interface;
|
import eu.neclab.iotplatform.ngsi.api.ngsi9.*;
|
[
"eu.neclab.iotplatform"
] |
eu.neclab.iotplatform;
| 2,419,841
|
@Override
protected Boolean doInBackground() {
// do not store stdout but store stderr for logging purposes in case of
// error
int returnValue = 0;
if (CurrentOperatingSystem.OS == OperatingSystem.Linux) {
// "-a" does not work when running on Linux and the destination
// directory is located on a NTFS partition
returnValue = processExecutor.executeProcess(false, true,
"rsync", "-rv", "--no-inc-recursive", "--progress",
destinationPath + File.separatorChar,
encfsPlainDir.getPath() + File.separatorChar);
} else {
returnValue = processExecutor.executeProcess(false, true,
"rsync", "-rv", "--progress",
destinationPath + File.separatorChar,
encfsPlainDir.getPath() + File.separatorChar);
}
cancelled = rsyncCopyDialog.isCancelPressed();
// we have to wait here, until plaindir ends up in /etc/mtab!?!?
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
LOGGER.log(Level.SEVERE, null, ex);
}
// umount temporary encfs
if (!FileTools.umountFUSE(encfsPlainDir, false)) {
return false;
}
// yes, we evaluate the return value of the rsync operation not until
// we umounted the temporary encfs (otherwise we end up with lots of
// pending temporary encfs mounts)
if (returnValue == 0) {
EncryptionFinishSwingWorker encryptionFinishSwingWorker =
new EncryptionFinishSwingWorker(parentFrame,
backupMainPanel, destinationPath, encfsPlainDir,
encfsCipherPath, password);
encryptionFinishSwingWorker.execute();
return true;
} else {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING, "rsync error messages:{0}{1}",
new Object[]{
LINE_SEPARATOR, processExecutor.getStdErr()
});
}
EncryptionCleanupSwingWorker encryptionCleanupSwingWorker =
new EncryptionCleanupSwingWorker(
parentFrame, encfsCipherPath, encfsPlainDir, cancelled);
encryptionCleanupSwingWorker.execute();
return false;
}
}
|
Boolean function() { int returnValue = 0; if (CurrentOperatingSystem.OS == OperatingSystem.Linux) { returnValue = processExecutor.executeProcess(false, true, "rsync", "-rv", STR, STR, destinationPath + File.separatorChar, encfsPlainDir.getPath() + File.separatorChar); } else { returnValue = processExecutor.executeProcess(false, true, "rsync", "-rv", STR, destinationPath + File.separatorChar, encfsPlainDir.getPath() + File.separatorChar); } cancelled = rsyncCopyDialog.isCancelPressed(); try { Thread.sleep(1000); } catch (InterruptedException ex) { LOGGER.log(Level.SEVERE, null, ex); } if (!FileTools.umountFUSE(encfsPlainDir, false)) { return false; } if (returnValue == 0) { EncryptionFinishSwingWorker encryptionFinishSwingWorker = new EncryptionFinishSwingWorker(parentFrame, backupMainPanel, destinationPath, encfsPlainDir, encfsCipherPath, password); encryptionFinishSwingWorker.execute(); return true; } else { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, STR, new Object[]{ LINE_SEPARATOR, processExecutor.getStdErr() }); } EncryptionCleanupSwingWorker encryptionCleanupSwingWorker = new EncryptionCleanupSwingWorker( parentFrame, encfsCipherPath, encfsPlainDir, cancelled); encryptionCleanupSwingWorker.execute(); return false; } }
|
/**
* execute the encryption in a background thread
* @return
*/
|
execute the encryption in a background thread
|
doInBackground
|
{
"repo_name": "amon-ra/jbackpack",
"path": "src/ch/fhnw/jbackpack/EncryptionSwingWorker.java",
"license": "gpl-3.0",
"size": 6748
}
|
[
"ch.fhnw.util.CurrentOperatingSystem",
"ch.fhnw.util.FileTools",
"ch.fhnw.util.OperatingSystem",
"java.io.File",
"java.util.logging.Level"
] |
import ch.fhnw.util.CurrentOperatingSystem; import ch.fhnw.util.FileTools; import ch.fhnw.util.OperatingSystem; import java.io.File; import java.util.logging.Level;
|
import ch.fhnw.util.*; import java.io.*; import java.util.logging.*;
|
[
"ch.fhnw.util",
"java.io",
"java.util"
] |
ch.fhnw.util; java.io; java.util;
| 2,028,333
|
@Override
public Map<String, Object> updateUser(MRSUser mrsUser) {
return save(mrsUser);
}
|
Map<String, Object> function(MRSUser mrsUser) { return save(mrsUser); }
|
/**
* Updates User attributes if found, else creates the user.
*
* @param mrsUser MRS User object
* @return A Map containing saved user's data
*/
|
Updates User attributes if found, else creates the user
|
updateUser
|
{
"repo_name": "llavoie/platform-medical-records",
"path": "modules/openmrs/api/src/main/java/org/motechproject/openmrs/services/OpenMRSUserAdapter.java",
"license": "bsd-3-clause",
"size": 8954
}
|
[
"java.util.Map",
"org.motechproject.mrs.domain.MRSUser"
] |
import java.util.Map; import org.motechproject.mrs.domain.MRSUser;
|
import java.util.*; import org.motechproject.mrs.domain.*;
|
[
"java.util",
"org.motechproject.mrs"
] |
java.util; org.motechproject.mrs;
| 93,274
|
protected void removeLinkFromStorage(Link lt) {
String id = getLinkId(lt);
storageSourceService.deleteRowAsync(LINK_TABLE_NAME, id);
}
|
void function(Link lt) { String id = getLinkId(lt); storageSourceService.deleteRowAsync(LINK_TABLE_NAME, id); }
|
/**
* Removes a link from storage using an asynchronous call.
*
* @param lt
* The LinkTuple to delete.
*/
|
Removes a link from storage using an asynchronous call
|
removeLinkFromStorage
|
{
"repo_name": "pawtul/ssp_projekt",
"path": "src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java",
"license": "apache-2.0",
"size": 76003
}
|
[
"net.floodlightcontroller.routing.Link"
] |
import net.floodlightcontroller.routing.Link;
|
import net.floodlightcontroller.routing.*;
|
[
"net.floodlightcontroller.routing"
] |
net.floodlightcontroller.routing;
| 2,884,608
|
public static String getContainerName(String hostname) throws IOException {
int i = hostname.indexOf(".");
if (i <= 0) {
throw badHostName(hostname);
}
return hostname.substring(0, i);
}
|
static String function(String hostname) throws IOException { int i = hostname.indexOf("."); if (i <= 0) { throw badHostName(hostname); } return hostname.substring(0, i); }
|
/**
* Extracts container name from the container.service
*
* @param hostname hostname to split
* @return the container
* @throws IOException
*/
|
Extracts container name from the container.service
|
getContainerName
|
{
"repo_name": "ymoatti/pushdown-stocator",
"path": "src/main/java/com/ibm/stocator/fs/common/Utils.java",
"license": "apache-2.0",
"size": 4304
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 302,271
|
public void add(TiUIView child)
{
if (child != null) {
View cv = child.getOuterView();
if (cv != null) {
View nv = getNativeView();
if (nv instanceof ViewGroup) {
if (cv.getParent() == null) {
((ViewGroup) nv).addView(cv, child.getLayoutParams());
}
children.add(child);
child.parent = proxy;
}
}
}
}
|
void function(TiUIView child) { if (child != null) { View cv = child.getOuterView(); if (cv != null) { View nv = getNativeView(); if (nv instanceof ViewGroup) { if (cv.getParent() == null) { ((ViewGroup) nv).addView(cv, child.getLayoutParams()); } children.add(child); child.parent = proxy; } } } }
|
/**
* Adds a child view into the ViewGroup.
* @param child the view to be added.
*/
|
Adds a child view into the ViewGroup
|
add
|
{
"repo_name": "hieupham007/Titanium_Mobile",
"path": "android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java",
"license": "apache-2.0",
"size": 48767
}
|
[
"android.view.View",
"android.view.ViewGroup"
] |
import android.view.View; import android.view.ViewGroup;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 2,250,160
|
private void loadProgram() {
// regenerate classloader stuff, because in handleUpdate additional
// .jar-files may have been added
try {
final ClassLoader classLoader = createClassloader(true, false);
final Class< ? > clazz = classLoader.loadClass(className);
final Method method = clazz.getMethod("main", args.getClass());
method.invoke(null, (Object) args);
} catch (final Throwable e) {
unexpectedErrorHandling("State: in game\r\n", e);
}
}
|
void function() { try { final ClassLoader classLoader = createClassloader(true, false); final Class< ? > clazz = classLoader.loadClass(className); final Method method = clazz.getMethod("main", args.getClass()); method.invoke(null, (Object) args); } catch (final Throwable e) { unexpectedErrorHandling(STR, e); } }
|
/**
* load program.
*/
|
load program
|
loadProgram
|
{
"repo_name": "AntumDeluge/arianne-stendhal",
"path": "src/games/stendhal/client/update/Bootstrap.java",
"license": "gpl-2.0",
"size": 15146
}
|
[
"java.lang.reflect.Method"
] |
import java.lang.reflect.Method;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 216,527
|
public static Map<String, Object> redactValue(Map<String, Object> m, String key) {
if (m.containsKey(key)) {
HashMap<String, Object> newMap = new HashMap<>(m);
Object value = newMap.get(key);
String v = value.toString();
String redacted = new String(new char[v.length()]).replace("\0", "#");
newMap.put(key, redacted);
return newMap;
}
return m;
}
|
static Map<String, Object> function(Map<String, Object> m, String key) { if (m.containsKey(key)) { HashMap<String, Object> newMap = new HashMap<>(m); Object value = newMap.get(key); String v = value.toString(); String redacted = new String(new char[v.length()]).replace("\0", "#"); newMap.put(key, redacted); return newMap; } return m; }
|
/**
* Creates a new map with a string value in the map replaced with an equivalently-lengthed string of '#'. (If the object is not a
* string to string will be called on it and replaced)
*
* @param m The map that a value will be redacted from
* @param key The key pointing to the value to be redacted
* @return a new map with the value redacted. The original map will not be modified.
*/
|
Creates a new map with a string value in the map replaced with an equivalently-lengthed string of '#'. (If the object is not a string to string will be called on it and replaced)
|
redactValue
|
{
"repo_name": "hmcl/storm-apache",
"path": "storm-client/src/jvm/org/apache/storm/utils/Utils.java",
"license": "apache-2.0",
"size": 71564
}
|
[
"java.util.HashMap",
"java.util.Map"
] |
import java.util.HashMap; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,656,077
|
@Test
public void testCcLibraryLinkopts() throws Exception {
scratch.overwriteFile(
"custom_malloc/BUILD",
"cc_library(name = 'custom_malloc',",
" srcs = ['custom_malloc.cc'],",
" linkopts = ['-Lmalloc_dir -lmalloc_opt']);");
ConfiguredTarget ccLib = getConfiguredTarget("//custom_malloc:custom_malloc");
final String linkOpt1 = "-Lmalloc_dir";
final String linkOpt2 = "-lmalloc_opt";
|
void function() throws Exception { scratch.overwriteFile( STR, STR, STR, STR); ConfiguredTarget ccLib = getConfiguredTarget(STR-Lmalloc_dirSTR-lmalloc_opt";
|
/**
* Tests that the shared library version of a cc_library includes linkopts settings
* in its link command line, but the archive library version doesn't.
*/
|
Tests that the shared library version of a cc_library includes linkopts settings in its link command line, but the archive library version doesn't
|
testCcLibraryLinkopts
|
{
"repo_name": "dropbox/bazel",
"path": "src/test/java/com/google/devtools/build/lib/rules/cpp/LibraryLinkingTest.java",
"license": "apache-2.0",
"size": 4976
}
|
[
"com.google.devtools.build.lib.analysis.ConfiguredTarget"
] |
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
|
import com.google.devtools.build.lib.analysis.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 2,454,013
|
public static HystrixCommand.Setter buildForFailFastCommand( final String groupKey ) {
return HystrixCommand.Setter.withGroupKey( HystrixCommandGroupKey.Factory.asKey( groupKey ) );
}
|
static HystrixCommand.Setter function( final String groupKey ) { return HystrixCommand.Setter.withGroupKey( HystrixCommandGroupKey.Factory.asKey( groupKey ) ); }
|
/**
* Builds the necessary Hystrix configuration instance suitable for fail fast semantics.
* @param groupKey the group key to associate the command to.
* @return properly constructed Hystrix settings.
*/
|
Builds the necessary Hystrix configuration instance suitable for fail fast semantics
|
buildForFailFastCommand
|
{
"repo_name": "kurron/lazybones-experiment",
"path": "templates/jvm-guy-amqp-micro-service/shared/src/main/java/org/example/shared/resilience/HystrixSettingsBuilder.java",
"license": "apache-2.0",
"size": 6956
}
|
[
"com.netflix.hystrix.HystrixCommand",
"com.netflix.hystrix.HystrixCommandGroupKey"
] |
import com.netflix.hystrix.HystrixCommand; import com.netflix.hystrix.HystrixCommandGroupKey;
|
import com.netflix.hystrix.*;
|
[
"com.netflix.hystrix"
] |
com.netflix.hystrix;
| 1,535,022
|
public List<String> getKeyColumns() {
return keyColumns;
}
|
List<String> function() { return keyColumns; }
|
/**
* Get key columns.
* @return Key columns.
*/
|
Get key columns
|
getKeyColumns
|
{
"repo_name": "edrdo/jdbdt",
"path": "src/main/java/org/jdbdt/Table.java",
"license": "mit",
"size": 2764
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,533,458
|
protected void bind(PreparedStatement stmt, List<?> params, List<?> batchValues)
throws SQLException {
for (int i = 0; i< params.size(); i++) {
Object paramValue = params.get(i);
Object value = null;
Class<?> paramType = null;
if (paramValue instanceof Literal) {
Literal litParam = (Literal)paramValue;
value = litParam.getValue();
paramType = litParam.getType();
} else {
Parameter param = (Parameter)paramValue;
if (batchValues == null) {
throw new AssertionError("Expected batchValues when using a Parameter"); //$NON-NLS-1$
}
value = batchValues.get(param.getValueIndex());
paramType = param.getType();
}
this.executionFactory.bindValue(stmt, value, paramType, i+1);
}
if (batchValues != null) {
stmt.addBatch();
}
}
// ===========================================================================================================================
// Methods
// ===========================================================================================================================
|
void function(PreparedStatement stmt, List<?> params, List<?> batchValues) throws SQLException { for (int i = 0; i< params.size(); i++) { Object paramValue = params.get(i); Object value = null; Class<?> paramType = null; if (paramValue instanceof Literal) { Literal litParam = (Literal)paramValue; value = litParam.getValue(); paramType = litParam.getType(); } else { Parameter param = (Parameter)paramValue; if (batchValues == null) { throw new AssertionError(STR); } value = batchValues.get(param.getValueIndex()); paramType = param.getType(); } this.executionFactory.bindValue(stmt, value, paramType, i+1); } if (batchValues != null) { stmt.addBatch(); } }
|
/**
* Bind the values in the TranslatedCommand to the PreparedStatement
*/
|
Bind the values in the TranslatedCommand to the PreparedStatement
|
bind
|
{
"repo_name": "jagazee/teiid-8.7",
"path": "connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCBaseExecution.java",
"license": "lgpl-2.1",
"size": 7983
}
|
[
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.util.List",
"org.teiid.language.Literal",
"org.teiid.language.Parameter"
] |
import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import org.teiid.language.Literal; import org.teiid.language.Parameter;
|
import java.sql.*; import java.util.*; import org.teiid.language.*;
|
[
"java.sql",
"java.util",
"org.teiid.language"
] |
java.sql; java.util; org.teiid.language;
| 1,493,923
|
@Override
public void setCreateDate(java.util.Date createDate) {
_docTemplate.setCreateDate(createDate);
}
|
void function(java.util.Date createDate) { _docTemplate.setCreateDate(createDate); }
|
/**
* Sets the create date of this doc template.
*
* @param createDate the create date of this doc template
*/
|
Sets the create date of this doc template
|
setCreateDate
|
{
"repo_name": "openegovplatform/OEPv2",
"path": "oep-dossier-portlet/docroot/WEB-INF/service/org/oep/dossiermgt/model/DocTemplateWrapper.java",
"license": "apache-2.0",
"size": 11314
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,492,274
|
public void putTraversalSource(final String tsName, final TraversalSource ts);
|
void function(final String tsName, final TraversalSource ts);
|
/**
* Add or update the specified {@link TraversalSource} with the specified name.
*/
|
Add or update the specified <code>TraversalSource</code> with the specified name
|
putTraversalSource
|
{
"repo_name": "apache/tinkerpop",
"path": "gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GraphManager.java",
"license": "apache-2.0",
"size": 4870
}
|
[
"org.apache.tinkerpop.gremlin.process.traversal.TraversalSource"
] |
import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
|
import org.apache.tinkerpop.gremlin.process.traversal.*;
|
[
"org.apache.tinkerpop"
] |
org.apache.tinkerpop;
| 1,541,863
|
public static boolean isDeltaLake(FileConfig fileConfig) {
if (fileConfig == null) {
return false;
}
return fileConfig.getType() == FileType.DELTA;
}
|
static boolean function(FileConfig fileConfig) { if (fileConfig == null) { return false; } return fileConfig.getType() == FileType.DELTA; }
|
/**
* Checks if datafile is from an DeltaLake dataset
*
* @param fileConfig file to check
* @return true if file is from an DeltaLake dataset
*/
|
Checks if datafile is from an DeltaLake dataset
|
isDeltaLake
|
{
"repo_name": "dremio/dremio-oss",
"path": "services/namespace/src/main/java/com/dremio/service/namespace/DatasetHelper.java",
"license": "apache-2.0",
"size": 5552
}
|
[
"com.dremio.service.namespace.file.proto.FileConfig",
"com.dremio.service.namespace.file.proto.FileType"
] |
import com.dremio.service.namespace.file.proto.FileConfig; import com.dremio.service.namespace.file.proto.FileType;
|
import com.dremio.service.namespace.file.proto.*;
|
[
"com.dremio.service"
] |
com.dremio.service;
| 631,675
|
public Map<String,FieldsTreeAttribute> getEntityTreeAttribute(List<String> ids, List<String> fields) throws IOException, JsonClientException {
List<Object> args = new ArrayList<Object>();
args.add(ids);
args.add(fields);
TypeReference<List<Map<String,FieldsTreeAttribute>>> retType = new TypeReference<List<Map<String,FieldsTreeAttribute>>>() {};
List<Map<String,FieldsTreeAttribute>> res = caller.jsonrpcCall("CDMI_EntityAPI.get_entity_TreeAttribute", args, retType, true, false);
return res.get(0);
}
|
Map<String,FieldsTreeAttribute> function(List<String> ids, List<String> fields) throws IOException, JsonClientException { List<Object> args = new ArrayList<Object>(); args.add(ids); args.add(fields); TypeReference<List<Map<String,FieldsTreeAttribute>>> retType = new TypeReference<List<Map<String,FieldsTreeAttribute>>>() {}; List<Map<String,FieldsTreeAttribute>> res = caller.jsonrpcCall(STR, args, retType, true, false); return res.get(0); }
|
/**
* <p>Original spec-file function name: get_entity_TreeAttribute</p>
* <pre>
* This entity represents an attribute type that can
* be assigned to a tree. The attribute
* values are stored in the relationships to the target. The
* key is the attribute name.
* It has the following fields:
* =over 4
* =back
* </pre>
* @param ids instance of list of String
* @param fields instance of list of String
* @return instance of mapping from String to type {@link us.kbase.cdmientityapi.FieldsTreeAttribute FieldsTreeAttribute} (original type "fields_TreeAttribute")
* @throws IOException if an IO exception occurs
* @throws JsonClientException if a JSON RPC exception occurs
*/
|
Original spec-file function name: get_entity_TreeAttribute <code> This entity represents an attribute type that can be assigned to a tree. The attribute values are stored in the relationships to the target. The key is the attribute name. It has the following fields: =over 4 =back </code>
|
getEntityTreeAttribute
|
{
"repo_name": "kbase/trees",
"path": "src/us/kbase/cdmientityapi/CDMIEntityAPIClient.java",
"license": "mit",
"size": 869221
}
|
[
"com.fasterxml.jackson.core.type.TypeReference",
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"us.kbase.common.service.JsonClientException"
] |
import com.fasterxml.jackson.core.type.TypeReference; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import us.kbase.common.service.JsonClientException;
|
import com.fasterxml.jackson.core.type.*; import java.io.*; import java.util.*; import us.kbase.common.service.*;
|
[
"com.fasterxml.jackson",
"java.io",
"java.util",
"us.kbase.common"
] |
com.fasterxml.jackson; java.io; java.util; us.kbase.common;
| 1,967,521
|
User findByToken(String token);
|
User findByToken(String token);
|
/**
* Returns a User based on a given token. Just for internal use
* @param token token to look for
* @return returns a User entity, or null if token not found
*/
|
Returns a User based on a given token. Just for internal use
|
findByToken
|
{
"repo_name": "meandor/project-aim",
"path": "src/main/java/de/haw/aim/authentication/facade/AuthenticationInterface.java",
"license": "mit",
"size": 1187
}
|
[
"de.haw.aim.authentication.persistence.User"
] |
import de.haw.aim.authentication.persistence.User;
|
import de.haw.aim.authentication.persistence.*;
|
[
"de.haw.aim"
] |
de.haw.aim;
| 715,157
|
private Tree getTree() {
return this.navigatorTree;
}
|
Tree function() { return this.navigatorTree; }
|
/**
* Get the Tree being edited.
*
* @returnTree
*/
|
Get the Tree being edited
|
getTree
|
{
"repo_name": "heartsome/translationstudio8",
"path": "base_commons/net.heartsome.cat.common.ui.navigator.resources/src/org/eclipse/ui/internal/navigator/resources/actions/RenameResourceAndCloseEditorAction.java",
"license": "gpl-2.0",
"size": 24878
}
|
[
"org.eclipse.swt.widgets.Tree"
] |
import org.eclipse.swt.widgets.Tree;
|
import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 82,033
|
@JRubyMethod(name = "get_cstring")
public RubyString getCString() {
ensureBsonRead();
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
byte next = NULL_BYTE;
while((next = this.buffer.get()) != NULL_BYTE) {
bytes.write(next);
}
RubyString string = getUTF8String(bytes.toByteArray());
this.readPosition += (bytes.size() + 1);
return string;
}
|
@JRubyMethod(name = STR) RubyString function() { ensureBsonRead(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); byte next = NULL_BYTE; while((next = this.buffer.get()) != NULL_BYTE) { bytes.write(next); } RubyString string = getUTF8String(bytes.toByteArray()); this.readPosition += (bytes.size() + 1); return string; }
|
/**
* Get a cstring from the buffer.
*
* @author Durran Jordan
* @since 2015.09.26
* @version 4.0.0
*/
|
Get a cstring from the buffer
|
getCString
|
{
"repo_name": "estolfo/bson-ruby",
"path": "src/main/org/bson/ByteBuf.java",
"license": "apache-2.0",
"size": 14467
}
|
[
"java.io.ByteArrayOutputStream",
"org.jruby.RubyString",
"org.jruby.anno.JRubyMethod"
] |
import java.io.ByteArrayOutputStream; import org.jruby.RubyString; import org.jruby.anno.JRubyMethod;
|
import java.io.*; import org.jruby.*; import org.jruby.anno.*;
|
[
"java.io",
"org.jruby",
"org.jruby.anno"
] |
java.io; org.jruby; org.jruby.anno;
| 35,606
|
// cannot create new class inside active transaction so we need to close the current
// transaction and
// then begin transaction once again after the class creation is done
OTransaction transaction = graphDatabase.getRawGraph().getTransaction();
if (transaction != null && transaction.isActive()) {
transaction.close();
}
OClass entityVertexType = graphDatabase.getVertexType(entityType);
if (entityVertexType == null) {
entityVertexType = graphDatabase.createVertexType(entityType);
entityVertexType.createProperty(DaasDefaultFields.FIELD_ACCOUNT_NAME.toString(), OType.STRING);
entityVertexType.createProperty(DaasDefaultFields.FIELD_APPLICATION_NAME.toString(), OType.STRING);
entityVertexType.createProperty(DaasDefaultFields.FIELD_UUID.toString(), OType.STRING);
// create index - for app and org name
entityVertexType.createIndex(entityType, OClass.INDEX_TYPE.NOTUNIQUE,
DaasDefaultFields.FIELD_ACCOUNT_NAME.toString(),
DaasDefaultFields.FIELD_APPLICATION_NAME.toString());
// create index - uuid based
entityVertexType.createIndex(entityType + "." + DaasDefaultFields.FIELD_UUID.toString(),
OClass.INDEX_TYPE.UNIQUE, DaasDefaultFields.FIELD_UUID.toString());
entityVertexType.setOverSize(2);
// now we can begin the transaction
if (transaction != null) {
transaction.begin();
}
}
}
|
OTransaction transaction = graphDatabase.getRawGraph().getTransaction(); if (transaction != null && transaction.isActive()) { transaction.close(); } OClass entityVertexType = graphDatabase.getVertexType(entityType); if (entityVertexType == null) { entityVertexType = graphDatabase.createVertexType(entityType); entityVertexType.createProperty(DaasDefaultFields.FIELD_ACCOUNT_NAME.toString(), OType.STRING); entityVertexType.createProperty(DaasDefaultFields.FIELD_APPLICATION_NAME.toString(), OType.STRING); entityVertexType.createProperty(DaasDefaultFields.FIELD_UUID.toString(), OType.STRING); entityVertexType.createIndex(entityType, OClass.INDEX_TYPE.NOTUNIQUE, DaasDefaultFields.FIELD_ACCOUNT_NAME.toString(), DaasDefaultFields.FIELD_APPLICATION_NAME.toString()); entityVertexType.createIndex(entityType + "." + DaasDefaultFields.FIELD_UUID.toString(), OClass.INDEX_TYPE.UNIQUE, DaasDefaultFields.FIELD_UUID.toString()); entityVertexType.setOverSize(2); if (transaction != null) { transaction.begin(); } } }
|
/**
* Create entity type if not available and index too
*
* @param entityType
*/
|
Create entity type if not available and index too
|
createEntityType
|
{
"repo_name": "bbytes/DAAS",
"path": "daas-rest-server/src/main/java/com/bbytes/daas/dao/DocumentUtils.java",
"license": "apache-2.0",
"size": 5655
}
|
[
"com.orientechnologies.orient.core.metadata.schema.OClass",
"com.orientechnologies.orient.core.metadata.schema.OType",
"com.orientechnologies.orient.core.tx.OTransaction",
"java.util.UUID"
] |
import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.metadata.schema.OType; import com.orientechnologies.orient.core.tx.OTransaction; import java.util.UUID;
|
import com.orientechnologies.orient.core.metadata.schema.*; import com.orientechnologies.orient.core.tx.*; import java.util.*;
|
[
"com.orientechnologies.orient",
"java.util"
] |
com.orientechnologies.orient; java.util;
| 2,746,452
|
public RetrievePtConsentByPtIdResponseType retrievePtConsentByPtId(RetrievePtConsentByPtIdRequestType request,
AssertionType assertion) {
LOG.trace("Begin AdapterPIPProxyOptInNoOpImpl.retrievePtConsentByPtId");
RetrievePtConsentByPtIdResponseType oResponse = new RetrievePtConsentByPtIdResponseType();
PatientPreferencesType oPref = new PatientPreferencesType();
oResponse.setPatientPreferences(oPref);
if ((request != null) && (request.getAssigningAuthority() != null)) {
oPref.setAssigningAuthority(request.getAssigningAuthority());
} else {
oPref.setAssigningAuthority("");
}
if ((request != null) && (request.getPatientId() != null)) {
oPref.setPatientId(request.getPatientId());
} else {
oPref.setPatientId("");
}
oPref.setOptIn(true);
LOG.trace("End AdapterPIPProxyOptInNoOpImpl.retrievePtConsentByPtId");
return oResponse;
}
|
RetrievePtConsentByPtIdResponseType function(RetrievePtConsentByPtIdRequestType request, AssertionType assertion) { LOG.trace(STR); RetrievePtConsentByPtIdResponseType oResponse = new RetrievePtConsentByPtIdResponseType(); PatientPreferencesType oPref = new PatientPreferencesType(); oResponse.setPatientPreferences(oPref); if ((request != null) && (request.getAssigningAuthority() != null)) { oPref.setAssigningAuthority(request.getAssigningAuthority()); } else { oPref.setAssigningAuthority(STRSTREnd AdapterPIPProxyOptInNoOpImpl.retrievePtConsentByPtId"); return oResponse; }
|
/**
* NO-OP implementation of the RetrievePtConsentByPtId operation. It will return a message with the same assigning
* authority and patient Id that was passed and return an OptIn of false.
*
* @param request The assigning authority and patient ID of the patient.
* @return A response containing the given assigning authority and patient ID along with OptIn set to false.
*/
|
NO-OP implementation of the RetrievePtConsentByPtId operation. It will return a message with the same assigning authority and patient Id that was passed and return an OptIn of false
|
retrievePtConsentByPtId
|
{
"repo_name": "AurionProject/Aurion",
"path": "Product/Production/Services/PolicyEngineCore/src/main/java/gov/hhs/fha/nhinc/policyengine/adapter/pip/proxy/AdapterPIPProxyOptInNoOpImpl.java",
"license": "bsd-3-clause",
"size": 5800
}
|
[
"gov.hhs.fha.nhinc.common.nhinccommon.AssertionType",
"gov.hhs.fha.nhinc.common.nhinccommonadapter.PatientPreferencesType",
"gov.hhs.fha.nhinc.common.nhinccommonadapter.RetrievePtConsentByPtIdRequestType",
"gov.hhs.fha.nhinc.common.nhinccommonadapter.RetrievePtConsentByPtIdResponseType"
] |
import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType; import gov.hhs.fha.nhinc.common.nhinccommonadapter.PatientPreferencesType; import gov.hhs.fha.nhinc.common.nhinccommonadapter.RetrievePtConsentByPtIdRequestType; import gov.hhs.fha.nhinc.common.nhinccommonadapter.RetrievePtConsentByPtIdResponseType;
|
import gov.hhs.fha.nhinc.common.nhinccommon.*; import gov.hhs.fha.nhinc.common.nhinccommonadapter.*;
|
[
"gov.hhs.fha"
] |
gov.hhs.fha;
| 465,119
|
@Override
@Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:10:02-06:00", comment = "JAXB RI v2.2.6")
public String toString() {
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE);
}
|
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
|
/**
* Generates a String representation of the contents of this type.
* This is an extension method, produced by the 'ts' xjc plugin
*
*/
|
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
|
toString
|
{
"repo_name": "angecab10/travelport-uapi-tutorial",
"path": "src/com/travelport/schema/air_v29_0/DocumentModifiers.java",
"license": "gpl-3.0",
"size": 4732
}
|
[
"javax.annotation.Generated",
"org.apache.commons.lang.builder.ToStringBuilder",
"org.apache.cxf.xjc.runtime.JAXBToStringStyle"
] |
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
|
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
|
[
"javax.annotation",
"org.apache.commons",
"org.apache.cxf"
] |
javax.annotation; org.apache.commons; org.apache.cxf;
| 2,475,471
|
private static Object parseArray(String value, StringTokenizer tokens) {
if (!tokens.hasMoreTokens()) {
throw new IllegalArgumentException("Expecting <of> token in Array type");
}
if (!"of".equals(tokens.nextToken())) {
throw new IllegalArgumentException("Expecting <of> token in Array type");
}
if (!tokens.hasMoreTokens()) {
throw new IllegalArgumentException("Expecting <primitive>|<scalar> token in Array type");
}
String type = tokens.nextToken();
if (SCALAR_TYPES.contains(type)) {
return parseScalarArray(value, type);
} else if (PRIMITIVE_TYPES.contains(type)) {
return parsePrimitiveArray(value, type);
} else {
throw new IllegalArgumentException("Expecting <scalar>|<primitive> type token in Array type: " + type);
}
}
|
static Object function(String value, StringTokenizer tokens) { if (!tokens.hasMoreTokens()) { throw new IllegalArgumentException(STR); } if (!"of".equals(tokens.nextToken())) { throw new IllegalArgumentException(STR); } if (!tokens.hasMoreTokens()) { throw new IllegalArgumentException(STR); } String type = tokens.nextToken(); if (SCALAR_TYPES.contains(type)) { return parseScalarArray(value, type); } else if (PRIMITIVE_TYPES.contains(type)) { return parsePrimitiveArray(value, type); } else { throw new IllegalArgumentException(STR + type); } }
|
/**
* Parse the array represented by the string value
*
* @param value
* @param tokens
* @return the array represented by the string value
*/
|
Parse the array represented by the string value
|
parseArray
|
{
"repo_name": "glyn/Gemini-Management",
"path": "org.eclipse.gemini.mgmt/src/org/eclipse/gemini/mgmt/internal/OSGiProperties.java",
"license": "apache-2.0",
"size": 18160
}
|
[
"java.util.StringTokenizer"
] |
import java.util.StringTokenizer;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,997,208
|
protected void replaceTimerListener(TimerListener timerListener) {
if ((m_timerListener != null)
&& (m_timerListener.getClass().getName().equals(timerListener
.getClass().getName()))) {
m_timerListener = timerListener;
if (c_logger.isTraceDebugEnabled()) {
StringBuffer b = new StringBuffer(64);
b.append("Replacing Timer Listener: ");
b.append(m_timerListener);
b.append(" For Application: ");
b.append(getApplicationName());
c_logger.traceDebug(this, "replaceTimerListener", b.toString());
}
}
}
|
void function(TimerListener timerListener) { if ((m_timerListener != null) && (m_timerListener.getClass().getName().equals(timerListener .getClass().getName()))) { m_timerListener = timerListener; if (c_logger.isTraceDebugEnabled()) { StringBuffer b = new StringBuffer(64); b.append(STR); b.append(m_timerListener); b.append(STR); b.append(getApplicationName()); c_logger.traceDebug(this, STR, b.toString()); } } }
|
/**
* replace the TimerListener instance associated with this application. this
* function should be called by the single instance for servlets acting as
* listeners only
*
* @param timerListener
*/
|
replace the TimerListener instance associated with this application. this function should be called by the single instance for servlets acting as listeners only
|
replaceTimerListener
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.sipcontainer/src/com/ibm/ws/sip/container/parser/SipAppDesc.java",
"license": "epl-1.0",
"size": 54998
}
|
[
"javax.servlet.sip.TimerListener"
] |
import javax.servlet.sip.TimerListener;
|
import javax.servlet.sip.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 2,046,477
|
@Deprecated
@SuppressWarnings("unchecked")
public static Object newGroup(String className, Class<?>[] genericParameters, Object[][] params, Node[] nodeList)
throws ClassNotFoundException, ClassNotReifiableException, ActiveObjectCreationException, NodeException {
Object result = ProActiveGroup.newGroup(className, genericParameters);
Group g = ProActiveGroup.getGroup(result);
if (params != null) {
for (int i = 0; i < params.length; i++) {
g.add(PAActiveObject.newActive(className, params[i], nodeList[i % nodeList.length]));
}
}
return result;
}
|
@SuppressWarnings(STR) static Object function(String className, Class<?>[] genericParameters, Object[][] params, Node[] nodeList) throws ClassNotFoundException, ClassNotReifiableException, ActiveObjectCreationException, NodeException { Object result = ProActiveGroup.newGroup(className, genericParameters); Group g = ProActiveGroup.getGroup(result); if (params != null) { for (int i = 0; i < params.length; i++) { g.add(PAActiveObject.newActive(className, params[i], nodeList[i % nodeList.length])); } } return result; }
|
/**
* Creates an object representing a group (a typed group) and creates members with params cycling on nodeList.
* @param className the name of the (upper) class of the group's members.
* @param genericParameters genericParameters parameterizing types
* @param params the array that contain the parameters used to build the group's members.
* If <code>params</code> is <code>null</code>, builds an empty group.
* @param nodeList the nodes where the members are created.
* @return a typed group with its members.
* @throws ActiveObjectCreationException if a problem occur while creating the stub or the body
* @throws ClassNotFoundException if the Class<?> corresponding to <code>className</code> can't be found.
* @throws ClassNotReifiableException if the Class<?> corresponding to <code>className</code> can't be reify.
* @throws NodeException if the node was null and that the DefaultNode cannot be created
* @deprecated Use {@link org.objectweb.proactive.api.PAGroup#newGroup(String,Class<?>[],Object[][],Node[])} instead
*/
|
Creates an object representing a group (a typed group) and creates members with params cycling on nodeList
|
newGroup
|
{
"repo_name": "paraita/programming",
"path": "programming-core/src/main/java/org/objectweb/proactive/core/group/ProActiveGroup.java",
"license": "agpl-3.0",
"size": 96895
}
|
[
"org.objectweb.proactive.ActiveObjectCreationException",
"org.objectweb.proactive.api.PAActiveObject",
"org.objectweb.proactive.core.mop.ClassNotReifiableException",
"org.objectweb.proactive.core.node.Node",
"org.objectweb.proactive.core.node.NodeException"
] |
import org.objectweb.proactive.ActiveObjectCreationException; import org.objectweb.proactive.api.PAActiveObject; import org.objectweb.proactive.core.mop.ClassNotReifiableException; import org.objectweb.proactive.core.node.Node; import org.objectweb.proactive.core.node.NodeException;
|
import org.objectweb.proactive.*; import org.objectweb.proactive.api.*; import org.objectweb.proactive.core.mop.*; import org.objectweb.proactive.core.node.*;
|
[
"org.objectweb.proactive"
] |
org.objectweb.proactive;
| 1,039,763
|
public void onDirectoryChange(final File directory) {
}
|
void function(final File directory) { }
|
/**
* Directory changed Event.
*
* @param directory The directory changed (ignored)
*/
|
Directory changed Event
|
onDirectoryChange
|
{
"repo_name": "jankill/commons-io",
"path": "src/main/java/org/apache/commons/io/monitor/FileAlterationListenerAdaptor.java",
"license": "apache-2.0",
"size": 2498
}
|
[
"java.io.File"
] |
import java.io.File;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,352,588
|
public static String encode(final List<LatLng> path) {
long lastLat = 0;
long lastLng = 0;
final StringBuffer result = new StringBuffer();
for (final LatLng point : path) {
long lat = Math.round(point.getLatitude() * 1e5);
long lng = Math.round(point.getLongitude() * 1e5);
long dLat = lat - lastLat;
long dLng = lng - lastLng;
encode(dLat, result);
encode(dLng, result);
lastLat = lat;
lastLng = lng;
}
return result.toString();
}
|
static String function(final List<LatLng> path) { long lastLat = 0; long lastLng = 0; final StringBuffer result = new StringBuffer(); for (final LatLng point : path) { long lat = Math.round(point.getLatitude() * 1e5); long lng = Math.round(point.getLongitude() * 1e5); long dLat = lat - lastLat; long dLng = lng - lastLng; encode(dLat, result); encode(dLng, result); lastLat = lat; lastLng = lng; } return result.toString(); }
|
/**
* Encodes a sequence of LatLngs into an encoded path string.
*/
|
Encodes a sequence of LatLngs into an encoded path string
|
encode
|
{
"repo_name": "mastrgamr/mapbox-android-utils",
"path": "library/src/main/java/net/mastrgamr/mbmapboxutils/PolyUtil.java",
"license": "apache-2.0",
"size": 21989
}
|
[
"com.mapbox.mapboxsdk.geometry.LatLng",
"java.util.List"
] |
import com.mapbox.mapboxsdk.geometry.LatLng; import java.util.List;
|
import com.mapbox.mapboxsdk.geometry.*; import java.util.*;
|
[
"com.mapbox.mapboxsdk",
"java.util"
] |
com.mapbox.mapboxsdk; java.util;
| 1,428,108
|
byte[] sign(InputStream toSign);
|
byte[] sign(InputStream toSign);
|
/**
* Exhausts {@code toSign}, and returns the raw signature bytes.
*
* @param toSign The source of the data to be signed
* @return The raw bytes of the signature
*/
|
Exhausts toSign, and returns the raw signature bytes
|
sign
|
{
"repo_name": "lsmaira/gradle",
"path": "subprojects/signing/src/main/java/org/gradle/plugins/signing/signatory/Signatory.java",
"license": "apache-2.0",
"size": 1889
}
|
[
"java.io.InputStream"
] |
import java.io.InputStream;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 833,750
|
private void setContentView(View view) {
mContentView = view;
}
|
void function(View view) { mContentView = view; }
|
/**
* Set up contentView which will be moved by user gesture
*
* @param view
*/
|
Set up contentView which will be moved by user gesture
|
setContentView
|
{
"repo_name": "cymcsg/UltimateAndroid",
"path": "deprecated/UltimateAndroidGradle/ultimateandroiduianimation/src/main/java/com/marshalchen/common/uimodule/swipeback/SwipeBackLayout.java",
"license": "apache-2.0",
"size": 20148
}
|
[
"android.view.View"
] |
import android.view.View;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 357,100
|
@PUT
@Path("stop")
InputStream stopScheduler(@HeaderParam("sessionid")
final String sessionId);
|
@Path("stop") InputStream stopScheduler(@HeaderParam(STR) final String sessionId);
|
/**
* Stops the Scheduler.
* @param sessionId the session id of the user which is logged in
* @return a ClientResponse containing the response status and true if the Scheduler was stopped paused and false in case of a
* failure
*/
|
Stops the Scheduler
|
stopScheduler
|
{
"repo_name": "lpellegr/scheduling-portal",
"path": "scheduler-portal/src/main/java/org/ow2/proactive_grid_cloud_portal/scheduler/server/RestClient.java",
"license": "agpl-3.0",
"size": 32783
}
|
[
"java.io.InputStream",
"javax.ws.rs.HeaderParam",
"javax.ws.rs.Path"
] |
import java.io.InputStream; import javax.ws.rs.HeaderParam; import javax.ws.rs.Path;
|
import java.io.*; import javax.ws.rs.*;
|
[
"java.io",
"javax.ws"
] |
java.io; javax.ws;
| 2,122,719
|
public Structure getBiologicalUnit(String pdbId) throws StructureException, IOException {
int bioAssemblyId = 1;
boolean bioAssemblyFallback = true;
return getBiologicalAssembly(pdbId, bioAssemblyId, bioAssemblyFallback);
}
|
Structure function(String pdbId) throws StructureException, IOException { int bioAssemblyId = 1; boolean bioAssemblyFallback = true; return getBiologicalAssembly(pdbId, bioAssemblyId, bioAssemblyFallback); }
|
/**
* Loads the default biological unit (*.pdb1.gz) file. If it is not available, the original PDB file will be loaded,
* i.e., for NMR structures, where the original files is also the biological assembly.
*
* @param pdbId
* the PDB ID
* @return a structure object
* @throws IOException
* @throws StructureException
* @since 3.2
*/
|
Loads the default biological unit (*.pdb1.gz) file. If it is not available, the original PDB file will be loaded, i.e., for NMR structures, where the original files is also the biological assembly
|
getBiologicalUnit
|
{
"repo_name": "kumar-physics/BioJava",
"path": "biojava3-structure/src/main/java/org/biojava/bio/structure/align/util/AtomCache.java",
"license": "lgpl-2.1",
"size": 34105
}
|
[
"java.io.IOException",
"org.biojava.bio.structure.Structure",
"org.biojava.bio.structure.StructureException"
] |
import java.io.IOException; import org.biojava.bio.structure.Structure; import org.biojava.bio.structure.StructureException;
|
import java.io.*; import org.biojava.bio.structure.*;
|
[
"java.io",
"org.biojava.bio"
] |
java.io; org.biojava.bio;
| 46,532
|
public ContentStore getContentStore(String storeID, int maxRetries)
throws ContentStoreException;
|
ContentStore function(String storeID, int maxRetries) throws ContentStoreException;
|
/**
* Gets a specific content store based on ID.
*
* @param storeID the ID of a particular content store
* @param maxRetries number of retries to perform if a content store call fails
* @return the ContentStore mapped to storeID
* @throws ContentStoreException if the content store cannot be retrieved
*/
|
Gets a specific content store based on ID
|
getContentStore
|
{
"repo_name": "duracloud/duracloud",
"path": "storeclient/src/main/java/org/duracloud/client/ContentStoreManager.java",
"license": "apache-2.0",
"size": 4206
}
|
[
"org.duracloud.error.ContentStoreException"
] |
import org.duracloud.error.ContentStoreException;
|
import org.duracloud.error.*;
|
[
"org.duracloud.error"
] |
org.duracloud.error;
| 901,768
|
public void readFully(long pos, byte[] b, int offset, int length)
throws IOException, MessageException {
if (start + length + pos > end) {
throw new IOException("Not enough bytes to read.");
}
underLyingStream.readFully(pos + start, b, offset, length);
}
|
void function(long pos, byte[] b, int offset, int length) throws IOException, MessageException { if (start + length + pos > end) { throw new IOException(STR); } underLyingStream.readFully(pos + start, b, offset, length); }
|
/**
* position readable again.
* @throws MessageException
*/
|
position readable again
|
readFully
|
{
"repo_name": "hanhlh/hadoop-0.20.2_FatBTree",
"path": "src/core/org/apache/hadoop/fs/HarFileSystem.java",
"license": "apache-2.0",
"size": 28247
}
|
[
"java.io.IOException",
"org.apache.hadoop.hdfs.server.namenodeFBT.msg.MessageException"
] |
import java.io.IOException; import org.apache.hadoop.hdfs.server.namenodeFBT.msg.MessageException;
|
import java.io.*; import org.apache.hadoop.hdfs.server.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,686,350
|
public DataValueDescriptor getDefault() throws StandardException {
switch(formatId){
case StoredFormatIds.BOOLEAN_TYPE_ID:
return new SQLBoolean(false);
case StoredFormatIds.CHAR_TYPE_ID:
return new SQLChar("");
case StoredFormatIds.DECIMAL_TYPE_ID:
return new SQLDecimal("0");
case StoredFormatIds.DECFLOAT_TYPE_ID:
return new SQLDecfloat("0");
case StoredFormatIds.DOUBLE_TYPE_ID:
return new SQLDouble(0);
case StoredFormatIds.INT_TYPE_ID:
return new SQLInteger(0);
case StoredFormatIds.LONGINT_TYPE_ID:
return new SQLLongint(0);
case StoredFormatIds.LONGVARBIT_TYPE_ID:
return new SQLLongVarbit(new byte[0]);
case StoredFormatIds.BLOB_TYPE_ID:
return new SQLBlob(new byte[0]);
case StoredFormatIds.CLOB_TYPE_ID:
return new SQLClob("");
case StoredFormatIds.LONGVARCHAR_TYPE_ID:
return new SQLLongvarchar("");
case StoredFormatIds.REAL_TYPE_ID:
return new SQLReal(0);
case StoredFormatIds.SMALLINT_TYPE_ID:
return new SQLSmallint(0);
case StoredFormatIds.TINYINT_TYPE_ID:
return new SQLTinyint((byte) 0);
case StoredFormatIds.VARBIT_TYPE_ID:
return new SQLVarbit(new byte[0]);
case StoredFormatIds.VARCHAR_TYPE_ID:
return new SQLVarchar("");
case StoredFormatIds.VARCHAR_DB2_COMPATIBLE_TYPE_ID:
return new SQLVarcharDB2Compatible("");
case StoredFormatIds.DATE_TYPE_ID:
case StoredFormatIds.TIME_TYPE_ID:
case StoredFormatIds.TIMESTAMP_TYPE_ID:
assert false: "Date, time and timestamp can't have empty defaults. They should be generated to current instead";
break;
case StoredFormatIds.BIT_TYPE_ID:
assert false: "BIT empty default should be filled in DataTypeDescriptor.getDefault where maximumWidth is known";
break;
case StoredFormatIds.LIST_TYPE_ID:
case StoredFormatIds.REF_TYPE_ID:
case StoredFormatIds.XML_TYPE_ID:
case StoredFormatIds.ARRAY_TYPE_ID:
case StoredFormatIds.USERDEFINED_TYPE_ID_V3:
default:
break;
}
throw new UnsupportedOperationException(
StandardException.newException(SQLState.SPLICE_NOT_IMPLEMENTED,"Empty default for " + formatId) );
}
|
DataValueDescriptor function() throws StandardException { switch(formatId){ case StoredFormatIds.BOOLEAN_TYPE_ID: return new SQLBoolean(false); case StoredFormatIds.CHAR_TYPE_ID: return new SQLChar(STR0STR0STRSTRSTRSTRSTRDate, time and timestamp can't have empty defaults. They should be generated to current insteadSTRBIT empty default should be filled in DataTypeDescriptor.getDefault where maximumWidth is knownSTREmpty default for " + formatId) ); }
|
/**
* Get SQL default value.
*
* @return SQL null value for this type.
*/
|
Get SQL default value
|
getDefault
|
{
"repo_name": "splicemachine/spliceengine",
"path": "db-engine/src/main/java/com/splicemachine/db/iapi/types/TypeId.java",
"license": "agpl-3.0",
"size": 67282
}
|
[
"com.splicemachine.db.iapi.error.StandardException",
"com.splicemachine.db.iapi.services.io.StoredFormatIds"
] |
import com.splicemachine.db.iapi.error.StandardException; import com.splicemachine.db.iapi.services.io.StoredFormatIds;
|
import com.splicemachine.db.iapi.error.*; import com.splicemachine.db.iapi.services.io.*;
|
[
"com.splicemachine.db"
] |
com.splicemachine.db;
| 220,727
|
@Override
public Adapter createForEachMediatorInputConnectorAdapter() {
if (forEachMediatorInputConnectorItemProvider == null) {
forEachMediatorInputConnectorItemProvider = new ForEachMediatorInputConnectorItemProvider(this);
}
return forEachMediatorInputConnectorItemProvider;
}
protected ForEachMediatorOutputConnectorItemProvider forEachMediatorOutputConnectorItemProvider;
|
Adapter function() { if (forEachMediatorInputConnectorItemProvider == null) { forEachMediatorInputConnectorItemProvider = new ForEachMediatorInputConnectorItemProvider(this); } return forEachMediatorInputConnectorItemProvider; } protected ForEachMediatorOutputConnectorItemProvider forEachMediatorOutputConnectorItemProvider;
|
/**
* This creates an adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.ForEachMediatorInputConnector}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
This creates an adapter for a <code>org.wso2.developerstudio.eclipse.gmf.esb.ForEachMediatorInputConnector</code>.
|
createForEachMediatorInputConnectorAdapter
|
{
"repo_name": "nwnpallewela/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/EsbItemProviderAdapterFactory.java",
"license": "apache-2.0",
"size": 304469
}
|
[
"org.eclipse.emf.common.notify.Adapter"
] |
import org.eclipse.emf.common.notify.Adapter;
|
import org.eclipse.emf.common.notify.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,044,822
|
@RequiredScope({download})
@RequestMapping(value = UrlHelpers.MESSAGE_ID_FILE, method = RequestMethod.GET)
public void fileRedirectForMessage(
@RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId,
@PathVariable("messageId") String messageId,
@RequestParam(required = false) Boolean redirect,
HttpServletResponse response) throws NotFoundException, IOException {
String redirectUrl = serviceProvider.getMessageService()
.getMessageFileRedirectURL(userId, messageId);
RedirectUtils.handleRedirect(redirect, redirectUrl, response);
}
|
@RequiredScope({download}) @RequestMapping(value = UrlHelpers.MESSAGE_ID_FILE, method = RequestMethod.GET) void function( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @PathVariable(STR) String messageId, @RequestParam(required = false) Boolean redirect, HttpServletResponse response) throws NotFoundException, IOException { String redirectUrl = serviceProvider.getMessageService() .getMessageFileRedirectURL(userId, messageId); RedirectUtils.handleRedirect(redirect, redirectUrl, response); }
|
/**
* Get the actual URL of the file associated with the message
* </br>
* Note: This call will result in a HTTP temporary redirect (307), to the
* actual file URL if the caller meets all of the download requirements.
*
* @param redirect
* When set to false, the URL will be returned as text/plain
* instead of redirecting.
*/
|
Get the actual URL of the file associated with the message Note: This call will result in a HTTP temporary redirect (307), to the actual file URL if the caller meets all of the download requirements
|
fileRedirectForMessage
|
{
"repo_name": "xschildw/Synapse-Repository-Services",
"path": "services/repository/src/main/java/org/sagebionetworks/repo/web/controller/MessageController.java",
"license": "apache-2.0",
"size": 15514
}
|
[
"java.io.IOException",
"javax.servlet.http.HttpServletResponse",
"org.sagebionetworks.repo.model.AuthorizationConstants",
"org.sagebionetworks.repo.web.NotFoundException",
"org.sagebionetworks.repo.web.RequiredScope",
"org.sagebionetworks.repo.web.UrlHelpers",
"org.springframework.web.bind.annotation.PathVariable",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestMethod",
"org.springframework.web.bind.annotation.RequestParam"
] |
import java.io.IOException; import javax.servlet.http.HttpServletResponse; import org.sagebionetworks.repo.model.AuthorizationConstants; import org.sagebionetworks.repo.web.NotFoundException; import org.sagebionetworks.repo.web.RequiredScope; import org.sagebionetworks.repo.web.UrlHelpers; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam;
|
import java.io.*; import javax.servlet.http.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*; import org.springframework.web.bind.annotation.*;
|
[
"java.io",
"javax.servlet",
"org.sagebionetworks.repo",
"org.springframework.web"
] |
java.io; javax.servlet; org.sagebionetworks.repo; org.springframework.web;
| 887,220
|
@Test
public void testSampleValuesRange() {
// Concentrate values near the endpoints of (0, 1).
// Unconstrained Gaussian kernel would generate values outside the interval.
final double[] data = new double[100];
for (int i = 0; i < 50; i++) {
data[i] = 1 / ((double) i + 1);
}
for (int i = 51; i < 100; i++) {
data[i] = 1 - 1 / (100 - (double) i + 2);
}
EmpiricalDistribution dist = new EmpiricalDistribution(10);
dist.load(data);
dist.reseedRandomGenerator(1000);
for (int i = 0; i < 1000; i++) {
final double dev = dist.sample();
Assert.assertTrue(dev < 1);
Assert.assertTrue(dev > 0);
}
}
|
void function() { final double[] data = new double[100]; for (int i = 0; i < 50; i++) { data[i] = 1 / ((double) i + 1); } for (int i = 51; i < 100; i++) { data[i] = 1 - 1 / (100 - (double) i + 2); } EmpiricalDistribution dist = new EmpiricalDistribution(10); dist.load(data); dist.reseedRandomGenerator(1000); for (int i = 0; i < 1000; i++) { final double dev = dist.sample(); Assert.assertTrue(dev < 1); Assert.assertTrue(dev > 0); } }
|
/**
* MATH-984
* Verify that sampled values do not go outside of the range of the data.
*/
|
MATH-984 Verify that sampled values do not go outside of the range of the data
|
testSampleValuesRange
|
{
"repo_name": "tknandu/CommonsMath_Modifed",
"path": "math (trunk)/src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java",
"license": "apache-2.0",
"size": 22915
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 2,666,601
|
public Automaton toAutomaton(Map<String,Automaton> automata,
int maxDeterminizedStates) throws IllegalArgumentException,
TooComplexToDeterminizeException {
return toAutomaton(automata, null, maxDeterminizedStates);
}
|
Automaton function(Map<String,Automaton> automata, int maxDeterminizedStates) throws IllegalArgumentException, TooComplexToDeterminizeException { return toAutomaton(automata, null, maxDeterminizedStates); }
|
/**
* Constructs new <code>Automaton</code> from this <code>RegExp</code>. The
* constructed automaton is minimal and deterministic and has no transitions
* to dead states.
*
* @param automata a map from automaton identifiers to automata (of type
* <code>Automaton</code>).
* @param maxDeterminizedStates maximum number of states in the resulting
* automata. If the automata would need more than this many states
* TooComplexToDeterminizeException is thrown. Higher number require more
* space but can process more complex regexes.
* @exception IllegalArgumentException if this regular expression uses a named
* identifier that does not occur in the automaton map
* @exception TooComplexToDeterminizeException if determinizing this regexp
* requires more than maxDeterminizedStates states
*/
|
Constructs new <code>Automaton</code> from this <code>RegExp</code>. The constructed automaton is minimal and deterministic and has no transitions to dead states
|
toAutomaton
|
{
"repo_name": "visouza/solr-5.0.0",
"path": "lucene/core/src/java/org/apache/lucene/util/automaton/RegExp.java",
"license": "apache-2.0",
"size": 34517
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,241,531
|
@Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
try {
final String fieldCheckValue =
BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCheckName);
final String fieldCompareValue =
BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCompareName);
if (StringUtils.isNotEmpty(fieldCheckValue) && StringUtils.isNotEmpty(fieldCompareValue)) {
this.switchContext(pcontext);
return false;
}
return true;
} catch (final Exception ignore) {
this.switchContext(pcontext);
return false;
}
}
|
final boolean function(final Object pvalue, final ConstraintValidatorContext pcontext) { if (pvalue == null) { return true; } try { final String fieldCheckValue = BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCheckName); final String fieldCompareValue = BeanPropertyReaderUtil.getNullSaveStringProperty(pvalue, this.fieldCompareName); if (StringUtils.isNotEmpty(fieldCheckValue) && StringUtils.isNotEmpty(fieldCompareValue)) { this.switchContext(pcontext); return false; } return true; } catch (final Exception ignore) { this.switchContext(pcontext); return false; } }
|
/**
* {@inheritDoc} check if given object is valid.
*
* @see javax.validation.ConstraintValidator#isValid(Object,
* javax.validation.ConstraintValidatorContext)
*/
|
check if given object is valid
|
isValid
|
{
"repo_name": "ManfredTremmel/mt-bean-validators",
"path": "src/main/java/de/knightsoftnet/validators/shared/impl/EmptyIfOtherIsNotEmptyValidator.java",
"license": "apache-2.0",
"size": 3143
}
|
[
"de.knightsoftnet.validators.shared.util.BeanPropertyReaderUtil",
"javax.validation.ConstraintValidatorContext",
"org.apache.commons.lang3.StringUtils"
] |
import de.knightsoftnet.validators.shared.util.BeanPropertyReaderUtil; import javax.validation.ConstraintValidatorContext; import org.apache.commons.lang3.StringUtils;
|
import de.knightsoftnet.validators.shared.util.*; import javax.validation.*; import org.apache.commons.lang3.*;
|
[
"de.knightsoftnet.validators",
"javax.validation",
"org.apache.commons"
] |
de.knightsoftnet.validators; javax.validation; org.apache.commons;
| 1,366,026
|
public void addNeighborFaces(ArrayList<MyFace> addFaces){
for (MyFace currFace: addFaces){
if (!faces.contains(currFace)){
faces.add(currFace);
}
}
//Auch duplicates faces hinzuf�gen, da sie ja den gleichen vertex sharen
//und f�r die normalenberechnung alle neighborfaces brauchen
for (VertexData vdDuplicate : this.getDuplicateVertexWithDiffTexCoordsList()){
vdDuplicate.addNeighborFaces(addFaces);
}
}
|
void function(ArrayList<MyFace> addFaces){ for (MyFace currFace: addFaces){ if (!faces.contains(currFace)){ faces.add(currFace); } } for (VertexData vdDuplicate : this.getDuplicateVertexWithDiffTexCoordsList()){ vdDuplicate.addNeighborFaces(addFaces); } }
|
/**
* Add and register the specified neighbors for this vertexdata and ints duplicates
* with different tex coords but same vertex pointer.
*
* @param addFaces the add faces
*/
|
Add and register the specified neighbors for this vertexdata and ints duplicates with different tex coords but same vertex pointer
|
addNeighborFaces
|
{
"repo_name": "rogiermars/mt4j-core",
"path": "src/org/mt4j/util/TriangleNormalGenerator.java",
"license": "gpl-2.0",
"size": 71916
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,128,083
|
public void parse(ParserInputSource source)
throws BuildFileContainsErrorsException, InterruptedException {
parse(source, null);
}
|
void function(ParserInputSource source) throws BuildFileContainsErrorsException, InterruptedException { parse(source, null); }
|
/**
* Parses the given WORKSPACE file without resolving skylark imports.
*/
|
Parses the given WORKSPACE file without resolving skylark imports
|
parse
|
{
"repo_name": "variac/bazel",
"path": "src/main/java/com/google/devtools/build/lib/packages/WorkspaceFactory.java",
"license": "apache-2.0",
"size": 23973
}
|
[
"com.google.devtools.build.lib.syntax.ParserInputSource"
] |
import com.google.devtools.build.lib.syntax.ParserInputSource;
|
import com.google.devtools.build.lib.syntax.*;
|
[
"com.google.devtools"
] |
com.google.devtools;
| 1,842,575
|
public boolean isLatest(LocalDateTime compare) {
int result = -1;
if (compare != null) {
result = lastChanged.compareTo(compare);
}
return result >= 0;
}
|
boolean function(LocalDateTime compare) { int result = -1; if (compare != null) { result = lastChanged.compareTo(compare); } return result >= 0; }
|
/**
* Returns true if the data is upToDate (compare is older or equal).
*
* @param compare LocalDateTime to compare to.
* @return If the data is upToDate.
*/
|
Returns true if the data is upToDate (compare is older or equal)
|
isLatest
|
{
"repo_name": "DaFloWaDa/MeytonAnalysis",
"path": "src/main/java/de/edelweissschuetzen/meytonanalysis/api/resource/Resource.java",
"license": "apache-2.0",
"size": 1621
}
|
[
"java.time.LocalDateTime"
] |
import java.time.LocalDateTime;
|
import java.time.*;
|
[
"java.time"
] |
java.time;
| 2,233,699
|
public CmsMailSettings getMailSettings() {
return m_mailSettings;
}
|
CmsMailSettings function() { return m_mailSettings; }
|
/**
* Returns the configured mail settings.<p>
*
* @return the configured mail settings
*/
|
Returns the configured mail settings
|
getMailSettings
|
{
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/configuration/CmsSystemConfiguration.java",
"license": "lgpl-2.1",
"size": 119837
}
|
[
"org.opencms.mail.CmsMailSettings"
] |
import org.opencms.mail.CmsMailSettings;
|
import org.opencms.mail.*;
|
[
"org.opencms.mail"
] |
org.opencms.mail;
| 1,225,981
|
public static void updateWidget(Context context) {
final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
if(THIS_APPWIDGET == null) {
THIS_APPWIDGET = new ComponentName(context, AccountWidgetProvider.class);
}
int[] appWidgetIds = appWidgetManager.getAppWidgetIds(THIS_APPWIDGET);
for (int widgetId : appWidgetIds) {
RemoteViews view = buildUpdate(context, widgetId);
appWidgetManager.updateAppWidget(widgetId, view);
}
}
|
static void function(Context context) { final AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context); if(THIS_APPWIDGET == null) { THIS_APPWIDGET = new ComponentName(context, AccountWidgetProvider.class); } int[] appWidgetIds = appWidgetManager.getAppWidgetIds(THIS_APPWIDGET); for (int widgetId : appWidgetIds) { RemoteViews view = buildUpdate(context, widgetId); appWidgetManager.updateAppWidget(widgetId, view); } }
|
/**
* Updates the widget when something changes, or when a button is pushed.
*
* @param context
*/
|
Updates the widget when something changes, or when a button is pushed
|
updateWidget
|
{
"repo_name": "ccalleu/halo-halo",
"path": "CSipSimple/src/com/csipsimple/widgets/AccountWidgetProvider.java",
"license": "gpl-3.0",
"size": 7446
}
|
[
"android.appwidget.AppWidgetManager",
"android.content.ComponentName",
"android.content.Context",
"android.widget.RemoteViews"
] |
import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Context; import android.widget.RemoteViews;
|
import android.appwidget.*; import android.content.*; import android.widget.*;
|
[
"android.appwidget",
"android.content",
"android.widget"
] |
android.appwidget; android.content; android.widget;
| 1,775,450
|
public Color getColor()
{
int value = picture.getBasicPixel(x,y);
// get the red value (starts at 17 so shift right 16)
// then and it with all 1's for the first 8 bits to keep
// end up with from 0 to 255
int red = (value >> 16) & 0xff;
// get the green value (starts at 9 so shift right 8)
int green = (value >> 8) & 0xff;
// get the blue value (starts at 0 so no shift required)
int blue = value & 0xff;
return new Color(red,green,blue);
}
|
Color function() { int value = picture.getBasicPixel(x,y); int red = (value >> 16) & 0xff; int green = (value >> 8) & 0xff; int blue = value & 0xff; return new Color(red,green,blue); }
|
/**
* Method to get a color object that represents the color at this pixel.
* @return a color object that represents the pixel color
*/
|
Method to get a color object that represents the color at this pixel
|
getColor
|
{
"repo_name": "DirkyJerky/ProgrammingClass",
"path": "src/me/yoerger/geoff/edu/progClass/bookClasses/Pixel.java",
"license": "mit",
"size": 10328
}
|
[
"java.awt.Color"
] |
import java.awt.Color;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,454,533
|
@Test
public void testEventWithSystemNamespaceExtendsEventWithOtherSystemNamespaceAccessPublic() throws QuickFixException {
//create event with system namespace
String eventSource = "<aura:event type='COMPONENT' access='PUBLIC'/>";
DefDescriptor<? extends Definition> eventDescriptor = getAuraTestingUtil().addSourceAutoCleanup(EventDef.class, eventSource,
StringSourceLoader.DEFAULT_NAMESPACE + ":testevent", true);
//create event extends the event above
String source = "<aura:event type='COMPONENT' extends='" + eventDescriptor.getNamespace() + ":" + eventDescriptor.getName() + "' /> ";
DefDescriptor<? extends Definition> descriptor = getAuraTestingUtil().addSourceAutoCleanup(EventDef.class, source,
StringSourceLoader.OTHER_NAMESPACE + ":testevent2", true);
descriptor.getDef();
}
|
void function() throws QuickFixException { String eventSource = STR; DefDescriptor<? extends Definition> eventDescriptor = getAuraTestingUtil().addSourceAutoCleanup(EventDef.class, eventSource, StringSourceLoader.DEFAULT_NAMESPACE + STR, true); String source = STR + eventDescriptor.getNamespace() + ":" + eventDescriptor.getName() + STR; DefDescriptor<? extends Definition> descriptor = getAuraTestingUtil().addSourceAutoCleanup(EventDef.class, source, StringSourceLoader.OTHER_NAMESPACE + STR, true); descriptor.getDef(); }
|
/**
* Verify PUBLIC access enforcement
* verifyAccess for Event,System,SystemOther
*/
|
Verify PUBLIC access enforcement verifyAccess for Event,System,SystemOther
|
testEventWithSystemNamespaceExtendsEventWithOtherSystemNamespaceAccessPublic
|
{
"repo_name": "badlogicmanpreet/aura",
"path": "aura-integration-test/src/test/java/org/auraframework/integration/test/root/parser/handler/EventAccessAttributeEnforcementTest.java",
"license": "apache-2.0",
"size": 41903
}
|
[
"org.auraframework.def.DefDescriptor",
"org.auraframework.def.Definition",
"org.auraframework.def.EventDef",
"org.auraframework.test.source.StringSourceLoader",
"org.auraframework.throwable.quickfix.QuickFixException"
] |
import org.auraframework.def.DefDescriptor; import org.auraframework.def.Definition; import org.auraframework.def.EventDef; import org.auraframework.test.source.StringSourceLoader; import org.auraframework.throwable.quickfix.QuickFixException;
|
import org.auraframework.def.*; import org.auraframework.test.source.*; import org.auraframework.throwable.quickfix.*;
|
[
"org.auraframework.def",
"org.auraframework.test",
"org.auraframework.throwable"
] |
org.auraframework.def; org.auraframework.test; org.auraframework.throwable;
| 656,877
|
Boolean instantiateTriggerCallback() {
if (_sessionCallbackClassName != null
&& !_sessionCallbackClassName.isEmpty())
try {
Class<?> c = Class.forName(_sessionCallbackClassName);
_callback = (SessionCallback) c.newInstance();
} catch (ClassNotFoundException e) {
_log.error("A ClassNotFoundException occured when trying to instantiate:"
+ this._sessionCallbackClassName);
e.printStackTrace();
return Boolean.FALSE;
} catch (InstantiationException e) {
_log.error("A InstantiationException occured when trying to instantiate:"
+ this._sessionCallbackClassName);
e.printStackTrace();
return Boolean.FALSE;
} catch (IllegalAccessException e) {
_log.error("A IllegalAccessException occured when trying to instantiate:"
+ this._sessionCallbackClassName);
e.printStackTrace();
return Boolean.FALSE;
}
return Boolean.TRUE;
}
|
Boolean instantiateTriggerCallback() { if (_sessionCallbackClassName != null && !_sessionCallbackClassName.isEmpty()) try { Class<?> c = Class.forName(_sessionCallbackClassName); _callback = (SessionCallback) c.newInstance(); } catch (ClassNotFoundException e) { _log.error(STR + this._sessionCallbackClassName); e.printStackTrace(); return Boolean.FALSE; } catch (InstantiationException e) { _log.error(STR + this._sessionCallbackClassName); e.printStackTrace(); return Boolean.FALSE; } catch (IllegalAccessException e) { _log.error(STR + this._sessionCallbackClassName); e.printStackTrace(); return Boolean.FALSE; } return Boolean.TRUE; }
|
/**
* Instantiates the trigger callback handler class
*
* @return
*/
|
Instantiates the trigger callback handler class
|
instantiateTriggerCallback
|
{
"repo_name": "yauritux/venice-legacy",
"path": "Venice/Venice-Service/src/main/java/com/gdn/venice/facade/FinSalesRecordSessionEJBBean.java",
"license": "apache-2.0",
"size": 19412
}
|
[
"com.gdn.venice.facade.callback.SessionCallback"
] |
import com.gdn.venice.facade.callback.SessionCallback;
|
import com.gdn.venice.facade.callback.*;
|
[
"com.gdn.venice"
] |
com.gdn.venice;
| 2,841,266
|
public void setResourceLocalService(
ResourceLocalService resourceLocalService) {
this.resourceLocalService = resourceLocalService;
}
|
void function( ResourceLocalService resourceLocalService) { this.resourceLocalService = resourceLocalService; }
|
/**
* Sets the resource local service.
*
* @param resourceLocalService the resource local service
*/
|
Sets the resource local service
|
setResourceLocalService
|
{
"repo_name": "iucn-whp/world-heritage-outlook",
"path": "portlets/iucn-dbservice-portlet/docroot/WEB-INF/src/com/iucn/whp/dbservice/service/base/effective_prot_mgmt_iothreatsLocalServiceBaseImpl.java",
"license": "gpl-2.0",
"size": 176884
}
|
[
"com.liferay.portal.service.ResourceLocalService"
] |
import com.liferay.portal.service.ResourceLocalService;
|
import com.liferay.portal.service.*;
|
[
"com.liferay.portal"
] |
com.liferay.portal;
| 2,813,389
|
private void storePolymorphisms( DBconnection conn )
throws InvalidActionException, SQLException {
if ( hasPolymorphisms() ) {
TfcPolymorphism poly = null;
TfcGermplasmMapElement germplasmAllele = null;
Iterator iter = alleles.keySet().iterator();
while ( iter.hasNext() ) {
poly = (TfcPolymorphism) iter.next();
germplasmAllele = (TfcGermplasmMapElement) alleles.get( poly );
germplasmAllele.set_germplasm_id( get_germplasm_id() );
germplasmAllele.store( conn );
}
}
}
|
void function( DBconnection conn ) throws InvalidActionException, SQLException { if ( hasPolymorphisms() ) { TfcPolymorphism poly = null; TfcGermplasmMapElement germplasmAllele = null; Iterator iter = alleles.keySet().iterator(); while ( iter.hasNext() ) { poly = (TfcPolymorphism) iter.next(); germplasmAllele = (TfcGermplasmMapElement) alleles.get( poly ); germplasmAllele.set_germplasm_id( get_germplasm_id() ); germplasmAllele.store( conn ); } } }
|
/**
* Stores germplasm's associations to polymorphisms. Polymorphism
* data itself is not INSERTed or UPDATEd in this operation
*
* @param conn A database connection with UPDATE/INSERT/DELETE privileges
* @throws InvalidActionException if required data has not been set
* for any elements
* @throws SQLException if a database error occurs
*/
|
Stores germplasm's associations to polymorphisms. Polymorphism data itself is not INSERTed or UPDATEd in this operation
|
storePolymorphisms
|
{
"repo_name": "tair/tairwebapp",
"path": "src/org/tair/processor/microarray/data/LoadableGermplasm.java",
"license": "gpl-3.0",
"size": 16055
}
|
[
"java.sql.SQLException",
"java.util.Iterator",
"org.tair.tfc.DBconnection",
"org.tair.tfc.TfcGermplasmMapElement",
"org.tair.tfc.TfcPolymorphism",
"org.tair.utilities.InvalidActionException"
] |
import java.sql.SQLException; import java.util.Iterator; import org.tair.tfc.DBconnection; import org.tair.tfc.TfcGermplasmMapElement; import org.tair.tfc.TfcPolymorphism; import org.tair.utilities.InvalidActionException;
|
import java.sql.*; import java.util.*; import org.tair.tfc.*; import org.tair.utilities.*;
|
[
"java.sql",
"java.util",
"org.tair.tfc",
"org.tair.utilities"
] |
java.sql; java.util; org.tair.tfc; org.tair.utilities;
| 173,008
|
CompletableFuture<?> appendPage(Page page);
|
CompletableFuture<?> appendPage(Page page);
|
/**
* Returns a future that will be completed when the page sink can accept
* more pages. If the page sink can accept more pages immediately,
* this method should return {@code NOT_BLOCKED}.
*/
|
Returns a future that will be completed when the page sink can accept more pages. If the page sink can accept more pages immediately, this method should return NOT_BLOCKED
|
appendPage
|
{
"repo_name": "ebyhr/presto",
"path": "core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorPageSink.java",
"license": "apache-2.0",
"size": 2401
}
|
[
"io.trino.spi.Page",
"java.util.concurrent.CompletableFuture"
] |
import io.trino.spi.Page; import java.util.concurrent.CompletableFuture;
|
import io.trino.spi.*; import java.util.concurrent.*;
|
[
"io.trino.spi",
"java.util"
] |
io.trino.spi; java.util;
| 2,839,885
|
protected final MessageAddressingProperties newChannelParams() {
assertNotNull(newReply);
assertNotNull(newReply.getMessageContext());
SoapMessage request = (SoapMessage) newReply.getMessageContext().getRequest();
assertNotNull(request);
MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties(request);
assertNotNull(wsaProperties);
assertNotNull(wsaProperties.getTo());
return wsaProperties;
}
|
final MessageAddressingProperties function() { assertNotNull(newReply); assertNotNull(newReply.getMessageContext()); SoapMessage request = (SoapMessage) newReply.getMessageContext().getRequest(); assertNotNull(request); MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties(request); assertNotNull(wsaProperties); assertNotNull(wsaProperties.getTo()); return wsaProperties; }
|
/**
* Only response is allow using a brand new channel
*/
|
Only response is allow using a brand new channel
|
newChannelParams
|
{
"repo_name": "nikhilvibhav/camel",
"path": "components/camel-spring-ws/src/test/java/org/apache/camel/component/spring/ws/addressing/AbstractWSATests.java",
"license": "apache-2.0",
"size": 6539
}
|
[
"org.apache.camel.component.spring.ws.utils.TestUtil",
"org.junit.jupiter.api.Assertions",
"org.springframework.ws.soap.SoapMessage",
"org.springframework.ws.soap.addressing.core.MessageAddressingProperties"
] |
import org.apache.camel.component.spring.ws.utils.TestUtil; import org.junit.jupiter.api.Assertions; import org.springframework.ws.soap.SoapMessage; import org.springframework.ws.soap.addressing.core.MessageAddressingProperties;
|
import org.apache.camel.component.spring.ws.utils.*; import org.junit.jupiter.api.*; import org.springframework.ws.soap.*; import org.springframework.ws.soap.addressing.core.*;
|
[
"org.apache.camel",
"org.junit.jupiter",
"org.springframework.ws"
] |
org.apache.camel; org.junit.jupiter; org.springframework.ws;
| 2,728,714
|
ServiceResponseWithHeaders<Void, LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders> beginDeleteAsyncRelativeRetryInvalidJsonPolling() throws CloudException, IOException;
|
ServiceResponseWithHeaders<Void, LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders> beginDeleteAsyncRelativeRetryInvalidJsonPolling() throws CloudException, IOException;
|
/**
* Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status.
*
* @throws CloudException exception thrown from REST call
* @throws IOException exception thrown from serialization/deserialization
* @return the {@link ServiceResponseWithHeaders} object if successful.
*/
|
Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status
|
beginDeleteAsyncRelativeRetryInvalidJsonPolling
|
{
"repo_name": "yaqiyang/autorest",
"path": "src/generator/AutoRest.Java.Azure.Tests/src/main/java/fixtures/lro/LROSADs.java",
"license": "mit",
"size": 104951
}
|
[
"com.microsoft.azure.CloudException",
"com.microsoft.rest.ServiceResponseWithHeaders",
"java.io.IOException"
] |
import com.microsoft.azure.CloudException; import com.microsoft.rest.ServiceResponseWithHeaders; import java.io.IOException;
|
import com.microsoft.azure.*; import com.microsoft.rest.*; import java.io.*;
|
[
"com.microsoft.azure",
"com.microsoft.rest",
"java.io"
] |
com.microsoft.azure; com.microsoft.rest; java.io;
| 2,216,177
|
public void startCDATA(Augmentations augs) throws XNIException {
if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
fDocumentHandler.startCDATA(augs);
}
} // startCDATA()
|
void function(Augmentations augs) throws XNIException { if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) { fDocumentHandler.startCDATA(augs); } }
|
/**
* The start of a CDATA section.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
|
The start of a CDATA section
|
startCDATA
|
{
"repo_name": "BIORIMP/biorimp",
"path": "BIO-RIMP/test_data/code/xerces/src/org/apache/xerces/impl/XMLNamespaceBinder.java",
"license": "gpl-2.0",
"size": 33107
}
|
[
"org.apache.xerces.xni.Augmentations",
"org.apache.xerces.xni.XNIException"
] |
import org.apache.xerces.xni.Augmentations; import org.apache.xerces.xni.XNIException;
|
import org.apache.xerces.xni.*;
|
[
"org.apache.xerces"
] |
org.apache.xerces;
| 1,973,409
|
public BigInteger getE() {
return this.e;
}
|
BigInteger function() { return this.e; }
|
/**
* Gets e.
*
* @return the e
*/
|
Gets e
|
getE
|
{
"repo_name": "forsrc/MyStudy",
"path": "src/main/java/com/forsrc/utils/MyRsaUtils.java",
"license": "apache-2.0",
"size": 16784
}
|
[
"java.math.BigInteger"
] |
import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 103,013
|
interface WithInputDirectories {
WithCreate withInputDirectories(List<InputDirectory> inputDirectories);
}
|
interface WithInputDirectories { WithCreate withInputDirectories(List<InputDirectory> inputDirectories); }
|
/**
* Specifies inputDirectories.
*/
|
Specifies inputDirectories
|
withInputDirectories
|
{
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/Job.java",
"license": "mit",
"size": 18641
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,870,963
|
Assert.assertEquals(NumberUtils.toInt(null), 0);
Assert.assertEquals(NumberUtils.toInt(""), 0);
Assert.assertEquals(NumberUtils.toInt("1"), 1);
Assert.assertEquals(NumberUtils.toInt(null, 1), 1);
Assert.assertEquals(NumberUtils.toInt("", 1), 1);
Assert.assertEquals(NumberUtils.toInt("1", 0), 1);
}
|
Assert.assertEquals(NumberUtils.toInt(null), 0); Assert.assertEquals(NumberUtils.toInt(STR1STRSTR1", 0), 1); }
|
/**
* Test case to convert string to Integer
*/
|
Test case to convert string to Integer
|
testToInt
|
{
"repo_name": "deepak-malik/Data-Structures-In-Java",
"path": "test/com/deepak/data/structures/Utils/NumberUtilsTest.java",
"license": "mit",
"size": 1403
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 256,618
|
@Override public void exitExpressionconstraintvalue(@NotNull ECLParser.ExpressionconstraintvalueContext ctx) { }
|
@Override public void exitExpressionconstraintvalue(@NotNull ECLParser.ExpressionconstraintvalueContext ctx) { }
|
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
|
The default implementation does nothing
|
enterExpressionconstraintvalue
|
{
"repo_name": "WestCoastInformatics/UMLS-Terminology-Server",
"path": "jpa-services/src/main/resources/ECLBaseListener.java",
"license": "apache-2.0",
"size": 18157
}
|
[
"org.antlr.v4.runtime.misc.NotNull"
] |
import org.antlr.v4.runtime.misc.NotNull;
|
import org.antlr.v4.runtime.misc.*;
|
[
"org.antlr.v4"
] |
org.antlr.v4;
| 2,506,520
|
protected Object createObject(COSBase kid)
{
COSDictionary kidDic = null;
if (kid instanceof COSDictionary)
{
kidDic = (COSDictionary) kid;
}
else if (kid instanceof COSObject)
{
COSBase base = ((COSObject) kid).getObject();
if (base instanceof COSDictionary)
{
kidDic = (COSDictionary) base;
}
}
if (kidDic != null)
{
return createObjectFromDic(kidDic);
}
else if (kid instanceof COSInteger)
{
// An integer marked-content identifier denoting a marked-content sequence
COSInteger mcid = (COSInteger) kid;
return mcid.intValue();
}
return null;
}
|
Object function(COSBase kid) { COSDictionary kidDic = null; if (kid instanceof COSDictionary) { kidDic = (COSDictionary) kid; } else if (kid instanceof COSObject) { COSBase base = ((COSObject) kid).getObject(); if (base instanceof COSDictionary) { kidDic = (COSDictionary) base; } } if (kidDic != null) { return createObjectFromDic(kidDic); } else if (kid instanceof COSInteger) { COSInteger mcid = (COSInteger) kid; return mcid.intValue(); } return null; }
|
/**
* Creates an object for a kid of this structure node.
* The type of object depends on the type of the kid. It can be
* <ul>
* <li>a {@link PDStructureElement},</li>
* <li>a {@link PDObjectReference},</li>
* <li>a {@link PDMarkedContentReference},</li>
* <li>an {@link Integer}</li>
* </ul>
*
* @param kid the kid
* @return the object
*/
|
Creates an object for a kid of this structure node. The type of object depends on the type of the kid. It can be a <code>PDStructureElement</code>, a <code>PDObjectReference</code>, a <code>PDMarkedContentReference</code>, an <code>Integer</code>
|
createObject
|
{
"repo_name": "TomRoush/PdfBox-Android",
"path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureNode.java",
"license": "apache-2.0",
"size": 12046
}
|
[
"com.tom_roush.pdfbox.cos.COSBase",
"com.tom_roush.pdfbox.cos.COSDictionary",
"com.tom_roush.pdfbox.cos.COSInteger",
"com.tom_roush.pdfbox.cos.COSObject"
] |
import com.tom_roush.pdfbox.cos.COSBase; import com.tom_roush.pdfbox.cos.COSDictionary; import com.tom_roush.pdfbox.cos.COSInteger; import com.tom_roush.pdfbox.cos.COSObject;
|
import com.tom_roush.pdfbox.cos.*;
|
[
"com.tom_roush.pdfbox"
] |
com.tom_roush.pdfbox;
| 1,051,311
|
void ok() {
if (this.showCats && this.initialCategory == null) {
Window.alert("You have to pick an initial category.");
return;
} else {
try {
validatePathPerJSR170(this.name.getText());
} catch (IllegalArgumentException e) {
Window.alert(e.getMessage());
return;
}
}
|
void ok() { if (this.showCats && this.initialCategory == null) { Window.alert(STR); return; } else { try { validatePathPerJSR170(this.name.getText()); } catch (IllegalArgumentException e) { Window.alert(e.getMessage()); return; } }
|
/**
* When OK is pressed, it will update the repository with the new rule.
*/
|
When OK is pressed, it will update the repository with the new rule
|
ok
|
{
"repo_name": "bobmcwhirter/drools",
"path": "drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/NewAssetWizard.java",
"license": "apache-2.0",
"size": 8292
}
|
[
"com.google.gwt.user.client.Window"
] |
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.*;
|
[
"com.google.gwt"
] |
com.google.gwt;
| 1,958,755
|
void setRuleDescExclusionFilter(Pattern exclusionFilter);
|
void setRuleDescExclusionFilter(Pattern exclusionFilter);
|
/**
* Sets the exclusion filter to use for this planner. Rules which match the
* given pattern will not be fired regardless of whether or when they are
* added to the planner.
*
* @param exclusionFilter pattern to match for exclusion; null to disable
* filtering
*/
|
Sets the exclusion filter to use for this planner. Rules which match the given pattern will not be fired regardless of whether or when they are added to the planner
|
setRuleDescExclusionFilter
|
{
"repo_name": "googleinterns/calcite",
"path": "core/src/main/java/org/apache/calcite/plan/RelOptPlanner.java",
"license": "apache-2.0",
"size": 11977
}
|
[
"java.util.regex.Pattern"
] |
import java.util.regex.Pattern;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 1,890,553
|
void enterGetter(@NotNull ECMAScriptParser.GetterContext ctx);
void exitGetter(@NotNull ECMAScriptParser.GetterContext ctx);
|
void enterGetter(@NotNull ECMAScriptParser.GetterContext ctx); void exitGetter(@NotNull ECMAScriptParser.GetterContext ctx);
|
/**
* Exit a parse tree produced by {@link ECMAScriptParser#getter}.
* @param ctx the parse tree
*/
|
Exit a parse tree produced by <code>ECMAScriptParser#getter</code>
|
exitGetter
|
{
"repo_name": "IsThisThePayneResidence/intellidots",
"path": "src/main/java/ua/edu/hneu/ast/parsers/ECMAScriptListener.java",
"license": "gpl-3.0",
"size": 39591
}
|
[
"org.antlr.v4.runtime.misc.NotNull"
] |
import org.antlr.v4.runtime.misc.NotNull;
|
import org.antlr.v4.runtime.misc.*;
|
[
"org.antlr.v4"
] |
org.antlr.v4;
| 44,109
|
private void runPrecaptureSequence() {
Log.d(TAG, "runPrecaptureSequence: ");
try {
// This is how to tell the camera to trigger.
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER,
CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_START);
// Tell #mCaptureCallback to wait for the precapture sequence to be set.
mState = STATE_WAITING_PRECAPTURE;
mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback,
mBackgroundHandler);
} catch (CameraAccessException e) {
e.printStackTrace();
}
}
|
void function() { Log.d(TAG, STR); try { mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_START); mState = STATE_WAITING_PRECAPTURE; mCaptureSession.capture(mPreviewRequestBuilder.build(), mCaptureCallback, mBackgroundHandler); } catch (CameraAccessException e) { e.printStackTrace(); } }
|
/**
* Run the precapture sequence for capturing a still image. This method should be called when we
* get a response in {@link #mCaptureCallback} from {@link #lockFocus()}.
*/
|
Run the precapture sequence for capturing a still image. This method should be called when we get a response in <code>#mCaptureCallback</code> from <code>#lockFocus()</code>
|
runPrecaptureSequence
|
{
"repo_name": "MaTriXy/io2015-codelabs",
"path": "voice-interaction-api/voice-interaction-start/Application/src/main/java/com/example/android/voicecamera/CameraFragment.java",
"license": "apache-2.0",
"size": 37429
}
|
[
"android.hardware.camera2.CameraAccessException",
"android.hardware.camera2.CaptureRequest",
"android.util.Log"
] |
import android.hardware.camera2.CameraAccessException; import android.hardware.camera2.CaptureRequest; import android.util.Log;
|
import android.hardware.camera2.*; import android.util.*;
|
[
"android.hardware",
"android.util"
] |
android.hardware; android.util;
| 1,299,115
|
@Override
public void onClick(View view) {
// Do nothing if we are not playing
if(playing == false)
return;
// Shifts for row and column
int sh_row, sh_col;
// Set the shifts, according to the clicked button
switch (view.getId()) {
case R.id.btnUpLeft:
sh_row = -1;
sh_col = -1;
break;
case R.id.btnUp:
sh_row = -1;
sh_col = 0;
break;
case R.id.btnUpRight:
sh_row = -1;
sh_col = 1;
break;
case R.id.btnLeft:
sh_row = 0;
sh_col = -1;
break;
case R.id.btnRight:
sh_row = 0;
sh_col = 1;
break;
case R.id.btnDownLeft:
sh_row = 1;
sh_col = -1;
break;
case R.id.btnDown:
sh_row = 1;
sh_col = 0;
break;
default: //case R.id.btnDownRight:
sh_row = 1;
sh_col = 1;
break;
}
// Calculate new position
int to_row = human_row + sh_row;
int to_col = human_col + sh_col;
// Do things if the new position is legal (board inside)
if (to_row >= 0 && to_row < BOARD_ROWS && to_col >= 0 && to_col < BOARD_COLS) {
// Involved cells
Cell from_cell = boardCells[human_row][human_col]; // Human cell
Cell to_cell = boardCells[to_row][to_col]; // Destination cell
// Check destination cell contents
switch(to_cell.getType()) {
// Ground: Ok, move the human there
case Cell.CELL_GROUND :
// Play the song
soundPool.play(soundMove, 1.0f, 1.0f, 0, 0, 1.0f);
from_cell.setType(Cell.CELL_GROUND);
to_cell.setType(Cell.CELL_HUMAN);
human_row = to_row;
human_col = to_col;
actRobots();
break;
// Robot: Kill the human
case Cell.CELL_ROBOT :
to_cell.setType(Cell.CELL_ROBOT_WIN);
youAreDead();
break;
}
}
}
};
OnClickListener onClickListenerForTel = new OnClickListener() {
|
void function(View view) { if(playing == false) return; int sh_row, sh_col; switch (view.getId()) { case R.id.btnUpLeft: sh_row = -1; sh_col = -1; break; case R.id.btnUp: sh_row = -1; sh_col = 0; break; case R.id.btnUpRight: sh_row = -1; sh_col = 1; break; case R.id.btnLeft: sh_row = 0; sh_col = -1; break; case R.id.btnRight: sh_row = 0; sh_col = 1; break; case R.id.btnDownLeft: sh_row = 1; sh_col = -1; break; case R.id.btnDown: sh_row = 1; sh_col = 0; break; default: sh_row = 1; sh_col = 1; break; } int to_row = human_row + sh_row; int to_col = human_col + sh_col; if (to_row >= 0 && to_row < BOARD_ROWS && to_col >= 0 && to_col < BOARD_COLS) { Cell from_cell = boardCells[human_row][human_col]; Cell to_cell = boardCells[to_row][to_col]; switch(to_cell.getType()) { case Cell.CELL_GROUND : soundPool.play(soundMove, 1.0f, 1.0f, 0, 0, 1.0f); from_cell.setType(Cell.CELL_GROUND); to_cell.setType(Cell.CELL_HUMAN); human_row = to_row; human_col = to_col; actRobots(); break; case Cell.CELL_ROBOT : to_cell.setType(Cell.CELL_ROBOT_WIN); youAreDead(); break; } } } }; OnClickListener onClickListenerForTel = new OnClickListener() {
|
/**
* Method called when a button is clicked.
*
* @param view Related view (Button)
*/
|
Method called when a button is clicked
|
onClick
|
{
"repo_name": "MiguelVis/RobotsAndroidStudio",
"path": "app/src/main/java/es/floppysoftware/robots/MainActivity.java",
"license": "gpl-2.0",
"size": 19146
}
|
[
"android.view.View"
] |
import android.view.View;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 1,306,118
|
@SideOnly(Side.CLIENT)
public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
{
this.motionX = p_70016_1_;
this.motionY = p_70016_3_;
this.motionZ = p_70016_5_;
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, (double)f) * 180.0D / Math.PI);
}
}
|
@SideOnly(Side.CLIENT) void function(double p_70016_1_, double p_70016_3_, double p_70016_5_) { this.motionX = p_70016_1_; this.motionY = p_70016_3_; this.motionZ = p_70016_5_; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, (double)f) * 180.0D / Math.PI); } }
|
/**
* Sets the velocity to the args. Args: x, y, z
*/
|
Sets the velocity to the args. Args: x, y, z
|
setVelocity
|
{
"repo_name": "CheeseL0ver/Ore-TTM",
"path": "build/tmp/recompSrc/net/minecraft/entity/projectile/EntityThrowable.java",
"license": "lgpl-2.1",
"size": 13315
}
|
[
"net.minecraft.util.MathHelper"
] |
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.*;
|
[
"net.minecraft.util"
] |
net.minecraft.util;
| 2,351,764
|
public void setManagerOptions(Set<UUID> managerOptions) {
ColumnDescription columndesc = new ColumnDescription(
OpenVSwitchColumn.MANAGEROPTIONS
.columnName(),
"setManagerOptions",
VersionNum.VERSION100);
super.setDataHandler(columndesc, managerOptions);
}
|
void function(Set<UUID> managerOptions) { ColumnDescription columndesc = new ColumnDescription( OpenVSwitchColumn.MANAGEROPTIONS .columnName(), STR, VersionNum.VERSION100); super.setDataHandler(columndesc, managerOptions); }
|
/**
* Add a Column entity which column name is "manager_options" to the Row
* entity of attributes.
* @param managerOptions the column data which column name is
* "manager_options"
*/
|
Add a Column entity which column name is "manager_options" to the Row entity of attributes
|
setManagerOptions
|
{
"repo_name": "planoAccess/clonedONOS",
"path": "protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/table/OpenVSwitch.java",
"license": "apache-2.0",
"size": 22432
}
|
[
"java.util.Set",
"org.onosproject.ovsdb.rfc.tableservice.ColumnDescription"
] |
import java.util.Set; import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
|
import java.util.*; import org.onosproject.ovsdb.rfc.tableservice.*;
|
[
"java.util",
"org.onosproject.ovsdb"
] |
java.util; org.onosproject.ovsdb;
| 1,681,482
|
public FileDesc getResolvedLinkFileDesc()
{
return this.resolvedLinkFileDesc;
}
|
FileDesc function() { return this.resolvedLinkFileDesc; }
|
/**
* Holds the cached value of a resolved link.
* If null the link has not been resolved yet.
*/
|
Holds the cached value of a resolved link. If null the link has not been resolved yet
|
getResolvedLinkFileDesc
|
{
"repo_name": "skoulouzis/vlet-1.5.0",
"path": "source/core/nl.uva.vlet.vfs.lfc/src/nl/uva/vlet/vfs/lfc/FileDescWrapper.java",
"license": "apache-2.0",
"size": 9844
}
|
[
"nl.uva.vlet.glite.lfc.internal.FileDesc"
] |
import nl.uva.vlet.glite.lfc.internal.FileDesc;
|
import nl.uva.vlet.glite.lfc.internal.*;
|
[
"nl.uva.vlet"
] |
nl.uva.vlet;
| 2,749,223
|
protected boolean isHorizontalTabSwitcherFlagEnabled() {
return ChromeFeatureList.isEnabled(ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID);
}
|
boolean function() { return ChromeFeatureList.isEnabled(ChromeFeatureList.HORIZONTAL_TAB_SWITCHER_ANDROID); }
|
/**
* Whether or not the HorizontalTabSwitcherAndroid flag (which enables the new horizontal tab
* switcher in both portrait and landscape mode) is enabled.
*/
|
Whether or not the HorizontalTabSwitcherAndroid flag (which enables the new horizontal tab switcher in both portrait and landscape mode) is enabled
|
isHorizontalTabSwitcherFlagEnabled
|
{
"repo_name": "endlessm/chromium-browser",
"path": "chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayoutBase.java",
"license": "bsd-3-clause",
"size": 65466
}
|
[
"org.chromium.chrome.browser.flags.ChromeFeatureList"
] |
import org.chromium.chrome.browser.flags.ChromeFeatureList;
|
import org.chromium.chrome.browser.flags.*;
|
[
"org.chromium.chrome"
] |
org.chromium.chrome;
| 105,603
|
String listStatus(String path) throws IOException {
StringBuilder sb = new StringBuilder();
List<Map<String, Object>> fileStatusList = getFileStatusList(path);
sb.append("{\"FileStatuses\":{\"FileStatus\":[\n");
int i = 0;
for (Map<String, Object> fileStatusMap : fileStatusList) {
if (i++ != 0) {
sb.append(',');
}
sb.append(JsonUtil.toJsonString(fileStatusMap));
}
sb.append("\n]}}\n");
return sb.toString();
}
|
String listStatus(String path) throws IOException { StringBuilder sb = new StringBuilder(); List<Map<String, Object>> fileStatusList = getFileStatusList(path); sb.append("{\"FileStatuses\":{\"FileStatus\":[\n"); int i = 0; for (Map<String, Object> fileStatusMap : fileStatusList) { if (i++ != 0) { sb.append(','); } sb.append(JsonUtil.toJsonString(fileStatusMap)); } sb.append(STR); return sb.toString(); }
|
/**
* Return the JSON formatted list of the files in the specified directory.
* @param path a path specifies a directory to list
* @return JSON formatted file list in the directory
* @throws IOException if failed to serialize fileStatus to JSON.
*/
|
Return the JSON formatted list of the files in the specified directory
|
listStatus
|
{
"repo_name": "apurtell/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/FSImageLoader.java",
"license": "apache-2.0",
"size": 23607
}
|
[
"java.io.IOException",
"java.util.List",
"java.util.Map",
"org.apache.hadoop.hdfs.web.JsonUtil"
] |
import java.io.IOException; import java.util.List; import java.util.Map; import org.apache.hadoop.hdfs.web.JsonUtil;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.web.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 2,447,324
|
default ElsqlEndpointConsumerBuilder timeUnit(TimeUnit timeUnit) {
doSetProperty("timeUnit", timeUnit);
return this;
}
|
default ElsqlEndpointConsumerBuilder timeUnit(TimeUnit timeUnit) { doSetProperty(STR, timeUnit); return this; }
|
/**
* Time unit for initialDelay and delay options.
*
* The option is a: <code>java.util.concurrent.TimeUnit</code> type.
*
* Default: MILLISECONDS
* Group: scheduler
*/
|
Time unit for initialDelay and delay options. The option is a: <code>java.util.concurrent.TimeUnit</code> type. Default: MILLISECONDS Group: scheduler
|
timeUnit
|
{
"repo_name": "DariusX/camel",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElsqlEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 95666
}
|
[
"java.util.concurrent.TimeUnit"
] |
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.*;
|
[
"java.util"
] |
java.util;
| 1,290,744
|
public synchronized int read() throws IOException
{
if(!syncFill())
return -1;
int b = iobuffer[head++] & 255;
if(head == iobuffer.length)
head = 0;
length--;
notify();
return b;
}
|
synchronized int function() throws IOException { if(!syncFill()) return -1; int b = iobuffer[head++] & 255; if(head == iobuffer.length) head = 0; length--; notify(); return b; }
|
/**
* Reads a byte from the stream.
* @throws InterruptedIOException if the timeout expired and no data was received,
* bytesTransferred will be zero
*
* @throws IOException if an i/o error occurs
*/
|
Reads a byte from the stream
|
read
|
{
"repo_name": "freenet/Thingamablog-Freenet",
"path": "src/net/sf/thingamablog/TimeoutInputStream.java",
"license": "gpl-2.0",
"size": 11114
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,513,813
|
protected void finishFileInfo() throws IOException {
if (lastKeyBuffer != null) {
// Make a copy. The copy is stuffed into HMapWritable. Needs a clean
// byte buffer. Won't take a tuple.
fileInfo.append(FileInfo.LASTKEY, Arrays.copyOfRange(lastKeyBuffer,
lastKeyOffset, lastKeyOffset + lastKeyLength), false);
}
// Average key length.
int avgKeyLen =
entryCount == 0 ? 0 : (int) (totalKeyLength / entryCount);
fileInfo.append(FileInfo.AVG_KEY_LEN, Bytes.toBytes(avgKeyLen), false);
// Average value length.
int avgValueLen =
entryCount == 0 ? 0 : (int) (totalValueLength / entryCount);
fileInfo.append(FileInfo.AVG_VALUE_LEN, Bytes.toBytes(avgValueLen), false);
}
|
void function() throws IOException { if (lastKeyBuffer != null) { fileInfo.append(FileInfo.LASTKEY, Arrays.copyOfRange(lastKeyBuffer, lastKeyOffset, lastKeyOffset + lastKeyLength), false); } int avgKeyLen = entryCount == 0 ? 0 : (int) (totalKeyLength / entryCount); fileInfo.append(FileInfo.AVG_KEY_LEN, Bytes.toBytes(avgKeyLen), false); int avgValueLen = entryCount == 0 ? 0 : (int) (totalValueLength / entryCount); fileInfo.append(FileInfo.AVG_VALUE_LEN, Bytes.toBytes(avgValueLen), false); }
|
/**
* Add last bits of metadata to file info before it is written out.
*/
|
Add last bits of metadata to file info before it is written out
|
finishFileInfo
|
{
"repo_name": "bcopeland/hbase-thrift",
"path": "src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java",
"license": "apache-2.0",
"size": 9773
}
|
[
"java.io.IOException",
"java.util.Arrays",
"org.apache.hadoop.hbase.io.hfile.HFile",
"org.apache.hadoop.hbase.util.Bytes"
] |
import java.io.IOException; import java.util.Arrays; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.util.Bytes;
|
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.io.hfile.*; import org.apache.hadoop.hbase.util.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop"
] |
java.io; java.util; org.apache.hadoop;
| 452,412
|
private void resetSplitParent(HbckInfo hi) throws IOException {
RowMutations mutations = new RowMutations(hi.metaEntry.getRegionName());
Delete d = new Delete(hi.metaEntry.getRegionName());
d.deleteColumn(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER);
d.deleteColumn(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER);
mutations.add(d);
HRegionInfo hri = new HRegionInfo(hi.metaEntry);
hri.setOffline(false);
hri.setSplit(false);
Put p = MetaEditor.makePutFromRegionInfo(hri);
mutations.add(p);
meta.mutateRow(mutations);
meta.flushCommits();
LOG.info("Reset split parent " + hi.metaEntry.getRegionNameAsString() + " in META" );
}
|
void function(HbckInfo hi) throws IOException { RowMutations mutations = new RowMutations(hi.metaEntry.getRegionName()); Delete d = new Delete(hi.metaEntry.getRegionName()); d.deleteColumn(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER); d.deleteColumn(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER); mutations.add(d); HRegionInfo hri = new HRegionInfo(hi.metaEntry); hri.setOffline(false); hri.setSplit(false); Put p = MetaEditor.makePutFromRegionInfo(hri); mutations.add(p); meta.mutateRow(mutations); meta.flushCommits(); LOG.info(STR + hi.metaEntry.getRegionNameAsString() + STR ); }
|
/**
* Reset the split parent region info in meta table
*/
|
Reset the split parent region info in meta table
|
resetSplitParent
|
{
"repo_name": "cloud-software-foundation/c5",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java",
"license": "apache-2.0",
"size": 140505
}
|
[
"java.io.IOException",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop.hbase.catalog.MetaEditor",
"org.apache.hadoop.hbase.client.Delete",
"org.apache.hadoop.hbase.client.Put",
"org.apache.hadoop.hbase.client.RowMutations"
] |
import java.io.IOException; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.catalog.MetaEditor; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.RowMutations;
|
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.catalog.*; import org.apache.hadoop.hbase.client.*;
|
[
"java.io",
"org.apache.hadoop"
] |
java.io; org.apache.hadoop;
| 2,781,235
|
@Nullable
Instant currentSynchronizedProcessingTime();
|
Instant currentSynchronizedProcessingTime();
|
/**
* Returns the current timestamp in the {@link TimeDomain#SYNCHRONIZED_PROCESSING_TIME} time
* domain or {@code null} if unknown.
*/
|
Returns the current timestamp in the <code>TimeDomain#SYNCHRONIZED_PROCESSING_TIME</code> time domain or null if unknown
|
currentSynchronizedProcessingTime
|
{
"repo_name": "josauder/AOP_incubator_beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/TimerInternals.java",
"license": "apache-2.0",
"size": 10346
}
|
[
"org.joda.time.Instant"
] |
import org.joda.time.Instant;
|
import org.joda.time.*;
|
[
"org.joda.time"
] |
org.joda.time;
| 803,709
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.