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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public TimeExtent timePrimitiveToTimeExtent(AbstractTimeGeometricPrimitive timePrimitive) { TimePosition timePos; TimeExtent timeExtent = new TimeExtent(); boolean beginUnknown = false; boolean endUnknown = false; if (timePrimitive instanceof TimeInstant) { timePos = ((TimeInstant) timePrimitive).getTimePosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setBaseAtNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) timeExtent.nullify(); else timeExtent.setBaseTime(timePos.getDecimalValue()); } else if (timePrimitive instanceof TimePeriod) { TimePeriod timePeriod = ((TimePeriod) timePrimitive); // begin timePos = timePeriod.getBeginPosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setBeginNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) beginUnknown = true; else timeExtent.setStartTime(timePos.getDecimalValue()); // end timePos = timePeriod.getEndPosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setEndNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) endUnknown = true; else timeExtent.setStopTime(timePos.getDecimalValue()); // handle case of period specified with unknown begin or end time if (timePeriod.isSetDuration()) { double duration = timePeriod.getDuration(); if (beginUnknown) timeExtent.setLagTimeDelta(duration); if (endUnknown) timeExtent.setLeadTimeDelta(duration); } else if (beginUnknown && endUnknown) timeExtent.nullify(); // get time step from timeInterval if (timePeriod.isSetTimeInterval()) { TimeIntervalLength interval = timePeriod.getTimeInterval(); timeExtent.setTimeStep(interval.getValue()); // for now we assume it's in seconds } } return timeExtent; }
TimeExtent function(AbstractTimeGeometricPrimitive timePrimitive) { TimePosition timePos; TimeExtent timeExtent = new TimeExtent(); boolean beginUnknown = false; boolean endUnknown = false; if (timePrimitive instanceof TimeInstant) { timePos = ((TimeInstant) timePrimitive).getTimePosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setBaseAtNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) timeExtent.nullify(); else timeExtent.setBaseTime(timePos.getDecimalValue()); } else if (timePrimitive instanceof TimePeriod) { TimePeriod timePeriod = ((TimePeriod) timePrimitive); timePos = timePeriod.getBeginPosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setBeginNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) beginUnknown = true; else timeExtent.setStartTime(timePos.getDecimalValue()); timePos = timePeriod.getEndPosition(); if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.NOW) timeExtent.setEndNow(true); else if (timePos.getIndeterminatePosition() == TimeIndeterminateValue.UNKNOWN) endUnknown = true; else timeExtent.setStopTime(timePos.getDecimalValue()); if (timePeriod.isSetDuration()) { double duration = timePeriod.getDuration(); if (beginUnknown) timeExtent.setLagTimeDelta(duration); if (endUnknown) timeExtent.setLeadTimeDelta(duration); } else if (beginUnknown && endUnknown) timeExtent.nullify(); if (timePeriod.isSetTimeInterval()) { TimeIntervalLength interval = timePeriod.getTimeInterval(); timeExtent.setTimeStep(interval.getValue()); } } return timeExtent; }
/** * Utility method to convert a {@link AbstractTimeGeometricPrimitive} to a {@link TimeExtent} object * @param timePrimitive GML time primitive * @return new TimeExtent instance */
Utility method to convert a <code>AbstractTimeGeometricPrimitive</code> to a <code>TimeExtent</code> object
timePrimitiveToTimeExtent
{ "repo_name": "sensiasoft/lib-swe-common", "path": "swe-common-om/src/main/java/org/vast/ogc/gml/GMLUtils.java", "license": "mpl-2.0", "size": 20800 }
[ "net.opengis.gml.v32.AbstractTimeGeometricPrimitive", "net.opengis.gml.v32.TimeIndeterminateValue", "net.opengis.gml.v32.TimeInstant", "net.opengis.gml.v32.TimeIntervalLength", "net.opengis.gml.v32.TimePeriod", "net.opengis.gml.v32.TimePosition", "org.vast.util.TimeExtent" ]
import net.opengis.gml.v32.AbstractTimeGeometricPrimitive; import net.opengis.gml.v32.TimeIndeterminateValue; import net.opengis.gml.v32.TimeInstant; import net.opengis.gml.v32.TimeIntervalLength; import net.opengis.gml.v32.TimePeriod; import net.opengis.gml.v32.TimePosition; import org.vast.util.TimeExtent;
import net.opengis.gml.v32.*; import org.vast.util.*;
[ "net.opengis.gml", "org.vast.util" ]
net.opengis.gml; org.vast.util;
651,754
public void triggerJobWithVolatileTrigger(SchedulingContext ctxt, String jobName, String groupName, JobDataMap data) throws SchedulerException { validateState(); if(groupName == null) { groupName = Scheduler.DEFAULT_GROUP; } Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(), Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName, new Date(), null, 0, 0); trig.setVolatility(true); trig.computeFirstFireTime(null); if(data != null) { trig.setJobDataMap(data); } boolean collision = true; while (collision) { try { resources.getJobStore().storeTrigger(ctxt, trig, false); collision = false; } catch (ObjectAlreadyExistsException oaee) { trig.setName(newTriggerId()); } } notifySchedulerThread(trig.getNextFireTime().getTime()); notifySchedulerListenersSchduled(trig); }
void function(SchedulingContext ctxt, String jobName, String groupName, JobDataMap data) throws SchedulerException { validateState(); if(groupName == null) { groupName = Scheduler.DEFAULT_GROUP; } Trigger trig = new org.quartz.SimpleTrigger(newTriggerId(), Scheduler.DEFAULT_MANUAL_TRIGGERS, jobName, groupName, new Date(), null, 0, 0); trig.setVolatility(true); trig.computeFirstFireTime(null); if(data != null) { trig.setJobDataMap(data); } boolean collision = true; while (collision) { try { resources.getJobStore().storeTrigger(ctxt, trig, false); collision = false; } catch (ObjectAlreadyExistsException oaee) { trig.setName(newTriggerId()); } } notifySchedulerThread(trig.getNextFireTime().getTime()); notifySchedulerListenersSchduled(trig); }
/** * <p> * Trigger the identified <code>{@link org.quartz.Job}</code> (execute it * now) - with a volatile trigger. * </p> */
Trigger the identified <code><code>org.quartz.Job</code></code> (execute it now) - with a volatile trigger.
triggerJobWithVolatileTrigger
{ "repo_name": "optivo-org/quartz-1.8.3-optivo", "path": "quartz/src/main/java/org/quartz/core/QuartzScheduler.java", "license": "apache-2.0", "size": 78832 }
[ "java.util.Date", "org.quartz.JobDataMap", "org.quartz.ObjectAlreadyExistsException", "org.quartz.Scheduler", "org.quartz.SchedulerException", "org.quartz.Trigger" ]
import java.util.Date; import org.quartz.JobDataMap; import org.quartz.ObjectAlreadyExistsException; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.Trigger;
import java.util.*; import org.quartz.*;
[ "java.util", "org.quartz" ]
java.util; org.quartz;
248,324
void writeMutations(List<Mutation> mutations) { hardAssert(isOpen(), "Writing mutations requires an opened stream"); hardAssert(handshakeComplete, "Handshake must be complete before writing mutations"); WriteRequest.Builder request = WriteRequest.newBuilder(); for (Mutation mutation : mutations) { request.addWrites(serializer.encodeMutation(mutation)); } request.setStreamToken(lastStreamToken); writeRequest(request.build()); }
void writeMutations(List<Mutation> mutations) { hardAssert(isOpen(), STR); hardAssert(handshakeComplete, STR); WriteRequest.Builder request = WriteRequest.newBuilder(); for (Mutation mutation : mutations) { request.addWrites(serializer.encodeMutation(mutation)); } request.setStreamToken(lastStreamToken); writeRequest(request.build()); }
/** * Sends a list of mutations to the Firestore backend to apply * * @param mutations The mutations */
Sends a list of mutations to the Firestore backend to apply
writeMutations
{ "repo_name": "firebase/firebase-android-sdk", "path": "firebase-firestore/src/main/java/com/google/firebase/firestore/remote/WriteStream.java", "license": "apache-2.0", "size": 7177 }
[ "com.google.firebase.firestore.model.mutation.Mutation", "com.google.firebase.firestore.util.Assert", "com.google.firestore.v1.WriteRequest", "java.util.List" ]
import com.google.firebase.firestore.model.mutation.Mutation; import com.google.firebase.firestore.util.Assert; import com.google.firestore.v1.WriteRequest; import java.util.List;
import com.google.firebase.firestore.model.mutation.*; import com.google.firebase.firestore.util.*; import com.google.firestore.v1.*; import java.util.*;
[ "com.google.firebase", "com.google.firestore", "java.util" ]
com.google.firebase; com.google.firestore; java.util;
1,774,330
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { { for (int l = 0; l < 4; ++l) { int i1 = par2 + par5Random.nextInt(3) - 1; int j1 = par3 + par5Random.nextInt(3) - 1; int k1 = par4 + par5Random.nextInt(3) - 1; //Spread through the air only. if (par1World.getBlockId(i1, j1, k1) == 0) { //System.out.println("Cliffie's Taints: Taint taking over on x: "+i1+" y: "+j1+" z: "+k1); par1World.setBlock(i1, j1, k1, this.blockID); if(par5Random.nextInt(5)==0) par1World.setBlock(par2, par3, par4, 0); } } } } }
void function(World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { { for (int l = 0; l < 4; ++l) { int i1 = par2 + par5Random.nextInt(3) - 1; int j1 = par3 + par5Random.nextInt(3) - 1; int k1 = par4 + par5Random.nextInt(3) - 1; if (par1World.getBlockId(i1, j1, k1) == 0) { par1World.setBlock(i1, j1, k1, this.blockID); if(par5Random.nextInt(5)==0) par1World.setBlock(par2, par3, par4, 0); } } } } }
/** * Block update. */
Block update
updateTick
{ "repo_name": "CliffracerX/CliffiesGoos", "path": "cliffracerx/mods/cliffiestaints/src/Tier2Taint.java", "license": "gpl-2.0", "size": 4480 }
[ "java.util.Random", "net.minecraft.world.World" ]
import java.util.Random; import net.minecraft.world.World;
import java.util.*; import net.minecraft.world.*;
[ "java.util", "net.minecraft.world" ]
java.util; net.minecraft.world;
1,147,892
@NotNull public List<DomainEvent<?>> getUncommittedChanges();
List<DomainEvent<?>> function();
/** * Returns a list of uncommitted changes. * * @return List of events that were not persisted yet. */
Returns a list of uncommitted changes
getUncommittedChanges
{ "repo_name": "fuinorg/ddd-4-java", "path": "src/main/java/org/fuin/ddd4j/ddd/AggregateRoot.java", "license": "lgpl-3.0", "size": 3151 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
845,410
@Test public void testSmoke() throws IOException, InterruptedException { registerGlobalDirectory(GLOBAL_DIRECTORY_NAME, GLOBAL_DIRECTORY_PATH.toString(), true); verifyProperlyRegistered(GLOBAL_DIRECTORY_NAME, GLOBAL_DIRECTORY_PATH.toString()); }
void function() throws IOException, InterruptedException { registerGlobalDirectory(GLOBAL_DIRECTORY_NAME, GLOBAL_DIRECTORY_PATH.toString(), true); verifyProperlyRegistered(GLOBAL_DIRECTORY_NAME, GLOBAL_DIRECTORY_PATH.toString()); }
/** * Test checking if global directory exist */
Test checking if global directory exist
testSmoke
{ "repo_name": "jstourac/wildfly", "path": "testsuite/integration/manualmode/src/test/java/org/jboss/as/test/manualmode/ee/globaldirectory/GlobalDirectoryTestCase.java", "license": "lgpl-2.1", "size": 16528 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,726,954
static TernaryValue isStrWhiteSpaceChar(int c) { switch (c) { case '\u000B': // <VT> return TernaryValue.UNKNOWN; // IE says "no", EcmaScript says "yes" case ' ': // <SP> case '\n': // <LF> case '\r': // <CR> case '\t': // <TAB> case '\u00A0': // <NBSP> case '\u000C': // <FF> case '\u2028': // <LS> case '\u2029': // <PS> case '\uFEFF': // <BOM> return TernaryValue.TRUE; default: return (Character.getType(c) == Character.SPACE_SEPARATOR) ? TernaryValue.TRUE : TernaryValue.FALSE; } } /** * Gets the function's name. This method recognizes five forms: * <ul> * <li>{@code function name() ...}</li> * <li>{@code var name = function() ...}</li> * <li>{@code qualified.name = function() ...}</li> * <li>{@code var name2 = function name1() ...}</li> * <li>{@code qualified.name2 = function name1() ...}</li> * </ul> * In two last cases with named function expressions, the second name is * returned (the variable of qualified name). * * @param n a node whose type is {@link Token#FUNCTION}
static TernaryValue isStrWhiteSpaceChar(int c) { switch (c) { case '\u000B': return TernaryValue.UNKNOWN; case ' ': case '\n': case '\r': case '\t': case '\u00A0': case '\u000C': case '\u2028': case '\u2029': case '\uFEFF': return TernaryValue.TRUE; default: return (Character.getType(c) == Character.SPACE_SEPARATOR) ? TernaryValue.TRUE : TernaryValue.FALSE; } } /** * Gets the function's name. This method recognizes five forms: * <ul> * <li>{@code function name() ...}</li> * <li>{@code var name = function() ...}</li> * <li>{@code qualified.name = function() ...}</li> * <li>{@code var name2 = function name1() ...}</li> * <li>{@code qualified.name2 = function name1() ...}</li> * </ul> * In two last cases with named function expressions, the second name is * returned (the variable of qualified name). * * @param n a node whose type is {@link Token#FUNCTION}
/** * Copied from Rhino's ScriptRuntime */
Copied from Rhino's ScriptRuntime
isStrWhiteSpaceChar
{ "repo_name": "JonathanWalsh/Granule-Closure-Compiler", "path": "src/com/google/javascript/jscomp/NodeUtil.java", "license": "apache-2.0", "size": 88449 }
[ "com.google.javascript.rhino.Token", "com.google.javascript.rhino.jstype.TernaryValue" ]
import com.google.javascript.rhino.Token; import com.google.javascript.rhino.jstype.TernaryValue;
import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
1,137,568
public static String generateGUID() { return new BigInteger(165, rnd).toString(36).toUpperCase(); }
static String function() { return new BigInteger(165, rnd).toString(36).toUpperCase(); }
/** * Generate guid. * * @return the string */
Generate guid
generateGUID
{ "repo_name": "confluxtoo/finflux_automation_test", "path": "browsermob-proxy/src/main/java/org/browsermob/proxy/util/GUID.java", "license": "mpl-2.0", "size": 1645 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
1,941,109
public IBlockState getStateFromMeta(int meta) { return this.getDefaultState().withProperty(WET, Boolean.valueOf((meta & 1) == 1)); }
IBlockState function(int meta) { return this.getDefaultState().withProperty(WET, Boolean.valueOf((meta & 1) == 1)); }
/** * Convert the given metadata into a BlockState for this Block */
Convert the given metadata into a BlockState for this Block
getStateFromMeta
{ "repo_name": "aebert1/BigTransport", "path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockSponge.java", "license": "gpl-3.0", "size": 6701 }
[ "net.minecraft.block.state.IBlockState" ]
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.state.*;
[ "net.minecraft.block" ]
net.minecraft.block;
697,282
@SuppressWarnings("Duplicates") protected ESat check(double sumLB, double sumUB) { switch (o) { case LE: if (sumLB <= b) { return ESat.TRUE; } if (sumLB > b) { return ESat.FALSE; } return ESat.UNDEFINED; case GE: if (sumUB >= b) { return ESat.TRUE; } if (sumUB < b) { return ESat.FALSE; } return ESat.UNDEFINED; default: if (sumLB <= b && b <= sumUB) { return ESat.TRUE; } if (sumUB < b || sumLB > b) { return ESat.FALSE; } return ESat.UNDEFINED; } }
@SuppressWarnings(STR) ESat function(double sumLB, double sumUB) { switch (o) { case LE: if (sumLB <= b) { return ESat.TRUE; } if (sumLB > b) { return ESat.FALSE; } return ESat.UNDEFINED; case GE: if (sumUB >= b) { return ESat.TRUE; } if (sumUB < b) { return ESat.FALSE; } return ESat.UNDEFINED; default: if (sumLB <= b && b <= sumUB) { return ESat.TRUE; } if (sumUB < b sumLB > b) { return ESat.FALSE; } return ESat.UNDEFINED; } }
/** * Whether the current state of the scalar product is entailed * * @param sumLB sum of lower bounds * @param sumUB sum of upper bounds * @return the entailment check */
Whether the current state of the scalar product is entailed
check
{ "repo_name": "chocoteam/choco3", "path": "src/main/java/org/chocosolver/solver/constraints/real/PropScalarMixed.java", "license": "bsd-3-clause", "size": 18889 }
[ "org.chocosolver.util.ESat" ]
import org.chocosolver.util.ESat;
import org.chocosolver.util.*;
[ "org.chocosolver.util" ]
org.chocosolver.util;
1,161,508
@Test public void testAddVersion() { NoVendorOption vendorOption = new NoVendorOption(); vendorOption.addVersion(null); // Does nothing }
void function() { NoVendorOption vendorOption = new NoVendorOption(); vendorOption.addVersion(null); }
/** * Test method for {@link * com.sldeditor.common.vendoroption.NoVendorOption#addVersion(com.sldeditor.common.vendoroption.VersionData)}. */
Test method for <code>com.sldeditor.common.vendoroption.NoVendorOption#addVersion(com.sldeditor.common.vendoroption.VersionData)</code>
testAddVersion
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/common/vendoroption/NoVendorOptionTest.java", "license": "gpl-3.0", "size": 2684 }
[ "com.sldeditor.common.vendoroption.NoVendorOption" ]
import com.sldeditor.common.vendoroption.NoVendorOption;
import com.sldeditor.common.vendoroption.*;
[ "com.sldeditor.common" ]
com.sldeditor.common;
559,070
public OkHttpClient setProxy(Proxy proxy) { this.proxy = proxy; return this; }
OkHttpClient function(Proxy proxy) { this.proxy = proxy; return this; }
/** * Sets the HTTP proxy that will be used by connections created by this * client. This takes precedence over {@link #setProxySelector}, which is * only honored when this proxy is null (which it is by default). To disable * proxy use completely, call {@code setProxy(Proxy.NO_PROXY)}. */
Sets the HTTP proxy that will be used by connections created by this client. This takes precedence over <code>#setProxySelector</code>, which is only honored when this proxy is null (which it is by default). To disable proxy use completely, call setProxy(Proxy.NO_PROXY)
setProxy
{ "repo_name": "cdut007/PMS_TASK", "path": "third_party/okhttp-master/okhttp/src/main/java/com/squareup/okhttp/OkHttpClient.java", "license": "mit", "size": 23940 }
[ "java.net.Proxy" ]
import java.net.Proxy;
import java.net.*;
[ "java.net" ]
java.net;
1,957,830
public void setEnabled() { // store status this.enabled = true; // update min/max indices minAlongIndex = FastMath.min(minAlongIndex, alongIndex); maxAlongIndex = FastMath.max(maxAlongIndex, alongIndex); minAcrossIndex = FastMath.min(minAcrossIndex, acrossIndex); maxAcrossIndex = FastMath.max(maxAcrossIndex, acrossIndex); }
void function() { this.enabled = true; minAlongIndex = FastMath.min(minAlongIndex, alongIndex); maxAlongIndex = FastMath.max(maxAlongIndex, alongIndex); minAcrossIndex = FastMath.min(minAcrossIndex, acrossIndex); maxAcrossIndex = FastMath.max(maxAcrossIndex, acrossIndex); }
/** Set the enabled property. */
Set the enabled property
setEnabled
{ "repo_name": "ProjectPersephone/Orekit", "path": "src/main/java/org/orekit/models/earth/tessellation/Mesh.java", "license": "apache-2.0", "size": 23862 }
[ "org.apache.commons.math3.util.FastMath" ]
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.*;
[ "org.apache.commons" ]
org.apache.commons;
2,611,074
public void setSelectorColor(int selectorColor) { this.mSelectorColor = selectorColor; this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP); this.invalidate(); }
void function(int selectorColor) { this.mSelectorColor = selectorColor; this.mSelectorFilter = new PorterDuffColorFilter(Color.argb(mSelectorAlpha, Color.red(mSelectorColor), Color.green(mSelectorColor), Color.blue(mSelectorColor)), PorterDuff.Mode.SRC_ATOP); this.invalidate(); }
/** * Sets the color of the selector to be draw over the * CircularImageView. Be sure to provide some opacity. * * @param selectorColor The color (including alpha) to set for the selector overlay. */
Sets the color of the selector to be draw over the CircularImageView. Be sure to provide some opacity
setSelectorColor
{ "repo_name": "TaRGroup/CoolApk-Console", "path": "app/src/main/java/com/targroup/coolapkconsole/view/BezelImageView.java", "license": "gpl-3.0", "size": 11757 }
[ "android.graphics.Color", "android.graphics.PorterDuff", "android.graphics.PorterDuffColorFilter" ]
import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,336,801
public org.wso2.carbon.apimgt.gateway.dto.APIData getApiForTenant(String apiProviderName, String apiName, String version, String tenantDomain) throws AxisFault { RESTAPIAdminServiceProxy restClient = getRestapiAdminClient(tenantDomain); String qualifiedName = GatewayUtils.getQualifiedApiName(apiProviderName, apiName, version); APIData apiData = restClient.getApi(qualifiedName); return convert(apiData); }
org.wso2.carbon.apimgt.gateway.dto.APIData function(String apiProviderName, String apiName, String version, String tenantDomain) throws AxisFault { RESTAPIAdminServiceProxy restClient = getRestapiAdminClient(tenantDomain); String qualifiedName = GatewayUtils.getQualifiedApiName(apiProviderName, apiName, version); APIData apiData = restClient.getApi(qualifiedName); return convert(apiData); }
/** * Get API from the gateway * * @param tenantDomain * @return * @throws AxisFault */
Get API from the gateway
getApiForTenant
{ "repo_name": "harsha89/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.gateway/src/main/java/org/wso2/carbon/apimgt/gateway/service/APIGatewayAdmin.java", "license": "apache-2.0", "size": 41004 }
[ "org.apache.axis2.AxisFault", "org.wso2.carbon.apimgt.gateway.utils.GatewayUtils", "org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy", "org.wso2.carbon.rest.api.APIData" ]
import org.apache.axis2.AxisFault; import org.wso2.carbon.apimgt.gateway.utils.GatewayUtils; import org.wso2.carbon.apimgt.gateway.utils.RESTAPIAdminServiceProxy; import org.wso2.carbon.rest.api.APIData;
import org.apache.axis2.*; import org.wso2.carbon.apimgt.gateway.utils.*; import org.wso2.carbon.rest.api.*;
[ "org.apache.axis2", "org.wso2.carbon" ]
org.apache.axis2; org.wso2.carbon;
2,783,407
private void initProcessedInfoLists() { proccessedIdsInfo = new LinkedList<>(); proccessedOvfGenerationsInfo = new LinkedList<>(); proccessedOvfConfigurationsInfo = new LinkedList<>(); }
void function() { proccessedIdsInfo = new LinkedList<>(); proccessedOvfGenerationsInfo = new LinkedList<>(); proccessedOvfConfigurationsInfo = new LinkedList<>(); }
/** * Init the lists contain the processed info. */
Init the lists contain the processed info
initProcessedInfoLists
{ "repo_name": "jtux270/translate", "path": "ovirt/3.6_source/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStoragePoolCommand.java", "license": "gpl-3.0", "size": 16168 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
1,462,127
public void publish(Message message, String topicName) throws EventBrokerException;
void function(Message message, String topicName) throws EventBrokerException;
/** * Publish an event to the given topic asynchronously. i.e it starts a new thread to send the * message. * * @param message - message to publish. this contains the OMElement of the message and any * properties. * @param topicName topic name */
Publish an event to the given topic asynchronously. i.e it starts a new thread to send the message
publish
{ "repo_name": "johannnallathamby/carbon-commons", "path": "components/event/org.wso2.carbon.event.core/src/main/java/org/wso2/carbon/event/core/EventBroker.java", "license": "apache-2.0", "size": 5629 }
[ "org.wso2.carbon.event.core.exception.EventBrokerException" ]
import org.wso2.carbon.event.core.exception.EventBrokerException;
import org.wso2.carbon.event.core.exception.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
667,779
protected static final List<CView> processQueryResults(final ResultSet resultSet, final INaviProject project, final Map<Integer, Set<CTag>> tags, final ITagManager nodeTagManager, final SQLProvider provider, final List<CView> views, final ViewType viewType, final GraphType graphType) throws SQLException { final Map<Integer, Set<CTag>> nodeTagMap = getNodeTags(provider.getConnection(), project, nodeTagManager); try { while (resultSet.next()) { final int viewId = resultSet.getInt("view_id"); final String name = PostgreSQLHelpers.readString(resultSet, "name"); final String description = PostgreSQLHelpers.readString(resultSet, "description"); final Timestamp creationDate = resultSet.getTimestamp("creation_date"); final Timestamp modificationDate = resultSet.getTimestamp("modification_date"); final boolean starState = resultSet.getBoolean("stared"); final int nodeCount = resultSet.getInt("bbcount"); final int edgeCount = resultSet.getInt("edgecount"); final Set<CTag> viewTags = tags.containsKey(viewId) ? tags.get(viewId) : new HashSet<CTag>(); final Set<CTag> nodeTags = nodeTagMap.containsKey(viewId) ? nodeTagMap.get(viewId) : new HashSet<CTag>(); final CProjectViewGenerator generator = new CProjectViewGenerator(provider, project); views.add(generator.generate(viewId, name, description, viewType, graphType, creationDate, modificationDate, nodeCount, edgeCount, viewTags, nodeTags, starState)); } return views; } finally { resultSet.close(); } }
static final List<CView> function(final ResultSet resultSet, final INaviProject project, final Map<Integer, Set<CTag>> tags, final ITagManager nodeTagManager, final SQLProvider provider, final List<CView> views, final ViewType viewType, final GraphType graphType) throws SQLException { final Map<Integer, Set<CTag>> nodeTagMap = getNodeTags(provider.getConnection(), project, nodeTagManager); try { while (resultSet.next()) { final int viewId = resultSet.getInt(STR); final String name = PostgreSQLHelpers.readString(resultSet, "name"); final String description = PostgreSQLHelpers.readString(resultSet, STR); final Timestamp creationDate = resultSet.getTimestamp(STR); final Timestamp modificationDate = resultSet.getTimestamp(STR); final boolean starState = resultSet.getBoolean(STR); final int nodeCount = resultSet.getInt(STR); final int edgeCount = resultSet.getInt(STR); final Set<CTag> viewTags = tags.containsKey(viewId) ? tags.get(viewId) : new HashSet<CTag>(); final Set<CTag> nodeTags = nodeTagMap.containsKey(viewId) ? nodeTagMap.get(viewId) : new HashSet<CTag>(); final CProjectViewGenerator generator = new CProjectViewGenerator(provider, project); views.add(generator.generate(viewId, name, description, viewType, graphType, creationDate, modificationDate, nodeCount, edgeCount, viewTags, nodeTags, starState)); } return views; } finally { resultSet.close(); } }
/** * Processes the results of a view loading query. * * @param resultSet Contains the results of the SQL query. * @param project The project the views were loaded for. * @param tags Map that contains the tags the views are tagged with. * @param nodeTagManager Provides the node tags. * @param provider The connection to the database. * @param views The loaded views are stored in this list. * @param viewType View type of the loaded views. * @param graphType Graph type of the loaded views. * * @return The loaded views. * * @throws SQLException Thrown if the views could not be loaded. */
Processes the results of a view loading query
processQueryResults
{ "repo_name": "guiquanz/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Database/PostgreSQL/Loaders/PostgreSQLViewsLoader.java", "license": "apache-2.0", "size": 15292 }
[ "com.google.security.zynamics.binnavi.Database", "com.google.security.zynamics.binnavi.Tagging", "com.google.security.zynamics.binnavi.disassembly.INaviProject", "com.google.security.zynamics.binnavi.disassembly.views.CView", "com.google.security.zynamics.zylib.disassembly.GraphType", "com.google.security.zynamics.zylib.disassembly.ViewType", "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Timestamp", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set" ]
import com.google.security.zynamics.binnavi.Database; import com.google.security.zynamics.binnavi.Tagging; import com.google.security.zynamics.binnavi.disassembly.INaviProject; import com.google.security.zynamics.binnavi.disassembly.views.CView; import com.google.security.zynamics.zylib.disassembly.GraphType; import com.google.security.zynamics.zylib.disassembly.ViewType; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set;
import com.google.security.zynamics.binnavi.*; import com.google.security.zynamics.binnavi.disassembly.*; import com.google.security.zynamics.binnavi.disassembly.views.*; import com.google.security.zynamics.zylib.disassembly.*; import java.sql.*; import java.util.*;
[ "com.google.security", "java.sql", "java.util" ]
com.google.security; java.sql; java.util;
2,714,716
@Override public boolean proposalPersonEqualsBudgetPerson(ProposalPersonContract proposalPerson, BudgetPersonnelDetailsContract budgetPersonnelDetails) { boolean equal = false; if (proposalPerson != null && budgetPersonnelDetails != null) { String budgetPersonId = budgetPersonnelDetails.getPersonId(); if ((proposalPerson.getPersonId() != null && proposalPerson.getPersonId().equals(budgetPersonId)) || (proposalPerson.getRolodexId() != null && proposalPerson.getRolodexId().toString().equals(budgetPersonId))) { equal = true; } } return equal; }
boolean function(ProposalPersonContract proposalPerson, BudgetPersonnelDetailsContract budgetPersonnelDetails) { boolean equal = false; if (proposalPerson != null && budgetPersonnelDetails != null) { String budgetPersonId = budgetPersonnelDetails.getPersonId(); if ((proposalPerson.getPersonId() != null && proposalPerson.getPersonId().equals(budgetPersonId)) (proposalPerson.getRolodexId() != null && proposalPerson.getRolodexId().toString().equals(budgetPersonId))) { equal = true; } } return equal; }
/** * This method compares a proposal person with budget person. It checks whether the proposal person is from PERSON or ROLODEX * and matches the respective person ID with the person in {@link BudgetPersonnelDetails}. It returns true only if IDs are not * null and also matches each other. * * @param proposalPerson - key person from proposal * @param budgetPersonnelDetails person from BudgetPersonnelDetails * @return true if persons match, false otherwise */
This method compares a proposal person with budget person. It checks whether the proposal person is from PERSON or ROLODEX and matches the respective person ID with the person in <code>BudgetPersonnelDetails</code>. It returns true only if IDs are not null and also matches each other
proposalPersonEqualsBudgetPerson
{ "repo_name": "sanjupolus/KC6.oLatest", "path": "coeus-impl/src/main/java/org/kuali/coeus/common/budget/impl/personnel/BudgetPersonServiceImpl.java", "license": "agpl-3.0", "size": 20852 }
[ "org.kuali.coeus.common.budget.api.personnel.BudgetPersonnelDetailsContract", "org.kuali.coeus.propdev.api.person.ProposalPersonContract" ]
import org.kuali.coeus.common.budget.api.personnel.BudgetPersonnelDetailsContract; import org.kuali.coeus.propdev.api.person.ProposalPersonContract;
import org.kuali.coeus.common.budget.api.personnel.*; import org.kuali.coeus.propdev.api.person.*;
[ "org.kuali.coeus" ]
org.kuali.coeus;
2,737,364
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String namespaceName, Context context);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String namespaceName, Context context);
/** * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * * @param resourceGroupName The name of the resource group. * @param namespaceName The namespace name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */
Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace
beginDelete
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java", "license": "mit", "size": 24889 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.SyncPoller" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*;
[ "com.azure.core" ]
com.azure.core;
1,117,140
public Request proxy(Proxy proxy) { this.proxy = proxy; return this; }
Request function(Proxy proxy) { this.proxy = proxy; return this; }
/** * Update the proxy for this request. * @param proxy the proxy ot use; <code>null</code> to disable. * @return this Request, for chaining */
Update the proxy for this request
proxy
{ "repo_name": "Relucent/yyl_mvc", "path": "src/main/java/yyl/mvc/common/http/Connection.java", "license": "apache-2.0", "size": 56134 }
[ "java.net.Proxy" ]
import java.net.Proxy;
import java.net.*;
[ "java.net" ]
java.net;
1,059,062
public HttpContext createHttpContext(final HttpUriRequest httpRequest) throws IOException { return new BasicHttpContext(); }
HttpContext function(final HttpUriRequest httpRequest) throws IOException { return new BasicHttpContext(); }
/** * Creates a {@link HttpContext} for given HTTP request. */
Creates a <code>HttpContext</code> for given HTTP request
createHttpContext
{ "repo_name": "scmod/nexus-public", "path": "components/nexus-core/src/main/java/org/sonatype/nexus/apachehttpclient/page/Page.java", "license": "epl-1.0", "size": 8893 }
[ "java.io.IOException", "org.apache.http.client.methods.HttpUriRequest", "org.apache.http.protocol.BasicHttpContext", "org.apache.http.protocol.HttpContext" ]
import java.io.IOException; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext;
import java.io.*; import org.apache.http.client.methods.*; import org.apache.http.protocol.*;
[ "java.io", "org.apache.http" ]
java.io; org.apache.http;
2,301,309
@ServiceThreadOnly void deviceSelect(int id, IHdmiControlCallback callback) { assertRunOnServiceThread(); HdmiDeviceInfo targetDevice = mDeviceInfos.get(id); if (targetDevice == null) { invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE); return; } int targetAddress = targetDevice.getLogicalAddress(); ActiveSource active = getActiveSource(); if (targetDevice.getDevicePowerStatus() == HdmiControlManager.POWER_STATUS_ON && active.isValid() && targetAddress == active.logicalAddress) { invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); return; } if (targetAddress == Constants.ADDR_INTERNAL) { handleSelectInternalSource(); // Switching to internal source is always successful even when CEC control is disabled. setActiveSource(targetAddress, mService.getPhysicalAddress()); setActivePath(mService.getPhysicalAddress()); invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); return; } if (!mService.isControlEnabled()) { setActiveSource(targetDevice); invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE); return; } removeAction(DeviceSelectAction.class); addAndStartAction(new DeviceSelectAction(this, targetDevice, callback)); }
void deviceSelect(int id, IHdmiControlCallback callback) { assertRunOnServiceThread(); HdmiDeviceInfo targetDevice = mDeviceInfos.get(id); if (targetDevice == null) { invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE); return; } int targetAddress = targetDevice.getLogicalAddress(); ActiveSource active = getActiveSource(); if (targetDevice.getDevicePowerStatus() == HdmiControlManager.POWER_STATUS_ON && active.isValid() && targetAddress == active.logicalAddress) { invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); return; } if (targetAddress == Constants.ADDR_INTERNAL) { handleSelectInternalSource(); setActiveSource(targetAddress, mService.getPhysicalAddress()); setActivePath(mService.getPhysicalAddress()); invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS); return; } if (!mService.isControlEnabled()) { setActiveSource(targetDevice); invokeCallback(callback, HdmiControlManager.RESULT_INCORRECT_MODE); return; } removeAction(DeviceSelectAction.class); addAndStartAction(new DeviceSelectAction(this, targetDevice, callback)); }
/** * Performs the action 'device select', or 'one touch play' initiated by TV. * * @param id id of HDMI device to select * @param callback callback object to report the result with */
Performs the action 'device select', or 'one touch play' initiated by TV
deviceSelect
{ "repo_name": "xorware/android_frameworks_base", "path": "services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java", "license": "apache-2.0", "size": 74896 }
[ "android.hardware.hdmi.HdmiControlManager", "android.hardware.hdmi.HdmiDeviceInfo", "android.hardware.hdmi.IHdmiControlCallback" ]
import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.HdmiDeviceInfo; import android.hardware.hdmi.IHdmiControlCallback;
import android.hardware.hdmi.*;
[ "android.hardware" ]
android.hardware;
2,241,961
public VpnGatewayProperties withBgpSettings(BgpSettings bgpSettings) { this.bgpSettings = bgpSettings; return this; }
VpnGatewayProperties function(BgpSettings bgpSettings) { this.bgpSettings = bgpSettings; return this; }
/** * Set the bgpSettings property: Local network gateway's BGP speaker settings. * * @param bgpSettings the bgpSettings value to set. * @return the VpnGatewayProperties object itself. */
Set the bgpSettings property: Local network gateway's BGP speaker settings
withBgpSettings
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VpnGatewayProperties.java", "license": "mit", "size": 4955 }
[ "com.azure.resourcemanager.network.models.BgpSettings" ]
import com.azure.resourcemanager.network.models.BgpSettings;
import com.azure.resourcemanager.network.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
902,473
private boolean update(Context context) { if (getId() == -1) { return false; } ContentResolver contentResolver = context.getContentResolver(); int rows = contentResolver.update(CmHomeContract.DataCard.CONTENT_URI, getContentValues(), CmHomeContract.DataCard._ID + " = " + getId(), new String[]{}); // We must have updated more than one row return rows > 0; }
boolean function(Context context) { if (getId() == -1) { return false; } ContentResolver contentResolver = context.getContentResolver(); int rows = contentResolver.update(CmHomeContract.DataCard.CONTENT_URI, getContentValues(), CmHomeContract.DataCard._ID + STR + getId(), new String[]{}); return rows > 0; }
/** * Updates an existing row in the ContentProvider that represents this card. * This will update every column at once. * @param context A Context object to retrieve the ContentResolver * @return true if the update successfully updates a row, false otherwise. */
Updates an existing row in the ContentProvider that represents this card. This will update every column at once
update
{ "repo_name": "mattgmg1990/external_cyanogen_cmhomeapi", "path": "sdk/src/org/cyanogenmod/launcher/home/api/cards/DataCard.java", "license": "apache-2.0", "size": 6895 }
[ "android.content.ContentResolver", "android.content.Context", "org.cyanogenmod.launcher.home.api.provider.CmHomeContract" ]
import android.content.ContentResolver; import android.content.Context; import org.cyanogenmod.launcher.home.api.provider.CmHomeContract;
import android.content.*; import org.cyanogenmod.launcher.home.api.provider.*;
[ "android.content", "org.cyanogenmod.launcher" ]
android.content; org.cyanogenmod.launcher;
1,422,489
private static boolean fileExists(String filePath) { File file = new File(filePath); return file.exists(); }
static boolean function(String filePath) { File file = new File(filePath); return file.exists(); }
/** * Check if a file exists on device * * @param filePath The absolute file path */
Check if a file exists on device
fileExists
{ "repo_name": "cicixiaoyan/OA_WEBApp", "path": "OA_WEBApp/plugins/cordova-plugin-filepath/src/android/FilePath.java", "license": "mit", "size": 12457 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,100,685
void readParameters(SMPPInputStream in) throws IOException { // Mandatory parameters message_id = in.readCString(); // Optional parameters readOptionalParameters(in); }
void readParameters(SMPPInputStream in) throws IOException { message_id = in.readCString(); readOptionalParameters(in); }
/** * Reads mandatory and optional parameters from SMPPInputStream. * * @param in SMPPInputStream for reading parameters. * @throws IOException In case of a problem while reading data. */
Reads mandatory and optional parameters from SMPPInputStream
readParameters
{ "repo_name": "vnesek/nmote-smpp", "path": "src/main/java/com/nmote/smpp/CancelBroadcastSmRespPDU.java", "license": "bsd-3-clause", "size": 5074 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,567,967
protected ConfigurablePropertyAccessor getPropertyAccessor() { return getInternalBindingResult().getPropertyAccessor(); }
ConfigurablePropertyAccessor function() { return getInternalBindingResult().getPropertyAccessor(); }
/** * Return the underlying PropertyAccessor of this binder's BindingResult. */
Return the underlying PropertyAccessor of this binder's BindingResult
getPropertyAccessor
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/validation/DataBinder.java", "license": "unlicense", "size": 23468 }
[ "org.springframework.beans.ConfigurablePropertyAccessor" ]
import org.springframework.beans.ConfigurablePropertyAccessor;
import org.springframework.beans.*;
[ "org.springframework.beans" ]
org.springframework.beans;
2,783,290
public long localSizeLong(CachePeekMode... peekModes);
long function(CachePeekMode... peekModes);
/** * Gets the number of all entries cached on this node as a long value. By default, if {@code peekModes} value isn't * defined, only size of primary copies will be returned. This behavior is identical to calling this method with * {@link CachePeekMode#PRIMARY} peek mode. * * @param peekModes Optional peek modes. If not provided, then total cache size is returned. * @return Cache size on this node. */
Gets the number of all entries cached on this node as a long value. By default, if peekModes value isn't defined, only size of primary copies will be returned. This behavior is identical to calling this method with <code>CachePeekMode#PRIMARY</code> peek mode
localSizeLong
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/IgniteCache.java", "license": "apache-2.0", "size": 82823 }
[ "org.apache.ignite.cache.CachePeekMode" ]
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.*;
[ "org.apache.ignite" ]
org.apache.ignite;
662,676
public static List<EvalTemplateItem> getChildItems(List<EvalTemplateItem> templateItemsList, Long blockParentId) { List<EvalTemplateItem> childItemsList = new ArrayList<EvalTemplateItem>(); for (int i=0; i<templateItemsList.size(); i++) { EvalTemplateItem templateItem = (EvalTemplateItem) templateItemsList.get(i); if ( isBlockChild(templateItem) ) { if ( blockParentId.equals(templateItem.getBlockId()) ) { childItemsList.add(templateItem); } } } // fix the order Collections.sort(childItemsList, new ComparatorsUtils.TemplateItemComparatorByOrder() ); return childItemsList; }
static List<EvalTemplateItem> function(List<EvalTemplateItem> templateItemsList, Long blockParentId) { List<EvalTemplateItem> childItemsList = new ArrayList<EvalTemplateItem>(); for (int i=0; i<templateItemsList.size(); i++) { EvalTemplateItem templateItem = (EvalTemplateItem) templateItemsList.get(i); if ( isBlockChild(templateItem) ) { if ( blockParentId.equals(templateItem.getBlockId()) ) { childItemsList.add(templateItem); } } } Collections.sort(childItemsList, new ComparatorsUtils.TemplateItemComparatorByOrder() ); return childItemsList; }
/** * return the child items which are associated with a block parent Id in the correct * display order * * @param tempItemsList a List of {@link EvalTemplateItem} objects in a template * @param blockParentId a unique identifier for an {@link EvalTemplateItem} which is a block parent * @return a List of {@link EvalTemplateItem} objects or empty if none found */
return the child items which are associated with a block parent Id in the correct display order
getChildItems
{ "repo_name": "marktriggs/nyu-sakai-10.4", "path": "evaluation/api/src/java/org/sakaiproject/evaluation/utils/TemplateItemUtils.java", "license": "apache-2.0", "size": 34468 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.sakaiproject.evaluation.model.EvalTemplateItem" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.sakaiproject.evaluation.model.EvalTemplateItem;
import java.util.*; import org.sakaiproject.evaluation.model.*;
[ "java.util", "org.sakaiproject.evaluation" ]
java.util; org.sakaiproject.evaluation;
1,923,423
void onSigningKeyUsed(String keyIdentifier, Instant expiration);
void onSigningKeyUsed(String keyIdentifier, Instant expiration);
/** * On Signing Key Used * * @param keyIdentifier Key Identifier * @param expiration JSON Web Token Expiration */
On Signing Key Used
onSigningKeyUsed
{ "repo_name": "MikeThomsen/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/main/java/org/apache/nifi/web/security/jwt/jws/SigningKeyListener.java", "license": "apache-2.0", "size": 1177 }
[ "java.time.Instant" ]
import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
1,695,256
protected MetadataField getAccessibleField(MappingAccessor accessor) { MetadataField field = getJavaClass().getField(accessor.getName()); if (field == null) { throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass()); } else { // True will force an exception to be thrown if it is not a valid // field. However, if it is a transient accessor, don't validate it // and return. if (accessor.isTransient() || field.isValidPersistenceField(this, true)) { return field; } return null; } }
MetadataField function(MappingAccessor accessor) { MetadataField field = getJavaClass().getField(accessor.getName()); if (field == null) { throw ValidationException.invalidFieldForClass(accessor.getName(), getJavaClass()); } else { if (accessor.isTransient() field.isValidPersistenceField(this, true)) { return field; } return null; } }
/** * INTERNAL: * Return the accessible field for the given mapping accessor. Validation is * performed on the existence of the field. */
Return the accessible field for the given mapping accessor. Validation is performed on the existence of the field
getAccessibleField
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/ClassAccessor.java", "license": "epl-1.0", "size": 82197 }
[ "org.eclipse.persistence.exceptions.ValidationException", "org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor", "org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField" ]
import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataField;
import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.*; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,185,856
public void setLocations(List<PropertiesLocation> locations) { // reset locations locations = parseLocations(locations); this.locations = Collections.unmodifiableList(locations); // we need to re-create the property sources which may have already been created from locations this.sources.removeIf(s -> s instanceof LocationPropertiesSource); for (PropertiesLocation loc : locations) { addPropertiesLocationsAsPropertiesSource(loc); } }
void function(List<PropertiesLocation> locations) { locations = parseLocations(locations); this.locations = Collections.unmodifiableList(locations); this.sources.removeIf(s -> s instanceof LocationPropertiesSource); for (PropertiesLocation loc : locations) { addPropertiesLocationsAsPropertiesSource(loc); } }
/** * A list of locations to load properties. This option will override any default locations and only use the * locations from this option. */
A list of locations to load properties. This option will override any default locations and only use the locations from this option
setLocations
{ "repo_name": "gnodet/camel", "path": "core/camel-base/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java", "license": "apache-2.0", "size": 24436 }
[ "java.util.Collections", "java.util.List" ]
import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,831,126
EnumSerializationFormat getFormat();
EnumSerializationFormat getFormat();
/** * Returns output serialization format. * @return output format */
Returns output serialization format
getFormat
{ "repo_name": "UnifiedViews/Plugins", "path": "t-fusionTool/src/main/java/eu/unifiedviews/plugins/transformer/fusiontool/config/FileOutput.java", "license": "lgpl-3.0", "size": 1022 }
[ "cz.cuni.mff.odcleanstore.fusiontool.io.EnumSerializationFormat" ]
import cz.cuni.mff.odcleanstore.fusiontool.io.EnumSerializationFormat;
import cz.cuni.mff.odcleanstore.fusiontool.io.*;
[ "cz.cuni.mff" ]
cz.cuni.mff;
2,622,827
public static void initNative(Context context, KeyInterface keyImpl, Class<? extends Activity> mainActivity) { SalesforceSDKManagerWithSmartStore.init(context, keyImpl, mainActivity, LoginActivity.class); }
static void function(Context context, KeyInterface keyImpl, Class<? extends Activity> mainActivity) { SalesforceSDKManagerWithSmartStore.init(context, keyImpl, mainActivity, LoginActivity.class); }
/** * Initializes components required for this class * to properly function. This method should be called * by native apps using the Salesforce Mobile SDK. * * @param context Application context. * @param keyImpl Implementation of KeyInterface. * @param mainActivity Activity that should be launched after the login flow. */
Initializes components required for this class to properly function. This method should be called by native apps using the Salesforce Mobile SDK
initNative
{ "repo_name": "iFernandoSousa/cordova-salesforcesdk", "path": "src/android/com/salesforce/androidsdk/smartstore/app/SalesforceSDKManagerWithSmartStore.java", "license": "unlicense", "size": 12648 }
[ "android.app.Activity", "android.content.Context", "com.salesforce.androidsdk.ui.LoginActivity" ]
import android.app.Activity; import android.content.Context; import com.salesforce.androidsdk.ui.LoginActivity;
import android.app.*; import android.content.*; import com.salesforce.androidsdk.ui.*;
[ "android.app", "android.content", "com.salesforce.androidsdk" ]
android.app; android.content; com.salesforce.androidsdk;
2,543,591
public static TypeAdapterFactory newFactoryWithMatchRawType( TypeToken<?> exactType, Object typeAdapter) { // only bother matching raw types if exact type is a raw type boolean matchRawType = exactType.getType() == exactType.getRawType(); return new SingleTypeFactory(typeAdapter, exactType, matchRawType, null); }
static TypeAdapterFactory function( TypeToken<?> exactType, Object typeAdapter) { boolean matchRawType = exactType.getType() == exactType.getRawType(); return new SingleTypeFactory(typeAdapter, exactType, matchRawType, null); }
/** * Returns a new factory that will match each type and its raw type against * {@code exactType}. */
Returns a new factory that will match each type and its raw type against exactType
newFactoryWithMatchRawType
{ "repo_name": "google/gson", "path": "gson/src/main/java/com/google/gson/internal/bind/TreeTypeAdapter.java", "license": "apache-2.0", "size": 6216 }
[ "com.google.gson.TypeAdapterFactory", "com.google.gson.reflect.TypeToken" ]
import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken;
import com.google.gson.*; import com.google.gson.reflect.*;
[ "com.google.gson" ]
com.google.gson;
199,884
public void setAlwaysOn(final Boolean alwaysOnValue) { this.alwaysOn = alwaysOnValue; } private HashMap<String, String> appSettings;
void function(final Boolean alwaysOnValue) { this.alwaysOn = alwaysOnValue; } private HashMap<String, String> appSettings;
/** * Optional. True if Always On functionality is enabled for the site; * otherwise, false. * @param alwaysOnValue The AlwaysOn value. */
Optional. True if Always On functionality is enabled for the site; otherwise, false
setAlwaysOn
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "resource-management/azure-mgmt-websites/src/main/java/com/microsoft/azure/management/websites/models/WebSiteUpdateConfigurationDetails.java", "license": "apache-2.0", "size": 19422 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
847,785
this.finalPhrases = new ArrayList<>(); this.checkBoxMap = new HashMap<>(); populateCheckBoxMap(); //Populate the default values in the hash map. this.occasionSelection.setItems(occasionValues); this.sortSelection.setItems(sortSelectionValues); this.priceColumn.setCellValueFactory(new PropertyValueFactory<>("price")); this.boroughColumn.setCellValueFactory(new PropertyValueFactory<>("neighbourhood")); this.descriptionColumn.setCellValueFactory(new PropertyValueFactory<>("description")); this.phrases.setTextFormatter(new TextFormatter<String>(text -> text.getControlNewText().length() <= 150 ? text : null)); Label promptText = new Label("Your results will appear here once the form is filled and the search button is pressed."); promptText.setStyle("-fx-font-size: 11px"); this.results.setPlaceholder(promptText); this.results.setDisable(true); this.sortSelection.setDisable(true); this.sortLabel.setDisable(true); this.listingLabel.setDisable(true); this.highlightLabel.setDisable(true); }
this.finalPhrases = new ArrayList<>(); this.checkBoxMap = new HashMap<>(); populateCheckBoxMap(); this.occasionSelection.setItems(occasionValues); this.sortSelection.setItems(sortSelectionValues); this.priceColumn.setCellValueFactory(new PropertyValueFactory<>("price")); this.boroughColumn.setCellValueFactory(new PropertyValueFactory<>(STR)); this.descriptionColumn.setCellValueFactory(new PropertyValueFactory<>(STR)); this.phrases.setTextFormatter(new TextFormatter<String>(text -> text.getControlNewText().length() <= 150 ? text : null)); Label promptText = new Label(STR); promptText.setStyle(STR); this.results.setPlaceholder(promptText); this.results.setDisable(true); this.sortSelection.setDisable(true); this.sortLabel.setDisable(true); this.listingLabel.setDisable(true); this.highlightLabel.setDisable(true); }
/** * Initialise the property finder. */
Initialise the property finder
initialize
{ "repo_name": "SalsGithub/Java", "path": "RentalServiceMain/src/application/componenthandlers/PropertyFinderComponentHandler.java", "license": "gpl-3.0", "size": 13361 }
[ "java.util.ArrayList", "java.util.HashMap" ]
import java.util.ArrayList; import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,374,527
void recordVariableUpdate(VariableInstanceEntity variable);
void recordVariableUpdate(VariableInstanceEntity variable);
/** * Record a variable has been updated, if audit history is enabled. */
Record a variable has been updated, if audit history is enabled
recordVariableUpdate
{ "repo_name": "roberthafner/flowable-engine", "path": "modules/flowable-engine/src/main/java/org/activiti/engine/impl/history/HistoryManager.java", "license": "apache-2.0", "size": 8227 }
[ "org.activiti.engine.impl.persistence.entity.VariableInstanceEntity" ]
import org.activiti.engine.impl.persistence.entity.VariableInstanceEntity;
import org.activiti.engine.impl.persistence.entity.*;
[ "org.activiti.engine" ]
org.activiti.engine;
1,038,597
public static HashMap<String, String> getKeyValuesFromUrl(String url) { HashMap<String, String> valueMap = new HashMap<String, String>(); String[] urlParts = url.split("[\\?\\&]"); for (int i = 1; i < urlParts.length; i++) { String part = urlParts[i]; String[] kv = part.split("=", 2); if (kv.length == 2) { String key = kv[0]; String value = kv[1]; try { key = URLDecoder.decode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { } try { value = URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { } Log.d(TAG, "Returned " + key + " = " + value); valueMap.put(key, value); } else if (kv.length == 1) { String key = kv[0]; try { key = URLDecoder.decode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { } valueMap.put(key, null); } } return valueMap; }
static HashMap<String, String> function(String url) { HashMap<String, String> valueMap = new HashMap<String, String>(); String[] urlParts = url.split(STR); for (int i = 1; i < urlParts.length; i++) { String part = urlParts[i]; String[] kv = part.split("=", 2); if (kv.length == 2) { String key = kv[0]; String value = kv[1]; try { key = URLDecoder.decode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { } try { value = URLDecoder.decode(value, "UTF-8"); } catch (UnsupportedEncodingException e) { } Log.d(TAG, STR + key + STR + value); valueMap.put(key, value); } else if (kv.length == 1) { String key = kv[0]; try { key = URLDecoder.decode(key, "UTF-8"); } catch (UnsupportedEncodingException e) { } valueMap.put(key, null); } } return valueMap; }
/** * convert a set of URL parameters into key/value pairs * * @param url * @return */
convert a set of URL parameters into key/value pairs
getKeyValuesFromUrl
{ "repo_name": "GSMADeveloper/MobileConnectTestApp", "path": "src/com/gsma/android/xoperatorapidemo/utils/HttpUtils.java", "license": "mit", "size": 9600 }
[ "android.util.Log", "java.io.UnsupportedEncodingException", "java.net.URLDecoder", "java.util.HashMap" ]
import android.util.Log; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.HashMap;
import android.util.*; import java.io.*; import java.net.*; import java.util.*;
[ "android.util", "java.io", "java.net", "java.util" ]
android.util; java.io; java.net; java.util;
269,259
@Override public boolean onTouchEvent(MotionEvent event) { if(event.getAction()==MotionEvent.ACTION_DOWN) //if screen is touched { if(!player.getPlaying() && newGameCreated && reset) { player.setPlaying(true); } if(player.getPlaying()) { if(!gameStarted)gameStarted = true; if(reset)reset = false; player.setUp(true); //tell player object that screen has been touched } if(isPaused){ //resumes game if screen is touched during pause isPaused=false; //clears pause-flag game.setMusic(true); //resumes music playback } return true; } if(event.getAction()==MotionEvent.ACTION_UP) { player.setUp(false); return true; } return super.onTouchEvent(event); }
boolean function(MotionEvent event) { if(event.getAction()==MotionEvent.ACTION_DOWN) { if(!player.getPlaying() && newGameCreated && reset) { player.setPlaying(true); } if(player.getPlaying()) { if(!gameStarted)gameStarted = true; if(reset)reset = false; player.setUp(true); } if(isPaused){ isPaused=false; game.setMusic(true); } return true; } if(event.getAction()==MotionEvent.ACTION_UP) { player.setUp(false); return true; } return super.onTouchEvent(event); }
/** * Handles user input (touch events). First touch starts or resumes the game. Subsequent * touches will cause the wasp to ascend, while releasing the touch will cause the wasp to * descend. * * @param event Touch event * @return true or super.onTouchEvent(event) */
Handles user input (touch events). First touch starts or resumes the game. Subsequent touches will cause the wasp to ascend, while releasing the touch will cause the wasp to descend
onTouchEvent
{ "repo_name": "ViktorStarn/Waspventure", "path": "app/src/main/java/com/wasp/measlebeam/waspventure/GamePanel.java", "license": "gpl-3.0", "size": 22165 }
[ "android.view.MotionEvent" ]
import android.view.MotionEvent;
import android.view.*;
[ "android.view" ]
android.view;
1,806,064
private static Rectangle getSignaturePositionOnPage(final Properties extraParams) { return PdfPreProcessor.getPositionOnPage(extraParams, "signature"); //$NON-NLS-1$ }
static Rectangle function(final Properties extraParams) { return PdfPreProcessor.getPositionOnPage(extraParams, STR); }
/** Devuelve la posici&oacute;n de la p&aacute;gina en donde debe agregarse * la firma. La medida de posicionamiento es el p&iacute;xel y se cuenta en * el eje horizontal de izquierda a derecha y en el vertical de abajo a * arriba. * @param extraParams Conjunto de propiedades con las coordenadas del rect&aacute;ngulo * @return Rect&aacute;ngulo que define la posici&oacute;n de la p&aacute;gina en donde * debe agregarse la firma*/
Devuelve la posici&oacute;n de la p&aacute;gina en donde debe agregarse la firma. La medida de posicionamiento es el p&iacute;xel y se cuenta en el eje horizontal de izquierda a derecha y en el vertical de abajo a arriba
getSignaturePositionOnPage
{ "repo_name": "venanciolm/afirma-ui-miniapplet_x_x", "path": "afirma_ui_miniapplet/src/main/java/es/gob/afirma/signers/pades/PdfSessionManager.java", "license": "mit", "size": 16559 }
[ "com.lowagie.text.Rectangle", "java.util.Properties" ]
import com.lowagie.text.Rectangle; import java.util.Properties;
import com.lowagie.text.*; import java.util.*;
[ "com.lowagie.text", "java.util" ]
com.lowagie.text; java.util;
2,184,571
private boolean setDsStates(final JsonNode dsStates) { if(dsStates == null) { return false; } final Map<String, DeliveryService> dsMap = cacheRegister.getDeliveryServices(); for (final String dsName : dsMap.keySet()) { dsMap.get(dsName).setState(dsStates.get(dsName)); } return true; }
boolean function(final JsonNode dsStates) { if(dsStates == null) { return false; } final Map<String, DeliveryService> dsMap = cacheRegister.getDeliveryServices(); for (final String dsName : dsMap.keySet()) { dsMap.get(dsName).setState(dsStates.get(dsName)); } return true; }
/** * Sets Delivery Service states based on the input JSON. * <p> * Delivery Services present in the input which aren't registered are ignored. * </p> * @param dsStates The input JSON object. Expected to be a map of Delivery Service XMLIDs to * "state" strings. * @return {@code false} iff dsStates was {@code null}, otherwise {@code true}. */
Sets Delivery Service states based on the input JSON. Delivery Services present in the input which aren't registered are ignored.
setDsStates
{ "repo_name": "hbeatty/incubator-trafficcontrol", "path": "traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/router/TrafficRouter.java", "license": "apache-2.0", "size": 83595 }
[ "com.comcast.cdn.traffic_control.traffic_router.core.ds.DeliveryService", "com.fasterxml.jackson.databind.JsonNode", "java.util.Map" ]
import com.comcast.cdn.traffic_control.traffic_router.core.ds.DeliveryService; import com.fasterxml.jackson.databind.JsonNode; import java.util.Map;
import com.comcast.cdn.traffic_control.traffic_router.core.ds.*; import com.fasterxml.jackson.databind.*; import java.util.*;
[ "com.comcast.cdn", "com.fasterxml.jackson", "java.util" ]
com.comcast.cdn; com.fasterxml.jackson; java.util;
521,387
TreeSet<Channel> channels = new TreeSet<Channel>(Comparator.comparing(Channel::getName).thenComparing(Channel::getId)); AuthenticatedWebClient.WebResponse response = webClient.get("projects/" + projectId + "/channels"); if (response.isErrorCode()) { throw new IOException(String.format("Code %s - %n%s", response.getCode(), response.getContent())); } JSONObject json = (JSONObject)JSONSerializer.toJSON(response.getContent()); for (Object obj : json.getJSONArray("Items")) { JSONObject jsonObj = (JSONObject)obj; String id = jsonObj.getString("Id"); String name = jsonObj.getString("Name"); String description = jsonObj.getString("Description"); boolean isDefault = jsonObj.getBoolean("IsDefault"); channels.add(new Channel(id, name, description, projectId, isDefault)); } return channels; }
TreeSet<Channel> channels = new TreeSet<Channel>(Comparator.comparing(Channel::getName).thenComparing(Channel::getId)); AuthenticatedWebClient.WebResponse response = webClient.get(STR + projectId + STR); if (response.isErrorCode()) { throw new IOException(String.format(STR, response.getCode(), response.getContent())); } JSONObject json = (JSONObject)JSONSerializer.toJSON(response.getContent()); for (Object obj : json.getJSONArray("Items")) { JSONObject jsonObj = (JSONObject)obj; String id = jsonObj.getString("Id"); String name = jsonObj.getString("Name"); String description = jsonObj.getString(STR); boolean isDefault = jsonObj.getBoolean(STR); channels.add(new Channel(id, name, description, projectId, isDefault)); } return channels; }
/** * Uses the authenticated web client to pull all channels for a given project * from the api and convert them to POJOs * @param projectId the project to get channels for * @return a Set of Channels (should have at minimum one entry) * @throws IllegalArgumentException when the web client receives a bad parameter * @throws IOException When the AuthenticatedWebClient receives and error response code */
Uses the authenticated web client to pull all channels for a given project from the api and convert them to POJOs
getChannelsByProjectId
{ "repo_name": "vistaprint/octopus-jenkins-plugin", "path": "src/main/java/com/octopusdeploy/api/ChannelsApi.java", "license": "mit", "size": 3534 }
[ "com.octopusdeploy.api.data.Channel", "java.io.IOException", "java.util.Comparator", "java.util.TreeSet", "net.sf.json.JSONObject", "net.sf.json.JSONSerializer" ]
import com.octopusdeploy.api.data.Channel; import java.io.IOException; import java.util.Comparator; import java.util.TreeSet; import net.sf.json.JSONObject; import net.sf.json.JSONSerializer;
import com.octopusdeploy.api.data.*; import java.io.*; import java.util.*; import net.sf.json.*;
[ "com.octopusdeploy.api", "java.io", "java.util", "net.sf.json" ]
com.octopusdeploy.api; java.io; java.util; net.sf.json;
561,151
public void menuKeyTyped(MenuKeyEvent e) {}
public void menuKeyTyped(MenuKeyEvent e) {}
/** * Required by I/F but not actually needed in our case, * no-operation implementation. * @see MenuKeyListener#menuKeyPressed(MenuKeyEvent) */
Required by I/F but not actually needed in our case, no-operation implementation
menuKeyPressed
{ "repo_name": "tp81/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerControl.java", "license": "gpl-2.0", "size": 59385 }
[ "javax.swing.event.MenuKeyEvent" ]
import javax.swing.event.MenuKeyEvent;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
7,413
public static RuleProviderRegistry instance(GraphRewrite event) { RuleProviderRegistry instance = (RuleProviderRegistry) event.getRewriteContext().get(RuleProviderRegistry.class); return instance; }
static RuleProviderRegistry function(GraphRewrite event) { RuleProviderRegistry instance = (RuleProviderRegistry) event.getRewriteContext().get(RuleProviderRegistry.class); return instance; }
/** * Gets the current instance of {@link RuleProviderRegistry}. */
Gets the current instance of <code>RuleProviderRegistry</code>
instance
{ "repo_name": "sgilda/windup", "path": "config/api/src/main/java/org/jboss/windup/config/metadata/RuleProviderRegistry.java", "license": "epl-1.0", "size": 2542 }
[ "org.jboss.windup.config.GraphRewrite" ]
import org.jboss.windup.config.GraphRewrite;
import org.jboss.windup.config.*;
[ "org.jboss.windup" ]
org.jboss.windup;
1,378,473
public static float getRightXAxis() { if (controllerConnected()) { float axis = controller.getAxis(Xbox360Pad.AXIS_RIGHT_X); return (Math.abs(axis) > axisPad) ? axis : 0; } if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) { return -1; } if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) { return 1; } return 0; }
static float function() { if (controllerConnected()) { float axis = controller.getAxis(Xbox360Pad.AXIS_RIGHT_X); return (Math.abs(axis) > axisPad) ? axis : 0; } if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) { return -1; } if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) { return 1; } return 0; }
/** * Returns the x-value of the right input axis (Arrow keys or right joystick) * @return A value from -1.0 to 1.0 */
Returns the x-value of the right input axis (Arrow keys or right joystick)
getRightXAxis
{ "repo_name": "cs428-dungeon/DungeonRPG", "path": "core/src/edu/byu/rpg/input/InputManager.java", "license": "gpl-3.0", "size": 3781 }
[ "com.badlogic.gdx.Gdx", "com.badlogic.gdx.Input" ]
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input;
import com.badlogic.gdx.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
2,189,600
private void processVariable(DetailAST ast) { if (!ScopeUtils.isInInterfaceOrAnnotationBlock(ast) && (ScopeUtils.isLocalVariableDef(ast) || ast.getType() == TokenTypes.PARAMETER_DEF)) { // local variable or parameter. Does it shadow a field? final DetailAST nameAST = ast.findFirstToken(TokenTypes.IDENT); final String name = nameAST.getText(); if ((isStaticFieldHiddenFromAnonymousClass(ast, name) || isStaticOrInstanceField(ast, name)) && !isMatchingRegexp(name) && !isIgnoredParam(ast, name)) { log(nameAST, MSG_KEY, name); } } }
void function(DetailAST ast) { if (!ScopeUtils.isInInterfaceOrAnnotationBlock(ast) && (ScopeUtils.isLocalVariableDef(ast) ast.getType() == TokenTypes.PARAMETER_DEF)) { final DetailAST nameAST = ast.findFirstToken(TokenTypes.IDENT); final String name = nameAST.getText(); if ((isStaticFieldHiddenFromAnonymousClass(ast, name) isStaticOrInstanceField(ast, name)) && !isMatchingRegexp(name) && !isIgnoredParam(ast, name)) { log(nameAST, MSG_KEY, name); } } }
/** * Process a variable token. * Check whether a local variable or parameter shadows a field. * Store a field for later comparison with local variables and parameters. * @param ast the variable token. */
Process a variable token. Check whether a local variable or parameter shadows a field. Store a field for later comparison with local variables and parameters
processVariable
{ "repo_name": "jasonchaffee/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.java", "license": "lgpl-2.1", "size": 23905 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.TokenTypes", "com.puppycrawl.tools.checkstyle.utils.ScopeUtils" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import com.puppycrawl.tools.checkstyle.utils.ScopeUtils;
import com.puppycrawl.tools.checkstyle.api.*; import com.puppycrawl.tools.checkstyle.utils.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
1,810,351
protected boolean handleDirtyConflict() { return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), getString("_WARN_FileConflict")); } public ModelReviewEditor() { super(); initializeEditingDomain(); }
boolean function() { return MessageDialog.openQuestion(getSite().getShell(), getString(STR), getString(STR)); } public ModelReviewEditor() { super(); initializeEditingDomain(); }
/** * Shows a dialog that asks if conflicting changes should be discarded. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @generated */
Shows a dialog that asks if conflicting changes should be discarded.
handleDirtyConflict
{ "repo_name": "theArchonius/mervin", "path": "plugins/at.bitandart.zoubek.mervin.model.editor/src/at/bitandart/zoubek/mervin/model/modelreview/presentation/ModelReviewEditor.java", "license": "epl-1.0", "size": 54743 }
[ "org.eclipse.jface.dialogs.MessageDialog" ]
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
2,742,734
private static void shutdown(final PeerDHT[] peers) { for (PeerDHT peer : peers) { peer.shutdown(); } }
static void function(final PeerDHT[] peers) { for (PeerDHT peer : peers) { peer.shutdown(); } }
/** * Shutdown all the peers. * * @param peers * The peers in this P2P network */
Shutdown all the peers
shutdown
{ "repo_name": "tomp2p/TomP2P", "path": "examples/src/main/java/net/tomp2p/examples/ExampleIndirectReplication.java", "license": "apache-2.0", "size": 5165 }
[ "net.tomp2p.dht.PeerDHT" ]
import net.tomp2p.dht.PeerDHT;
import net.tomp2p.dht.*;
[ "net.tomp2p.dht" ]
net.tomp2p.dht;
2,647,039
public static String getStringList(List list) { return getStringList(list, true, false); }
static String function(List list) { return getStringList(list, true, false); }
/** * List the toString out put of the objects in the List comma separated. If * the List is null or empty an empty string is returned. * * The same as getStringList(list, true, false) * @see #getStringList(List, boolean, boolean) * @param list * list of objects with toString methods * @return comma separated list of the elements in the list */
List the toString out put of the objects in the List comma separated. If the List is null or empty an empty string is returned. The same as getStringList(list, true, false)
getStringList
{ "repo_name": "55open/skylunece", "path": "skylucene/jsqlparser/net/sf/jsqlparser/statement/select/PlainSelect.java", "license": "apache-2.0", "size": 6606 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,805,960
public void writeNextUid(final ByteBuffer byteBuffer) { ByteBufferUtils.copy(this.byteBuffer, byteBuffer); UNSIGNED_BYTES.increment(byteBuffer); }
void function(final ByteBuffer byteBuffer) { ByteBufferUtils.copy(this.byteBuffer, byteBuffer); UNSIGNED_BYTES.increment(byteBuffer); }
/** * Writes the next uid value after this to the passed bytebuffer and wraps it with * a new UID instance. */
Writes the next uid value after this to the passed bytebuffer and wraps it with a new UID instance
writeNextUid
{ "repo_name": "gchq/stroom", "path": "stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/UID.java", "license": "apache-2.0", "size": 6634 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
221,485
public void readPacketData(PacketBuffer p_148837_1_) throws IOException { this.field_148876_a = p_148837_1_.readInt(); this.field_148874_b = p_148837_1_.readShort(); this.field_148875_c = p_148837_1_.readInt(); this.field_148872_d = p_148837_1_.readUnsignedByte(); this.field_148873_e = p_148837_1_.readUnsignedByte(); this.field_148871_f = Block.getBlockById(p_148837_1_.readVarIntFromBuffer() & 4095); }
void function(PacketBuffer p_148837_1_) throws IOException { this.field_148876_a = p_148837_1_.readInt(); this.field_148874_b = p_148837_1_.readShort(); this.field_148875_c = p_148837_1_.readInt(); this.field_148872_d = p_148837_1_.readUnsignedByte(); this.field_148873_e = p_148837_1_.readUnsignedByte(); this.field_148871_f = Block.getBlockById(p_148837_1_.readVarIntFromBuffer() & 4095); }
/** * Reads the raw packet data from the data stream. */
Reads the raw packet data from the data stream
readPacketData
{ "repo_name": "mviitanen/marsmod", "path": "mcp/src/minecraft/net/minecraft/network/play/server/S24PacketBlockAction.java", "license": "gpl-2.0", "size": 2820 }
[ "java.io.IOException", "net.minecraft.block.Block", "net.minecraft.network.PacketBuffer" ]
import java.io.IOException; import net.minecraft.block.Block; import net.minecraft.network.PacketBuffer;
import java.io.*; import net.minecraft.block.*; import net.minecraft.network.*;
[ "java.io", "net.minecraft.block", "net.minecraft.network" ]
java.io; net.minecraft.block; net.minecraft.network;
2,485,089
private Set<BuildConfiguration> computeAllReachableConfigurations() { Set<BuildConfiguration> result = new LinkedHashSet<>(); Queue<BuildConfiguration> queue = new LinkedList<>(); queue.add(this); while (!queue.isEmpty()) { BuildConfiguration config = queue.remove(); if (!result.add(config)) { continue; } config.getTransitions().addDirectlyReachableConfigurations(queue); } return result; } /** * Returns the new configuration after traversing a dependency edge with a given configuration * transition. * * @param transition the configuration transition * @return the new configuration * @throws IllegalArgumentException if the transition is a {@link SplitTransition}
Set<BuildConfiguration> function() { Set<BuildConfiguration> result = new LinkedHashSet<>(); Queue<BuildConfiguration> queue = new LinkedList<>(); queue.add(this); while (!queue.isEmpty()) { BuildConfiguration config = queue.remove(); if (!result.add(config)) { continue; } config.getTransitions().addDirectlyReachableConfigurations(queue); } return result; } /** * Returns the new configuration after traversing a dependency edge with a given configuration * transition. * * @param transition the configuration transition * @return the new configuration * @throws IllegalArgumentException if the transition is a {@link SplitTransition}
/** * Returns all configurations that can be reached from this configuration through any kind of * configuration transition. */
Returns all configurations that can be reached from this configuration through any kind of configuration transition
computeAllReachableConfigurations
{ "repo_name": "bitemyapp/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java", "license": "apache-2.0", "size": 73993 }
[ "com.google.devtools.build.lib.packages.Attribute", "java.util.LinkedHashSet", "java.util.LinkedList", "java.util.Queue", "java.util.Set" ]
import com.google.devtools.build.lib.packages.Attribute; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.Queue; import java.util.Set;
import com.google.devtools.build.lib.packages.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
1,908,725
@XmlElementRef public DefaultProcessing getElement() { return DefaultProcessing.castOrCopy(metadata); }
DefaultProcessing function() { return DefaultProcessing.castOrCopy(metadata); }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <gmi:LE_Processing>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return The metadata to be marshalled. */
Invoked by JAXB at marshalling time for getting the actual metadata to write inside the XML element. This is the value or a copy of the value given in argument to the wrap method
getElement
{ "repo_name": "desruisseaux/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/LE_Processing.java", "license": "apache-2.0", "size": 3173 }
[ "org.apache.sis.metadata.iso.lineage.DefaultProcessing" ]
import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
import org.apache.sis.metadata.iso.lineage.*;
[ "org.apache.sis" ]
org.apache.sis;
1,328,474
@Nonnull GenericAttributeValue<String> getNode();
GenericAttributeValue<String> getNode();
/** * Returns the value of the node child. * Attribute node * @return the value of the node child. */
Returns the value of the node child. Attribute node
getNode
{ "repo_name": "consulo-trash/consulo-hibernate", "path": "plugin/src/main/java/com/intellij/hibernate/model/xml/mapping/HbmDynamicComponent.java", "license": "apache-2.0", "size": 6916 }
[ "com.intellij.util.xml.GenericAttributeValue" ]
import com.intellij.util.xml.GenericAttributeValue;
import com.intellij.util.xml.*;
[ "com.intellij.util" ]
com.intellij.util;
1,804,249
default T on(Date date) { Objects.requireNonNull(date, "date"); return on(date.toInstant()); }
default T on(Date date) { Objects.requireNonNull(date, "date"); return on(date.toInstant()); }
/** * Uses the given {@link Date} instance. * * @param date * {@link Date} to be used. * @return itself */
Uses the given <code>Date</code> instance
on
{ "repo_name": "shred/commons-suncalc", "path": "src/main/java/org/shredzone/commons/suncalc/param/TimeParameter.java", "license": "apache-2.0", "size": 5741 }
[ "java.util.Date", "java.util.Objects" ]
import java.util.Date; import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
2,584,896
private boolean isAch(PaymentDTOEx payment) { // we use ACH payment by default return (payment.getAch() != null); }
boolean function(PaymentDTOEx payment) { return (payment.getAch() != null); }
/** * Check type of payment (ACH or credit card) * * @param payment * payment data */
Check type of payment (ACH or credit card)
isAch
{ "repo_name": "maduhu/jBilling", "path": "src/java/com/sapienter/jbilling/server/payment/tasks/PaymentSageTask.java", "license": "agpl-3.0", "size": 22772 }
[ "com.sapienter.jbilling.server.payment.PaymentDTOEx" ]
import com.sapienter.jbilling.server.payment.PaymentDTOEx;
import com.sapienter.jbilling.server.payment.*;
[ "com.sapienter.jbilling" ]
com.sapienter.jbilling;
1,340,485
IReplCommand commandFromName(String commandName) throws CommandNotFoundException;
IReplCommand commandFromName(String commandName) throws CommandNotFoundException;
/** * Returns the command with name {@code commandName}. * * @param commandName * The name of an {@link IReplCommand}. * @return The {@link IReplCommand} bound to {@code commandName}. * @throws CommandNotFoundException * When the command could not be found. */
Returns the command with name commandName
commandFromName
{ "repo_name": "spoofax-shell-2017/spoofax-shell", "path": "org.metaborg.spoofax.shell.core/src/main/java/org/metaborg/spoofax/shell/invoker/ICommandInvoker.java", "license": "apache-2.0", "size": 2957 }
[ "org.metaborg.spoofax.shell.commands.IReplCommand" ]
import org.metaborg.spoofax.shell.commands.IReplCommand;
import org.metaborg.spoofax.shell.commands.*;
[ "org.metaborg.spoofax" ]
org.metaborg.spoofax;
17,630
public Point getNumTiles(Point co);
Point function(Point co);
/** * Returns the number of tiles in the horizontal and vertical directions. * * @param co If not null this object is used to return the information. If * null a new one is created and returned. * * @return The number of tiles in the horizontal (Point.x) and vertical * (Point.y) directions. * */
Returns the number of tiles in the horizontal and vertical directions
getNumTiles
{ "repo_name": "stelfrich/bioformats", "path": "components/forks/jai/src/jj2000/j2k/image/ImgData.java", "license": "gpl-2.0", "size": 11860 }
[ "java.awt.Point" ]
import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
237,613
private static String[] getLocaleValues() { String[] values = new String[LOCALE_COUNT]; values[LOCALE_ENGLISH] = Locale.ENGLISH.getDisplayName(); values[LOCALE_ITALIAN] = Locale.ITALIAN.getDisplayName(); return values; }
static String[] function() { String[] values = new String[LOCALE_COUNT]; values[LOCALE_ENGLISH] = Locale.ENGLISH.getDisplayName(); values[LOCALE_ITALIAN] = Locale.ITALIAN.getDisplayName(); return values; }
/** * Returns the locale combobox values * * @return the locale combobox values */
Returns the locale combobox values
getLocaleValues
{ "repo_name": "pasdam/batchRegexRenamer", "path": "src/main/java/com/pasdam/regexren/gui/SettingDialog.java", "license": "gpl-3.0", "size": 7085 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,341,786
Observable<VirtualMachine> listByLocationAsync(final String location);
Observable<VirtualMachine> listByLocationAsync(final String location);
/** * Gets all the virtual machines under the specified subscription for the specified location. * * @param location The location for which virtual machines under the subscription are queried. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */
Gets all the virtual machines under the specified subscription for the specified location
listByLocationAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/VirtualMachines.java", "license": "mit", "size": 11108 }
[ "com.microsoft.azure.management.compute.v2020_06_01.VirtualMachine" ]
import com.microsoft.azure.management.compute.v2020_06_01.VirtualMachine;
import com.microsoft.azure.management.compute.v2020_06_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,626,909
public void setTemporaryFolder(Path path) throws IOException { // delete contents of existing temp folder if (writable) { FileUtils.clearFolder(path); } // create new temp folder if it didn't exist Files.createDirectories(path); temporary = path; LOGGER.config("temp folder path set to [" + path + "]"); }
void function(Path path) throws IOException { if (writable) { FileUtils.clearFolder(path); } Files.createDirectories(path); temporary = path; LOGGER.config(STR + path + "]"); }
/** * Sets the path to the temporary folder. If the file system is writable, * the folder will also be emptied. * * @param path the {@code Path} to the temporary folder * @throws IOException if the temporary folder can't be set */
Sets the path to the temporary folder. If the file system is writable, the folder will also be emptied
setTemporaryFolder
{ "repo_name": "kosmonet/neon", "path": "src/neon/common/files/NeonFileSystem.java", "license": "gpl-3.0", "size": 10284 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
908,098
private boolean isClientAlive(Set<String> allClients, UIClient currClient) { switch(currClient.getUIClientType()) { case UIClient.REMOTE_UI: if(UIManager.getLocalUIByName(currClient.getLocalUIClientName()) == null) { if (Sage.DBG) System.out.println("Seeker is dropping RUI client from watch map because its connection is dead:" + currClient); return false; } break; default: if (!allClients.contains(currClient.getUIClientHostname())) { if (Sage.DBG) System.out.println("Seeker is dropping client from watch map because its connection is dead:" + currClient); return false; } break; } return true; }
boolean function(Set<String> allClients, UIClient currClient) { switch(currClient.getUIClientType()) { case UIClient.REMOTE_UI: if(UIManager.getLocalUIByName(currClient.getLocalUIClientName()) == null) { if (Sage.DBG) System.out.println(STR + currClient); return false; } break; default: if (!allClients.contains(currClient.getUIClientHostname())) { if (Sage.DBG) System.out.println(STR + currClient); return false; } break; } return true; }
/** * Test if the given client is still active in the system. * * @param allClients set of default client names to test against * @param currClient to test * @return true if connected, false otherwise */
Test if the given client is still active in the system
isClientAlive
{ "repo_name": "enternoescape/sagetv", "path": "java/sage/Seeker.java", "license": "apache-2.0", "size": 286721 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,716,901
void getBlockChecksum(DataInputStream in) throws IOException { final Block block = new Block(in.readLong(), 0 , in.readLong()); DataOutputStream out = null; final MetaDataInputStream metadataIn = datanode.data.getMetaDataInputStream(block); final DataInputStream checksumIn = new DataInputStream(new BufferedInputStream( metadataIn, BUFFER_SIZE)); try { //read metadata file final BlockMetadataHeader header = BlockMetadataHeader.readHeader(checksumIn); final DataChecksum checksum = header.getChecksum(); final int bytesPerCRC = checksum.getBytesPerChecksum(); final long crcPerBlock = (metadataIn.getLength() - BlockMetadataHeader.getHeaderSize())/checksum.getChecksumSize(); //compute block checksum final MD5Hash md5 = MD5Hash.digest(checksumIn); if (LOG.isDebugEnabled()) { LOG.debug("block=" + block + ", bytesPerCRC=" + bytesPerCRC + ", crcPerBlock=" + crcPerBlock + ", md5=" + md5); } //write reply out = new DataOutputStream( NetUtils.getOutputStream(s, datanode.socketWriteTimeout)); out.writeShort(DataTransferProtocol.OP_STATUS_SUCCESS); out.writeInt(bytesPerCRC); out.writeLong(crcPerBlock); md5.write(out); out.flush(); } finally { IOUtils.closeStream(out); IOUtils.closeStream(checksumIn); IOUtils.closeStream(metadataIn); } }
void getBlockChecksum(DataInputStream in) throws IOException { final Block block = new Block(in.readLong(), 0 , in.readLong()); DataOutputStream out = null; final MetaDataInputStream metadataIn = datanode.data.getMetaDataInputStream(block); final DataInputStream checksumIn = new DataInputStream(new BufferedInputStream( metadataIn, BUFFER_SIZE)); try { final BlockMetadataHeader header = BlockMetadataHeader.readHeader(checksumIn); final DataChecksum checksum = header.getChecksum(); final int bytesPerCRC = checksum.getBytesPerChecksum(); final long crcPerBlock = (metadataIn.getLength() - BlockMetadataHeader.getHeaderSize())/checksum.getChecksumSize(); final MD5Hash md5 = MD5Hash.digest(checksumIn); if (LOG.isDebugEnabled()) { LOG.debug(STR + block + STR + bytesPerCRC + STR + crcPerBlock + STR + md5); } out = new DataOutputStream( NetUtils.getOutputStream(s, datanode.socketWriteTimeout)); out.writeShort(DataTransferProtocol.OP_STATUS_SUCCESS); out.writeInt(bytesPerCRC); out.writeLong(crcPerBlock); md5.write(out); out.flush(); } finally { IOUtils.closeStream(out); IOUtils.closeStream(checksumIn); IOUtils.closeStream(metadataIn); } }
/** * Get block checksum (MD5 of CRC32). * @param in */
Get block checksum (MD5 of CRC32)
getBlockChecksum
{ "repo_name": "submergerock/avatar-hadoop", "path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataXceiver.java", "license": "apache-2.0", "size": 24637 }
[ "java.io.BufferedInputStream", "java.io.DataInputStream", "java.io.DataOutputStream", "java.io.IOException", "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.protocol.DataTransferProtocol", "org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface", "org.apache.hadoop.io.IOUtils", "org.apache.hadoop.io.MD5Hash", "org.apache.hadoop.net.NetUtils", "org.apache.hadoop.util.DataChecksum" ]
import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DataTransferProtocol; import org.apache.hadoop.hdfs.server.datanode.FSDatasetInterface; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.io.MD5Hash; import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.util.DataChecksum;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.datanode.*; import org.apache.hadoop.io.*; import org.apache.hadoop.net.*; import org.apache.hadoop.util.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,075,799
public static Properties loadProperties(String filename) { Properties props = new NonOverrideableProperties(); try { ClassLoader loader = PropertiesUtil.class.getClassLoader(); InputStream is = loader.getResourceAsStream(filename); if (is == null) { LOG.error("Could not find file " + filename + " from " + loader); return null; } props.load(is); is.close(); } catch (IOException e) { throw new RuntimeException("Failed to load :" + filename, e); } return props; }
static Properties function(String filename) { Properties props = new NonOverrideableProperties(); try { ClassLoader loader = PropertiesUtil.class.getClassLoader(); InputStream is = loader.getResourceAsStream(filename); if (is == null) { LOG.error(STR + filename + STR + loader); return null; } props.load(is); is.close(); } catch (IOException e) { throw new RuntimeException(STR + filename, e); } return props; }
/** * Load a specified properties file * @param filename the filename of the properties file * @return the corresponding Properties object */
Load a specified properties file
loadProperties
{ "repo_name": "zebrafishmine/intermine", "path": "intermine/objectstore/main/src/org/intermine/util/PropertiesUtil.java", "license": "lgpl-2.1", "size": 6006 }
[ "java.io.IOException", "java.io.InputStream", "java.util.Properties", "org.intermine.metadata.NonOverrideableProperties" ]
import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.intermine.metadata.NonOverrideableProperties;
import java.io.*; import java.util.*; import org.intermine.metadata.*;
[ "java.io", "java.util", "org.intermine.metadata" ]
java.io; java.util; org.intermine.metadata;
2,760,984
@Beta(SinceVersion.V1_1_0) @Method Update withoutAnyDisabledSslProtocols(); } } interface Update extends Appliable<ApplicationGateway>, Resource.UpdateWithTags<Update>, UpdateStages.WithSize, UpdateStages.WithInstanceCount, UpdateStages.WithBackend, UpdateStages.WithBackendHttpConfig, UpdateStages.WithIPConfig, UpdateStages.WithFrontend, UpdateStages.WithPublicIPAddress, UpdateStages.WithFrontendPort, UpdateStages.WithSslCert, UpdateStages.WithListener, UpdateStages.WithRequestRoutingRule, UpdateStages.WithExistingSubnet, UpdateStages.WithProbe, UpdateStages.WithDisabledSslProtocol { }
@Beta(SinceVersion.V1_1_0) Update withoutAnyDisabledSslProtocols(); } } interface Update extends Appliable<ApplicationGateway>, Resource.UpdateWithTags<Update>, UpdateStages.WithSize, UpdateStages.WithInstanceCount, UpdateStages.WithBackend, UpdateStages.WithBackendHttpConfig, UpdateStages.WithIPConfig, UpdateStages.WithFrontend, UpdateStages.WithPublicIPAddress, UpdateStages.WithFrontendPort, UpdateStages.WithSslCert, UpdateStages.WithListener, UpdateStages.WithRequestRoutingRule, UpdateStages.WithExistingSubnet, UpdateStages.WithProbe, UpdateStages.WithDisabledSslProtocol { }
/** * Enables all SSL protocols, if previously disabled. * @return the next stage of the update */
Enables all SSL protocols, if previously disabled
withoutAnyDisabledSslProtocols
{ "repo_name": "jianghaolu/azure-sdk-for-java", "path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/ApplicationGateway.java", "license": "mit", "size": 39538 }
[ "com.microsoft.azure.management.apigeneration.Beta", "com.microsoft.azure.management.resources.fluentcore.arm.models.Resource", "com.microsoft.azure.management.resources.fluentcore.model.Appliable" ]
import com.microsoft.azure.management.apigeneration.Beta; import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
import com.microsoft.azure.management.apigeneration.*; import com.microsoft.azure.management.resources.fluentcore.arm.models.*; import com.microsoft.azure.management.resources.fluentcore.model.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
2,524,211
void flush() throws IOException;
void flush() throws IOException;
/** * Flushes any modified file system structures to the underlying storage. * * @throws IOException */
Flushes any modified file system structures to the underlying storage
flush
{ "repo_name": "compilelab/obb-storage", "path": "lib-fat32/src/main/java/de/waldheinz/fs/FileSystem.java", "license": "apache-2.0", "size": 2895 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,800,647
public static void setHasPart(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Thing value) { Base.set(model, instanceResource, HASPART, value); }
static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, Thing value) { Base.set(model, instanceResource, HASPART, value); }
/** * Sets a value of property HasPart from an instance of Thing First, all * existing values are removed, then this value is added. Cardinality * constraints are not checked, but this method exists only for properties * with no minCardinality or minCardinality == 1. * * @param model * an RDF2Go model * @param resource * an RDF2Go resource * @param value * the value to be added * * [Generated from RDFReactor template rule #set3static] */
Sets a value of property HasPart from an instance of Thing First, all existing values are removed, then this value is added. Cardinality constraints are not checked, but this method exists only for properties with no minCardinality or minCardinality == 1
setHasPart
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc/src/main/java/org/rdfs/sioc/Thing.java", "license": "mit", "size": 317844 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
1,084,165
public void submit() { // Lookup a reference for the account business interface LifetimeAccountService service = ServiceLocator.findLifetimeAccountService(); if (service != null) { // Call backend to register with the collected and verified data boolean successfullRegistration = service.register(firstname.getValue(), lastname.getValue(), email.getValue(), Util.getEncodedPassword(password.getValue()), defaultLanguage.getValue().toString(), birthDate.getValue(), birthPlace.getValue()); // Upon successfull registration, return to the welcome page if (successfullRegistration) { Notification.show("Registration concluded.", Notification.Type.TRAY_NOTIFICATION); getUI().getNavigator().navigateTo(Navigation.WELCOME_VIEW.getName()); } else { Notification.show("Registration failed. Try again later.", Notification.Type.WARNING_MESSAGE); } } }
void function() { LifetimeAccountService service = ServiceLocator.findLifetimeAccountService(); if (service != null) { boolean successfullRegistration = service.register(firstname.getValue(), lastname.getValue(), email.getValue(), Util.getEncodedPassword(password.getValue()), defaultLanguage.getValue().toString(), birthDate.getValue(), birthPlace.getValue()); if (successfullRegistration) { Notification.show(STR, Notification.Type.TRAY_NOTIFICATION); getUI().getNavigator().navigateTo(Navigation.WELCOME_VIEW.getName()); } else { Notification.show(STR, Notification.Type.WARNING_MESSAGE); } } }
/** * Submits the registration form, issuing a register request to the backend. */
Submits the registration form, issuing a register request to the backend
submit
{ "repo_name": "zuacaldeira/lifetime", "path": "lifetime-ui/src/main/java/lifetime/component/welcome/register/RegistrationForm.java", "license": "unlicense", "size": 8209 }
[ "com.vaadin.ui.Notification" ]
import com.vaadin.ui.Notification;
import com.vaadin.ui.*;
[ "com.vaadin.ui" ]
com.vaadin.ui;
1,963,493
// If we don't need to refresh and we have a recent enough version, just use that. if (!reload && regions != null && regionsFetchTimeMillis + MAX_REGION_AGE_MILLIS > System.currentTimeMillis()) { return regions; } SampleRowKeysRequest.Builder request = SampleRowKeysRequest.newBuilder(); request.setTableName(bigtableTableName.toString()); LOG.debug("Sampling rowkeys for table %s", request.getTableName()); try { ImmutableList<SampleRowKeysResponse> responses = client.sampleRowKeys(request.build()); regions = adapter.adaptResponse(responses); regionsFetchTimeMillis = System.currentTimeMillis(); return regions; } catch(Throwable throwable) { regions = null; throw new IOException("Error sampling rowkeys.", throwable); } }
if (!reload && regions != null && regionsFetchTimeMillis + MAX_REGION_AGE_MILLIS > System.currentTimeMillis()) { return regions; } SampleRowKeysRequest.Builder request = SampleRowKeysRequest.newBuilder(); request.setTableName(bigtableTableName.toString()); LOG.debug(STR, request.getTableName()); try { ImmutableList<SampleRowKeysResponse> responses = client.sampleRowKeys(request.build()); regions = adapter.adaptResponse(responses); regionsFetchTimeMillis = System.currentTimeMillis(); return regions; } catch(Throwable throwable) { regions = null; throw new IOException(STR, throwable); } }
/** * The list of regions will be sorted and cover all the possible rows. */
The list of regions will be sorted and cover all the possible rows
getRegions
{ "repo_name": "rameshdharan/cloud-bigtable-client", "path": "bigtable-hbase-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableRegionLocator.java", "license": "apache-2.0", "size": 5503 }
[ "com.google.bigtable.v2.SampleRowKeysRequest", "com.google.bigtable.v2.SampleRowKeysResponse", "com.google.common.collect.ImmutableList", "java.io.IOException" ]
import com.google.bigtable.v2.SampleRowKeysRequest; import com.google.bigtable.v2.SampleRowKeysResponse; import com.google.common.collect.ImmutableList; import java.io.IOException;
import com.google.bigtable.v2.*; import com.google.common.collect.*; import java.io.*;
[ "com.google.bigtable", "com.google.common", "java.io" ]
com.google.bigtable; com.google.common; java.io;
1,892,869
@ServiceMethod(returns = ReturnType.SINGLE) public MicrosoftGraphTodoTaskListInner getLists(String userId, String todoTaskListId) { final List<UsersTodoSelect> select = null; final List<UsersTodoExpand> expand = null; return getListsAsync(userId, todoTaskListId, select, expand).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) MicrosoftGraphTodoTaskListInner function(String userId, String todoTaskListId) { final List<UsersTodoSelect> select = null; final List<UsersTodoExpand> expand = null; return getListsAsync(userId, todoTaskListId, select, expand).block(); }
/** * Get lists from users. * * @param userId key: id of user. * @param todoTaskListId key: id of todoTaskList. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws OdataErrorMainException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return lists from users. */
Get lists from users
getLists
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/implementation/UsersTodosClientImpl.java", "license": "mit", "size": 48043 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphTodoTaskListInner", "com.azure.resourcemanager.authorization.fluent.models.UsersTodoExpand", "com.azure.resourcemanager.authorization.fluent.models.UsersTodoSelect", "java.util.List" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphTodoTaskListInner; import com.azure.resourcemanager.authorization.fluent.models.UsersTodoExpand; import com.azure.resourcemanager.authorization.fluent.models.UsersTodoSelect; import java.util.List;
import com.azure.core.annotation.*; import com.azure.resourcemanager.authorization.fluent.models.*; import java.util.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.util" ]
com.azure.core; com.azure.resourcemanager; java.util;
2,225,474
public static String commandQuery(Connection conn, String query, boolean showHeaders, String separator, boolean showMetaData) { final String NEWLINE = System.getProperty("line.separator"); StringWriter resp = new StringWriter(); Statement stmt = null; try { stmt = conn.createStatement(); boolean executed = stmt.execute(query); if (executed) { ResultSet rs = stmt.getResultSet(); ResultSetMetaData rsmd = rs.getMetaData(); if (showHeaders) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { resp.append(rsmd.getColumnName(i) + separator); } resp.append(NEWLINE); } if (showMetaData) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { String scale = ""; if (rsmd.getScale(i) != 0) { scale = "," + rsmd.getScale(i); } resp.append(rsmd.getColumnTypeName(i) + "(" + rsmd.getPrecision(i) + "" + scale + ")" + separator); } resp.append(NEWLINE); } while (rs.next()) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { resp.append(rs.getString(i) + separator); } resp.append(NEWLINE); } } else { stmt.getUpdateCount(); } } catch (Exception e) { e.printStackTrace(); } finally { try { stmt.close(); } catch (SQLException ex) { } } return resp.toString(); }
static String function(Connection conn, String query, boolean showHeaders, String separator, boolean showMetaData) { final String NEWLINE = System.getProperty(STR); StringWriter resp = new StringWriter(); Statement stmt = null; try { stmt = conn.createStatement(); boolean executed = stmt.execute(query); if (executed) { ResultSet rs = stmt.getResultSet(); ResultSetMetaData rsmd = rs.getMetaData(); if (showHeaders) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { resp.append(rsmd.getColumnName(i) + separator); } resp.append(NEWLINE); } if (showMetaData) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { String scale = STR,STR(STRSTR)" + separator); } resp.append(NEWLINE); } while (rs.next()) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { resp.append(rs.getString(i) + separator); } resp.append(NEWLINE); } } else { stmt.getUpdateCount(); } } catch (Exception e) { e.printStackTrace(); } finally { try { stmt.close(); } catch (SQLException ex) { } } return resp.toString(); }
/** * Performs a sql Query and returns the result */
Performs a sql Query and returns the result
commandQuery
{ "repo_name": "nikox94/JDBCSQLtool", "path": "src/CommandQuery.java", "license": "mit", "size": 6567 }
[ "java.io.StringWriter", "java.sql.Connection", "java.sql.ResultSet", "java.sql.ResultSetMetaData", "java.sql.SQLException", "java.sql.Statement" ]
import java.io.StringWriter; import java.sql.Connection; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
587,690
public static Path moveAsideBadEditsFile(final FileSystem fs, final Path edits) throws IOException { Path moveAsideName = new Path(edits.getParent(), edits.getName() + "." + System.currentTimeMillis()); if (!fs.rename(edits, moveAsideName)) { LOG.warn("Rename failed from " + edits + " to " + moveAsideName); } return moveAsideName; } private static final String SEQUENCE_ID_FILE_SUFFIX = ".seqid"; private static final String OLD_SEQUENCE_ID_FILE_SUFFIX = "_seqid"; private static final int SEQUENCE_ID_FILE_SUFFIX_LENGTH = SEQUENCE_ID_FILE_SUFFIX.length();
static Path function(final FileSystem fs, final Path edits) throws IOException { Path moveAsideName = new Path(edits.getParent(), edits.getName() + "." + System.currentTimeMillis()); if (!fs.rename(edits, moveAsideName)) { LOG.warn(STR + edits + STR + moveAsideName); } return moveAsideName; } private static final String SEQUENCE_ID_FILE_SUFFIX = STR; private static final String OLD_SEQUENCE_ID_FILE_SUFFIX = STR; private static final int SEQUENCE_ID_FILE_SUFFIX_LENGTH = SEQUENCE_ID_FILE_SUFFIX.length();
/** * Move aside a bad edits file. * * @param fs * @param edits * Edits file to move aside. * @return The name of the moved aside file. * @throws IOException */
Move aside a bad edits file
moveAsideBadEditsFile
{ "repo_name": "toshimasa-nasu/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java", "license": "apache-2.0", "size": 82681 }
[ "java.io.IOException", "org.apache.hadoop.fs.FileSystem", "org.apache.hadoop.fs.Path" ]
import java.io.IOException; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path;
import java.io.*; import org.apache.hadoop.fs.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,953,160
public YangString getRegisterNameValue() throws JNCException { return (YangString)getValue("register-name"); }
YangString function() throws JNCException { return (YangString)getValue(STR); }
/** * Gets the value for child leaf "register-name". * @return The value of the leaf. */
Gets the value for child leaf "register-name"
getRegisterNameValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/statistics/gprsMm/IrauFail.java", "license": "apache-2.0", "size": 11353 }
[ "com.tailf.jnc.YangString" ]
import com.tailf.jnc.YangString;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
8,331
private static CubicCurve2D.Double makeline(double x1, double y1, double x2, double y2) { return new CubicCurve2D.Double(x1, y1, (x2 - x1) * 0.3 + x1, (y2 - y1) * 0.3 + y1, (x2 - x1) * 0.6 + x1, (y2 - y1) * 0.6 + y1, x2, y2); }
static CubicCurve2D.Double function(double x1, double y1, double x2, double y2) { return new CubicCurve2D.Double(x1, y1, (x2 - x1) * 0.3 + x1, (y2 - y1) * 0.3 + y1, (x2 - x1) * 0.6 + x1, (y2 - y1) * 0.6 + y1, x2, y2); }
/** * Produce a cubic bezier curve representing a straightline segment from (x1,y1) * to (x2,y2) */
Produce a cubic bezier curve representing a straightline segment from (x1,y1) to (x2,y2)
makeline
{ "repo_name": "AlloyTools/org.alloytools.alloy", "path": "org.alloytools.alloy.application/src/main/java/edu/mit/csail/sdg/alloy4graph/Curve.java", "license": "apache-2.0", "size": 10589 }
[ "java.awt.geom.CubicCurve2D" ]
import java.awt.geom.CubicCurve2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,727,218
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; }
AxisAlignedBB function(World par1World, int par2, int par3, int par4) { return null; }
/** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */
Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been cleared to be reused)
getCollisionBoundingBoxFromPool
{ "repo_name": "MinecraftModArchive/Runes-And-Silver", "path": "src/main/java/Runes/Blocks/LuminShroomBlock.java", "license": "lgpl-3.0", "size": 4731 }
[ "net.minecraft.util.AxisAlignedBB", "net.minecraft.world.World" ]
import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World;
import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.util; net.minecraft.world;
1,108,749
public static void bonus(final boolean bForce) { if (bForce || random.nextInt(GraphicManager.BONUS_SPAWN_RATE) == 5) { // add a new bonus to get more lifes only if we have less than 3 // lifes int nextInt, iNBonus = Entity.BonusType.values().length; if (iBonus == -1) nextInt = random.nextInt(iNBonus + 2); // 2 lifes else nextInt = iBonus; switch (nextInt) { case 0: if (GlobalSettings.PROFILE.getNbLifes() < GlobalSettings.MAX_LIFES && canEnabledBonus("life")) { graphicManager.addBody(new Bonus(0, "bonus/heart/heart.png", "bonus/heart/heart.json", "heart", Entity.BonusType.LIVE_UP)); break; } case 1: if (canEnabledBonus("speed")) { graphicManager.addBody(new Bonus(0, "bonus/speed/speed_low.png", "bonus/speed/speed_low.json", "speed_low", Entity.BonusType.SPEED_LOW)); break; } case 2: if (canEnabledBonus("invincible")) { graphicManager.addBody(new Bonus(0, "bonus/invincible/invincible.png", "bonus/invincible/invincible.json", "invincible", Entity.BonusType.INVINCIBLE)); break; } case 3: if (canEnabledBonus("elast")) { graphicManager .addBody(new Bonus(0, "bonus/elasticity/elasticity_high.png", "bonus/elasticity/elasticity_high.json", "elasticity_high", Entity.BonusType.ELASTICITY_HIGH)); break; } case 4: if (canEnabledBonus("weight")) { graphicManager.addBody(new Bonus(0, "bonus/weight/weight_high.png", "bonus/weight/weight_high.json", "weight_high", Entity.BonusType.WEIGHT_HIGH)); break; } case 5: if (canEnabledBonus("timedown")) { graphicManager.addBody(new Bonus(0, "bonus/time/timedown.png", "bonus/time/timedown.json", "timedown", Entity.BonusType.TIME_DOWN)); break; } case 6: if (canEnabledBonus("weight")) { graphicManager.addBody(new Bonus(0, "bonus/weight/weight_low.png", "bonus/weight/weight_low.json", "weight_low", Entity.BonusType.WEIGHT_LOW)); break; } case 7: if (GlobalSettings.PROFILE.getNbLifes() < GlobalSettings.MAX_LIFES && canEnabledBonus("life")) { graphicManager.addBody(new Bonus(0, "bonus/heart/heart.png", "bonus/heart/heart.json", "heart", Entity.BonusType.LIVE_UP)); break; } case 8: if (canEnabledBonus("elast")) { graphicManager.addBody(new Bonus(0, "bonus/elasticity/elasticity_low.png", "bonus/elasticity/elasticity_low.json", "elasticity_low", Entity.BonusType.ELASTICITY_LOW)); break; } case 9: if (canEnabledBonus("speed")) { graphicManager.addBody(new Bonus(0, "bonus/speed/speed_high.png", "bonus/speed/speed_high.json", "speed_high", Entity.BonusType.SPEED_HIGH)); break; } case 10: if (canEnabledBonus("invisible")) { graphicManager.addBody(new Bonus(0, "bonus/invisible/invisible.png", "bonus/invisible/invisible.json", "invisible", Entity.BonusType.INVISIBLE)); break; } case 11: if (canEnabledBonus("timeup")) { graphicManager.addBody(new Bonus(0, "bonus/time/timeup.png", "bonus/time/timeup.json", "timeup", Entity.BonusType.TIME_UP)); break; } case 12: if (canEnabledBonus("inverse")) { graphicManager.addBody(new Bonus(0, "bonus/inverse/inverse.png", "bonus/inverse/inverse.json", "inverse", Entity.BonusType.INVERSE)); break; } default: if (canEnabledBonus("star")) { graphicManager.addBody(new Bonus(0, "bonus/star/star.png", "bonus/star/star.json", "star", Entity.BonusType.POINT)); break; } } } }
static void function(final boolean bForce) { if (bForce random.nextInt(GraphicManager.BONUS_SPAWN_RATE) == 5) { int nextInt, iNBonus = Entity.BonusType.values().length; if (iBonus == -1) nextInt = random.nextInt(iNBonus + 2); else nextInt = iBonus; switch (nextInt) { case 0: if (GlobalSettings.PROFILE.getNbLifes() < GlobalSettings.MAX_LIFES && canEnabledBonus("life")) { graphicManager.addBody(new Bonus(0, STR, STR, "heart", Entity.BonusType.LIVE_UP)); break; } case 1: if (canEnabledBonus("speed")) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.SPEED_LOW)); break; } case 2: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.INVINCIBLE)); break; } case 3: if (canEnabledBonus("elast")) { graphicManager .addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.ELASTICITY_HIGH)); break; } case 4: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.WEIGHT_HIGH)); break; } case 5: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.TIME_DOWN)); break; } case 6: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.WEIGHT_LOW)); break; } case 7: if (GlobalSettings.PROFILE.getNbLifes() < GlobalSettings.MAX_LIFES && canEnabledBonus("life")) { graphicManager.addBody(new Bonus(0, STR, STR, "heart", Entity.BonusType.LIVE_UP)); break; } case 8: if (canEnabledBonus("elast")) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.ELASTICITY_LOW)); break; } case 9: if (canEnabledBonus("speed")) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.SPEED_HIGH)); break; } case 10: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.INVISIBLE)); break; } case 11: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.TIME_UP)); break; } case 12: if (canEnabledBonus(STR)) { graphicManager.addBody(new Bonus(0, STR, STR, STR, Entity.BonusType.INVERSE)); break; } default: if (canEnabledBonus("star")) { graphicManager.addBody(new Bonus(0, STR, STR, "star", Entity.BonusType.POINT)); break; } } } }
/** * Create a Bonus instance in the GraphicManager if the spawn rate is * reached * * private void bonus() */
Create a Bonus instance in the GraphicManager if the spawn rate is reached private void bonus()
bonus
{ "repo_name": "matttbe/bouboule", "path": "Bouboule/src/be/ac/ucl/lfsab1509/bouboule/game/gameManager/GameLoop.java", "license": "gpl-3.0", "size": 14976 }
[ "be.ac.ucl.lfsab1509.bouboule.game.body.Bonus", "be.ac.ucl.lfsab1509.bouboule.game.entity.Entity" ]
import be.ac.ucl.lfsab1509.bouboule.game.body.Bonus; import be.ac.ucl.lfsab1509.bouboule.game.entity.Entity;
import be.ac.ucl.lfsab1509.bouboule.game.body.*; import be.ac.ucl.lfsab1509.bouboule.game.entity.*;
[ "be.ac.ucl" ]
be.ac.ucl;
2,683,986
void setSystemGestureExclusionRects(@NonNull ArrayList<Rect> rects); } public enum SoundType { CLICK("SystemSoundType.click");
void setSystemGestureExclusionRects(@NonNull ArrayList<Rect> rects); } public enum SoundType { CLICK(STR);
/** * The Flutter application would like to set the system gesture exclusion rects through the * given {@code rects}. */
The Flutter application would like to set the system gesture exclusion rects through the given rects
setSystemGestureExclusionRects
{ "repo_name": "mikejurka/engine", "path": "shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java", "license": "bsd-3-clause", "size": 28716 }
[ "android.graphics.Rect", "android.support.annotation.NonNull", "java.util.ArrayList" ]
import android.graphics.Rect; import android.support.annotation.NonNull; import java.util.ArrayList;
import android.graphics.*; import android.support.annotation.*; import java.util.*;
[ "android.graphics", "android.support", "java.util" ]
android.graphics; android.support; java.util;
138,981
private static void initializeScope(ScriptEngine engine, ScriptScopeProvider provider) { if (engine.getFactory().getEngineName().toLowerCase().endsWith("nashorn")) { initializeNashornScope(engine, provider); } else { initializeGeneralScope(engine, provider); } } /** * initializes Globals for Oracle Nashorn in conjunction with Java 8 * * To prevent Class loading Problems use this directive: -Dorg.osgi.framework.bundle.parent=ext * further information: * http://apache-felix.18485.x6.nabble.com/org-osgi-framework-bootdelegation-and-org-osgi-framework-system-packages- * extra-td4946354.html * https://bugs.eclipse.org/bugs/show_bug.cgi?id=466683 * http://spring.io/blog/2009/01/19/exposing-the-boot-classpath-in-osgi/ * http://osdir.com/ml/users-felix-apache/2015-02/msg00067.html * http://stackoverflow.com/questions/30225398/java-8-scriptengine-across-classloaders * * later we will get auto imports for Classes in Nashorn: * further information: * http://nashorn.36665.n7.nabble.com/8u60-8085937-add-autoimports-sample-script-to-easily-explore-Java-classes-in- * interactive-mode-td4705.html * * Later in a pure Java 8/9 environment: * http://mail.openjdk.java.net/pipermail/nashorn-dev/2015-February/004177.html * Using Nashorn with interfaces loaded from custom classloaders, "script function" as a Java lambda: * * engine.put("JavaClass", (Function<String, Class>) * s -> { * try { * // replace this whatever Class finding logic here * // say, using your own class loader(s) based search * Class<?> c = Class.forName(s); * logger.error("Class " + c.getName()); * logger.error("s " + s); * return Class.forName(s); * } catch (ClassNotFoundException cnfe) { * throw new RuntimeException(cnfe); * }
static void function(ScriptEngine engine, ScriptScopeProvider provider) { if (engine.getFactory().getEngineName().toLowerCase().endsWith(STR)) { initializeNashornScope(engine, provider); } else { initializeGeneralScope(engine, provider); } } /** * initializes Globals for Oracle Nashorn in conjunction with Java 8 * * To prevent Class loading Problems use this directive: -Dorg.osgi.framework.bundle.parent=ext * further information: * http: * extra-td4946354.html * https: * http: * http: * http: * * later we will get auto imports for Classes in Nashorn: * further information: * http: * interactive-mode-td4705.html * * Later in a pure Java 8/9 environment: * http: * Using Nashorn with interfaces loaded from custom classloaders, STR as a Java lambda: * * engine.put(STR, (Function<String, Class>) * s -> { * try { * * * Class<?> c = Class.forName(s); * logger.error(STR + c.getName()); * logger.error(STR + s); * return Class.forName(s); * } catch (ClassNotFoundException cnfe) { * throw new RuntimeException(cnfe); * }
/** * Adds elements from a provider to the engine scope * * @param engine the script engine to initialize * @param provider the provider holding the elements that should be added to the scope */
Adds elements from a provider to the engine scope
initializeScope
{ "repo_name": "CrackerStealth/smarthome", "path": "bundles/automation/org.eclipse.smarthome.automation.module.script/src/main/java/org/eclipse/smarthome/automation/module/script/internal/ScriptModuleActivator.java", "license": "epl-1.0", "size": 10925 }
[ "javax.script.ScriptEngine", "org.eclipse.smarthome.automation.module.script.ScriptScopeProvider" ]
import javax.script.ScriptEngine; import org.eclipse.smarthome.automation.module.script.ScriptScopeProvider;
import javax.script.*; import org.eclipse.smarthome.automation.module.script.*;
[ "javax.script", "org.eclipse.smarthome" ]
javax.script; org.eclipse.smarthome;
488,850
public void testParseMonth() { Month month = null; // test 1... try { month = Month.parseMonth("1990-01"); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(1, month.getMonth()); assertEquals(1990, month.getYear().getYear()); // test 2... try { month = Month.parseMonth("02-1991"); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(2, month.getMonth()); assertEquals(1991, month.getYear().getYear()); // test 3... try { month = Month.parseMonth("March 1993"); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(3, month.getMonth()); assertEquals(1993, month.getYear().getYear()); }
void function() { Month month = null; try { month = Month.parseMonth(STR); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(1, month.getMonth()); assertEquals(1990, month.getYear().getYear()); try { month = Month.parseMonth(STR); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(2, month.getMonth()); assertEquals(1991, month.getYear().getYear()); try { month = Month.parseMonth(STR); } catch (TimePeriodFormatException e) { month = new Month(1, 1900); } assertEquals(3, month.getMonth()); assertEquals(1993, month.getYear().getYear()); }
/** * Tests the string parsing code... */
Tests the string parsing code..
testParseMonth
{ "repo_name": "SpoonLabs/astor", "path": "examples/chart_11/tests/org/jfree/data/time/junit/MonthTests.java", "license": "gpl-2.0", "size": 13804 }
[ "org.jfree.data.time.Month", "org.jfree.data.time.TimePeriodFormatException" ]
import org.jfree.data.time.Month; import org.jfree.data.time.TimePeriodFormatException;
import org.jfree.data.time.*;
[ "org.jfree.data" ]
org.jfree.data;
884,475
Type getExceptionType();
Type getExceptionType();
/** * Obtains the handled event type. */
Obtains the handled event type
getExceptionType
{ "repo_name": "os890/deltaspike-vote", "path": "deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/exception/control/HandlerMethod.java", "license": "apache-2.0", "size": 2609 }
[ "java.lang.reflect.Type" ]
import java.lang.reflect.Type;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
283,443
AnalyzeRequestBuilder prepareAnalyze(String text);
AnalyzeRequestBuilder prepareAnalyze(String text);
/** * Analyze text. * * @param text The text to analyze */
Analyze text
prepareAnalyze
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/client/IndicesAdminClient.java", "license": "apache-2.0", "size": 26479 }
[ "org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder" ]
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequestBuilder;
import org.elasticsearch.action.admin.indices.analyze.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
1,814,360
public final void calibrate(final BigDecimal targetRead) { BigDecimal tolerance = new BigDecimal(0.3); this.offset = BigDecimal.ZERO; BigDecimal currentValue = this.calcPhValue(); if (currentValue.subtract(targetRead).abs() .compareTo(tolerance) > 0) { // We're outside of the tolerance. So Set the offset. offset = targetRead.subtract(currentValue); } // Verify we're good currentValue = this.calcPhValue(); if (currentValue.subtract(targetRead).plus() .compareTo(tolerance) > 0) { LaunchControl.setMessage("Failed to calibrate. Difference is: " + currentValue.subtract(targetRead)); } }
final void function(final BigDecimal targetRead) { BigDecimal tolerance = new BigDecimal(0.3); this.offset = BigDecimal.ZERO; BigDecimal currentValue = this.calcPhValue(); if (currentValue.subtract(targetRead).abs() .compareTo(tolerance) > 0) { offset = targetRead.subtract(currentValue); } currentValue = this.calcPhValue(); if (currentValue.subtract(targetRead).plus() .compareTo(tolerance) > 0) { LaunchControl.setMessage(STR + currentValue.subtract(targetRead)); } }
/** * Calibrate the Probe and calculate the offset. * @param targetRead The pH of the solution being measured. */
Calibrate the Probe and calculate the offset
calibrate
{ "repo_name": "dbayub/SB_Elsinore_Server", "path": "src/main/java/com/sb/elsinore/inputs/PhSensor.java", "license": "mit", "size": 12577 }
[ "com.sb.elsinore.LaunchControl", "java.math.BigDecimal" ]
import com.sb.elsinore.LaunchControl; import java.math.BigDecimal;
import com.sb.elsinore.*; import java.math.*;
[ "com.sb.elsinore", "java.math" ]
com.sb.elsinore; java.math;
808,308
private void handleNow() { Log.d(TAG, "Short lived task is done."); }
void function() { Log.d(TAG, STR); }
/** * Handle time allotted to BroadcastReceivers. */
Handle time allotted to BroadcastReceivers
handleNow
{ "repo_name": "trientran/Give-Lives-Android", "path": "app/src/main/java/net/givelives/givelives/MyFirebaseMessagingService.java", "license": "apache-2.0", "size": 5446 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
942,818
public static List<String> formatObjectTooltip(DataObject object) { if (object == null) return null; if (!(object instanceof ImageData || object instanceof WellSampleData || object instanceof PlateData || object instanceof WellData)) return null; List<String> l = new ArrayList<String>(); String v; ImageData img = null; if (object instanceof ImageData) img = (ImageData) object; else if (object instanceof WellSampleData) { img = ((WellSampleData) object).getImage(); } else if (object instanceof PlateData) { PlateData plate = (PlateData) object; v = plate.getPlateType(); if (v != null && v.trim().length() > 0) { v = "<b>"+TYPE+": </b>"+v; l.add(v); } v = plate.getExternalIdentifier(); if (v != null && v.trim().length() > 0) { v = "<b>"+EXTERNAL_IDENTIFIER+": </b>"+v; l.add(v); } v = plate.getStatus(); if (v != null && v.trim().length() > 0) { v = "<b>"+STATUS+": </b>"+v; l.add(v); } } else if (object instanceof WellData) { WellData well = (WellData) object; v = well.getWellType(); if (v != null && v.trim().length() > 0) { v = "<b>"+TYPE+": </b>"+v; l.add(v); } v = well.getExternalDescription(); if (v != null && v.trim().length() > 0) { v = "<b>"+EXTERNAL_IDENTIFIER+": </b>"+v; l.add(v); } v = well.getStatus(); if (v != null && v.trim().length() > 0) { v = "<b>"+STATUS+": </b>"+v; l.add(v); } } if (img == null) return l; v = "<b>"+ACQUISITION_DATE+": </b>"+formatDate(img); l.add(v); try { v = "<b>"+IMPORTED_DATE+": </b>"+ UIUtilities.formatDefaultDate(img.getInserted()); l.add(v); } catch (Exception e) {} PixelsData data = null; try { data = img.getDefaultPixels(); } catch (Exception e) {} if (data == null) return l; Map details = transformPixelsData(data); v = "<b>"+XY_DIMENSION+": </b>"; v += (String) details.get(SIZE_X); v += " x "; v += (String) details.get(SIZE_Y); l.add(v); v = "<b>"+PIXEL_TYPE+": </b>"+details.get(PIXEL_TYPE); l.add(v); v = formatPixelsSize(details); if (v != null) l.add(v); v = "<b>ZxTxC: </b>"; v += (String) details.get(SECTIONS); v += " x "; v += (String) details.get(TIMEPOINTS); v += " x "; v += (String) details.get(CHANNELS); l.add(v); return l; }
static List<String> function(DataObject object) { if (object == null) return null; if (!(object instanceof ImageData object instanceof WellSampleData object instanceof PlateData object instanceof WellData)) return null; List<String> l = new ArrayList<String>(); String v; ImageData img = null; if (object instanceof ImageData) img = (ImageData) object; else if (object instanceof WellSampleData) { img = ((WellSampleData) object).getImage(); } else if (object instanceof PlateData) { PlateData plate = (PlateData) object; v = plate.getPlateType(); if (v != null && v.trim().length() > 0) { v = "<b>"+TYPE+STR+v; l.add(v); } v = plate.getExternalIdentifier(); if (v != null && v.trim().length() > 0) { v = "<b>"+EXTERNAL_IDENTIFIER+STR+v; l.add(v); } v = plate.getStatus(); if (v != null && v.trim().length() > 0) { v = "<b>"+STATUS+STR+v; l.add(v); } } else if (object instanceof WellData) { WellData well = (WellData) object; v = well.getWellType(); if (v != null && v.trim().length() > 0) { v = "<b>"+TYPE+STR+v; l.add(v); } v = well.getExternalDescription(); if (v != null && v.trim().length() > 0) { v = "<b>"+EXTERNAL_IDENTIFIER+STR+v; l.add(v); } v = well.getStatus(); if (v != null && v.trim().length() > 0) { v = "<b>"+STATUS+STR+v; l.add(v); } } if (img == null) return l; v = "<b>"+ACQUISITION_DATE+STR+formatDate(img); l.add(v); try { v = "<b>"+IMPORTED_DATE+STR+ UIUtilities.formatDefaultDate(img.getInserted()); l.add(v); } catch (Exception e) {} PixelsData data = null; try { data = img.getDefaultPixels(); } catch (Exception e) {} if (data == null) return l; Map details = transformPixelsData(data); v = "<b>"+XY_DIMENSION+STR; v += (String) details.get(SIZE_X); v += STR; v += (String) details.get(SIZE_Y); l.add(v); v = "<b>"+PIXEL_TYPE+STR+details.get(PIXEL_TYPE); l.add(v); v = formatPixelsSize(details); if (v != null) l.add(v); v = STR; v += (String) details.get(SECTIONS); v += STR; v += (String) details.get(TIMEPOINTS); v += STR; v += (String) details.get(CHANNELS); l.add(v); return l; }
/** * Formats the tooltip for an image. * * @param object The object to handle. * @return See above. */
Formats the tooltip for an image
formatObjectTooltip
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/EditorUtil.java", "license": "gpl-2.0", "size": 91785 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "org.openmicroscopy.shoola.util.ui.UIUtilities" ]
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.openmicroscopy.shoola.util.ui.UIUtilities;
import java.util.*; import org.openmicroscopy.shoola.util.ui.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
2,672,875
super.registerForClick(AdaptableSignupIds.AdaptableSignupSignup, new AIEventListener<AdaptableSignupCriteria>(criteria) { @Override protected void onFire(Event evt) { final Email email = criteria.getInviteData().getEmail(); if (email.valid()) { final HumanId invitee = new HumanId(email.getObj()); if (!DB.getHumanCRUDHumanLocal(false).doDirtyIsHumansNetPeople(criteria.getHumanId(), invitee).returnValue()) { if (!criteria.getHumanId().getHumanId().equals(email.getObj())) { Return<Boolean> r = DB.getHumanCRUDHumanLocal(true).doNTxAddHumansNetPeople(criteria.getHumanId(), invitee); if (r.valid()) { $$(AdaptableSignupIds.AdaptableSignupNoti).setTextContent(MessageFormat.format(RBGet.gui().getString(INVITED_ADDED_0), email)); $$(AdaptableSignupIds.AdaptableSignupEmail).setAttribute(MarkupTag.INPUT.value(), ""); final String notification = criteria.getAdaptableSignupCallback().afterInvite(invitee); notifyUser(notification); $$sendJS(criteria.getAdaptableSignupCallback().jsToSend(invitee)); } else { notifyUser(RBGet.gui().getString(COULD_NOT_INVITE_AND_ADD_TRY_AGAIN)); } } else { notifyUser(RBGet.gui().getString(MESSAGE_ADDING_SELF_AS_FRIEND)); } } else { notifyUser(MessageFormat.format(RBGet.gui().getString(IS_ALREADY_YOUR_FRIEND), UserProperty.HUMANS_IDENTITY_CACHE.get(email.getObj(), "").getHuman().getDisplayName())); } } } }); }
super.registerForClick(AdaptableSignupIds.AdaptableSignupSignup, new AIEventListener<AdaptableSignupCriteria>(criteria) { void function(Event evt) { final Email email = criteria.getInviteData().getEmail(); if (email.valid()) { final HumanId invitee = new HumanId(email.getObj()); if (!DB.getHumanCRUDHumanLocal(false).doDirtyIsHumansNetPeople(criteria.getHumanId(), invitee).returnValue()) { if (!criteria.getHumanId().getHumanId().equals(email.getObj())) { Return<Boolean> r = DB.getHumanCRUDHumanLocal(true).doNTxAddHumansNetPeople(criteria.getHumanId(), invitee); if (r.valid()) { $$(AdaptableSignupIds.AdaptableSignupNoti).setTextContent(MessageFormat.format(RBGet.gui().getString(INVITED_ADDED_0), email)); $$(AdaptableSignupIds.AdaptableSignupEmail).setAttribute(MarkupTag.INPUT.value(), STR").getHuman().getDisplayName())); } } } }); }
/** * Override this method and avoid {@link #handleEvent(org.w3c.dom.events.Event)} to make debug logging transparent * * @param evt fired from client */
Override this method and avoid <code>#handleEvent(org.w3c.dom.events.Event)</code> to make debug logging transparent
onFire
{ "repo_name": "Adimpression/Baby", "path": "src/main/java/ai/baby/logic/Listeners/widgets/AdaptableSignup.java", "license": "agpl-3.0", "size": 5856 }
[ "ai.baby.logic.crud.DB", "ai.baby.logic.validators.unit.Email", "ai.baby.rbs.RBGet", "ai.baby.util.AIEventListener", "ai.baby.util.MarkupTag", "ai.ilikeplaces.entities.etc.HumanId", "ai.reaver.Return", "java.text.MessageFormat", "org.w3c.dom.events.Event" ]
import ai.baby.logic.crud.DB; import ai.baby.logic.validators.unit.Email; import ai.baby.rbs.RBGet; import ai.baby.util.AIEventListener; import ai.baby.util.MarkupTag; import ai.ilikeplaces.entities.etc.HumanId; import ai.reaver.Return; import java.text.MessageFormat; import org.w3c.dom.events.Event;
import ai.baby.logic.crud.*; import ai.baby.logic.validators.unit.*; import ai.baby.rbs.*; import ai.baby.util.*; import ai.ilikeplaces.entities.etc.*; import ai.reaver.*; import java.text.*; import org.w3c.dom.events.*;
[ "ai.baby.logic", "ai.baby.rbs", "ai.baby.util", "ai.ilikeplaces.entities", "ai.reaver", "java.text", "org.w3c.dom" ]
ai.baby.logic; ai.baby.rbs; ai.baby.util; ai.ilikeplaces.entities; ai.reaver; java.text; org.w3c.dom;
2,803,455
public void setClob(int i, Clob x) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { if (x == null) { setNull(i, Types.CLOB); } else { String forcedEncoding = this.connection.getClobCharacterEncoding(); if (forcedEncoding == null) { setString(i, x.getSubString(1L, (int) x.length())); } else { try { setBytes(i, StringUtils.getBytes(x.getSubString(1L, (int) x.length()), forcedEncoding)); } catch (UnsupportedEncodingException uee) { throw SQLError.createSQLException("Unsupported character encoding " + forcedEncoding, SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } } this.parameterTypes[i - 1 + getParameterIndexOffset()] = Types.CLOB; } } }
void function(int i, Clob x) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { if (x == null) { setNull(i, Types.CLOB); } else { String forcedEncoding = this.connection.getClobCharacterEncoding(); if (forcedEncoding == null) { setString(i, x.getSubString(1L, (int) x.length())); } else { try { setBytes(i, StringUtils.getBytes(x.getSubString(1L, (int) x.length()), forcedEncoding)); } catch (UnsupportedEncodingException uee) { throw SQLError.createSQLException(STR + forcedEncoding, SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } } this.parameterTypes[i - 1 + getParameterIndexOffset()] = Types.CLOB; } } }
/** * JDBC 2.0 Set a CLOB parameter. * * @param i * the first parameter is 1, the second is 2, ... * @param x * an object representing a CLOB * * @throws SQLException * if a database error occurs */
JDBC 2.0 Set a CLOB parameter
setClob
{ "repo_name": "swankjesse/mysql-connector-j", "path": "src/com/mysql/jdbc/PreparedStatement.java", "license": "gpl-2.0", "size": 198268 }
[ "java.io.UnsupportedEncodingException", "java.sql.Clob", "java.sql.SQLException", "java.sql.Types" ]
import java.io.UnsupportedEncodingException; import java.sql.Clob; import java.sql.SQLException; import java.sql.Types;
import java.io.*; import java.sql.*;
[ "java.io", "java.sql" ]
java.io; java.sql;
2,904,666
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); setArtifactPaint( SerialUtilities.readPaint(stream)); }
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); setArtifactPaint( SerialUtilities.readPaint(stream)); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */
Provides serialization support
readObject
{ "repo_name": "NCIP/stats-analysis", "path": "src/gov/nih/nci/caintegrator/ui/graphing/chart/plot/BoxAndWhiskerCoinPlotRenderer.java", "license": "bsd-3-clause", "size": 29992 }
[ "java.io.IOException", "java.io.ObjectInputStream", "org.jfree.io.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities;
import java.io.*; import org.jfree.io.*;
[ "java.io", "org.jfree.io" ]
java.io; org.jfree.io;
924,395
protected void setSessionValue(HttpServletRequest request, String key, Object value) { request.getSession(true).setAttribute(key, value); }
void function(HttpServletRequest request, String key, Object value) { request.getSession(true).setAttribute(key, value); }
/** * Returns the session value of the request. * * @param request * @param key * @param value */
Returns the session value of the request
setSessionValue
{ "repo_name": "mariacioffi/azkaban", "path": "azkaban-web-server/src/main/java/azkaban/webapp/servlet/AbstractAzkabanServlet.java", "license": "apache-2.0", "size": 13418 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
2,224,041
public final void setWidth(int cooked) throws AccessPoemException, ValidationPoemException { setWidth(new Integer(cooked)); }
final void function(int cooked) throws AccessPoemException, ValidationPoemException { setWidth(new Integer(cooked)); }
/** * Sets the <code>Width</code> value, with checking, for this * <code>ValueInfo</code> <code>Persistent</code>. * Field description: * A sensible width for text boxes used for entering the field, where * appropriate * * * Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods * @param cooked a validated <code>int</code> * @throws AccessPoemException * if the current <code>AccessToken</code> * does not confer write access rights * @throws ValidationPoemException * if the value is not valid */
Sets the <code>Width</code> value, with checking, for this <code>ValueInfo</code> <code>Persistent</code>. Field description: A sensible width for text boxes used for entering the field, where appropriate Generated by org.melati.poem.prepro.IntegerFieldDef#generateBaseMethods
setWidth
{ "repo_name": "timp21337/melati-old", "path": "poem/src/main/java/org/melati/poem/generated/ValueInfoBase.java", "license": "gpl-2.0", "size": 44733 }
[ "org.melati.poem.AccessPoemException", "org.melati.poem.ValidationPoemException" ]
import org.melati.poem.AccessPoemException; import org.melati.poem.ValidationPoemException;
import org.melati.poem.*;
[ "org.melati.poem" ]
org.melati.poem;
2,017,050
public String[] getSupportedArtifactTypes() { Set<String> artifactTypeSet = Sets.newHashSet(artifactMap.keySet()); artifactTypeSet.add("tosca.artifacts.Deployment.Image.Container.Docker"); artifactTypeSet.add("tosca.artifacts.Deployment.Image.Container.Docker.Kubernetes"); return artifactTypeSet.toArray(new String[artifactTypeSet.size()]); }
String[] function() { Set<String> artifactTypeSet = Sets.newHashSet(artifactMap.keySet()); artifactTypeSet.add(STR); artifactTypeSet.add(STR); return artifactTypeSet.toArray(new String[artifactTypeSet.size()]); }
/** * Get an array of the supported artifact types. * * @return An array of the supported artifact types. */
Get an array of the supported artifact types
getSupportedArtifactTypes
{ "repo_name": "alien4cloud/alien4cloud-cloudify3-provider", "path": "alien4cloud-cloudify3-provider/src/main/java/alien4cloud/paas/cloudify3/shared/ArtifactRegistryService.java", "license": "apache-2.0", "size": 1675 }
[ "com.google.common.collect.Sets", "java.util.Set" ]
import com.google.common.collect.Sets; import java.util.Set;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,151,234
public DawgRestRequestService setRequestPathParams(Map<String, String> map) { paramMap = map; return this; }
DawgRestRequestService function(Map<String, String> map) { paramMap = map; return this; }
/** * Method to set Request Path Parameters, if any * @param map - Parameter Map * @return DawgRestRequestService */
Method to set Request Path Parameters, if any
setRequestPathParams
{ "repo_name": "vmatha002c/dawg", "path": "functional-tests/src/main/java/com/comcast/dawg/DawgRestRequestService.java", "license": "apache-2.0", "size": 7284 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,241,245
public void setFile(File briefing) { this.briefing = briefing; }
void function(File briefing) { this.briefing = briefing; }
/** * Sets the briefing displayed during this crisis. * * @param briefing * the new briefing */
Sets the briefing displayed during this crisis
setFile
{ "repo_name": "WChargin/kiosk", "path": "kiosk/src/org/lcmmun/kiosk/Crisis.java", "license": "mit", "size": 4618 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
511,353
@Override public void writeFloat(float value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalFloat(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
void function(float value) throws JMSException { initializeWriting(); try { MarshallingSupport.marshalFloat(dataOut, value); } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } }
/** * Writes a <code>float</code> to the stream message. * * @param value the <code>float</code> value to be written * @throws JMSException if the JMS provider fails to write the message due * to some internal error. * @throws MessageNotWriteableException if the message is in read-only mode. */
Writes a <code>float</code> to the stream message
writeFloat
{ "repo_name": "chirino/activemq", "path": "activemq-client/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java", "license": "apache-2.0", "size": 46567 }
[ "java.io.IOException", "javax.jms.JMSException", "org.apache.activemq.util.JMSExceptionSupport", "org.apache.activemq.util.MarshallingSupport" ]
import java.io.IOException; import javax.jms.JMSException; import org.apache.activemq.util.JMSExceptionSupport; import org.apache.activemq.util.MarshallingSupport;
import java.io.*; import javax.jms.*; import org.apache.activemq.util.*;
[ "java.io", "javax.jms", "org.apache.activemq" ]
java.io; javax.jms; org.apache.activemq;
1,342,354
public static Map<String, Object> parkQueue( long delay ) { return parkQueue( new HashMap<>(), delay ); }
static Map<String, Object> function( long delay ) { return parkQueue( new HashMap<>(), delay ); }
/** * Create properties to mark this queue as being parked * <p> * @param delay Delay in milliseconds to hold a message before delivery * <p> * @return Map */
Create properties to mark this queue as being parked
parkQueue
{ "repo_name": "peter-mount/opendata-common", "path": "brokers/rabbitmq/src/main/java/uk/trainwatch/rabbitmq/RabbitMQ.java", "license": "apache-2.0", "size": 29777 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,264,960
// ============================================================================ // Namespace Locking Helpers // ============================================================================ public boolean waitNamespaceExclusiveLock(Procedure<?> procedure, String namespace) { schedLock(); try { final LockAndQueue systemNamespaceTableLock = locking.getTableLock(TableProcedureInterface.DUMMY_NAMESPACE_TABLE_NAME); if (!systemNamespaceTableLock.trySharedLock(procedure)) { waitProcedure(systemNamespaceTableLock, procedure); logLockedResource(LockedResourceType.TABLE, TableProcedureInterface.DUMMY_NAMESPACE_TABLE_NAME.getNameAsString()); return true; } final LockAndQueue namespaceLock = locking.getNamespaceLock(namespace); if (!namespaceLock.tryExclusiveLock(procedure)) { systemNamespaceTableLock.releaseSharedLock(); waitProcedure(namespaceLock, procedure); logLockedResource(LockedResourceType.NAMESPACE, namespace); return true; } return false; } finally { schedUnlock(); } }
boolean function(Procedure<?> procedure, String namespace) { schedLock(); try { final LockAndQueue systemNamespaceTableLock = locking.getTableLock(TableProcedureInterface.DUMMY_NAMESPACE_TABLE_NAME); if (!systemNamespaceTableLock.trySharedLock(procedure)) { waitProcedure(systemNamespaceTableLock, procedure); logLockedResource(LockedResourceType.TABLE, TableProcedureInterface.DUMMY_NAMESPACE_TABLE_NAME.getNameAsString()); return true; } final LockAndQueue namespaceLock = locking.getNamespaceLock(namespace); if (!namespaceLock.tryExclusiveLock(procedure)) { systemNamespaceTableLock.releaseSharedLock(); waitProcedure(namespaceLock, procedure); logLockedResource(LockedResourceType.NAMESPACE, namespace); return true; } return false; } finally { schedUnlock(); } }
/** * Suspend the procedure if the specified namespace is already locked. * @see #wakeNamespaceExclusiveLock(Procedure,String) * @param procedure the procedure trying to acquire the lock * @param namespace Namespace to lock * @return true if the procedure has to wait for the namespace to be available */
Suspend the procedure if the specified namespace is already locked
waitNamespaceExclusiveLock
{ "repo_name": "mahak/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/MasterProcedureScheduler.java", "license": "apache-2.0", "size": 39100 }
[ "org.apache.hadoop.hbase.procedure2.LockAndQueue", "org.apache.hadoop.hbase.procedure2.LockedResourceType", "org.apache.hadoop.hbase.procedure2.Procedure" ]
import org.apache.hadoop.hbase.procedure2.LockAndQueue; import org.apache.hadoop.hbase.procedure2.LockedResourceType; import org.apache.hadoop.hbase.procedure2.Procedure;
import org.apache.hadoop.hbase.procedure2.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,105,289
Observable<Long> zrevrangebyscore(ValueStreamingChannel<V> channel, K key, double max, double min, long offset, long count);
Observable<Long> zrevrangebyscore(ValueStreamingChannel<V> channel, K key, double max, double min, long offset, long count);
/** * Stream over a range of members in a sorted set, by score, with scores ordered from high to low. * * @param channel streaming channel that receives a call for every value * @param key the key * @param min min score * @param max max score * @param offset the offset * @param count the count * @return Long count of elements in the specified range. */
Stream over a range of members in a sorted set, by score, with scores ordered from high to low
zrevrangebyscore
{ "repo_name": "taer/lettuce", "path": "src/main/java/com/lambdaworks/redis/api/rx/RedisSortedSetReactiveCommands.java", "license": "apache-2.0", "size": 31207 }
[ "com.lambdaworks.redis.output.ValueStreamingChannel" ]
import com.lambdaworks.redis.output.ValueStreamingChannel;
import com.lambdaworks.redis.output.*;
[ "com.lambdaworks.redis" ]
com.lambdaworks.redis;
2,223,610
@Test public void testAccessUnauthorizedPublicContainer() throws Exception { Path noAccessPath = new Path( "wasb://nonExistentContainer@hopefullyNonExistentAccount/someFile"); NativeAzureFileSystem.suppressRetryPolicy(); try { FileSystem.get(noAccessPath.toUri(), new Configuration()) .open(noAccessPath); assertTrue("Should've thrown.", false); } catch (AzureException ex) { assertTrue("Unexpected message in exception " + ex, ex.getMessage().contains( "Unable to access container nonExistentContainer in account" + " hopefullyNonExistentAccount")); } finally { NativeAzureFileSystem.resumeRetryPolicy(); } }
void function() throws Exception { Path noAccessPath = new Path( STRShould've thrown.STRUnexpected message in exception STRUnable to access container nonExistentContainer in accountSTR hopefullyNonExistentAccount")); } finally { NativeAzureFileSystem.resumeRetryPolicy(); } }
/** * Try accessing an unauthorized or non-existent (treated the same) container * from WASB. */
Try accessing an unauthorized or non-existent (treated the same) container from WASB
testAccessUnauthorizedPublicContainer
{ "repo_name": "cnfire/hadoop", "path": "hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/TestAzureFileSystemErrorConditions.java", "license": "apache-2.0", "size": 8519 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,007,493
public void setBackgroundEnable(Rectangle2D bgRgn) { backgroundEnableRgn = bgRgn; }
void function(Rectangle2D bgRgn) { backgroundEnableRgn = bgRgn; }
/** * Sets the enable background property to the specified rectangle. * * @param bgRgn the region that defines the background enable property */
Sets the enable background property to the specified rectangle
setBackgroundEnable
{ "repo_name": "Uni-Sol/batik", "path": "sources/org/apache/batik/gvt/CompositeGraphicsNode.java", "license": "apache-2.0", "size": 34701 }
[ "java.awt.geom.Rectangle2D" ]
import java.awt.geom.Rectangle2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
1,915,305