repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
joniles/mpxj | src/main/java/net/sf/mpxj/utility/MppCleanUtility.java | MppCleanUtility.compareBytes | private boolean compareBytes(byte[] lhs, byte[] rhs, int rhsOffset) {
"""
Compare an array of bytes with a subsection of a larger array of bytes.
@param lhs small array of bytes
@param rhs large array of bytes
@param rhsOffset offset into larger array of bytes
@return true if a match is found
"""
b... | java | private boolean compareBytes(byte[] lhs, byte[] rhs, int rhsOffset)
{
boolean result = true;
for (int loop = 0; loop < lhs.length; loop++)
{
if (lhs[loop] != rhs[rhsOffset + loop])
{
result = false;
break;
}
}
return (result);
} | [
"private",
"boolean",
"compareBytes",
"(",
"byte",
"[",
"]",
"lhs",
",",
"byte",
"[",
"]",
"rhs",
",",
"int",
"rhsOffset",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"for",
"(",
"int",
"loop",
"=",
"0",
";",
"loop",
"<",
"lhs",
".",
"length",... | Compare an array of bytes with a subsection of a larger array of bytes.
@param lhs small array of bytes
@param rhs large array of bytes
@param rhsOffset offset into larger array of bytes
@return true if a match is found | [
"Compare",
"an",
"array",
"of",
"bytes",
"with",
"a",
"subsection",
"of",
"a",
"larger",
"array",
"of",
"bytes",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/utility/MppCleanUtility.java#L420-L432 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addIdNotInCollectionCondition | protected void addIdNotInCollectionCondition(final Expression<?> property, final Collection<?> values) {
"""
Add a Field Search Condition that will check if the id field exists in an array of values. eg. {@code field IN (values)}
@param property The field id as defined in the Entity mapping class.
@param value... | java | protected void addIdNotInCollectionCondition(final Expression<?> property, final Collection<?> values) {
if (values != null && !values.isEmpty()) {
fieldConditions.add(getCriteriaBuilder().not(property.in(values)));
}
} | [
"protected",
"void",
"addIdNotInCollectionCondition",
"(",
"final",
"Expression",
"<",
"?",
">",
"property",
",",
"final",
"Collection",
"<",
"?",
">",
"values",
")",
"{",
"if",
"(",
"values",
"!=",
"null",
"&&",
"!",
"values",
".",
"isEmpty",
"(",
")",
... | Add a Field Search Condition that will check if the id field exists in an array of values. eg. {@code field IN (values)}
@param property The field id as defined in the Entity mapping class.
@param values The List of Ids to be compared to. | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"check",
"if",
"the",
"id",
"field",
"exists",
"in",
"an",
"array",
"of",
"values",
".",
"eg",
".",
"{",
"@code",
"field",
"IN",
"(",
"values",
")",
"}"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L382-L386 |
google/closure-compiler | src/com/google/javascript/jscomp/RemoveUnusedCode.java | RemoveUnusedCode.traverseClass | private void traverseClass(Node classNode, Scope scope) {
"""
Handle a class that is not the RHS child of an assignment or a variable declaration
initializer.
<p>For
@param classNode
@param scope
"""
checkArgument(classNode.isClass());
if (NodeUtil.isClassDeclaration(classNode)) {
traverseC... | java | private void traverseClass(Node classNode, Scope scope) {
checkArgument(classNode.isClass());
if (NodeUtil.isClassDeclaration(classNode)) {
traverseClassDeclaration(classNode, scope);
} else {
traverseClassExpression(classNode, scope);
}
} | [
"private",
"void",
"traverseClass",
"(",
"Node",
"classNode",
",",
"Scope",
"scope",
")",
"{",
"checkArgument",
"(",
"classNode",
".",
"isClass",
"(",
")",
")",
";",
"if",
"(",
"NodeUtil",
".",
"isClassDeclaration",
"(",
"classNode",
")",
")",
"{",
"traver... | Handle a class that is not the RHS child of an assignment or a variable declaration
initializer.
<p>For
@param classNode
@param scope | [
"Handle",
"a",
"class",
"that",
"is",
"not",
"the",
"RHS",
"child",
"of",
"an",
"assignment",
"or",
"a",
"variable",
"declaration",
"initializer",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/RemoveUnusedCode.java#L1198-L1205 |
ibm-bluemix-mobile-services/bms-clientsdk-android-push | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java | MFPPush.setNotificationOptions | private void setNotificationOptions(Context context,MFPPushNotificationOptions options) {
"""
Set the default push notification options for notifications.
@param context - this is the Context of the application from getApplicationContext()
@param options - The MFPPushNotificationOptions with the default parame... | java | private void setNotificationOptions(Context context,MFPPushNotificationOptions options) {
if (this.appContext == null) {
this.appContext = context.getApplicationContext();
}
this.options = options;
Gson gson = new Gson();
String json = gson.toJson(options);
SharedPreferences sharedPrefere... | [
"private",
"void",
"setNotificationOptions",
"(",
"Context",
"context",
",",
"MFPPushNotificationOptions",
"options",
")",
"{",
"if",
"(",
"this",
".",
"appContext",
"==",
"null",
")",
"{",
"this",
".",
"appContext",
"=",
"context",
".",
"getApplicationContext",
... | Set the default push notification options for notifications.
@param context - this is the Context of the application from getApplicationContext()
@param options - The MFPPushNotificationOptions with the default parameters | [
"Set",
"the",
"default",
"push",
"notification",
"options",
"for",
"notifications",
"."
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-push/blob/26c048637e81a6942004693919558f3d9aa8c674/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/push/api/MFPPush.java#L656-L666 |
caelum/vraptor4 | vraptor-core/src/main/java/br/com/caelum/vraptor/converter/EnumConverter.java | EnumConverter.convert | @Override
public Object convert(String value, Class type) {
"""
Enums are always final, so I can suppress this warning safely
"""
if (isNullOrEmpty(value)) {
return null;
}
if (Character.isDigit(value.charAt(0))) {
return resolveByOrdinal(value, type);
} else {
return resolveByName(value, ty... | java | @Override
public Object convert(String value, Class type) {
if (isNullOrEmpty(value)) {
return null;
}
if (Character.isDigit(value.charAt(0))) {
return resolveByOrdinal(value, type);
} else {
return resolveByName(value, type);
}
} | [
"@",
"Override",
"public",
"Object",
"convert",
"(",
"String",
"value",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"Character",
".",
"isDigit",
"(",
"value",
".",
"c... | Enums are always final, so I can suppress this warning safely | [
"Enums",
"are",
"always",
"final",
"so",
"I",
"can",
"suppress",
"this",
"warning",
"safely"
] | train | https://github.com/caelum/vraptor4/blob/593ce9ad60f9d38c360881b2132417c56b8cc093/vraptor-core/src/main/java/br/com/caelum/vraptor/converter/EnumConverter.java#L46-L57 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByPassword | public Iterable<DUser> queryByPassword(java.lang.String password) {
"""
query-by method for field password
@param password the specified attribute
@return an Iterable of DUsers for the specified password
"""
return queryByField(null, DUserMapper.Field.PASSWORD.getFieldName(), password);
} | java | public Iterable<DUser> queryByPassword(java.lang.String password) {
return queryByField(null, DUserMapper.Field.PASSWORD.getFieldName(), password);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByPassword",
"(",
"java",
".",
"lang",
".",
"String",
"password",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"PASSWORD",
".",
"getFieldName",
"(",
")",
",",
"passwo... | query-by method for field password
@param password the specified attribute
@return an Iterable of DUsers for the specified password | [
"query",
"-",
"by",
"method",
"for",
"field",
"password"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L178-L180 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.registerDeviceForPush | public Device registerDeviceForPush(UUID deviceId,
String notifier,
String token,
Map<String, Object> properties) {
"""
Registers a device using the device's unique device ID.
@param context
... | java | public Device registerDeviceForPush(UUID deviceId,
String notifier,
String token,
Map<String, Object> properties) {
if (properties == null) {
properties = new HashMap<String, Object>()... | [
"public",
"Device",
"registerDeviceForPush",
"(",
"UUID",
"deviceId",
",",
"String",
"notifier",
",",
"String",
"token",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"properties",
"... | Registers a device using the device's unique device ID.
@param context
@param properties
@return a Device object if success | [
"Registers",
"a",
"device",
"using",
"the",
"device",
"s",
"unique",
"device",
"ID",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L561-L571 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/parameter/Parameter.java | Parameter.setParameter | public int setParameter(final PreparedStatement preparedStatement, final int index,
final BindParameterMapperManager parameterMapperManager) throws SQLException {
"""
ステートメントへパラメータ値をバインド。
@param preparedStatement ステートメント
@param index パラメータインデックス
@param parameterMapperManager パラメータ変換管理クラス
@return 次のパラメータイン... | java | public int setParameter(final PreparedStatement preparedStatement, final int index,
final BindParameterMapperManager parameterMapperManager) throws SQLException {
return setInParameter(preparedStatement, index, parameterMapperManager);
} | [
"public",
"int",
"setParameter",
"(",
"final",
"PreparedStatement",
"preparedStatement",
",",
"final",
"int",
"index",
",",
"final",
"BindParameterMapperManager",
"parameterMapperManager",
")",
"throws",
"SQLException",
"{",
"return",
"setInParameter",
"(",
"preparedState... | ステートメントへパラメータ値をバインド。
@param preparedStatement ステートメント
@param index パラメータインデックス
@param parameterMapperManager パラメータ変換管理クラス
@return 次のパラメータインデックス
@throws SQLException SQL例外 | [
"ステートメントへパラメータ値をバインド。"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/parameter/Parameter.java#L143-L146 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getMastery | public Future<Mastery> getMastery(int id, MasteryData data) {
"""
<p>
Get a specific mastery
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the mastery
@param data Additional information to retrieve
@return The mastery
@see <a href=https://deve... | java | public Future<Mastery> getMastery(int id, MasteryData data) {
return new DummyFuture<>(handler.getMastery(id, data));
} | [
"public",
"Future",
"<",
"Mastery",
">",
"getMastery",
"(",
"int",
"id",
",",
"MasteryData",
"data",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getMastery",
"(",
"id",
",",
"data",
")",
")",
";",
"}"
] | <p>
Get a specific mastery
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param id The id of the mastery
@param data Additional information to retrieve
@return The mastery
@see <a href=https://developer.riotgames.com/api/methods#!/649/2175>Official API documentation</a> | [
"<p",
">",
"Get",
"a",
"specific",
"mastery",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L589-L591 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java | MemoryRemoteTable.doMove | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException {
"""
Move the current position and read the record (optionally read several records).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this... | java | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException
{
int iRowIndex = m_iCurrentRecord + iRelPosition; // Calculate absolute position
if ((m_iCurrentRecord == -1)
&& (iRelPosition == -1))
iRowIndex = m_mDataMap.size() - 1; // S... | [
"public",
"Object",
"doMove",
"(",
"int",
"iRelPosition",
",",
"int",
"iRecordCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"int",
"iRowIndex",
"=",
"m_iCurrentRecord",
"+",
"iRelPosition",
";",
"// Calculate absolute position",
"if",
"(",
"(",
... | Move the current position and read the record (optionally read several records).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this is the record's data.
@return If I read several records, this is a vector of the returned records.
@return... | [
"Move",
"the",
"current",
"position",
"and",
"read",
"the",
"record",
"(",
"optionally",
"read",
"several",
"records",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/client/memory/MemoryRemoteTable.java#L193-L200 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java | SpringContextHelper.getBean | public static <T> T getBean(final String beanName, final Class<T> beanClazz) {
"""
method to return a certain bean by its class and name.
@param beanName
name of the beand which should be returned from the
application context
@param beanClazz
class of the bean which should be returned from the
application ... | java | public static <T> T getBean(final String beanName, final Class<T> beanClazz) {
return context.getBean(beanName, beanClazz);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getBean",
"(",
"final",
"String",
"beanName",
",",
"final",
"Class",
"<",
"T",
">",
"beanClazz",
")",
"{",
"return",
"context",
".",
"getBean",
"(",
"beanName",
",",
"beanClazz",
")",
";",
"}"
] | method to return a certain bean by its class and name.
@param beanName
name of the beand which should be returned from the
application context
@param beanClazz
class of the bean which should be returned from the
application context
@return the requested bean | [
"method",
"to",
"return",
"a",
"certain",
"bean",
"by",
"its",
"class",
"and",
"name",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/utils/SpringContextHelper.java#L69-L71 |
pwittchen/ReactiveNetwork | library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java | ReactiveNetwork.observeNetworkConnectivity | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context) {
"""
Observes network connectivity. Information about network state, type and typeName are contained
in
observed Connectivity object.
@param context Context... | java | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static Observable<Connectivity> observeNetworkConnectivity(final Context context) {
final NetworkObservingStrategy strategy;
if (Preconditions.isAtLeastAndroidMarshmallow()) {
strategy = new MarshmallowNetworkObservingStrategy();
... | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"ACCESS_NETWORK_STATE",
")",
"public",
"static",
"Observable",
"<",
"Connectivity",
">",
"observeNetworkConnectivity",
"(",
"final",
"Context",
"context",
")",
"{",
"final",
"NetworkObservingStrategy",
... | Observes network connectivity. Information about network state, type and typeName are contained
in
observed Connectivity object.
@param context Context of the activity or an application
@return RxJava Observable with Connectivity class containing information about network state,
type and typeName | [
"Observes",
"network",
"connectivity",
".",
"Information",
"about",
"network",
"state",
"type",
"and",
"typeName",
"are",
"contained",
"in",
"observed",
"Connectivity",
"object",
"."
] | train | https://github.com/pwittchen/ReactiveNetwork/blob/cfeb3b79a1e44d106581af5e6709ff206e60c369/library/src/main/java/com/github/pwittchen/reactivenetwork/library/rx2/ReactiveNetwork.java#L60-L73 |
rterp/GMapsFX | GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java | JavascriptObject.checkBoolean | protected Boolean checkBoolean(Object val, Boolean def) {
"""
Checks a returned Javascript value where we expect a boolean but could
get null.
@param val The value from Javascript to be checked.
@param def The default return value, which can be null.
@return The actual value, or if null, returns false.
"... | java | protected Boolean checkBoolean(Object val, Boolean def) {
return (val == null) ? def : (Boolean) val;
} | [
"protected",
"Boolean",
"checkBoolean",
"(",
"Object",
"val",
",",
"Boolean",
"def",
")",
"{",
"return",
"(",
"val",
"==",
"null",
")",
"?",
"def",
":",
"(",
"Boolean",
")",
"val",
";",
"}"
] | Checks a returned Javascript value where we expect a boolean but could
get null.
@param val The value from Javascript to be checked.
@param def The default return value, which can be null.
@return The actual value, or if null, returns false. | [
"Checks",
"a",
"returned",
"Javascript",
"value",
"where",
"we",
"expect",
"a",
"boolean",
"but",
"could",
"get",
"null",
"."
] | train | https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptObject.java#L300-L302 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_networkInterfaceController_GET | public ArrayList<String> serviceName_networkInterfaceController_GET(String serviceName, OvhNetworkInterfaceControllerLinkTypeEnum linkType) throws IOException {
"""
List server networkInterfaceController
REST: GET /dedicated/server/{serviceName}/networkInterfaceController
@param linkType [required] Filter the ... | java | public ArrayList<String> serviceName_networkInterfaceController_GET(String serviceName, OvhNetworkInterfaceControllerLinkTypeEnum linkType) throws IOException {
String qPath = "/dedicated/server/{serviceName}/networkInterfaceController";
StringBuilder sb = path(qPath, serviceName);
query(sb, "linkType", linkType)... | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_networkInterfaceController_GET",
"(",
"String",
"serviceName",
",",
"OvhNetworkInterfaceControllerLinkTypeEnum",
"linkType",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/net... | List server networkInterfaceController
REST: GET /dedicated/server/{serviceName}/networkInterfaceController
@param linkType [required] Filter the value of linkType property (=)
@param serviceName [required] The internal name of your dedicated server
API beta | [
"List",
"server",
"networkInterfaceController"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L449-L455 |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/ExtraSamplesActivity.java | ExtraSamplesActivity.onKeyUp | @Override
public boolean onKeyUp (int keyCode, KeyEvent event) {
"""
small example of keyboard events on the mapview
page up = zoom out
page down = zoom in
@param keyCode
@param event
@return
"""
Fragment frag = getSupportFragmentManager().findFragmentByTag(SAMPLES_FRAGMENT_TAG);
if (f... | java | @Override
public boolean onKeyUp (int keyCode, KeyEvent event){
Fragment frag = getSupportFragmentManager().findFragmentByTag(SAMPLES_FRAGMENT_TAG);
if (frag==null) {
return super.onKeyUp(keyCode, event);
}
if (!(frag instanceof BaseSampleFragment)) {
return s... | [
"@",
"Override",
"public",
"boolean",
"onKeyUp",
"(",
"int",
"keyCode",
",",
"KeyEvent",
"event",
")",
"{",
"Fragment",
"frag",
"=",
"getSupportFragmentManager",
"(",
")",
".",
"findFragmentByTag",
"(",
"SAMPLES_FRAGMENT_TAG",
")",
";",
"if",
"(",
"frag",
"=="... | small example of keyboard events on the mapview
page up = zoom out
page down = zoom in
@param keyCode
@param event
@return | [
"small",
"example",
"of",
"keyboard",
"events",
"on",
"the",
"mapview",
"page",
"up",
"=",
"zoom",
"out",
"page",
"down",
"=",
"zoom",
"in"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/ExtraSamplesActivity.java#L53-L74 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/storage/record/RecordPage.java | RecordPage.insertIntoDeletedSlot | public RecordId insertIntoDeletedSlot() {
"""
Inserts a new, blank record into this deleted slot and return the record
id of the next one.
@return the record id of the next deleted slot
"""
RecordId nds = getNextDeletedSlotId();
// Important: Erase the free chain information.
// If we didn't do th... | java | public RecordId insertIntoDeletedSlot() {
RecordId nds = getNextDeletedSlotId();
// Important: Erase the free chain information.
// If we didn't do this, it would crash when
// a tx try to set a VARCHAR at this position
// since the getVal would get negative size.
setNextDeletedSlotId(new RecordId(new... | [
"public",
"RecordId",
"insertIntoDeletedSlot",
"(",
")",
"{",
"RecordId",
"nds",
"=",
"getNextDeletedSlotId",
"(",
")",
";",
"// Important: Erase the free chain information.\r",
"// If we didn't do this, it would crash when\r",
"// a tx try to set a VARCHAR at this position\r",
"// s... | Inserts a new, blank record into this deleted slot and return the record
id of the next one.
@return the record id of the next deleted slot | [
"Inserts",
"a",
"new",
"blank",
"record",
"into",
"this",
"deleted",
"slot",
"and",
"return",
"the",
"record",
"id",
"of",
"the",
"next",
"one",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/record/RecordPage.java#L254-L264 |
intellimate/Izou | src/main/java/org/intellimate/izou/output/OutputManager.java | OutputManager.removeOutputExtension | public void removeOutputExtension(OutputExtensionModel<?, ?> outputExtension) {
"""
removes the output-extension of id: extensionId from outputPluginList
@param outputExtension the OutputExtension to remove
"""
IdentifiableSet<OutputExtensionModel<?, ?>> outputExtensions =
this.outpu... | java | public void removeOutputExtension(OutputExtensionModel<?, ?> outputExtension) {
IdentifiableSet<OutputExtensionModel<?, ?>> outputExtensions =
this.outputExtensions.get(outputExtension.getPluginId());
if (outputExtensions != null)
outputExtensions.remove(outputExtension);
... | [
"public",
"void",
"removeOutputExtension",
"(",
"OutputExtensionModel",
"<",
"?",
",",
"?",
">",
"outputExtension",
")",
"{",
"IdentifiableSet",
"<",
"OutputExtensionModel",
"<",
"?",
",",
"?",
">",
">",
"outputExtensions",
"=",
"this",
".",
"outputExtensions",
... | removes the output-extension of id: extensionId from outputPluginList
@param outputExtension the OutputExtension to remove | [
"removes",
"the",
"output",
"-",
"extension",
"of",
"id",
":",
"extensionId",
"from",
"outputPluginList"
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/output/OutputManager.java#L120-L129 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.addAll | public static <T> Collection<T> addAll(Collection<T> collection, Object value) {
"""
将指定对象全部加入到集合中<br>
提供的对象如果为集合类型,会自动转换为目标元素类型<br>
@param <T> 元素类型
@param collection 被加入的集合
@param value 对象,可能为Iterator、Iterable、Enumeration、Array
@return 被加入集合
"""
return addAll(collection, value, TypeUtil.getTypeArgum... | java | public static <T> Collection<T> addAll(Collection<T> collection, Object value) {
return addAll(collection, value, TypeUtil.getTypeArgument(collection.getClass()));
} | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Object",
"value",
")",
"{",
"return",
"addAll",
"(",
"collection",
",",
"value",
",",
"TypeUtil",
".",
"getTypeArgument",
"(",... | 将指定对象全部加入到集合中<br>
提供的对象如果为集合类型,会自动转换为目标元素类型<br>
@param <T> 元素类型
@param collection 被加入的集合
@param value 对象,可能为Iterator、Iterable、Enumeration、Array
@return 被加入集合 | [
"将指定对象全部加入到集合中<br",
">",
"提供的对象如果为集合类型,会自动转换为目标元素类型<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1690-L1692 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java | TargetTable.resetTargetCountDetails | private void resetTargetCountDetails() {
"""
Set total target count and count of targets truncated in target table.
"""
final long totalTargetsCount = getTotalTargetsCount();
managementUIState.setTargetsCountAll(totalTargetsCount);
final boolean noTagClicked = managementUIState.getTarg... | java | private void resetTargetCountDetails() {
final long totalTargetsCount = getTotalTargetsCount();
managementUIState.setTargetsCountAll(totalTargetsCount);
final boolean noTagClicked = managementUIState.getTargetTableFilters().isNoTagSelected();
final Long distributionId = managementUIStat... | [
"private",
"void",
"resetTargetCountDetails",
"(",
")",
"{",
"final",
"long",
"totalTargetsCount",
"=",
"getTotalTargetsCount",
"(",
")",
";",
"managementUIState",
".",
"setTargetsCountAll",
"(",
"totalTargetsCount",
")",
";",
"final",
"boolean",
"noTagClicked",
"=",
... | Set total target count and count of targets truncated in target table. | [
"Set",
"total",
"target",
"count",
"and",
"count",
"of",
"targets",
"truncated",
"in",
"target",
"table",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/management/targettable/TargetTable.java#L774-L810 |
ontop/ontop | engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/connection/impl/JDBCConnector.java | JDBCConnector.getConnection | @Override
public OntopConnection getConnection() throws OntopConnectionException {
"""
*
Returns an OntopConnection, the main object that a client should use to
access the query answering services of Quest. With the QuestConnection
you can get a QuestStatement to execute queries.
<p>
Note, the OntopConn... | java | @Override
public OntopConnection getConnection() throws OntopConnectionException {
return new SQLConnection(this, queryReformulator, getSQLPoolConnection(), iriDictionary,
dbMetadata, inputQueryFactory, termFactory, typeFactory, rdfFactory, settings);
} | [
"@",
"Override",
"public",
"OntopConnection",
"getConnection",
"(",
")",
"throws",
"OntopConnectionException",
"{",
"return",
"new",
"SQLConnection",
"(",
"this",
",",
"queryReformulator",
",",
"getSQLPoolConnection",
"(",
")",
",",
"iriDictionary",
",",
"dbMetadata",... | *
Returns an OntopConnection, the main object that a client should use to
access the query answering services of Quest. With the QuestConnection
you can get a QuestStatement to execute queries.
<p>
Note, the OntopConnection is not a normal JDBC connection. It is a
wrapper of one of the N JDBC connections that quest's ... | [
"*",
"Returns",
"an",
"OntopConnection",
"the",
"main",
"object",
"that",
"a",
"client",
"should",
"use",
"to",
"access",
"the",
"query",
"answering",
"services",
"of",
"Quest",
".",
"With",
"the",
"QuestConnection",
"you",
"can",
"get",
"a",
"QuestStatement",... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/engine/system/sql/core/src/main/java/it/unibz/inf/ontop/answering/connection/impl/JDBCConnector.java#L124-L129 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java | InheritanceTypeChecking.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
implements the visitor to find if/else code that checks types using instanceof, and these types are related by inheritance.
@param seen
the opcode of the currently parsed instruction
"""
boolean processed = false;
Iterator<IfStatement> isi... | java | @Override
public void sawOpcode(int seen) {
boolean processed = false;
Iterator<IfStatement> isi = ifStatements.iterator();
while (isi.hasNext()) {
IfStatement.Action action = isi.next().processOpcode(this, bugReporter, seen);
if (action == IfStatement.Action.REMOVE_A... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"boolean",
"processed",
"=",
"false",
";",
"Iterator",
"<",
"IfStatement",
">",
"isi",
"=",
"ifStatements",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"isi",
".",
"hasNext",... | implements the visitor to find if/else code that checks types using instanceof, and these types are related by inheritance.
@param seen
the opcode of the currently parsed instruction | [
"implements",
"the",
"visitor",
"to",
"find",
"if",
"/",
"else",
"code",
"that",
"checks",
"types",
"using",
"instanceof",
"and",
"these",
"types",
"are",
"related",
"by",
"inheritance",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java#L90-L107 |
Pi4J/pi4j | pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java | PCA9685GpioProvider.setPwm | public void setPwm(Pin pin, int onPosition, int offPosition) {
"""
The LEDn_ON and LEDn_OFF counts can vary from 0 to 4095 max.<br>
The LEDn_ON and LEDn_OFF count registers should never be programmed with the same values.
<p>
Because the loading of the LEDn_ON and LEDn_OFF registers is via the I2C-bus, and
asy... | java | public void setPwm(Pin pin, int onPosition, int offPosition) {
validatePin(pin, onPosition, offPosition);
final int channel = pin.getAddress();
validatePwmValueInRange(onPosition);
validatePwmValueInRange(offPosition);
if (onPosition == offPosition) {
throw new Valida... | [
"public",
"void",
"setPwm",
"(",
"Pin",
"pin",
",",
"int",
"onPosition",
",",
"int",
"offPosition",
")",
"{",
"validatePin",
"(",
"pin",
",",
"onPosition",
",",
"offPosition",
")",
";",
"final",
"int",
"channel",
"=",
"pin",
".",
"getAddress",
"(",
")",
... | The LEDn_ON and LEDn_OFF counts can vary from 0 to 4095 max.<br>
The LEDn_ON and LEDn_OFF count registers should never be programmed with the same values.
<p>
Because the loading of the LEDn_ON and LEDn_OFF registers is via the I2C-bus, and
asynchronous to the internal oscillator, we want to ensure that we do not see a... | [
"The",
"LEDn_ON",
"and",
"LEDn_OFF",
"counts",
"can",
"vary",
"from",
"0",
"to",
"4095",
"max",
".",
"<br",
">",
"The",
"LEDn_ON",
"and",
"LEDn_OFF",
"count",
"registers",
"should",
"never",
"be",
"programmed",
"with",
"the",
"same",
"values",
".",
"<p",
... | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-gpio-extension/src/main/java/com/pi4j/gpio/extension/pca/PCA9685GpioProvider.java#L186-L203 |
alkacon/opencms-core | src/org/opencms/loader/CmsJspLoader.java | CmsJspLoader.parseJsp | protected byte[] parseJsp(
byte[] byteContent,
String encoding,
CmsFlexController controller,
Set<String> updatedFiles,
boolean isHardInclude) {
"""
Parses the JSP and modifies OpenCms critical directive information.<p>
@param byteContent the original JSP content
@param ... | java | protected byte[] parseJsp(
byte[] byteContent,
String encoding,
CmsFlexController controller,
Set<String> updatedFiles,
boolean isHardInclude) {
String content;
// make sure encoding is set correctly
try {
content = new String(byteContent, enc... | [
"protected",
"byte",
"[",
"]",
"parseJsp",
"(",
"byte",
"[",
"]",
"byteContent",
",",
"String",
"encoding",
",",
"CmsFlexController",
"controller",
",",
"Set",
"<",
"String",
">",
"updatedFiles",
",",
"boolean",
"isHardInclude",
")",
"{",
"String",
"content",
... | Parses the JSP and modifies OpenCms critical directive information.<p>
@param byteContent the original JSP content
@param encoding the encoding to use for the JSP
@param controller the controller for the JSP integration
@param updatedFiles a Set containing all JSP pages that have been already updated
@param isHardIncl... | [
"Parses",
"the",
"JSP",
"and",
"modifies",
"OpenCms",
"critical",
"directive",
"information",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsJspLoader.java#L1190-L1234 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java | SftpClient.getFiles | public SftpFile[] getFiles(String remote, FileTransferProgress progress,
boolean resume) throws FileNotFoundException, SftpStatusException,
SshException, TransferCancelledException {
"""
<p>
Download the remote files to the local computer.
</p>
@param remote
the regular expression path to the remote fi... | java | public SftpFile[] getFiles(String remote, FileTransferProgress progress,
boolean resume) throws FileNotFoundException, SftpStatusException,
SshException, TransferCancelledException {
return getFiles(remote, lcwd, progress, resume);
} | [
"public",
"SftpFile",
"[",
"]",
"getFiles",
"(",
"String",
"remote",
",",
"FileTransferProgress",
"progress",
",",
"boolean",
"resume",
")",
"throws",
"FileNotFoundException",
",",
"SftpStatusException",
",",
"SshException",
",",
"TransferCancelledException",
"{",
"re... | <p>
Download the remote files to the local computer.
</p>
@param remote
the regular expression path to the remote file
@param progress
@param resume
attempt to resume a interrupted download
@return SftpFile[]
@throws FileNotFoundException
@throws SftpStatusException
@throws SshException
@throws TransferCancelledExce... | [
"<p",
">",
"Download",
"the",
"remote",
"files",
"to",
"the",
"local",
"computer",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpClient.java#L2888-L2892 |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java | BGDClient.submit | public void submit(final Configuration runtimeConfiguration, final String jobName) throws Exception {
"""
Runs BGD on the given runtime.
@param runtimeConfiguration the runtime to run on.
@param jobName the name of the job on the runtime.
"""
final Configuration driverConfiguration = getDr... | java | public void submit(final Configuration runtimeConfiguration, final String jobName) throws Exception {
final Configuration driverConfiguration = getDriverConfiguration(jobName);
Tang.Factory.getTang().newInjector(runtimeConfiguration).getInstance(REEF.class).submit(driverConfiguration);
} | [
"public",
"void",
"submit",
"(",
"final",
"Configuration",
"runtimeConfiguration",
",",
"final",
"String",
"jobName",
")",
"throws",
"Exception",
"{",
"final",
"Configuration",
"driverConfiguration",
"=",
"getDriverConfiguration",
"(",
"jobName",
")",
";",
"Tang",
"... | Runs BGD on the given runtime.
@param runtimeConfiguration the runtime to run on.
@param jobName the name of the job on the runtime. | [
"Runs",
"BGD",
"on",
"the",
"given",
"runtime",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java#L71-L74 |
Whiley/WhileyCompiler | src/main/java/wyil/interpreter/Interpreter.java | Interpreter.executeBreak | private Status executeBreak(Stmt.Break stmt, CallStack frame, EnclosingScope scope) {
"""
Execute a break statement. This transfers to control out of the nearest
enclosing loop.
@param stmt
--- Break statement.
@param frame
--- The current stack frame
@return
"""
// TODO: the break bytecode supports ... | java | private Status executeBreak(Stmt.Break stmt, CallStack frame, EnclosingScope scope) {
// TODO: the break bytecode supports a non-nearest exit and eventually
// this should be supported.
return Status.BREAK;
} | [
"private",
"Status",
"executeBreak",
"(",
"Stmt",
".",
"Break",
"stmt",
",",
"CallStack",
"frame",
",",
"EnclosingScope",
"scope",
")",
"{",
"// TODO: the break bytecode supports a non-nearest exit and eventually",
"// this should be supported.",
"return",
"Status",
".",
"B... | Execute a break statement. This transfers to control out of the nearest
enclosing loop.
@param stmt
--- Break statement.
@param frame
--- The current stack frame
@return | [
"Execute",
"a",
"break",
"statement",
".",
"This",
"transfers",
"to",
"control",
"out",
"of",
"the",
"nearest",
"enclosing",
"loop",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/interpreter/Interpreter.java#L282-L286 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.checkDirectory | protected static void checkDirectory(boolean generateSouceOnly, File sourceOutputDir) {
"""
to check current {@link File} is a directory.
@param generateSouceOnly the generate souce only
@param sourceOutputDir the source output dir
"""
if (generateSouceOnly) {
if (sourceOutputDir == nul... | java | protected static void checkDirectory(boolean generateSouceOnly, File sourceOutputDir) {
if (generateSouceOnly) {
if (sourceOutputDir == null) {
throw new RuntimeException("param 'sourceOutputDir' is null.");
}
if (!sourceOutputDir.isDirectory()) {
... | [
"protected",
"static",
"void",
"checkDirectory",
"(",
"boolean",
"generateSouceOnly",
",",
"File",
"sourceOutputDir",
")",
"{",
"if",
"(",
"generateSouceOnly",
")",
"{",
"if",
"(",
"sourceOutputDir",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(... | to check current {@link File} is a directory.
@param generateSouceOnly the generate souce only
@param sourceOutputDir the source output dir | [
"to",
"check",
"current",
"{",
"@link",
"File",
"}",
"is",
"a",
"directory",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L267-L277 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findConcreteMethod | @Deprecated
public static @CheckForNull
JavaClassAndMethod findConcreteMethod(JavaClass javaClass, String methodName, String methodSig) {
"""
Find a method in given class.
@param javaClass
the class
@param methodName
the name of the method
@param methodSig
the signature of the method
@return the J... | java | @Deprecated
public static @CheckForNull
JavaClassAndMethod findConcreteMethod(JavaClass javaClass, String methodName, String methodSig) {
if (DEBUG_METHOD_LOOKUP) {
System.out.println("Check " + javaClass.getClassName());
}
Method[] methodList = javaClass.getMethods();
... | [
"@",
"Deprecated",
"public",
"static",
"@",
"CheckForNull",
"JavaClassAndMethod",
"findConcreteMethod",
"(",
"JavaClass",
"javaClass",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"if",
"(",
"DEBUG_METHOD_LOOKUP",
")",
"{",
"System",
".",
"ou... | Find a method in given class.
@param javaClass
the class
@param methodName
the name of the method
@param methodSig
the signature of the method
@return the JavaClassAndMethod, or null if no such method exists in the
class | [
"Find",
"a",
"method",
"in",
"given",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L497-L518 |
Netflix/conductor | cassandra-persistence/src/main/java/com/netflix/conductor/dao/cassandra/CassandraExecutionDAO.java | CassandraExecutionDAO.createTasks | @Override
public List<Task> createTasks(List<Task> tasks) {
"""
Inserts tasks into the Cassandra datastore.
<b>Note:</b>
Creates the task_id to workflow_id mapping in the task_lookup table first.
Once this succeeds, inserts the tasks into the workflows table. Tasks belonging to the same shard are created us... | java | @Override
public List<Task> createTasks(List<Task> tasks) {
validateTasks(tasks);
String workflowId = tasks.get(0).getWorkflowInstanceId();
try {
WorkflowMetadata workflowMetadata = getWorkflowMetadata(workflowId);
int totalTasks = workflowMetadata.getTotalTasks() + t... | [
"@",
"Override",
"public",
"List",
"<",
"Task",
">",
"createTasks",
"(",
"List",
"<",
"Task",
">",
"tasks",
")",
"{",
"validateTasks",
"(",
"tasks",
")",
";",
"String",
"workflowId",
"=",
"tasks",
".",
"get",
"(",
"0",
")",
".",
"getWorkflowInstanceId",
... | Inserts tasks into the Cassandra datastore.
<b>Note:</b>
Creates the task_id to workflow_id mapping in the task_lookup table first.
Once this succeeds, inserts the tasks into the workflows table. Tasks belonging to the same shard are created using batch statements.
@param tasks tasks to be created | [
"Inserts",
"tasks",
"into",
"the",
"Cassandra",
"datastore",
".",
"<b",
">",
"Note",
":",
"<",
"/",
"b",
">",
"Creates",
"the",
"task_id",
"to",
"workflow_id",
"mapping",
"in",
"the",
"task_lookup",
"table",
"first",
".",
"Once",
"this",
"succeeds",
"inser... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/cassandra-persistence/src/main/java/com/netflix/conductor/dao/cassandra/CassandraExecutionDAO.java#L127-L165 |
google/error-prone | check_api/src/main/java/com/google/errorprone/bugpatterns/BugChecker.java | BugChecker.describeMatch | @CheckReturnValue
protected Description describeMatch(DiagnosticPosition position, Fix fix) {
"""
Helper to create a Description for the common case where there is a fix.
"""
return buildDescription(position).addFix(fix).build();
} | java | @CheckReturnValue
protected Description describeMatch(DiagnosticPosition position, Fix fix) {
return buildDescription(position).addFix(fix).build();
} | [
"@",
"CheckReturnValue",
"protected",
"Description",
"describeMatch",
"(",
"DiagnosticPosition",
"position",
",",
"Fix",
"fix",
")",
"{",
"return",
"buildDescription",
"(",
"position",
")",
".",
"addFix",
"(",
"fix",
")",
".",
"build",
"(",
")",
";",
"}"
] | Helper to create a Description for the common case where there is a fix. | [
"Helper",
"to",
"create",
"a",
"Description",
"for",
"the",
"common",
"case",
"where",
"there",
"is",
"a",
"fix",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/bugpatterns/BugChecker.java#L123-L126 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.tableClass | public static String tableClass(String clazz, String... content) {
"""
Build a HTML Table with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for table element
@param content c... | java | public static String tableClass(String clazz, String... content) {
return tagClass(Html.Tag.TABLE, clazz, content);
} | [
"public",
"static",
"String",
"tableClass",
"(",
"String",
"clazz",
",",
"String",
"...",
"content",
")",
"{",
"return",
"tagClass",
"(",
"Html",
".",
"Tag",
".",
"TABLE",
",",
"clazz",
",",
"content",
")",
";",
"}"
] | Build a HTML Table with given CSS class for a string.
Given content does <b>not</b> consists of HTML snippets and
as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}.
@param clazz class for table element
@param content content string
@return HTML table element as string | [
"Build",
"a",
"HTML",
"Table",
"with",
"given",
"CSS",
"class",
"for",
"a",
"string",
".",
"Given",
"content",
"does",
"<b",
">",
"not<",
"/",
"b",
">",
"consists",
"of",
"HTML",
"snippets",
"and",
"as",
"such",
"is",
"being",
"prepared",
"with",
"{",
... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L67-L69 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/beans/SimpleBeanInfo.java | SimpleBeanInfo.introspectProperties | @SuppressWarnings("unchecked")
private List<PropertyDescriptor> introspectProperties(Method[] methodDescriptors) {
"""
Introspects the supplied class and returns a list of the Properties of
the class.
@param methodDescriptors the method descriptors
@return The list of Properties as an array of PropertyDes... | java | @SuppressWarnings("unchecked")
private List<PropertyDescriptor> introspectProperties(Method[] methodDescriptors) {
// Get the list of public non-static methods into an array
if (methodDescriptors == null) {
return null;
}
HashMap<String, HashMap> propertyTable = new Has... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"List",
"<",
"PropertyDescriptor",
">",
"introspectProperties",
"(",
"Method",
"[",
"]",
"methodDescriptors",
")",
"{",
"// Get the list of public non-static methods into an array",
"if",
"(",
"methodDescriptors... | Introspects the supplied class and returns a list of the Properties of
the class.
@param methodDescriptors the method descriptors
@return The list of Properties as an array of PropertyDescriptors | [
"Introspects",
"the",
"supplied",
"class",
"and",
"returns",
"a",
"list",
"of",
"the",
"Properties",
"of",
"the",
"class",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/beans/SimpleBeanInfo.java#L95-L137 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertBlob | public static Object convertBlob(Connection conn, String value) throws SQLException {
"""
Transfers data from String into sql.Blob
@param conn connection for which sql.Blob object would be created
@param value String
@return sql.Blob from String
@throws SQLException
"""
return convertBlob(conn, ... | java | public static Object convertBlob(Connection conn, String value) throws SQLException {
return convertBlob(conn, value.getBytes());
} | [
"public",
"static",
"Object",
"convertBlob",
"(",
"Connection",
"conn",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"return",
"convertBlob",
"(",
"conn",
",",
"value",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | Transfers data from String into sql.Blob
@param conn connection for which sql.Blob object would be created
@param value String
@return sql.Blob from String
@throws SQLException | [
"Transfers",
"data",
"from",
"String",
"into",
"sql",
".",
"Blob"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L107-L109 |
opencb/datastore | datastore-hbase/src/main/java/org/opencb/datastore/hbase/HBaseNativeQuery.java | HBaseNativeQuery.find | public Result find(String rowKey, List<String> returnFields, QueryOptions options) throws IOException {
"""
Returns the result from a query to a single row, performed using a Get
object from HBase API.
@param rowKey Row key to query
@param returnFields List of fields to return, in pairs of format cf:col
@par... | java | public Result find(String rowKey, List<String> returnFields, QueryOptions options) throws IOException {
Get get = new Get(rowKey.getBytes());
if (returnFields != null) {
for (String field : returnFields) {
String[] parts = field.split(":");
get.addCol... | [
"public",
"Result",
"find",
"(",
"String",
"rowKey",
",",
"List",
"<",
"String",
">",
"returnFields",
",",
"QueryOptions",
"options",
")",
"throws",
"IOException",
"{",
"Get",
"get",
"=",
"new",
"Get",
"(",
"rowKey",
".",
"getBytes",
"(",
")",
")",
";",
... | Returns the result from a query to a single row, performed using a Get
object from HBase API.
@param rowKey Row key to query
@param returnFields List of fields to return, in pairs of format cf:col
@param options
@return
@throws IOException | [
"Returns",
"the",
"result",
"from",
"a",
"query",
"to",
"a",
"single",
"row",
"performed",
"using",
"a",
"Get",
"object",
"from",
"HBase",
"API",
"."
] | train | https://github.com/opencb/datastore/blob/c6b92b30385d5fc5cc191e2db96c46b0389a88c7/datastore-hbase/src/main/java/org/opencb/datastore/hbase/HBaseNativeQuery.java#L69-L87 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/AbstractTreebankParserParams.java | AbstractTreebankParserParams.typedDependencyObjectify | public static Collection<List<String>> typedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
"""
Returns a collection of word-word dependencies typed by mother, head, daughter node syntactic categories.
"""
return dependencyObjectify(t, hf, collinizer, new TypedDependencyTyper(hf))... | java | public static Collection<List<String>> typedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) {
return dependencyObjectify(t, hf, collinizer, new TypedDependencyTyper(hf));
} | [
"public",
"static",
"Collection",
"<",
"List",
"<",
"String",
">",
">",
"typedDependencyObjectify",
"(",
"Tree",
"t",
",",
"HeadFinder",
"hf",
",",
"TreeTransformer",
"collinizer",
")",
"{",
"return",
"dependencyObjectify",
"(",
"t",
",",
"hf",
",",
"collinize... | Returns a collection of word-word dependencies typed by mother, head, daughter node syntactic categories. | [
"Returns",
"a",
"collection",
"of",
"word",
"-",
"word",
"dependencies",
"typed",
"by",
"mother",
"head",
"daughter",
"node",
"syntactic",
"categories",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/AbstractTreebankParserParams.java#L358-L360 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/internal/util/Checks.java | Checks.checkNotNullState | public static void checkNotNullState(Object object, String message, Object... args) {
"""
Checks that {@code object} is not null.
@param object the object that cannot be null
@param message the error message if {@code condition} is false
@param args the arguments to the error message
@throws Illegal... | java | public static void checkNotNullState(Object object, String message, Object... args) {
checkState(object != null, message, args);
} | [
"public",
"static",
"void",
"checkNotNullState",
"(",
"Object",
"object",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"checkState",
"(",
"object",
"!=",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Checks that {@code object} is not null.
@param object the object that cannot be null
@param message the error message if {@code condition} is false
@param args the arguments to the error message
@throws IllegalStateException if {@code object} is null | [
"Checks",
"that",
"{",
"@code",
"object",
"}",
"is",
"not",
"null",
"."
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/internal/util/Checks.java#L119-L121 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java | XMLBuilder.addDataElement | public void addDataElement(String elemName, String content, String attrName, String attrValue) {
"""
Same as above but with a single attribute name/value pair as well.
"""
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeData... | java | public void addDataElement(String elemName, String content, String attrName, String attrValue) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", attrName, "", "CDATA", attrValue);
writeDataElement(elemName, attrs, content);
} | [
"public",
"void",
"addDataElement",
"(",
"String",
"elemName",
",",
"String",
"content",
",",
"String",
"attrName",
",",
"String",
"attrValue",
")",
"{",
"AttributesImpl",
"attrs",
"=",
"new",
"AttributesImpl",
"(",
")",
";",
"attrs",
".",
"addAttribute",
"(",... | Same as above but with a single attribute name/value pair as well. | [
"Same",
"as",
"above",
"but",
"with",
"a",
"single",
"attribute",
"name",
"/",
"value",
"pair",
"as",
"well",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/XMLBuilder.java#L105-L109 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addSrcLink | public void addSrcLink(Element typeElement, Content label, Content htmltree) {
"""
Add the link to the content tree.
@param typeElement program element typeElement for which the link will be added
@param label label for the link
@param htmltree the content tree to which the link will be added
"""
... | java | public void addSrcLink(Element typeElement, Content label, Content htmltree) {
if (typeElement == null) {
return;
}
TypeElement te = utils.getEnclosingTypeElement(typeElement);
if (te == null) {
// must be a typeElement since in has no containing class.
... | [
"public",
"void",
"addSrcLink",
"(",
"Element",
"typeElement",
",",
"Content",
"label",
",",
"Content",
"htmltree",
")",
"{",
"if",
"(",
"typeElement",
"==",
"null",
")",
"{",
"return",
";",
"}",
"TypeElement",
"te",
"=",
"utils",
".",
"getEnclosingTypeEleme... | Add the link to the content tree.
@param typeElement program element typeElement for which the link will be added
@param label label for the link
@param htmltree the content tree to which the link will be added | [
"Add",
"the",
"link",
"to",
"the",
"content",
"tree",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1165-L1180 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/MissingSuperCall.java | MissingSuperCall.matchAnnotation | @Override
public Description matchAnnotation(AnnotationTree tree, VisitorState state) {
"""
Prevents abstract methods from being annotated with {@code @CallSuper} et al. It doesn't make
sense to require overriders to call a method with no implementation.
"""
if (!ANNOTATION_MATCHER.matches(tree, state))... | java | @Override
public Description matchAnnotation(AnnotationTree tree, VisitorState state) {
if (!ANNOTATION_MATCHER.matches(tree, state)) {
return Description.NO_MATCH;
}
MethodTree methodTree = ASTHelpers.findEnclosingNode(state.getPath(), MethodTree.class);
if (methodTree == null) {
return ... | [
"@",
"Override",
"public",
"Description",
"matchAnnotation",
"(",
"AnnotationTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"if",
"(",
"!",
"ANNOTATION_MATCHER",
".",
"matches",
"(",
"tree",
",",
"state",
")",
")",
"{",
"return",
"Description",
".",
... | Prevents abstract methods from being annotated with {@code @CallSuper} et al. It doesn't make
sense to require overriders to call a method with no implementation. | [
"Prevents",
"abstract",
"methods",
"from",
"being",
"annotated",
"with",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/MissingSuperCall.java#L98-L129 |
kaazing/gateway | transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java | LoggingUtils.resolveIdentity | private static String resolveIdentity(SocketAddress address, IoSessionEx session) {
"""
Method performing identity resolution - attempts to extract a subject from the current
IoSessionEx session
@param address
@param session
@return
"""
if (address instanceof ResourceAddress) {
Subject ... | java | private static String resolveIdentity(SocketAddress address, IoSessionEx session) {
if (address instanceof ResourceAddress) {
Subject subject = session.getSubject();
if (subject == null) {
subject = new Subject();
}
return resolveIdentity((Resource... | [
"private",
"static",
"String",
"resolveIdentity",
"(",
"SocketAddress",
"address",
",",
"IoSessionEx",
"session",
")",
"{",
"if",
"(",
"address",
"instanceof",
"ResourceAddress",
")",
"{",
"Subject",
"subject",
"=",
"session",
".",
"getSubject",
"(",
")",
";",
... | Method performing identity resolution - attempts to extract a subject from the current
IoSessionEx session
@param address
@param session
@return | [
"Method",
"performing",
"identity",
"resolution",
"-",
"attempts",
"to",
"extract",
"a",
"subject",
"from",
"the",
"current",
"IoSessionEx",
"session"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/transport/spi/src/main/java/org/kaazing/gateway/transport/LoggingUtils.java#L160-L169 |
groovy/groovy-core | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.eachRow | public void eachRow(String sql, List<Object> params, Closure metaClosure, Closure rowClosure) throws SQLException {
"""
Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>ResultSet</code>
that supports accessing ... | java | public void eachRow(String sql, List<Object> params, Closure metaClosure, Closure rowClosure) throws SQLException {
eachRow(sql, params, metaClosure, 0, 0, rowClosure);
} | [
"public",
"void",
"eachRow",
"(",
"String",
"sql",
",",
"List",
"<",
"Object",
">",
"params",
",",
"Closure",
"metaClosure",
",",
"Closure",
"rowClosure",
")",
"throws",
"SQLException",
"{",
"eachRow",
"(",
"sql",
",",
"params",
",",
"metaClosure",
",",
"0... | Performs the given SQL query calling the given Closure with each row of the result set.
The row will be a <code>GroovyResultSet</code> which is a <code>ResultSet</code>
that supports accessing the fields using property style notation and ordinal index values.
In addition, the <code>metaClosure</code> will be called onc... | [
"Performs",
"the",
"given",
"SQL",
"query",
"calling",
"the",
"given",
"Closure",
"with",
"each",
"row",
"of",
"the",
"result",
"set",
".",
"The",
"row",
"will",
"be",
"a",
"<code",
">",
"GroovyResultSet<",
"/",
"code",
">",
"which",
"is",
"a",
"<code",
... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L1336-L1338 |
jhalterman/concurrentunit | src/main/java/net/jodah/concurrentunit/internal/ReentrantCircuit.java | ReentrantCircuit.await | public boolean await(long waitDuration, TimeUnit timeUnit) throws InterruptedException {
"""
Waits for the {@code waitDuration} until the circuit has been closed, aborting if interrupted,
returning true if the circuit is closed else false.
"""
return sync.tryAcquireSharedNanos(0, timeUnit.toNanos(waitDura... | java | public boolean await(long waitDuration, TimeUnit timeUnit) throws InterruptedException {
return sync.tryAcquireSharedNanos(0, timeUnit.toNanos(waitDuration));
} | [
"public",
"boolean",
"await",
"(",
"long",
"waitDuration",
",",
"TimeUnit",
"timeUnit",
")",
"throws",
"InterruptedException",
"{",
"return",
"sync",
".",
"tryAcquireSharedNanos",
"(",
"0",
",",
"timeUnit",
".",
"toNanos",
"(",
"waitDuration",
")",
")",
";",
"... | Waits for the {@code waitDuration} until the circuit has been closed, aborting if interrupted,
returning true if the circuit is closed else false. | [
"Waits",
"for",
"the",
"{"
] | train | https://github.com/jhalterman/concurrentunit/blob/403b82537866e5ba598017d874753e12fa7aab10/src/main/java/net/jodah/concurrentunit/internal/ReentrantCircuit.java#L84-L86 |
centic9/commons-dost | src/main/java/org/dstadler/commons/graphviz/DotUtils.java | DotUtils.writeln | public static void writeln(final Writer writer, final String string, int indentLevel) throws IOException {
"""
Write out the string and a newline, appending a number of tabs to
properly indent the resulting text-file.
@param writer The writer for the .dot-file
@param string The text to write
@param indentLev... | java | public static void writeln(final Writer writer, final String string, int indentLevel) throws IOException {
writer.write(StringUtils.repeat("\t", indentLevel) + string);
writer.write("\n");
} | [
"public",
"static",
"void",
"writeln",
"(",
"final",
"Writer",
"writer",
",",
"final",
"String",
"string",
",",
"int",
"indentLevel",
")",
"throws",
"IOException",
"{",
"writer",
".",
"write",
"(",
"StringUtils",
".",
"repeat",
"(",
"\"\\t\"",
",",
"indentLe... | Write out the string and a newline, appending a number of tabs to
properly indent the resulting text-file.
@param writer The writer for the .dot-file
@param string The text to write
@param indentLevel How much to indent the line
@throws IOException if writing to the Writer fails | [
"Write",
"out",
"the",
"string",
"and",
"a",
"newline",
"appending",
"a",
"number",
"of",
"tabs",
"to",
"properly",
"indent",
"the",
"resulting",
"text",
"-",
"file",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/graphviz/DotUtils.java#L45-L48 |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/definition/DefaultJobDefinition.java | DefaultJobDefinition.retryableFixedDelayJobDefinition | public static DefaultJobDefinition retryableFixedDelayJobDefinition(final String jobType,
final String jobName,
final String description,
... | java | public static DefaultJobDefinition retryableFixedDelayJobDefinition(final String jobType,
final String jobName,
final String description,
... | [
"public",
"static",
"DefaultJobDefinition",
"retryableFixedDelayJobDefinition",
"(",
"final",
"String",
"jobType",
",",
"final",
"String",
"jobName",
",",
"final",
"String",
"description",
",",
"final",
"Duration",
"fixedDelay",
",",
"final",
"int",
"restarts",
",",
... | Create a JobDefinition that is using fixed delays specify, when and how often the job should be triggered.
@param jobType The type of the Job
@param jobName A human readable name of the Job
@param description A human readable description of the Job.
@param fixedDelay The delay duration between to executions o... | [
"Create",
"a",
"JobDefinition",
"that",
"is",
"using",
"fixed",
"delays",
"specify",
"when",
"and",
"how",
"often",
"the",
"job",
"should",
"be",
"triggered",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/definition/DefaultJobDefinition.java#L129-L138 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PushbackInputStream.java | PushbackInputStream.unread | public void unread(byte[] b, int off, int len) throws IOException {
"""
Pushes back a portion of an array of bytes by copying it to the front
of the pushback buffer. After this method returns, the next byte to be
read will have the value <code>b[off]</code>, the byte after that will
have the value <code>b[off+... | java | public void unread(byte[] b, int off, int len) throws IOException {
ensureOpen();
if (len > pos) {
throw new IOException("Push back buffer is full");
}
pos -= len;
System.arraycopy(b, off, buf, pos, len);
} | [
"public",
"void",
"unread",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"len",
">",
"pos",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Push back buf... | Pushes back a portion of an array of bytes by copying it to the front
of the pushback buffer. After this method returns, the next byte to be
read will have the value <code>b[off]</code>, the byte after that will
have the value <code>b[off+1]</code>, and so forth.
@param b the byte array to push back.
@param off the s... | [
"Pushes",
"back",
"a",
"portion",
"of",
"an",
"array",
"of",
"bytes",
"by",
"copying",
"it",
"to",
"the",
"front",
"of",
"the",
"pushback",
"buffer",
".",
"After",
"this",
"method",
"returns",
"the",
"next",
"byte",
"to",
"be",
"read",
"will",
"have",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/PushbackInputStream.java#L229-L236 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/ServerSocketEndpointConfig.java | ServerSocketEndpointConfig.setPort | public ServerSocketEndpointConfig setPort(int port) {
"""
Sets the port the Hazelcast member will try to bind on.
A valid port value is between 0 and 65535.
A port number of 0 will let the system pick up an ephemeral port.
@param port the port the Hazelcast member will try to bind on
@return NetworkConfig ... | java | public ServerSocketEndpointConfig setPort(int port) {
if (port < 0 || port > PORT_MAX) {
throw new IllegalArgumentException("Port out of range: " + port + ". Allowed range [0,65535]");
}
this.port = port;
return this;
} | [
"public",
"ServerSocketEndpointConfig",
"setPort",
"(",
"int",
"port",
")",
"{",
"if",
"(",
"port",
"<",
"0",
"||",
"port",
">",
"PORT_MAX",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Port out of range: \"",
"+",
"port",
"+",
"\". Allowed rang... | Sets the port the Hazelcast member will try to bind on.
A valid port value is between 0 and 65535.
A port number of 0 will let the system pick up an ephemeral port.
@param port the port the Hazelcast member will try to bind on
@return NetworkConfig the updated NetworkConfig
@see #getPort()
@see #setPortAutoIncrement(... | [
"Sets",
"the",
"port",
"the",
"Hazelcast",
"member",
"will",
"try",
"to",
"bind",
"on",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/ServerSocketEndpointConfig.java#L97-L103 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java | MultiUserChatLight.setRoomConfigs | public void setRoomConfigs(HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Set the room configurations.
@param customConfigs
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedExceptio... | java | public void setRoomConfigs(HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
setRoomConfigs(null, customConfigs);
} | [
"public",
"void",
"setRoomConfigs",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"customConfigs",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"setRoomConfigs",
"(",
"null",
",",... | Set the room configurations.
@param customConfigs
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Set",
"the",
"room",
"configurations",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java#L484-L487 |
FitLayout/classify | src/main/java/org/fit/layout/classify/articles/ArticleFeatureExtractor.java | ArticleFeatureExtractor.countAreas | private int countAreas(Area a, Rectangular r) {
"""
Counts the number of sub-areas in the specified region of the area
@param a the area to be examined
@param r the grid region of the area to be examined
@return the number of visual areas in the specified area of the grid
"""
int ret = 0;
... | java | private int countAreas(Area a, Rectangular r)
{
int ret = 0;
for (int i = 0; i < a.getChildCount(); i++)
{
Area n = a.getChildAt(i);
if (a.getTopology().getPosition(n).intersects(r))
ret++;
}
return ret;
} | [
"private",
"int",
"countAreas",
"(",
"Area",
"a",
",",
"Rectangular",
"r",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"getChildCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"Area",
"n",
"="... | Counts the number of sub-areas in the specified region of the area
@param a the area to be examined
@param r the grid region of the area to be examined
@return the number of visual areas in the specified area of the grid | [
"Counts",
"the",
"number",
"of",
"sub",
"-",
"areas",
"in",
"the",
"specified",
"region",
"of",
"the",
"area"
] | train | https://github.com/FitLayout/classify/blob/0b43ceb2f0be4e6d26263491893884d811f0d605/src/main/java/org/fit/layout/classify/articles/ArticleFeatureExtractor.java#L346-L357 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.dateFormat | protected static void dateFormat(String pattern, String... attributeNames) {
"""
Registers date format for specified attributes. This format will be used to convert between
Date -> String -> java.sql.Date when using the appropriate getters and setters.
<p>For example:
<blockquote><pre>
public class Person ex... | java | protected static void dateFormat(String pattern, String... attributeNames) {
ModelDelegate.dateFormat(modelClass(), pattern, attributeNames);
} | [
"protected",
"static",
"void",
"dateFormat",
"(",
"String",
"pattern",
",",
"String",
"...",
"attributeNames",
")",
"{",
"ModelDelegate",
".",
"dateFormat",
"(",
"modelClass",
"(",
")",
",",
"pattern",
",",
"attributeNames",
")",
";",
"}"
] | Registers date format for specified attributes. This format will be used to convert between
Date -> String -> java.sql.Date when using the appropriate getters and setters.
<p>For example:
<blockquote><pre>
public class Person extends Model {
static {
dateFormat("MM/dd/yyyy", "dob");
}
}
Person p = new Person();
// wi... | [
"Registers",
"date",
"format",
"for",
"specified",
"attributes",
".",
"This",
"format",
"will",
"be",
"used",
"to",
"convert",
"between",
"Date",
"-",
">",
"String",
"-",
">",
"java",
".",
"sql",
".",
"Date",
"when",
"using",
"the",
"appropriate",
"getters... | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L2126-L2128 |
iipc/webarchive-commons | src/main/java/org/archive/format/cdx/FieldSplitLine.java | FieldSplitLine.getField | public String getField(String name, String defaultVal) {
"""
Return field for given name, or defaultVal if not found
@param name
@return
"""
int index = getFieldIndex(name);
return (isInRange(index) ? this.fields.get(index) : defaultVal);
} | java | public String getField(String name, String defaultVal) {
int index = getFieldIndex(name);
return (isInRange(index) ? this.fields.get(index) : defaultVal);
} | [
"public",
"String",
"getField",
"(",
"String",
"name",
",",
"String",
"defaultVal",
")",
"{",
"int",
"index",
"=",
"getFieldIndex",
"(",
"name",
")",
";",
"return",
"(",
"isInRange",
"(",
"index",
")",
"?",
"this",
".",
"fields",
".",
"get",
"(",
"inde... | Return field for given name, or defaultVal if not found
@param name
@return | [
"Return",
"field",
"for",
"given",
"name",
"or",
"defaultVal",
"if",
"not",
"found"
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/format/cdx/FieldSplitLine.java#L94-L97 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.optionsAsync | public CompletableFuture<Object> optionsAsync(final Consumer<HttpConfig> configuration) {
"""
Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to `options(Consumer)`), with additional configuration
provided by the configuration function.
This method is generally used for Java-... | java | public CompletableFuture<Object> optionsAsync(final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> options(configuration), getExecutor());
} | [
"public",
"CompletableFuture",
"<",
"Object",
">",
"optionsAsync",
"(",
"final",
"Consumer",
"<",
"HttpConfig",
">",
"configuration",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",
")",
"->",
"options",
"(",
"configuration",
")",
",",
"... | Executes an asynchronous OPTIONS request on the configured URI (asynchronous alias to `options(Consumer)`), with additional configuration
provided by the configuration function.
This method is generally used for Java-specific configuration.
[source,java]
----
HttpBuilder http = HttpBuilder.configure(config -> {
confi... | [
"Executes",
"an",
"asynchronous",
"OPTIONS",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"options",
"(",
"Consumer",
")",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"function",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1928-L1930 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java | AbstractMultiDataSetNormalizer.revertFeatures | public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays) {
"""
Undo (revert) the normalization applied by this normalizer to the features arrays
@param features Features to revert the normalization on
"""
for (int i = 0; i < features.length; i++) {
INDArray mask = ... | java | public void revertFeatures(@NonNull INDArray[] features, INDArray[] maskArrays) {
for (int i = 0; i < features.length; i++) {
INDArray mask = (maskArrays == null ? null : maskArrays[i]);
revertFeatures(features[i], mask, i);
}
} | [
"public",
"void",
"revertFeatures",
"(",
"@",
"NonNull",
"INDArray",
"[",
"]",
"features",
",",
"INDArray",
"[",
"]",
"maskArrays",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"features",
".",
"length",
";",
"i",
"++",
")",
"{",
"IND... | Undo (revert) the normalization applied by this normalizer to the features arrays
@param features Features to revert the normalization on | [
"Undo",
"(",
"revert",
")",
"the",
"normalization",
"applied",
"by",
"this",
"normalizer",
"to",
"the",
"features",
"arrays"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java#L220-L225 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ApplicationsImpl.java | ApplicationsImpl.listAsync | public ServiceFuture<List<ApplicationSummary>> listAsync(final ListOperationCallback<ApplicationSummary> serviceCallback) {
"""
Lists all of the applications available in the specified account.
This operation returns only applications and versions that are available for use on compute nodes; that is, that can be ... | java | public ServiceFuture<List<ApplicationSummary>> listAsync(final ListOperationCallback<ApplicationSummary> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listSinglePageAsync(),
new Func1<String, Observable<ServiceResponseWithHeaders<Page<ApplicationSummary>, Applicati... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"ApplicationSummary",
">",
">",
"listAsync",
"(",
"final",
"ListOperationCallback",
"<",
"ApplicationSummary",
">",
"serviceCallback",
")",
"{",
"return",
"AzureServiceFuture",
".",
"fromHeaderPageResponse",
"(",
"listSingleP... | Lists all of the applications available in the specified account.
This operation returns only applications and versions that are available for use on compute nodes; that is, that can be used in an application package reference. For administrator information about applications and versions that are not yet available to ... | [
"Lists",
"all",
"of",
"the",
"applications",
"available",
"in",
"the",
"specified",
"account",
".",
"This",
"operation",
"returns",
"only",
"applications",
"and",
"versions",
"that",
"are",
"available",
"for",
"use",
"on",
"compute",
"nodes",
";",
"that",
"is"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ApplicationsImpl.java#L110-L120 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayAttention | public void displayAttention (String bundle, String message) {
"""
Display a system ATTENTION message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Attention messages are sent when something requires user action that did not result from
direct action by the user.
... | java | public void displayAttention (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.ATTENTION, PLACE_CHAT_TYPE);
} | [
"public",
"void",
"displayAttention",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"ATTENTION",
",",
"PLACE_CHAT_TYPE",
")",
";",
"}"
] | Display a system ATTENTION message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Attention messages are sent when something requires user action that did not result from
direct action by the user. | [
"Display",
"a",
"system",
"ATTENTION",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
".",
"The",
"localtype",
"of",
"the",
"message",
"will",
"be",
"PLACE_CHAT_TYPE",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L356-L359 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxAPIConnection.java | BoxAPIConnection.getLowerScopedToken | public ScopedToken getLowerScopedToken(List<String> scopes, String resource) {
"""
Get a lower-scoped token restricted to a resource for the list of scopes that are passed.
@param scopes the list of scopes to which the new token should be restricted for
@param resource the resource for which the new token has to... | java | public ScopedToken getLowerScopedToken(List<String> scopes, String resource) {
assert (scopes != null);
assert (scopes.size() > 0);
URL url = null;
try {
url = new URL(this.getTokenURL());
} catch (MalformedURLException e) {
assert false : "An invalid refr... | [
"public",
"ScopedToken",
"getLowerScopedToken",
"(",
"List",
"<",
"String",
">",
"scopes",
",",
"String",
"resource",
")",
"{",
"assert",
"(",
"scopes",
"!=",
"null",
")",
";",
"assert",
"(",
"scopes",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"URL",
... | Get a lower-scoped token restricted to a resource for the list of scopes that are passed.
@param scopes the list of scopes to which the new token should be restricted for
@param resource the resource for which the new token has to be obtained
@return scopedToken which has access token and other details | [
"Get",
"a",
"lower",
"-",
"scoped",
"token",
"restricted",
"to",
"a",
"resource",
"for",
"the",
"list",
"of",
"scopes",
"that",
"are",
"passed",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIConnection.java#L680-L733 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.addWorkListItemsForClasspath | private void addWorkListItemsForClasspath(LinkedList<WorkListItem> workList, String path) {
"""
Add worklist items from given system classpath.
@param workList
the worklist
@param path
a system classpath
"""
if (path == null) {
return;
}
StringTokenizer st = new Strin... | java | private void addWorkListItemsForClasspath(LinkedList<WorkListItem> workList, String path) {
if (path == null) {
return;
}
StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
while (st.hasMoreTokens()) {
String entry = st.nextToken();
i... | [
"private",
"void",
"addWorkListItemsForClasspath",
"(",
"LinkedList",
"<",
"WorkListItem",
">",
"workList",
",",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
";",
"}",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
... | Add worklist items from given system classpath.
@param workList
the worklist
@param path
a system classpath | [
"Add",
"worklist",
"items",
"from",
"given",
"system",
"classpath",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L519-L533 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java | MetadataStore.getOrAssignSegmentId | @VisibleForTesting
CompletableFuture<Long> getOrAssignSegmentId(String streamSegmentName, Duration timeout) {
"""
Same as {@link #getOrAssignSegmentId(String, Duration, Function)) except that this simply returns a CompletableFuture
with the SegmentId.
@param streamSegmentName The case-sensitive StreamSegme... | java | @VisibleForTesting
CompletableFuture<Long> getOrAssignSegmentId(String streamSegmentName, Duration timeout) {
return getOrAssignSegmentId(streamSegmentName, timeout, CompletableFuture::completedFuture);
} | [
"@",
"VisibleForTesting",
"CompletableFuture",
"<",
"Long",
">",
"getOrAssignSegmentId",
"(",
"String",
"streamSegmentName",
",",
"Duration",
"timeout",
")",
"{",
"return",
"getOrAssignSegmentId",
"(",
"streamSegmentName",
",",
"timeout",
",",
"CompletableFuture",
"::",... | Same as {@link #getOrAssignSegmentId(String, Duration, Function)) except that this simply returns a CompletableFuture
with the SegmentId.
@param streamSegmentName The case-sensitive StreamSegment Name.
@param timeout The timeout for the operation.
@return A CompletableFuture that, when completed normally, wi... | [
"Same",
"as",
"{",
"@link",
"#getOrAssignSegmentId",
"(",
"String",
"Duration",
"Function",
"))",
"except",
"that",
"this",
"simply",
"returns",
"a",
"CompletableFuture",
"with",
"the",
"SegmentId",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/containers/MetadataStore.java#L369-L372 |
super-csv/super-csv | super-csv-java8/src/main/java/org/supercsv/cellprocessor/time/FmtZoneId.java | FmtZoneId.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException if value is null or not a ZoneId
"""
validateInputNotNull(value, context);
if( !(value instanceof ZoneId) ) {
throw new SuperCsvCellProcessorException(ZoneId.class, value, co... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
if( !(value instanceof ZoneId) ) {
throw new SuperCsvCellProcessorException(ZoneId.class, value, context, this);
}
final ZoneId zoneId = (ZoneId) value;
final String result;
if (textStyle != null &... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"if",
"(",
"!",
"(",
"value",
"instanceof",
"ZoneId",
")",
")",
"{",
"throw",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException if value is null or not a ZoneId | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv-java8/src/main/java/org/supercsv/cellprocessor/time/FmtZoneId.java#L100-L113 |
h2oai/h2o-3 | h2o-core/src/main/java/water/api/GridSearchHandler.java | GridSearchHandler.validateHyperParams | protected void validateHyperParams(P params, Map<String, Object[]> hyperParams) {
"""
Validate given hyper parameters with respect to type parameter P.
It verifies that given parameters are annotated in P with @API annotation
@param params regular model build parameters
@param hyperParams map of hyper ... | java | protected void validateHyperParams(P params, Map<String, Object[]> hyperParams) {
List<SchemaMetadata.FieldMetadata> fsMeta = SchemaMetadata.getFieldMetadata(params);
for (Map.Entry<String, Object[]> hparam : hyperParams.entrySet()) {
SchemaMetadata.FieldMetadata fieldMetadata = null;
// Found corre... | [
"protected",
"void",
"validateHyperParams",
"(",
"P",
"params",
",",
"Map",
"<",
"String",
",",
"Object",
"[",
"]",
">",
"hyperParams",
")",
"{",
"List",
"<",
"SchemaMetadata",
".",
"FieldMetadata",
">",
"fsMeta",
"=",
"SchemaMetadata",
".",
"getFieldMetadata"... | Validate given hyper parameters with respect to type parameter P.
It verifies that given parameters are annotated in P with @API annotation
@param params regular model build parameters
@param hyperParams map of hyper parameters | [
"Validate",
"given",
"hyper",
"parameters",
"with",
"respect",
"to",
"type",
"parameter",
"P",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/GridSearchHandler.java#L131-L152 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.createJob | public void createJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException {
"""
Adds a job to the Batch account.
@param jobId The ID of the job to be added.
@param poolInfo Specifies how a job should be assigned to a pool.
@throws BatchErrorException Exception thrown when an error ... | java | public void createJob(String jobId, PoolInformation poolInfo) throws BatchErrorException, IOException {
createJob(jobId, poolInfo, null);
} | [
"public",
"void",
"createJob",
"(",
"String",
"jobId",
",",
"PoolInformation",
"poolInfo",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"createJob",
"(",
"jobId",
",",
"poolInfo",
",",
"null",
")",
";",
"}"
] | Adds a job to the Batch account.
@param jobId The ID of the job to be added.
@param poolInfo Specifies how a job should be assigned to a pool.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOException Exception thrown when there is an error in serializa... | [
"Adds",
"a",
"job",
"to",
"the",
"Batch",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L276-L278 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsHistoryDriver.java | CmsHistoryDriver.internalCreateProject | protected CmsHistoryProject internalCreateProject(ResultSet res, List<String> resources) throws SQLException {
"""
Creates a historical project from the given result set and resources.<p>
@param res the resource set
@param resources the historical resources
@return the historical project
@throws SQLExcepti... | java | protected CmsHistoryProject internalCreateProject(ResultSet res, List<String> resources) throws SQLException {
String ou = CmsOrganizationalUnit.removeLeadingSeparator(
res.getString(m_sqlManager.readQuery("C_PROJECTS_PROJECT_OU_0")));
CmsUUID publishedById = new CmsUUID(res.getString(m_sql... | [
"protected",
"CmsHistoryProject",
"internalCreateProject",
"(",
"ResultSet",
"res",
",",
"List",
"<",
"String",
">",
"resources",
")",
"throws",
"SQLException",
"{",
"String",
"ou",
"=",
"CmsOrganizationalUnit",
".",
"removeLeadingSeparator",
"(",
"res",
".",
"getSt... | Creates a historical project from the given result set and resources.<p>
@param res the resource set
@param resources the historical resources
@return the historical project
@throws SQLException if something goes wrong | [
"Creates",
"a",
"historical",
"project",
"from",
"the",
"given",
"result",
"set",
"and",
"resources",
".",
"<p",
">",
"@param",
"res",
"the",
"resource",
"set",
"@param",
"resources",
"the",
"historical",
"resources"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsHistoryDriver.java#L1698-L1717 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java | DependencyBundlingAnalyzer.namesAreEqual | private boolean namesAreEqual(Dependency dependency, Dependency nextDependency) {
"""
Determine if the dependency name is equal in the given dependencies.
@param dependency a dependency to compare
@param nextDependency a dependency to compare
@return true if the name is equal in both dependencies; otherwise f... | java | private boolean namesAreEqual(Dependency dependency, Dependency nextDependency) {
return dependency.getName() != null && dependency.getName().equals(nextDependency.getName());
} | [
"private",
"boolean",
"namesAreEqual",
"(",
"Dependency",
"dependency",
",",
"Dependency",
"nextDependency",
")",
"{",
"return",
"dependency",
".",
"getName",
"(",
")",
"!=",
"null",
"&&",
"dependency",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"nextDepend... | Determine if the dependency name is equal in the given dependencies.
@param dependency a dependency to compare
@param nextDependency a dependency to compare
@return true if the name is equal in both dependencies; otherwise false | [
"Determine",
"if",
"the",
"dependency",
"name",
"is",
"equal",
"in",
"the",
"given",
"dependencies",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L496-L498 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/temporal/TemporalAdjusters.java | TemporalAdjusters.dayOfWeekInMonth | public static TemporalAdjuster dayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek) {
"""
Returns the day-of-week in month adjuster, which returns a new date
in the same month with the ordinal day-of-week.
This is used for expressions like the 'second Tuesday in March'.
<p>
The ISO calendar system behaves as fol... | java | public static TemporalAdjuster dayOfWeekInMonth(int ordinal, DayOfWeek dayOfWeek) {
Jdk8Methods.requireNonNull(dayOfWeek, "dayOfWeek");
return new DayOfWeekInMonth(ordinal, dayOfWeek);
} | [
"public",
"static",
"TemporalAdjuster",
"dayOfWeekInMonth",
"(",
"int",
"ordinal",
",",
"DayOfWeek",
"dayOfWeek",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"dayOfWeek",
",",
"\"dayOfWeek\"",
")",
";",
"return",
"new",
"DayOfWeekInMonth",
"(",
"ordinal",
... | Returns the day-of-week in month adjuster, which returns a new date
in the same month with the ordinal day-of-week.
This is used for expressions like the 'second Tuesday in March'.
<p>
The ISO calendar system behaves as follows:<br>
The input 2011-12-15 for (1,TUESDAY) will return 2011-12-06.<br>
The input 2011-12-15 f... | [
"Returns",
"the",
"day",
"-",
"of",
"-",
"week",
"in",
"month",
"adjuster",
"which",
"returns",
"a",
"new",
"date",
"in",
"the",
"same",
"month",
"with",
"the",
"ordinal",
"day",
"-",
"of",
"-",
"week",
".",
"This",
"is",
"used",
"for",
"expressions",
... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/temporal/TemporalAdjusters.java#L319-L322 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.callUninterruptibly | public static <T> T callUninterruptibly(Try.Callable<T, InterruptedException> cmd) {
"""
Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
timeout elapses, and only then re-int... | java | public static <T> T callUninterruptibly(Try.Callable<T, InterruptedException> cmd) {
N.checkArgNotNull(cmd);
boolean interrupted = false;
try {
while (true) {
try {
return cmd.call();
} catch (InterruptedException e) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"callUninterruptibly",
"(",
"Try",
".",
"Callable",
"<",
"T",
",",
"InterruptedException",
">",
"cmd",
")",
"{",
"N",
".",
"checkArgNotNull",
"(",
"cmd",
")",
";",
"boolean",
"interrupted",
"=",
"false",
";",
"try"... | Note: Copied from Google Guava under Apache License v2.0
<br />
<br />
If a thread is interrupted during such a call, the call continues to block until the result is available or the
timeout elapses, and only then re-interrupts the thread.
@param cmd
@return | [
"Note",
":",
"Copied",
"from",
"Google",
"Guava",
"under",
"Apache",
"License",
"v2",
".",
"0",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L28038-L28055 |
primefaces/primefaces | src/main/java/org/primefaces/component/organigram/OrganigramRenderer.java | OrganigramRenderer.decodeSelection | protected void decodeSelection(FacesContext context, Organigram organigram) {
"""
Checks if the current request is a selection request and
assigns the found {@link OrganigramNode} to the <code>selection</code> value expression.
@param context The current {@link FacesContext}.
@param organigram The {@link O... | java | protected void decodeSelection(FacesContext context, Organigram organigram) {
if (ComponentUtils.isRequestSource(organigram, context)) {
boolean selectionEnabled = organigram.getValueExpression("selection") != null;
if (selectionEnabled) {
Map<String, String> params = c... | [
"protected",
"void",
"decodeSelection",
"(",
"FacesContext",
"context",
",",
"Organigram",
"organigram",
")",
"{",
"if",
"(",
"ComponentUtils",
".",
"isRequestSource",
"(",
"organigram",
",",
"context",
")",
")",
"{",
"boolean",
"selectionEnabled",
"=",
"organigra... | Checks if the current request is a selection request and
assigns the found {@link OrganigramNode} to the <code>selection</code> value expression.
@param context The current {@link FacesContext}.
@param organigram The {@link Organigram} component. | [
"Checks",
"if",
"the",
"current",
"request",
"is",
"a",
"selection",
"request",
"and",
"assigns",
"the",
"found",
"{",
"@link",
"OrganigramNode",
"}",
"to",
"the",
"<code",
">",
"selection<",
"/",
"code",
">",
"value",
"expression",
"."
] | train | https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/component/organigram/OrganigramRenderer.java#L62-L78 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java | BcUtils.getAsymmetricKeyParameter | public static AsymmetricKeyParameter getAsymmetricKeyParameter(PublicKeyParameters publicKey) {
"""
Convert public key parameters to asymmetric key parameter.
@param publicKey the public key parameter to convert.
@return an asymmetric key parameter.
"""
if (publicKey instanceof BcAsymmetricKeyParam... | java | public static AsymmetricKeyParameter getAsymmetricKeyParameter(PublicKeyParameters publicKey)
{
if (publicKey instanceof BcAsymmetricKeyParameters) {
return ((BcAsymmetricKeyParameters) publicKey).getParameters();
} else {
try {
return PublicKeyFactory.createK... | [
"public",
"static",
"AsymmetricKeyParameter",
"getAsymmetricKeyParameter",
"(",
"PublicKeyParameters",
"publicKey",
")",
"{",
"if",
"(",
"publicKey",
"instanceof",
"BcAsymmetricKeyParameters",
")",
"{",
"return",
"(",
"(",
"BcAsymmetricKeyParameters",
")",
"publicKey",
")... | Convert public key parameters to asymmetric key parameter.
@param publicKey the public key parameter to convert.
@return an asymmetric key parameter. | [
"Convert",
"public",
"key",
"parameters",
"to",
"asymmetric",
"key",
"parameter",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/pkix/internal/BcUtils.java#L89-L102 |
nobuoka/android-lib-ZXingCaptureActivity | src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java | CaptureActivityIntents.setDecodeFormats | public static void setDecodeFormats(Intent intent, Collection<BarcodeFormat> formats) {
"""
Set barcode formats to scan for onto {@code Intent}.
This setting precedes to setting by {@code #setDecodeFormats} method.
In case that {@code formats} is empty collection, this method do nothing.
@param intent Target in... | java | public static void setDecodeFormats(Intent intent, Collection<BarcodeFormat> formats) {
StringBuilder sb = new StringBuilder();
for (BarcodeFormat f : formats) {
if (sb.length() != 0) sb.append(",");
sb.append(f.name());
}
String formatsStr = sb.toString();
if (formatsStr.length()... | [
"public",
"static",
"void",
"setDecodeFormats",
"(",
"Intent",
"intent",
",",
"Collection",
"<",
"BarcodeFormat",
">",
"formats",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"BarcodeFormat",
"f",
":",
"formats",
"... | Set barcode formats to scan for onto {@code Intent}.
This setting precedes to setting by {@code #setDecodeFormats} method.
In case that {@code formats} is empty collection, this method do nothing.
@param intent Target intent.
@param formats Barcode formats to scan for. | [
"Set",
"barcode",
"formats",
"to",
"scan",
"for",
"onto",
"{"
] | train | https://github.com/nobuoka/android-lib-ZXingCaptureActivity/blob/17aaa7cf75520d3f2e03db9796b7e8c1d1f1b1e6/src/main/java/info/vividcode/android/zxing/CaptureActivityIntents.java#L38-L46 |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/DateUtilities.java | DateUtilities.isBetweenHours | public static boolean isBetweenHours(long dt, TimeZone tz, int from, int to, int tolerance) {
"""
Returns <CODE>true</CODE> if the given date is inside the start and end hours.
@param dt The date to be checked
@param tz The timezone associated with the date
@param from The start hour to check that the date is a... | java | public static boolean isBetweenHours(long dt, TimeZone tz, int from, int to, int tolerance)
{
long start = 0L;
long end = 0L;
// If from > to then the "to" date may be in the next day
// or the "from" date may be in the previous day, depending
// on whether or not it's ... | [
"public",
"static",
"boolean",
"isBetweenHours",
"(",
"long",
"dt",
",",
"TimeZone",
"tz",
",",
"int",
"from",
",",
"int",
"to",
",",
"int",
"tolerance",
")",
"{",
"long",
"start",
"=",
"0L",
";",
"long",
"end",
"=",
"0L",
";",
"// If from > to then the ... | Returns <CODE>true</CODE> if the given date is inside the start and end hours.
@param dt The date to be checked
@param tz The timezone associated with the date
@param from The start hour to check that the date is after
@param to The end hour to check that the date is before
@param tolerance The tolerance that by the wh... | [
"Returns",
"<CODE",
">",
"true<",
"/",
"CODE",
">",
"if",
"the",
"given",
"date",
"is",
"inside",
"the",
"start",
"and",
"end",
"hours",
"."
] | train | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/DateUtilities.java#L100-L129 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.addNoteAwardEmoji | public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
"""
Add an award emoji for the specified note.
<pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
@param projectIdOrPath ... | java | public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
Response response = post(Response.Status.CREATED, form.asMap(),
"projects", getP... | [
"public",
"AwardEmoji",
"addNoteAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"Integer",
"noteId",
",",
"String",
"name",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"form",
"=",
"new",
"GitLabApiForm",
"(",
")",
".... | Add an award emoji for the specified note.
<pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the issue IID of the issue that owns the note
@param n... | [
"Add",
"an",
"award",
"emoji",
"for",
"the",
"specified",
"note",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L222-L227 |
Harium/keel | src/main/java/jdt/triangulation/DelaunayTriangulation.java | DelaunayTriangulation.insertPointSimple | private Triangle insertPointSimple(Set<Vector3> vertices, Vector3 p) {
"""
/*private void allTriangles(Triangle curr, List<Triangle> front, int mc) {
if (curr != null && curr.modCounter == mc && !front.contains(curr)) {
front.add(curr);
allTriangles(curr.abnext, front, mc);
allTriangles(curr.bcnext, front, mc)... | java | private Triangle insertPointSimple(Set<Vector3> vertices, Vector3 p) {
if (!allCollinear) {
return insertNonColinear(p);
} else {
return insertColinear(vertices, p);
}
} | [
"private",
"Triangle",
"insertPointSimple",
"(",
"Set",
"<",
"Vector3",
">",
"vertices",
",",
"Vector3",
"p",
")",
"{",
"if",
"(",
"!",
"allCollinear",
")",
"{",
"return",
"insertNonColinear",
"(",
"p",
")",
";",
"}",
"else",
"{",
"return",
"insertColinear... | /*private void allTriangles(Triangle curr, List<Triangle> front, int mc) {
if (curr != null && curr.modCounter == mc && !front.contains(curr)) {
front.add(curr);
allTriangles(curr.abnext, front, mc);
allTriangles(curr.bcnext, front, mc);
allTriangles(curr.canext, front, mc);
}
} | [
"/",
"*",
"private",
"void",
"allTriangles",
"(",
"Triangle",
"curr",
"List<Triangle",
">",
"front",
"int",
"mc",
")",
"{",
"if",
"(",
"curr",
"!",
"=",
"null",
"&&",
"curr",
".",
"modCounter",
"==",
"mc",
"&&",
"!front",
".",
"contains",
"(",
"curr",
... | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/DelaunayTriangulation.java#L701-L707 |
Activiti/Activiti | activiti-bpmn-converter/src/main/java/org/activiti/bpmn/converter/util/BpmnXMLUtil.java | BpmnXMLUtil.addCustomAttributes | public static void addCustomAttributes(XMLStreamReader xtr, BaseElement element, List<ExtensionAttribute>... blackLists) {
"""
add all attributes from XML to element extensionAttributes (except blackListed).
@param xtr
@param element
@param blackLists
"""
for (int i = 0; i < xtr.getAttributeCount(); i... | java | public static void addCustomAttributes(XMLStreamReader xtr, BaseElement element, List<ExtensionAttribute>... blackLists) {
for (int i = 0; i < xtr.getAttributeCount(); i++) {
ExtensionAttribute extensionAttribute = new ExtensionAttribute();
extensionAttribute.setName(xtr.getAttributeLocalName(i));
... | [
"public",
"static",
"void",
"addCustomAttributes",
"(",
"XMLStreamReader",
"xtr",
",",
"BaseElement",
"element",
",",
"List",
"<",
"ExtensionAttribute",
">",
"...",
"blackLists",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"xtr",
".",
"getAt... | add all attributes from XML to element extensionAttributes (except blackListed).
@param xtr
@param element
@param blackLists | [
"add",
"all",
"attributes",
"from",
"XML",
"to",
"element",
"extensionAttributes",
"(",
"except",
"blackListed",
")",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-bpmn-converter/src/main/java/org/activiti/bpmn/converter/util/BpmnXMLUtil.java#L335-L350 |
Netflix/zeno | src/main/java/com/netflix/zeno/json/JsonFrameworkSerializer.java | JsonFrameworkSerializer.serializeObject | @Deprecated
@Override
@SuppressWarnings( {
"""
/*
@Deprecated instead use serializeObject(HashGenericRecord rec, String fieldName, Object obj)
""" "unchecked", "rawtypes" })
public void serializeObject(JsonWriteGenericRecord record, String fieldName, String typeName, Object obj) {
try {
... | java | @Deprecated
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void serializeObject(JsonWriteGenericRecord record, String fieldName, String typeName, Object obj) {
try {
if (obj == null) {
record.getGenerator().writeObjectField(fieldName, null);
... | [
"@",
"Deprecated",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"void",
"serializeObject",
"(",
"JsonWriteGenericRecord",
"record",
",",
"String",
"fieldName",
",",
"String",
"typeName",
",",
"Object... | /*
@Deprecated instead use serializeObject(HashGenericRecord rec, String fieldName, Object obj) | [
"/",
"*",
"@Deprecated",
"instead",
"use",
"serializeObject",
"(",
"HashGenericRecord",
"rec",
"String",
"fieldName",
"Object",
"obj",
")"
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/json/JsonFrameworkSerializer.java#L81-L104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/JwtFatActions.java | JwtFatActions.logInAndObtainJwtCookie | public Cookie logInAndObtainJwtCookie(String testName, WebClient webClient, String protectedUrl, String username, String password, String issuerRegex) throws Exception {
"""
Accesses the protected resource and logs in successfully, ensuring that a JWT SSO cookie is included in the result.
"""
Expectati... | java | public Cookie logInAndObtainJwtCookie(String testName, WebClient webClient, String protectedUrl, String username, String password, String issuerRegex) throws Exception {
Expectations expectations = new Expectations();
expectations.addExpectations(CommonExpectations.successfullyReachedLoginPage(TestActio... | [
"public",
"Cookie",
"logInAndObtainJwtCookie",
"(",
"String",
"testName",
",",
"WebClient",
"webClient",
",",
"String",
"protectedUrl",
",",
"String",
"username",
",",
"String",
"password",
",",
"String",
"issuerRegex",
")",
"throws",
"Exception",
"{",
"Expectations... | Accesses the protected resource and logs in successfully, ensuring that a JWT SSO cookie is included in the result. | [
"Accesses",
"the",
"protected",
"resource",
"and",
"logs",
"in",
"successfully",
"ensuring",
"that",
"a",
"JWT",
"SSO",
"cookie",
"is",
"included",
"in",
"the",
"result",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jwtsso_fat/fat/src/com/ibm/ws/security/jwtsso/fat/utils/JwtFatActions.java#L43-L51 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java | CveDB.determineEcosystem | private String determineEcosystem(String baseEcosystem, String vendor, String product, String targetSw) {
"""
Attempts to determine the ecosystem based on the vendor, product and
targetSw.
@param baseEcosystem the base ecosystem
@param vendor the vendor
@param product the product
@param targetSw the target ... | java | private String determineEcosystem(String baseEcosystem, String vendor, String product, String targetSw) {
if ("ibm".equals(vendor) && "java".equals(product)) {
return "c/c++";
}
if ("oracle".equals(vendor) && "vm".equals(product)) {
return "c/c++";
}
if ("... | [
"private",
"String",
"determineEcosystem",
"(",
"String",
"baseEcosystem",
",",
"String",
"vendor",
",",
"String",
"product",
",",
"String",
"targetSw",
")",
"{",
"if",
"(",
"\"ibm\"",
".",
"equals",
"(",
"vendor",
")",
"&&",
"\"java\"",
".",
"equals",
"(",
... | Attempts to determine the ecosystem based on the vendor, product and
targetSw.
@param baseEcosystem the base ecosystem
@param vendor the vendor
@param product the product
@param targetSw the target software
@return the ecosystem if one is identified | [
"Attempts",
"to",
"determine",
"the",
"ecosystem",
"based",
"on",
"the",
"vendor",
"product",
"and",
"targetSw",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L222-L233 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java | ResourceImpl.withTags | @SuppressWarnings("unchecked")
public final FluentModelImplT withTags(Map<String, String> tags) {
"""
Specifies tags for the resource as a {@link Map}.
@param tags a {@link Map} of tags
@return the next stage of the definition/update
"""
this.inner().withTags(new HashMap<>(tags));
return ... | java | @SuppressWarnings("unchecked")
public final FluentModelImplT withTags(Map<String, String> tags) {
this.inner().withTags(new HashMap<>(tags));
return (FluentModelImplT) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"FluentModelImplT",
"withTags",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"this",
".",
"inner",
"(",
")",
".",
"withTags",
"(",
"new",
"HashMap",
"<>",
"(",
"ta... | Specifies tags for the resource as a {@link Map}.
@param tags a {@link Map} of tags
@return the next stage of the definition/update | [
"Specifies",
"tags",
"for",
"the",
"resource",
"as",
"a",
"{"
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/models/implementation/ResourceImpl.java#L97-L101 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceSnippetsMap.java | ResourceSnippetsMap.getSnippet | public ResourceSnippet getSnippet(PageSource ps, int startPos, int endPos, String charset) {
"""
this method accesses the underlying Map(s) and is therefore synchronized
@param ps
@param startPos
@param endPos
@param charset
@return
"""
String keySnp = calcKey(ps, startPos, endPos);
synchronized (sync... | java | public ResourceSnippet getSnippet(PageSource ps, int startPos, int endPos, String charset) {
String keySnp = calcKey(ps, startPos, endPos);
synchronized (sync) {
ResourceSnippet snippet = snippets.get(keySnp);
if (snippet == null) {
Resource res = ps.getResource();
String keyRes = calcKey(res);
String... | [
"public",
"ResourceSnippet",
"getSnippet",
"(",
"PageSource",
"ps",
",",
"int",
"startPos",
",",
"int",
"endPos",
",",
"String",
"charset",
")",
"{",
"String",
"keySnp",
"=",
"calcKey",
"(",
"ps",
",",
"startPos",
",",
"endPos",
")",
";",
"synchronized",
"... | this method accesses the underlying Map(s) and is therefore synchronized
@param ps
@param startPos
@param endPos
@param charset
@return | [
"this",
"method",
"accesses",
"the",
"underlying",
"Map",
"(",
"s",
")",
"and",
"is",
"therefore",
"synchronized"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceSnippetsMap.java#L50-L67 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java | Watch.addDoc | private DocumentChange addDoc(QueryDocumentSnapshot newDocument) {
"""
Applies a document add to the document tree. Returns the corresponding DocumentChange event.
"""
ResourcePath resourcePath = newDocument.getReference().getResourcePath();
documentSet = documentSet.add(newDocument);
int newIndex ... | java | private DocumentChange addDoc(QueryDocumentSnapshot newDocument) {
ResourcePath resourcePath = newDocument.getReference().getResourcePath();
documentSet = documentSet.add(newDocument);
int newIndex = documentSet.indexOf(resourcePath);
return new DocumentChange(newDocument, Type.ADDED, -1, newIndex);
} | [
"private",
"DocumentChange",
"addDoc",
"(",
"QueryDocumentSnapshot",
"newDocument",
")",
"{",
"ResourcePath",
"resourcePath",
"=",
"newDocument",
".",
"getReference",
"(",
")",
".",
"getResourcePath",
"(",
")",
";",
"documentSet",
"=",
"documentSet",
".",
"add",
"... | Applies a document add to the document tree. Returns the corresponding DocumentChange event. | [
"Applies",
"a",
"document",
"add",
"to",
"the",
"document",
"tree",
".",
"Returns",
"the",
"corresponding",
"DocumentChange",
"event",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Watch.java#L497-L502 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java | PropFindResponseEntity.traverseResources | private void traverseResources(Resource resource, int counter) throws XMLStreamException, RepositoryException,
IllegalResourceTypeException, URISyntaxException, UnsupportedEncodingException {
"""
Traverses resources and collects the vales of required properties.
@param resource resource to traverse
@par... | java | private void traverseResources(Resource resource, int counter) throws XMLStreamException, RepositoryException,
IllegalResourceTypeException, URISyntaxException, UnsupportedEncodingException
{
xmlStreamWriter.writeStartElement("DAV:", "response");
xmlStreamWriter.writeStartElement("DAV:", "h... | [
"private",
"void",
"traverseResources",
"(",
"Resource",
"resource",
",",
"int",
"counter",
")",
"throws",
"XMLStreamException",
",",
"RepositoryException",
",",
"IllegalResourceTypeException",
",",
"URISyntaxException",
",",
"UnsupportedEncodingException",
"{",
"xmlStreamW... | Traverses resources and collects the vales of required properties.
@param resource resource to traverse
@param counter the depth
@throws XMLStreamException {@link XMLStreamException}
@throws RepositoryException {@link RepositoryException}
@throws IllegalResourceTypeException {@link IllegalResourceTypeException}
@throw... | [
"Traverses",
"resources",
"and",
"collects",
"the",
"vales",
"of",
"required",
"properties",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/propfind/PropFindResponseEntity.java#L183-L222 |
js-lib-com/commons | src/main/java/js/io/FilesOutputStream.java | FilesOutputStream.addFiles | public void addFiles(File baseDir, List<String> fileNames) throws FileNotFoundException, IOException {
"""
Add files list to this archive. Files from list are relative to given base directory. For every file create a new entry
into this ZIP archive with file name as entry name. As mentioned file/entry name is rel... | java | public void addFiles(File baseDir, List<String> fileNames) throws FileNotFoundException, IOException {
for (String fileName : fileNames) {
addFileEntry(fileName, new FileInputStream(new File(baseDir, fileName)));
}
} | [
"public",
"void",
"addFiles",
"(",
"File",
"baseDir",
",",
"List",
"<",
"String",
">",
"fileNames",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"for",
"(",
"String",
"fileName",
":",
"fileNames",
")",
"{",
"addFileEntry",
"(",
"fileName",
... | Add files list to this archive. Files from list are relative to given base directory. For every file create a new entry
into this ZIP archive with file name as entry name. As mentioned file/entry name is relative to base directory and does
not start with it. For example, bee it <code>/var/www/</code> a base directory a... | [
"Add",
"files",
"list",
"to",
"this",
"archive",
".",
"Files",
"from",
"list",
"are",
"relative",
"to",
"given",
"base",
"directory",
".",
"For",
"every",
"file",
"create",
"a",
"new",
"entry",
"into",
"this",
"ZIP",
"archive",
"with",
"file",
"name",
"a... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/io/FilesOutputStream.java#L129-L133 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/backend/BackendManager.java | BackendManager.isRemoteAccessAllowed | public boolean isRemoteAccessAllowed(String pRemoteHost, String pRemoteAddr) {
"""
Check whether remote access from the given client is allowed.
@param pRemoteHost remote host to check against. Can be null if no reverse lookup is configured.
@param pRemoteAddr alternative IP address
@return true if remote acc... | java | public boolean isRemoteAccessAllowed(String pRemoteHost, String pRemoteAddr) {
return restrictor.isRemoteAccessAllowed(pRemoteHost != null ?
new String[] { pRemoteHost, pRemoteAddr } :
new String[] { ... | [
"public",
"boolean",
"isRemoteAccessAllowed",
"(",
"String",
"pRemoteHost",
",",
"String",
"pRemoteAddr",
")",
"{",
"return",
"restrictor",
".",
"isRemoteAccessAllowed",
"(",
"pRemoteHost",
"!=",
"null",
"?",
"new",
"String",
"[",
"]",
"{",
"pRemoteHost",
",",
"... | Check whether remote access from the given client is allowed.
@param pRemoteHost remote host to check against. Can be null if no reverse lookup is configured.
@param pRemoteAddr alternative IP address
@return true if remote access is allowed | [
"Check",
"whether",
"remote",
"access",
"from",
"the",
"given",
"client",
"is",
"allowed",
"."
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/backend/BackendManager.java#L218-L222 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/ScaleConverter.java | ScaleConverter.scaleToString | public static String scaleToString(double scale, int precision, int significantDigits) {
"""
Convert a scale to a string representation.
@param scale scale to convert
@param precision precision for the scale, or 0
@param significantDigits maximum number of significant digits
@return string representation for... | java | public static String scaleToString(double scale, int precision, int significantDigits) {
NumberFormat numberFormat = NumberFormat.getFormat("###,###");
if (scale > 0 && scale < 1.0) {
int denominator = round((int) Math.round(1.0 / scale), precision, significantDigits);
return "1 : " + numberFormat.format(deno... | [
"public",
"static",
"String",
"scaleToString",
"(",
"double",
"scale",
",",
"int",
"precision",
",",
"int",
"significantDigits",
")",
"{",
"NumberFormat",
"numberFormat",
"=",
"NumberFormat",
".",
"getFormat",
"(",
"\"###,###\"",
")",
";",
"if",
"(",
"scale",
... | Convert a scale to a string representation.
@param scale scale to convert
@param precision precision for the scale, or 0
@param significantDigits maximum number of significant digits
@return string representation for the scale | [
"Convert",
"a",
"scale",
"to",
"a",
"string",
"representation",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/ScaleConverter.java#L37-L48 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java | ASegment.getNextLatinWord | protected IWord getNextLatinWord(int c, int pos) throws IOException {
"""
get the next Latin word from the current position of the input stream
@param c
@param pos
@return IWord could be null and that mean we reached a stop word
@throws IOException
"""
/*
* clear or just return the... | java | protected IWord getNextLatinWord(int c, int pos) throws IOException
{
/*
* clear or just return the English punctuation as
* a single word with PUNCTUATION type and part of speech
*/
if ( StringUtil.isEnPunctuation( c ) ) {
String str = String.valueOf((char)c);... | [
"protected",
"IWord",
"getNextLatinWord",
"(",
"int",
"c",
",",
"int",
"pos",
")",
"throws",
"IOException",
"{",
"/*\n * clear or just return the English punctuation as\n * a single word with PUNCTUATION type and part of speech \n */",
"if",
"(",
"StringUtil",
... | get the next Latin word from the current position of the input stream
@param c
@param pos
@return IWord could be null and that mean we reached a stop word
@throws IOException | [
"get",
"the",
"next",
"Latin",
"word",
"from",
"the",
"current",
"position",
"of",
"the",
"input",
"stream"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L587-L629 |
cloudant/sync-android | cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/internal/sqlite/android/AndroidSQLCipherSQLite.java | AndroidSQLCipherSQLite.open | public static AndroidSQLCipherSQLite open(File path, KeyProvider provider) {
"""
Constructor for creating SQLCipher-based SQLite database.
@param path full file path of the db file
@param provider Provider object that contains the key to encrypt the SQLCipher database
@return
"""
//Call SQLCipher-b... | java | public static AndroidSQLCipherSQLite open(File path, KeyProvider provider) {
//Call SQLCipher-based method for opening database, or creating if database not found
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(path,
KeyUtils.sqlCipherKeyForKeyProvider(provider), null);
... | [
"public",
"static",
"AndroidSQLCipherSQLite",
"open",
"(",
"File",
"path",
",",
"KeyProvider",
"provider",
")",
"{",
"//Call SQLCipher-based method for opening database, or creating if database not found",
"SQLiteDatabase",
"db",
"=",
"SQLiteDatabase",
".",
"openOrCreateDatabase"... | Constructor for creating SQLCipher-based SQLite database.
@param path full file path of the db file
@param provider Provider object that contains the key to encrypt the SQLCipher database
@return | [
"Constructor",
"for",
"creating",
"SQLCipher",
"-",
"based",
"SQLite",
"database",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-android-encryption/src/main/java/com/cloudant/sync/internal/sqlite/android/AndroidSQLCipherSQLite.java#L52-L59 |
eBay/parallec | src/main/java/io/parallec/core/ParallecHeader.java | ParallecHeader.addPair | public ParallecHeader addPair(String key, String value) {
"""
Adds the pair.
@param key
the key
@param value
the value
@return the parallec header
"""
this.headerMap.put(key, value);
return this;
} | java | public ParallecHeader addPair(String key, String value) {
this.headerMap.put(key, value);
return this;
} | [
"public",
"ParallecHeader",
"addPair",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"headerMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds the pair.
@param key
the key
@param value
the value
@return the parallec header | [
"Adds",
"the",
"pair",
"."
] | train | https://github.com/eBay/parallec/blob/1b4f1628f34fedfb06b24c33a5372d64d3df0952/src/main/java/io/parallec/core/ParallecHeader.java#L48-L51 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/Cycles.java | Cycles.toRing | private static IRing toRing(IAtomContainer container, int[] cycle, EdgeToBondMap bondMap) {
"""
Internal - convert a set of cycles to a ring.
@param container molecule
@param cycle a cycle of the chemical graph
@param bondMap mapping of the edges (int,int) to the bonds of the
container
@return the rin... | java | private static IRing toRing(IAtomContainer container, int[] cycle, EdgeToBondMap bondMap) {
IAtom[] atoms = new IAtom[cycle.length - 1];
IBond[] bonds = new IBond[cycle.length - 1];
for (int i = 1; i < cycle.length; i++) {
int v = cycle[i];
int u = cycle[i - 1];
... | [
"private",
"static",
"IRing",
"toRing",
"(",
"IAtomContainer",
"container",
",",
"int",
"[",
"]",
"cycle",
",",
"EdgeToBondMap",
"bondMap",
")",
"{",
"IAtom",
"[",
"]",
"atoms",
"=",
"new",
"IAtom",
"[",
"cycle",
".",
"length",
"-",
"1",
"]",
";",
"IBo... | Internal - convert a set of cycles to a ring.
@param container molecule
@param cycle a cycle of the chemical graph
@param bondMap mapping of the edges (int,int) to the bonds of the
container
@return the ring for the specified cycle | [
"Internal",
"-",
"convert",
"a",
"set",
"of",
"cycles",
"to",
"a",
"ring",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/Cycles.java#L938-L956 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerUnmarshaller | public final <S, T> void registerUnmarshaller(ConverterKey<S,T> key, FromUnmarshaller<S, T> converter) {
"""
Register an UnMarshaller with the given source and target class.
The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
@param key Converter Key to use
@par... | java | public final <S, T> void registerUnmarshaller(ConverterKey<S,T> key, FromUnmarshaller<S, T> converter) {
registerConverter(key.invert(), new FromUnmarshallerConverter<S,T>(converter));
} | [
"public",
"final",
"<",
"S",
",",
"T",
">",
"void",
"registerUnmarshaller",
"(",
"ConverterKey",
"<",
"S",
",",
"T",
">",
"key",
",",
"FromUnmarshaller",
"<",
"S",
",",
"T",
">",
"converter",
")",
"{",
"registerConverter",
"(",
"key",
".",
"invert",
"(... | Register an UnMarshaller with the given source and target class.
The unmarshaller is used as follows: Instances of the source can be marshalled into the target class.
@param key Converter Key to use
@param converter The FromUnmarshaller to be registered | [
"Register",
"an",
"UnMarshaller",
"with",
"the",
"given",
"source",
"and",
"target",
"class",
".",
"The",
"unmarshaller",
"is",
"used",
"as",
"follows",
":",
"Instances",
"of",
"the",
"source",
"can",
"be",
"marshalled",
"into",
"the",
"target",
"class",
"."... | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L633-L635 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java | HttpAuthUtils.splitCookieToken | private static Map<String, String> splitCookieToken(String tokenStr) {
"""
Splits the cookie token into attributes pairs.
@param str input token.
@return a map with the attribute pairs of the token if the input is valid.
Else, returns null.
"""
Map<String, String> map = new HashMap<String, String>();
... | java | private static Map<String, String> splitCookieToken(String tokenStr) {
Map<String, String> map = new HashMap<String, String>();
StringTokenizer st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR);
while (st.hasMoreTokens()) {
String part = st.nextToken();
int separator = part.indexOf(COOK... | [
"private",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"splitCookieToken",
"(",
"String",
"tokenStr",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"StringTok... | Splits the cookie token into attributes pairs.
@param str input token.
@return a map with the attribute pairs of the token if the input is valid.
Else, returns null. | [
"Splits",
"the",
"cookie",
"token",
"into",
"attributes",
"pairs",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java#L124-L140 |
line/centraldogma | server-auth/shiro/src/main/java/com/linecorp/centraldogma/server/auth/shiro/realm/SearchFirstActiveDirectoryRealm.java | SearchFirstActiveDirectoryRealm.findUserDn | @Nullable
protected String findUserDn(LdapContextFactory ldapContextFactory, String username) throws NamingException {
"""
Finds a distinguished name(DN) of a user by querying the active directory LDAP context for the
specified username.
@return the DN of the user, or {@code null} if there's no such user
... | java | @Nullable
protected String findUserDn(LdapContextFactory ldapContextFactory, String username) throws NamingException {
LdapContext ctx = null;
try {
// Binds using the system username and password.
ctx = ldapContextFactory.getSystemLdapContext();
final SearchCont... | [
"@",
"Nullable",
"protected",
"String",
"findUserDn",
"(",
"LdapContextFactory",
"ldapContextFactory",
",",
"String",
"username",
")",
"throws",
"NamingException",
"{",
"LdapContext",
"ctx",
"=",
"null",
";",
"try",
"{",
"// Binds using the system username and password.",... | Finds a distinguished name(DN) of a user by querying the active directory LDAP context for the
specified username.
@return the DN of the user, or {@code null} if there's no such user | [
"Finds",
"a",
"distinguished",
"name",
"(",
"DN",
")",
"of",
"a",
"user",
"by",
"querying",
"the",
"active",
"directory",
"LDAP",
"context",
"for",
"the",
"specified",
"username",
"."
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server-auth/shiro/src/main/java/com/linecorp/centraldogma/server/auth/shiro/realm/SearchFirstActiveDirectoryRealm.java#L148-L176 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java | ConfusionMatrixPanel.renderMatrix | private void renderMatrix(Graphics2D g2, double fontSize) {
"""
Renders the confusion matrix and visualizes the value in each cell with a color and optionally a color.
"""
int numCategories = confusion.getNumRows();
Font fontNumber = new Font("Serif", Font.BOLD, (int)(0.6*fontSize + 0.5));
g2.setFont(fo... | java | private void renderMatrix(Graphics2D g2, double fontSize) {
int numCategories = confusion.getNumRows();
Font fontNumber = new Font("Serif", Font.BOLD, (int)(0.6*fontSize + 0.5));
g2.setFont(fontNumber);
FontMetrics metrics = g2.getFontMetrics(fontNumber);
for (int i = 0; i < numCategories; i++) {
int y0 =... | [
"private",
"void",
"renderMatrix",
"(",
"Graphics2D",
"g2",
",",
"double",
"fontSize",
")",
"{",
"int",
"numCategories",
"=",
"confusion",
".",
"getNumRows",
"(",
")",
";",
"Font",
"fontNumber",
"=",
"new",
"Font",
"(",
"\"Serif\"",
",",
"Font",
".",
"BOLD... | Renders the confusion matrix and visualizes the value in each cell with a color and optionally a color. | [
"Renders",
"the",
"confusion",
"matrix",
"and",
"visualizes",
"the",
"value",
"in",
"each",
"cell",
"with",
"a",
"color",
"and",
"optionally",
"a",
"color",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/learning/ConfusionMatrixPanel.java#L241-L290 |
prolificinteractive/material-calendarview | library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java | MaterialCalendarView.enableView | private static void enableView(final View view, final boolean enable) {
"""
Used for enabling or disabling views, while also changing the alpha.
@param view The view to enable or disable.
@param enable Whether to enable or disable the view.
"""
view.setEnabled(enable);
view.setAlpha(enable ? 1f : 0... | java | private static void enableView(final View view, final boolean enable) {
view.setEnabled(enable);
view.setAlpha(enable ? 1f : 0.1f);
} | [
"private",
"static",
"void",
"enableView",
"(",
"final",
"View",
"view",
",",
"final",
"boolean",
"enable",
")",
"{",
"view",
".",
"setEnabled",
"(",
"enable",
")",
";",
"view",
".",
"setAlpha",
"(",
"enable",
"?",
"1f",
":",
"0.1f",
")",
";",
"}"
] | Used for enabling or disabling views, while also changing the alpha.
@param view The view to enable or disable.
@param enable Whether to enable or disable the view. | [
"Used",
"for",
"enabling",
"or",
"disabling",
"views",
"while",
"also",
"changing",
"the",
"alpha",
"."
] | train | https://github.com/prolificinteractive/material-calendarview/blob/04fae8175fd034d0a7131f8cb253cae883a88aa2/library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java#L2014-L2017 |
h2oai/h2o-3 | h2o-core/src/main/java/water/api/MetadataHandler.java | MetadataHandler.fetchSchemaMetadata | @SuppressWarnings("unused") // called through reflection by RequestServer
public MetadataV3 fetchSchemaMetadata(int version, MetadataV3 docs) {
"""
Fetch the metadata for a Schema by its simple Schema name (e.g., "DeepLearningParametersV2").
"""
if ("void".equals(docs.schemaname)) {
docs.schemas = ... | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public MetadataV3 fetchSchemaMetadata(int version, MetadataV3 docs) {
if ("void".equals(docs.schemaname)) {
docs.schemas = new SchemaMetadataV3[0];
return docs;
}
docs.schemas = new SchemaMetadataV3[1];
// NOTE: thi... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"MetadataV3",
"fetchSchemaMetadata",
"(",
"int",
"version",
",",
"MetadataV3",
"docs",
")",
"{",
"if",
"(",
"\"void\"",
".",
"equals",
"(",
"docs",
".",
"sche... | Fetch the metadata for a Schema by its simple Schema name (e.g., "DeepLearningParametersV2"). | [
"Fetch",
"the",
"metadata",
"for",
"a",
"Schema",
"by",
"its",
"simple",
"Schema",
"name",
"(",
"e",
".",
"g",
".",
"DeepLearningParametersV2",
")",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/MetadataHandler.java#L144-L165 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/cdn/CdnClient.java | CdnClient.enableDomain | public EnableDomainResponse enableDomain(EnableDomainRequest request) {
"""
Enable an existing domain acceleration.
@param request The request containing user-defined domain information.
@return Result of the enableDomain operation returned by the service.
"""
checkNotNull(request, "The parameter r... | java | public EnableDomainResponse enableDomain(EnableDomainRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest = createRequest(request, HttpMethodName.POST, DOMAIN, request.getDomain());
internalRequest.addParameter("enable", "");
... | [
"public",
"EnableDomainResponse",
"enableDomain",
"(",
"EnableDomainRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"request",
","... | Enable an existing domain acceleration.
@param request The request containing user-defined domain information.
@return Result of the enableDomain operation returned by the service. | [
"Enable",
"an",
"existing",
"domain",
"acceleration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/cdn/CdnClient.java#L204-L209 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/request/RequestProcessorChain.java | RequestProcessorChain.onInitiate | @Override
protected HttpRequestBase onInitiate(ProcessorChainLink<HttpRequestBase, RequestProcessorException> root, Object... args) {
"""
<p>Accepts the {@link InvocationContext} given to {@link #run(Object...)}} the {@link RequestProcessorChain}
and translates the request metadata to a concrete instance of {@li... | java | @Override
protected HttpRequestBase onInitiate(ProcessorChainLink<HttpRequestBase, RequestProcessorException> root, Object... args) {
InvocationContext context = assertAssignable(assertNotEmpty(args)[0], InvocationContext.class);
HttpRequestBase request = RequestUtils.translateRequestMethod(context);
re... | [
"@",
"Override",
"protected",
"HttpRequestBase",
"onInitiate",
"(",
"ProcessorChainLink",
"<",
"HttpRequestBase",
",",
"RequestProcessorException",
">",
"root",
",",
"Object",
"...",
"args",
")",
"{",
"InvocationContext",
"context",
"=",
"assertAssignable",
"(",
"asse... | <p>Accepts the {@link InvocationContext} given to {@link #run(Object...)}} the {@link RequestProcessorChain}
and translates the request metadata to a concrete instance of {@link HttpRequestBase}. The
{@link HttpRequestBase}, together with the {@link InvocationContext} is then given to the root link
which runs the {@lin... | [
"<p",
">",
"Accepts",
"the",
"{",
"@link",
"InvocationContext",
"}",
"given",
"to",
"{",
"@link",
"#run",
"(",
"Object",
"...",
")",
"}}",
"the",
"{",
"@link",
"RequestProcessorChain",
"}",
"and",
"translates",
"the",
"request",
"metadata",
"to",
"a",
"con... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/request/RequestProcessorChain.java#L107-L115 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformGZipBytes.java | TransformGZipBytes.transformOut | @Override
public byte[] transformOut(JdbcPreparedStatementFactory jpsf, byte[] attributeObject) throws CpoException {
"""
Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param par... | java | @Override
public byte[] transformOut(JdbcPreparedStatementFactory jpsf, byte[] attributeObject) throws CpoException {
byte[] retBytes = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
if (attributeObject != null) {
if (attributeObject.length > 0) {
GZIPOutp... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"transformOut",
"(",
"JdbcPreparedStatementFactory",
"jpsf",
",",
"byte",
"[",
"]",
"attributeObject",
")",
"throws",
"CpoException",
"{",
"byte",
"[",
"]",
"retBytes",
"=",
"null",
";",
"ByteArrayOutputStream",
"baos... | Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param parentObject The object that contains the attribute being persisted.
@param attributeObject The object that represents the attribute be... | [
"Transforms",
"the",
"data",
"from",
"the",
"class",
"attribute",
"to",
"the",
"object",
"required",
"by",
"the",
"datasource"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformGZipBytes.java#L95-L124 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java | XML.addClass | public XML addClass(Class<?> aClass, Global global) {
"""
This method adds aClass with this global mapping and attributes to XML configuration file.<br>
It's mandatory define at least one attribute, global is optional instead.
@param aClass Class to adds
@param global global mapping
@return this instance
"... | java | public XML addClass(Class<?> aClass, Global global){
checksClassAbsence(aClass);
XmlClass xmlClass = new XmlClass();
xmlClass.name = aClass.getName();
xmlJmapper.classes.add(xmlClass);
addGlobal(aClass, global);
return this;
} | [
"public",
"XML",
"addClass",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"Global",
"global",
")",
"{",
"checksClassAbsence",
"(",
"aClass",
")",
";",
"XmlClass",
"xmlClass",
"=",
"new",
"XmlClass",
"(",
")",
";",
"xmlClass",
".",
"name",
"=",
"aClass",
... | This method adds aClass with this global mapping and attributes to XML configuration file.<br>
It's mandatory define at least one attribute, global is optional instead.
@param aClass Class to adds
@param global global mapping
@return this instance | [
"This",
"method",
"adds",
"aClass",
"with",
"this",
"global",
"mapping",
"and",
"attributes",
"to",
"XML",
"configuration",
"file",
".",
"<br",
">",
"It",
"s",
"mandatory",
"define",
"at",
"least",
"one",
"attribute",
"global",
"is",
"optional",
"instead",
"... | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/xml/XML.java#L258-L266 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.loadImage | public void loadImage(String uri, ImageSize targetImageSize, ImageLoadingListener listener) {
"""
Adds load image task to execution pool. Image will be returned with
{@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}.
<br />
<b>NOTE:</b> {@link #init(Ima... | java | public void loadImage(String uri, ImageSize targetImageSize, ImageLoadingListener listener) {
loadImage(uri, targetImageSize, null, listener, null);
} | [
"public",
"void",
"loadImage",
"(",
"String",
"uri",
",",
"ImageSize",
"targetImageSize",
",",
"ImageLoadingListener",
"listener",
")",
"{",
"loadImage",
"(",
"uri",
",",
"targetImageSize",
",",
"null",
",",
"listener",
",",
"null",
")",
";",
"}"
] | Adds load image task to execution pool. Image will be returned with
{@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}.
<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri Image URI (i... | [
"Adds",
"load",
"image",
"task",
"to",
"execution",
"pool",
".",
"Image",
"will",
"be",
"returned",
"with",
"{",
"@link",
"ImageLoadingListener#onLoadingComplete",
"(",
"String",
"android",
".",
"view",
".",
"View",
"android",
".",
"graphics",
".",
"Bitmap",
"... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L444-L446 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.mergeCalls | public void mergeCalls(
String connId,
String otherConnId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
"""
Merge the two specified calls.
@param connId The connection ID of the first call to be merged.
@param ... | java | public void mergeCalls(
String connId,
String otherConnId,
KeyValueCollection reasons,
KeyValueCollection extensions
) throws WorkspaceApiException {
try {
VoicecallsidmergeData mergeData = new VoicecallsidmergeData();
mergeData... | [
"public",
"void",
"mergeCalls",
"(",
"String",
"connId",
",",
"String",
"otherConnId",
",",
"KeyValueCollection",
"reasons",
",",
"KeyValueCollection",
"extensions",
")",
"throws",
"WorkspaceApiException",
"{",
"try",
"{",
"VoicecallsidmergeData",
"mergeData",
"=",
"n... | Merge the two specified calls.
@param connId The connection ID of the first call to be merged.
@param otherConnId The connection ID of the second call to be merged.
@param reasons Information on causes for, and results of, actions taken by the user of the current DN. For details about reasons, refer to the [*Genesys Ev... | [
"Merge",
"the",
"two",
"specified",
"calls",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L1252-L1272 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/PemReader.java | PemReader.readFirstSectionAndClose | public static Section readFirstSectionAndClose(Reader reader, String titleToLookFor)
throws IOException {
"""
Reads the first section in the PEM file, optionally based on a title to look for, and then
closes the reader.
@param titleToLookFor title to look for or {@code null} for any title
@param reader ... | java | public static Section readFirstSectionAndClose(Reader reader, String titleToLookFor)
throws IOException {
PemReader pemReader = new PemReader(reader);
try {
return pemReader.readNextSection(titleToLookFor);
} finally {
pemReader.close();
}
} | [
"public",
"static",
"Section",
"readFirstSectionAndClose",
"(",
"Reader",
"reader",
",",
"String",
"titleToLookFor",
")",
"throws",
"IOException",
"{",
"PemReader",
"pemReader",
"=",
"new",
"PemReader",
"(",
"reader",
")",
";",
"try",
"{",
"return",
"pemReader",
... | Reads the first section in the PEM file, optionally based on a title to look for, and then
closes the reader.
@param titleToLookFor title to look for or {@code null} for any title
@param reader reader
@return first section found or {@code null} for none found | [
"Reads",
"the",
"first",
"section",
"in",
"the",
"PEM",
"file",
"optionally",
"based",
"on",
"a",
"title",
"to",
"look",
"for",
"and",
"then",
"closes",
"the",
"reader",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/PemReader.java#L124-L132 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java | CitrusAnnotations.injectEndpoints | public static final void injectEndpoints(final Object target, final TestContext context) {
"""
Reads all {@link CitrusEndpoint} and {@link CitrusEndpointConfig} related annotations on target object field declarations and
injects proper endpoint instances.
@param target
@param context
"""
Reflectio... | java | public static final void injectEndpoints(final Object target, final TestContext context) {
ReflectionUtils.doWithFields(target.getClass(), new ReflectionUtils.FieldCallback() {
@Override
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
... | [
"public",
"static",
"final",
"void",
"injectEndpoints",
"(",
"final",
"Object",
"target",
",",
"final",
"TestContext",
"context",
")",
"{",
"ReflectionUtils",
".",
"doWithFields",
"(",
"target",
".",
"getClass",
"(",
")",
",",
"new",
"ReflectionUtils",
".",
"F... | Reads all {@link CitrusEndpoint} and {@link CitrusEndpointConfig} related annotations on target object field declarations and
injects proper endpoint instances.
@param target
@param context | [
"Reads",
"all",
"{",
"@link",
"CitrusEndpoint",
"}",
"and",
"{",
"@link",
"CitrusEndpointConfig",
"}",
"related",
"annotations",
"on",
"target",
"object",
"field",
"declarations",
"and",
"injects",
"proper",
"endpoint",
"instances",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/annotations/CitrusAnnotations.java#L80-L118 |
hypercube1024/firefly | firefly/src/main/java/com/firefly/codec/http2/hpack/MetaDataBuilder.java | MetaDataBuilder.checkSize | public void checkSize(int length, boolean huffman) throws HpackException.SessionException {
"""
Check that the max size will not be exceeded.
@param length the length
@param huffman the huffman name
@throws HpackException.SessionException in case of size errors
"""
// Apply a huffman fudge factor... | java | public void checkSize(int length, boolean huffman) throws HpackException.SessionException {
// Apply a huffman fudge factor
if (huffman)
length = (length * 4) / 3;
if ((_size + length) > _maxSize)
throw new HpackException.SessionException("Header too large %d > %d", _size... | [
"public",
"void",
"checkSize",
"(",
"int",
"length",
",",
"boolean",
"huffman",
")",
"throws",
"HpackException",
".",
"SessionException",
"{",
"// Apply a huffman fudge factor",
"if",
"(",
"huffman",
")",
"length",
"=",
"(",
"length",
"*",
"4",
")",
"/",
"3",
... | Check that the max size will not be exceeded.
@param length the length
@param huffman the huffman name
@throws HpackException.SessionException in case of size errors | [
"Check",
"that",
"the",
"max",
"size",
"will",
"not",
"be",
"exceeded",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/hpack/MetaDataBuilder.java#L239-L245 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.