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 |
|---|---|---|---|---|---|---|---|---|---|---|
jirutka/spring-rest-exception-handler | src/main/java/cz/jirutka/spring/exhandler/MapUtils.java | MapUtils.putAllIfAbsent | static <K, V> void putAllIfAbsent(Map<K, V> target, Map<K, V> source) {
"""
Puts entries from the {@code source} map into the {@code target} map, but without overriding
any existing entry in {@code target} map, i.e. put only if the key does not exist in the
{@code target} map.
@param target The target map whe... | java | static <K, V> void putAllIfAbsent(Map<K, V> target, Map<K, V> source) {
for (Map.Entry<K, V> entry : source.entrySet()) {
if (!target.containsKey(entry.getKey())) {
target.put(entry.getKey(), entry.getValue());
}
}
} | [
"static",
"<",
"K",
",",
"V",
">",
"void",
"putAllIfAbsent",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"target",
",",
"Map",
"<",
"K",
",",
"V",
">",
"source",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
"entry",
":",
"so... | Puts entries from the {@code source} map into the {@code target} map, but without overriding
any existing entry in {@code target} map, i.e. put only if the key does not exist in the
{@code target} map.
@param target The target map where to put new entries.
@param source The source map from which read the entries. | [
"Puts",
"entries",
"from",
"the",
"{",
"@code",
"source",
"}",
"map",
"into",
"the",
"{",
"@code",
"target",
"}",
"map",
"but",
"without",
"overriding",
"any",
"existing",
"entry",
"in",
"{",
"@code",
"target",
"}",
"map",
"i",
".",
"e",
".",
"put",
... | train | https://github.com/jirutka/spring-rest-exception-handler/blob/f171956e59fe866f1a853c7d38444f136acc7a3b/src/main/java/cz/jirutka/spring/exhandler/MapUtils.java#L32-L39 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.updateServerRedirectHost | public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) {
"""
Update server mapping's host header
@param serverMappingId ID of server mapping
@param hostHeader value of host header
@return updated ServerRedirect
"""
ServerRedirect redirect = new ServerRedirect();
... | java | public ServerRedirect updateServerRedirectHost(int serverMappingId, String hostHeader) {
ServerRedirect redirect = new ServerRedirect();
BasicNameValuePair[] params = {
new BasicNameValuePair("hostHeader", hostHeader),
new BasicNameValuePair("profileIdentifier", this._profileName... | [
"public",
"ServerRedirect",
"updateServerRedirectHost",
"(",
"int",
"serverMappingId",
",",
"String",
"hostHeader",
")",
"{",
"ServerRedirect",
"redirect",
"=",
"new",
"ServerRedirect",
"(",
")",
";",
"BasicNameValuePair",
"[",
"]",
"params",
"=",
"{",
"new",
"Bas... | Update server mapping's host header
@param serverMappingId ID of server mapping
@param hostHeader value of host header
@return updated ServerRedirect | [
"Update",
"server",
"mapping",
"s",
"host",
"header"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1159-L1173 |
Red5/red5-server-common | src/main/java/org/red5/server/persistence/RamPersistence.java | RamPersistence.getObjectPath | protected String getObjectPath(String id, String name) {
"""
Get object path for given id and name. The format of the object id is
<pre>
type / path / objectName
</pre>
@param id
object id
@param name
object name
@return resource path
"""
// The format of the object id is <type>/<path>/<ob... | java | protected String getObjectPath(String id, String name) {
// The format of the object id is <type>/<path>/<objectName>
id = id.substring(id.indexOf('/') + 1);
if (id.charAt(0) == '/') {
id = id.substring(1);
}
if (id.lastIndexOf(name) <= 0) {
return ... | [
"protected",
"String",
"getObjectPath",
"(",
"String",
"id",
",",
"String",
"name",
")",
"{",
"// The format of the object id is <type>/<path>/<objectName>\r",
"id",
"=",
"id",
".",
"substring",
"(",
"id",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
";"... | Get object path for given id and name. The format of the object id is
<pre>
type / path / objectName
</pre>
@param id
object id
@param name
object name
@return resource path | [
"Get",
"object",
"path",
"for",
"given",
"id",
"and",
"name",
".",
"The",
"format",
"of",
"the",
"object",
"id",
"is"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/persistence/RamPersistence.java#L113-L123 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlyear | public static void sqlyear(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
year translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "extract(year from ", "... | java | public static void sqlyear(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "extract(year from ", "year", parsedArgs);
} | [
"public",
"static",
"void",
"sqlyear",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"extract(year from \"",
",",
"\"year\"",
"... | year translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"year",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L486-L488 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java | Drawable.loadSpriteTiled | public static SpriteTiled loadSpriteTiled(Media media, int tileWidth, int tileHeight) {
"""
Load a tiled sprite from a file, giving tile dimension.
<p>
Once created, sprite must call {@link SpriteTiled#load()} before any other operations.
</p>
@param media The sprite media (must not be <code>null</code>).
@... | java | public static SpriteTiled loadSpriteTiled(Media media, int tileWidth, int tileHeight)
{
return new SpriteTiledImpl(getMediaDpi(media), tileWidth, tileHeight);
} | [
"public",
"static",
"SpriteTiled",
"loadSpriteTiled",
"(",
"Media",
"media",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
")",
"{",
"return",
"new",
"SpriteTiledImpl",
"(",
"getMediaDpi",
"(",
"media",
")",
",",
"tileWidth",
",",
"tileHeight",
")",
";",
... | Load a tiled sprite from a file, giving tile dimension.
<p>
Once created, sprite must call {@link SpriteTiled#load()} before any other operations.
</p>
@param media The sprite media (must not be <code>null</code>).
@param tileWidth The tile width (must be strictly positive).
@param tileHeight The tile height (must be ... | [
"Load",
"a",
"tiled",
"sprite",
"from",
"a",
"file",
"giving",
"tile",
"dimension",
".",
"<p",
">",
"Once",
"created",
"sprite",
"must",
"call",
"{",
"@link",
"SpriteTiled#load",
"()",
"}",
"before",
"any",
"other",
"operations",
".",
"<",
"/",
"p",
">"
... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L214-L217 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/ReflectionUtil.java | ReflectionUtil.isAssignableFrom | @Pure
public static boolean isAssignableFrom(Class<?> assignementTarget, Class<?> assignementSource) {
"""
Determines if the <code>assignmentTarget</code> object is either the same as,
or is a superclass or superinterface of, the class or interface
represented by the specified
<code>assignementSource</code> pa... | java | @Pure
public static boolean isAssignableFrom(Class<?> assignementTarget, Class<?> assignementSource) {
assert assignementSource != null;
assert assignementTarget != null;
// Test according to the Class's behaviour
if (assignementTarget.isAssignableFrom(assignementSource)) {
return true;
}
// Test acco... | [
"@",
"Pure",
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"assignementTarget",
",",
"Class",
"<",
"?",
">",
"assignementSource",
")",
"{",
"assert",
"assignementSource",
"!=",
"null",
";",
"assert",
"assignementTarget",
"!=",
... | Determines if the <code>assignmentTarget</code> object is either the same as,
or is a superclass or superinterface of, the class or interface
represented by the specified
<code>assignementSource</code> parameter. This method extends
{@link Class#isAssignableFrom(Class)} with autoboxing support.
@param assignementTarge... | [
"Determines",
"if",
"the",
"<code",
">",
"assignmentTarget<",
"/",
"code",
">",
"object",
"is",
"either",
"the",
"same",
"as",
"or",
"is",
"a",
"superclass",
"or",
"superinterface",
"of",
"the",
"class",
"or",
"interface",
"represented",
"by",
"the",
"specif... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/ReflectionUtil.java#L168-L186 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/MockRequest.java | MockRequest.setFileContents | public void setFileContents(final String key, final byte[] contents) {
"""
Sets mock file upload contents.
@param key the parameter key.
@param contents the file binary data.
"""
MockFileItem fileItem = new MockFileItem();
fileItem.set(contents);
files.put(key, new FileItem[]{fileItem});
} | java | public void setFileContents(final String key, final byte[] contents) {
MockFileItem fileItem = new MockFileItem();
fileItem.set(contents);
files.put(key, new FileItem[]{fileItem});
} | [
"public",
"void",
"setFileContents",
"(",
"final",
"String",
"key",
",",
"final",
"byte",
"[",
"]",
"contents",
")",
"{",
"MockFileItem",
"fileItem",
"=",
"new",
"MockFileItem",
"(",
")",
";",
"fileItem",
".",
"set",
"(",
"contents",
")",
";",
"files",
"... | Sets mock file upload contents.
@param key the parameter key.
@param contents the file binary data. | [
"Sets",
"mock",
"file",
"upload",
"contents",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/mock/MockRequest.java#L105-L109 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.getWrappedValue | public static int getWrappedValue(int currentValue, int wrapValue,
int minValue, int maxValue) {
"""
Utility method used by addWrapField implementations to ensure the new
value lies within the field's legal value range.
@param currentValue the current value of the data, wh... | java | public static int getWrappedValue(int currentValue, int wrapValue,
int minValue, int maxValue) {
return getWrappedValue(currentValue + wrapValue, minValue, maxValue);
} | [
"public",
"static",
"int",
"getWrappedValue",
"(",
"int",
"currentValue",
",",
"int",
"wrapValue",
",",
"int",
"minValue",
",",
"int",
"maxValue",
")",
"{",
"return",
"getWrappedValue",
"(",
"currentValue",
"+",
"wrapValue",
",",
"minValue",
",",
"maxValue",
"... | Utility method used by addWrapField implementations to ensure the new
value lies within the field's legal value range.
@param currentValue the current value of the data, which may lie outside
the wrapped value range
@param wrapValue the value to add to current value before
wrapping. This may be negative.
@param minV... | [
"Utility",
"method",
"used",
"by",
"addWrapField",
"implementations",
"to",
"ensure",
"the",
"new",
"value",
"lies",
"within",
"the",
"field",
"s",
"legal",
"value",
"range",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L313-L316 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonDriverFunction.java | GeoJsonDriverFunction.exportTable | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException {
"""
Export a table or a query to a geojson file
@param connection
@param tableReference
@param fileName
@param progress
@param enco... | java | @Override
public void exportTable(Connection connection, String tableReference, File fileName, ProgressVisitor progress, String encoding) throws SQLException, IOException{
GeoJsonWriteDriver geoJsonDriver = new GeoJsonWriteDriver(connection);
geoJsonDriver.write(progress,tableReference, fileName, en... | [
"@",
"Override",
"public",
"void",
"exportTable",
"(",
"Connection",
"connection",
",",
"String",
"tableReference",
",",
"File",
"fileName",
",",
"ProgressVisitor",
"progress",
",",
"String",
"encoding",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"Geo... | Export a table or a query to a geojson file
@param connection
@param tableReference
@param fileName
@param progress
@param encoding
@throws SQLException
@throws IOException | [
"Export",
"a",
"table",
"or",
"a",
"query",
"to",
"a",
"geojson",
"file"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonDriverFunction.java#L88-L92 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.removeByLtD_S | @Override
public void removeByLtD_S(Date displayDate, int status) {
"""
Removes all the commerce discounts where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status
"""
for (CommerceDiscount commerceDiscount : findByLtD_S(displayDate,... | java | @Override
public void removeByLtD_S(Date displayDate, int status) {
for (CommerceDiscount commerceDiscount : findByLtD_S(displayDate,
status, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(commerceDiscount);
}
} | [
"@",
"Override",
"public",
"void",
"removeByLtD_S",
"(",
"Date",
"displayDate",
",",
"int",
"status",
")",
"{",
"for",
"(",
"CommerceDiscount",
"commerceDiscount",
":",
"findByLtD_S",
"(",
"displayDate",
",",
"status",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"Q... | Removes all the commerce discounts where displayDate < ? and status = ? from the database.
@param displayDate the display date
@param status the status | [
"Removes",
"all",
"the",
"commerce",
"discounts",
"where",
"displayDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L3857-L3863 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateEntity | public OperationStatus updateEntity(UUID appId, String versionId, UUID entityId, UpdateEntityOptionalParameter updateEntityOptionalParameter) {
"""
Updates the name of an entity extractor.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@param update... | java | public OperationStatus updateEntity(UUID appId, String versionId, UUID entityId, UpdateEntityOptionalParameter updateEntityOptionalParameter) {
return updateEntityWithServiceResponseAsync(appId, versionId, entityId, updateEntityOptionalParameter).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateEntity",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UpdateEntityOptionalParameter",
"updateEntityOptionalParameter",
")",
"{",
"return",
"updateEntityWithServiceResponseAsync",
"(",
"appId",
",",
"v... | Updates the name of an entity extractor.
@param appId The application ID.
@param versionId The version ID.
@param entityId The entity extractor ID.
@param updateEntityOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameter... | [
"Updates",
"the",
"name",
"of",
"an",
"entity",
"extractor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L3378-L3380 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.searchElement | public void searchElement(final String path, final Runnable nextAction) {
"""
Searches for a specific element and opens it's preview if found.<p>
@param path the element path
@param nextAction the next action to execute after the search data for the element has been loaded into the gallery dialog
"""
... | java | public void searchElement(final String path, final Runnable nextAction) {
m_dialogBean.setCurrentElement(path);
m_dialogBean.setStartTab(GalleryTabId.cms_tab_results);
m_dialogBean.setTreeToken(getTreeToken());
CmsRpcAction<CmsGallerySearchBean> searchAction = new CmsRpcAction<CmsGalle... | [
"public",
"void",
"searchElement",
"(",
"final",
"String",
"path",
",",
"final",
"Runnable",
"nextAction",
")",
"{",
"m_dialogBean",
".",
"setCurrentElement",
"(",
"path",
")",
";",
"m_dialogBean",
".",
"setStartTab",
"(",
"GalleryTabId",
".",
"cms_tab_results",
... | Searches for a specific element and opens it's preview if found.<p>
@param path the element path
@param nextAction the next action to execute after the search data for the element has been loaded into the gallery dialog | [
"Searches",
"for",
"a",
"specific",
"element",
"and",
"opens",
"it",
"s",
"preview",
"if",
"found",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1208-L1236 |
Metatavu/edelphi | edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimeSerieQueryReportPage.java | ThesisTimeSerieQueryReportPage.appendQueryPageComments | private void appendQueryPageComments(RequestContext requestContext, final QueryPage queryPage) {
"""
Appends query page comment to request.
@param requestContext request contract
@param queryPage query page
"""
PanelStamp panelStamp = RequestUtils.getActiveStamp(requestContext);
Map<Long, Map<Strin... | java | private void appendQueryPageComments(RequestContext requestContext, final QueryPage queryPage) {
PanelStamp panelStamp = RequestUtils.getActiveStamp(requestContext);
Map<Long, Map<String, String>> answers = getRequestAnswerMap(requestContext);
Double maxX = QueryPageUtils.getDoubleSetting(queryPage, "time_s... | [
"private",
"void",
"appendQueryPageComments",
"(",
"RequestContext",
"requestContext",
",",
"final",
"QueryPage",
"queryPage",
")",
"{",
"PanelStamp",
"panelStamp",
"=",
"RequestUtils",
".",
"getActiveStamp",
"(",
"requestContext",
")",
";",
"Map",
"<",
"Long",
",",... | Appends query page comment to request.
@param requestContext request contract
@param queryPage query page | [
"Appends",
"query",
"page",
"comment",
"to",
"request",
"."
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/thesis/ThesisTimeSerieQueryReportPage.java#L181-L189 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.createResource | @Deprecated
public CmsResource createResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException, CmsIllegalArgumentException {
"""
Creates a new resource of the given resource type
with the provided content and properties.<p>
@param resourcename the name o... | java | @Deprecated
public CmsResource createResource(String resourcename, int type, byte[] content, List<CmsProperty> properties)
throws CmsException, CmsIllegalArgumentException {
return createResource(resourcename, getResourceType(type), content, properties);
} | [
"@",
"Deprecated",
"public",
"CmsResource",
"createResource",
"(",
"String",
"resourcename",
",",
"int",
"type",
",",
"byte",
"[",
"]",
"content",
",",
"List",
"<",
"CmsProperty",
">",
"properties",
")",
"throws",
"CmsException",
",",
"CmsIllegalArgumentException"... | Creates a new resource of the given resource type
with the provided content and properties.<p>
@param resourcename the name of the resource to create (full current site relative path)
@param type the type of the resource to create
@param content the contents for the new resource
@param properties the properties for th... | [
"Creates",
"a",
"new",
"resource",
"of",
"the",
"given",
"resource",
"type",
"with",
"the",
"provided",
"content",
"and",
"properties",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L847-L852 |
TakahikoKawasaki/nv-cipher | src/main/java/com/neovisionaries/security/Utils.java | Utils.toStringUTF8 | public static String toStringUTF8(byte[] input) {
"""
Build a {@code String} instance by {@code new String(input, "UTF-8")}.
"""
if (input == null)
{
return null;
}
try
{
return new String(input, "UTF-8");
}
catch (Unsup... | java | public static String toStringUTF8(byte[] input)
{
if (input == null)
{
return null;
}
try
{
return new String(input, "UTF-8");
}
catch (UnsupportedEncodingException e)
{
// This won't happen.
... | [
"public",
"static",
"String",
"toStringUTF8",
"(",
"byte",
"[",
"]",
"input",
")",
"{",
"if",
"(",
"input",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"new",
"String",
"(",
"input",
",",
"\"UTF-8\"",
")",
";",
"}",
"c... | Build a {@code String} instance by {@code new String(input, "UTF-8")}. | [
"Build",
"a",
"{"
] | train | https://github.com/TakahikoKawasaki/nv-cipher/blob/d01aa4f53611e2724ae03633060f55bacf549175/src/main/java/com/neovisionaries/security/Utils.java#L62-L78 |
twilio/twilio-java | src/main/java/com/twilio/rest/wireless/v1/RatePlanReader.java | RatePlanReader.firstPage | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<RatePlan> firstPage(final TwilioRestClient client) {
"""
Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return RatePlan ResourceSet
"""
Request request = ... | java | @Override
@SuppressWarnings("checkstyle:linelength")
public Page<RatePlan> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.WIRELESS.toString(),
"/v1/RatePlans",
client.getRegion()
);
addQue... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:linelength\"",
")",
"public",
"Page",
"<",
"RatePlan",
">",
"firstPage",
"(",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET"... | Make the request to the Twilio API to perform the read.
@param client TwilioRestClient with which to make the request
@return RatePlan ResourceSet | [
"Make",
"the",
"request",
"to",
"the",
"Twilio",
"API",
"to",
"perform",
"the",
"read",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/wireless/v1/RatePlanReader.java#L40-L52 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java | MapUtils.buildClickBoundingBox | public static BoundingBox buildClickBoundingBox(LatLng latLng, View view, GoogleMap map, float screenClickPercentage) {
"""
Build a bounding box using the click location, map view, map, and screen percentage tolerance.
The bounding box can be used to query for features that were clicked
@param latLng ... | java | public static BoundingBox buildClickBoundingBox(LatLng latLng, View view, GoogleMap map, float screenClickPercentage) {
LatLngBoundingBox latLngBoundingBox = buildClickLatLngBoundingBox(latLng, view, map, screenClickPercentage);
// Create the bounding box to query for features
BoundingBox boun... | [
"public",
"static",
"BoundingBox",
"buildClickBoundingBox",
"(",
"LatLng",
"latLng",
",",
"View",
"view",
",",
"GoogleMap",
"map",
",",
"float",
"screenClickPercentage",
")",
"{",
"LatLngBoundingBox",
"latLngBoundingBox",
"=",
"buildClickLatLngBoundingBox",
"(",
"latLng... | Build a bounding box using the click location, map view, map, and screen percentage tolerance.
The bounding box can be used to query for features that were clicked
@param latLng click location
@param view view
@param map Google map
@param screenClickPercentage screen c... | [
"Build",
"a",
"bounding",
"box",
"using",
"the",
"click",
"location",
"map",
"view",
"map",
"and",
"screen",
"percentage",
"tolerance",
".",
"The",
"bounding",
"box",
"can",
"be",
"used",
"to",
"query",
"for",
"features",
"that",
"were",
"clicked"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/MapUtils.java#L113-L125 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionValuedMap.java | CollectionValuedMap.removeMapping | public void removeMapping(K key, V value) {
"""
Removes the value from the Collection mapped to by this key, leaving the
rest of the collection intact.
@param key
the key to the Collection to remove the value from
@param value
the value to remove
"""
if (treatCollectionsAsImmutable) {
Collec... | java | public void removeMapping(K key, V value) {
if (treatCollectionsAsImmutable) {
Collection<V> c = map.get(key);
if (c != null) {
Collection<V> newC = cf.newCollection();
newC.addAll(c);
newC.remove(value);
map.put(key, newC);
}
} else {
Collecti... | [
"public",
"void",
"removeMapping",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"treatCollectionsAsImmutable",
")",
"{",
"Collection",
"<",
"V",
">",
"c",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"c",
"!=",
"null",
")",
... | Removes the value from the Collection mapped to by this key, leaving the
rest of the collection intact.
@param key
the key to the Collection to remove the value from
@param value
the value to remove | [
"Removes",
"the",
"value",
"from",
"the",
"Collection",
"mapped",
"to",
"by",
"this",
"key",
"leaving",
"the",
"rest",
"of",
"the",
"collection",
"intact",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionValuedMap.java#L163-L177 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java | GenericUtils.expandByteArray | static public byte[] expandByteArray(byte[] src, byte[] dst) {
"""
Generic method to copy the entire length of each buffer.
@param src
@param dst
@return byte[]
"""
int srcLength = (null != src) ? src.length : 0;
int dstLength = (null != dst) ? dst.length : 0;
return expandByteArra... | java | static public byte[] expandByteArray(byte[] src, byte[] dst) {
int srcLength = (null != src) ? src.length : 0;
int dstLength = (null != dst) ? dst.length : 0;
return expandByteArray(src, dst, 0, srcLength, 0, dstLength);
} | [
"static",
"public",
"byte",
"[",
"]",
"expandByteArray",
"(",
"byte",
"[",
"]",
"src",
",",
"byte",
"[",
"]",
"dst",
")",
"{",
"int",
"srcLength",
"=",
"(",
"null",
"!=",
"src",
")",
"?",
"src",
".",
"length",
":",
"0",
";",
"int",
"dstLength",
"... | Generic method to copy the entire length of each buffer.
@param src
@param dst
@return byte[] | [
"Generic",
"method",
"to",
"copy",
"the",
"entire",
"length",
"of",
"each",
"buffer",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/GenericUtils.java#L696-L700 |
hsiafan/requests | src/main/java/net/dongliu/requests/RawResponse.java | RawResponse.writeTo | public void writeTo(Writer writer) {
"""
Write response body to Writer, charset can be set using {@link #charset(Charset)},
or will use charset detected from response header if not set.
Writer will not be closed.
"""
try {
try (InputStream in = body();
Reader reader = new... | java | public void writeTo(Writer writer) {
try {
try (InputStream in = body();
Reader reader = new InputStreamReader(in, getCharset())) {
Readers.transferTo(reader, writer);
}
} catch (IOException e) {
throw new RequestsException(e);
... | [
"public",
"void",
"writeTo",
"(",
"Writer",
"writer",
")",
"{",
"try",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"body",
"(",
")",
";",
"Reader",
"reader",
"=",
"new",
"InputStreamReader",
"(",
"in",
",",
"getCharset",
"(",
")",
")",
")",
"{",
"Read... | Write response body to Writer, charset can be set using {@link #charset(Charset)},
or will use charset detected from response header if not set.
Writer will not be closed. | [
"Write",
"response",
"body",
"to",
"Writer",
"charset",
"can",
"be",
"set",
"using",
"{"
] | train | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/RawResponse.java#L292-L303 |
trellis-ldp-archive/trellis-http | src/main/java/org/trellisldp/http/impl/GetHandler.java | GetHandler.getRepresentation | public ResponseBuilder getRepresentation(final Resource res) {
"""
Build the representation for the given resource
@param res the resource
@return the response builder
"""
final String identifier = getBaseUrl() + req.getPartition() + req.getPath();
// Check if this is already deleted
... | java | public ResponseBuilder getRepresentation(final Resource res) {
final String identifier = getBaseUrl() + req.getPartition() + req.getPath();
// Check if this is already deleted
checkDeleted(res, identifier);
LOGGER.debug("Acceptable media types: {}", req.getHeaders().getAcceptableMediaT... | [
"public",
"ResponseBuilder",
"getRepresentation",
"(",
"final",
"Resource",
"res",
")",
"{",
"final",
"String",
"identifier",
"=",
"getBaseUrl",
"(",
")",
"+",
"req",
".",
"getPartition",
"(",
")",
"+",
"req",
".",
"getPath",
"(",
")",
";",
"// Check if this... | Build the representation for the given resource
@param res the resource
@return the response builder | [
"Build",
"the",
"representation",
"for",
"the",
"given",
"resource"
] | train | https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/GetHandler.java#L132-L176 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java | InodeTree.lockFullInodePath | public LockedInodePath lockFullInodePath(long id, LockPattern lockPattern)
throws FileDoesNotExistException {
"""
Locks a path and throws an exception if the path does not exist.
@param id the inode id to lock
@param lockPattern the pattern to lock with
@return a locked inode path for the uri
"""
... | java | public LockedInodePath lockFullInodePath(long id, LockPattern lockPattern)
throws FileDoesNotExistException {
LockedInodePath inodePath = lockInodePathById(id, lockPattern);
if (!inodePath.fullPathExists()) {
inodePath.close();
throw new FileDoesNotExistException(ExceptionMessage.INODE_DOES_NO... | [
"public",
"LockedInodePath",
"lockFullInodePath",
"(",
"long",
"id",
",",
"LockPattern",
"lockPattern",
")",
"throws",
"FileDoesNotExistException",
"{",
"LockedInodePath",
"inodePath",
"=",
"lockInodePathById",
"(",
"id",
",",
"lockPattern",
")",
";",
"if",
"(",
"!"... | Locks a path and throws an exception if the path does not exist.
@param id the inode id to lock
@param lockPattern the pattern to lock with
@return a locked inode path for the uri | [
"Locks",
"a",
"path",
"and",
"throws",
"an",
"exception",
"if",
"the",
"path",
"does",
"not",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTree.java#L389-L397 |
tminglei/form-binder-java | src/main/java/com/github/tminglei/bind/Mappings.java | Mappings.doublev | public static Mapping<Double> doublev(Constraint... constraints) {
"""
(convert to Double) mapping
@param constraints constraints
@return new created mapping
"""
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ? 0.0d ... | java | public static Mapping<Double> doublev(Constraint... constraints) {
return new FieldMapping(
InputMode.SINGLE,
mkSimpleConverter(s ->
isEmptyStr(s) ? 0.0d : Double.parseDouble(s)
), new MappingMeta(MAPPING_DOUBLE, Double.class)
).con... | [
"public",
"static",
"Mapping",
"<",
"Double",
">",
"doublev",
"(",
"Constraint",
"...",
"constraints",
")",
"{",
"return",
"new",
"FieldMapping",
"(",
"InputMode",
".",
"SINGLE",
",",
"mkSimpleConverter",
"(",
"s",
"->",
"isEmptyStr",
"(",
"s",
")",
"?",
"... | (convert to Double) mapping
@param constraints constraints
@return new created mapping | [
"(",
"convert",
"to",
"Double",
")",
"mapping"
] | train | https://github.com/tminglei/form-binder-java/blob/4c0bd1e8f81ae56b21142bb525ee6b4deb7f92ab/src/main/java/com/github/tminglei/bind/Mappings.java#L77-L85 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/av/EglCore.java | EglCore.getConfig | private EGLConfig getConfig(int flags, int version) {
"""
Finds a suitable EGLConfig.
@param flags Bit flags from constructor.
@param version Must be 2 or 3.
"""
int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
if (version >= 3) {
renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
... | java | private EGLConfig getConfig(int flags, int version) {
int renderableType = EGL14.EGL_OPENGL_ES2_BIT;
if (version >= 3) {
renderableType |= EGLExt.EGL_OPENGL_ES3_BIT_KHR;
}
// The actual surface is generally RGBA or RGBX, so situationally omitting alpha
// doesn't rea... | [
"private",
"EGLConfig",
"getConfig",
"(",
"int",
"flags",
",",
"int",
"version",
")",
"{",
"int",
"renderableType",
"=",
"EGL14",
".",
"EGL_OPENGL_ES2_BIT",
";",
"if",
"(",
"version",
">=",
"3",
")",
"{",
"renderableType",
"|=",
"EGLExt",
".",
"EGL_OPENGL_ES... | Finds a suitable EGLConfig.
@param flags Bit flags from constructor.
@param version Must be 2 or 3. | [
"Finds",
"a",
"suitable",
"EGLConfig",
"."
] | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/av/EglCore.java#L143-L175 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/DatePickerSettings.java | DatePickerSettings.setColor | public void setColor(DateArea area, Color color) {
"""
setColor, This sets a color for the specified area. Setting an area to null will restore the
default color for that area.
"""
// If null was supplied, then use the default color.
if (color == null) {
color = area.defaultColor;
... | java | public void setColor(DateArea area, Color color) {
// If null was supplied, then use the default color.
if (color == null) {
color = area.defaultColor;
}
// Save the color to the color map.
colors.put(area, color);
// Call any "updating functions" that are app... | [
"public",
"void",
"setColor",
"(",
"DateArea",
"area",
",",
"Color",
"color",
")",
"{",
"// If null was supplied, then use the default color.",
"if",
"(",
"color",
"==",
"null",
")",
"{",
"color",
"=",
"area",
".",
"defaultColor",
";",
"}",
"// Save the color to t... | setColor, This sets a color for the specified area. Setting an area to null will restore the
default color for that area. | [
"setColor",
"This",
"sets",
"a",
"color",
"for",
"the",
"specified",
"area",
".",
"Setting",
"an",
"area",
"to",
"null",
"will",
"restore",
"the",
"default",
"color",
"for",
"that",
"area",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/DatePickerSettings.java#L1317-L1339 |
glyptodon/guacamole-client | extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java | UserVerificationService.getKey | private UserTOTPKey getKey(UserContext context,
String username) throws GuacamoleException {
"""
Retrieves and decodes the base32-encoded TOTP key associated with user
having the given UserContext. If no TOTP key is associated with the user,
a random key is generated and associated with the user. If ... | java | private UserTOTPKey getKey(UserContext context,
String username) throws GuacamoleException {
// Retrieve attributes from current user
User self = context.self();
Map<String, String> attributes = context.self().getAttributes();
// If no key is defined, attempt to generate a ... | [
"private",
"UserTOTPKey",
"getKey",
"(",
"UserContext",
"context",
",",
"String",
"username",
")",
"throws",
"GuacamoleException",
"{",
"// Retrieve attributes from current user",
"User",
"self",
"=",
"context",
".",
"self",
"(",
")",
";",
"Map",
"<",
"String",
",... | Retrieves and decodes the base32-encoded TOTP key associated with user
having the given UserContext. If no TOTP key is associated with the user,
a random key is generated and associated with the user. If the extension
storing the user does not support storage of the TOTP key, null is
returned.
@param context
The UserC... | [
"Retrieves",
"and",
"decodes",
"the",
"base32",
"-",
"encoded",
"TOTP",
"key",
"associated",
"with",
"user",
"having",
"the",
"given",
"UserContext",
".",
"If",
"no",
"TOTP",
"key",
"is",
"associated",
"with",
"the",
"user",
"a",
"random",
"key",
"is",
"ge... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java#L102-L142 |
igniterealtime/Smack | smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java | TransportNegotiator.triggerTransportEstablished | private void triggerTransportEstablished(TransportCandidate local, TransportCandidate remote) throws NotConnectedException, InterruptedException {
"""
Trigger a Transport session established event.
@param local TransportCandidate that has been agreed.
@param remote TransportCandidate that has been agreed.
@t... | java | private void triggerTransportEstablished(TransportCandidate local, TransportCandidate remote) throws NotConnectedException, InterruptedException {
List<JingleListener> listeners = getListenersList();
for (JingleListener li : listeners) {
if (li instanceof JingleTransportListener) {
... | [
"private",
"void",
"triggerTransportEstablished",
"(",
"TransportCandidate",
"local",
",",
"TransportCandidate",
"remote",
")",
"throws",
"NotConnectedException",
",",
"InterruptedException",
"{",
"List",
"<",
"JingleListener",
">",
"listeners",
"=",
"getListenersList",
"... | Trigger a Transport session established event.
@param local TransportCandidate that has been agreed.
@param remote TransportCandidate that has been agreed.
@throws NotConnectedException
@throws InterruptedException | [
"Trigger",
"a",
"Transport",
"session",
"established",
"event",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/TransportNegotiator.java#L799-L809 |
google/closure-compiler | src/com/google/javascript/jscomp/parsing/parser/FeatureSet.java | FeatureSet.with | @VisibleForTesting
public FeatureSet with(FeatureSet newFeatures) {
"""
Returns a feature set combining all the features from {@code this} and {@code newFeatures}.
"""
return new FeatureSet(union(features, newFeatures.features));
} | java | @VisibleForTesting
public FeatureSet with(FeatureSet newFeatures) {
return new FeatureSet(union(features, newFeatures.features));
} | [
"@",
"VisibleForTesting",
"public",
"FeatureSet",
"with",
"(",
"FeatureSet",
"newFeatures",
")",
"{",
"return",
"new",
"FeatureSet",
"(",
"union",
"(",
"features",
",",
"newFeatures",
".",
"features",
")",
")",
";",
"}"
] | Returns a feature set combining all the features from {@code this} and {@code newFeatures}. | [
"Returns",
"a",
"feature",
"set",
"combining",
"all",
"the",
"features",
"from",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/parsing/parser/FeatureSet.java#L379-L382 |
ops4j/org.ops4j.pax.web | pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletContextHelperTracker.java | ServletContextHelperTracker.createFilter | private static Filter createFilter(final BundleContext bundleContext, final Class<?>... classes) {
"""
Creates an OSGi filter for the classes.
@param bundleContext
a bundle context
@param classes
array of tracked classes
@return osgi filter
"""
final StringBuilder filter = new StringBuilder();
if ... | java | private static Filter createFilter(final BundleContext bundleContext, final Class<?>... classes) {
final StringBuilder filter = new StringBuilder();
if (classes != null) {
if (classes.length > 1) {
filter.append("(|");
}
for (Class<?> clazz : classes) {
filter.append("(").append(Constants.OB... | [
"private",
"static",
"Filter",
"createFilter",
"(",
"final",
"BundleContext",
"bundleContext",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"final",
"StringBuilder",
"filter",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"class... | Creates an OSGi filter for the classes.
@param bundleContext
a bundle context
@param classes
array of tracked classes
@return osgi filter | [
"Creates",
"an",
"OSGi",
"filter",
"for",
"the",
"classes",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/tracker/ServletContextHelperTracker.java#L100-L118 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java | HttpHeaderMap.put | public Object put(Object key, Object value) {
"""
May return a list if the key previously mapped to multiple values.
"""
if (value instanceof List) {
return mMap.put(key, new ArrayList((List)value));
}
else {
return mMap.put(key, value);
}
} | java | public Object put(Object key, Object value) {
if (value instanceof List) {
return mMap.put(key, new ArrayList((List)value));
}
else {
return mMap.put(key, value);
}
} | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"List",
")",
"{",
"return",
"mMap",
".",
"put",
"(",
"key",
",",
"new",
"ArrayList",
"(",
"(",
"List",
")",
"value",
")",
")",
";",... | May return a list if the key previously mapped to multiple values. | [
"May",
"return",
"a",
"list",
"if",
"the",
"key",
"previously",
"mapped",
"to",
"multiple",
"values",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/HttpHeaderMap.java#L427-L434 |
xebia-france/xebia-management-extras | src/main/java/fr/xebia/management/statistics/ProfileAspect.java | ProfileAspect.getFullyQualifiedMethodName | protected static String getFullyQualifiedMethodName(String fullyQualifiedClassName, String methodName, ClassNameStyle classNameStyle) {
"""
<p>
Formats the given <code>fullyQualifiedName</code> according to the given
<code>classNameStyle</code>.
</p>
<p>
Samples with <code>java.lang.String</code>:
<ul>
<li>... | java | protected static String getFullyQualifiedMethodName(String fullyQualifiedClassName, String methodName, ClassNameStyle classNameStyle) {
StringBuilder fullyQualifiedMethodName = new StringBuilder(fullyQualifiedClassName.length() + methodName.length() + 1);
switch (classNameStyle) {
case FULLY_QUA... | [
"protected",
"static",
"String",
"getFullyQualifiedMethodName",
"(",
"String",
"fullyQualifiedClassName",
",",
"String",
"methodName",
",",
"ClassNameStyle",
"classNameStyle",
")",
"{",
"StringBuilder",
"fullyQualifiedMethodName",
"=",
"new",
"StringBuilder",
"(",
"fullyQua... | <p>
Formats the given <code>fullyQualifiedName</code> according to the given
<code>classNameStyle</code>.
</p>
<p>
Samples with <code>java.lang.String</code>:
<ul>
<li>{@link ClassNameStyle#FULLY_QUALIFIED_NAME} :
<code>java.lang.String</code></li>
<li>{@link ClassNameStyle#COMPACT_FULLY_QUALIFIED_NAME} :
<code>j.l.Str... | [
"<p",
">",
"Formats",
"the",
"given",
"<code",
">",
"fullyQualifiedName<",
"/",
"code",
">",
"according",
"to",
"the",
"given",
"<code",
">",
"classNameStyle<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Samples",
"with",
"<code",
">",
"jav... | train | https://github.com/xebia-france/xebia-management-extras/blob/09f52a0ddb898e402a04f0adfacda74a5d0556e8/src/main/java/fr/xebia/management/statistics/ProfileAspect.java#L105-L128 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java | AbstractBigtableAdmin.modifyColumns | public void modifyColumns(final String tableName, HColumnDescriptor descriptor)
throws IOException {
"""
Modify an existing column family on a table. NOTE: this is needed for backwards compatibility
for the hbase shell.
@param tableName a {@link TableName} object.
@param descriptor a {@link HColumnDesc... | java | public void modifyColumns(final String tableName, HColumnDescriptor descriptor)
throws IOException {
modifyColumn(TableName.valueOf(tableName), descriptor);
} | [
"public",
"void",
"modifyColumns",
"(",
"final",
"String",
"tableName",
",",
"HColumnDescriptor",
"descriptor",
")",
"throws",
"IOException",
"{",
"modifyColumn",
"(",
"TableName",
".",
"valueOf",
"(",
"tableName",
")",
",",
"descriptor",
")",
";",
"}"
] | Modify an existing column family on a table. NOTE: this is needed for backwards compatibility
for the hbase shell.
@param tableName a {@link TableName} object.
@param descriptor a {@link HColumnDescriptor} object.
@throws java.io.IOException if any. | [
"Modify",
"an",
"existing",
"column",
"family",
"on",
"a",
"table",
".",
"NOTE",
":",
"this",
"is",
"needed",
"for",
"backwards",
"compatibility",
"for",
"the",
"hbase",
"shell",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableAdmin.java#L631-L634 |
samskivert/pythagoras | src/main/java/pythagoras/d/Lines.java | Lines.relativeCCW | public static int relativeCCW (double px, double py, double x1, double y1, double x2, double y2) {
"""
Returns an indicator of where the specified point (px,py) lies with respect to the line
segment from (x1,y1) to (x2,y2).
See http://download.oracle.com/javase/6/docs/api/java/awt/geom/Line2D.html
"""
... | java | public static int relativeCCW (double px, double py, double x1, double y1, double x2, double y2) {
// A = (x2-x1, y2-y1)
// P = (px-x1, py-y1)
x2 -= x1;
y2 -= y1;
px -= x1;
py -= y1;
double t = px * y2 - py * x2; // PxA
if (t == 0f) {
t = px * ... | [
"public",
"static",
"int",
"relativeCCW",
"(",
"double",
"px",
",",
"double",
"py",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"// A = (x2-x1, y2-y1)",
"// P = (px-x1, py-y1)",
"x2",
"-=",
"x1",
";",
"y2",... | Returns an indicator of where the specified point (px,py) lies with respect to the line
segment from (x1,y1) to (x2,y2).
See http://download.oracle.com/javase/6/docs/api/java/awt/geom/Line2D.html | [
"Returns",
"an",
"indicator",
"of",
"where",
"the",
"specified",
"point",
"(",
"px",
"py",
")",
"lies",
"with",
"respect",
"to",
"the",
"line",
"segment",
"from",
"(",
"x1",
"y1",
")",
"to",
"(",
"x2",
"y2",
")",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Lines.java#L131-L151 |
astrapi69/jaulp-wicket | jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/BaseModalPanel.java | BaseModalPanel.newOkButton | protected AjaxButton newOkButton(final String id) {
"""
Factory method for creating the new ok {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new ok {@link AjaxButton}.
@param id
the id
@return the new ... | java | protected AjaxButton newOkButton(final String id)
{
final AjaxButton ok = new AjaxButton(id)
{
/**
* The serialVersionUID.
*/
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void onError(final AjaxRequestTarget target, final F... | [
"protected",
"AjaxButton",
"newOkButton",
"(",
"final",
"String",
"id",
")",
"{",
"final",
"AjaxButton",
"ok",
"=",
"new",
"AjaxButton",
"(",
"id",
")",
"{",
"/**\r\n\t\t\t * The serialVersionUID.\r\n\t\t\t */",
"private",
"static",
"final",
"long",
"serialVersionUID"... | Factory method for creating the new ok {@link AjaxButton}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new ok {@link AjaxButton}.
@param id
the id
@return the new ok {@link AjaxButton} | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"ok",
"{",
"@link",
"AjaxButton",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"p... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-dialogs/src/main/java/de/alpharogroup/wicket/dialogs/ajax/modal/BaseModalPanel.java#L141-L171 |
unbescape/unbescape | src/main/java/org/unbescape/csv/CsvEscape.java | CsvEscape.unescapeCsv | public static void unescapeCsv(final char[] text, final int offset, final int len, final Writer writer)
throws IOException {
"""
<p>
Perform a CSV <strong>unescape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>
@... | java | public static void unescapeCsv(final char[] text, final int offset, final int len, final Writer writer)
throws IOException{
if (writer == null) {
throw new IllegalArgumentException("Argument 'writer' cannot be null");
}
final int textLen = (text ... | [
"public",
"static",
"void",
"unescapeCsv",
"(",
"final",
"char",
"[",
"]",
"text",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"len",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"... | <p>
Perform a CSV <strong>unescape</strong> operation on a <tt>char[]</tt> input.
</p>
<p>
This method is <strong>thread-safe</strong>.
</p>
@param text the <tt>char[]</tt> to be unescaped.
@param offset the position in <tt>text</tt> at which the unescape operation should start.
@param len the number of characters in ... | [
"<p",
">",
"Perform",
"a",
"CSV",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"char",
"[]",
"<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
"This",
"method",
"is",
"<strong",
">",
"thread... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/csv/CsvEscape.java#L330-L351 |
apache/incubator-druid | extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java | ThriftDeserialization.detectAndDeserialize | public static <T extends TBase> T detectAndDeserialize(final byte[] bytes, final T thriftObj) throws TException {
"""
Deserializes byte-array into thrift object.
<p>
Supporting binary, compact and json protocols,
and the byte array could be or not be encoded by Base64.
@param bytes the byte-array to dese... | java | public static <T extends TBase> T detectAndDeserialize(final byte[] bytes, final T thriftObj) throws TException
{
Preconditions.checkNotNull(thriftObj);
try {
final byte[] src = decodeB64IfNeeded(bytes);
final TProtocolFactory protocolFactory = TProtocolUtil.guessProtocolFactory(src, null);
... | [
"public",
"static",
"<",
"T",
"extends",
"TBase",
">",
"T",
"detectAndDeserialize",
"(",
"final",
"byte",
"[",
"]",
"bytes",
",",
"final",
"T",
"thriftObj",
")",
"throws",
"TException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"thriftObj",
")",
";",
... | Deserializes byte-array into thrift object.
<p>
Supporting binary, compact and json protocols,
and the byte array could be or not be encoded by Base64.
@param bytes the byte-array to deserialize
@param thriftObj the output thrift object
@return the output thrift object, or null if error occurs | [
"Deserializes",
"byte",
"-",
"array",
"into",
"thrift",
"object",
".",
"<p",
">",
"Supporting",
"binary",
"compact",
"and",
"json",
"protocols",
"and",
"the",
"byte",
"array",
"could",
"be",
"or",
"not",
"be",
"encoded",
"by",
"Base64",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-contrib/thrift-extensions/src/main/java/org/apache/druid/data/input/thrift/ThriftDeserialization.java#L102-L121 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java | CombineFileInputFormat.createPool | protected void createPool(JobConf conf, List<PathFilter> filters) {
"""
Create a new pool and add the filters to it.
A split cannot have files from different pools.
"""
pools.add(new MultiPathFilter(filters));
} | java | protected void createPool(JobConf conf, List<PathFilter> filters) {
pools.add(new MultiPathFilter(filters));
} | [
"protected",
"void",
"createPool",
"(",
"JobConf",
"conf",
",",
"List",
"<",
"PathFilter",
">",
"filters",
")",
"{",
"pools",
".",
"add",
"(",
"new",
"MultiPathFilter",
"(",
"filters",
")",
")",
";",
"}"
] | Create a new pool and add the filters to it.
A split cannot have files from different pools. | [
"Create",
"a",
"new",
"pool",
"and",
"add",
"the",
"filters",
"to",
"it",
".",
"A",
"split",
"cannot",
"have",
"files",
"from",
"different",
"pools",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/lib/CombineFileInputFormat.java#L269-L271 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLineLayer.java | BusLineLayer.onBusItineraryAdded | protected boolean onBusItineraryAdded(BusItinerary itinerary, int index) {
"""
Invoked when a bus itinerary was added in the attached line.
<p>This function exists to allow be override to provide a specific behaviour
when a bus itinerary has been added.
@param itinerary is the new itinerary.
@param index i... | java | protected boolean onBusItineraryAdded(BusItinerary itinerary, int index) {
if (this.autoUpdate.get()) {
try {
addMapLayer(index, new BusItineraryLayer(itinerary, isLayerAutoUpdated()));
return true;
} catch (Throwable exception) {
//
}
}
return false;
} | [
"protected",
"boolean",
"onBusItineraryAdded",
"(",
"BusItinerary",
"itinerary",
",",
"int",
"index",
")",
"{",
"if",
"(",
"this",
".",
"autoUpdate",
".",
"get",
"(",
")",
")",
"{",
"try",
"{",
"addMapLayer",
"(",
"index",
",",
"new",
"BusItineraryLayer",
... | Invoked when a bus itinerary was added in the attached line.
<p>This function exists to allow be override to provide a specific behaviour
when a bus itinerary has been added.
@param itinerary is the new itinerary.
@param index is the index of the bus itinerary.
@return <code>true</code> if the events was fired, other... | [
"Invoked",
"when",
"a",
"bus",
"itinerary",
"was",
"added",
"in",
"the",
"attached",
"line",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/layer/BusLineLayer.java#L253-L263 |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/Input.java | Input.withTags | public Input withTags(java.util.Map<String, String> tags) {
"""
A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
} | java | public Input withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"Input",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | A collection of key-value pairs.
@param tags
A collection of key-value pairs.
@return Returns a reference to this object so that method calls can be chained together. | [
"A",
"collection",
"of",
"key",
"-",
"value",
"pairs",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/Input.java#L668-L671 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/ZipBuilder.java | ZipBuilder.addFile | private void addFile(File root, File file, String prefix, ZipOutputStream zos) throws IOException {
"""
Adds a given file to the given ZIP output stream.
@param root
an ancestor of {@code file}, used to determine the relative path within the
archive
@param file
file to be added
@param zos
ZIP output strea... | java | private void addFile(File root, File file, String prefix, ZipOutputStream zos) throws IOException {
FileInputStream fis = new FileInputStream(file);
ZipEntry jarEntry = new ZipEntry(prefix + normalizePath(root, file));
zos.putNextEntry(jarEntry);
StreamUtils.copyStream(fis, zos, false);
... | [
"private",
"void",
"addFile",
"(",
"File",
"root",
",",
"File",
"file",
",",
"String",
"prefix",
",",
"ZipOutputStream",
"zos",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"ZipEntry",
"ja... | Adds a given file to the given ZIP output stream.
@param root
an ancestor of {@code file}, used to determine the relative path within the
archive
@param file
file to be added
@param zos
ZIP output stream
@throws IOException | [
"Adds",
"a",
"given",
"file",
"to",
"the",
"given",
"ZIP",
"output",
"stream",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/ZipBuilder.java#L177-L183 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java | DetectPolygonFromContour.determineCornersOnBorder | void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) {
"""
Check to see if corners are touching the image border
@param polygon Polygon in distorted (original image) pixels
@param onImageBorder storage for corner indexes
"""
onImageBorder.reset();
for (int i = 0; i < polygon... | java | void determineCornersOnBorder( Polygon2D_F64 polygon , GrowQueue_B onImageBorder ) {
onImageBorder.reset();
for (int i = 0; i < polygon.size(); i++) {
Point2D_F64 p = polygon.get(i);
onImageBorder.add( p.x <= 1 || p.y <= 1 || p.x >= imageWidth-2 || p.y >= imageHeight-2);
}
} | [
"void",
"determineCornersOnBorder",
"(",
"Polygon2D_F64",
"polygon",
",",
"GrowQueue_B",
"onImageBorder",
")",
"{",
"onImageBorder",
".",
"reset",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"polygon",
".",
"size",
"(",
")",
";",
"i",... | Check to see if corners are touching the image border
@param polygon Polygon in distorted (original image) pixels
@param onImageBorder storage for corner indexes | [
"Check",
"to",
"see",
"if",
"corners",
"are",
"touching",
"the",
"image",
"border"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polygon/DetectPolygonFromContour.java#L442-L449 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.create_POINTER_Image | protected BufferedImage create_POINTER_Image(final int WIDTH, final PointerType POINTER_TYPE, final ColorDef POINTER_COLOR) {
"""
Returns the image of the pointer. This pointer is centered in the gauge.
@param WIDTH
@param POINTER_TYPE
@param POINTER_COLOR
@return the pointer image that is used in all gauges t... | java | protected BufferedImage create_POINTER_Image(final int WIDTH, final PointerType POINTER_TYPE, final ColorDef POINTER_COLOR) {
return POINTER_FACTORY.createStandardPointer(WIDTH, POINTER_TYPE, POINTER_COLOR, getBackgroundColor());
} | [
"protected",
"BufferedImage",
"create_POINTER_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"PointerType",
"POINTER_TYPE",
",",
"final",
"ColorDef",
"POINTER_COLOR",
")",
"{",
"return",
"POINTER_FACTORY",
".",
"createStandardPointer",
"(",
"WIDTH",
",",
"POINTER... | Returns the image of the pointer. This pointer is centered in the gauge.
@param WIDTH
@param POINTER_TYPE
@param POINTER_COLOR
@return the pointer image that is used in all gauges that have a centered pointer | [
"Returns",
"the",
"image",
"of",
"the",
"pointer",
".",
"This",
"pointer",
"is",
"centered",
"in",
"the",
"gauge",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L2983-L2985 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java | RelatedTablesCoreExtension.addRelationship | public ExtendedRelation addRelationship(String baseTableName,
UserTable<? extends UserColumn> relatedTable, String relationName,
UserMappingTable userMappingTable) {
"""
Adds a relationship between the base and user related table. Creates the
user mapping table and related table if needed.
@param baseTab... | java | public ExtendedRelation addRelationship(String baseTableName,
UserTable<? extends UserColumn> relatedTable, String relationName,
UserMappingTable userMappingTable) {
// Create the related table if needed
createRelatedTable(relatedTable);
return addRelationship(baseTableName, relatedTable.getTableName(),
... | [
"public",
"ExtendedRelation",
"addRelationship",
"(",
"String",
"baseTableName",
",",
"UserTable",
"<",
"?",
"extends",
"UserColumn",
">",
"relatedTable",
",",
"String",
"relationName",
",",
"UserMappingTable",
"userMappingTable",
")",
"{",
"// Create the related table if... | Adds a relationship between the base and user related table. Creates the
user mapping table and related table if needed.
@param baseTableName
base table name
@param relatedTable
user related table
@param relationName
relation name
@param userMappingTable
user mapping table
@return The relationship that was added
@sinc... | [
"Adds",
"a",
"relationship",
"between",
"the",
"base",
"and",
"user",
"related",
"table",
".",
"Creates",
"the",
"user",
"mapping",
"table",
"and",
"related",
"table",
"if",
"needed",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L465-L474 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java | XmlUtil.getReqAttrVal | public static String getReqAttrVal(final Element el, final String name)
throws SAXException {
"""
Return the required value of the named attribute of the given element.
@param el Element
@param name String name of desired attribute
@return String attribute value
@throws SAXException... | java | public static String getReqAttrVal(final Element el, final String name)
throws SAXException {
String str = getAttrVal(el, name);
if ((str == null) || (str.length() == 0)) {
throw new SAXException("Missing attribute value: " + name);
}
return str;
} | [
"public",
"static",
"String",
"getReqAttrVal",
"(",
"final",
"Element",
"el",
",",
"final",
"String",
"name",
")",
"throws",
"SAXException",
"{",
"String",
"str",
"=",
"getAttrVal",
"(",
"el",
",",
"name",
")",
";",
"if",
"(",
"(",
"str",
"==",
"null",
... | Return the required value of the named attribute of the given element.
@param el Element
@param name String name of desired attribute
@return String attribute value
@throws SAXException | [
"Return",
"the",
"required",
"value",
"of",
"the",
"named",
"attribute",
"of",
"the",
"given",
"element",
"."
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlUtil.java#L235-L244 |
kmbulebu/dsc-it100-java | src/main/java/com/github/kmbulebu/dsc/it100/ConfigurationBuilder.java | ConfigurationBuilder.withRemoteSocket | public ConfigurationBuilder withRemoteSocket(String host, int port) {
"""
Use a TCP connection for remotely connecting to the IT-100.
Typically used with a utility such as ser2net for connecting to a remote serial port.
@param host Hostname or IP address of the remote device.
@param port TCP port of the remot... | java | public ConfigurationBuilder withRemoteSocket(String host, int port) {
configuration.connector = new NioSocketConnector();
configuration.address = new InetSocketAddress(host, port);
return this;
} | [
"public",
"ConfigurationBuilder",
"withRemoteSocket",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"configuration",
".",
"connector",
"=",
"new",
"NioSocketConnector",
"(",
")",
";",
"configuration",
".",
"address",
"=",
"new",
"InetSocketAddress",
"(",
... | Use a TCP connection for remotely connecting to the IT-100.
Typically used with a utility such as ser2net for connecting to a remote serial port.
@param host Hostname or IP address of the remote device.
@param port TCP port of the remote device.
@return This builder instance. | [
"Use",
"a",
"TCP",
"connection",
"for",
"remotely",
"connecting",
"to",
"the",
"IT",
"-",
"100",
"."
] | train | https://github.com/kmbulebu/dsc-it100-java/blob/69c170ba50c870cce6dbbe04b488c6b1c6a0e10f/src/main/java/com/github/kmbulebu/dsc/it100/ConfigurationBuilder.java#L38-L42 |
geomajas/geomajas-project-client-gwt2 | plugin/editing/impl/src/main/java/org/geomajas/gwt2/plugin/editing/client/gfx/GeometryRendererImpl.java | GeometryRendererImpl.onTentativeMove | public void onTentativeMove(GeometryEditTentativeMoveEvent event) {
"""
Renders a line from the last inserted point to the current mouse position, indicating what the new situation
would look like if a vertex where to be inserted at the mouse location.
"""
try {
Coordinate[] vertices = editService.getInd... | java | public void onTentativeMove(GeometryEditTentativeMoveEvent event) {
try {
Coordinate[] vertices = editService.getIndexService().getSiblingVertices(editService.getGeometry(),
editService.getInsertIndex());
String geometryType = editService.getIndexService().getGeometryType(editService.getGeometry(),
ed... | [
"public",
"void",
"onTentativeMove",
"(",
"GeometryEditTentativeMoveEvent",
"event",
")",
"{",
"try",
"{",
"Coordinate",
"[",
"]",
"vertices",
"=",
"editService",
".",
"getIndexService",
"(",
")",
".",
"getSiblingVertices",
"(",
"editService",
".",
"getGeometry",
... | Renders a line from the last inserted point to the current mouse position, indicating what the new situation
would look like if a vertex where to be inserted at the mouse location. | [
"Renders",
"a",
"line",
"from",
"the",
"last",
"inserted",
"point",
"to",
"the",
"current",
"mouse",
"position",
"indicating",
"what",
"the",
"new",
"situation",
"would",
"look",
"like",
"if",
"a",
"vertex",
"where",
"to",
"be",
"inserted",
"at",
"the",
"m... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/impl/src/main/java/org/geomajas/gwt2/plugin/editing/client/gfx/GeometryRendererImpl.java#L417-L441 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorPixel.java | ColorPixel.getGrey | public double getGrey(final double redWeight, final double greenWeight, final double blueWeight) {
"""
Calculates the grey value of this pixel using specified weights.
@param redWeight weight for red channel
@param greenWeight weight for green channel
@param blueWeight weight for blue channel
@return grey valu... | java | public double getGrey(final double redWeight, final double greenWeight, final double blueWeight){
return ColorPixel.getGrey(r_asDouble(),g_asDouble(),b_asDouble(), redWeight, greenWeight, blueWeight);
} | [
"public",
"double",
"getGrey",
"(",
"final",
"double",
"redWeight",
",",
"final",
"double",
"greenWeight",
",",
"final",
"double",
"blueWeight",
")",
"{",
"return",
"ColorPixel",
".",
"getGrey",
"(",
"r_asDouble",
"(",
")",
",",
"g_asDouble",
"(",
")",
",",
... | Calculates the grey value of this pixel using specified weights.
@param redWeight weight for red channel
@param greenWeight weight for green channel
@param blueWeight weight for blue channel
@return grey value of pixel for specified weights
@throws ArrayIndexOutOfBoundsException if this Pixel's index is not in
range of... | [
"Calculates",
"the",
"grey",
"value",
"of",
"this",
"pixel",
"using",
"specified",
"weights",
"."
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorPixel.java#L250-L252 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java | GrailsHibernateUtil.setObjectToReadyOnly | public static void setObjectToReadyOnly(Object target, SessionFactory sessionFactory) {
"""
Sets the target object to read-only using the given SessionFactory instance. This
avoids Hibernate performing any dirty checking on the object
@see #setObjectToReadWrite(Object, org.hibernate.SessionFactory)
@param t... | java | public static void setObjectToReadyOnly(Object target, SessionFactory sessionFactory) {
Object resource = TransactionSynchronizationManager.getResource(sessionFactory);
if(resource != null) {
Session session = sessionFactory.getCurrentSession();
if (canModifyReadWriteState(sessio... | [
"public",
"static",
"void",
"setObjectToReadyOnly",
"(",
"Object",
"target",
",",
"SessionFactory",
"sessionFactory",
")",
"{",
"Object",
"resource",
"=",
"TransactionSynchronizationManager",
".",
"getResource",
"(",
"sessionFactory",
")",
";",
"if",
"(",
"resource",
... | Sets the target object to read-only using the given SessionFactory instance. This
avoids Hibernate performing any dirty checking on the object
@see #setObjectToReadWrite(Object, org.hibernate.SessionFactory)
@param target The target object
@param sessionFactory The SessionFactory instance | [
"Sets",
"the",
"target",
"object",
"to",
"read",
"-",
"only",
"using",
"the",
"given",
"SessionFactory",
"instance",
".",
"This",
"avoids",
"Hibernate",
"performing",
"any",
"dirty",
"checking",
"on",
"the",
"object"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java#L293-L305 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.thenComparing | @NotNull
public <U> ComparatorCompat<T> thenComparing(
@NotNull Function<? super T, ? extends U> keyExtractor,
@NotNull Comparator<? super U> keyComparator) {
"""
Adds the comparator, that uses a function for extract
a sort key, to the chain.
@param <U> the type of the sort key
@pa... | java | @NotNull
public <U> ComparatorCompat<T> thenComparing(
@NotNull Function<? super T, ? extends U> keyExtractor,
@NotNull Comparator<? super U> keyComparator) {
return thenComparing(comparing(keyExtractor, keyComparator));
} | [
"@",
"NotNull",
"public",
"<",
"U",
">",
"ComparatorCompat",
"<",
"T",
">",
"thenComparing",
"(",
"@",
"NotNull",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"keyExtractor",
",",
"@",
"NotNull",
"Comparator",
"<",
"?",
"super",
"... | Adds the comparator, that uses a function for extract
a sort key, to the chain.
@param <U> the type of the sort key
@param keyExtractor the function that extracts the sort key
@param keyComparator the comparator used to compare the sort key
@return the new {@code ComparatorCompat} instance | [
"Adds",
"the",
"comparator",
"that",
"uses",
"a",
"function",
"for",
"extract",
"a",
"sort",
"key",
"to",
"the",
"chain",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L347-L352 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/util/Settings.java | Settings.loadPropFile | private void loadPropFile(String propFileName) throws IOException, Error {
"""
Loads the settings from the properties file
@param propFileName
the name of the file
@throws IOException - if an error occurred when reading from the input stream.
@throws Error - If setting file not found
"""
InputStream... | java | private void loadPropFile(String propFileName) throws IOException, Error {
InputStream inputStream = null;
try {
inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
if (inputStream != null) {
this.prop.load(inputStream);
LOGGER.debug("properties file " + propFileName + " load... | [
"private",
"void",
"loadPropFile",
"(",
"String",
"propFileName",
")",
"throws",
"IOException",
",",
"Error",
"{",
"InputStream",
"inputStream",
"=",
"null",
";",
"try",
"{",
"inputStream",
"=",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"ge... | Loads the settings from the properties file
@param propFileName
the name of the file
@throws IOException - if an error occurred when reading from the input stream.
@throws Error - If setting file not found | [
"Loads",
"the",
"settings",
"from",
"the",
"properties",
"file"
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/util/Settings.java#L147-L169 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.ofTree | @SuppressWarnings("unchecked")
public static <T, TT extends T> EntryStream<Integer, T> ofTree(T root, Class<TT> collectionClass,
BiFunction<Integer, TT, Stream<T>> mapper) {
"""
Return a new {@link EntryStream} containing all the nodes of tree-like
data structure in entry values along with the c... | java | @SuppressWarnings("unchecked")
public static <T, TT extends T> EntryStream<Integer, T> ofTree(T root, Class<TT> collectionClass,
BiFunction<Integer, TT, Stream<T>> mapper) {
return ofTree(root, (d, t) -> collectionClass.isInstance(t) ? mapper.apply(d, (TT) t) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
",",
"TT",
"extends",
"T",
">",
"EntryStream",
"<",
"Integer",
",",
"T",
">",
"ofTree",
"(",
"T",
"root",
",",
"Class",
"<",
"TT",
">",
"collectionClass",
",",
"BiFunction"... | Return a new {@link EntryStream} containing all the nodes of tree-like
data structure in entry values along with the corresponding tree depths
in entry keys, in depth-first order.
<p>
The keys of the returned stream are non-negative integer numbers. 0 is
used for the root node only, 1 is for root immediate children, 2... | [
"Return",
"a",
"new",
"{",
"@link",
"EntryStream",
"}",
"containing",
"all",
"the",
"nodes",
"of",
"tree",
"-",
"like",
"data",
"structure",
"in",
"entry",
"values",
"along",
"with",
"the",
"corresponding",
"tree",
"depths",
"in",
"entry",
"keys",
"in",
"d... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L2126-L2130 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.copy | private static void copy(ZipFile zipFile, ZipEntry zipEntry, File outItemFile) throws IOException {
"""
从Zip文件流中拷贝文件出来
@param zipFile Zip文件
@param zipEntry zip文件中的子文件
@param outItemFile 输出到的文件
@throws IOException IO异常
"""
InputStream in = null;
OutputStream out = null;
try {
in = zipFile.get... | java | private static void copy(ZipFile zipFile, ZipEntry zipEntry, File outItemFile) throws IOException {
InputStream in = null;
OutputStream out = null;
try {
in = zipFile.getInputStream(zipEntry);
out = FileUtil.getOutputStream(outItemFile);
IoUtil.copy(in, out);
} finally {
IoUtil.close(out);
... | [
"private",
"static",
"void",
"copy",
"(",
"ZipFile",
"zipFile",
",",
"ZipEntry",
"zipEntry",
",",
"File",
"outItemFile",
")",
"throws",
"IOException",
"{",
"InputStream",
"in",
"=",
"null",
";",
"OutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"in",
"=... | 从Zip文件流中拷贝文件出来
@param zipFile Zip文件
@param zipEntry zip文件中的子文件
@param outItemFile 输出到的文件
@throws IOException IO异常 | [
"从Zip文件流中拷贝文件出来"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L905-L916 |
otto-de/edison-microservice | edison-core/src/main/java/de/otto/edison/status/configuration/VersionInfoProperties.java | VersionInfoProperties.versionInfoProperties | public static VersionInfoProperties versionInfoProperties(final String version, final String commit, final String urlTemplate) {
"""
Used for testing purposes.
@param version vcs version
@param commit vcs commit number
@param urlTemplate template used to generate links to the vcs server
@return VersionInfoPr... | java | public static VersionInfoProperties versionInfoProperties(final String version, final String commit, final String urlTemplate) {
final VersionInfoProperties p = new VersionInfoProperties();
p.version = version;
p.commit = commit;
p.urlTemplate = urlTemplate;
return p;
} | [
"public",
"static",
"VersionInfoProperties",
"versionInfoProperties",
"(",
"final",
"String",
"version",
",",
"final",
"String",
"commit",
",",
"final",
"String",
"urlTemplate",
")",
"{",
"final",
"VersionInfoProperties",
"p",
"=",
"new",
"VersionInfoProperties",
"(",... | Used for testing purposes.
@param version vcs version
@param commit vcs commit number
@param urlTemplate template used to generate links to the vcs server
@return VersionInfoProperties | [
"Used",
"for",
"testing",
"purposes",
"."
] | train | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/status/configuration/VersionInfoProperties.java#L42-L48 |
landawn/AbacusUtil | src/com/landawn/abacus/util/HBaseColumn.java | HBaseColumn.asSortedMap | public static <T> SortedMap<Long, HBaseColumn<T>> asSortedMap(T value) {
"""
Returns a sorted map descended by version
@param value
@return
"""
return asSortedMap(value, DESC_HBASE_VERSION_COMPARATOR);
} | java | public static <T> SortedMap<Long, HBaseColumn<T>> asSortedMap(T value) {
return asSortedMap(value, DESC_HBASE_VERSION_COMPARATOR);
} | [
"public",
"static",
"<",
"T",
">",
"SortedMap",
"<",
"Long",
",",
"HBaseColumn",
"<",
"T",
">",
">",
"asSortedMap",
"(",
"T",
"value",
")",
"{",
"return",
"asSortedMap",
"(",
"value",
",",
"DESC_HBASE_VERSION_COMPARATOR",
")",
";",
"}"
] | Returns a sorted map descended by version
@param value
@return | [
"Returns",
"a",
"sorted",
"map",
"descended",
"by",
"version"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/HBaseColumn.java#L173-L175 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java | LibertyJaxRsInvoker.performInvocation | @Override
protected Object performInvocation(Exchange exchange, Object serviceObject, Method m, Object[] paramArray) throws Exception {
"""
using LibertyJaxRsServerFactoryBean.performInvocation to support POJO, EJB, CDI resource
"""
paramArray = insertExchange(m, paramArray, exchange);
retu... | java | @Override
protected Object performInvocation(Exchange exchange, Object serviceObject, Method m, Object[] paramArray) throws Exception {
paramArray = insertExchange(m, paramArray, exchange);
return this.libertyJaxRsServerFactoryBean.performInvocation(exchange, serviceObject, m, paramArray);
} | [
"@",
"Override",
"protected",
"Object",
"performInvocation",
"(",
"Exchange",
"exchange",
",",
"Object",
"serviceObject",
",",
"Method",
"m",
",",
"Object",
"[",
"]",
"paramArray",
")",
"throws",
"Exception",
"{",
"paramArray",
"=",
"insertExchange",
"(",
"m",
... | using LibertyJaxRsServerFactoryBean.performInvocation to support POJO, EJB, CDI resource | [
"using",
"LibertyJaxRsServerFactoryBean",
".",
"performInvocation",
"to",
"support",
"POJO",
"EJB",
"CDI",
"resource"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java#L157-L161 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendText | public static void sendText(final ByteBuffer message, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
"""
Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param callback The callback to invok... | java | public static void sendText(final ByteBuffer message, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback) {
sendInternal(message, WebSocketFrameType.TEXT, wsChannel, callback, null, -1);
} | [
"public",
"static",
"void",
"sendText",
"(",
"final",
"ByteBuffer",
"message",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"Void",
">",
"callback",
")",
"{",
"sendInternal",
"(",
"message",
",",
"WebSocketFrameType",
".",... | Sends a complete text message, invoking the callback when complete
@param message The text to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion | [
"Sends",
"a",
"complete",
"text",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L99-L101 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByZipCode | public Iterable<DUser> queryByZipCode(java.lang.String zipCode) {
"""
query-by method for field zipCode
@param zipCode the specified attribute
@return an Iterable of DUsers for the specified zipCode
"""
return queryByField(null, DUserMapper.Field.ZIPCODE.getFieldName(), zipCode);
} | java | public Iterable<DUser> queryByZipCode(java.lang.String zipCode) {
return queryByField(null, DUserMapper.Field.ZIPCODE.getFieldName(), zipCode);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByZipCode",
"(",
"java",
".",
"lang",
".",
"String",
"zipCode",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"ZIPCODE",
".",
"getFieldName",
"(",
")",
",",
"zipCode",... | query-by method for field zipCode
@param zipCode the specified attribute
@return an Iterable of DUsers for the specified zipCode | [
"query",
"-",
"by",
"method",
"for",
"field",
"zipCode"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L286-L288 |
apiman/apiman | common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java | PluginClassLoader.extractDependency | private ZipFile extractDependency(ZipEntry zipEntry) throws IOException {
"""
Extracts a dependency from the plugin artifact ZIP and saves it to the work
directory. If the dependency has already been extracted (we're re-using the
work directory) then this simply returns what is already there.
@param zipEntry a... | java | private ZipFile extractDependency(ZipEntry zipEntry) throws IOException {
File dependencyWorkDir = new File(workDir, "lib");
if (!dependencyWorkDir.exists()) {
dependencyWorkDir.mkdirs();
}
String depFileName = new File(zipEntry.getName()).getName();
File depFile = ne... | [
"private",
"ZipFile",
"extractDependency",
"(",
"ZipEntry",
"zipEntry",
")",
"throws",
"IOException",
"{",
"File",
"dependencyWorkDir",
"=",
"new",
"File",
"(",
"workDir",
",",
"\"lib\"",
")",
";",
"if",
"(",
"!",
"dependencyWorkDir",
".",
"exists",
"(",
")",
... | Extracts a dependency from the plugin artifact ZIP and saves it to the work
directory. If the dependency has already been extracted (we're re-using the
work directory) then this simply returns what is already there.
@param zipEntry a ZIP file entry
@throws IOException if an I/O error has occurred | [
"Extracts",
"a",
"dependency",
"from",
"the",
"plugin",
"artifact",
"ZIP",
"and",
"saves",
"it",
"to",
"the",
"work",
"directory",
".",
"If",
"the",
"dependency",
"has",
"already",
"been",
"extracted",
"(",
"we",
"re",
"re",
"-",
"using",
"the",
"work",
... | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/plugin/src/main/java/io/apiman/common/plugin/PluginClassLoader.java#L114-L141 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java | VecmathUtil.newUnitVector | static Vector2d newUnitVector(final Tuple2d from, final Tuple2d to) {
"""
Create a unit vector between two points.
@param from start of vector
@param to end of vector
@return unit vector
"""
final Vector2d vector = new Vector2d(to.x - from.x, to.y - from.y);
vector.normalize();
ret... | java | static Vector2d newUnitVector(final Tuple2d from, final Tuple2d to) {
final Vector2d vector = new Vector2d(to.x - from.x, to.y - from.y);
vector.normalize();
return vector;
} | [
"static",
"Vector2d",
"newUnitVector",
"(",
"final",
"Tuple2d",
"from",
",",
"final",
"Tuple2d",
"to",
")",
"{",
"final",
"Vector2d",
"vector",
"=",
"new",
"Vector2d",
"(",
"to",
".",
"x",
"-",
"from",
".",
"x",
",",
"to",
".",
"y",
"-",
"from",
".",... | Create a unit vector between two points.
@param from start of vector
@param to end of vector
@return unit vector | [
"Create",
"a",
"unit",
"vector",
"between",
"two",
"points",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L80-L84 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/VisualizationUtils.java | VisualizationUtils.getMSDLineChart | public static Chart getMSDLineChart(Trajectory t, int lagMin, int lagMax) {
"""
Plots the MSD curve for trajectory t.
@param t List of trajectories
@param lagMin Minimum timelag (e.g. 1,2,3..) lagMin*timelag = elapsed time in seconds
@param lagMax Maximum timelag (e.g. 1,2,3..) lagMax*timelag = elapsed time in... | java | public static Chart getMSDLineChart(Trajectory t, int lagMin, int lagMax) {
return getMSDLineChart(t, lagMin, lagMax, new MeanSquaredDisplacmentFeature(t,
lagMin));
} | [
"public",
"static",
"Chart",
"getMSDLineChart",
"(",
"Trajectory",
"t",
",",
"int",
"lagMin",
",",
"int",
"lagMax",
")",
"{",
"return",
"getMSDLineChart",
"(",
"t",
",",
"lagMin",
",",
"lagMax",
",",
"new",
"MeanSquaredDisplacmentFeature",
"(",
"t",
",",
"la... | Plots the MSD curve for trajectory t.
@param t List of trajectories
@param lagMin Minimum timelag (e.g. 1,2,3..) lagMin*timelag = elapsed time in seconds
@param lagMax Maximum timelag (e.g. 1,2,3..) lagMax*timelag = elapsed time in seconds | [
"Plots",
"the",
"MSD",
"curve",
"for",
"trajectory",
"t",
"."
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/VisualizationUtils.java#L312-L315 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java | ClientFactory.instantiateInstanceWithClientConfig | @SuppressWarnings("unchecked")
public static Object instantiateInstanceWithClientConfig(String className, IClientConfig clientConfig)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
"""
Creates instance related to client framework using reflection. It first checks if the obj... | java | @SuppressWarnings("unchecked")
public static Object instantiateInstanceWithClientConfig(String className, IClientConfig clientConfig)
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
Class clazz = Class.forName(className);
if (IClientConfigAware.class.isAssignableFrom(cl... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Object",
"instantiateInstanceWithClientConfig",
"(",
"String",
"className",
",",
"IClientConfig",
"clientConfig",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
",",
"ClassNotF... | Creates instance related to client framework using reflection. It first checks if the object is an instance of
{@link IClientConfigAware} and if so invoke {@link IClientConfigAware#initWithNiwsConfig(IClientConfig)}. If that does not
apply, it tries to find if there is a constructor with {@link IClientConfig} as a para... | [
"Creates",
"instance",
"related",
"to",
"client",
"framework",
"using",
"reflection",
".",
"It",
"first",
"checks",
"if",
"the",
"object",
"is",
"an",
"instance",
"of",
"{",
"@link",
"IClientConfigAware",
"}",
"and",
"if",
"so",
"invoke",
"{",
"@link",
"ICli... | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L217-L238 |
tvesalainen/util | util/src/main/java/org/vesalainen/navi/Navis.java | Navis.deltaLongitude | public static final double deltaLongitude(double latitude, double distance, double bearing) {
"""
Return longitude change after moving distance at bearing
@param latitude
@param distance
@param bearing
@return
"""
double departure = departure(latitude);
double sin = Math.sin(Math.toRadian... | java | public static final double deltaLongitude(double latitude, double distance, double bearing)
{
double departure = departure(latitude);
double sin = Math.sin(Math.toRadians(bearing));
return (sin*distance)/(60*departure);
} | [
"public",
"static",
"final",
"double",
"deltaLongitude",
"(",
"double",
"latitude",
",",
"double",
"distance",
",",
"double",
"bearing",
")",
"{",
"double",
"departure",
"=",
"departure",
"(",
"latitude",
")",
";",
"double",
"sin",
"=",
"Math",
".",
"sin",
... | Return longitude change after moving distance at bearing
@param latitude
@param distance
@param bearing
@return | [
"Return",
"longitude",
"change",
"after",
"moving",
"distance",
"at",
"bearing"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/Navis.java#L55-L60 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/EncodingInfo.java | EncodingInfo.inEncoding | private static boolean inEncoding(char high, char low, String encoding) {
"""
This is heart of the code that determines if a given high/low
surrogate pair forms a character that is in the given encoding.
This method is probably expensive, and the answer should be cached.
<p>
This method is not a public API,
a... | java | private static boolean inEncoding(char high, char low, String encoding) {
boolean isInEncoding;
try {
char cArray[] = new char[2];
cArray[0] = high;
cArray[1] = low;
// Construct a String from the char
String s = new String(cArray);
... | [
"private",
"static",
"boolean",
"inEncoding",
"(",
"char",
"high",
",",
"char",
"low",
",",
"String",
"encoding",
")",
"{",
"boolean",
"isInEncoding",
";",
"try",
"{",
"char",
"cArray",
"[",
"]",
"=",
"new",
"char",
"[",
"2",
"]",
";",
"cArray",
"[",
... | This is heart of the code that determines if a given high/low
surrogate pair forms a character that is in the given encoding.
This method is probably expensive, and the answer should be cached.
<p>
This method is not a public API,
and should only be used internally within the serializer.
@param high the high char of
a ... | [
"This",
"is",
"heart",
"of",
"the",
"code",
"that",
"determines",
"if",
"a",
"given",
"high",
"/",
"low",
"surrogate",
"pair",
"forms",
"a",
"character",
"that",
"is",
"in",
"the",
"given",
"encoding",
".",
"This",
"method",
"is",
"probably",
"expensive",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/EncodingInfo.java#L464-L481 |
apiman/apiman | common/net/src/main/java/io/apiman/common/net/hawkular/beans/MetricLongBean.java | MetricLongBean.addDataPoint | public DataPointLongBean addDataPoint(Date timestamp, long value) {
"""
Adds a single data point to the metric.
@param timestamp
@param value
"""
DataPointLongBean point = new DataPointLongBean(timestamp, value);
dataPoints.add(point);
return point;
} | java | public DataPointLongBean addDataPoint(Date timestamp, long value) {
DataPointLongBean point = new DataPointLongBean(timestamp, value);
dataPoints.add(point);
return point;
} | [
"public",
"DataPointLongBean",
"addDataPoint",
"(",
"Date",
"timestamp",
",",
"long",
"value",
")",
"{",
"DataPointLongBean",
"point",
"=",
"new",
"DataPointLongBean",
"(",
"timestamp",
",",
"value",
")",
";",
"dataPoints",
".",
"add",
"(",
"point",
")",
";",
... | Adds a single data point to the metric.
@param timestamp
@param value | [
"Adds",
"a",
"single",
"data",
"point",
"to",
"the",
"metric",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/net/src/main/java/io/apiman/common/net/hawkular/beans/MetricLongBean.java#L89-L93 |
Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/dacl/DACLAssertor.java | DACLAssertor.isAceExcluded | private boolean isAceExcluded(final List<AceFlag> aceFlags, final AceFlag excludedFlag) {
"""
Checks whether the AceFlags attribute of the ACE contains the given AceFlag of the AceAssertion. If the
{@code excludedFlag} is null, or the {@code aceFlags} are null (or empty), or are non-null and do DO NOT contain
th... | java | private boolean isAceExcluded(final List<AceFlag> aceFlags, final AceFlag excludedFlag) {
boolean res = false;
if (excludedFlag != null) {
// aceFlags could be null if the ACE applies to 'this object only' and has no other flags set
if (aceFlags != null && !aceFlags.isEmpty() && ... | [
"private",
"boolean",
"isAceExcluded",
"(",
"final",
"List",
"<",
"AceFlag",
">",
"aceFlags",
",",
"final",
"AceFlag",
"excludedFlag",
")",
"{",
"boolean",
"res",
"=",
"false",
";",
"if",
"(",
"excludedFlag",
"!=",
"null",
")",
"{",
"// aceFlags could be null ... | Checks whether the AceFlags attribute of the ACE contains the given AceFlag of the AceAssertion. If the
{@code excludedFlag} is null, or the {@code aceFlags} are null (or empty), or are non-null and do DO NOT contain
the excluded flag, a false result is returned. Otherwise, a true result is returned.
@param aceFlags
l... | [
"Checks",
"whether",
"the",
"AceFlags",
"attribute",
"of",
"the",
"ACE",
"contains",
"the",
"given",
"AceFlag",
"of",
"the",
"AceAssertion",
".",
"If",
"the",
"{",
"@code",
"excludedFlag",
"}",
"is",
"null",
"or",
"the",
"{",
"@code",
"aceFlags",
"}",
"are... | train | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/dacl/DACLAssertor.java#L481-L491 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java | RecaptchaEnterpriseServiceV1Beta1Client.createAssessment | public final Assessment createAssessment(String parent, Assessment assessment) {
"""
Creates an Assessment of the likelihood an event is legitimate.
<p>Sample code:
<pre><code>
try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.crea... | java | public final Assessment createAssessment(String parent, Assessment assessment) {
CreateAssessmentRequest request =
CreateAssessmentRequest.newBuilder().setParent(parent).setAssessment(assessment).build();
return createAssessment(request);
} | [
"public",
"final",
"Assessment",
"createAssessment",
"(",
"String",
"parent",
",",
"Assessment",
"assessment",
")",
"{",
"CreateAssessmentRequest",
"request",
"=",
"CreateAssessmentRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"... | Creates an Assessment of the likelihood an event is legitimate.
<p>Sample code:
<pre><code>
try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Assessment assessment = Assessment.ne... | [
"Creates",
"an",
"Assessment",
"of",
"the",
"likelihood",
"an",
"event",
"is",
"legitimate",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java#L208-L213 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.notNull | public static Validator<Object> notNull(@NonNull final Context context) {
"""
Creates and returns a validator, which allows to ensure, that values are not null.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be n... | java | public static Validator<Object> notNull(@NonNull final Context context) {
return new NotNullValidator(context, R.string.default_error_message);
} | [
"public",
"static",
"Validator",
"<",
"Object",
">",
"notNull",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"return",
"new",
"NotNullValidator",
"(",
"context",
",",
"R",
".",
"string",
".",
"default_error_message",
")",
";",
"}"
] | Creates and returns a validator, which allows to ensure, that values are not null.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@return The validator, which has been created, as an instance of the type {@link Va... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"ensure",
"that",
"values",
"are",
"not",
"null",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L286-L288 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/AuthorizationCodeAuthenticator.java | AuthorizationCodeAuthenticator.getTokensFromTokenEndpoint | void getTokensFromTokenEndpoint() throws SocialLoginException {
"""
Obtains access token (and possibly ID token) from the token endpoint.
"""
try {
tokens = getTokensUsingAuthzCode();
} catch (Exception e) {
throw createExceptionAndLogMessage(e, "AUTH_CODE_ERROR_GETTING_... | java | void getTokensFromTokenEndpoint() throws SocialLoginException {
try {
tokens = getTokensUsingAuthzCode();
} catch (Exception e) {
throw createExceptionAndLogMessage(e, "AUTH_CODE_ERROR_GETTING_TOKENS", new Object[] { socialConfig.getUniqueId(), e.getLocalizedMessage() });
... | [
"void",
"getTokensFromTokenEndpoint",
"(",
")",
"throws",
"SocialLoginException",
"{",
"try",
"{",
"tokens",
"=",
"getTokensUsingAuthzCode",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"createExceptionAndLogMessage",
"(",
"e",
",",
"\"... | Obtains access token (and possibly ID token) from the token endpoint. | [
"Obtains",
"access",
"token",
"(",
"and",
"possibly",
"ID",
"token",
")",
"from",
"the",
"token",
"endpoint",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/tai/AuthorizationCodeAuthenticator.java#L103-L109 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.classNameWithSuffix | public static ClassName classNameWithSuffix(String packageName, String className, String suffix) {
"""
Generate class typeName.
@param packageName
the package name
@param className
the class name
@param suffix
the suffix
@return class typeName generated
"""
return ClassName.get(packageName, classNam... | java | public static ClassName classNameWithSuffix(String packageName, String className, String suffix) {
return ClassName.get(packageName, className + suffix);
} | [
"public",
"static",
"ClassName",
"classNameWithSuffix",
"(",
"String",
"packageName",
",",
"String",
"className",
",",
"String",
"suffix",
")",
"{",
"return",
"ClassName",
".",
"get",
"(",
"packageName",
",",
"className",
"+",
"suffix",
")",
";",
"}"
] | Generate class typeName.
@param packageName
the package name
@param className
the class name
@param suffix
the suffix
@return class typeName generated | [
"Generate",
"class",
"typeName",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L194-L196 |
mozilla/rhino | src/org/mozilla/javascript/NativeContinuation.java | NativeContinuation.equalImplementations | public static boolean equalImplementations(NativeContinuation c1, NativeContinuation c2) {
"""
Returns true if both continuations have equal implementations.
@param c1 one continuation
@param c2 another continuation
@return true if the implementations of both continuations are equal, or they are both null.
@th... | java | public static boolean equalImplementations(NativeContinuation c1, NativeContinuation c2) {
return Objects.equals(c1.implementation, c2.implementation);
} | [
"public",
"static",
"boolean",
"equalImplementations",
"(",
"NativeContinuation",
"c1",
",",
"NativeContinuation",
"c2",
")",
"{",
"return",
"Objects",
".",
"equals",
"(",
"c1",
".",
"implementation",
",",
"c2",
".",
"implementation",
")",
";",
"}"
] | Returns true if both continuations have equal implementations.
@param c1 one continuation
@param c2 another continuation
@return true if the implementations of both continuations are equal, or they are both null.
@throws NullPointerException if either continuation is null | [
"Returns",
"true",
"if",
"both",
"continuations",
"have",
"equal",
"implementations",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeContinuation.java#L70-L72 |
forge/core | javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/impl/RootAndNestedDTOResourceGenerator.java | RootAndNestedDTOResourceGenerator.from | public DTOCollection from(Project project, JavaClass<?> entity, String dtoPackage) {
"""
Creates a collection of DTOs for the provided JPA entity, and any JPA entities referenced in the JPA entity.
@param entity The JPA entity for which DTOs are to be generated
@param dtoPackage The Java package in which the D... | java | public DTOCollection from(Project project, JavaClass<?> entity, String dtoPackage)
{
DTOCollection dtoCollection = new DTOCollection();
if (entity == null)
{
throw new IllegalArgumentException("The argument entity was null.");
}
generatedDTOGraphForEntity(project, entity, dtoPa... | [
"public",
"DTOCollection",
"from",
"(",
"Project",
"project",
",",
"JavaClass",
"<",
"?",
">",
"entity",
",",
"String",
"dtoPackage",
")",
"{",
"DTOCollection",
"dtoCollection",
"=",
"new",
"DTOCollection",
"(",
")",
";",
"if",
"(",
"entity",
"==",
"null",
... | Creates a collection of DTOs for the provided JPA entity, and any JPA entities referenced in the JPA entity.
@param entity The JPA entity for which DTOs are to be generated
@param dtoPackage The Java package in which the DTOs are to be created
@return The {@link DTOCollection} containing the DTOs created for the JPA e... | [
"Creates",
"a",
"collection",
"of",
"DTOs",
"for",
"the",
"provided",
"JPA",
"entity",
"and",
"any",
"JPA",
"entities",
"referenced",
"in",
"the",
"JPA",
"entity",
"."
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/javaee/impl/src/main/java/org/jboss/forge/addon/javaee/rest/generator/impl/RootAndNestedDTOResourceGenerator.java#L121-L130 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageCompression.java | FSImageCompression.readCompressionHeader | public static FSImageCompression readCompressionHeader(
Configuration conf,
DataInputStream dis) throws IOException {
"""
Create a compression instance based on a header read from an input stream.
@throws IOException if the specified codec is not available or the
underlying IO fails.
"""
boolean ... | java | public static FSImageCompression readCompressionHeader(
Configuration conf,
DataInputStream dis) throws IOException
{
boolean isCompressed = dis.readBoolean();
if (!isCompressed) {
return createNoopCompression();
} else {
String codecClassName = Text.readString(dis);
return crea... | [
"public",
"static",
"FSImageCompression",
"readCompressionHeader",
"(",
"Configuration",
"conf",
",",
"DataInputStream",
"dis",
")",
"throws",
"IOException",
"{",
"boolean",
"isCompressed",
"=",
"dis",
".",
"readBoolean",
"(",
")",
";",
"if",
"(",
"!",
"isCompress... | Create a compression instance based on a header read from an input stream.
@throws IOException if the specified codec is not available or the
underlying IO fails. | [
"Create",
"a",
"compression",
"instance",
"based",
"on",
"a",
"header",
"read",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSImageCompression.java#L110-L122 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.temporalLsqtQuery | public StructuredQueryDefinition temporalLsqtQuery(String temporalCollection, Calendar time,
double weight, String... options) {
"""
Matches documents with LSQT prior to timestamp
@param temporalCollection the temporal collection to query
@param time documents... | java | public StructuredQueryDefinition temporalLsqtQuery(String temporalCollection, Calendar time,
double weight, String... options)
{
if ( temporalCollection == null ) throw new IllegalArgumentException("temporalCollection cannot be null");
return new TemporalLs... | [
"public",
"StructuredQueryDefinition",
"temporalLsqtQuery",
"(",
"String",
"temporalCollection",
",",
"Calendar",
"time",
",",
"double",
"weight",
",",
"String",
"...",
"options",
")",
"{",
"if",
"(",
"temporalCollection",
"==",
"null",
")",
"throw",
"new",
"Illeg... | Matches documents with LSQT prior to timestamp
@param temporalCollection the temporal collection to query
@param time documents with lsqt equal to or prior to this timestamp will match
@param weight the weight for this query
@param options string options from the list for
<a href="http://docs.marklogic.com/cts:lsqt-que... | [
"Matches",
"documents",
"with",
"LSQT",
"prior",
"to",
"timestamp"
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L2846-L2851 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedLeaderService.java | EmbeddedLeaderService.confirmLeader | private void confirmLeader(final EmbeddedLeaderElectionService service, final UUID leaderSessionId) {
"""
Callback from leader contenders when they confirm a leader grant.
"""
synchronized (lock) {
// if the service was shut down in the meantime, ignore this confirmation
if (!service.running || shutdow... | java | private void confirmLeader(final EmbeddedLeaderElectionService service, final UUID leaderSessionId) {
synchronized (lock) {
// if the service was shut down in the meantime, ignore this confirmation
if (!service.running || shutdown) {
return;
}
try {
// check if the confirmation is for the same gr... | [
"private",
"void",
"confirmLeader",
"(",
"final",
"EmbeddedLeaderElectionService",
"service",
",",
"final",
"UUID",
"leaderSessionId",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// if the service was shut down in the meantime, ignore this confirmation",
"if",
"(",
"!... | Callback from leader contenders when they confirm a leader grant. | [
"Callback",
"from",
"leader",
"contenders",
"when",
"they",
"confirm",
"a",
"leader",
"grant",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/highavailability/nonha/embedded/EmbeddedLeaderService.java#L239-L268 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeFromStream | public static File writeFromStream(InputStream in, String fullFilePath) throws IORuntimeException {
"""
将流的内容写入文件<br>
@param in 输入流
@param fullFilePath 文件绝对路径
@return 目标文件
@throws IORuntimeException IO异常
"""
return writeFromStream(in, touch(fullFilePath));
} | java | public static File writeFromStream(InputStream in, String fullFilePath) throws IORuntimeException {
return writeFromStream(in, touch(fullFilePath));
} | [
"public",
"static",
"File",
"writeFromStream",
"(",
"InputStream",
"in",
",",
"String",
"fullFilePath",
")",
"throws",
"IORuntimeException",
"{",
"return",
"writeFromStream",
"(",
"in",
",",
"touch",
"(",
"fullFilePath",
")",
")",
";",
"}"
] | 将流的内容写入文件<br>
@param in 输入流
@param fullFilePath 文件绝对路径
@return 目标文件
@throws IORuntimeException IO异常 | [
"将流的内容写入文件<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3165-L3167 |
NessComputing/components-ness-lifecycle | src/main/java/com/nesscomputing/lifecycle/AbstractLifecycle.java | AbstractLifecycle.addListener | @Override
public void addListener(@Nonnull final LifecycleStage lifecycleStage, @Nonnull final LifecycleListener lifecycleListener) {
"""
Adds a listener to a lifecycle stage.
@param lifecycleStage The Lifecycle stage on which to be notified.
@param lifecycleListener Callback to be invoked when the life... | java | @Override
public void addListener(@Nonnull final LifecycleStage lifecycleStage, @Nonnull final LifecycleListener lifecycleListener)
{
if (!listeners.containsKey(lifecycleStage)) {
throw illegalStage(lifecycleStage);
}
listeners.get(lifecycleStage).add(lifecycleListener);
... | [
"@",
"Override",
"public",
"void",
"addListener",
"(",
"@",
"Nonnull",
"final",
"LifecycleStage",
"lifecycleStage",
",",
"@",
"Nonnull",
"final",
"LifecycleListener",
"lifecycleListener",
")",
"{",
"if",
"(",
"!",
"listeners",
".",
"containsKey",
"(",
"lifecycleSt... | Adds a listener to a lifecycle stage.
@param lifecycleStage The Lifecycle stage on which to be notified.
@param lifecycleListener Callback to be invoked when the lifecycle stage is executed. | [
"Adds",
"a",
"listener",
"to",
"a",
"lifecycle",
"stage",
"."
] | train | https://github.com/NessComputing/components-ness-lifecycle/blob/6c8ae8ec8fdcd16b30383092ce9e70424a6760f1/src/main/java/com/nesscomputing/lifecycle/AbstractLifecycle.java#L66-L73 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectLineSegmentAar | public static int intersectLineSegmentAar(Vector2fc p0, Vector2fc p1, Vector2fc min, Vector2fc max, Vector2f result) {
"""
Determine whether the undirected line segment with the end points <code>p0</code> and <code>p1</code>
intersects the axis-aligned rectangle given as its minimum corner <code>min</code> and ma... | java | public static int intersectLineSegmentAar(Vector2fc p0, Vector2fc p1, Vector2fc min, Vector2fc max, Vector2f result) {
return intersectLineSegmentAar(p0.x(), p0.y(), p1.x(), p1.y(), min.x(), min.y(), max.x(), max.y(), result);
} | [
"public",
"static",
"int",
"intersectLineSegmentAar",
"(",
"Vector2fc",
"p0",
",",
"Vector2fc",
"p1",
",",
"Vector2fc",
"min",
",",
"Vector2fc",
"max",
",",
"Vector2f",
"result",
")",
"{",
"return",
"intersectLineSegmentAar",
"(",
"p0",
".",
"x",
"(",
")",
"... | Determine whether the undirected line segment with the end points <code>p0</code> and <code>p1</code>
intersects the axis-aligned rectangle given as its minimum corner <code>min</code> and maximum corner <code>max</code>,
and store the values of the parameter <i>t</i> in the ray equation <i>p(t) = p0 + t * (p1 - p0)</i... | [
"Determine",
"whether",
"the",
"undirected",
"line",
"segment",
"with",
"the",
"end",
"points",
"<code",
">",
"p0<",
"/",
"code",
">",
"and",
"<code",
">",
"p1<",
"/",
"code",
">",
"intersects",
"the",
"axis",
"-",
"aligned",
"rectangle",
"given",
"as",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L4551-L4553 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/SiRNANotation.java | SiRNANotation.getSiRNANotation | public static HELM2Notation getSiRNANotation(String senseSeq, String antiSenseSeq)
throws NotationException, FastaFormatException, HELM2HandledException, RNAUtilsException,
org.helm.notation2.exception.NotationException, ChemistryException, CTKException,
NucleotideLoadingException {
"""
this method con... | java | public static HELM2Notation getSiRNANotation(String senseSeq, String antiSenseSeq)
throws NotationException, FastaFormatException, HELM2HandledException, RNAUtilsException,
org.helm.notation2.exception.NotationException, ChemistryException, CTKException,
NucleotideLoadingException {
return getSirnaNotati... | [
"public",
"static",
"HELM2Notation",
"getSiRNANotation",
"(",
"String",
"senseSeq",
",",
"String",
"antiSenseSeq",
")",
"throws",
"NotationException",
",",
"FastaFormatException",
",",
"HELM2HandledException",
",",
"RNAUtilsException",
",",
"org",
".",
"helm",
".",
"n... | this method converts nucleotide sequences into HELM2Notation
@param senseSeq
5-3 nucleotide sequence for default notation
@param antiSenseSeq
3-5 nucleotide sequence for default notation
@return HELM2Notation for siRNA
@throws NotationException
if notation is not valid
@throws FastaFormatException if the fasta input i... | [
"this",
"method",
"converts",
"nucleotide",
"sequences",
"into",
"HELM2Notation"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/SiRNANotation.java#L88-L93 |
alkacon/opencms-core | src/org/opencms/db/CmsAliasManager.java | CmsAliasManager.saveRewriteAliases | public void saveRewriteAliases(CmsObject cms, String siteRoot, List<CmsRewriteAlias> newAliases)
throws CmsException {
"""
Saves the rewrite alias for a given site root.<p>
@param cms the current CMS context
@param siteRoot the site root for which the rewrite aliases should be saved
@param newAliases the... | java | public void saveRewriteAliases(CmsObject cms, String siteRoot, List<CmsRewriteAlias> newAliases)
throws CmsException {
checkPermissionsForMassEdit(cms, siteRoot);
m_securityManager.saveRewriteAliases(cms.getRequestContext(), siteRoot, newAliases);
} | [
"public",
"void",
"saveRewriteAliases",
"(",
"CmsObject",
"cms",
",",
"String",
"siteRoot",
",",
"List",
"<",
"CmsRewriteAlias",
">",
"newAliases",
")",
"throws",
"CmsException",
"{",
"checkPermissionsForMassEdit",
"(",
"cms",
",",
"siteRoot",
")",
";",
"m_securit... | Saves the rewrite alias for a given site root.<p>
@param cms the current CMS context
@param siteRoot the site root for which the rewrite aliases should be saved
@param newAliases the list of aliases to save
@throws CmsException if something goes wrong | [
"Saves",
"the",
"rewrite",
"alias",
"for",
"a",
"given",
"site",
"root",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsAliasManager.java#L256-L261 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/PendingIntentUtils.java | PendingIntentUtils.getBroadcast | public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) {
"""
Create a new {@link PendingIntent} clearing previously created {@link PendingIntent} that does not work properly due to application's re-installation.
Bugfix utility for this issue: https://code.google.com/p... | java | public static PendingIntent getBroadcast(Context context, int requestCode, Intent intent, int flags) {
PendingIntent.getBroadcast(context, requestCode, intent, flags).cancel();
return PendingIntent.getBroadcast(context, requestCode, intent, flags);
} | [
"public",
"static",
"PendingIntent",
"getBroadcast",
"(",
"Context",
"context",
",",
"int",
"requestCode",
",",
"Intent",
"intent",
",",
"int",
"flags",
")",
"{",
"PendingIntent",
".",
"getBroadcast",
"(",
"context",
",",
"requestCode",
",",
"intent",
",",
"fl... | Create a new {@link PendingIntent} clearing previously created {@link PendingIntent} that does not work properly due to application's re-installation.
Bugfix utility for this issue: https://code.google.com/p/android/issues/detail?id=61850 | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/PendingIntentUtils.java#L41-L44 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/composition/AbstractCompositeServiceBuilder.java | AbstractCompositeServiceBuilder.serviceUnder | protected T serviceUnder(String pathPrefix, Service<I, O> service) {
"""
Binds the specified {@link Service} under the specified directory..
"""
return service(CompositeServiceEntry.ofPrefix(pathPrefix, service));
} | java | protected T serviceUnder(String pathPrefix, Service<I, O> service) {
return service(CompositeServiceEntry.ofPrefix(pathPrefix, service));
} | [
"protected",
"T",
"serviceUnder",
"(",
"String",
"pathPrefix",
",",
"Service",
"<",
"I",
",",
"O",
">",
"service",
")",
"{",
"return",
"service",
"(",
"CompositeServiceEntry",
".",
"ofPrefix",
"(",
"pathPrefix",
",",
"service",
")",
")",
";",
"}"
] | Binds the specified {@link Service} under the specified directory.. | [
"Binds",
"the",
"specified",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/composition/AbstractCompositeServiceBuilder.java#L115-L117 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java | MapConverter.getString | public String getString(Map<String, Object> data, String attr) {
"""
get parameter named attr
@param attr a {@link java.lang.String} object.
@return single value or multivalue joined with comma
@param data a {@link java.util.Map} object.
"""
Object value = data.get(attr);
if (null == value) { retu... | java | public String getString(Map<String, Object> data, String attr) {
Object value = data.get(attr);
if (null == value) { return null; }
if (!value.getClass().isArray()) { return value.toString(); }
String[] values = (String[]) value;
if (values.length == 1) {
return values[0];
} else {
r... | [
"public",
"String",
"getString",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"String",
"attr",
")",
"{",
"Object",
"value",
"=",
"data",
".",
"get",
"(",
"attr",
")",
";",
"if",
"(",
"null",
"==",
"value",
")",
"{",
"return",
"null"... | get parameter named attr
@param attr a {@link java.lang.String} object.
@return single value or multivalue joined with comma
@param data a {@link java.util.Map} object. | [
"get",
"parameter",
"named",
"attr"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/collection/MapConverter.java#L96-L106 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java | DefaultSwidProcessor.setSoftwareCreator | public DefaultSwidProcessor setSoftwareCreator(final String softwareCreatorName, final String softwareCreatorRegId) {
"""
Identifies the creator of the software (tag: software_creator).
@param softwareCreatorName
software creator name
@param softwareCreatorRegId
software creator registration ID
@return a re... | java | public DefaultSwidProcessor setSoftwareCreator(final String softwareCreatorName, final String softwareCreatorRegId) {
swidTag.setSoftwareCreator(
new EntityComplexType(
new Token(softwareCreatorName, idGenerator.nextId()),
new RegistrationId(softwa... | [
"public",
"DefaultSwidProcessor",
"setSoftwareCreator",
"(",
"final",
"String",
"softwareCreatorName",
",",
"final",
"String",
"softwareCreatorRegId",
")",
"{",
"swidTag",
".",
"setSoftwareCreator",
"(",
"new",
"EntityComplexType",
"(",
"new",
"Token",
"(",
"softwareCre... | Identifies the creator of the software (tag: software_creator).
@param softwareCreatorName
software creator name
@param softwareCreatorRegId
software creator registration ID
@return a reference to this object. | [
"Identifies",
"the",
"creator",
"of",
"the",
"software",
"(",
"tag",
":",
"software_creator",
")",
"."
] | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java#L137-L144 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/net/IpHelper.java | IpHelper.getLocalIp | public static String getLocalIp() throws RuntimeException {
"""
Gets the local IP address
@return String the local ip address's HostAddress
@throws RuntimeException
On error (eg. when the local host cannot be determined)
"""
try
{
InetAddress addr = getLocalIpAddress();
return addr.getHostAdd... | java | public static String getLocalIp() throws RuntimeException
{
try
{
InetAddress addr = getLocalIpAddress();
return addr.getHostAddress();
}
catch (RuntimeException e)
{
throw new RuntimeException("[FileHelper] {getLocalIp}: Unable to find the local machine", e);
}
} | [
"public",
"static",
"String",
"getLocalIp",
"(",
")",
"throws",
"RuntimeException",
"{",
"try",
"{",
"InetAddress",
"addr",
"=",
"getLocalIpAddress",
"(",
")",
";",
"return",
"addr",
".",
"getHostAddress",
"(",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
... | Gets the local IP address
@return String the local ip address's HostAddress
@throws RuntimeException
On error (eg. when the local host cannot be determined) | [
"Gets",
"the",
"local",
"IP",
"address"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/net/IpHelper.java#L89-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.setReadOnly | public void setReadOnly(WSRdbManagedConnectionImpl managedConn, boolean readOnly, boolean externalCall)
throws SQLException {
"""
<p>This method is used to do special handling for readOnly when method setReadOnly is called.</p>
@param managedConn WSRdbManagedConnectionImpl object
@param rea... | java | public void setReadOnly(WSRdbManagedConnectionImpl managedConn, boolean readOnly, boolean externalCall)
throws SQLException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "setReadOnly", managedConn, readOnly, externalCall);
managedCo... | [
"public",
"void",
"setReadOnly",
"(",
"WSRdbManagedConnectionImpl",
"managedConn",
",",
"boolean",
"readOnly",
",",
"boolean",
"externalCall",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"... | <p>This method is used to do special handling for readOnly when method setReadOnly is called.</p>
@param managedConn WSRdbManagedConnectionImpl object
@param readOnly The readOnly value going to be set
@param externalCall indicates if the call is done by WAS, or by the user application. | [
"<p",
">",
"This",
"method",
"is",
"used",
"to",
"do",
"special",
"handling",
"for",
"readOnly",
"when",
"method",
"setReadOnly",
"is",
"called",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L534-L539 |
santhosh-tekuri/jlibs | core/src/main/java/jlibs/core/io/FileUtil.java | FileUtil.findFreeFile | public static File findFreeFile(final File dir, String pattern, boolean tryEmptyVar) {
"""
Finds a free file (i.e non-existing) in specified directory, using specified pattern.
for example:
findFreeFile(myDir, "sample${i}.xml", false)
will search for free file in order:
sample1.xml, sample2.xml, sample3.xml ... | java | public static File findFreeFile(final File dir, String pattern, boolean tryEmptyVar){
String name = StringUtil.suggest(new Filter<String>(){
@Override
public boolean select(String name){
return !new File(dir, name).exists();
}
}, pattern, tryEmptyVar);... | [
"public",
"static",
"File",
"findFreeFile",
"(",
"final",
"File",
"dir",
",",
"String",
"pattern",
",",
"boolean",
"tryEmptyVar",
")",
"{",
"String",
"name",
"=",
"StringUtil",
".",
"suggest",
"(",
"new",
"Filter",
"<",
"String",
">",
"(",
")",
"{",
"@",... | Finds a free file (i.e non-existing) in specified directory, using specified pattern.
for example:
findFreeFile(myDir, "sample${i}.xml", false)
will search for free file in order:
sample1.xml, sample2.xml, sample3.xml and so on
if tryEmptyVar is true, it it seaches for free file in order:
sample.xml, sample2.xml, sam... | [
"Finds",
"a",
"free",
"file",
"(",
"i",
".",
"e",
"non",
"-",
"existing",
")",
"in",
"specified",
"directory",
"using",
"specified",
"pattern",
".",
"for",
"example",
":",
"findFreeFile",
"(",
"myDir",
"sample$",
"{",
"i",
"}",
".",
"xml",
"false",
")"... | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/core/src/main/java/jlibs/core/io/FileUtil.java#L93-L102 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java | Logger.printDetail | public static void printDetail(Class<?> c, String msg) {
"""
print DEBUG level information with package name
@param component Component from which the message originates
@param msg DEBUG-level message
"""
if(Logger.printDetails) {
String preamble;
if(c != null)
preamble = "["+c.getSimpleName()+"]... | java | public static void printDetail(Class<?> c, String msg) {
if(Logger.printDetails) {
String preamble;
if(c != null)
preamble = "["+c.getSimpleName()+"]";
else
preamble = "";
synchronized(System.err) {
System.err.println(preamble+" "+msg);
}
}
} | [
"public",
"static",
"void",
"printDetail",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"Logger",
".",
"printDetails",
")",
"{",
"String",
"preamble",
";",
"if",
"(",
"c",
"!=",
"null",
")",
"preamble",
"=",
"\"[\"",
... | print DEBUG level information with package name
@param component Component from which the message originates
@param msg DEBUG-level message | [
"print",
"DEBUG",
"level",
"information",
"with",
"package",
"name"
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/utilities/Logger.java#L27-L39 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_interface_interfaceId_GET | public OvhInterface project_serviceName_instance_instanceId_interface_interfaceId_GET(String serviceName, String instanceId, String interfaceId) throws IOException {
"""
Get interface
REST: GET /cloud/project/{serviceName}/instance/{instanceId}/interface/{interfaceId}
@param instanceId [required] Instance id
... | java | public OvhInterface project_serviceName_instance_instanceId_interface_interfaceId_GET(String serviceName, String instanceId, String interfaceId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/interface/{interfaceId}";
StringBuilder sb = path(qPath, serviceName, instanceId, i... | [
"public",
"OvhInterface",
"project_serviceName_instance_instanceId_interface_interfaceId_GET",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
",",
"String",
"interfaceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/ins... | Get interface
REST: GET /cloud/project/{serviceName}/instance/{instanceId}/interface/{interfaceId}
@param instanceId [required] Instance id
@param interfaceId [required] Interface id
@param serviceName [required] Service name | [
"Get",
"interface"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1973-L1978 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java | RingPlacer.getPerpendicular | private static Vector2d getPerpendicular(Tuple2d a, Tuple2d b, Vector2d ref) {
"""
Gat a vector perpendicular to the line, a-b, that is pointing
the same direction as 'ref'.
@param a first coordinate
@param b second coordinate
@param ref reference vector
@return perpendicular vector
"""
final Ve... | java | private static Vector2d getPerpendicular(Tuple2d a, Tuple2d b, Vector2d ref) {
final Vector2d pVec = new Vector2d(-(a.y-b.y), a.x-b.x);
if (pVec.dot(ref) < 0)
pVec.negate();
return pVec;
} | [
"private",
"static",
"Vector2d",
"getPerpendicular",
"(",
"Tuple2d",
"a",
",",
"Tuple2d",
"b",
",",
"Vector2d",
"ref",
")",
"{",
"final",
"Vector2d",
"pVec",
"=",
"new",
"Vector2d",
"(",
"-",
"(",
"a",
".",
"y",
"-",
"b",
".",
"y",
")",
",",
"a",
"... | Gat a vector perpendicular to the line, a-b, that is pointing
the same direction as 'ref'.
@param a first coordinate
@param b second coordinate
@param ref reference vector
@return perpendicular vector | [
"Gat",
"a",
"vector",
"perpendicular",
"to",
"the",
"line",
"a",
"-",
"b",
"that",
"is",
"pointing",
"the",
"same",
"direction",
"as",
"ref",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/RingPlacer.java#L589-L594 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.updateTagsAsync | public Observable<VirtualHubInner> updateTagsAsync(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
"""
Updates VirtualHub tags.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param tags Resource tags.
@throws... | java | public Observable<VirtualHubInner> updateTagsAsync(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1<ServiceResponse<VirtualHubInner>, VirtualHubInner>() {
@Override
... | [
"public",
"Observable",
"<",
"VirtualHubInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resour... | Updates VirtualHub tags.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"VirtualHub",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L475-L482 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/ssh/PseudoTerminalModes.java | PseudoTerminalModes.setTerminalMode | public void setTerminalMode(int mode, int value) throws SshException {
"""
Set an integer value mode
@param mode
int
@param value
int
@throws SshException
"""
try {
encodedModes.write(mode);
if (version == 1 && mode <= 127) {
encodedModes.write(value);
} else {
encodedModes.writeInt... | java | public void setTerminalMode(int mode, int value) throws SshException {
try {
encodedModes.write(mode);
if (version == 1 && mode <= 127) {
encodedModes.write(value);
} else {
encodedModes.writeInt(value);
}
} catch (IOException ex) {
throw new SshException(SshException.INTERNAL_ERROR, ex);
... | [
"public",
"void",
"setTerminalMode",
"(",
"int",
"mode",
",",
"int",
"value",
")",
"throws",
"SshException",
"{",
"try",
"{",
"encodedModes",
".",
"write",
"(",
"mode",
")",
";",
"if",
"(",
"version",
"==",
"1",
"&&",
"mode",
"<=",
"127",
")",
"{",
"... | Set an integer value mode
@param mode
int
@param value
int
@throws SshException | [
"Set",
"an",
"integer",
"value",
"mode"
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh/PseudoTerminalModes.java#L372-L386 |
jenkinsci/jenkins | core/src/main/java/hudson/util/RunList.java | RunList.byTimestamp | public RunList<R> byTimestamp(final long start, final long end) {
"""
Filter the list by timestamp.
{@code s<=;e}.
<em>Warning:</em> this method mutates the original list and then returns it.
"""
return
limit(new CountingPredicate<R>() {
public boolean apply(int index, R r) {
... | java | public RunList<R> byTimestamp(final long start, final long end) {
return
limit(new CountingPredicate<R>() {
public boolean apply(int index, R r) {
return start<=r.getTimeInMillis();
}
}).filter(new Predicate<R>() {
public boolean apply(R r) {
... | [
"public",
"RunList",
"<",
"R",
">",
"byTimestamp",
"(",
"final",
"long",
"start",
",",
"final",
"long",
"end",
")",
"{",
"return",
"limit",
"(",
"new",
"CountingPredicate",
"<",
"R",
">",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"int",
"index"... | Filter the list by timestamp.
{@code s<=;e}.
<em>Warning:</em> this method mutates the original list and then returns it. | [
"Filter",
"the",
"list",
"by",
"timestamp",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/RunList.java#L322-L333 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/ImageViewWidget.java | ImageViewWidget.setImage | public void setImage(Resource resource) {
"""
Sets the image content of the widget based on a resource
@param resource
points to a image resource
"""
ImageIcon image = null;
if (resource != null && resource.exists())
{
try
{
image = new ImageI... | java | public void setImage(Resource resource)
{
ImageIcon image = null;
if (resource != null && resource.exists())
{
try
{
image = new ImageIcon(resource.getURL());
}
catch (IOException e)
{
logger.warn("Er... | [
"public",
"void",
"setImage",
"(",
"Resource",
"resource",
")",
"{",
"ImageIcon",
"image",
"=",
"null",
";",
"if",
"(",
"resource",
"!=",
"null",
"&&",
"resource",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{",
"image",
"=",
"new",
"ImageIcon",
"(",
... | Sets the image content of the widget based on a resource
@param resource
points to a image resource | [
"Sets",
"the",
"image",
"content",
"of",
"the",
"widget",
"based",
"on",
"a",
"resource"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/widget/ImageViewWidget.java#L66-L82 |
czyzby/gdx-lml | websocket/natives/gwt/src/main/java/com/github/czyzby/websocket/impl/GwtWebSocket.java | GwtWebSocket.onClose | protected void onClose(final int closeCode, final String reason) {
"""
Invoked by native listener.
@param closeCode see {@link WebSocketCloseCode}.
@param reason optional closing reason.
"""
postCloseEvent(WebSocketCloseCode.getByCodeOrElse(closeCode, WebSocketCloseCode.ABNORMAL), reason);
} | java | protected void onClose(final int closeCode, final String reason) {
postCloseEvent(WebSocketCloseCode.getByCodeOrElse(closeCode, WebSocketCloseCode.ABNORMAL), reason);
} | [
"protected",
"void",
"onClose",
"(",
"final",
"int",
"closeCode",
",",
"final",
"String",
"reason",
")",
"{",
"postCloseEvent",
"(",
"WebSocketCloseCode",
".",
"getByCodeOrElse",
"(",
"closeCode",
",",
"WebSocketCloseCode",
".",
"ABNORMAL",
")",
",",
"reason",
"... | Invoked by native listener.
@param closeCode see {@link WebSocketCloseCode}.
@param reason optional closing reason. | [
"Invoked",
"by",
"native",
"listener",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/websocket/natives/gwt/src/main/java/com/github/czyzby/websocket/impl/GwtWebSocket.java#L79-L81 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/BatchStatusValidator.java | BatchStatusValidator.validateStatusAtExecutionRestart | public static void validateStatusAtExecutionRestart(long previousExecutionId,
Properties restartJobParameters) throws JobRestartException, JobExecutionNotMostRecentException, JobExecutionAlreadyCompleteException {
"""
/*
validates job is restart-able, jobExe... | java | public static void validateStatusAtExecutionRestart(long previousExecutionId,
Properties restartJobParameters) throws JobRestartException, JobExecutionNotMostRecentException, JobExecutionAlreadyCompleteException {
Helper helper = new Helper(previousExecuti... | [
"public",
"static",
"void",
"validateStatusAtExecutionRestart",
"(",
"long",
"previousExecutionId",
",",
"Properties",
"restartJobParameters",
")",
"throws",
"JobRestartException",
",",
"JobExecutionNotMostRecentException",
",",
"JobExecutionAlreadyCompleteException",
"{",
"Helpe... | /*
validates job is restart-able, jobExecution is most recent,
validates the jobExecutions and stepExecutions in non-final states | [
"/",
"*",
"validates",
"job",
"is",
"restart",
"-",
"able",
"jobExecution",
"is",
"most",
"recent",
"validates",
"the",
"jobExecutions",
"and",
"stepExecutions",
"in",
"non",
"-",
"final",
"states"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/BatchStatusValidator.java#L64-L74 |
google/closure-compiler | src/com/google/javascript/jscomp/ExpressionDecomposer.java | ExpressionDecomposer.rewriteCallExpression | private Node rewriteCallExpression(Node call, DecompositionState state) {
"""
Rewrite the call so "this" is preserved.
<pre>a.b(c);</pre>
becomes:
<pre>
var temp1 = a; var temp0 = temp1.b;
temp0.call(temp1,c);
</pre>
@return The replacement node.
"""
checkArgument(call.isCall(), call);
N... | java | private Node rewriteCallExpression(Node call, DecompositionState state) {
checkArgument(call.isCall(), call);
Node first = call.getFirstChild();
checkArgument(NodeUtil.isGet(first), first);
// Find the type of (fn expression).call
JSType fnType = first.getJSType();
JSType fnCallType = null;
... | [
"private",
"Node",
"rewriteCallExpression",
"(",
"Node",
"call",
",",
"DecompositionState",
"state",
")",
"{",
"checkArgument",
"(",
"call",
".",
"isCall",
"(",
")",
",",
"call",
")",
";",
"Node",
"first",
"=",
"call",
".",
"getFirstChild",
"(",
")",
";",
... | Rewrite the call so "this" is preserved.
<pre>a.b(c);</pre>
becomes:
<pre>
var temp1 = a; var temp0 = temp1.b;
temp0.call(temp1,c);
</pre>
@return The replacement node. | [
"Rewrite",
"the",
"call",
"so",
"this",
"is",
"preserved",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ExpressionDecomposer.java#L606-L666 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.kindIs | public static <T extends Tree> Matcher<T> kindIs(final Kind kind) {
"""
Matches an AST node of a given kind, for example, an Annotation or a switch block.
"""
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
return tree.getKind() == kind;
}
... | java | public static <T extends Tree> Matcher<T> kindIs(final Kind kind) {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
return tree.getKind() == kind;
}
};
} | [
"public",
"static",
"<",
"T",
"extends",
"Tree",
">",
"Matcher",
"<",
"T",
">",
"kindIs",
"(",
"final",
"Kind",
"kind",
")",
"{",
"return",
"new",
"Matcher",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"T",
"... | Matches an AST node of a given kind, for example, an Annotation or a switch block. | [
"Matches",
"an",
"AST",
"node",
"of",
"a",
"given",
"kind",
"for",
"example",
"an",
"Annotation",
"or",
"a",
"switch",
"block",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L181-L188 |
Grasia/phatsim | phat-core/src/main/java/phat/util/SpatialFactory.java | SpatialFactory.createShape | public static Geometry createShape(String name, Mesh shape, ColorRGBA color) {
"""
Creates a geometry given its name, its mesh and its color
@param name
@param shape
@param color
@return
"""
checkInit();
Geometry g = new Geometry(name, shape);
Material mat = new Material(... | java | public static Geometry createShape(String name, Mesh shape, ColorRGBA color) {
checkInit();
Geometry g = new Geometry(name, shape);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setC... | [
"public",
"static",
"Geometry",
"createShape",
"(",
"String",
"name",
",",
"Mesh",
"shape",
",",
"ColorRGBA",
"color",
")",
"{",
"checkInit",
"(",
")",
";",
"Geometry",
"g",
"=",
"new",
"Geometry",
"(",
"name",
",",
"shape",
")",
";",
"Material",
"mat",
... | Creates a geometry given its name, its mesh and its color
@param name
@param shape
@param color
@return | [
"Creates",
"a",
"geometry",
"given",
"its",
"name",
"its",
"mesh",
"and",
"its",
"color"
] | train | https://github.com/Grasia/phatsim/blob/2d4fc8189be9730b34c8e3e1a08fb4800e01c5df/phat-core/src/main/java/phat/util/SpatialFactory.java#L100-L109 |
threerings/playn | core/src/playn/core/util/Enums.java | Enums.valueOf | public static <E extends Enum<?>> E valueOf (E[] values, String name) {
"""
Finds the enum instance in the given array whose name matches the given value. This is a
substitute for {@link Enum#valueOf(Class, String)}, which crashes on iOS. This is apparently
due to the fact that IKVM does not support {@link Class... | java | public static <E extends Enum<?>> E valueOf (E[] values, String name){
for (E e : values) {
if (e.name().equals(name)) {
return e;
}
}
throw new IllegalArgumentException(
name + " not found in enum " + values[0].getClass().getName());
} | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"?",
">",
">",
"E",
"valueOf",
"(",
"E",
"[",
"]",
"values",
",",
"String",
"name",
")",
"{",
"for",
"(",
"E",
"e",
":",
"values",
")",
"{",
"if",
"(",
"e",
".",
"name",
"(",
")",
".",
"... | Finds the enum instance in the given array whose name matches the given value. This is a
substitute for {@link Enum#valueOf(Class, String)}, which crashes on iOS. This is apparently
due to the fact that IKVM does not support {@link Class#getEnumConstants()}. However, the
static {@code values()} method on enum types is ... | [
"Finds",
"the",
"enum",
"instance",
"in",
"the",
"given",
"array",
"whose",
"name",
"matches",
"the",
"given",
"value",
".",
"This",
"is",
"a",
"substitute",
"for",
"{",
"@link",
"Enum#valueOf",
"(",
"Class",
"String",
")",
"}",
"which",
"crashes",
"on",
... | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/core/src/playn/core/util/Enums.java#L35-L43 |
joniles/mpxj | src/main/java/net/sf/mpxj/phoenix/PhoenixInputStream.java | PhoenixInputStream.readHeaderString | private String readHeaderString(BufferedInputStream stream) throws IOException {
"""
Read the header from the Phoenix file.
@param stream input stream
@return raw header data
"""
int bufferSize = 100;
stream.mark(bufferSize);
byte[] buffer = new byte[bufferSize];
stream.read(buffer)... | java | private String readHeaderString(BufferedInputStream stream) throws IOException
{
int bufferSize = 100;
stream.mark(bufferSize);
byte[] buffer = new byte[bufferSize];
stream.read(buffer);
Charset charset = CharsetHelper.UTF8;
String header = new String(buffer, charset);
int p... | [
"private",
"String",
"readHeaderString",
"(",
"BufferedInputStream",
"stream",
")",
"throws",
"IOException",
"{",
"int",
"bufferSize",
"=",
"100",
";",
"stream",
".",
"mark",
"(",
"bufferSize",
")",
";",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
... | Read the header from the Phoenix file.
@param stream input stream
@return raw header data | [
"Read",
"the",
"header",
"from",
"the",
"Phoenix",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/phoenix/PhoenixInputStream.java#L110-L131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.