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 |
|---|---|---|---|---|---|---|---|---|---|---|
spring-cloud/spring-cloud-stream-app-starters | processor/spring-cloud-starter-stream-processor-tasklaunchrequest-transform/src/main/java/org/springframework/cloud/stream/app/tasklaunchrequest/transform/processor/TasklaunchrequestTransformProcessorConfiguration.java | TasklaunchrequestTransformProcessorConfiguration.addKeyValuePairAsProperty | private void addKeyValuePairAsProperty(String pair, Map<String, String> properties) {
"""
Adds a String of format key=value to the provided Map as a key/value pair.
@param pair the String representation
@param properties the Map to which the key/value pair should be added
"""
int firstEquals = pair... | java | private void addKeyValuePairAsProperty(String pair, Map<String, String> properties) {
int firstEquals = pair.indexOf('=');
if (firstEquals != -1) {
properties.put(pair.substring(0, firstEquals).trim(), pair.substring(firstEquals + 1).trim());
}
} | [
"private",
"void",
"addKeyValuePairAsProperty",
"(",
"String",
"pair",
",",
"Map",
"<",
"String",
",",
"String",
">",
"properties",
")",
"{",
"int",
"firstEquals",
"=",
"pair",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"firstEquals",
"!=",
"-",... | Adds a String of format key=value to the provided Map as a key/value pair.
@param pair the String representation
@param properties the Map to which the key/value pair should be added | [
"Adds",
"a",
"String",
"of",
"format",
"key",
"=",
"value",
"to",
"the",
"provided",
"Map",
"as",
"a",
"key",
"/",
"value",
"pair",
"."
] | train | https://github.com/spring-cloud/spring-cloud-stream-app-starters/blob/c82827a9b5a6eab78fe6a2d56a946b5f9fb0ead9/processor/spring-cloud-starter-stream-processor-tasklaunchrequest-transform/src/main/java/org/springframework/cloud/stream/app/tasklaunchrequest/transform/processor/TasklaunchrequestTransformProcessorConfigura... |
JetBrains/xodus | environment/src/main/java/jetbrains/exodus/tree/patricia/PatriciaTreeMutable.java | PatriciaTreeMutable.mutateUp | private void mutateUp(@NotNull final Deque<ChildReferenceTransient> stack, MutableNode node) {
"""
/*
stack contains all ancestors of the node, stack.peek() is its parent.
"""
while (!stack.isEmpty()) {
final ChildReferenceTransient parent = stack.pop();
final MutableNode mutab... | java | private void mutateUp(@NotNull final Deque<ChildReferenceTransient> stack, MutableNode node) {
while (!stack.isEmpty()) {
final ChildReferenceTransient parent = stack.pop();
final MutableNode mutableParent = parent.mutate(this);
mutableParent.setChild(parent.firstByte, node);... | [
"private",
"void",
"mutateUp",
"(",
"@",
"NotNull",
"final",
"Deque",
"<",
"ChildReferenceTransient",
">",
"stack",
",",
"MutableNode",
"node",
")",
"{",
"while",
"(",
"!",
"stack",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"ChildReferenceTransient",
"par... | /*
stack contains all ancestors of the node, stack.peek() is its parent. | [
"/",
"*",
"stack",
"contains",
"all",
"ancestors",
"of",
"the",
"node",
"stack",
".",
"peek",
"()",
"is",
"its",
"parent",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/environment/src/main/java/jetbrains/exodus/tree/patricia/PatriciaTreeMutable.java#L416-L423 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/logging/LoggerUtil.java | LoggerUtil.createSLF4JIntervalStatsLoggerForAllConfiguredIntervals | public static final void createSLF4JIntervalStatsLoggerForAllConfiguredIntervals(IStatsProducer producer, String loggerNamePrefix) {
"""
Creates interval stats loggers for all configured intervals. Every logger is attached to a logger with name
loggerNamePrefix<intervalName>. If loggerNamePrefix is for exam... | java | public static final void createSLF4JIntervalStatsLoggerForAllConfiguredIntervals(IStatsProducer producer, String loggerNamePrefix){
List<String> configuredIntervals = MoskitoConfigurationHolder.getConfiguration().getConfiguredIntervalNames();
for (String intervalName : configuredIntervals){
new IntervalStatsLogg... | [
"public",
"static",
"final",
"void",
"createSLF4JIntervalStatsLoggerForAllConfiguredIntervals",
"(",
"IStatsProducer",
"producer",
",",
"String",
"loggerNamePrefix",
")",
"{",
"List",
"<",
"String",
">",
"configuredIntervals",
"=",
"MoskitoConfigurationHolder",
".",
"getCon... | Creates interval stats loggers for all configured intervals. Every logger is attached to a logger with name
loggerNamePrefix<intervalName>. If loggerNamePrefix is for example 'foo' then all loggers are attached to
foo1m, foo5m, foo15m etc, for all configured intervals.
@param producer producer to attach loggers t... | [
"Creates",
"interval",
"stats",
"loggers",
"for",
"all",
"configured",
"intervals",
".",
"Every",
"logger",
"is",
"attached",
"to",
"a",
"logger",
"with",
"name",
"loggerNamePrefix<",
";",
"intervalName>",
";",
".",
"If",
"loggerNamePrefix",
"is",
"for",
"ex... | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/logging/LoggerUtil.java#L41-L48 |
actframework/actframework | src/main/java/act/event/EventBus.java | EventBus.emitSync | public EventBus emitSync(String event, Object... args) {
"""
Emit a string event with parameters and force all listener to be called synchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(String, Object...)
"""
return _emitWithOnceBus(eventContextSync(event, ... | java | public EventBus emitSync(String event, Object... args) {
return _emitWithOnceBus(eventContextSync(event, args));
} | [
"public",
"EventBus",
"emitSync",
"(",
"String",
"event",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"_emitWithOnceBus",
"(",
"eventContextSync",
"(",
"event",
",",
"args",
")",
")",
";",
"}"
] | Emit a string event with parameters and force all listener to be called synchronously.
@param event
the target event
@param args
the arguments passed in
@see #emit(String, Object...) | [
"Emit",
"a",
"string",
"event",
"with",
"parameters",
"and",
"force",
"all",
"listener",
"to",
"be",
"called",
"synchronously",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/event/EventBus.java#L1092-L1094 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java | CookieHelper.clearCookie | @Sensitive
public static void clearCookie(HttpServletRequest req, HttpServletResponse res, String cookieName, Cookie[] cookies) {
"""
Invalidate (clear) the cookie in the HttpServletResponse.
Setting age to 0 to invalidate it.
@param res
"""
Cookie existing = getCookie(cookies, cookieName);
... | java | @Sensitive
public static void clearCookie(HttpServletRequest req, HttpServletResponse res, String cookieName, Cookie[] cookies) {
Cookie existing = getCookie(cookies, cookieName);
if (existing != null) {
Cookie c = new Cookie(cookieName, "");
String path = existing.getPath()... | [
"@",
"Sensitive",
"public",
"static",
"void",
"clearCookie",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"String",
"cookieName",
",",
"Cookie",
"[",
"]",
"cookies",
")",
"{",
"Cookie",
"existing",
"=",
"getCookie",
"(",
"cookies",
... | Invalidate (clear) the cookie in the HttpServletResponse.
Setting age to 0 to invalidate it.
@param res | [
"Invalidate",
"(",
"clear",
")",
"the",
"cookie",
"in",
"the",
"HttpServletResponse",
".",
"Setting",
"age",
"to",
"0",
"to",
"invalidate",
"it",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L106-L125 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixUtils.java | IdemixUtils.modSub | static BIG modSub(BIG a, BIG b, BIG m) {
"""
Modsub takes input BIGs a, b, m and returns a-b modulo m
@param a the minuend of the modular subtraction
@param b the subtrahend of the modular subtraction
@param m the modulus
@return returns a-b (mod m)
"""
return modAdd(a, BIG.modneg(b, m), m);
... | java | static BIG modSub(BIG a, BIG b, BIG m) {
return modAdd(a, BIG.modneg(b, m), m);
} | [
"static",
"BIG",
"modSub",
"(",
"BIG",
"a",
",",
"BIG",
"b",
",",
"BIG",
"m",
")",
"{",
"return",
"modAdd",
"(",
"a",
",",
"BIG",
".",
"modneg",
"(",
"b",
",",
"m",
")",
",",
"m",
")",
";",
"}"
] | Modsub takes input BIGs a, b, m and returns a-b modulo m
@param a the minuend of the modular subtraction
@param b the subtrahend of the modular subtraction
@param m the modulus
@return returns a-b (mod m) | [
"Modsub",
"takes",
"input",
"BIGs",
"a",
"b",
"m",
"and",
"returns",
"a",
"-",
"b",
"modulo",
"m"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/idemix/IdemixUtils.java#L272-L274 |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/types/IndexedURLClassPath.java | IndexedURLClassPath.maybeIndexResource | private void maybeIndexResource(String relPath, URL delegate) {
"""
Callers may request the directory itself as a resource, and may
do so with or without trailing slashes. We do this in a while-loop
in case the classpath element has multiple superfluous trailing slashes.
@param relPath relative path
@param de... | java | private void maybeIndexResource(String relPath, URL delegate) {
if (!index.containsKey(relPath)) {
index.put(relPath, delegate);
if (relPath.endsWith(File.separator)) {
maybeIndexResource(relPath.substring(0, relPath.length() - File.separator.length()), delegate);
... | [
"private",
"void",
"maybeIndexResource",
"(",
"String",
"relPath",
",",
"URL",
"delegate",
")",
"{",
"if",
"(",
"!",
"index",
".",
"containsKey",
"(",
"relPath",
")",
")",
"{",
"index",
".",
"put",
"(",
"relPath",
",",
"delegate",
")",
";",
"if",
"(",
... | Callers may request the directory itself as a resource, and may
do so with or without trailing slashes. We do this in a while-loop
in case the classpath element has multiple superfluous trailing slashes.
@param relPath relative path
@param delegate value to insert | [
"Callers",
"may",
"request",
"the",
"directory",
"itself",
"as",
"a",
"resource",
"and",
"may",
"do",
"so",
"with",
"or",
"without",
"trailing",
"slashes",
".",
"We",
"do",
"this",
"in",
"a",
"while",
"-",
"loop",
"in",
"case",
"the",
"classpath",
"eleme... | train | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/types/IndexedURLClassPath.java#L148-L156 |
before/uadetector | modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java | UADetectorServiceFactory.getCachingAndUpdatingParser | public static UserAgentStringParser getCachingAndUpdatingParser(final URL dataUrl, final URL versionUrl) {
"""
Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of
<em>UAS data</em> (also known as database). When newer data available, it automatically lo... | java | public static UserAgentStringParser getCachingAndUpdatingParser(final URL dataUrl, final URL versionUrl) {
return CachingAndUpdatingParserHolder.getParser(dataUrl, versionUrl, RESOURCE_MODULE);
} | [
"public",
"static",
"UserAgentStringParser",
"getCachingAndUpdatingParser",
"(",
"final",
"URL",
"dataUrl",
",",
"final",
"URL",
"versionUrl",
")",
"{",
"return",
"CachingAndUpdatingParserHolder",
".",
"getParser",
"(",
"dataUrl",
",",
"versionUrl",
",",
"RESOURCE_MODUL... | Returns an implementation of {@link UserAgentStringParser} which checks at regular intervals for new versions of
<em>UAS data</em> (also known as database). When newer data available, it automatically loads and updates it.
Additionally the loaded data are stored in a cache file.
<p>
At initialization time the returned... | [
"Returns",
"an",
"implementation",
"of",
"{",
"@link",
"UserAgentStringParser",
"}",
"which",
"checks",
"at",
"regular",
"intervals",
"for",
"new",
"versions",
"of",
"<em",
">",
"UAS",
"data<",
"/",
"em",
">",
"(",
"also",
"known",
"as",
"database",
")",
"... | train | https://github.com/before/uadetector/blob/215fb652723c52866572cff885f52a3fe67b9db5/modules/uadetector-resources/src/main/java/net/sf/uadetector/service/UADetectorServiceFactory.java#L170-L172 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | Sql.asList | protected List<GroovyRowResult> asList(String sql, ResultSet rs,
@ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
"""
Hook to allow derived classes to override list of result collection behavior.
The ... | java | protected List<GroovyRowResult> asList(String sql, ResultSet rs,
@ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
return asList(sql, rs, 0, 0, metaClosure);
} | [
"protected",
"List",
"<",
"GroovyRowResult",
">",
"asList",
"(",
"String",
"sql",
",",
"ResultSet",
"rs",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.sql.ResultSetMetaData\"",
")",
"Closure",
"metaClosur... | Hook to allow derived classes to override list of result collection behavior.
The default behavior is to return a list of GroovyRowResult objects corresponding
to each row in the ResultSet.
@param sql query to execute
@param rs the ResultSet to process
@param metaClosure called for meta data (only onc... | [
"Hook",
"to",
"allow",
"derived",
"classes",
"to",
"override",
"list",
"of",
"result",
"collection",
"behavior",
".",
"The",
"default",
"behavior",
"is",
"to",
"return",
"a",
"list",
"of",
"GroovyRowResult",
"objects",
"corresponding",
"to",
"each",
"row",
"in... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java#L3969-L3972 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.perspectiveRect | public Matrix4f perspectiveRect(float width, float height, float zNear, float zFar, boolean zZeroToOne, Matrix4f dest) {
"""
Apply a symmetric perspective projection frustum transformation for a right-handed coordinate system
using the given NDC z range to this matrix and store the result in <code>dest</code>.
<... | java | public Matrix4f perspectiveRect(float width, float height, float zNear, float zFar, boolean zZeroToOne, Matrix4f dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setPerspectiveRect(width, height, zNear, zFar, zZeroToOne);
return perspectiveRectGeneric(width, height, zNear, zFar... | [
"public",
"Matrix4f",
"perspectiveRect",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
",",
"Matrix4f",
"dest",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
")",... | Apply a symmetric perspective projection frustum transformation for a right-handed coordinate system
using the given NDC z range to this matrix and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>P</code> the perspective projection matrix,
then the new matrix will be <... | [
"Apply",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L9425-L9429 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.getSyncPathList | public List<SyncPointInfo> getSyncPathList() {
"""
Get the sync point list.
@return a list of URIs (sync points)
"""
List<SyncPointInfo> returnList = new ArrayList<>();
for (AlluxioURI uri: mSyncPathList) {
SyncPointInfo.SyncStatus status;
Future<?> syncStatus = mSyncPathStatus.get(uri);... | java | public List<SyncPointInfo> getSyncPathList() {
List<SyncPointInfo> returnList = new ArrayList<>();
for (AlluxioURI uri: mSyncPathList) {
SyncPointInfo.SyncStatus status;
Future<?> syncStatus = mSyncPathStatus.get(uri);
if (syncStatus == null) {
status = SyncPointInfo.SyncStatus.NOT_INI... | [
"public",
"List",
"<",
"SyncPointInfo",
">",
"getSyncPathList",
"(",
")",
"{",
"List",
"<",
"SyncPointInfo",
">",
"returnList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"AlluxioURI",
"uri",
":",
"mSyncPathList",
")",
"{",
"SyncPointInfo",
... | Get the sync point list.
@return a list of URIs (sync points) | [
"Get",
"the",
"sync",
"point",
"list",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L338-L353 |
dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.createFamilyEvent | public Attribute createFamilyEvent(final Family family, final String type,
final String dateString) {
"""
Create a dated event.
@param family the family the event is for
@param type the type of event
@param dateString the date of the event
@return the created event
"""
if (family == n... | java | public Attribute createFamilyEvent(final Family family, final String type,
final String dateString) {
if (family == null || type == null || dateString == null) {
return gedObjectBuilder.createAttribute();
}
final Attribute event = gedObjectBuilder.createAttribute(family, ... | [
"public",
"Attribute",
"createFamilyEvent",
"(",
"final",
"Family",
"family",
",",
"final",
"String",
"type",
",",
"final",
"String",
"dateString",
")",
"{",
"if",
"(",
"family",
"==",
"null",
"||",
"type",
"==",
"null",
"||",
"dateString",
"==",
"null",
"... | Create a dated event.
@param family the family the event is for
@param type the type of event
@param dateString the date of the event
@return the created event | [
"Create",
"a",
"dated",
"event",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L71-L79 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineHtmlPage | public static String inlineHtmlPage(final String html, final String basePath) {
"""
Takes a XHTML file (usually generated by Publican), and inlines all the
CSS, image and SVG data. The resulting string is a stand alone HTML file
with no references to external resources.
@param html The original XHTML code... | java | public static String inlineHtmlPage(final String html, final String basePath) {
String retValue = html;
Document doc = null;
try {
doc = XMLUtilities.convertStringToDocument(html);
} catch (Exception ex) {
LOG.error("Failed to convert the HTML into a DOM Document... | [
"public",
"static",
"String",
"inlineHtmlPage",
"(",
"final",
"String",
"html",
",",
"final",
"String",
"basePath",
")",
"{",
"String",
"retValue",
"=",
"html",
";",
"Document",
"doc",
"=",
"null",
";",
"try",
"{",
"doc",
"=",
"XMLUtilities",
".",
"convert... | Takes a XHTML file (usually generated by Publican), and inlines all the
CSS, image and SVG data. The resulting string is a stand alone HTML file
with no references to external resources.
@param html The original XHTML code
@param basePath The path on which all the resources referenced by the
XHTML file can be foun... | [
"Takes",
"a",
"XHTML",
"file",
"(",
"usually",
"generated",
"by",
"Publican",
")",
"and",
"inlines",
"all",
"the",
"CSS",
"image",
"and",
"SVG",
"data",
".",
"The",
"resulting",
"string",
"is",
"a",
"stand",
"alone",
"HTML",
"file",
"with",
"no",
"refere... | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L60-L78 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/ConcurrentTaskScheduler.java | ConcurrentTaskScheduler.decorateTask | private Runnable decorateTask(Runnable task, boolean isRepeatingTask) {
"""
Decorate task.
@param task
the task
@param isRepeatingTask
the is repeating task
@return the runnable
"""
Runnable result = TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, isRepeatingTask);
if (th... | java | private Runnable decorateTask(Runnable task, boolean isRepeatingTask) {
Runnable result = TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, isRepeatingTask);
if (this.enterpriseConcurrentScheduler) {
result = ManagedTaskBuilder.buildManagedTask(result, task.toString());
... | [
"private",
"Runnable",
"decorateTask",
"(",
"Runnable",
"task",
",",
"boolean",
"isRepeatingTask",
")",
"{",
"Runnable",
"result",
"=",
"TaskUtils",
".",
"decorateTaskWithErrorHandler",
"(",
"task",
",",
"this",
".",
"errorHandler",
",",
"isRepeatingTask",
")",
";... | Decorate task.
@param task
the task
@param isRepeatingTask
the is repeating task
@return the runnable | [
"Decorate",
"task",
"."
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/ConcurrentTaskScheduler.java#L287-L293 |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java | PersistenceUnitComponent.getNewTempClassLoader | @Override
public ClassLoader getNewTempClassLoader() {
"""
In this method we just create a simple temporary class loader. This class
loader uses the bundle's class loader as parent but defines the classes
in this class loader. This has the implicit assumption that the temp
class loader is used BEFORE any bu... | java | @Override
public ClassLoader getNewTempClassLoader() {
return new ClassLoader(getClassLoader()) { //NOSONAR
/**
* Searches for the .class file and define it using the current class loader.
* @param className the class name
* @return the class object
... | [
"@",
"Override",
"public",
"ClassLoader",
"getNewTempClassLoader",
"(",
")",
"{",
"return",
"new",
"ClassLoader",
"(",
"getClassLoader",
"(",
")",
")",
"{",
"//NOSONAR",
"/**\n * Searches for the .class file and define it using the current class loader.\n ... | In this method we just create a simple temporary class loader. This class
loader uses the bundle's class loader as parent but defines the classes
in this class loader. This has the implicit assumption that the temp
class loader is used BEFORE any bundle's classes are loaded since a class
loader does parent delegation f... | [
"In",
"this",
"method",
"we",
"just",
"create",
"a",
"simple",
"temporary",
"class",
"loader",
".",
"This",
"class",
"loader",
"uses",
"the",
"bundle",
"s",
"class",
"loader",
"as",
"parent",
"but",
"defines",
"the",
"classes",
"in",
"this",
"class",
"load... | train | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java#L314-L365 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/support/security/SymmetricKey.java | SymmetricKey.decryptData | public byte[] decryptData(byte[] data) throws SymmetricKeyException {
"""
Decrypt the encrypted byte array data. The encrypted data must be prefixed with the
IV header (16 bytes) used when encrypting the data.
@param data Encrypted data
@return Decrypted data
@throws SymmetricKeyException
"""
if (d... | java | public byte[] decryptData(byte[] data) throws SymmetricKeyException {
if (data.length < IV_SIZE)
throw new SymmetricKeyException("Invalid encrypted data, no IV prepended");
byte[] iv = ArrayUtils.subarray(data, 0, IV_SIZE);
Cipher cipher = getCipher(Cipher.DECRYPT_MODE, iv);
... | [
"public",
"byte",
"[",
"]",
"decryptData",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"SymmetricKeyException",
"{",
"if",
"(",
"data",
".",
"length",
"<",
"IV_SIZE",
")",
"throw",
"new",
"SymmetricKeyException",
"(",
"\"Invalid encrypted data, no IV prepended\"... | Decrypt the encrypted byte array data. The encrypted data must be prefixed with the
IV header (16 bytes) used when encrypting the data.
@param data Encrypted data
@return Decrypted data
@throws SymmetricKeyException | [
"Decrypt",
"the",
"encrypted",
"byte",
"array",
"data",
".",
"The",
"encrypted",
"data",
"must",
"be",
"prefixed",
"with",
"the",
"IV",
"header",
"(",
"16",
"bytes",
")",
"used",
"when",
"encrypting",
"the",
"data",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/support/security/SymmetricKey.java#L131-L141 |
cryptomator/cryptofs | src/main/java/org/cryptomator/cryptofs/ConflictResolver.java | ConflictResolver.resolveConflictsIfNecessary | public Path resolveConflictsIfNecessary(Path ciphertextPath, String dirId) throws IOException {
"""
Checks if the name of the file represented by the given ciphertextPath is a valid ciphertext name without any additional chars.
If any unexpected chars are found on the name but it still contains an authentic ciphe... | java | public Path resolveConflictsIfNecessary(Path ciphertextPath, String dirId) throws IOException {
String ciphertextFileName = ciphertextPath.getFileName().toString();
String basename = StringUtils.removeEnd(ciphertextFileName, LONG_NAME_FILE_EXT);
Matcher m = CIPHERTEXT_FILENAME_PATTERN.matcher(basename);
if (!m.... | [
"public",
"Path",
"resolveConflictsIfNecessary",
"(",
"Path",
"ciphertextPath",
",",
"String",
"dirId",
")",
"throws",
"IOException",
"{",
"String",
"ciphertextFileName",
"=",
"ciphertextPath",
".",
"getFileName",
"(",
")",
".",
"toString",
"(",
")",
";",
"String"... | Checks if the name of the file represented by the given ciphertextPath is a valid ciphertext name without any additional chars.
If any unexpected chars are found on the name but it still contains an authentic ciphertext, it is considered a conflicting file.
Conflicting files will be given a new name. The caller must us... | [
"Checks",
"if",
"the",
"name",
"of",
"the",
"file",
"represented",
"by",
"the",
"given",
"ciphertextPath",
"is",
"a",
"valid",
"ciphertext",
"name",
"without",
"any",
"additional",
"chars",
".",
"If",
"any",
"unexpected",
"chars",
"are",
"found",
"on",
"the"... | train | https://github.com/cryptomator/cryptofs/blob/67fc1a4950dd1c150cd2e2c75bcabbeb7c9ac82e/src/main/java/org/cryptomator/cryptofs/ConflictResolver.java#L50-L61 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.SMALL | public static HtmlTree SMALL(Content body) {
"""
Generates a SMALL tag with some content.
@param body content for the tag
@return an HtmlTree object for the SMALL tag
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.SMALL, nullCheck(body));
return htmltree;
} | java | public static HtmlTree SMALL(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.SMALL, nullCheck(body));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"SMALL",
"(",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"SMALL",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"return",
"htmltree",
";",
"}"
] | Generates a SMALL tag with some content.
@param body content for the tag
@return an HtmlTree object for the SMALL tag | [
"Generates",
"a",
"SMALL",
"tag",
"with",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L697-L700 |
gliga/ekstazi | org.ekstazi.core/src/main/java/org/ekstazi/data/Storer.java | Storer.openFileRead | private static FileInputStream openFileRead(String dirName, String fullName, String firstPart, String secondPart) {
"""
Opens {@link FileInputStream}. This method checks if file name is too
long and hashes the file name. If there are some other problems, the
method gives up and returns null.
@param dirName
D... | java | private static FileInputStream openFileRead(String dirName, String fullName, String firstPart, String secondPart) {
try {
return new FileInputStream(new File(dirName, fullName));
} catch (FileNotFoundException ex1) {
// If file name is too long hash it and try again.
... | [
"private",
"static",
"FileInputStream",
"openFileRead",
"(",
"String",
"dirName",
",",
"String",
"fullName",
",",
"String",
"firstPart",
",",
"String",
"secondPart",
")",
"{",
"try",
"{",
"return",
"new",
"FileInputStream",
"(",
"new",
"File",
"(",
"dirName",
... | Opens {@link FileInputStream}. This method checks if file name is too
long and hashes the file name. If there are some other problems, the
method gives up and returns null.
@param dirName
Destination directory.
@param fullName
Name of the file.
@return Opened {@link FileInputStream} or null if operation was not
succes... | [
"Opens",
"{",
"@link",
"FileInputStream",
"}",
".",
"This",
"method",
"checks",
"if",
"file",
"name",
"is",
"too",
"long",
"and",
"hashes",
"the",
"file",
"name",
".",
"If",
"there",
"are",
"some",
"other",
"problems",
"the",
"method",
"gives",
"up",
"an... | train | https://github.com/gliga/ekstazi/blob/5bf4d39a13305afe62f8b8d2d7b4c573d37d42a1/org.ekstazi.core/src/main/java/org/ekstazi/data/Storer.java#L187-L210 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.existsResource | public boolean existsResource(String resourcename, CmsResourceFilter filter) {
"""
Checks the availability of a resource in the VFS,
using the provided filter.<p>
A resource may be of type <code>{@link CmsFile}</code> or
<code>{@link CmsFolder}</code>.<p>
The specified filter controls what kind of resource... | java | public boolean existsResource(String resourcename, CmsResourceFilter filter) {
return m_securityManager.existsResource(m_context, addSiteRoot(resourcename), filter);
} | [
"public",
"boolean",
"existsResource",
"(",
"String",
"resourcename",
",",
"CmsResourceFilter",
"filter",
")",
"{",
"return",
"m_securityManager",
".",
"existsResource",
"(",
"m_context",
",",
"addSiteRoot",
"(",
"resourcename",
")",
",",
"filter",
")",
";",
"}"
] | Checks the availability of a resource in the VFS,
using the provided filter.<p>
A resource may be of type <code>{@link CmsFile}</code> or
<code>{@link CmsFolder}</code>.<p>
The specified filter controls what kind of resources should be "found"
during the read operation. This will depend on the application. For exampl... | [
"Checks",
"the",
"availability",
"of",
"a",
"resource",
"in",
"the",
"VFS",
"using",
"the",
"provided",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1229-L1232 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleDeleteEntity | protected <C extends CrudResponse, T extends DeleteEntity> C handleDeleteEntity(Class<T> type, Integer id) {
"""
Makes the delete api call. The type of delete (soft or hard) depends on the DeleteEntity type of the Class<T> type passed in.
@param type
@param id
@return
"""
Map<String, String> uriVa... | java | protected <C extends CrudResponse, T extends DeleteEntity> C handleDeleteEntity(Class<T> type, Integer id) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesForEntityDelete(
BullhornEntityInfo.getTypesRestEntityName(type), id);
String url = restUrlFactory.assemb... | [
"protected",
"<",
"C",
"extends",
"CrudResponse",
",",
"T",
"extends",
"DeleteEntity",
">",
"C",
"handleDeleteEntity",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"Integer",
"id",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"re... | Makes the delete api call. The type of delete (soft or hard) depends on the DeleteEntity type of the Class<T> type passed in.
@param type
@param id
@return | [
"Makes",
"the",
"delete",
"api",
"call",
".",
"The",
"type",
"of",
"delete",
"(",
"soft",
"or",
"hard",
")",
"depends",
"on",
"the",
"DeleteEntity",
"type",
"of",
"the",
"Class<T",
">",
"type",
"passed",
"in",
"."
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1192-L1215 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.rotate | public static void rotate(Image image, int degree, File outFile) throws IORuntimeException {
"""
旋转图片为指定角度<br>
此方法不会关闭输出流
@param image 目标图像
@param degree 旋转角度
@param outFile 输出文件
@since 3.2.2
@throws IORuntimeException IO异常
"""
write(rotate(image, degree), outFile);
} | java | public static void rotate(Image image, int degree, File outFile) throws IORuntimeException {
write(rotate(image, degree), outFile);
} | [
"public",
"static",
"void",
"rotate",
"(",
"Image",
"image",
",",
"int",
"degree",
",",
"File",
"outFile",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"rotate",
"(",
"image",
",",
"degree",
")",
",",
"outFile",
")",
";",
"}"
] | 旋转图片为指定角度<br>
此方法不会关闭输出流
@param image 目标图像
@param degree 旋转角度
@param outFile 输出文件
@since 3.2.2
@throws IORuntimeException IO异常 | [
"旋转图片为指定角度<br",
">",
"此方法不会关闭输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1016-L1018 |
sporniket/p3 | src/main/java/com/sporniket/libre/p3/P3.java | P3.executeProgram | @SuppressWarnings("unused")
private void executeProgram(String name, String[] source) throws Exception {
"""
The processor for extracting directives.
@param name
property name, unused.
@param source
the directives.
@throws Exception
when there is a problem.
"""
String _singleStringSource = executePr... | java | @SuppressWarnings("unused")
private void executeProgram(String name, String[] source) throws Exception
{
String _singleStringSource = executeProgram__makeSingleStringSource(source);
executeProgram(name, _singleStringSource);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"executeProgram",
"(",
"String",
"name",
",",
"String",
"[",
"]",
"source",
")",
"throws",
"Exception",
"{",
"String",
"_singleStringSource",
"=",
"executeProgram__makeSingleStringSource",
"(",
"sou... | The processor for extracting directives.
@param name
property name, unused.
@param source
the directives.
@throws Exception
when there is a problem. | [
"The",
"processor",
"for",
"extracting",
"directives",
"."
] | train | https://github.com/sporniket/p3/blob/fc20b3066dc4a9cd759090adae0a6b02508df135/src/main/java/com/sporniket/libre/p3/P3.java#L558-L563 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java | JournalCreator.getNextPID | public String[] getNextPID(Context context, int numPIDs, String namespace)
throws ServerException {
"""
Create a journal entry, add the arguments, and invoke the method.
"""
try {
CreatorJournalEntry cje =
new CreatorJournalEntry(METHOD_GET_NEXT_PID, context)... | java | public String[] getNextPID(Context context, int numPIDs, String namespace)
throws ServerException {
try {
CreatorJournalEntry cje =
new CreatorJournalEntry(METHOD_GET_NEXT_PID, context);
cje.addArgument(ARGUMENT_NAME_NUM_PIDS, numPIDs);
cje.add... | [
"public",
"String",
"[",
"]",
"getNextPID",
"(",
"Context",
"context",
",",
"int",
"numPIDs",
",",
"String",
"namespace",
")",
"throws",
"ServerException",
"{",
"try",
"{",
"CreatorJournalEntry",
"cje",
"=",
"new",
"CreatorJournalEntry",
"(",
"METHOD_GET_NEXT_PID"... | Create a journal entry, add the arguments, and invoke the method. | [
"Create",
"a",
"journal",
"entry",
"add",
"the",
"arguments",
"and",
"invoke",
"the",
"method",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java#L360-L371 |
hdbeukel/james-extensions | src/main/java/org/jamesframework/ext/permutation/neigh/SingleSwapNeighbourhood.java | SingleSwapNeighbourhood.getRandomMove | @Override
public SingleSwapMove getRandomMove(PermutationSolution solution, Random rnd) {
"""
Create a random single swap move.
@param solution permutation solution to which the move is to be applied
@param rnd source of randomness used to generate random move
@return random swap move, <code>null</code> i... | java | @Override
public SingleSwapMove getRandomMove(PermutationSolution solution, Random rnd) {
int n = solution.size();
// check: move possible
if(n < 2){
return null;
}
// pick two random, distinct positions to swap
int i = rnd.nextInt(n);
int j = rnd.... | [
"@",
"Override",
"public",
"SingleSwapMove",
"getRandomMove",
"(",
"PermutationSolution",
"solution",
",",
"Random",
"rnd",
")",
"{",
"int",
"n",
"=",
"solution",
".",
"size",
"(",
")",
";",
"// check: move possible",
"if",
"(",
"n",
"<",
"2",
")",
"{",
"r... | Create a random single swap move.
@param solution permutation solution to which the move is to be applied
@param rnd source of randomness used to generate random move
@return random swap move, <code>null</code> if the permutation contains
less than 2 items | [
"Create",
"a",
"random",
"single",
"swap",
"move",
"."
] | train | https://github.com/hdbeukel/james-extensions/blob/37a43aa6ac4d67575cabc7aed25fd96c91d4c7b2/src/main/java/org/jamesframework/ext/permutation/neigh/SingleSwapNeighbourhood.java#L41-L56 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java | Attachment.fromTextInputStream | @Deprecated
public static Attachment fromTextInputStream( InputStream inputStream, MediaType mediaType, Charset charset ) throws IOException {
"""
Creates a non-binary attachment from the given file.
@throws IOException if an I/O error occurs
@throws java.lang.IllegalArgumentException if mediaType is binary
... | java | @Deprecated
public static Attachment fromTextInputStream( InputStream inputStream, MediaType mediaType, Charset charset ) throws IOException {
return fromText( CharStreams.toString( new InputStreamReader( inputStream, charset ) ), mediaType );
} | [
"@",
"Deprecated",
"public",
"static",
"Attachment",
"fromTextInputStream",
"(",
"InputStream",
"inputStream",
",",
"MediaType",
"mediaType",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"fromText",
"(",
"CharStreams",
".",
"toString",
"("... | Creates a non-binary attachment from the given file.
@throws IOException if an I/O error occurs
@throws java.lang.IllegalArgumentException if mediaType is binary
@deprecated use fromTextInputStream without charSet with a mediaType that has a specified charSet | [
"Creates",
"a",
"non",
"-",
"binary",
"attachment",
"from",
"the",
"given",
"file",
"."
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L221-L224 |
GerdHolz/TOVAL | src/de/invation/code/toval/types/DynamicMatrix.java | DynamicMatrix.putValue | public void putValue(E row, E col, T value) {
"""
Sets the matrix entry specified by the given row and col keys.<br>
This method sets the following content: Matrix[row,col]=value
@param row Row-value of indexing type
@param col Col-value of indexing type
@param value Value that has to be inserted
"""
en... | java | public void putValue(E row, E col, T value) {
ensureRowKey(row);
ensureColKey(col);
get(rowKeys.get(row)).set(colKeys.get(col), value);
} | [
"public",
"void",
"putValue",
"(",
"E",
"row",
",",
"E",
"col",
",",
"T",
"value",
")",
"{",
"ensureRowKey",
"(",
"row",
")",
";",
"ensureColKey",
"(",
"col",
")",
";",
"get",
"(",
"rowKeys",
".",
"get",
"(",
"row",
")",
")",
".",
"set",
"(",
"... | Sets the matrix entry specified by the given row and col keys.<br>
This method sets the following content: Matrix[row,col]=value
@param row Row-value of indexing type
@param col Col-value of indexing type
@param value Value that has to be inserted | [
"Sets",
"the",
"matrix",
"entry",
"specified",
"by",
"the",
"given",
"row",
"and",
"col",
"keys",
".",
"<br",
">",
"This",
"method",
"sets",
"the",
"following",
"content",
":",
"Matrix",
"[",
"row",
"col",
"]",
"=",
"value"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/DynamicMatrix.java#L51-L55 |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/HttpServiceActivator.java | HttpServiceActivator.shutdownService | @Override
public boolean shutdownService(Object service, BundleContext context) {
"""
Shutdown this service.
Override this to do all the startup.
@return true if successful.
"""
if (this.service != null)
((HttpServiceTracker)this.service).close();
return true;
} | java | @Override
public boolean shutdownService(Object service, BundleContext context)
{
if (this.service != null)
((HttpServiceTracker)this.service).close();
return true;
} | [
"@",
"Override",
"public",
"boolean",
"shutdownService",
"(",
"Object",
"service",
",",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"this",
".",
"service",
"!=",
"null",
")",
"(",
"(",
"HttpServiceTracker",
")",
"this",
".",
"service",
")",
".",
"clos... | Shutdown this service.
Override this to do all the startup.
@return true if successful. | [
"Shutdown",
"this",
"service",
".",
"Override",
"this",
"to",
"do",
"all",
"the",
"startup",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/HttpServiceActivator.java#L58-L64 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java | ScreenField.printData | public boolean printData(PrintWriter out, int iPrintOptions) {
"""
Display this control's data in print (view) format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
if (!this.isInputField())
return f... | java | public boolean printData(PrintWriter out, int iPrintOptions)
{
if (!this.isInputField())
return false;
if (this.isToolbar())
return false;
return this.getScreenFieldView().printData(out, iPrintOptions);
} | [
"public",
"boolean",
"printData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"!",
"this",
".",
"isInputField",
"(",
")",
")",
"return",
"false",
";",
"if",
"(",
"this",
".",
"isToolbar",
"(",
")",
")",
"return",
"false... | Display this control's data in print (view) format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"this",
"control",
"s",
"data",
"in",
"print",
"(",
"view",
")",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/ScreenField.java#L700-L707 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java | HttpContext.PUT | public <T> Optional<T> PUT(String partialUrl, Object payload, GenericType<T> returnType) {
"""
Execute a PUT call against the partial URL.
@param <T> The type parameter used for the return object
@param partialUrl The partial URL to build
@param payload The object to use for the PUT
@param returnType The expec... | java | public <T> Optional<T> PUT(String partialUrl, Object payload, GenericType<T> returnType)
{
URI uri = buildUri(partialUrl);
return executePutRequest(uri, payload, null, null, returnType);
} | [
"public",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"PUT",
"(",
"String",
"partialUrl",
",",
"Object",
"payload",
",",
"GenericType",
"<",
"T",
">",
"returnType",
")",
"{",
"URI",
"uri",
"=",
"buildUri",
"(",
"partialUrl",
")",
";",
"return",
"executeP... | Execute a PUT call against the partial URL.
@param <T> The type parameter used for the return object
@param partialUrl The partial URL to build
@param payload The object to use for the PUT
@param returnType The expected return type
@return The return type | [
"Execute",
"a",
"PUT",
"call",
"against",
"the",
"partial",
"URL",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L164-L168 |
liferay/com-liferay-commerce | commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java | CommerceVirtualOrderItemPersistenceImpl.findAll | @Override
public List<CommerceVirtualOrderItem> findAll() {
"""
Returns all the commerce virtual order items.
@return the commerce virtual order items
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceVirtualOrderItem> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceVirtualOrderItem",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce virtual order items.
@return the commerce virtual order items | [
"Returns",
"all",
"the",
"commerce",
"virtual",
"order",
"items",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-type-virtual-order-service/src/main/java/com/liferay/commerce/product/type/virtual/order/service/persistence/impl/CommerceVirtualOrderItemPersistenceImpl.java#L2353-L2356 |
ykrasik/jaci | jaci-utils/src/main/java/com/github/ykrasik/jaci/util/string/StringUtils.java | StringUtils.removeTrailingDelimiter | public static String removeTrailingDelimiter(String str, String delimiter) {
"""
Removes the trailing delimiter from a string.
@param str String to process.
@param delimiter Delimiter to remove.
@return The string with the trailing delimiter removed.
"""
if (!str.endsWith(delimiter)) {
... | java | public static String removeTrailingDelimiter(String str, String delimiter) {
if (!str.endsWith(delimiter)) {
return str;
} else {
return str.substring(0, str.length() - delimiter.length());
}
} | [
"public",
"static",
"String",
"removeTrailingDelimiter",
"(",
"String",
"str",
",",
"String",
"delimiter",
")",
"{",
"if",
"(",
"!",
"str",
".",
"endsWith",
"(",
"delimiter",
")",
")",
"{",
"return",
"str",
";",
"}",
"else",
"{",
"return",
"str",
".",
... | Removes the trailing delimiter from a string.
@param str String to process.
@param delimiter Delimiter to remove.
@return The string with the trailing delimiter removed. | [
"Removes",
"the",
"trailing",
"delimiter",
"from",
"a",
"string",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-utils/src/main/java/com/github/ykrasik/jaci/util/string/StringUtils.java#L60-L66 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.similarDeleteByUrl | public JSONObject similarDeleteByUrl(String url, HashMap<String, String> options) {
"""
相似图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key... | java | public JSONObject similarDeleteByUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearc... | [
"public",
"JSONObject",
"similarDeleteByUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",... | 相似图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"相似图检索—删除接口",
"**",
"删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L649-L660 |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java | UdpManager.bindLocal | public void bindLocal(DatagramChannel channel, int port) throws IOException {
"""
Binds socket to global bind address and specified port.
@param channel the channel
@param port the port to bind to
@throws IOException
"""
// select port if wildcarded
if (port == PORT_ANY) {
port... | java | public void bindLocal(DatagramChannel channel, int port) throws IOException {
// select port if wildcarded
if (port == PORT_ANY) {
port = localPortManager.next();
}
// try bind
IOException ex = null;
for (int q = 0; q < 100; q++) {
try {
... | [
"public",
"void",
"bindLocal",
"(",
"DatagramChannel",
"channel",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"// select port if wildcarded",
"if",
"(",
"port",
"==",
"PORT_ANY",
")",
"{",
"port",
"=",
"localPortManager",
".",
"next",
"(",
")",
";",... | Binds socket to global bind address and specified port.
@param channel the channel
@param port the port to bind to
@throws IOException | [
"Binds",
"socket",
"to",
"global",
"bind",
"address",
"and",
"specified",
"port",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java#L390-L413 |
zxing/zxing | core/src/main/java/com/google/zxing/pdf417/detector/Detector.java | Detector.patternMatchVariance | private static float patternMatchVariance(int[] counters, int[] pattern, float maxIndividualVariance) {
"""
Determines how closely a set of observed counts of runs of black/white
values matches a given target pattern. This is reported as the ratio of
the total variance from the expected pattern proportions acros... | java | private static float patternMatchVariance(int[] counters, int[] pattern, float maxIndividualVariance) {
int numCounters = counters.length;
int total = 0;
int patternLength = 0;
for (int i = 0; i < numCounters; i++) {
total += counters[i];
patternLength += pattern[i];
}
if (total < pa... | [
"private",
"static",
"float",
"patternMatchVariance",
"(",
"int",
"[",
"]",
"counters",
",",
"int",
"[",
"]",
"pattern",
",",
"float",
"maxIndividualVariance",
")",
"{",
"int",
"numCounters",
"=",
"counters",
".",
"length",
";",
"int",
"total",
"=",
"0",
"... | Determines how closely a set of observed counts of runs of black/white
values matches a given target pattern. This is reported as the ratio of
the total variance from the expected pattern proportions across all
pattern elements, to the length of the pattern.
@param counters observed counters
@param pattern expected pa... | [
"Determines",
"how",
"closely",
"a",
"set",
"of",
"observed",
"counts",
"of",
"runs",
"of",
"black",
"/",
"white",
"values",
"matches",
"a",
"given",
"target",
"pattern",
".",
"This",
"is",
"reported",
"as",
"the",
"ratio",
"of",
"the",
"total",
"variance"... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/pdf417/detector/Detector.java#L309-L339 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/BloomFilter.java | BloomFilter.murmurHash3 | public static int murmurHash3(byte[] data, long nTweak, int hashNum, byte[] object) {
"""
Applies the MurmurHash3 (x86_32) algorithm to the given data.
See this <a href="https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp">C++ code for the original.</a>
"""
int h1 = (int)(hashNum * 0x... | java | public static int murmurHash3(byte[] data, long nTweak, int hashNum, byte[] object) {
int h1 = (int)(hashNum * 0xFBA4C795L + nTweak);
final int c1 = 0xcc9e2d51;
final int c2 = 0x1b873593;
int numBlocks = (object.length / 4) * 4;
// body
for(int i = 0; i < numBlocks; i +=... | [
"public",
"static",
"int",
"murmurHash3",
"(",
"byte",
"[",
"]",
"data",
",",
"long",
"nTweak",
",",
"int",
"hashNum",
",",
"byte",
"[",
"]",
"object",
")",
"{",
"int",
"h1",
"=",
"(",
"int",
")",
"(",
"hashNum",
"*",
"0xFBA4C795",
"L",
"+",
"nTwea... | Applies the MurmurHash3 (x86_32) algorithm to the given data.
See this <a href="https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp">C++ code for the original.</a> | [
"Applies",
"the",
"MurmurHash3",
"(",
"x86_32",
")",
"algorithm",
"to",
"the",
"given",
"data",
".",
"See",
"this",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",
"aappleby",
"/",
"smhasher",
"/",
"blob",
"/",
"master",
"/",
"src",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/BloomFilter.java#L175-L224 |
spotify/sparkey-java | src/main/java/com/spotify/sparkey/Sparkey.java | Sparkey.writeHash | public static void writeHash(File file, HashType hashType) throws IOException {
"""
Write (or rewrite) the index file for a given sparkey file.
@param file File base to use, the actual file endings will be set to .spi and .spl
@param hashType choice of hash type, can be 32 or 64 bits.
"""
SparkeyWriter... | java | public static void writeHash(File file, HashType hashType) throws IOException {
SparkeyWriter writer = append(file);
writer.writeHash(hashType);
writer.close();
} | [
"public",
"static",
"void",
"writeHash",
"(",
"File",
"file",
",",
"HashType",
"hashType",
")",
"throws",
"IOException",
"{",
"SparkeyWriter",
"writer",
"=",
"append",
"(",
"file",
")",
";",
"writer",
".",
"writeHash",
"(",
"hashType",
")",
";",
"writer",
... | Write (or rewrite) the index file for a given sparkey file.
@param file File base to use, the actual file endings will be set to .spi and .spl
@param hashType choice of hash type, can be 32 or 64 bits. | [
"Write",
"(",
"or",
"rewrite",
")",
"the",
"index",
"file",
"for",
"a",
"given",
"sparkey",
"file",
"."
] | train | https://github.com/spotify/sparkey-java/blob/77ed13b17b4b28f38d6e335610269fb135c3a1be/src/main/java/com/spotify/sparkey/Sparkey.java#L137-L141 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/Xml.java | Xml.toObject | @SuppressWarnings("rawtypes")
public static Object toObject(File file, String encoding, Class<Map> cls) throws UnmarshalException, NoSuchPathException {
"""
将XML文件绑定为对象
@param file XML文件
@param encoding XML文件编码, 例如UTF-8, GBK
@param cls 绑定目标类
@return 绑定后的对象
@throws NoSuchPathException 路径异常
@throws Unma... | java | @SuppressWarnings("rawtypes")
public static Object toObject(File file, String encoding, Class<Map> cls) throws UnmarshalException, NoSuchPathException {
if (file == null || !file.exists()) {
throw new NoSuchPathException("Could not find file");
}
if (file.isDirectory()) {
throw new NoSuchPathException(... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"Object",
"toObject",
"(",
"File",
"file",
",",
"String",
"encoding",
",",
"Class",
"<",
"Map",
">",
"cls",
")",
"throws",
"UnmarshalException",
",",
"NoSuchPathException",
"{",
"if",
"(",
... | 将XML文件绑定为对象
@param file XML文件
@param encoding XML文件编码, 例如UTF-8, GBK
@param cls 绑定目标类
@return 绑定后的对象
@throws NoSuchPathException 路径异常
@throws UnmarshalException 解组异常 | [
"将XML文件绑定为对象"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/Xml.java#L175-L193 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/ThreadLocalUsage.java | ThreadLocalUsage.wellKnownTypeArgument | private boolean wellKnownTypeArgument(NewClassTree tree, VisitorState state) {
"""
Ignore some common ThreadLocal type arguments that are fine to have per-instance copies of.
"""
Type type = getType(tree);
if (type == null) {
return false;
}
type = state.getTypes().asSuper(type, state.get... | java | private boolean wellKnownTypeArgument(NewClassTree tree, VisitorState state) {
Type type = getType(tree);
if (type == null) {
return false;
}
type = state.getTypes().asSuper(type, state.getSymbolFromString("java.lang.ThreadLocal"));
if (type == null) {
return false;
}
if (type.ge... | [
"private",
"boolean",
"wellKnownTypeArgument",
"(",
"NewClassTree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"Type",
"type",
"=",
"getType",
"(",
"tree",
")",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"type",
"="... | Ignore some common ThreadLocal type arguments that are fine to have per-instance copies of. | [
"Ignore",
"some",
"common",
"ThreadLocal",
"type",
"arguments",
"that",
"are",
"fine",
"to",
"have",
"per",
"-",
"instance",
"copies",
"of",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/ThreadLocalUsage.java#L106-L126 |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/util/StringUtils.java | StringUtils.leftPad | public static String leftPad(String str, int size, char padChar) {
"""
<p>
Left pad a String with a specified character.
</p>
<p>
Pad to a size of {@code size}.
</p>
<pre>
StringUtils.leftPad(null, *, *) = null
StringUtils.leftPad("", 3, 'z') = "zzz"
StringUtils.leftPad("bat", 3, 'z') = "bat"... | java | public static String leftPad(String str, int size, char padChar) {
return org.apache.commons.lang3.StringUtils.leftPad(str, size, padChar);
} | [
"public",
"static",
"String",
"leftPad",
"(",
"String",
"str",
",",
"int",
"size",
",",
"char",
"padChar",
")",
"{",
"return",
"org",
".",
"apache",
".",
"commons",
".",
"lang3",
".",
"StringUtils",
".",
"leftPad",
"(",
"str",
",",
"size",
",",
"padCha... | <p>
Left pad a String with a specified character.
</p>
<p>
Pad to a size of {@code size}.
</p>
<pre>
StringUtils.leftPad(null, *, *) = null
StringUtils.leftPad("", 3, 'z') = "zzz"
StringUtils.leftPad("bat", 3, 'z') = "bat"
StringUtils.leftPad("bat", 5, 'z') = "zzbat"
StringUtils.leftPad("bat", 1, 'z') = "b... | [
"<p",
">",
"Left",
"pad",
"a",
"String",
"with",
"a",
"specified",
"character",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/StringUtils.java#L107-L109 |
treasure-data/td-client-java | src/main/java/com/treasuredata/client/TDHttpClient.java | TDHttpClient.withHeaders | public TDHttpClient withHeaders(Multimap<String, String> headers) {
"""
Get a {@link TDHttpClient} that uses the specified headers for each request. Reuses the same
underlying http client so closing the returned instance will return this instance as well.
@param headers
@return
"""
Multimap<String... | java | public TDHttpClient withHeaders(Multimap<String, String> headers)
{
Multimap<String, String> mergedHeaders = ImmutableMultimap.<String, String>builder()
.putAll(this.headers)
.putAll(headers)
.build();
return new TDHttpClient(config, httpClient, object... | [
"public",
"TDHttpClient",
"withHeaders",
"(",
"Multimap",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"Multimap",
"<",
"String",
",",
"String",
">",
"mergedHeaders",
"=",
"ImmutableMultimap",
".",
"<",
"String",
",",
"String",
">",
"builder",
"("... | Get a {@link TDHttpClient} that uses the specified headers for each request. Reuses the same
underlying http client so closing the returned instance will return this instance as well.
@param headers
@return | [
"Get",
"a",
"{",
"@link",
"TDHttpClient",
"}",
"that",
"uses",
"the",
"specified",
"headers",
"for",
"each",
"request",
".",
"Reuses",
"the",
"same",
"underlying",
"http",
"client",
"so",
"closing",
"the",
"returned",
"instance",
"will",
"return",
"this",
"i... | train | https://github.com/treasure-data/td-client-java/blob/2769cbcf0e787d457344422cfcdde467399bd684/src/main/java/com/treasuredata/client/TDHttpClient.java#L152-L159 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGetOptional | public static <T> Optional<Optional<T>> dotGetOptional(
final Map map, final String pathString, final Class<T> clazz
) {
"""
Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value
"""
... | java | public static <T> Optional<Optional<T>> dotGetOptional(
final Map map, final String pathString, final Class<T> clazz
) {
return dotGet(map, Optional.class, pathString).map(opt -> (Optional<T>) opt);
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"Optional",
"<",
"T",
">",
">",
"dotGetOptional",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"dotGet",
"(",
... | Get optional value by path.
@param <T> optional value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"optional",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L240-L244 |
jbundle/jbundle | app/program/screen/src/main/java/org/jbundle/app/program/access/AccessGridScreen.java | AccessGridScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) {
"""
Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't pr... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if ((strCommand.equalsIgnoreCase(MenuConstants.FORM))
|| (strCommand.equalsIgnoreCase(MenuConstants.FORMLINK)))
{
String strHandle = null;
if (strCommand.equalsIgnoreCase(... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"if",
"(",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"MenuConstants",
".",
"FORM",
")",
")",
"||",
"(",
"strComma... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/screen/src/main/java/org/jbundle/app/program/access/AccessGridScreen.java#L111-L135 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/HashUtil.java | HashUtil.MurmurHash3_x64_64_direct | public static long MurmurHash3_x64_64_direct(MemoryAccessor mem, long base, int offset, int len) {
"""
Returns the {@code MurmurHash3_x64_64} hash of a memory block accessed by the provided {@link MemoryAccessor}.
The {@code MemoryAccessor} will be used to access {@code long}-sized data at addresses {@code (base ... | java | public static long MurmurHash3_x64_64_direct(MemoryAccessor mem, long base, int offset, int len) {
return MurmurHash3_x64_64(mem.isBigEndian() ? NARROW_DIRECT_LOADER : WIDE_DIRECT_LOADER,
mem, base + offset, len, DEFAULT_MURMUR_SEED);
} | [
"public",
"static",
"long",
"MurmurHash3_x64_64_direct",
"(",
"MemoryAccessor",
"mem",
",",
"long",
"base",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"return",
"MurmurHash3_x64_64",
"(",
"mem",
".",
"isBigEndian",
"(",
")",
"?",
"NARROW_DIRECT_LOADER",
... | Returns the {@code MurmurHash3_x64_64} hash of a memory block accessed by the provided {@link MemoryAccessor}.
The {@code MemoryAccessor} will be used to access {@code long}-sized data at addresses {@code (base + offset)},
{@code (base + offset + 8)}, etc. The caller must ensure that the {@code MemoryAccessor} supports... | [
"Returns",
"the",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/HashUtil.java#L153-L156 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsPreEditorAction.java | CmsPreEditorAction.sendForwardToEditor | public static void sendForwardToEditor(CmsDialog dialog, Map<String, String[]> additionalParams) {
"""
Forwards to the editor and opens it after the action was performed.<p>
@param dialog the dialog instance forwarding to the editor
@param additionalParams eventual additional request parameters for the editor ... | java | public static void sendForwardToEditor(CmsDialog dialog, Map<String, String[]> additionalParams) {
// create the Map of original request parameters
Map<String, String[]> params = CmsRequestUtil.createParameterMap(dialog.getParamOriginalParams());
// put the parameter indicating that the pre edi... | [
"public",
"static",
"void",
"sendForwardToEditor",
"(",
"CmsDialog",
"dialog",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"additionalParams",
")",
"{",
"// create the Map of original request parameters",
"Map",
"<",
"String",
",",
"String",
"[",
"]",... | Forwards to the editor and opens it after the action was performed.<p>
@param dialog the dialog instance forwarding to the editor
@param additionalParams eventual additional request parameters for the editor to use | [
"Forwards",
"to",
"the",
"editor",
"and",
"opens",
"it",
"after",
"the",
"action",
"was",
"performed",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsPreEditorAction.java#L119-L138 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_attachedDomain_POST | public OvhTask serviceName_attachedDomain_POST(String serviceName, OvhCdnEnum cdn, String domain, OvhFirewallEnum firewall, String ownLog, String path, Long runtimeId, Boolean ssl) throws IOException {
"""
Link a domain to this hosting
REST: POST /hosting/web/{serviceName}/attachedDomain
@param cdn [required] ... | java | public OvhTask serviceName_attachedDomain_POST(String serviceName, OvhCdnEnum cdn, String domain, OvhFirewallEnum firewall, String ownLog, String path, Long runtimeId, Boolean ssl) throws IOException {
String qPath = "/hosting/web/{serviceName}/attachedDomain";
StringBuilder sb = path(qPath, serviceName);
HashMap... | [
"public",
"OvhTask",
"serviceName_attachedDomain_POST",
"(",
"String",
"serviceName",
",",
"OvhCdnEnum",
"cdn",
",",
"String",
"domain",
",",
"OvhFirewallEnum",
"firewall",
",",
"String",
"ownLog",
",",
"String",
"path",
",",
"Long",
"runtimeId",
",",
"Boolean",
"... | Link a domain to this hosting
REST: POST /hosting/web/{serviceName}/attachedDomain
@param cdn [required] Is linked to the hosting cdn
@param runtimeId [required] The runtime configuration ID linked to this attached domain
@param ownLog [required] Put domain for separate the logs on logs.ovh.net
@param ssl [required] P... | [
"Link",
"a",
"domain",
"to",
"this",
"hosting"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2027-L2040 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.areNotEqual | @NullSafe
private static boolean areNotEqual(Object obj1, Object obj2) {
"""
Evaluate the given {@link Object objects} or equality.
@param obj1 {@link Object} to evaluate for equality with {@link Object object 1}.
@param obj2 {@link Object} to evaluate for equality with {@link Object object 2}.
@return a bo... | java | @NullSafe
private static boolean areNotEqual(Object obj1, Object obj2) {
return obj1 == null || !obj1.equals(obj2);
} | [
"@",
"NullSafe",
"private",
"static",
"boolean",
"areNotEqual",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"return",
"obj1",
"==",
"null",
"||",
"!",
"obj1",
".",
"equals",
"(",
"obj2",
")",
";",
"}"
] | Evaluate the given {@link Object objects} or equality.
@param obj1 {@link Object} to evaluate for equality with {@link Object object 1}.
@param obj2 {@link Object} to evaluate for equality with {@link Object object 2}.
@return a boolean value indicating whether the given {@link Object objects} are equal.
@see java.lan... | [
"Evaluate",
"the",
"given",
"{",
"@link",
"Object",
"objects",
"}",
"or",
"equality",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L330-L333 |
frostwire/frostwire-jlibtorrent | src/main/java/com/frostwire/jlibtorrent/FileStorage.java | FileStorage.filePath | public String filePath(int index, String savePath) {
"""
returns the full path to a file.
@param index
@param savePath
@return
"""
// not calling the corresponding swig function because internally,
// the use of the function GetStringUTFChars does not consider the case of
// a copy... | java | public String filePath(int index, String savePath) {
// not calling the corresponding swig function because internally,
// the use of the function GetStringUTFChars does not consider the case of
// a copy not made
return savePath + File.separator + fs.file_path(index);
} | [
"public",
"String",
"filePath",
"(",
"int",
"index",
",",
"String",
"savePath",
")",
"{",
"// not calling the corresponding swig function because internally,",
"// the use of the function GetStringUTFChars does not consider the case of",
"// a copy not made",
"return",
"savePath",
"+... | returns the full path to a file.
@param index
@param savePath
@return | [
"returns",
"the",
"full",
"path",
"to",
"a",
"file",
"."
] | train | https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/FileStorage.java#L322-L327 |
riversun/finbin | src/main/java/org/riversun/finbin/BigBinarySearcher.java | BigBinarySearcher.searchBigBytes | public List<Integer> searchBigBytes(byte[] srcBytes, byte[] searchBytes) {
"""
Search bytes faster in a concurrent processing.
@param srcBytes
@param searchBytes
@return
"""
int numOfThreadsOptimized = (srcBytes.length / analyzeByteArrayUnitSize);
if (numOfThreadsOptimized == 0) {
numOfThrea... | java | public List<Integer> searchBigBytes(byte[] srcBytes, byte[] searchBytes) {
int numOfThreadsOptimized = (srcBytes.length / analyzeByteArrayUnitSize);
if (numOfThreadsOptimized == 0) {
numOfThreadsOptimized = 1;
}
return searchBigBytes(srcBytes, searchBytes, numOfThreadsOptimized);
} | [
"public",
"List",
"<",
"Integer",
">",
"searchBigBytes",
"(",
"byte",
"[",
"]",
"srcBytes",
",",
"byte",
"[",
"]",
"searchBytes",
")",
"{",
"int",
"numOfThreadsOptimized",
"=",
"(",
"srcBytes",
".",
"length",
"/",
"analyzeByteArrayUnitSize",
")",
";",
"if",
... | Search bytes faster in a concurrent processing.
@param srcBytes
@param searchBytes
@return | [
"Search",
"bytes",
"faster",
"in",
"a",
"concurrent",
"processing",
"."
] | train | https://github.com/riversun/finbin/blob/d1db86a0d2966dcf47087340bbd0727a9d508b3e/src/main/java/org/riversun/finbin/BigBinarySearcher.java#L87-L96 |
stagemonitor/stagemonitor | stagemonitor-configuration/src/main/java/org/stagemonitor/configuration/ConfigurationRegistry.java | ConfigurationRegistry.save | public void save(String key, String value, String configurationSourceName) throws IOException {
"""
Dynamically updates a configuration key.
<p>
Does not perform a password check.
@param key the configuration key
@param value the configuration value
@param confi... | java | public void save(String key, String value, String configurationSourceName) throws IOException {
final ConfigurationOption<?> configurationOption = validateConfigurationOption(key, value);
saveToConfigurationSource(key, value, configurationSourceName, configurationOption);
} | [
"public",
"void",
"save",
"(",
"String",
"key",
",",
"String",
"value",
",",
"String",
"configurationSourceName",
")",
"throws",
"IOException",
"{",
"final",
"ConfigurationOption",
"<",
"?",
">",
"configurationOption",
"=",
"validateConfigurationOption",
"(",
"key",... | Dynamically updates a configuration key.
<p>
Does not perform a password check.
@param key the configuration key
@param value the configuration value
@param configurationSourceName the {@link ConfigurationSource#getName()}
of the configuration source the value should b... | [
"Dynamically",
"updates",
"a",
"configuration",
"key",
".",
"<p",
">",
"Does",
"not",
"perform",
"a",
"password",
"check",
"."
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-configuration/src/main/java/org/stagemonitor/configuration/ConfigurationRegistry.java#L384-L387 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildPackageSerializedForm | public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) {
"""
Build the package serialized form for the current package being processed.
@param node the XML element that specifies which components to document
@param serializedSummariesTree content tree to which the documentation w... | java | public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) {
Content packageSerializedTree = writer.getPackageSerializedHeader();
String foo = currentPackage.name();
ClassDoc[] classes = currentPackage.allClasses(false);
if (classes == null || classes.length ==... | [
"public",
"void",
"buildPackageSerializedForm",
"(",
"XMLNode",
"node",
",",
"Content",
"serializedSummariesTree",
")",
"{",
"Content",
"packageSerializedTree",
"=",
"writer",
".",
"getPackageSerializedHeader",
"(",
")",
";",
"String",
"foo",
"=",
"currentPackage",
".... | Build the package serialized form for the current package being processed.
@param node the XML element that specifies which components to document
@param serializedSummariesTree content tree to which the documentation will be added | [
"Build",
"the",
"package",
"serialized",
"form",
"for",
"the",
"current",
"package",
"being",
"processed",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L180-L195 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SluggishGui.java | SluggishGui.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
overrides the visitor to look for the execution of expensive calls
@param seen
the currently parsed opcode
"""
if ((seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESPECIAL) || (seen == Const.INVOKESTATIC)) ... | java | @Override
public void sawOpcode(int seen) {
if ((seen == Const.INVOKEINTERFACE) || (seen == Const.INVOKEVIRTUAL) || (seen == Const.INVOKESPECIAL) || (seen == Const.INVOKESTATIC)) {
String clsName = getClassConstantOperand();
String mName = getNameConstantOperand();
Strin... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"if",
"(",
"(",
"seen",
"==",
"Const",
".",
"INVOKEINTERFACE",
")",
"||",
"(",
"seen",
"==",
"Const",
".",
"INVOKEVIRTUAL",
")",
"||",
"(",
"seen",
"==",
"Const",
".",
"INV... | overrides the visitor to look for the execution of expensive calls
@param seen
the currently parsed opcode | [
"overrides",
"the",
"visitor",
"to",
"look",
"for",
"the",
"execution",
"of",
"expensive",
"calls"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SluggishGui.java#L170-L189 |
seedstack/business | migrate/src/main/java/org/seedstack/business/view/VirtualList.java | VirtualList.assertSubRange | private void assertSubRange(long from, long to) {
"""
Asserts that the requested sub list is available in the virtual list. Otherwise it throws
an IndexOutOfBoundsException.
@param from the from index (inclusive)
@param to the to index (inclusive)
"""
if (!checkSubRange(from) || !checkSubRange(t... | java | private void assertSubRange(long from, long to) {
if (!checkSubRange(from) || !checkSubRange(to)) {
throw new IndexOutOfBoundsException("Required data for the sub list [" + from + "," + (to + 1) + "[ have "
+ "not been loaded in the virtual list.");
}
} | [
"private",
"void",
"assertSubRange",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"!",
"checkSubRange",
"(",
"from",
")",
"||",
"!",
"checkSubRange",
"(",
"to",
")",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"Required da... | Asserts that the requested sub list is available in the virtual list. Otherwise it throws
an IndexOutOfBoundsException.
@param from the from index (inclusive)
@param to the to index (inclusive) | [
"Asserts",
"that",
"the",
"requested",
"sub",
"list",
"is",
"available",
"in",
"the",
"virtual",
"list",
".",
"Otherwise",
"it",
"throws",
"an",
"IndexOutOfBoundsException",
"."
] | train | https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L116-L121 |
hortonworks/dstream | dstream-api/src/main/java/io/dstream/utils/StringUtils.java | StringUtils.compareLength | public static int compareLength(String a, String b) {
"""
Will compare the length of two strings, maintaining semantics of the
traditional {@link Comparator} by returning <i>int</i>.
@param a first {@link String}
@param b second {@link String}
@return integer value of -1, 0 or 1 following this logic:<br>
<pre... | java | public static int compareLength(String a, String b){
return a.length() > b.length() ? 1 : a.length() < b.length() ? -1 : 0;
} | [
"public",
"static",
"int",
"compareLength",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"return",
"a",
".",
"length",
"(",
")",
">",
"b",
".",
"length",
"(",
")",
"?",
"1",
":",
"a",
".",
"length",
"(",
")",
"<",
"b",
".",
"length",
"(",
... | Will compare the length of two strings, maintaining semantics of the
traditional {@link Comparator} by returning <i>int</i>.
@param a first {@link String}
@param b second {@link String}
@return integer value of -1, 0 or 1 following this logic:<br>
<pre>
a.length() > b.length() ? 1 : a.length() < b.length() ? -1 :... | [
"Will",
"compare",
"the",
"length",
"of",
"two",
"strings",
"maintaining",
"semantics",
"of",
"the",
"traditional",
"{"
] | train | https://github.com/hortonworks/dstream/blob/3a106c0f14725b028fe7fe2dbc660406d9a5f142/dstream-api/src/main/java/io/dstream/utils/StringUtils.java#L37-L39 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/AvatarNode.java | AvatarNode.adjustMetaDirectoryNames | public static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
"""
Append service name to each avatar meta directory name
@param conf configuration of NameNode
@param serviceKey the non-empty name of the name node service
"""
adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR0_KEY,... | java | public static void adjustMetaDirectoryNames(Configuration conf, String serviceKey) {
adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR0_KEY, serviceKey);
adjustMetaDirectoryName(conf, DFS_SHARED_NAME_DIR1_KEY, serviceKey);
adjustMetaDirectoryName(conf, DFS_SHARED_EDITS_DIR0_KEY, serviceKey);
adjustMetaD... | [
"public",
"static",
"void",
"adjustMetaDirectoryNames",
"(",
"Configuration",
"conf",
",",
"String",
"serviceKey",
")",
"{",
"adjustMetaDirectoryName",
"(",
"conf",
",",
"DFS_SHARED_NAME_DIR0_KEY",
",",
"serviceKey",
")",
";",
"adjustMetaDirectoryName",
"(",
"conf",
"... | Append service name to each avatar meta directory name
@param conf configuration of NameNode
@param serviceKey the non-empty name of the name node service | [
"Append",
"service",
"name",
"to",
"each",
"avatar",
"meta",
"directory",
"name"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/namenode/AvatarNode.java#L1598-L1603 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/GanttChartView14.java | GanttChartView14.getFontStyle | protected FontStyle getFontStyle(byte[] data, int offset, Map<Integer, FontBase> fontBases, boolean ignoreBackground) {
"""
Retrieve font details from a block of property data.
@param data property data
@param offset offset into property data
@param fontBases map of font bases
@param ignoreBackground set bac... | java | protected FontStyle getFontStyle(byte[] data, int offset, Map<Integer, FontBase> fontBases, boolean ignoreBackground)
{
//System.out.println(ByteArrayHelper.hexdump(data, offset, 32, false));
Integer index = Integer.valueOf(MPPUtility.getByte(data, offset));
FontBase fontBase = fontBases.get(index... | [
"protected",
"FontStyle",
"getFontStyle",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"Map",
"<",
"Integer",
",",
"FontBase",
">",
"fontBases",
",",
"boolean",
"ignoreBackground",
")",
"{",
"//System.out.println(ByteArrayHelper.hexdump(data, offset, 32, ... | Retrieve font details from a block of property data.
@param data property data
@param offset offset into property data
@param fontBases map of font bases
@param ignoreBackground set background to default values
@return FontStyle instance | [
"Retrieve",
"font",
"details",
"from",
"a",
"block",
"of",
"property",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/GanttChartView14.java#L251-L281 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.displayImage | public void displayImage(String uri, ImageView imageView) {
"""
Adds display image task to execution pool. Image will be set to ImageView when it's turn. <br/>
Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration
configuration} will be used.<br />
<b>NOTE:</b>... | java | public void displayImage(String uri, ImageView imageView) {
displayImage(uri, new ImageViewAware(imageView), null, null, null);
} | [
"public",
"void",
"displayImage",
"(",
"String",
"uri",
",",
"ImageView",
"imageView",
")",
"{",
"displayImage",
"(",
"uri",
",",
"new",
"ImageViewAware",
"(",
"imageView",
")",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Adds display image task to execution pool. Image will be set to ImageView when it's turn. <br/>
Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration
configuration} will be used.<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before th... | [
"Adds",
"display",
"image",
"task",
"to",
"execution",
"pool",
".",
"Image",
"will",
"be",
"set",
"to",
"ImageView",
"when",
"it",
"s",
"turn",
".",
"<br",
"/",
">",
"Default",
"{",
"@linkplain",
"DisplayImageOptions",
"display",
"image",
"options",
"}",
"... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L315-L317 |
strator-dev/greenpepper-open | extensions-external/selenium/src/main/java/com/greenpepper/extensions/selenium/SeleniumRemoteControlFixture.java | SeleniumRemoteControlFixture.assertExpression | public boolean assertExpression(String variableNameExpression, String expectedValue) {
"""
<p>assertExpression.</p>
@param variableNameExpression a {@link java.lang.String} object.
@param expectedValue a {@link java.lang.String} object.
@return a boolean.
"""
Expression expression = new Expression(va... | java | public boolean assertExpression(String variableNameExpression, String expectedValue)
{
Expression expression = new Expression(variableNameExpression);
return expectedValue.equals(this.variables.get(expression.parseVariableName()));
} | [
"public",
"boolean",
"assertExpression",
"(",
"String",
"variableNameExpression",
",",
"String",
"expectedValue",
")",
"{",
"Expression",
"expression",
"=",
"new",
"Expression",
"(",
"variableNameExpression",
")",
";",
"return",
"expectedValue",
".",
"equals",
"(",
... | <p>assertExpression.</p>
@param variableNameExpression a {@link java.lang.String} object.
@param expectedValue a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"assertExpression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper-open/blob/71fd244b4989e9cd2d07ae62dd954a1f2a269a92/extensions-external/selenium/src/main/java/com/greenpepper/extensions/selenium/SeleniumRemoteControlFixture.java#L178-L182 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.ccowPending | @Override
public void ccowPending(CCOWContextManager sender, ContextItems contextItems) {
"""
Callback to handle a polling request from the CCOW context manager.
"""
ccowTransaction = true;
updateCCOWStatus();
setMarshaledContext(contextItems, false, response -> {
if (re... | java | @Override
public void ccowPending(CCOWContextManager sender, ContextItems contextItems) {
ccowTransaction = true;
updateCCOWStatus();
setMarshaledContext(contextItems, false, response -> {
if (response.rejected()) {
sender.setSurveyResponse(response.toString());
... | [
"@",
"Override",
"public",
"void",
"ccowPending",
"(",
"CCOWContextManager",
"sender",
",",
"ContextItems",
"contextItems",
")",
"{",
"ccowTransaction",
"=",
"true",
";",
"updateCCOWStatus",
"(",
")",
";",
"setMarshaledContext",
"(",
"contextItems",
",",
"false",
... | Callback to handle a polling request from the CCOW context manager. | [
"Callback",
"to",
"handle",
"a",
"polling",
"request",
"from",
"the",
"CCOW",
"context",
"manager",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L636-L648 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.createRecipient | public Recipients createRecipient(String accountId, String envelopeId, Recipients recipients) throws ApiException {
"""
Adds one or more recipients to an envelope.
Adds one or more recipients to an envelope. For an in process envelope, one that has been sent and has not been completed or voided, an email is sent... | java | public Recipients createRecipient(String accountId, String envelopeId, Recipients recipients) throws ApiException {
return createRecipient(accountId, envelopeId, recipients, null);
} | [
"public",
"Recipients",
"createRecipient",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"Recipients",
"recipients",
")",
"throws",
"ApiException",
"{",
"return",
"createRecipient",
"(",
"accountId",
",",
"envelopeId",
",",
"recipients",
",",
"null",... | Adds one or more recipients to an envelope.
Adds one or more recipients to an envelope. For an in process envelope, one that has been sent and has not been completed or voided, an email is sent to a new recipient when they are reached in the routing order. If the new recipient's routing order is before or the same... | [
"Adds",
"one",
"or",
"more",
"recipients",
"to",
"an",
"envelope",
".",
"Adds",
"one",
"or",
"more",
"recipients",
"to",
"an",
"envelope",
".",
"For",
"an",
"in",
"process",
"envelope",
"one",
"that",
"has",
"been",
"sent",
"and",
"has",
"not",
"been",
... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L831-L833 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/net/NetworkTopology.java | NetworkTopology.isOnSameRack | public boolean isOnSameRack( Node node1, Node node2) {
"""
Check if two nodes are on the same rack
@param node1 one node
@param node2 another node
@return true if node1 and node2 are pm the same rack; false otherwise
@exception IllegalArgumentException when either node1 or node2 is null, or
node1 or node2 do... | java | public boolean isOnSameRack( Node node1, Node node2) {
if (node1 == null || node2 == null) {
return false;
}
netlock.readLock().lock();
try {
return node1.getParent()==node2.getParent();
} finally {
netlock.readLock().unlock();
}
} | [
"public",
"boolean",
"isOnSameRack",
"(",
"Node",
"node1",
",",
"Node",
"node2",
")",
"{",
"if",
"(",
"node1",
"==",
"null",
"||",
"node2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"netlock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
... | Check if two nodes are on the same rack
@param node1 one node
@param node2 another node
@return true if node1 and node2 are pm the same rack; false otherwise
@exception IllegalArgumentException when either node1 or node2 is null, or
node1 or node2 do not belong to the cluster | [
"Check",
"if",
"two",
"nodes",
"are",
"on",
"the",
"same",
"rack"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetworkTopology.java#L551-L562 |
line/armeria | examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java | HelloServiceImpl.lazyHello | @Override
public void lazyHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
"""
Sends a {@link HelloReply} 3 seconds after receiving a request.
"""
// You can use the event loop for scheduling a task.
RequestContext.current().contextAwareEventLoop().schedule(() -> {... | java | @Override
public void lazyHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) {
// You can use the event loop for scheduling a task.
RequestContext.current().contextAwareEventLoop().schedule(() -> {
responseObserver.onNext(buildReply(toMessage(request.getName())));
... | [
"@",
"Override",
"public",
"void",
"lazyHello",
"(",
"HelloRequest",
"request",
",",
"StreamObserver",
"<",
"HelloReply",
">",
"responseObserver",
")",
"{",
"// You can use the event loop for scheduling a task.",
"RequestContext",
".",
"current",
"(",
")",
".",
"context... | Sends a {@link HelloReply} 3 seconds after receiving a request. | [
"Sends",
"a",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/examples/grpc-service/src/main/java/example/armeria/grpc/HelloServiceImpl.java#L31-L38 |
OpenTSDB/opentsdb | src/query/filter/TagVLiteralOrFilter.java | TagVLiteralOrFilter.resolveTagkName | @Override
public Deferred<byte[]> resolveTagkName(final TSDB tsdb) {
"""
Overridden here so that we can resolve the literal values if we don't have
too many of them AND we're not searching with case insensitivity.
"""
final Config config = tsdb.getConfig();
// resolve tag values if the filter i... | java | @Override
public Deferred<byte[]> resolveTagkName(final TSDB tsdb) {
final Config config = tsdb.getConfig();
// resolve tag values if the filter is NOT case insensitive and there are
// fewer literals than the expansion limit
if (!case_insensitive &&
literals.size() <= config.getInt("ts... | [
"@",
"Override",
"public",
"Deferred",
"<",
"byte",
"[",
"]",
">",
"resolveTagkName",
"(",
"final",
"TSDB",
"tsdb",
")",
"{",
"final",
"Config",
"config",
"=",
"tsdb",
".",
"getConfig",
"(",
")",
";",
"// resolve tag values if the filter is NOT case insensitive an... | Overridden here so that we can resolve the literal values if we don't have
too many of them AND we're not searching with case insensitivity. | [
"Overridden",
"here",
"so",
"that",
"we",
"can",
"resolve",
"the",
"literal",
"values",
"if",
"we",
"don",
"t",
"have",
"too",
"many",
"of",
"them",
"AND",
"we",
"re",
"not",
"searching",
"with",
"case",
"insensitivity",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/query/filter/TagVLiteralOrFilter.java#L100-L112 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/base/GenericDataSinkBase.java | GenericDataSinkBase.setRangePartitioned | public void setRangePartitioned(Ordering partitionOrdering, DataDistribution distribution) {
"""
Sets the sink to partition the records into ranges over the given ordering.
The bucket boundaries are determined using the given data distribution.
@param partitionOrdering The record ordering over which to partiti... | java | public void setRangePartitioned(Ordering partitionOrdering, DataDistribution distribution) {
if (partitionOrdering.getNumberOfFields() != distribution.getNumberOfFields()) {
throw new IllegalArgumentException("The number of keys in the distribution must match number of ordered fields.");
}
// TODO: check co... | [
"public",
"void",
"setRangePartitioned",
"(",
"Ordering",
"partitionOrdering",
",",
"DataDistribution",
"distribution",
")",
"{",
"if",
"(",
"partitionOrdering",
".",
"getNumberOfFields",
"(",
")",
"!=",
"distribution",
".",
"getNumberOfFields",
"(",
")",
")",
"{",
... | Sets the sink to partition the records into ranges over the given ordering.
The bucket boundaries are determined using the given data distribution.
@param partitionOrdering The record ordering over which to partition in ranges.
@param distribution The distribution to use for the range partitioning. | [
"Sets",
"the",
"sink",
"to",
"partition",
"the",
"records",
"into",
"ranges",
"over",
"the",
"given",
"ordering",
".",
"The",
"bucket",
"boundaries",
"are",
"determined",
"using",
"the",
"given",
"data",
"distribution",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/base/GenericDataSinkBase.java#L221-L231 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/MetadataUtils.java | MetadataUtils.setSchemaAndPersistenceUnit | public static void setSchemaAndPersistenceUnit(EntityMetadata m, String schemaStr, Map puProperties) {
"""
Sets the schema and persistence unit.
@param m
the m
@param schemaStr
the schema str
@param puProperties
"""
if (schemaStr.indexOf(Constants.SCHEMA_PERSISTENCE_UNIT_SEPARATOR) > 0)
... | java | public static void setSchemaAndPersistenceUnit(EntityMetadata m, String schemaStr, Map puProperties)
{
if (schemaStr.indexOf(Constants.SCHEMA_PERSISTENCE_UNIT_SEPARATOR) > 0)
{
String schemaName = null;
if (puProperties != null)
{
schemaNa... | [
"public",
"static",
"void",
"setSchemaAndPersistenceUnit",
"(",
"EntityMetadata",
"m",
",",
"String",
"schemaStr",
",",
"Map",
"puProperties",
")",
"{",
"if",
"(",
"schemaStr",
".",
"indexOf",
"(",
"Constants",
".",
"SCHEMA_PERSISTENCE_UNIT_SEPARATOR",
")",
">",
"... | Sets the schema and persistence unit.
@param m
the m
@param schemaStr
the schema str
@param puProperties | [
"Sets",
"the",
"schema",
"and",
"persistence",
"unit",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/MetadataUtils.java#L283-L305 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java | GenomicsFactory.fromServiceAccount | public Genomics fromServiceAccount(String serviceAccountId, File p12File)
throws GeneralSecurityException, IOException {
"""
Create a new genomics stub from the given service account ID and private key {@link File}.
@param serviceAccountId The service account ID (typically an email address)
@param p12Fil... | java | public Genomics fromServiceAccount(String serviceAccountId, File p12File)
throws GeneralSecurityException, IOException {
Preconditions.checkNotNull(serviceAccountId);
Preconditions.checkNotNull(p12File);
return fromServiceAccount(getGenomicsBuilder(), serviceAccountId, p12File).build();
} | [
"public",
"Genomics",
"fromServiceAccount",
"(",
"String",
"serviceAccountId",
",",
"File",
"p12File",
")",
"throws",
"GeneralSecurityException",
",",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"serviceAccountId",
")",
";",
"Preconditions",
".",
"c... | Create a new genomics stub from the given service account ID and private key {@link File}.
@param serviceAccountId The service account ID (typically an email address)
@param p12File The file on disk containing the private key
@return The new {@code Genomics} stub
@throws GeneralSecurityException
@throws IOException | [
"Create",
"a",
"new",
"genomics",
"stub",
"from",
"the",
"given",
"service",
"account",
"ID",
"and",
"private",
"key",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java#L440-L445 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/CrosstabBuilder.java | CrosstabBuilder.setRowStyles | public CrosstabBuilder setRowStyles(Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
"""
Should be called after all rows have been created
@param headerStyle
@param totalStyle
@param totalHeaderStyle
@return
"""
crosstab.setRowHeaderStyle(headerStyle);
crosstab.setRowTotalheaderStyle(to... | java | public CrosstabBuilder setRowStyles(Style headerStyle, Style totalStyle, Style totalHeaderStyle) {
crosstab.setRowHeaderStyle(headerStyle);
crosstab.setRowTotalheaderStyle(totalHeaderStyle);
crosstab.setRowTotalStyle(totalStyle);
return this;
} | [
"public",
"CrosstabBuilder",
"setRowStyles",
"(",
"Style",
"headerStyle",
",",
"Style",
"totalStyle",
",",
"Style",
"totalHeaderStyle",
")",
"{",
"crosstab",
".",
"setRowHeaderStyle",
"(",
"headerStyle",
")",
";",
"crosstab",
".",
"setRowTotalheaderStyle",
"(",
"tot... | Should be called after all rows have been created
@param headerStyle
@param totalStyle
@param totalHeaderStyle
@return | [
"Should",
"be",
"called",
"after",
"all",
"rows",
"have",
"been",
"created"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/CrosstabBuilder.java#L385-L390 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.checkTransactions | private void checkTransactions(final int height, final EnumSet<VerifyFlag> flags)
throws VerificationException {
"""
Verify the transactions on a block.
@param height block height, if known, or -1 otherwise. If provided, used
to validate the coinbase input script of v2 and above blocks.
@throws Ve... | java | private void checkTransactions(final int height, final EnumSet<VerifyFlag> flags)
throws VerificationException {
// The first transaction in a block must always be a coinbase transaction.
if (!transactions.get(0).isCoinBase())
throw new VerificationException("First tx is not coin... | [
"private",
"void",
"checkTransactions",
"(",
"final",
"int",
"height",
",",
"final",
"EnumSet",
"<",
"VerifyFlag",
">",
"flags",
")",
"throws",
"VerificationException",
"{",
"// The first transaction in a block must always be a coinbase transaction.",
"if",
"(",
"!",
"tra... | Verify the transactions on a block.
@param height block height, if known, or -1 otherwise. If provided, used
to validate the coinbase input script of v2 and above blocks.
@throws VerificationException if there was an error verifying the block. | [
"Verify",
"the",
"transactions",
"on",
"a",
"block",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L686-L699 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getOutput | public OutputStream getOutput(String pathname, boolean append, int chunkSize) throws IOException {
"""
Opens an OutputStream for writing to the file denoted by pathname.
@param pathname the file to write to
@param append if true, the bytes written to the OutputStream will be appended to the end of the file
@par... | java | public OutputStream getOutput(String pathname, boolean append, int chunkSize) throws IOException {
GridFile file = (GridFile) getFile(pathname, chunkSize);
checkIsNotDirectory(file);
createIfNeeded(file);
return new GridOutputStream(file, append, data);
} | [
"public",
"OutputStream",
"getOutput",
"(",
"String",
"pathname",
",",
"boolean",
"append",
",",
"int",
"chunkSize",
")",
"throws",
"IOException",
"{",
"GridFile",
"file",
"=",
"(",
"GridFile",
")",
"getFile",
"(",
"pathname",
",",
"chunkSize",
")",
";",
"ch... | Opens an OutputStream for writing to the file denoted by pathname.
@param pathname the file to write to
@param append if true, the bytes written to the OutputStream will be appended to the end of the file
@param chunkSize the size of the file's chunks. This parameter is honored only when the file at pathname does
not y... | [
"Opens",
"an",
"OutputStream",
"for",
"writing",
"to",
"the",
"file",
"denoted",
"by",
"pathname",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L119-L124 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.chemicalAffectsProteinThroughBinding | public static Pattern chemicalAffectsProteinThroughBinding(Blacklist blacklist) {
"""
A small molecule is in a complex with a protein.
@param blacklist a skip-list of ubiquitous molecules
@return pattern
"""
Pattern p = new Pattern(SmallMoleculeReference.class, "SMR");
p.add(erToPE(), "SMR", "SPE1");
... | java | public static Pattern chemicalAffectsProteinThroughBinding(Blacklist blacklist)
{
Pattern p = new Pattern(SmallMoleculeReference.class, "SMR");
p.add(erToPE(), "SMR", "SPE1");
p.add(notGeneric(), "SPE1");
if (blacklist != null) p.add(new NonUbique(blacklist), "SPE1");
p.add(linkToComplex(), "SPE1", "PE1");
... | [
"public",
"static",
"Pattern",
"chemicalAffectsProteinThroughBinding",
"(",
"Blacklist",
"blacklist",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"SmallMoleculeReference",
".",
"class",
",",
"\"SMR\"",
")",
";",
"p",
".",
"add",
"(",
"erToPE",
"(",
"... | A small molecule is in a complex with a protein.
@param blacklist a skip-list of ubiquitous molecules
@return pattern | [
"A",
"small",
"molecule",
"is",
"in",
"a",
"complex",
"with",
"a",
"protein",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L527-L542 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.setPointAt | public final boolean setPointAt(int groupIndex, int indexInGroup, Point2D<?, ?> point, boolean canonize) {
"""
Set the specified point at the given index in the specified group.
@param groupIndex is the index of the group
@param indexInGroup is the index of the ponit in the group (0 for the
first point of the... | java | public final boolean setPointAt(int groupIndex, int indexInGroup, Point2D<?, ?> point, boolean canonize) {
return setPointAt(groupIndex, indexInGroup, point.getX(), point.getY(), canonize);
} | [
"public",
"final",
"boolean",
"setPointAt",
"(",
"int",
"groupIndex",
",",
"int",
"indexInGroup",
",",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
",",
"boolean",
"canonize",
")",
"{",
"return",
"setPointAt",
"(",
"groupIndex",
",",
"indexInGroup",
",",
"... | Set the specified point at the given index in the specified group.
@param groupIndex is the index of the group
@param indexInGroup is the index of the ponit in the group (0 for the
first point of the group...).
@param point is the new value.
@param canonize indicates if the function {@link #canonize(int)} must be call... | [
"Set",
"the",
"specified",
"point",
"at",
"the",
"given",
"index",
"in",
"the",
"specified",
"group",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L1081-L1083 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java | HashUtils.getFileSHA256String | public static String getFileSHA256String(File file) throws IOException {
"""
Calculate SHA-256 hash of a File
@param file - the File to hash
@return the SHA-256 hash value
@throws IOException
"""
MessageDigest messageDigest = getMessageDigest(SHA256);
return getFileHashString(file, message... | java | public static String getFileSHA256String(File file) throws IOException {
MessageDigest messageDigest = getMessageDigest(SHA256);
return getFileHashString(file, messageDigest);
} | [
"public",
"static",
"String",
"getFileSHA256String",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"MessageDigest",
"messageDigest",
"=",
"getMessageDigest",
"(",
"SHA256",
")",
";",
"return",
"getFileHashString",
"(",
"file",
",",
"messageDigest",
")",
... | Calculate SHA-256 hash of a File
@param file - the File to hash
@return the SHA-256 hash value
@throws IOException | [
"Calculate",
"SHA",
"-",
"256",
"hash",
"of",
"a",
"File"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/HashUtils.java#L70-L73 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.invokeConstructor | public static <T> T invokeConstructor(Class<T> classThatContainsTheConstructorToTest, Class<?>[] parameterTypes,
Object[] arguments) throws Exception {
"""
Invoke a constructor. Useful for testing classes with a private
constructor when PowerMock cannot determine which co... | java | public static <T> T invokeConstructor(Class<T> classThatContainsTheConstructorToTest, Class<?>[] parameterTypes,
Object[] arguments) throws Exception {
if (parameterTypes != null && arguments != null) {
if (parameterTypes.length != arguments.length) {
... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeConstructor",
"(",
"Class",
"<",
"T",
">",
"classThatContainsTheConstructorToTest",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"Exception",
"{",... | Invoke a constructor. Useful for testing classes with a private
constructor when PowerMock cannot determine which constructor to invoke.
This only happens if you have two constructors with the same number of
arguments where one is using primitive data types and the other is using
the wrapped counter part. For example:
... | [
"Invoke",
"a",
"constructor",
".",
"Useful",
"for",
"testing",
"classes",
"with",
"a",
"private",
"constructor",
"when",
"PowerMock",
"cannot",
"determine",
"which",
"constructor",
"to",
"invoke",
".",
"This",
"only",
"happens",
"if",
"you",
"have",
"two",
"co... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L1247-L1263 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java | AbstractDoclet.generateClassFiles | protected void generateClassFiles(DocletEnvironment docEnv, ClassTree classtree)
throws DocletException {
"""
Iterate through all classes and construct documentation for them.
@param docEnv the DocletEnvironment
@param classtree the data structure representing the class tree
@throws DocletExc... | java | protected void generateClassFiles(DocletEnvironment docEnv, ClassTree classtree)
throws DocletException {
generateClassFiles(classtree);
SortedSet<PackageElement> packages = new TreeSet<>(utils.makePackageComparator());
packages.addAll(configuration.getSpecifiedPackageElements());
... | [
"protected",
"void",
"generateClassFiles",
"(",
"DocletEnvironment",
"docEnv",
",",
"ClassTree",
"classtree",
")",
"throws",
"DocletException",
"{",
"generateClassFiles",
"(",
"classtree",
")",
";",
"SortedSet",
"<",
"PackageElement",
">",
"packages",
"=",
"new",
"T... | Iterate through all classes and construct documentation for them.
@param docEnv the DocletEnvironment
@param classtree the data structure representing the class tree
@throws DocletException if there is a problem while generating the documentation | [
"Iterate",
"through",
"all",
"classes",
"and",
"construct",
"documentation",
"for",
"them",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java#L266-L275 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java | FilterQuery.addMultipleValuesFilter | public void addMultipleValuesFilter(String field, Set<String> valueToFilter) {
"""
add a filter with multiple values to build FilterQuery instance
@param field
@param valueToFilter
"""
if(!valueToFilter.isEmpty()){
filterQueries.put(field, new FilterFieldValue(field, valueToFilter));
... | java | public void addMultipleValuesFilter(String field, Set<String> valueToFilter){
if(!valueToFilter.isEmpty()){
filterQueries.put(field, new FilterFieldValue(field, valueToFilter));
}
} | [
"public",
"void",
"addMultipleValuesFilter",
"(",
"String",
"field",
",",
"Set",
"<",
"String",
">",
"valueToFilter",
")",
"{",
"if",
"(",
"!",
"valueToFilter",
".",
"isEmpty",
"(",
")",
")",
"{",
"filterQueries",
".",
"put",
"(",
"field",
",",
"new",
"F... | add a filter with multiple values to build FilterQuery instance
@param field
@param valueToFilter | [
"add",
"a",
"filter",
"with",
"multiple",
"values",
"to",
"build",
"FilterQuery",
"instance"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java#L105-L109 |
paypal/SeLion | client/src/main/java/com/paypal/selion/reports/services/ReporterConfigMetadata.java | ReporterConfigMetadata.addReporterMetadataItem | public static void addReporterMetadataItem(String key, String itemType, String value) {
"""
Adds an new item to the reporter metadata.
@param key
- A {@link String} that represents the property name contained in JsonRuntimeReporter file.
@param itemType
- A {@link String} that represents the (supported) type... | java | public static void addReporterMetadataItem(String key, String itemType, String value) {
logger.entering(new Object[] { key, itemType, value });
if (StringUtils.isNotBlank(value) && supportedMetaDataProperties.contains(itemType)) {
Map<String, String> subMap = reporterMetadata.get(key);
... | [
"public",
"static",
"void",
"addReporterMetadataItem",
"(",
"String",
"key",
",",
"String",
"itemType",
",",
"String",
"value",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"key",
",",
"itemType",
",",
"value",
"}",
")",
";",... | Adds an new item to the reporter metadata.
@param key
- A {@link String} that represents the property name contained in JsonRuntimeReporter file.
@param itemType
- A {@link String} that represents the (supported) type of metadata.
@param value
- A {@link String} that represents the reader friendly value to be displaye... | [
"Adds",
"an",
"new",
"item",
"to",
"the",
"reporter",
"metadata",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/reports/services/ReporterConfigMetadata.java#L68-L83 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.findSuperMethod | public static Optional<MethodSymbol> findSuperMethod(MethodSymbol methodSymbol, Types types) {
"""
Finds (if it exists) first (in the class hierarchy) non-interface super method of given {@code
method}.
"""
return findSuperMethods(methodSymbol, types, /* skipInterfaces= */ true).findFirst();
} | java | public static Optional<MethodSymbol> findSuperMethod(MethodSymbol methodSymbol, Types types) {
return findSuperMethods(methodSymbol, types, /* skipInterfaces= */ true).findFirst();
} | [
"public",
"static",
"Optional",
"<",
"MethodSymbol",
">",
"findSuperMethod",
"(",
"MethodSymbol",
"methodSymbol",
",",
"Types",
"types",
")",
"{",
"return",
"findSuperMethods",
"(",
"methodSymbol",
",",
"types",
",",
"/* skipInterfaces= */",
"true",
")",
".",
"fin... | Finds (if it exists) first (in the class hierarchy) non-interface super method of given {@code
method}. | [
"Finds",
"(",
"if",
"it",
"exists",
")",
"first",
"(",
"in",
"the",
"class",
"hierarchy",
")",
"non",
"-",
"interface",
"super",
"method",
"of",
"given",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L584-L586 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.retainAll | public static <T> boolean retainAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
"""
Modifies this collection so that it retains only its elements
that are matched according to the specified closure condition. In other words,
removes from this collection all of its ... | java | public static <T> boolean retainAll(Collection<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
Iterator iter = InvokerHelper.asIterator(self);
BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
boolean result = false;
while (iter.hasNext()) ... | [
"public",
"static",
"<",
"T",
">",
"boolean",
"retainAll",
"(",
"Collection",
"<",
"T",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"FirstGenericType",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"Iterator",
"iter",
"=",
"Invok... | Modifies this collection so that it retains only its elements
that are matched according to the specified closure condition. In other words,
removes from this collection all of its elements that don't match.
<pre class="groovyTestCase">def list = ['a', 'b']
list.retainAll { it == 'b' }
assert list == ['b']</pre>
See... | [
"Modifies",
"this",
"collection",
"so",
"that",
"it",
"retains",
"only",
"its",
"elements",
"that",
"are",
"matched",
"according",
"to",
"the",
"specified",
"closure",
"condition",
".",
"In",
"other",
"words",
"removes",
"from",
"this",
"collection",
"all",
"o... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5012-L5024 |
enioka/jqm | jqm-all/jqm-model/src/main/java/com/enioka/jqm/jdbc/DbAdapter.java | DbAdapter.prepare | public void prepare(Properties p, Connection cnx) {
"""
Called after creating the first connection. The adapter should create its caches and do all initialization it requires. Most
importantly, the SQL query cache should be created.
@param cnx
an open ready to use connection to the database.
"""
t... | java | public void prepare(Properties p, Connection cnx)
{
this.tablePrefix = p.getProperty("com.enioka.jqm.jdbc.tablePrefix", "");
queries.putAll(DbImplBase.queries);
for (Map.Entry<String, String> entry : DbImplBase.queries.entrySet())
{
queries.put(entry.getKey(), this.adaptS... | [
"public",
"void",
"prepare",
"(",
"Properties",
"p",
",",
"Connection",
"cnx",
")",
"{",
"this",
".",
"tablePrefix",
"=",
"p",
".",
"getProperty",
"(",
"\"com.enioka.jqm.jdbc.tablePrefix\"",
",",
"\"\"",
")",
";",
"queries",
".",
"putAll",
"(",
"DbImplBase",
... | Called after creating the first connection. The adapter should create its caches and do all initialization it requires. Most
importantly, the SQL query cache should be created.
@param cnx
an open ready to use connection to the database. | [
"Called",
"after",
"creating",
"the",
"first",
"connection",
".",
"The",
"adapter",
"should",
"create",
"its",
"caches",
"and",
"do",
"all",
"initialization",
"it",
"requires",
".",
"Most",
"importantly",
"the",
"SQL",
"query",
"cache",
"should",
"be",
"create... | train | https://github.com/enioka/jqm/blob/391733b8e291404b97c714c3727a241c4a861f98/jqm-all/jqm-model/src/main/java/com/enioka/jqm/jdbc/DbAdapter.java#L94-L102 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java | Http2ConnectionManager.getOrCreatePerRoutePool | private EventLoopPool.PerRouteConnectionPool getOrCreatePerRoutePool(EventLoopPool eventLoopPool, String key) {
"""
Get or creat the per route pool.
@param eventLoopPool the pool that is bound to the eventloop
@param key the route key
@return PerRouteConnectionPool
"""
final EventLoopPoo... | java | private EventLoopPool.PerRouteConnectionPool getOrCreatePerRoutePool(EventLoopPool eventLoopPool, String key) {
final EventLoopPool.PerRouteConnectionPool perRouteConnectionPool = eventLoopPool.fetchPerRoutePool(key);
if (perRouteConnectionPool != null) {
return perRouteConnectionPool;
... | [
"private",
"EventLoopPool",
".",
"PerRouteConnectionPool",
"getOrCreatePerRoutePool",
"(",
"EventLoopPool",
"eventLoopPool",
",",
"String",
"key",
")",
"{",
"final",
"EventLoopPool",
".",
"PerRouteConnectionPool",
"perRouteConnectionPool",
"=",
"eventLoopPool",
".",
"fetchP... | Get or creat the per route pool.
@param eventLoopPool the pool that is bound to the eventloop
@param key the route key
@return PerRouteConnectionPool | [
"Get",
"or",
"creat",
"the",
"per",
"route",
"pool",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/sender/http2/Http2ConnectionManager.java#L93-L102 |
vatbub/common | updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java | UpdateChecker.downloadAndInstallUpdate | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui, String... params)
throws IllegalStateException, IOException {
"""
Downloads the specified update as a jar-file and launches it. The jar
file will be saved at the same location as the currently executed... | java | public static boolean downloadAndInstallUpdate(UpdateInfo updateToInstall, UpdateProgressDialog gui, String... params)
throws IllegalStateException, IOException {
return downloadAndInstallUpdate(updateToInstall, gui, true, params);
} | [
"public",
"static",
"boolean",
"downloadAndInstallUpdate",
"(",
"UpdateInfo",
"updateToInstall",
",",
"UpdateProgressDialog",
"gui",
",",
"String",
"...",
"params",
")",
"throws",
"IllegalStateException",
",",
"IOException",
"{",
"return",
"downloadAndInstallUpdate",
"(",... | Downloads the specified update as a jar-file and launches it. The jar
file will be saved at the same location as the currently executed file
but will not replace it (unless it has the same filename but this will
never happen). The old app file will be deleted once the updated one is
launched. <b>Please note</b> that th... | [
"Downloads",
"the",
"specified",
"update",
"as",
"a",
"jar",
"-",
"file",
"and",
"launches",
"it",
".",
"The",
"jar",
"file",
"will",
"be",
"saved",
"at",
"the",
"same",
"location",
"as",
"the",
"currently",
"executed",
"file",
"but",
"will",
"not",
"rep... | train | https://github.com/vatbub/common/blob/8b9fd2ece0a23d520ce53b66c84cbd094e378443/updater/src/main/java/com/github/vatbub/common/updater/UpdateChecker.java#L423-L426 |
MenoData/Time4J | base/src/main/java/net/time4j/range/DateInterval.java | DateInterval.toFullDays | public TimestampInterval toFullDays() {
"""
/*[deutsch]
<p>Wandelt diese Instanz in ein Zeitstempelintervall
mit Datumswerten von Mitternacht zu Mitternacht um. </p>
<p>Das Ergebnisintervall ist halb-offen, wenn dieses Intervall
endlich ist. </p>
@return timestamp interval (from midnight to midnight)
@s... | java | public TimestampInterval toFullDays() {
Boundary<PlainTimestamp> b1;
Boundary<PlainTimestamp> b2;
if (this.getStart().isInfinite()) {
b1 = Boundary.infinitePast();
} else {
PlainDate d1 = this.getStart().getTemporal();
PlainTimestamp t1;
... | [
"public",
"TimestampInterval",
"toFullDays",
"(",
")",
"{",
"Boundary",
"<",
"PlainTimestamp",
">",
"b1",
";",
"Boundary",
"<",
"PlainTimestamp",
">",
"b2",
";",
"if",
"(",
"this",
".",
"getStart",
"(",
")",
".",
"isInfinite",
"(",
")",
")",
"{",
"b1",
... | /*[deutsch]
<p>Wandelt diese Instanz in ein Zeitstempelintervall
mit Datumswerten von Mitternacht zu Mitternacht um. </p>
<p>Das Ergebnisintervall ist halb-offen, wenn dieses Intervall
endlich ist. </p>
@return timestamp interval (from midnight to midnight)
@since 2.0 | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Wandelt",
"diese",
"Instanz",
"in",
"ein",
"Zeitstempelintervall",
"mit",
"Datumswerten",
"von",
"Mitternacht",
"zu",
"Mitternacht",
"um",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/DateInterval.java#L535-L568 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Line.java | Line.set | public void set(float sx, float sy, float ex, float ey) {
"""
Configure the line without garbage
@param sx
The x coordinate of the start
@param sy
The y coordinate of the start
@param ex
The x coordiante of the end
@param ey
The y coordinate of the end
"""
super.pointsDirty = true;
start.set(sx... | java | public void set(float sx, float sy, float ex, float ey) {
super.pointsDirty = true;
start.set(sx, sy);
end.set(ex, ey);
float dx = (ex - sx);
float dy = (ey - sy);
vec.set(dx,dy);
lenSquared = (dx * dx) + (dy * dy);
} | [
"public",
"void",
"set",
"(",
"float",
"sx",
",",
"float",
"sy",
",",
"float",
"ex",
",",
"float",
"ey",
")",
"{",
"super",
".",
"pointsDirty",
"=",
"true",
";",
"start",
".",
"set",
"(",
"sx",
",",
"sy",
")",
";",
"end",
".",
"set",
"(",
"ex",... | Configure the line without garbage
@param sx
The x coordinate of the start
@param sy
The y coordinate of the start
@param ex
The x coordiante of the end
@param ey
The y coordinate of the end | [
"Configure",
"the",
"line",
"without",
"garbage"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Line.java#L215-L224 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/refer/Referencer.java | Referencer.setReferencesForOne | public static void setReferencesForOne(IReferences references, Object component)
throws ReferenceException, ConfigException {
"""
Sets references to specific component.
To set references components must implement IReferenceable interface. If they
don't the call to this method has no effect.
@param refere... | java | public static void setReferencesForOne(IReferences references, Object component)
throws ReferenceException, ConfigException {
if (component instanceof IReferenceable)
((IReferenceable) component).setReferences(references);
} | [
"public",
"static",
"void",
"setReferencesForOne",
"(",
"IReferences",
"references",
",",
"Object",
"component",
")",
"throws",
"ReferenceException",
",",
"ConfigException",
"{",
"if",
"(",
"component",
"instanceof",
"IReferenceable",
")",
"(",
"(",
"IReferenceable",
... | Sets references to specific component.
To set references components must implement IReferenceable interface. If they
don't the call to this method has no effect.
@param references the references to be set.
@param component the component to set references to.
@throws ReferenceException when no references found.
@thro... | [
"Sets",
"references",
"to",
"specific",
"component",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/refer/Referencer.java#L25-L30 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgElement | public static Element svgElement(Document document, String name) {
"""
Create a SVG element in appropriate namespace
@param document containing document
@param name node name
@return new SVG element.
"""
return document.createElementNS(SVGConstants.SVG_NAMESPACE_URI, name);
} | java | public static Element svgElement(Document document, String name) {
return document.createElementNS(SVGConstants.SVG_NAMESPACE_URI, name);
} | [
"public",
"static",
"Element",
"svgElement",
"(",
"Document",
"document",
",",
"String",
"name",
")",
"{",
"return",
"document",
".",
"createElementNS",
"(",
"SVGConstants",
".",
"SVG_NAMESPACE_URI",
",",
"name",
")",
";",
"}"
] | Create a SVG element in appropriate namespace
@param document containing document
@param name node name
@return new SVG element. | [
"Create",
"a",
"SVG",
"element",
"in",
"appropriate",
"namespace"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L283-L285 |
redbox-mint/redbox | plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java | CurationManager.reharvest | private void reharvest(JsonSimple response, JsonSimple message) {
"""
Generate a fairly common list of orders to transform and index an object.
This mirrors the traditional tool chain.
@param message
The response to modify
@param message
The message we received
"""
String oid = message.getString(null,... | java | private void reharvest(JsonSimple response, JsonSimple message) {
String oid = message.getString(null, "oid");
try {
if (oid != null) {
setRenderFlag(oid);
// Transformer config
JsonSimple itemConfig = getConfigFromStorage(oid);
if (itemConfig == null) {
log.error("Error accessing item con... | [
"private",
"void",
"reharvest",
"(",
"JsonSimple",
"response",
",",
"JsonSimple",
"message",
")",
"{",
"String",
"oid",
"=",
"message",
".",
"getString",
"(",
"null",
",",
"\"oid\"",
")",
";",
"try",
"{",
"if",
"(",
"oid",
"!=",
"null",
")",
"{",
"setR... | Generate a fairly common list of orders to transform and index an object.
This mirrors the traditional tool chain.
@param message
The response to modify
@param message
The message we received | [
"Generate",
"a",
"fairly",
"common",
"list",
"of",
"orders",
"to",
"transform",
"and",
"index",
"an",
"object",
".",
"This",
"mirrors",
"the",
"traditional",
"tool",
"chain",
"."
] | train | https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/CurationManager.java#L1526-L1552 |
casmi/casmi | src/main/java/casmi/graphics/Graphics.java | Graphics.setDirectionalLight | public void setDirectionalLight(int i, Color color, boolean enableColor, Vector3D v) {
"""
Sets the color value and the position of the No.i directionalLight
"""
float directionalColor[] = {
(float)color.getRed(),
(float)color.getGreen(),
(float)color.getBlue(),
... | java | public void setDirectionalLight(int i, Color color, boolean enableColor, Vector3D v) {
float directionalColor[] = {
(float)color.getRed(),
(float)color.getGreen(),
(float)color.getBlue(),
(float)color.getAlpha()
};
float pos[] = { (float)v.getX(), (flo... | [
"public",
"void",
"setDirectionalLight",
"(",
"int",
"i",
",",
"Color",
"color",
",",
"boolean",
"enableColor",
",",
"Vector3D",
"v",
")",
"{",
"float",
"directionalColor",
"[",
"]",
"=",
"{",
"(",
"float",
")",
"color",
".",
"getRed",
"(",
")",
",",
"... | Sets the color value and the position of the No.i directionalLight | [
"Sets",
"the",
"color",
"value",
"and",
"the",
"position",
"of",
"the",
"No",
".",
"i",
"directionalLight"
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/Graphics.java#L528-L540 |
motown-io/motown | operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/TransactionEventListener.java | TransactionEventListener.toOperatorApiMeterValue | private io.motown.operatorapi.viewmodel.persistence.entities.MeterValue toOperatorApiMeterValue(MeterValue meterValue) {
"""
Converts the Core API's {@code MeterValue} to an Operator API's {@code MeterValue}.
@param meterValue the Core API {@code MeterValue}.
@return the Operator API {@code MeterValue}.
@thro... | java | private io.motown.operatorapi.viewmodel.persistence.entities.MeterValue toOperatorApiMeterValue(MeterValue meterValue) {
String value;
switch (meterValue.getUnit()) {
case WATT_HOUR:
value = meterValue.getValue();
break;
case KILOWATT_HOUR:
... | [
"private",
"io",
".",
"motown",
".",
"operatorapi",
".",
"viewmodel",
".",
"persistence",
".",
"entities",
".",
"MeterValue",
"toOperatorApiMeterValue",
"(",
"MeterValue",
"meterValue",
")",
"{",
"String",
"value",
";",
"switch",
"(",
"meterValue",
".",
"getUnit... | Converts the Core API's {@code MeterValue} to an Operator API's {@code MeterValue}.
@param meterValue the Core API {@code MeterValue}.
@return the Operator API {@code MeterValue}.
@throws AssertionError if an unexpected {@code UnitOfMeasure} is encountered. | [
"Converts",
"the",
"Core",
"API",
"s",
"{",
"@code",
"MeterValue",
"}",
"to",
"an",
"Operator",
"API",
"s",
"{",
"@code",
"MeterValue",
"}",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/TransactionEventListener.java#L123-L138 |
greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.find | public T find(String key, Object val, CacheLoader<T> loader) {
"""
Seeks the item from the cache that is identified by the specified key having
the specified value. If no match is found, the specified loader will be called to
place an item in the cache. You may pass in <code>null</code> for the loader.
If you ... | java | public T find(String key, Object val, CacheLoader<T> loader) {
return find(key, val, loader, null, null);
} | [
"public",
"T",
"find",
"(",
"String",
"key",
",",
"Object",
"val",
",",
"CacheLoader",
"<",
"T",
">",
"loader",
")",
"{",
"return",
"find",
"(",
"key",
",",
"val",
",",
"loader",
",",
"null",
",",
"null",
")",
";",
"}"
] | Seeks the item from the cache that is identified by the specified key having
the specified value. If no match is found, the specified loader will be called to
place an item in the cache. You may pass in <code>null</code> for the loader.
If you do, only an object in active memory will be returned.
@param key the name o... | [
"Seeks",
"the",
"item",
"from",
"the",
"cache",
"that",
"is",
"identified",
"by",
"the",
"specified",
"key",
"having",
"the",
"specified",
"value",
".",
"If",
"no",
"match",
"is",
"found",
"the",
"specified",
"loader",
"will",
"be",
"called",
"to",
"place"... | train | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L241-L243 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/CertificateWriter.java | CertificateWriter.writeInDerFormat | public static void writeInDerFormat(final X509Certificate certificate, final @NonNull File file)
throws IOException, CertificateEncodingException {
"""
Write the given {@link X509Certificate} into the given {@link File} in the *.der format.
@param certificate
the certificate
@param file
the file to write i... | java | public static void writeInDerFormat(final X509Certificate certificate, final @NonNull File file)
throws IOException, CertificateEncodingException
{
writeInDerFormat(certificate, new FileOutputStream(file));
} | [
"public",
"static",
"void",
"writeInDerFormat",
"(",
"final",
"X509Certificate",
"certificate",
",",
"final",
"@",
"NonNull",
"File",
"file",
")",
"throws",
"IOException",
",",
"CertificateEncodingException",
"{",
"writeInDerFormat",
"(",
"certificate",
",",
"new",
... | Write the given {@link X509Certificate} into the given {@link File} in the *.der format.
@param certificate
the certificate
@param file
the file to write in
@throws IOException
Signals that an I/O exception has occurred.
@throws CertificateEncodingException
is thrown if an encoding error occurs. | [
"Write",
"the",
"given",
"{",
"@link",
"X509Certificate",
"}",
"into",
"the",
"given",
"{",
"@link",
"File",
"}",
"in",
"the",
"*",
".",
"der",
"format",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/writer/CertificateWriter.java#L119-L123 |
oasp/oasp4j | modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java | RestServiceExceptionFacade.createResponse | protected Response createResponse(Status status, NlsRuntimeException error, String message,
Map<String, List<String>> errorsMap) {
"""
Create a response message as a JSON-String from the given parts.
@param status is the HTTP {@link Status}.
@param error is the catched or wrapped {@link NlsRuntimeExcepti... | java | protected Response createResponse(Status status, NlsRuntimeException error, String message,
Map<String, List<String>> errorsMap) {
return createResponse(status, error, message, error.getCode(), errorsMap);
} | [
"protected",
"Response",
"createResponse",
"(",
"Status",
"status",
",",
"NlsRuntimeException",
"error",
",",
"String",
"message",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"errorsMap",
")",
"{",
"return",
"createResponse",
"(",
"status"... | Create a response message as a JSON-String from the given parts.
@param status is the HTTP {@link Status}.
@param error is the catched or wrapped {@link NlsRuntimeException}.
@param message is the JSON message attribute.
@param errorsMap is a map with all validation errors
@return the corresponding {@link Response}. | [
"Create",
"a",
"response",
"message",
"as",
"a",
"JSON",
"-",
"String",
"from",
"the",
"given",
"parts",
"."
] | train | https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/rest/src/main/java/io/oasp/module/rest/service/impl/RestServiceExceptionFacade.java#L426-L430 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/http/ReqRspUtil.java | ReqRspUtil.getRequestURL | public static String getRequestURL(HttpServletRequest req, boolean includeQueryString) {
"""
returns the full request URL
@param req - the HttpServletRequest
@param includeQueryString - if true, the QueryString will be appended if one exists
"""
StringBuffer sb = req.getRequestURL();
int maxpos = sb.ind... | java | public static String getRequestURL(HttpServletRequest req, boolean includeQueryString) {
StringBuffer sb = req.getRequestURL();
int maxpos = sb.indexOf("/", 8);
if (maxpos > -1) {
if (req.isSecure()) {
if (sb.substring(maxpos - 4, maxpos).equals(":443")) sb.delete(maxpos - 4, maxpos);
}
else {
... | [
"public",
"static",
"String",
"getRequestURL",
"(",
"HttpServletRequest",
"req",
",",
"boolean",
"includeQueryString",
")",
"{",
"StringBuffer",
"sb",
"=",
"req",
".",
"getRequestURL",
"(",
")",
";",
"int",
"maxpos",
"=",
"sb",
".",
"indexOf",
"(",
"\"/\"",
... | returns the full request URL
@param req - the HttpServletRequest
@param includeQueryString - if true, the QueryString will be appended if one exists | [
"returns",
"the",
"full",
"request",
"URL"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/http/ReqRspUtil.java#L493-L511 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.createAlias | public Criteria createAlias(String associationPath, String alias) {
"""
Join an association, assigning an alias to the joined association.
Functionally equivalent to createAlias(String, String, int) using
CriteriaSpecificationINNER_JOIN for the joinType.
@param associationPath A dot-seperated property path
... | java | public Criteria createAlias(String associationPath, String alias) {
return criteria.createAlias(associationPath, alias);
} | [
"public",
"Criteria",
"createAlias",
"(",
"String",
"associationPath",
",",
"String",
"alias",
")",
"{",
"return",
"criteria",
".",
"createAlias",
"(",
"associationPath",
",",
"alias",
")",
";",
"}"
] | Join an association, assigning an alias to the joined association.
Functionally equivalent to createAlias(String, String, int) using
CriteriaSpecificationINNER_JOIN for the joinType.
@param associationPath A dot-seperated property path
@param alias The alias to assign to the joined association (for later reference).
... | [
"Join",
"an",
"association",
"assigning",
"an",
"alias",
"to",
"the",
"joined",
"association",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L574-L576 |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java | EsIndexColumns.noprefix | private String noprefix(String name, String... prefix) {
"""
Cuts name prefix for the pseudo column case.
@param name the name of the column or pseudo column.
@param prefix the list of prefixes to cut.
@return the name without prefix.
"""
for (int i = 0; i < prefix.length; i++) {
if (n... | java | private String noprefix(String name, String... prefix) {
for (int i = 0; i < prefix.length; i++) {
if (name.startsWith(prefix[i])) {
name = name.replaceAll(prefix[i], "");
}
}
return name;
} | [
"private",
"String",
"noprefix",
"(",
"String",
"name",
",",
"String",
"...",
"prefix",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"prefix",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"name",
".",
"startsWith",
"(",
"pref... | Cuts name prefix for the pseudo column case.
@param name the name of the column or pseudo column.
@param prefix the list of prefixes to cut.
@return the name without prefix. | [
"Cuts",
"name",
"prefix",
"for",
"the",
"pseudo",
"column",
"case",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumns.java#L92-L99 |
jboss/jboss-common-beans | src/main/java/org/jboss/common/beans/property/DateEditor.java | DateEditor.setAsText | @Override
public void setAsText(String text) {
"""
Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).
@param text the string date
"""
if (BeanUtils.isNull(text)) {
setValue(null);
return;
}
ParseException pe = null;
... | java | @Override
public void setAsText(String text) {
if (BeanUtils.isNull(text)) {
setValue(null);
return;
}
ParseException pe = null;
for (int i = 0; i < formats.length; i++) {
try {
// try to parse the date
DateFormat d... | [
"@",
"Override",
"public",
"void",
"setAsText",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"BeanUtils",
".",
"isNull",
"(",
"text",
")",
")",
"{",
"setValue",
"(",
"null",
")",
";",
"return",
";",
"}",
"ParseException",
"pe",
"=",
"null",
";",
"for"... | Parse the text into a java.util.Date by trying one by one the registered DateFormat(s).
@param text the string date | [
"Parse",
"the",
"text",
"into",
"a",
"java",
".",
"util",
".",
"Date",
"by",
"trying",
"one",
"by",
"one",
"the",
"registered",
"DateFormat",
"(",
"s",
")",
"."
] | train | https://github.com/jboss/jboss-common-beans/blob/ffb48b1719762534bf92d762eadf91d1815f6748/src/main/java/org/jboss/common/beans/property/DateEditor.java#L109-L136 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/ExceptionThrower.java | ExceptionThrower.createExceptionMessage | protected String createExceptionMessage(final String message, final Object... messageParameters) {
"""
Create a string message by string format.
@param message
@param messageParameters
@return
"""
if (ArrayUtils.isEmpty(messageParameters)) {
return message;
} else {
... | java | protected String createExceptionMessage(final String message, final Object... messageParameters) {
if (ArrayUtils.isEmpty(messageParameters)) {
return message;
} else {
return String.format(message, messageParameters);
}
} | [
"protected",
"String",
"createExceptionMessage",
"(",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"messageParameters",
")",
"{",
"if",
"(",
"ArrayUtils",
".",
"isEmpty",
"(",
"messageParameters",
")",
")",
"{",
"return",
"message",
";",
"}",
"... | Create a string message by string format.
@param message
@param messageParameters
@return | [
"Create",
"a",
"string",
"message",
"by",
"string",
"format",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/ExceptionThrower.java#L65-L72 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.addDataSerieToHistogram | public void addDataSerieToHistogram(String histogramID, double[] dataSerie, int binsCount) {
"""
Adds data to the histogram.
Given the number of bins, this will show a count on the number of
times a value is repeated. For example:
[1,2,3,1,1,3], and bins = 3
Will provide:
_
| | _
| | _ | |
_|_||_||_|_
... | java | public void addDataSerieToHistogram(String histogramID, double[] dataSerie, int binsCount){
if (this.histograms.containsKey(histogramID)) {
this.histograms.get(histogramID).addSeries(dataSerie, binsCount, histogramID, null);
}
} | [
"public",
"void",
"addDataSerieToHistogram",
"(",
"String",
"histogramID",
",",
"double",
"[",
"]",
"dataSerie",
",",
"int",
"binsCount",
")",
"{",
"if",
"(",
"this",
".",
"histograms",
".",
"containsKey",
"(",
"histogramID",
")",
")",
"{",
"this",
".",
"h... | Adds data to the histogram.
Given the number of bins, this will show a count on the number of
times a value is repeated. For example:
[1,2,3,1,1,3], and bins = 3
Will provide:
_
| | _
| | _ | |
_|_||_||_|_
If the number of different values is different from the number of bins,
then each bin will represent the numbe... | [
"Adds",
"data",
"to",
"the",
"histogram",
".",
"Given",
"the",
"number",
"of",
"bins",
"this",
"will",
"show",
"a",
"count",
"on",
"the",
"number",
"of",
"times",
"a",
"value",
"is",
"repeated",
".",
"For",
"example",
":",
"[",
"1",
"2",
"3",
"1",
... | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L416-L420 |
alkacon/opencms-core | src/org/opencms/search/documents/CmsDocumentDependency.java | CmsDocumentDependency.readFromContext | private static CmsDocumentDependency readFromContext(CmsObject cms, String rootPath) {
"""
Reads the dependency object for the given root path in the OpenCms runtime context.<p>
@param cms the current OpenCms user context
@param rootPath the root path to look up the dependency object for
@return the deps
... | java | private static CmsDocumentDependency readFromContext(CmsObject cms, String rootPath) {
return (CmsDocumentDependency)cms.getRequestContext().getAttribute(getAttributeKey(rootPath));
} | [
"private",
"static",
"CmsDocumentDependency",
"readFromContext",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
")",
"{",
"return",
"(",
"CmsDocumentDependency",
")",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getAttribute",
"(",
"getAttributeKey",
"(",
... | Reads the dependency object for the given root path in the OpenCms runtime context.<p>
@param cms the current OpenCms user context
@param rootPath the root path to look up the dependency object for
@return the deps | [
"Reads",
"the",
"dependency",
"object",
"for",
"the",
"given",
"root",
"path",
"in",
"the",
"OpenCms",
"runtime",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/documents/CmsDocumentDependency.java#L405-L408 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java | ArrayList.addAll | public boolean addAll(int index, Collection<? extends E> c) {
"""
Inserts all of the elements in the specified collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new eleme... | java | public boolean addAll(int index, Collection<? extends E> c) {
if (index > size || index < 0)
throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
Object[] a = c.toArray();
int numNew = a.length;
ensureCapacityInternal(size + numNew); // Increments modCount
i... | [
"public",
"boolean",
"addAll",
"(",
"int",
"index",
",",
"Collection",
"<",
"?",
"extends",
"E",
">",
"c",
")",
"{",
"if",
"(",
"index",
">",
"size",
"||",
"index",
"<",
"0",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"outOfBoundsMsg",
"(",
... | Inserts all of the elements in the specified collection into this
list, starting at the specified position. Shifts the element
currently at that position (if any) and any subsequent elements to
the right (increases their indices). The new elements will appear
in the list in the order that they are returned by the
spe... | [
"Inserts",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"collection",
"into",
"this",
"list",
"starting",
"at",
"the",
"specified",
"position",
".",
"Shifts",
"the",
"element",
"currently",
"at",
"that",
"position",
"(",
"if",
"any",
")",
"and",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayList.java#L611-L627 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java | StorageAccountsInner.updateAsync | public Observable<StorageAccountInner> updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) {
"""
The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. On... | java | public Observable<StorageAccountInner> updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParameters parameters) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1<ServiceResponse<StorageAccountInner>, StorageAccountInner>() {
... | [
"public",
"Observable",
"<",
"StorageAccountInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"StorageAccountUpdateParameters",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom doma... | [
"The",
"update",
"operation",
"can",
"be",
"used",
"to",
"update",
"the",
"SKU",
"encryption",
"access",
"tier",
"or",
"tags",
"for",
"a",
"storage",
"account",
".",
"It",
"can",
"also",
"be",
"used",
"to",
"map",
"the",
"account",
"to",
"a",
"custom",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L598-L605 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.