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 |
|---|---|---|---|---|---|---|---|---|---|---|
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java | UnsafeOperations.deepCopyArrayField | public final void deepCopyArrayField(Object obj, Object copy, Field field, IdentityHashMap<Object, Object> referencesToReuse) {
"""
Copies the array of the specified type from the given field in the source object
to the same field in the copy, visiting the array during the copy so that its contents are also copi... | java | public final void deepCopyArrayField(Object obj, Object copy, Field field, IdentityHashMap<Object, Object> referencesToReuse) {
deepCopyArrayAtOffset(obj, copy, field.getType(), getObjectFieldOffset(field), referencesToReuse);
} | [
"public",
"final",
"void",
"deepCopyArrayField",
"(",
"Object",
"obj",
",",
"Object",
"copy",
",",
"Field",
"field",
",",
"IdentityHashMap",
"<",
"Object",
",",
"Object",
">",
"referencesToReuse",
")",
"{",
"deepCopyArrayAtOffset",
"(",
"obj",
",",
"copy",
","... | Copies the array of the specified type from the given field in the source object
to the same field in the copy, visiting the array during the copy so that its contents are also copied
@param obj The object to copy from
@param copy The target object
@param field Field to be copied
@param referencesToReuse An identity m... | [
"Copies",
"the",
"array",
"of",
"the",
"specified",
"type",
"from",
"the",
"given",
"field",
"in",
"the",
"source",
"object",
"to",
"the",
"same",
"field",
"in",
"the",
"copy",
"visiting",
"the",
"array",
"during",
"the",
"copy",
"so",
"that",
"its",
"co... | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/access/unsafe/UnsafeOperations.java#L491-L494 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/Model.java | Model.findFirstByCache | public M findFirstByCache(String cacheName, Object key, String sql, Object... paras) {
"""
Find first model by cache. I recommend add "limit 1" in your sql.
@see #findFirst(String, Object...)
@param cacheName the cache name
@param key the key used to get data from cache
@param sql an SQL statement that may con... | java | public M findFirstByCache(String cacheName, Object key, String sql, Object... paras) {
ICache cache = _getConfig().getCache();
M result = cache.get(cacheName, key);
if (result == null) {
result = findFirst(sql, paras);
cache.put(cacheName, key, result);
}
return result;
} | [
"public",
"M",
"findFirstByCache",
"(",
"String",
"cacheName",
",",
"Object",
"key",
",",
"String",
"sql",
",",
"Object",
"...",
"paras",
")",
"{",
"ICache",
"cache",
"=",
"_getConfig",
"(",
")",
".",
"getCache",
"(",
")",
";",
"M",
"result",
"=",
"cac... | Find first model by cache. I recommend add "limit 1" in your sql.
@see #findFirst(String, Object...)
@param cacheName the cache name
@param key the key used to get data from cache
@param sql an SQL statement that may contain one or more '?' IN parameter placeholders
@param paras the parameters of sql | [
"Find",
"first",
"model",
"by",
"cache",
".",
"I",
"recommend",
"add",
"limit",
"1",
"in",
"your",
"sql",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L967-L975 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.deleteTagAsync | public Observable<Void> deleteTagAsync(UUID projectId, UUID tagId) {
"""
Delete a tag from the project.
@param projectId The project id
@param tagId Id of the tag to be deleted
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful.
... | java | public Observable<Void> deleteTagAsync(UUID projectId, UUID tagId) {
return deleteTagWithServiceResponseAsync(projectId, tagId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body();
... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteTagAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"tagId",
")",
"{",
"return",
"deleteTagWithServiceResponseAsync",
"(",
"projectId",
",",
"tagId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponse",
"... | Delete a tag from the project.
@param projectId The project id
@param tagId Id of the tag to be deleted
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Delete",
"a",
"tag",
"from",
"the",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L717-L724 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java | CmsImportExportUserDialog.getExportUserDialogForGroup | public static CmsImportExportUserDialog getExportUserDialogForGroup(
CmsUUID groupID,
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
"""
Gets an dialog instance for fixed group.<p>
@param groupID id
@param ou ou name
@param window window
@param allowTechnicalF... | java | public static CmsImportExportUserDialog getExportUserDialogForGroup(
CmsUUID groupID,
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, groupID, window, allowTechnicalFieldsExport);
return re... | [
"public",
"static",
"CmsImportExportUserDialog",
"getExportUserDialogForGroup",
"(",
"CmsUUID",
"groupID",
",",
"String",
"ou",
",",
"Window",
"window",
",",
"boolean",
"allowTechnicalFieldsExport",
")",
"{",
"CmsImportExportUserDialog",
"res",
"=",
"new",
"CmsImportExpor... | Gets an dialog instance for fixed group.<p>
@param groupID id
@param ou ou name
@param window window
@param allowTechnicalFieldsExport flag indicates if technical field export option should be available
@return an instance of this class | [
"Gets",
"an",
"dialog",
"instance",
"for",
"fixed",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java#L453-L461 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java | ResourceManager.closeJobManagerConnection | protected void closeJobManagerConnection(JobID jobId, Exception cause) {
"""
This method should be called by the framework once it detects that a currently registered
job manager has failed.
@param jobId identifying the job whose leader shall be disconnected.
@param cause The exception which cause the JobMana... | java | protected void closeJobManagerConnection(JobID jobId, Exception cause) {
JobManagerRegistration jobManagerRegistration = jobManagerRegistrations.remove(jobId);
if (jobManagerRegistration != null) {
final ResourceID jobManagerResourceId = jobManagerRegistration.getJobManagerResourceID();
final JobMasterGatewa... | [
"protected",
"void",
"closeJobManagerConnection",
"(",
"JobID",
"jobId",
",",
"Exception",
"cause",
")",
"{",
"JobManagerRegistration",
"jobManagerRegistration",
"=",
"jobManagerRegistrations",
".",
"remove",
"(",
"jobId",
")",
";",
"if",
"(",
"jobManagerRegistration",
... | This method should be called by the framework once it detects that a currently registered
job manager has failed.
@param jobId identifying the job whose leader shall be disconnected.
@param cause The exception which cause the JobManager failed. | [
"This",
"method",
"should",
"be",
"called",
"by",
"the",
"framework",
"once",
"it",
"detects",
"that",
"a",
"currently",
"registered",
"job",
"manager",
"has",
"failed",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java#L763-L785 |
walkmod/walkmod-core | src/main/java/org/walkmod/WalkModFacade.java | WalkModFacade.removeModules | public void removeModules(List<String> modules) throws Exception {
"""
Removes the module list from the configuration file
@param modules
Module names to remove
@throws Exception
if the walkmod configuration file can't be read.
"""
long startTime = System.currentTimeMillis();
Exception ... | java | public void removeModules(List<String> modules) throws Exception {
long startTime = System.currentTimeMillis();
Exception exception = null;
if (!cfg.exists()) {
init();
}
userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
System.setPr... | [
"public",
"void",
"removeModules",
"(",
"List",
"<",
"String",
">",
"modules",
")",
"throws",
"Exception",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"Exception",
"exception",
"=",
"null",
";",
"if",
"(",
"!",
"cfg",
... | Removes the module list from the configuration file
@param modules
Module names to remove
@throws Exception
if the walkmod configuration file can't be read. | [
"Removes",
"the",
"module",
"list",
"from",
"the",
"configuration",
"file"
] | train | https://github.com/walkmod/walkmod-core/blob/fa79b836894fa00ca4b3e2bd26326a44b778f46f/src/main/java/org/walkmod/WalkModFacade.java#L870-L889 |
lessthanoptimal/ddogleg | src/org/ddogleg/solver/PolynomialSolver.java | PolynomialSolver.createRootFinder | public static PolynomialRoots createRootFinder( RootFinderType type , int maxDegree ) {
"""
Creates a generic polynomial root finding class which will return all real or all real and complex roots
depending on the algorithm selected.
@param type Which algorithm is to be returned.
@param maxDegree Maximum degr... | java | public static PolynomialRoots createRootFinder( RootFinderType type , int maxDegree ) {
switch ( type ) {
case EVD:
return new RootFinderCompanion();
case STURM:
FindRealRootsSturm sturm = new FindRealRootsSturm(maxDegree,-1,1e-10,30,20);
return new WrapRealRootsSturm(sturm);
}
throw new Illeg... | [
"public",
"static",
"PolynomialRoots",
"createRootFinder",
"(",
"RootFinderType",
"type",
",",
"int",
"maxDegree",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"EVD",
":",
"return",
"new",
"RootFinderCompanion",
"(",
")",
";",
"case",
"STURM",
":",
"Fi... | Creates a generic polynomial root finding class which will return all real or all real and complex roots
depending on the algorithm selected.
@param type Which algorithm is to be returned.
@param maxDegree Maximum degree of the polynomial being considered.
@return Root finding algorithm. | [
"Creates",
"a",
"generic",
"polynomial",
"root",
"finding",
"class",
"which",
"will",
"return",
"all",
"real",
"or",
"all",
"real",
"and",
"complex",
"roots",
"depending",
"on",
"the",
"algorithm",
"selected",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/solver/PolynomialSolver.java#L44-L55 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/JvmShutdownSafeguard.java | JvmShutdownSafeguard.installAsShutdownHook | public static void installAsShutdownHook(Logger logger, long delayMillis) {
"""
Installs the safeguard shutdown hook. The maximum time that the JVM is allowed to spend
on shutdown before being killed is the given number of milliseconds.
@param logger The logger to log errors to.
@param delayMillis The de... | java | public static void installAsShutdownHook(Logger logger, long delayMillis) {
checkArgument(delayMillis >= 0, "delay must be >= 0");
// install the blocking shutdown hook
Thread shutdownHook = new JvmShutdownSafeguard(delayMillis);
ShutdownHookUtil.addShutdownHookThread(shutdownHook, JvmShutdownSafeguard.class.g... | [
"public",
"static",
"void",
"installAsShutdownHook",
"(",
"Logger",
"logger",
",",
"long",
"delayMillis",
")",
"{",
"checkArgument",
"(",
"delayMillis",
">=",
"0",
",",
"\"delay must be >= 0\"",
")",
";",
"// install the blocking shutdown hook",
"Thread",
"shutdownHook"... | Installs the safeguard shutdown hook. The maximum time that the JVM is allowed to spend
on shutdown before being killed is the given number of milliseconds.
@param logger The logger to log errors to.
@param delayMillis The delay (in milliseconds) to wait after clean shutdown was stared,
before forcibly terminatin... | [
"Installs",
"the",
"safeguard",
"shutdown",
"hook",
".",
"The",
"maximum",
"time",
"that",
"the",
"JVM",
"is",
"allowed",
"to",
"spend",
"on",
"shutdown",
"before",
"being",
"killed",
"is",
"the",
"given",
"number",
"of",
"milliseconds",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/JvmShutdownSafeguard.java#L112-L118 |
f2prateek/dart | dart/src/main/java/dart/Dart.java | Dart.bindNavigationModel | public static void bindNavigationModel(Object target, Activity source) {
"""
Inject fields annotated with {@link BindExtra} in the specified {@code target} using the {@code
source} {@link android.app.Activity}.
@param target Target class for field binding.
@param source Activity on which IDs will be looked up... | java | public static void bindNavigationModel(Object target, Activity source) {
bindNavigationModel(target, source, Finder.ACTIVITY);
} | [
"public",
"static",
"void",
"bindNavigationModel",
"(",
"Object",
"target",
",",
"Activity",
"source",
")",
"{",
"bindNavigationModel",
"(",
"target",
",",
"source",
",",
"Finder",
".",
"ACTIVITY",
")",
";",
"}"
] | Inject fields annotated with {@link BindExtra} in the specified {@code target} using the {@code
source} {@link android.app.Activity}.
@param target Target class for field binding.
@param source Activity on which IDs will be looked up.
@throws Dart.UnableToInjectException if binding could not be performed.
@see android... | [
"Inject",
"fields",
"annotated",
"with",
"{",
"@link",
"BindExtra",
"}",
"in",
"the",
"specified",
"{",
"@code",
"target",
"}",
"using",
"the",
"{",
"@code",
"source",
"}",
"{",
"@link",
"android",
".",
"app",
".",
"Activity",
"}",
"."
] | train | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/dart/src/main/java/dart/Dart.java#L92-L94 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_mitigation_POST | public OvhMitigationIp ip_mitigation_POST(String ip, String ipOnMitigation) throws IOException {
"""
AntiDDOS option. Add new IP on permanent mitigation
REST: POST /ip/{ip}/mitigation
@param ipOnMitigation [required]
@param ip [required]
"""
String qPath = "/ip/{ip}/mitigation";
StringBuilder sb = pat... | java | public OvhMitigationIp ip_mitigation_POST(String ip, String ipOnMitigation) throws IOException {
String qPath = "/ip/{ip}/mitigation";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "ipOnMitigation", ipOnMitigation);
String resp = exec(qPath, "POST", s... | [
"public",
"OvhMitigationIp",
"ip_mitigation_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnMitigation",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/mitigation\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
... | AntiDDOS option. Add new IP on permanent mitigation
REST: POST /ip/{ip}/mitigation
@param ipOnMitigation [required]
@param ip [required] | [
"AntiDDOS",
"option",
".",
"Add",
"new",
"IP",
"on",
"permanent",
"mitigation"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L795-L802 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaDesktopDriver.java | OperaDesktopDriver.findWidgetByPosition | public QuickWidget findWidgetByPosition(QuickWidgetType type, int windowId, int row, int column) {
"""
Finds widget by specified position. Used for widgets that have a position only, e.g.
treeviewitems and tabs.
@param windowId id of parent window
@param row row of widget within its parent
@param column... | java | public QuickWidget findWidgetByPosition(QuickWidgetType type, int windowId, int row, int column) {
return desktopWindowManager.getQuickWidgetByPos(type, windowId, row, column);
} | [
"public",
"QuickWidget",
"findWidgetByPosition",
"(",
"QuickWidgetType",
"type",
",",
"int",
"windowId",
",",
"int",
"row",
",",
"int",
"column",
")",
"{",
"return",
"desktopWindowManager",
".",
"getQuickWidgetByPos",
"(",
"type",
",",
"windowId",
",",
"row",
",... | Finds widget by specified position. Used for widgets that have a position only, e.g.
treeviewitems and tabs.
@param windowId id of parent window
@param row row of widget within its parent
@param column column of widget within its parent
@return QuickWidget matching, or null if no matching widget is found | [
"Finds",
"widget",
"by",
"specified",
"position",
".",
"Used",
"for",
"widgets",
"that",
"have",
"a",
"position",
"only",
"e",
".",
"g",
".",
"treeviewitems",
"and",
"tabs",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaDesktopDriver.java#L408-L410 |
io7m/jregions | com.io7m.jregions.generators/src/main/java/com/io7m/jregions/generators/PAreaSizeBDGenerator.java | PAreaSizeBDGenerator.create | public static <S> PAreaSizeBDGenerator<S> create() {
"""
@param <S> A phantom type parameter indicating the coordinate space of the
area
@return A generator initialized with useful defaults
"""
final LongGenerator gen = new LongGenerator(0L, Long.MAX_VALUE);
return new PAreaSizeBDGenerator<>(() -> ... | java | public static <S> PAreaSizeBDGenerator<S> create()
{
final LongGenerator gen = new LongGenerator(0L, Long.MAX_VALUE);
return new PAreaSizeBDGenerator<>(() -> new BigDecimal(gen.next().toString()));
} | [
"public",
"static",
"<",
"S",
">",
"PAreaSizeBDGenerator",
"<",
"S",
">",
"create",
"(",
")",
"{",
"final",
"LongGenerator",
"gen",
"=",
"new",
"LongGenerator",
"(",
"0L",
",",
"Long",
".",
"MAX_VALUE",
")",
";",
"return",
"new",
"PAreaSizeBDGenerator",
"<... | @param <S> A phantom type parameter indicating the coordinate space of the
area
@return A generator initialized with useful defaults | [
"@param",
"<S",
">",
"A",
"phantom",
"type",
"parameter",
"indicating",
"the",
"coordinate",
"space",
"of",
"the",
"area"
] | train | https://github.com/io7m/jregions/blob/ae03850b5fa2a5fcbd8788953fba7897d4a88d7c/com.io7m.jregions.generators/src/main/java/com/io7m/jregions/generators/PAreaSizeBDGenerator.java#L56-L60 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.createStreamFailed | public void createStreamFailed(String scope, String streamName) {
"""
This method increments the global counter of failed Stream creations in the system as well as the failed creation
attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream.
"""
DYNAMI... | java | public void createStreamFailed(String scope, String streamName) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(CREATE_STREAM_FAILED), 1);
DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM_FAILED, 1, streamTags(scope, streamName));
} | [
"public",
"void",
"createStreamFailed",
"(",
"String",
"scope",
",",
"String",
"streamName",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"CREATE_STREAM_FAILED",
")",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
... | This method increments the global counter of failed Stream creations in the system as well as the failed creation
attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream. | [
"This",
"method",
"increments",
"the",
"global",
"counter",
"of",
"failed",
"Stream",
"creations",
"in",
"the",
"system",
"as",
"well",
"as",
"the",
"failed",
"creation",
"attempts",
"for",
"this",
"specific",
"Stream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L75-L78 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.newSubject | public Subject newSubject(final String nameIdFormat, final String nameIdValue,
final String recipient, final ZonedDateTime notOnOrAfter,
final String inResponseTo, final ZonedDateTime notBefore) {
"""
New subject subject.
@param nameIdFormat the name i... | java | public Subject newSubject(final String nameIdFormat, final String nameIdValue,
final String recipient, final ZonedDateTime notOnOrAfter,
final String inResponseTo, final ZonedDateTime notBefore) {
val nameID = getNameID(nameIdFormat, nameIdValue);
... | [
"public",
"Subject",
"newSubject",
"(",
"final",
"String",
"nameIdFormat",
",",
"final",
"String",
"nameIdValue",
",",
"final",
"String",
"recipient",
",",
"final",
"ZonedDateTime",
"notOnOrAfter",
",",
"final",
"String",
"inResponseTo",
",",
"final",
"ZonedDateTime... | New subject subject.
@param nameIdFormat the name id format
@param nameIdValue the name id value
@param recipient the recipient
@param notOnOrAfter the not on or after
@param inResponseTo the in response to
@param notBefore the not before
@return the subject | [
"New",
"subject",
"subject",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L410-L415 |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/UnifierUtilities.java | UnifierUtilities.getMGU | public Substitution getMGU(Function first, Function second) {
"""
Computes the Most General Unifier (MGU) for two n-ary atoms.
<p/>
IMPORTANT: Function terms are supported as long as they are not nested.
<p/>
IMPORTANT: handling of AnonymousVariables is questionable --
much is left to UnifierUtilities.apply (... | java | public Substitution getMGU(Function first, Function second) {
SubstitutionImpl mgu = new SubstitutionImpl(termFactory);
if (mgu.composeFunctions(first, second))
return mgu;
return null;
} | [
"public",
"Substitution",
"getMGU",
"(",
"Function",
"first",
",",
"Function",
"second",
")",
"{",
"SubstitutionImpl",
"mgu",
"=",
"new",
"SubstitutionImpl",
"(",
"termFactory",
")",
";",
"if",
"(",
"mgu",
".",
"composeFunctions",
"(",
"first",
",",
"second",
... | Computes the Most General Unifier (MGU) for two n-ary atoms.
<p/>
IMPORTANT: Function terms are supported as long as they are not nested.
<p/>
IMPORTANT: handling of AnonymousVariables is questionable --
much is left to UnifierUtilities.apply (and only one version handles them)
@param first
@param second
@return the s... | [
"Computes",
"the",
"Most",
"General",
"Unifier",
"(",
"MGU",
")",
"for",
"two",
"n",
"-",
"ary",
"atoms",
".",
"<p",
"/",
">",
"IMPORTANT",
":",
"Function",
"terms",
"are",
"supported",
"as",
"long",
"as",
"they",
"are",
"not",
"nested",
".",
"<p",
"... | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/UnifierUtilities.java#L72-L77 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.objectAssignableTo | public static boolean objectAssignableTo(Object object, String className) throws MjdbcException {
"""
Checks if instance can be cast to specified Class
@param object Instance which would be checked
@param className Class name with which it would be checked
@return true if Instance can be cast to specified ... | java | public static boolean objectAssignableTo(Object object, String className) throws MjdbcException {
AssertUtils.assertNotNull(object);
boolean result = false;
Class clazz = null;
try {
clazz = Class.forName(className);
} catch (ClassNotFoundException ex) {
... | [
"public",
"static",
"boolean",
"objectAssignableTo",
"(",
"Object",
"object",
",",
"String",
"className",
")",
"throws",
"MjdbcException",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"object",
")",
";",
"boolean",
"result",
"=",
"false",
";",
"Class",
"clazz"... | Checks if instance can be cast to specified Class
@param object Instance which would be checked
@param className Class name with which it would be checked
@return true if Instance can be cast to specified class
@throws org.midao.jdbc.core.exception.MjdbcException | [
"Checks",
"if",
"instance",
"can",
"be",
"cast",
"to",
"specified",
"Class"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L400-L415 |
apache/incubator-heron | heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java | TopologyBuilder.setBolt | public BoltDeclarer setBolt(String id, IWindowedBolt bolt, Number parallelismHint) throws
IllegalArgumentException {
"""
Define a new bolt in this topology. This defines a windowed bolt, intended
for windowing operations. The {@link IWindowedBolt#execute(TupleWindow)} method
is triggered for each window in... | java | public BoltDeclarer setBolt(String id, IWindowedBolt bolt, Number parallelismHint) throws
IllegalArgumentException {
return setBolt(id, new WindowedBoltExecutor(bolt), parallelismHint);
} | [
"public",
"BoltDeclarer",
"setBolt",
"(",
"String",
"id",
",",
"IWindowedBolt",
"bolt",
",",
"Number",
"parallelismHint",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"setBolt",
"(",
"id",
",",
"new",
"WindowedBoltExecutor",
"(",
"bolt",
")",
",",
"... | Define a new bolt in this topology. This defines a windowed bolt, intended
for windowing operations. The {@link IWindowedBolt#execute(TupleWindow)} method
is triggered for each window interval with the list of current events in the window.
@param id the id of this component. This id is referenced by other components t... | [
"Define",
"a",
"new",
"bolt",
"in",
"this",
"topology",
".",
"This",
"defines",
"a",
"windowed",
"bolt",
"intended",
"for",
"windowing",
"operations",
".",
"The",
"{",
"@link",
"IWindowedBolt#execute",
"(",
"TupleWindow",
")",
"}",
"method",
"is",
"triggered",... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java#L191-L194 |
unbescape/unbescape | src/main/java/org/unbescape/properties/PropertiesEscape.java | PropertiesEscape.escapePropertiesKey | public static void escapePropertiesKey(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>L... | java | public static void escapePropertiesKey(final Reader reader, final Writer writer)
throws IOException {
escapePropertiesKey(reader, writer, PropertiesKeyEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET);
} | [
"public",
"static",
"void",
"escapePropertiesKey",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapePropertiesKey",
"(",
"reader",
",",
"writer",
",",
"PropertiesKeyEscapeLevel",
".",
"LEVEL_2_ALL_NON_ASCII_... | <p>
Perform a Java Properties Key level 2 (basic set and all non-ASCII chars) <strong>escape</strong> operation
on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 2</em> means this method will escape:
</p>
<ul>
<li>The Java Properties Key basic escape set:
<ul>
<li>The <em>Single Escap... | [
"<p",
">",
"Perform",
"a",
"Java",
"Properties",
"Key",
"level",
"2",
"(",
"basic",
"set",
"and",
"all",
"non",
"-",
"ASCII",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/properties/PropertiesEscape.java#L1140-L1143 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jndi/src/com/ibm/ws/jndi/internal/JNDIURLEntry.java | JNDIURLEntry.activate | protected void activate(BundleContext context, Map<String, Object> props) {
"""
Registers the JNDI service for the supplied properties as long as the jndiName and value are set
@param context
@param props The properties containing values for <code>"jndiName"</code> and <code>"value"</code>
"""
fina... | java | protected void activate(BundleContext context, Map<String, Object> props) {
final String jndiName = (String) props.get("jndiName");
final String urlValue = (String) props.get("value");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Registering JNDIU... | [
"protected",
"void",
"activate",
"(",
"BundleContext",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"final",
"String",
"jndiName",
"=",
"(",
"String",
")",
"props",
".",
"get",
"(",
"\"jndiName\"",
")",
";",
"final",
"Stri... | Registers the JNDI service for the supplied properties as long as the jndiName and value are set
@param context
@param props The properties containing values for <code>"jndiName"</code> and <code>"value"</code> | [
"Registers",
"the",
"JNDI",
"service",
"for",
"the",
"supplied",
"properties",
"as",
"long",
"as",
"the",
"jndiName",
"and",
"value",
"are",
"set"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jndi/src/com/ibm/ws/jndi/internal/JNDIURLEntry.java#L81-L115 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/util/json/CDL.java | CDL.toJSONArray | public static JSONArray toJSONArray(JSONArray names, String string) throws JSONException {
"""
Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.
@param names
A JSONArray of strings.
@param string
The comma delimited text.
@return... | java | public static JSONArray toJSONArray(JSONArray names, String string) throws JSONException {
return toJSONArray(names, new JSONTokener(string));
} | [
"public",
"static",
"JSONArray",
"toJSONArray",
"(",
"JSONArray",
"names",
",",
"String",
"string",
")",
"throws",
"JSONException",
"{",
"return",
"toJSONArray",
"(",
"names",
",",
"new",
"JSONTokener",
"(",
"string",
")",
")",
";",
"}"
] | Produce a JSONArray of JSONObjects from a comma delimited text string using a supplied JSONArray as the source of element names.
@param names
A JSONArray of strings.
@param string
The comma delimited text.
@return A JSONArray of JSONObjects.
@throws JSONException | [
"Produce",
"a",
"JSONArray",
"of",
"JSONObjects",
"from",
"a",
"comma",
"delimited",
"text",
"string",
"using",
"a",
"supplied",
"JSONArray",
"as",
"the",
"source",
"of",
"element",
"names",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/json/CDL.java#L167-L169 |
jruby/yecht | src/main/org/yecht/DefaultYAMLParser.java | DefaultYAMLParser.yyparse | public Object yyparse (yyInput yyLex, Object yydebug)
throws java.io.IOException {
"""
the generated parser, with debugging messages.
Maintains a dynamic state and value stack.
@param yyLex scanner.
@param yydebug debug message writer implementing <tt>yyDebug</tt>, or <tt>null</tt>.
@return result of the l... | java | public Object yyparse (yyInput yyLex, Object yydebug)
throws java.io.IOException {
//t this.yydebug = (jay.yydebug.yyDebug)yydebug;
return yyparse(yyLex);
} | [
"public",
"Object",
"yyparse",
"(",
"yyInput",
"yyLex",
",",
"Object",
"yydebug",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"//t this.yydebug = (jay.yydebug.yyDebug)yydebug;",
"return",
"yyparse",
"(",
"yyLex",
")",
";",
"}"
] | the generated parser, with debugging messages.
Maintains a dynamic state and value stack.
@param yyLex scanner.
@param yydebug debug message writer implementing <tt>yyDebug</tt>, or <tt>null</tt>.
@return result of the last reduction, if any. | [
"the",
"generated",
"parser",
"with",
"debugging",
"messages",
".",
"Maintains",
"a",
"dynamic",
"state",
"and",
"value",
"stack",
"."
] | train | https://github.com/jruby/yecht/blob/d745f62de8c10556b8964d78a07d436b65eeb8a9/src/main/org/yecht/DefaultYAMLParser.java#L262-L266 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java | PointCloudUtils.statistics | public static void statistics( List<Point3D_F64> cloud , Point3D_F64 mean , Point3D_F64 stdev ) {
"""
Computes the mean and standard deviation of each axis in the point cloud computed in dependently
@param cloud (Input) Cloud
@param mean (Output) mean of each axis
@param stdev (Output) standard deviation of eac... | java | public static void statistics( List<Point3D_F64> cloud , Point3D_F64 mean , Point3D_F64 stdev ) {
final int N = cloud.size();
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud.get(i);
mean.x += p.x / N;
mean.y += p.y / N;
mean.z += p.z / N;
}
for (int i = 0; i < N; i++) {
Point3D_F64 p = cloud... | [
"public",
"static",
"void",
"statistics",
"(",
"List",
"<",
"Point3D_F64",
">",
"cloud",
",",
"Point3D_F64",
"mean",
",",
"Point3D_F64",
"stdev",
")",
"{",
"final",
"int",
"N",
"=",
"cloud",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0... | Computes the mean and standard deviation of each axis in the point cloud computed in dependently
@param cloud (Input) Cloud
@param mean (Output) mean of each axis
@param stdev (Output) standard deviation of each axis | [
"Computes",
"the",
"mean",
"and",
"standard",
"deviation",
"of",
"each",
"axis",
"in",
"the",
"point",
"cloud",
"computed",
"in",
"dependently"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/cloud/PointCloudUtils.java#L65-L87 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_mailingList_POST | public OvhTask organizationName_service_exchangeService_mailingList_POST(String organizationName, String exchangeService, OvhMailingListDepartRestrictionEnum departRestriction, String displayName, Boolean hiddenFromGAL, OvhMailingListJoinRestrictionEnum joinRestriction, String mailingListAddress, Long maxReceiveSize, L... | java | public OvhTask organizationName_service_exchangeService_mailingList_POST(String organizationName, String exchangeService, OvhMailingListDepartRestrictionEnum departRestriction, String displayName, Boolean hiddenFromGAL, OvhMailingListJoinRestrictionEnum joinRestriction, String mailingListAddress, Long maxReceiveSize, L... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_mailingList_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhMailingListDepartRestrictionEnum",
"departRestriction",
",",
"String",
"displayName",
",",
"Boolean",
"hiddenFromGAL",
"... | Add mailing list
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList
@param senderAuthentification [required] If true sender has to authenticate
@param hiddenFromGAL [required] If true mailing list is hiddend in Global Address List
@param departRestriction [required] Depart restriction ... | [
"Add",
"mailing",
"list"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1522-L1536 |
btrplace/scheduler | api/src/main/java/org/btrplace/plan/event/Action.java | Action.addEvent | public boolean addEvent(Hook k, Event n) {
"""
Add an event to the action.
The moment the event will be executed depends on its hook.
@param k the hook
@param n the event to attach
@return {@code true} iff the event was added
"""
Set<Event> l = events.get(k);
if (l == null) {
... | java | public boolean addEvent(Hook k, Event n) {
Set<Event> l = events.get(k);
if (l == null) {
l = new HashSet<>();
events.put(k, l);
}
return l.add(n);
} | [
"public",
"boolean",
"addEvent",
"(",
"Hook",
"k",
",",
"Event",
"n",
")",
"{",
"Set",
"<",
"Event",
">",
"l",
"=",
"events",
".",
"get",
"(",
"k",
")",
";",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"l",
"=",
"new",
"HashSet",
"<>",
"(",
")",
... | Add an event to the action.
The moment the event will be executed depends on its hook.
@param k the hook
@param n the event to attach
@return {@code true} iff the event was added | [
"Add",
"an",
"event",
"to",
"the",
"action",
".",
"The",
"moment",
"the",
"event",
"will",
"be",
"executed",
"depends",
"on",
"its",
"hook",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/Action.java#L151-L158 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/oracle/AbstractOracleQuery.java | AbstractOracleQuery.connectByNocyclePrior | @WithBridgeMethods(value = OracleQuery.class, castRequired = true)
public C connectByNocyclePrior(Predicate cond) {
"""
CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
@param cond condition
@return the current object
"""
return addFlag(Position.BEFORE_... | java | @WithBridgeMethods(value = OracleQuery.class, castRequired = true)
public C connectByNocyclePrior(Predicate cond) {
return addFlag(Position.BEFORE_ORDER, CONNECT_BY_NOCYCLE_PRIOR, cond);
} | [
"@",
"WithBridgeMethods",
"(",
"value",
"=",
"OracleQuery",
".",
"class",
",",
"castRequired",
"=",
"true",
")",
"public",
"C",
"connectByNocyclePrior",
"(",
"Predicate",
"cond",
")",
"{",
"return",
"addFlag",
"(",
"Position",
".",
"BEFORE_ORDER",
",",
"CONNEC... | CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
@param cond condition
@return the current object | [
"CONNECT",
"BY",
"specifies",
"the",
"relationship",
"between",
"parent",
"rows",
"and",
"child",
"rows",
"of",
"the",
"hierarchy",
"."
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/oracle/AbstractOracleQuery.java#L83-L86 |
morimekta/providence | providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java | Any.wrapMessage | public static <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
Any wrapMessage(@javax.annotation.Nonnull M message) {
"""
Wrap a message into an <code>Any</code> wrapper message. This
will serialize the message using the default binary serializer.
@p... | java | public static <M extends net.morimekta.providence.PMessage<M, F>, F extends net.morimekta.providence.descriptor.PField>
Any wrapMessage(@javax.annotation.Nonnull M message) {
return wrapMessage(message, new net.morimekta.providence.serializer.BinarySerializer());
} | [
"public",
"static",
"<",
"M",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"PMessage",
"<",
"M",
",",
"F",
">",
",",
"F",
"extends",
"net",
".",
"morimekta",
".",
"providence",
".",
"descriptor",
".",
"PField",
">",
"Any",
"wrapMessage",
... | Wrap a message into an <code>Any</code> wrapper message. This
will serialize the message using the default binary serializer.
@param message Wrap this message.
@param <M> The message type
@param <F> The message field type
@return The wrapped message. | [
"Wrap",
"a",
"message",
"into",
"an",
"<code",
">",
"Any<",
"/",
"code",
">",
"wrapper",
"message",
".",
"This",
"will",
"serialize",
"the",
"message",
"using",
"the",
"default",
"binary",
"serializer",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java-gen/net/morimekta/providence/util/Any.java#L530-L533 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/FilteredJobLifecycleListener.java | FilteredJobLifecycleListener.onDeleteJob | @Override public void onDeleteJob(URI deletedJobURI, String deletedJobVersion) {
"""
{@inheritDoc}
NOTE: For this callback only conditions on the URI and version will be used.
"""
JobSpec fakeJobSpec = JobSpec.builder(deletedJobURI).withVersion(deletedJobVersion).build();
if (this.filter.apply(fakeJ... | java | @Override public void onDeleteJob(URI deletedJobURI, String deletedJobVersion) {
JobSpec fakeJobSpec = JobSpec.builder(deletedJobURI).withVersion(deletedJobVersion).build();
if (this.filter.apply(fakeJobSpec)) {
this.delegate.onDeleteJob(deletedJobURI, deletedJobVersion);
}
} | [
"@",
"Override",
"public",
"void",
"onDeleteJob",
"(",
"URI",
"deletedJobURI",
",",
"String",
"deletedJobVersion",
")",
"{",
"JobSpec",
"fakeJobSpec",
"=",
"JobSpec",
".",
"builder",
"(",
"deletedJobURI",
")",
".",
"withVersion",
"(",
"deletedJobVersion",
")",
"... | {@inheritDoc}
NOTE: For this callback only conditions on the URI and version will be used. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/FilteredJobLifecycleListener.java#L54-L59 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java | WebAppSecurityCollaboratorImpl.checkPrecludedAccess | @Override
public WebReply checkPrecludedAccess(WebRequest webRequest, String uriName) {
"""
Access precluded explicitly specified in the security constraints or
by the usage of the com.ibm.ws.webcontainer.security.checkdefaultmethod attribute.
This attribute is set by the web container in ServletWrapper.star... | java | @Override
public WebReply checkPrecludedAccess(WebRequest webRequest, String uriName) {
WebReply webReply = null;
if (webRequest.isAccessPrecluded()) {
webReply = new DenyReply("Access is precluded because security constraints are specified, but the required roles are empty.");
}... | [
"@",
"Override",
"public",
"WebReply",
"checkPrecludedAccess",
"(",
"WebRequest",
"webRequest",
",",
"String",
"uriName",
")",
"{",
"WebReply",
"webReply",
"=",
"null",
";",
"if",
"(",
"webRequest",
".",
"isAccessPrecluded",
"(",
")",
")",
"{",
"webReply",
"="... | Access precluded explicitly specified in the security constraints or
by the usage of the com.ibm.ws.webcontainer.security.checkdefaultmethod attribute.
This attribute is set by the web container in ServletWrapper.startRequest() with the
intent of blocking hackers from crafting an HTTP HEAD method to bypass security con... | [
"Access",
"precluded",
"explicitly",
"specified",
"in",
"the",
"security",
"constraints",
"or",
"by",
"the",
"usage",
"of",
"the",
"com",
".",
"ibm",
".",
"ws",
".",
"webcontainer",
".",
"security",
".",
"checkdefaultmethod",
"attribute",
".",
"This",
"attribu... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/WebAppSecurityCollaboratorImpl.java#L1601-L1618 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/ResAutoLinkReferenceFactoryImpl.java | ResAutoLinkReferenceFactoryImpl.getBindingName | public static String getBindingName(String name) {
"""
Determine the binding name that will be used for a reference name. This
implements basically the same algorithm as "default bindings" in traditional WAS.
"""
// For "java:" names, come up with a reasonable binding name by removing
// "java... | java | public static String getBindingName(String name) {
// For "java:" names, come up with a reasonable binding name by removing
// "java:" and if possible, the scope (e.g., "global") and "env".
if (name.startsWith("java:")) {
int begin = "java:".length();
int index = name.in... | [
"public",
"static",
"String",
"getBindingName",
"(",
"String",
"name",
")",
"{",
"// For \"java:\" names, come up with a reasonable binding name by removing",
"// \"java:\" and if possible, the scope (e.g., \"global\") and \"env\".",
"if",
"(",
"name",
".",
"startsWith",
"(",
"\"ja... | Determine the binding name that will be used for a reference name. This
implements basically the same algorithm as "default bindings" in traditional WAS. | [
"Determine",
"the",
"binding",
"name",
"that",
"will",
"be",
"used",
"for",
"a",
"reference",
"name",
".",
"This",
"implements",
"basically",
"the",
"same",
"algorithm",
"as",
"default",
"bindings",
"in",
"traditional",
"WAS",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/ResAutoLinkReferenceFactoryImpl.java#L65-L84 |
m-m-m/util | resource/src/main/java/net/sf/mmm/util/resource/impl/ClasspathScannerImpl.java | ClasspathScannerImpl.initCache | private synchronized void initCache() {
"""
Scans the entire classpath and initializes the {@link #getReflectionUtil() root}.
"""
if (this.cache == null) {
ClasspathFolder rootFolder = new ClasspathFolder(null, "");
Set<String> resourceNames = this.reflectionUtil.findResourceNames("", true, Co... | java | private synchronized void initCache() {
if (this.cache == null) {
ClasspathFolder rootFolder = new ClasspathFolder(null, "");
Set<String> resourceNames = this.reflectionUtil.findResourceNames("", true, ConstantFilter.getInstance(true));
List<ClasspathFile> fileList = new ArrayList<>(resourceNames... | [
"private",
"synchronized",
"void",
"initCache",
"(",
")",
"{",
"if",
"(",
"this",
".",
"cache",
"==",
"null",
")",
"{",
"ClasspathFolder",
"rootFolder",
"=",
"new",
"ClasspathFolder",
"(",
"null",
",",
"\"\"",
")",
";",
"Set",
"<",
"String",
">",
"resour... | Scans the entire classpath and initializes the {@link #getReflectionUtil() root}. | [
"Scans",
"the",
"entire",
"classpath",
"and",
"initializes",
"the",
"{"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/resource/src/main/java/net/sf/mmm/util/resource/impl/ClasspathScannerImpl.java#L84-L99 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.adding | public Query adding( Column... columns ) {
"""
Create a copy of this query, but that returns results that include the columns specified by this query as well as the
supplied columns.
@param columns the additional columns that should be included in the the results; may not be null
@return the copy of the query... | java | public Query adding( Column... columns ) {
List<Column> newColumns = null;
if (this.columns != null) {
newColumns = new ArrayList<Column>(this.columns);
for (Column column : columns) {
newColumns.add(column);
}
} else {
newColumns =... | [
"public",
"Query",
"adding",
"(",
"Column",
"...",
"columns",
")",
"{",
"List",
"<",
"Column",
">",
"newColumns",
"=",
"null",
";",
"if",
"(",
"this",
".",
"columns",
"!=",
"null",
")",
"{",
"newColumns",
"=",
"new",
"ArrayList",
"<",
"Column",
">",
... | Create a copy of this query, but that returns results that include the columns specified by this query as well as the
supplied columns.
@param columns the additional columns that should be included in the the results; may not be null
@return the copy of the query returning the supplied result columns; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"that",
"returns",
"results",
"that",
"include",
"the",
"columns",
"specified",
"by",
"this",
"query",
"as",
"well",
"as",
"the",
"supplied",
"columns",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L240-L251 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/DbXmlPolicyIndex.java | DbXmlPolicyIndex.createQuery | private String createQuery(Map<String, Collection<AttributeBean>> attributeMap) {
"""
Given a set of attributes this method generates a DBXML XPath query based
on those attributes to extract a subset of policies from the database.
@param attributeMap
the Map of Attributes from which to generate the query
@pa... | java | private String createQuery(Map<String, Collection<AttributeBean>> attributeMap) {
StringBuilder sb = new StringBuilder(256);
sb.append("collection('");
sb.append(m_dbXmlManager.CONTAINER);
sb.append("')");
getXpath(attributeMap, sb);
return sb.toString();
} | [
"private",
"String",
"createQuery",
"(",
"Map",
"<",
"String",
",",
"Collection",
"<",
"AttributeBean",
">",
">",
"attributeMap",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"256",
")",
";",
"sb",
".",
"append",
"(",
"\"collection('\""... | Given a set of attributes this method generates a DBXML XPath query based
on those attributes to extract a subset of policies from the database.
@param attributeMap
the Map of Attributes from which to generate the query
@param r
the number of components in the resource id
@return the query as a String | [
"Given",
"a",
"set",
"of",
"attributes",
"this",
"method",
"generates",
"a",
"DBXML",
"XPath",
"query",
"based",
"on",
"those",
"attributes",
"to",
"extract",
"a",
"subset",
"of",
"policies",
"from",
"the",
"database",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/DbXmlPolicyIndex.java#L262-L269 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/lang/ExcelDateUtils.java | ExcelDateUtils.parseDate | public static Date parseDate(final String str) {
"""
文字列を日時形式を{@literal yyyy-MM-dd HH:mm:ss.SSS}のパースする。
<p>ただし、タイムゾーンは、標準時間の{@literal GMT-00:00}で処理する。
@param str パース対象の文字列
@return パースした日付。
@throws IllegalArgumentException str is empty.
@throws IllegalStateException fail parsing.
"""
ArgUtils.notE... | java | public static Date parseDate(final String str) {
ArgUtils.notEmpty(str, str);
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
format.setTimeZone(TimeZone.getTimeZone("GMT-00:00"));
return format.parse(str);
} ca... | [
"public",
"static",
"Date",
"parseDate",
"(",
"final",
"String",
"str",
")",
"{",
"ArgUtils",
".",
"notEmpty",
"(",
"str",
",",
"str",
")",
";",
"try",
"{",
"SimpleDateFormat",
"format",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyy-MM-dd HH:mm:ss.SSS\"",
")",
... | 文字列を日時形式を{@literal yyyy-MM-dd HH:mm:ss.SSS}のパースする。
<p>ただし、タイムゾーンは、標準時間の{@literal GMT-00:00}で処理する。
@param str パース対象の文字列
@return パースした日付。
@throws IllegalArgumentException str is empty.
@throws IllegalStateException fail parsing. | [
"文字列を日時形式を",
"{"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/ExcelDateUtils.java#L196-L207 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java | URLUtil.getReader | public static BufferedReader getReader(URL url, Charset charset) {
"""
获得Reader
@param url {@link URL}
@param charset 编码
@return {@link BufferedReader}
@since 3.2.1
"""
return IoUtil.getReader(getStream(url), charset);
} | java | public static BufferedReader getReader(URL url, Charset charset) {
return IoUtil.getReader(getStream(url), charset);
} | [
"public",
"static",
"BufferedReader",
"getReader",
"(",
"URL",
"url",
",",
"Charset",
"charset",
")",
"{",
"return",
"IoUtil",
".",
"getReader",
"(",
"getStream",
"(",
"url",
")",
",",
"charset",
")",
";",
"}"
] | 获得Reader
@param url {@link URL}
@param charset 编码
@return {@link BufferedReader}
@since 3.2.1 | [
"获得Reader"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L523-L525 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getPackageResource | public static String getPackageResource(Class<?> type, String resourceName) {
"""
Get resource name qualified with the package of a given class. Given a resource with simple name
<code>pdf-view-fop.xconf</code> and class <code>js.fop.PdfView</code> this method returns
<code>js/fop/pdf-view-fop.xconf</code>.
@... | java | public static String getPackageResource(Class<?> type, String resourceName)
{
StringBuilder builder = new StringBuilder();
builder.append(type.getPackage().getName().replace('.', '/'));
if(resourceName.charAt(0) != '/') {
builder.append('/');
}
builder.append(resourceName);
retur... | [
"public",
"static",
"String",
"getPackageResource",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"resourceName",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"type",
".",
"getPackage"... | Get resource name qualified with the package of a given class. Given a resource with simple name
<code>pdf-view-fop.xconf</code> and class <code>js.fop.PdfView</code> this method returns
<code>js/fop/pdf-view-fop.xconf</code>.
@param type class to infer package on which resource reside,
@param resourceName simple reso... | [
"Get",
"resource",
"name",
"qualified",
"with",
"the",
"package",
"of",
"a",
"given",
"class",
".",
"Given",
"a",
"resource",
"with",
"simple",
"name",
"<code",
">",
"pdf",
"-",
"view",
"-",
"fop",
".",
"xconf<",
"/",
"code",
">",
"and",
"class",
"<cod... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L949-L958 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalWriter.java | JournalWriter.writeFileArgument | private void writeFileArgument(String key, File file, XMLEventWriter writer)
throws XMLStreamException, JournalException {
"""
An InputStream argument must be written as a Base64-encoded String. It is
read from the temp file in segments. Each segment is encoded and written
to the XML writer as a seri... | java | private void writeFileArgument(String key, File file, XMLEventWriter writer)
throws XMLStreamException, JournalException {
try {
putStartTag(writer, QNAME_TAG_ARGUMENT);
putAttribute(writer, QNAME_ATTR_NAME, key);
putAttribute(writer, QNAME_ATTR_TYPE, ARGUMENT_TYP... | [
"private",
"void",
"writeFileArgument",
"(",
"String",
"key",
",",
"File",
"file",
",",
"XMLEventWriter",
"writer",
")",
"throws",
"XMLStreamException",
",",
"JournalException",
"{",
"try",
"{",
"putStartTag",
"(",
"writer",
",",
"QNAME_TAG_ARGUMENT",
")",
";",
... | An InputStream argument must be written as a Base64-encoded String. It is
read from the temp file in segments. Each segment is encoded and written
to the XML writer as a series of character events. | [
"An",
"InputStream",
"argument",
"must",
"be",
"written",
"as",
"a",
"Base64",
"-",
"encoded",
"String",
".",
"It",
"is",
"read",
"from",
"the",
"temp",
"file",
"in",
"segments",
".",
"Each",
"segment",
"is",
"encoded",
"and",
"written",
"to",
"the",
"XM... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalWriter.java#L327-L345 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java | BigtableTableAdminClient.getTableAsync | @SuppressWarnings("WeakerAccess")
public ApiFuture<Table> getTableAsync(String tableId) {
"""
Asynchronously gets the table metadata by tableId.
<p>Sample code:
<pre>{@code
ApiFuture<Table> tableFuture = client.getTableAsync("my-table");
ApiFutures.addCallback(
tableFuture,
new ApiFutureCallback<Tabl... | java | @SuppressWarnings("WeakerAccess")
public ApiFuture<Table> getTableAsync(String tableId) {
return getTableAsync(tableId, com.google.bigtable.admin.v2.Table.View.SCHEMA_VIEW);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"ApiFuture",
"<",
"Table",
">",
"getTableAsync",
"(",
"String",
"tableId",
")",
"{",
"return",
"getTableAsync",
"(",
"tableId",
",",
"com",
".",
"google",
".",
"bigtable",
".",
"admin",
".",
"v... | Asynchronously gets the table metadata by tableId.
<p>Sample code:
<pre>{@code
ApiFuture<Table> tableFuture = client.getTableAsync("my-table");
ApiFutures.addCallback(
tableFuture,
new ApiFutureCallback<Table>() {
public void onSuccess(Table table) {
System.out.println("Got metadata for table: " + table.getId());
Sy... | [
"Asynchronously",
"gets",
"the",
"table",
"metadata",
"by",
"tableId",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java#L484-L487 |
diirt/util | src/main/java/org/epics/util/stats/Ranges.java | Ranges.contains | public static boolean contains(Range range, double value) {
"""
Determines whether the value is contained by the range or not.
@param range a range
@param value a value
@return true if the value is within the range
"""
return value >= range.getMinimum().doubleValue() && value <= range.getMaximum()... | java | public static boolean contains(Range range, double value) {
return value >= range.getMinimum().doubleValue() && value <= range.getMaximum().doubleValue();
} | [
"public",
"static",
"boolean",
"contains",
"(",
"Range",
"range",
",",
"double",
"value",
")",
"{",
"return",
"value",
">=",
"range",
".",
"getMinimum",
"(",
")",
".",
"doubleValue",
"(",
")",
"&&",
"value",
"<=",
"range",
".",
"getMaximum",
"(",
")",
... | Determines whether the value is contained by the range or not.
@param range a range
@param value a value
@return true if the value is within the range | [
"Determines",
"whether",
"the",
"value",
"is",
"contained",
"by",
"the",
"range",
"or",
"not",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/stats/Ranges.java#L135-L137 |
haifengl/smile | math/src/main/java/smile/stat/distribution/HyperGeometricDistribution.java | HyperGeometricDistribution.rand | @Override
public double rand() {
"""
Uses inversion by chop-down search from the mode when the mean < 20
and the patchwork-rejection method when the mean > 20.
"""
int mm = m;
int nn = n;
if (mm > N / 2) {
// invert mm
mm = N - mm;
}
... | java | @Override
public double rand() {
int mm = m;
int nn = n;
if (mm > N / 2) {
// invert mm
mm = N - mm;
}
if (nn > N / 2) {
// invert nn
nn = N - nn;
}
if (nn > mm) {
// swap nn and mm
int... | [
"@",
"Override",
"public",
"double",
"rand",
"(",
")",
"{",
"int",
"mm",
"=",
"m",
";",
"int",
"nn",
"=",
"n",
";",
"if",
"(",
"mm",
">",
"N",
"/",
"2",
")",
"{",
"// invert mm",
"mm",
"=",
"N",
"-",
"mm",
";",
"}",
"if",
"(",
"nn",
">",
... | Uses inversion by chop-down search from the mode when the mean < 20
and the patchwork-rejection method when the mean > 20. | [
"Uses",
"inversion",
"by",
"chop",
"-",
"down",
"search",
"from",
"the",
"mode",
"when",
"the",
"mean",
"<",
";",
"20",
"and",
"the",
"patchwork",
"-",
"rejection",
"method",
"when",
"the",
"mean",
">",
";",
"20",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/stat/distribution/HyperGeometricDistribution.java#L179-L212 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java | ArrayFunctions.arrayContains | public static Expression arrayContains(Expression expression, Expression value) {
"""
Returned expression results in true if the array contains value.
"""
return x("ARRAY_CONTAINS(" + expression.toString() + ", " + value.toString() + ")");
} | java | public static Expression arrayContains(Expression expression, Expression value) {
return x("ARRAY_CONTAINS(" + expression.toString() + ", " + value.toString() + ")");
} | [
"public",
"static",
"Expression",
"arrayContains",
"(",
"Expression",
"expression",
",",
"Expression",
"value",
")",
"{",
"return",
"x",
"(",
"\"ARRAY_CONTAINS(\"",
"+",
"expression",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"value",
".",
"toString",
"("... | Returned expression results in true if the array contains value. | [
"Returned",
"expression",
"results",
"in",
"true",
"if",
"the",
"array",
"contains",
"value",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L111-L113 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java | GroupElement.cmov | org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement cmov(
final org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement u, final int b) {
"""
Constant-time conditional move.
<p>
Replaces this with $u$ if $b == 1$.<br> Replaces this with this if $b == 0$.
<p>... | java | org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement cmov(
final org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement u, final int b) {
return precomp(curve, X.cmov(u.X, b), Y.cmov(u.Y, b), Z.cmov(u.Z, b));
} | [
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
".",
"authentication",
".",
"ed25519",
".",
"math",
".",
"GroupElement",
"cmov",
"(",
"final",
"org",
".",
"mariadb",
".",
"jdbc",
".",
"internal",
".",
"com",
".",
"send",
... | Constant-time conditional move.
<p>
Replaces this with $u$ if $b == 1$.<br> Replaces this with this if $b == 0$.
<p>
Method is package private only so that tests run.
@param u The group element to return if $b == 1$.
@param b in $\{0, 1\}$
@return $u$ if $b == 1$; this if $b == 0$. Results undefined if $b$ is not in $... | [
"Constant",
"-",
"time",
"conditional",
"move",
".",
"<p",
">",
"Replaces",
"this",
"with",
"$u$",
"if",
"$b",
"==",
"1$",
".",
"<br",
">",
"Replaces",
"this",
"with",
"this",
"if",
"$b",
"==",
"0$",
".",
"<p",
">",
"Method",
"is",
"package",
"privat... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/send/authentication/ed25519/math/GroupElement.java#L868-L871 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Maps.java | Maps.newTreeMap | public static <K extends Comparable, V> TreeMap<K, V> newTreeMap() {
"""
Creates a <i>mutable</i>, empty {@code TreeMap} instance using the natural
ordering of its elements.
<p><b>Note:</b> if mutability is not required, use {@link
ImmutableSortedMap#of()} instead.
<p><b>Note for Java 7 and later:</b> this... | java | public static <K extends Comparable, V> TreeMap<K, V> newTreeMap() {
return new TreeMap<K, V>();
} | [
"public",
"static",
"<",
"K",
"extends",
"Comparable",
",",
"V",
">",
"TreeMap",
"<",
"K",
",",
"V",
">",
"newTreeMap",
"(",
")",
"{",
"return",
"new",
"TreeMap",
"<",
"K",
",",
"V",
">",
"(",
")",
";",
"}"
] | Creates a <i>mutable</i>, empty {@code TreeMap} instance using the natural
ordering of its elements.
<p><b>Note:</b> if mutability is not required, use {@link
ImmutableSortedMap#of()} instead.
<p><b>Note for Java 7 and later:</b> this method is now unnecessary and
should be treated as deprecated. Instead, use the {@c... | [
"Creates",
"a",
"<i",
">",
"mutable<",
"/",
"i",
">",
"empty",
"{",
"@code",
"TreeMap",
"}",
"instance",
"using",
"the",
"natural",
"ordering",
"of",
"its",
"elements",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Maps.java#L320-L322 |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java | MediaChannel.enableDTLS | public void enableDTLS(String hashFunction, String remoteFingerprint) {
"""
Enables DTLS on the channel. RTP and RTCP packets flowing through this
channel will be secured.
<p>
This method is used in <b>inbound</b> calls where the remote fingerprint is known.
</p>
@param remoteFingerprint
The DTLS finger ... | java | public void enableDTLS(String hashFunction, String remoteFingerprint) {
if (!this.dtls) {
this.rtpChannel.enableSRTP(hashFunction, remoteFingerprint);
if (!this.rtcpMux) {
rtcpChannel.enableSRTCP(hashFunction, remoteFingerprint);
}
this.dtls = true... | [
"public",
"void",
"enableDTLS",
"(",
"String",
"hashFunction",
",",
"String",
"remoteFingerprint",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dtls",
")",
"{",
"this",
".",
"rtpChannel",
".",
"enableSRTP",
"(",
"hashFunction",
",",
"remoteFingerprint",
")",
";",... | Enables DTLS on the channel. RTP and RTCP packets flowing through this
channel will be secured.
<p>
This method is used in <b>inbound</b> calls where the remote fingerprint is known.
</p>
@param remoteFingerprint
The DTLS finger print of the remote peer. | [
"Enables",
"DTLS",
"on",
"the",
"channel",
".",
"RTP",
"and",
"RTCP",
"packets",
"flowing",
"through",
"this",
"channel",
"will",
"be",
"secured",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/channels/MediaChannel.java#L801-L813 |
alkacon/opencms-core | src/org/opencms/synchronize/CmsSynchronize.java | CmsSynchronize.importToVfs | private void importToVfs(File fsFile, String resName, String folder) throws CmsException {
"""
Imports a new resource from the FS into the VFS and updates the
synchronization lists.<p>
@param fsFile the file in the FS
@param resName the name of the resource in the VFS
@param folder the folder to import the f... | java | private void importToVfs(File fsFile, String resName, String folder) throws CmsException {
try {
// get the content of the FS file
byte[] content = CmsFileUtil.readFile(fsFile);
// create the file
String filename = translate(fsFile.getName());
m_rep... | [
"private",
"void",
"importToVfs",
"(",
"File",
"fsFile",
",",
"String",
"resName",
",",
"String",
"folder",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"// get the content of the FS file",
"byte",
"[",
"]",
"content",
"=",
"CmsFileUtil",
".",
"readFile",
"("... | Imports a new resource from the FS into the VFS and updates the
synchronization lists.<p>
@param fsFile the file in the FS
@param resName the name of the resource in the VFS
@param folder the folder to import the file into
@throws CmsException if something goes wrong | [
"Imports",
"a",
"new",
"resource",
"from",
"the",
"FS",
"into",
"the",
"VFS",
"and",
"updates",
"the",
"synchronization",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/synchronize/CmsSynchronize.java#L528-L596 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/distancemetrics/TrainableDistanceMetric.java | TrainableDistanceMetric.trainIfNeeded | public static void trainIfNeeded(DistanceMetric dm, DataSet dataset, ExecutorService threadpool) {
"""
Static helper method for training a distance metric only if it is needed.
This method can be safely called for any Distance Metric.
@param dm the distance metric to train
@param dataset the data set to train... | java | public static void trainIfNeeded(DistanceMetric dm, DataSet dataset, ExecutorService threadpool)
{
//TODO I WILL DELETE, JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME
trainIfNeeded(dm, dataset);
} | [
"public",
"static",
"void",
"trainIfNeeded",
"(",
"DistanceMetric",
"dm",
",",
"DataSet",
"dataset",
",",
"ExecutorService",
"threadpool",
")",
"{",
"//TODO I WILL DELETE, JUST STUBBING FOR NOW TO MAKE LIFE EASY AS I DO ONE CODE SECTION AT A TIME",
"trainIfNeeded",
"(",
"dm",
"... | Static helper method for training a distance metric only if it is needed.
This method can be safely called for any Distance Metric.
@param dm the distance metric to train
@param dataset the data set to train from
@param threadpool the source of threads for parallel training. May be
<tt>null</tt>, in which case {@link ... | [
"Static",
"helper",
"method",
"for",
"training",
"a",
"distance",
"metric",
"only",
"if",
"it",
"is",
"needed",
".",
"This",
"method",
"can",
"be",
"safely",
"called",
"for",
"any",
"Distance",
"Metric",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/distancemetrics/TrainableDistanceMetric.java#L186-L190 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildPackageSummary | public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
"""
Build the profile package summary.
@param node the XML element that specifies which components to document
@param summaryContentTree the content tree to which the summaries will
be added
"""
PackageDoc[] packages = con... | java | public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
PackageDoc[] packages = configuration.profilePackages.get(profile.name);
for (int i = 0; i < packages.length; i++) {
this.pkg = packages[i];
Content packageSummaryContentTree = profileWriter.getPackageSum... | [
"public",
"void",
"buildPackageSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"PackageDoc",
"[",
"]",
"packages",
"=",
"configuration",
".",
"profilePackages",
".",
"get",
"(",
"profile",
".",
"name",
")",
";",
"for",
"(",
... | Build the profile package summary.
@param node the XML element that specifies which components to document
@param summaryContentTree the content tree to which the summaries will
be added | [
"Build",
"the",
"profile",
"package",
"summary",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L167-L176 |
alkacon/opencms-core | src/org/opencms/file/CmsLinkRewriter.java | CmsLinkRewriter.rewriteContentString | protected String rewriteContentString(String originalContent) {
"""
Replaces structure ids of resources in the source subtree with the structure ids of the corresponding
resources in the target subtree inside a content string.<p>
@param originalContent the original content
@return the content with the new s... | java | protected String rewriteContentString(String originalContent) {
Pattern uuidPattern = Pattern.compile(CmsUUID.UUID_REGEX);
I_CmsRegexSubstitution substitution = new I_CmsRegexSubstitution() {
public String substituteMatch(String text, Matcher matcher) {
String uuidString =... | [
"protected",
"String",
"rewriteContentString",
"(",
"String",
"originalContent",
")",
"{",
"Pattern",
"uuidPattern",
"=",
"Pattern",
".",
"compile",
"(",
"CmsUUID",
".",
"UUID_REGEX",
")",
";",
"I_CmsRegexSubstitution",
"substitution",
"=",
"new",
"I_CmsRegexSubstitut... | Replaces structure ids of resources in the source subtree with the structure ids of the corresponding
resources in the target subtree inside a content string.<p>
@param originalContent the original content
@return the content with the new structure ids | [
"Replaces",
"structure",
"ids",
"of",
"resources",
"in",
"the",
"source",
"subtree",
"with",
"the",
"structure",
"ids",
"of",
"the",
"corresponding",
"resources",
"in",
"the",
"target",
"subtree",
"inside",
"a",
"content",
"string",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsLinkRewriter.java#L654-L671 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasAsset.java | BaasAsset.streamImageAsset | public static <R> RequestToken streamImageAsset(String id, int size, int flags, DataStreamHandler<R> data, BaasHandler<R> handler) {
"""
Streams the file using the provided data stream handler.
@param id the name of the asset to download
@param size a size spec to specify the resize of an image asset... | java | public static <R> RequestToken streamImageAsset(String id, int size, int flags, DataStreamHandler<R> data, BaasHandler<R> handler) {
return BaasAsset.doStreamAsset(id, null, size, flags, data, handler);
} | [
"public",
"static",
"<",
"R",
">",
"RequestToken",
"streamImageAsset",
"(",
"String",
"id",
",",
"int",
"size",
",",
"int",
"flags",
",",
"DataStreamHandler",
"<",
"R",
">",
"data",
",",
"BaasHandler",
"<",
"R",
">",
"handler",
")",
"{",
"return",
"BaasA... | Streams the file using the provided data stream handler.
@param id the name of the asset to download
@param size a size spec to specify the resize of an image asset
@param flags {@link RequestOptions}
@param data the data stream handler {@link com.baasbox.android.DataStreamHandler}
@param handler the... | [
"Streams",
"the",
"file",
"using",
"the",
"provided",
"data",
"stream",
"handler",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasAsset.java#L141-L143 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.addBuddy | public PresenceSubscriber addBuddy(String uri, int duration, long timeout) {
"""
This method is the same as addBuddy(uri, duration, eventId, timeout) except that no event "id"
parameter will be included.
@param uri the URI (ie, sip:bob@nist.gov) of the buddy to be added to the list.
@param duration the durati... | java | public PresenceSubscriber addBuddy(String uri, int duration, long timeout) {
return addBuddy(uri, duration, null, timeout);
} | [
"public",
"PresenceSubscriber",
"addBuddy",
"(",
"String",
"uri",
",",
"int",
"duration",
",",
"long",
"timeout",
")",
"{",
"return",
"addBuddy",
"(",
"uri",
",",
"duration",
",",
"null",
",",
"timeout",
")",
";",
"}"
] | This method is the same as addBuddy(uri, duration, eventId, timeout) except that no event "id"
parameter will be included.
@param uri the URI (ie, sip:bob@nist.gov) of the buddy to be added to the list.
@param duration the duration in seconds to put in the SUBSCRIBE message. If 0, this is
equivalent to a fetch except ... | [
"This",
"method",
"is",
"the",
"same",
"as",
"addBuddy",
"(",
"uri",
"duration",
"eventId",
"timeout",
")",
"except",
"that",
"no",
"event",
"id",
"parameter",
"will",
"be",
"included",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L1458-L1460 |
roboconf/roboconf-platform | core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java | ConfigurationUtils.findIcon | public static File findIcon( String name, String qualifier, File configurationDirectory ) {
"""
Finds the icon associated with an application template.
@param name the application or template name
@param qualifier the template qualifier or <code>null</code> for an application
@param configurationDirectory the D... | java | public static File findIcon( String name, String qualifier, File configurationDirectory ) {
// Deal with an invalid directory
if( configurationDirectory == null )
return null;
// Find the root directory
File root;
if( ! Utils.isEmptyOrWhitespaces( qualifier )) {
ApplicationTemplate tpl = new Applicati... | [
"public",
"static",
"File",
"findIcon",
"(",
"String",
"name",
",",
"String",
"qualifier",
",",
"File",
"configurationDirectory",
")",
"{",
"// Deal with an invalid directory",
"if",
"(",
"configurationDirectory",
"==",
"null",
")",
"return",
"null",
";",
"// Find t... | Finds the icon associated with an application template.
@param name the application or template name
@param qualifier the template qualifier or <code>null</code> for an application
@param configurationDirectory the DM's configuration directory
@return an existing file, or null if no icon was found | [
"Finds",
"the",
"icon",
"associated",
"with",
"an",
"application",
"template",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm/src/main/java/net/roboconf/dm/internal/utils/ConfigurationUtils.java#L156-L173 |
rollbar/rollbar-java | rollbar-java/src/main/java/com/rollbar/Rollbar.java | Rollbar.handleUncaughtErrors | public void handleUncaughtErrors(Thread thread) {
"""
Handle all uncaught errors on {@code thread} with this `Rollbar`.
@param thread the thread to handle errors on
"""
final Rollbar rollbar = this;
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtEx... | java | public void handleUncaughtErrors(Thread thread) {
final Rollbar rollbar = this;
thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t, Throwable e) {
rollbar.log(e, null, null, null, true);
}
});
} | [
"public",
"void",
"handleUncaughtErrors",
"(",
"Thread",
"thread",
")",
"{",
"final",
"Rollbar",
"rollbar",
"=",
"this",
";",
"thread",
".",
"setUncaughtExceptionHandler",
"(",
"new",
"Thread",
".",
"UncaughtExceptionHandler",
"(",
")",
"{",
"public",
"void",
"u... | Handle all uncaught errors on {@code thread} with this `Rollbar`.
@param thread the thread to handle errors on | [
"Handle",
"all",
"uncaught",
"errors",
"on",
"{"
] | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-java/src/main/java/com/rollbar/Rollbar.java#L142-L149 |
hyperledger/fabric-chaincode-java | fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementUtils.java | StateBasedEndorsementUtils.signedByFabricEntity | static SignaturePolicyEnvelope signedByFabricEntity(String mspId, MSPRoleType role) {
"""
Creates a {@link SignaturePolicyEnvelope}
requiring 1 signature from any fabric entity, having the passed role, of the specified MSP
@param mspId
@param role
@return
"""
// specify the principal: it's a memb... | java | static SignaturePolicyEnvelope signedByFabricEntity(String mspId, MSPRoleType role) {
// specify the principal: it's a member of the msp we just found
MSPPrincipal principal = MSPPrincipal
.newBuilder()
.setPrincipalClassification(Classification.ROLE)
.set... | [
"static",
"SignaturePolicyEnvelope",
"signedByFabricEntity",
"(",
"String",
"mspId",
",",
"MSPRoleType",
"role",
")",
"{",
"// specify the principal: it's a member of the msp we just found",
"MSPPrincipal",
"principal",
"=",
"MSPPrincipal",
".",
"newBuilder",
"(",
")",
".",
... | Creates a {@link SignaturePolicyEnvelope}
requiring 1 signature from any fabric entity, having the passed role, of the specified MSP
@param mspId
@param role
@return | [
"Creates",
"a",
"{",
"@link",
"SignaturePolicyEnvelope",
"}",
"requiring",
"1",
"signature",
"from",
"any",
"fabric",
"entity",
"having",
"the",
"passed",
"role",
"of",
"the",
"specified",
"MSP"
] | train | https://github.com/hyperledger/fabric-chaincode-java/blob/1c688a3c7824758448fec31daaf0a1410a427e91/fabric-chaincode-shim/src/main/java/org/hyperledger/fabric/shim/ext/sbe/impl/StateBasedEndorsementUtils.java#L60-L80 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/ValidationUtils.java | ValidationUtils.assertAllAreNull | public static void assertAllAreNull(String messageIfNull, Object... objects) throws IllegalArgumentException {
"""
Asserts that all of the objects are null.
@throws IllegalArgumentException
if any object provided was NOT null.
"""
for (Object object : objects) {
if (object != null) {
... | java | public static void assertAllAreNull(String messageIfNull, Object... objects) throws IllegalArgumentException {
for (Object object : objects) {
if (object != null) {
throw new IllegalArgumentException(messageIfNull);
}
}
} | [
"public",
"static",
"void",
"assertAllAreNull",
"(",
"String",
"messageIfNull",
",",
"Object",
"...",
"objects",
")",
"throws",
"IllegalArgumentException",
"{",
"for",
"(",
"Object",
"object",
":",
"objects",
")",
"{",
"if",
"(",
"object",
"!=",
"null",
")",
... | Asserts that all of the objects are null.
@throws IllegalArgumentException
if any object provided was NOT null. | [
"Asserts",
"that",
"all",
"of",
"the",
"objects",
"are",
"null",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/ValidationUtils.java#L48-L54 |
lightbend/config | config/src/main/java/com/typesafe/config/ConfigFactory.java | ConfigFactory.parseReader | public static Config parseReader(Reader reader, ConfigParseOptions options) {
"""
Parses a Reader into a Config instance. Does not call
{@link Config#resolve} or merge the parsed stream with any
other configuration; this method parses a single stream and
does nothing else. It does process "include" statements i... | java | public static Config parseReader(Reader reader, ConfigParseOptions options) {
return Parseable.newReader(reader, options).parse().toConfig();
} | [
"public",
"static",
"Config",
"parseReader",
"(",
"Reader",
"reader",
",",
"ConfigParseOptions",
"options",
")",
"{",
"return",
"Parseable",
".",
"newReader",
"(",
"reader",
",",
"options",
")",
".",
"parse",
"(",
")",
".",
"toConfig",
"(",
")",
";",
"}"
] | Parses a Reader into a Config instance. Does not call
{@link Config#resolve} or merge the parsed stream with any
other configuration; this method parses a single stream and
does nothing else. It does process "include" statements in
the parsed stream, and may end up doing other IO due to those
statements.
@param reader... | [
"Parses",
"a",
"Reader",
"into",
"a",
"Config",
"instance",
".",
"Does",
"not",
"call",
"{",
"@link",
"Config#resolve",
"}",
"or",
"merge",
"the",
"parsed",
"stream",
"with",
"any",
"other",
"configuration",
";",
"this",
"method",
"parses",
"a",
"single",
... | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigFactory.java#L672-L674 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/OldConvolution.java | OldConvolution.col2im | public static INDArray col2im(INDArray col, int sy, int sx, int ph, int pw, int h, int w) {
"""
Rearrange matrix
columns into blocks
@param col the column
transposed image to convert
@param sy stride y
@param sx stride x
@param ph padding height
@param pw padding width
@param h height
@param w width
@r... | java | public static INDArray col2im(INDArray col, int sy, int sx, int ph, int pw, int h, int w) {
//number of images
long n = col.size(0);
//number of columns
long c = col.size(1);
//kernel height
long kh = col.size(2);
//kernel width
long kw = col.size(3);
... | [
"public",
"static",
"INDArray",
"col2im",
"(",
"INDArray",
"col",
",",
"int",
"sy",
",",
"int",
"sx",
",",
"int",
"ph",
",",
"int",
"pw",
",",
"int",
"h",
",",
"int",
"w",
")",
"{",
"//number of images",
"long",
"n",
"=",
"col",
".",
"size",
"(",
... | Rearrange matrix
columns into blocks
@param col the column
transposed image to convert
@param sy stride y
@param sx stride x
@param ph padding height
@param pw padding width
@param h height
@param w width
@return | [
"Rearrange",
"matrix",
"columns",
"into",
"blocks"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/OldConvolution.java#L55-L92 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java | MarkLogicClientImpl.performGraphQuery | public InputStream performGraphQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) throws JsonProcessingException {
"""
executes GraphQuery
@param queryString
@param bindings
@param tx
@param includeInferred
@param baseURI
@return
@throws JsonPr... | java | public InputStream performGraphQuery(String queryString, SPARQLQueryBindingSet bindings, Transaction tx, boolean includeInferred, String baseURI) throws JsonProcessingException {
return performGraphQuery(queryString, bindings, new InputStreamHandle(), tx, includeInferred, baseURI);
} | [
"public",
"InputStream",
"performGraphQuery",
"(",
"String",
"queryString",
",",
"SPARQLQueryBindingSet",
"bindings",
",",
"Transaction",
"tx",
",",
"boolean",
"includeInferred",
",",
"String",
"baseURI",
")",
"throws",
"JsonProcessingException",
"{",
"return",
"perform... | executes GraphQuery
@param queryString
@param bindings
@param tx
@param includeInferred
@param baseURI
@return
@throws JsonProcessingException | [
"executes",
"GraphQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClientImpl.java#L185-L187 |
sarl/sarl | main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java | MavenHelper.getPluginDependencyVersion | public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException {
"""
Replies the version of the given plugin that is specified in the POM of the
plugin in which this mojo is located.
@param groupId the identifier of the group.
@param artifactId thidentifier of the ar... | java | public String getPluginDependencyVersion(String groupId, String artifactId) throws MojoExecutionException {
final Map<String, Dependency> deps = getPluginDependencies();
final String key = ArtifactUtils.versionlessKey(groupId, artifactId);
this.log.debug("COMPONENT DEPENDENCIES(getPluginVersionFromDependencies):"... | [
"public",
"String",
"getPluginDependencyVersion",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
")",
"throws",
"MojoExecutionException",
"{",
"final",
"Map",
"<",
"String",
",",
"Dependency",
">",
"deps",
"=",
"getPluginDependencies",
"(",
")",
";",
"fina... | Replies the version of the given plugin that is specified in the POM of the
plugin in which this mojo is located.
@param groupId the identifier of the group.
@param artifactId thidentifier of the artifact.
@return the version, never <code>null</code>
@throws MojoExecutionException if the plugin was not found. | [
"Replies",
"the",
"version",
"of",
"the",
"given",
"plugin",
"that",
"is",
"specified",
"in",
"the",
"POM",
"of",
"the",
"plugin",
"in",
"which",
"this",
"mojo",
"is",
"located",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L349-L363 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-protocols/xwiki-commons-classloader-protocol-jar/src/main/java/org/xwiki/classloader/internal/protocol/jar/JarURLConnection.java | JarURLConnection.parseSpecs | private void parseSpecs(URL url) throws MalformedURLException {
"""
/*
get the specs for a given url out of the cache, and compute and cache them if they're not there.
"""
String spec = url.getFile();
int separator = spec.indexOf('!');
/*
* REMIND: we don't handle nested JAR ... | java | private void parseSpecs(URL url) throws MalformedURLException
{
String spec = url.getFile();
int separator = spec.indexOf('!');
/*
* REMIND: we don't handle nested JAR URLs
*/
if (separator == -1) {
throw new MalformedURLException("no ! found in url spe... | [
"private",
"void",
"parseSpecs",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"String",
"spec",
"=",
"url",
".",
"getFile",
"(",
")",
";",
"int",
"separator",
"=",
"spec",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"/*\n * REMIND: ... | /*
get the specs for a given url out of the cache, and compute and cache them if they're not there. | [
"/",
"*",
"get",
"the",
"specs",
"for",
"a",
"given",
"url",
"out",
"of",
"the",
"cache",
"and",
"compute",
"and",
"cache",
"them",
"if",
"they",
"re",
"not",
"there",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-classloader/xwiki-commons-classloader-protocols/xwiki-commons-classloader-protocol-jar/src/main/java/org/xwiki/classloader/internal/protocol/jar/JarURLConnection.java#L120-L154 |
appium/java-client | src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java | FeaturesMatchingResult.getPoints2 | public List<Point> getPoints2() {
"""
Returns a list of matching points on the second image.
@return The list of matching points on the second image.
"""
verifyPropertyPresence(POINTS2);
//noinspection unchecked
return ((List<Map<String, Object>>) getCommandResult().get(POINTS2)).str... | java | public List<Point> getPoints2() {
verifyPropertyPresence(POINTS2);
//noinspection unchecked
return ((List<Map<String, Object>>) getCommandResult().get(POINTS2)).stream()
.map(ComparisonResult::mapToPoint)
.collect(Collectors.toList());
} | [
"public",
"List",
"<",
"Point",
">",
"getPoints2",
"(",
")",
"{",
"verifyPropertyPresence",
"(",
"POINTS2",
")",
";",
"//noinspection unchecked",
"return",
"(",
"(",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
")",
"getCommandResult",
"(",
... | Returns a list of matching points on the second image.
@return The list of matching points on the second image. | [
"Returns",
"a",
"list",
"of",
"matching",
"points",
"on",
"the",
"second",
"image",
"."
] | train | https://github.com/appium/java-client/blob/5a17759b05d6fda8ef425b3ab6e766c73ed2e8df/src/main/java/io/appium/java_client/imagecomparison/FeaturesMatchingResult.java#L91-L97 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.listEffectiveNetworkSecurityGroups | public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) {
"""
Gets all network security groups applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of t... | java | public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) {
return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().body();
} | [
"public",
"EffectiveNetworkSecurityGroupListResultInner",
"listEffectiveNetworkSecurityGroups",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
")",
"{",
"return",
"listEffectiveNetworkSecurityGroupsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Gets all network security groups applied to a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by ... | [
"Gets",
"all",
"network",
"security",
"groups",
"applied",
"to",
"a",
"network",
"interface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java#L1344-L1346 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/BlockVector.java | BlockVector.removeElementsAt | public final void removeElementsAt(int firstindex, int count) {
"""
Deletes the components in [firstindex, firstindex+ count-1]. Each component in
this vector with an index greater than firstindex+count-1
is shifted downward.
The firstindex+count-1 must be a value less than the current size of the vector.
@e... | java | public final void removeElementsAt(int firstindex, int count)
{
if (tc.isEntryEnabled())
SibTr.entry(
tc,
"removeElementsAt",
new Object[] { new Integer(firstindex), new Integer(count)});
removeRange(firstindex, firstindex + count);
if (tc.isEntryEnabled())
SibTr.exit... | [
"public",
"final",
"void",
"removeElementsAt",
"(",
"int",
"firstindex",
",",
"int",
"count",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeElementsAt\"",
",",
"new",
"Object",
"[",
"]",
... | Deletes the components in [firstindex, firstindex+ count-1]. Each component in
this vector with an index greater than firstindex+count-1
is shifted downward.
The firstindex+count-1 must be a value less than the current size of the vector.
@exception ArrayIndexOutOfBoundsException if the indices was invalid. | [
"Deletes",
"the",
"components",
"in",
"[",
"firstindex",
"firstindex",
"+",
"count",
"-",
"1",
"]",
".",
"Each",
"component",
"in",
"this",
"vector",
"with",
"an",
"index",
"greater",
"than",
"firstindex",
"+",
"count",
"-",
"1",
"is",
"shifted",
"downward... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/BlockVector.java#L42-L54 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/ContextXmlReader.java | ContextXmlReader.storeInMultiMap | private void storeInMultiMap(MultiValueMap<String> map, String key, String[] values)
throws JournalException {
"""
This method is just to guard against the totally bogus Exception
declaration in MultiValueMap.set()
"""
try {
map.set(key, values);
} catch (Exception e) {... | java | private void storeInMultiMap(MultiValueMap<String> map, String key, String[] values)
throws JournalException {
try {
map.set(key, values);
} catch (Exception e) {
// totally bogus Exception here.
throw new JournalException(e);
}
} | [
"private",
"void",
"storeInMultiMap",
"(",
"MultiValueMap",
"<",
"String",
">",
"map",
",",
"String",
"key",
",",
"String",
"[",
"]",
"values",
")",
"throws",
"JournalException",
"{",
"try",
"{",
"map",
".",
"set",
"(",
"key",
",",
"values",
")",
";",
... | This method is just to guard against the totally bogus Exception
declaration in MultiValueMap.set() | [
"This",
"method",
"is",
"just",
"to",
"guard",
"against",
"the",
"totally",
"bogus",
"Exception",
"declaration",
"in",
"MultiValueMap",
".",
"set",
"()"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/xmlhelpers/ContextXmlReader.java#L197-L205 |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Server.java | Server.addHandler | public synchronized void addHandler(Class iface, Object handler) {
"""
Associates the handler instance with the given IDL interface. Replaces
an existing handler for this iface if one was previously registered.
@param iface Interface class that this handler implements. This is usually
an Idl2Java generated ... | java | public synchronized void addHandler(Class iface, Object handler) {
try {
iface.cast(handler);
}
catch (Exception e) {
throw new IllegalArgumentException("Handler: " + handler.getClass().getName() +
" does not implement: " + i... | [
"public",
"synchronized",
"void",
"addHandler",
"(",
"Class",
"iface",
",",
"Object",
"handler",
")",
"{",
"try",
"{",
"iface",
".",
"cast",
"(",
"handler",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException"... | Associates the handler instance with the given IDL interface. Replaces
an existing handler for this iface if one was previously registered.
@param iface Interface class that this handler implements. This is usually
an Idl2Java generated interface Class
@param handler Object that implements iface. Generally one of y... | [
"Associates",
"the",
"handler",
"instance",
"with",
"the",
"given",
"IDL",
"interface",
".",
"Replaces",
"an",
"existing",
"handler",
"for",
"this",
"iface",
"if",
"one",
"was",
"previously",
"registered",
"."
] | train | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Server.java#L76-L95 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/converter/AsyncConverter1to1.java | AsyncConverter1to1.processStream | @Override
public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws SchemaConversionException {
"""
Return a {@link RecordStreamWithMetadata} with the appropriate modifications.
@param inputStream
@param workUnitState
@return
... | java | @Override
public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws SchemaConversionException {
int maxConcurrentAsyncConversions = workUnitState.getPropAsInt(MAX_CONCURRENT_ASYNC_CONVERSIONS_KEY,
DEFAULT_MAX_CONCURRENT_AS... | [
"@",
"Override",
"public",
"RecordStreamWithMetadata",
"<",
"DO",
",",
"SO",
">",
"processStream",
"(",
"RecordStreamWithMetadata",
"<",
"DI",
",",
"SI",
">",
"inputStream",
",",
"WorkUnitState",
"workUnitState",
")",
"throws",
"SchemaConversionException",
"{",
"int... | Return a {@link RecordStreamWithMetadata} with the appropriate modifications.
@param inputStream
@param workUnitState
@return
@throws SchemaConversionException
@implNote this processStream does not handle {@link org.apache.gobblin.stream.MetadataUpdateControlMessage}s | [
"Return",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/converter/AsyncConverter1to1.java#L78-L99 |
agentgt/jirm | jirm-core/src/main/java/co/jirm/core/util/ResourceUtils.java | ResourceUtils.resolveName | private static String resolveName(Class<?> c, String name) {
"""
/*
Add a package name prefix if the name is not absolute Remove leading "/"
if name is absolute
"""
if (name == null) {
return name;
}
if (!name.startsWith("/")) {
while (c.isArray()) {
... | java | private static String resolveName(Class<?> c, String name) {
if (name == null) {
return name;
}
if (!name.startsWith("/")) {
while (c.isArray()) {
c = c.getComponentType();
}
String baseName = c.getName();
int index = baseName.la... | [
"private",
"static",
"String",
"resolveName",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"return",
"name",
";",
"}",
"if",
"(",
"!",
"name",
".",
"startsWith",
"(",
"\"/\"",
")",
... | /*
Add a package name prefix if the name is not absolute Remove leading "/"
if name is absolute | [
"/",
"*",
"Add",
"a",
"package",
"name",
"prefix",
"if",
"the",
"name",
"is",
"not",
"absolute",
"Remove",
"leading",
"/",
"if",
"name",
"is",
"absolute"
] | train | https://github.com/agentgt/jirm/blob/95a2fcdef4121c439053524407af3d4ce8035722/jirm-core/src/main/java/co/jirm/core/util/ResourceUtils.java#L102-L120 |
aws/aws-sdk-java | aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformEndpointRequest.java | CreatePlatformEndpointRequest.getAttributes | public java.util.Map<String, String> getAttributes() {
"""
<p>
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html">SetEndpointAttributes</a>.
</p>
@return For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEn... | java | public java.util.Map<String, String> getAttributes() {
if (attributes == null) {
attributes = new com.amazonaws.internal.SdkInternalMap<String, String>();
}
return attributes;
} | [
"public",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"getAttributes",
"(",
")",
"{",
"if",
"(",
"attributes",
"==",
"null",
")",
"{",
"attributes",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalMap",
"<... | <p>
For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html">SetEndpointAttributes</a>.
</p>
@return For a list of attributes, see <a
href="https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html"
>SetEndpointAttributes</a>. | [
"<p",
">",
"For",
"a",
"list",
"of",
"attributes",
"see",
"<a",
"href",
"=",
"https",
":",
"//",
"docs",
".",
"aws",
".",
"amazon",
".",
"com",
"/",
"sns",
"/",
"latest",
"/",
"api",
"/",
"API_SetEndpointAttributes",
".",
"html",
">",
"SetEndpointAttri... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/CreatePlatformEndpointRequest.java#L216-L221 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/WebSecurityPropagatorImpl.java | WebSecurityPropagatorImpl.isUnqualified | private boolean isUnqualified(String url, String urlPattern) {
"""
***********************************************************************
Any pattern, qualified by a pattern that matches it, is overridden and
made irrelevant (in the translation) by the qualifying pattern.
Specifically, all extension patterns a... | java | private boolean isUnqualified(String url, String urlPattern) {
boolean unqualified = false;
if (urlPattern.indexOf(":") != -1) {
int idx = urlPattern.indexOf(":");
StringTokenizer st = new StringTokenizer(urlPattern.substring(idx + 1), ":");
while (st.hasMoreTokens())... | [
"private",
"boolean",
"isUnqualified",
"(",
"String",
"url",
",",
"String",
"urlPattern",
")",
"{",
"boolean",
"unqualified",
"=",
"false",
";",
"if",
"(",
"urlPattern",
".",
"indexOf",
"(",
"\":\"",
")",
"!=",
"-",
"1",
")",
"{",
"int",
"idx",
"=",
"u... | ***********************************************************************
Any pattern, qualified by a pattern that matches it, is overridden and
made irrelevant (in the translation) by the qualifying pattern.
Specifically, all extension patterns and the default pattern are made
irrelevant by the presence of the path pref... | [
"***********************************************************************",
"Any",
"pattern",
"qualified",
"by",
"a",
"pattern",
"that",
"matches",
"it",
"is",
"overridden",
"and",
"made",
"irrelevant",
"(",
"in",
"the",
"translation",
")",
"by",
"the",
"qualifying",
"pa... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.jacc.web/src/com/ibm/ws/security/authorization/jacc/web/impl/WebSecurityPropagatorImpl.java#L462-L475 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java | MariaDbDatabaseMetaData.patternCond | private String patternCond(String columnName, String tableName) {
"""
Helper to generate information schema queries with "like" or "equals" condition (typically on table name)
"""
if (tableName == null) {
return "(1 = 1)";
}
String predicate =
(tableName.indexOf('%') == -1 && tableN... | java | private String patternCond(String columnName, String tableName) {
if (tableName == null) {
return "(1 = 1)";
}
String predicate =
(tableName.indexOf('%') == -1 && tableName.indexOf('_') == -1) ? "=" : "LIKE";
return "(" + columnName + " " + predicate + " '" + Utils.escapeString(tableName, ... | [
"private",
"String",
"patternCond",
"(",
"String",
"columnName",
",",
"String",
"tableName",
")",
"{",
"if",
"(",
"tableName",
"==",
"null",
")",
"{",
"return",
"\"(1 = 1)\"",
";",
"}",
"String",
"predicate",
"=",
"(",
"tableName",
".",
"indexOf",
"(",
"'"... | Helper to generate information schema queries with "like" or "equals" condition (typically on table name) | [
"Helper",
"to",
"generate",
"information",
"schema",
"queries",
"with",
"like",
"or",
"equals",
"condition",
"(",
"typically",
"on",
"table",
"name",
")"
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L518-L525 |
UrielCh/ovh-java-sdk | ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java | ApiOvhStore.partner_partnerId_product_GET | public ArrayList<OvhEditResponse> partner_partnerId_product_GET(String partnerId) throws IOException {
"""
List partner's products
REST: GET /store/partner/{partnerId}/product
@param partnerId [required] Id of the partner
API beta
"""
String qPath = "/store/partner/{partnerId}/product";
StringBuilde... | java | public ArrayList<OvhEditResponse> partner_partnerId_product_GET(String partnerId) throws IOException {
String qPath = "/store/partner/{partnerId}/product";
StringBuilder sb = path(qPath, partnerId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t5);
} | [
"public",
"ArrayList",
"<",
"OvhEditResponse",
">",
"partner_partnerId_product_GET",
"(",
"String",
"partnerId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/store/partner/{partnerId}/product\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | List partner's products
REST: GET /store/partner/{partnerId}/product
@param partnerId [required] Id of the partner
API beta | [
"List",
"partner",
"s",
"products"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java#L528-L533 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/Clients.java | Clients.withHttpHeader | public static SafeCloseable withHttpHeader(AsciiString name, String value) {
"""
Sets the specified HTTP header in a thread-local variable so that the header is sent by the client call
made from the current thread. Use the `try-with-resources` block with the returned
{@link SafeCloseable} to unset the thread-loc... | java | public static SafeCloseable withHttpHeader(AsciiString name, String value) {
requireNonNull(name, "name");
requireNonNull(value, "value");
return withHttpHeaders(headers -> headers.set(name, value));
} | [
"public",
"static",
"SafeCloseable",
"withHttpHeader",
"(",
"AsciiString",
"name",
",",
"String",
"value",
")",
"{",
"requireNonNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"requireNonNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"return",
"withHttpHeaders"... | Sets the specified HTTP header in a thread-local variable so that the header is sent by the client call
made from the current thread. Use the `try-with-resources` block with the returned
{@link SafeCloseable} to unset the thread-local variable automatically:
<pre>{@code
import static com.linecorp.armeria.common.HttpHea... | [
"Sets",
"the",
"specified",
"HTTP",
"header",
"in",
"a",
"thread",
"-",
"local",
"variable",
"so",
"that",
"the",
"header",
"is",
"sent",
"by",
"the",
"client",
"call",
"made",
"from",
"the",
"current",
"thread",
".",
"Use",
"the",
"try",
"-",
"with",
... | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/Clients.java#L291-L295 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/ListWidget.java | ListWidget.getViewFromAdapter | protected Widget getViewFromAdapter(final int index, ListItemHostWidget host) {
"""
Get view displays the data at the specified position in the {@link Adapter}
@param index - item index in {@link Adapter}
@param host - view using as a host for the adapter view
@return view displays the data at the specified pos... | java | protected Widget getViewFromAdapter(final int index, ListItemHostWidget host) {
return mAdapter == null ? null : mAdapter.getView(index, host.getGuest(), host);
} | [
"protected",
"Widget",
"getViewFromAdapter",
"(",
"final",
"int",
"index",
",",
"ListItemHostWidget",
"host",
")",
"{",
"return",
"mAdapter",
"==",
"null",
"?",
"null",
":",
"mAdapter",
".",
"getView",
"(",
"index",
",",
"host",
".",
"getGuest",
"(",
")",
... | Get view displays the data at the specified position in the {@link Adapter}
@param index - item index in {@link Adapter}
@param host - view using as a host for the adapter view
@return view displays the data at the specified position | [
"Get",
"view",
"displays",
"the",
"data",
"at",
"the",
"specified",
"position",
"in",
"the",
"{"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/ListWidget.java#L951-L953 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java | CursorLoader.getCursor | public Cursor getCursor(ImageData imageData,int x,int y) throws IOException, LWJGLException {
"""
Get a cursor based on a set of image data
@param imageData The data from which the cursor can read it's contents
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordinate of the cu... | java | public Cursor getCursor(ImageData imageData,int x,int y) throws IOException, LWJGLException {
ByteBuffer buf = imageData.getImageBufferData();
for (int i=0;i<buf.limit();i+=4) {
byte red = buf.get(i);
byte green = buf.get(i+1);
byte blue = buf.get(i+2);
byte alpha = buf.get(i+3);
buf.put(... | [
"public",
"Cursor",
"getCursor",
"(",
"ImageData",
"imageData",
",",
"int",
"x",
",",
"int",
"y",
")",
"throws",
"IOException",
",",
"LWJGLException",
"{",
"ByteBuffer",
"buf",
"=",
"imageData",
".",
"getImageBufferData",
"(",
")",
";",
"for",
"(",
"int",
... | Get a cursor based on a set of image data
@param imageData The data from which the cursor can read it's contents
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordinate of the cursor hotspot (bottom -> top)
@return The create cursor
@throws IOException Indicates a failure to load the ... | [
"Get",
"a",
"cursor",
"based",
"on",
"a",
"set",
"of",
"image",
"data"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java#L129-L153 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java | MutableURI.setOpaque | public void setOpaque( String scheme, String schemeSpecificPart ) {
"""
Sets the URI to be opaque using the given scheme and
schemeSpecificPart.
<p> From {@link URI}: "A URI is opaque if, and only
if, it is absolute and its scheme-specific part does not begin with
a slash character ('/'). An opaque URI ha... | java | public void setOpaque( String scheme, String schemeSpecificPart )
{
if ( scheme == null || scheme.length() == 0
|| schemeSpecificPart == null
|| schemeSpecificPart.length() == 0
|| schemeSpecificPart.indexOf( '/' ) > 0 )
{
throw new Illegal... | [
"public",
"void",
"setOpaque",
"(",
"String",
"scheme",
",",
"String",
"schemeSpecificPart",
")",
"{",
"if",
"(",
"scheme",
"==",
"null",
"||",
"scheme",
".",
"length",
"(",
")",
"==",
"0",
"||",
"schemeSpecificPart",
"==",
"null",
"||",
"schemeSpecificPart"... | Sets the URI to be opaque using the given scheme and
schemeSpecificPart.
<p> From {@link URI}: "A URI is opaque if, and only
if, it is absolute and its scheme-specific part does not begin with
a slash character ('/'). An opaque URI has a scheme, a
scheme-specific part, and possibly a fragment; all other components... | [
"Sets",
"the",
"URI",
"to",
"be",
"opaque",
"using",
"the",
"given",
"scheme",
"and",
"schemeSpecificPart",
".",
"<p",
">",
"From",
"{",
"@link",
"URI",
"}",
":",
""",
";",
"A",
"URI",
"is",
"opaque",
"if",
"and",
"only",
"if",
"it",
"is",
"absol... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urls/MutableURI.java#L799-L817 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java | OSchemaHelper.oClass | public OSchemaHelper oClass(String className, String... superClasses) {
"""
Create if required {@link OClass}
@param className name of a class to create
@param superClasses list of superclasses
@return this helper
"""
return oClass(className, false, superClasses);
} | java | public OSchemaHelper oClass(String className, String... superClasses)
{
return oClass(className, false, superClasses);
} | [
"public",
"OSchemaHelper",
"oClass",
"(",
"String",
"className",
",",
"String",
"...",
"superClasses",
")",
"{",
"return",
"oClass",
"(",
"className",
",",
"false",
",",
"superClasses",
")",
";",
"}"
] | Create if required {@link OClass}
@param className name of a class to create
@param superClasses list of superclasses
@return this helper | [
"Create",
"if",
"required",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L65-L68 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java | VirtualMachineImagesInner.listOffersAsync | public Observable<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String publisherName) {
"""
Gets a list of virtual machine image offers for the specified location and publisher.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@thro... | java | public Observable<List<VirtualMachineImageResourceInner>> listOffersAsync(String location, String publisherName) {
return listOffersWithServiceResponseAsync(location, publisherName).map(new Func1<ServiceResponse<List<VirtualMachineImageResourceInner>>, List<VirtualMachineImageResourceInner>>() {
@Ov... | [
"public",
"Observable",
"<",
"List",
"<",
"VirtualMachineImageResourceInner",
">",
">",
"listOffersAsync",
"(",
"String",
"location",
",",
"String",
"publisherName",
")",
"{",
"return",
"listOffersWithServiceResponseAsync",
"(",
"location",
",",
"publisherName",
")",
... | Gets a list of virtual machine image offers for the specified location and publisher.
@param location The name of a supported Azure region.
@param publisherName A valid image publisher.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<VirtualMachineImageRe... | [
"Gets",
"a",
"list",
"of",
"virtual",
"machine",
"image",
"offers",
"for",
"the",
"specified",
"location",
"and",
"publisher",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L427-L434 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendNullCriteria | private void appendNullCriteria(TableAlias alias, PathInfo pathInfo, NullCriteria c, StringBuffer buf) {
"""
Answer the SQL-Clause for a NullCriteria
@param alias
@param pathInfo
@param c NullCriteria
@param buf
"""
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
buf.appe... | java | private void appendNullCriteria(TableAlias alias, PathInfo pathInfo, NullCriteria c, StringBuffer buf)
{
appendColName(alias, pathInfo, c.isTranslateAttribute(), buf);
buf.append(c.getClause());
} | [
"private",
"void",
"appendNullCriteria",
"(",
"TableAlias",
"alias",
",",
"PathInfo",
"pathInfo",
",",
"NullCriteria",
"c",
",",
"StringBuffer",
"buf",
")",
"{",
"appendColName",
"(",
"alias",
",",
"pathInfo",
",",
"c",
".",
"isTranslateAttribute",
"(",
")",
"... | Answer the SQL-Clause for a NullCriteria
@param alias
@param pathInfo
@param c NullCriteria
@param buf | [
"Answer",
"the",
"SQL",
"-",
"Clause",
"for",
"a",
"NullCriteria"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L799-L803 |
diffplug/durian | src/com/diffplug/common/base/TreeComparison.java | TreeComparison.assertEqualMappedBy | public void assertEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) {
"""
Asserts that the trees are equal, by calling {@link Objects#equals(Object, Object)} on the results of both mappers.
@see #isEqualMappedBy(Function, Function)
"""
if (!isEqualMappedBy(expectedM... | java | public void assertEqualMappedBy(Function<? super E, ?> expectedMapper, Function<? super A, ?> actualMapper) {
if (!isEqualMappedBy(expectedMapper, actualMapper)) {
throwAssertionError();
}
} | [
"public",
"void",
"assertEqualMappedBy",
"(",
"Function",
"<",
"?",
"super",
"E",
",",
"?",
">",
"expectedMapper",
",",
"Function",
"<",
"?",
"super",
"A",
",",
"?",
">",
"actualMapper",
")",
"{",
"if",
"(",
"!",
"isEqualMappedBy",
"(",
"expectedMapper",
... | Asserts that the trees are equal, by calling {@link Objects#equals(Object, Object)} on the results of both mappers.
@see #isEqualMappedBy(Function, Function) | [
"Asserts",
"that",
"the",
"trees",
"are",
"equal",
"by",
"calling",
"{",
"@link",
"Objects#equals",
"(",
"Object",
"Object",
")",
"}",
"on",
"the",
"results",
"of",
"both",
"mappers",
"."
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeComparison.java#L84-L88 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java | CredentialsInner.createOrUpdateAsync | public Observable<CredentialInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String credentialName, CredentialCreateOrUpdateParameters parameters) {
"""
Create a credential.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the ... | java | public Observable<CredentialInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String credentialName, CredentialCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, credentialName, parameters).map(new Func1... | [
"public",
"Observable",
"<",
"CredentialInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"credentialName",
",",
"CredentialCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpd... | Create a credential.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param credentialName The parameters supplied to the create or update credential operation.
@param parameters The parameters supplied to the create or update credential operat... | [
"Create",
"a",
"credential",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/CredentialsInner.java#L316-L323 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java | ComputePoliciesInner.getAsync | public Observable<ComputePolicyInner> getAsync(String resourceGroupName, String accountName, String computePolicyName) {
"""
Gets the specified Data Lake Analytics compute policy.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@pa... | java | public Observable<ComputePolicyInner> getAsync(String resourceGroupName, String accountName, String computePolicyName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, computePolicyName).map(new Func1<ServiceResponse<ComputePolicyInner>, ComputePolicyInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ComputePolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"computePolicyName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
","... | Gets the specified Data Lake Analytics compute policy.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@param computePolicyName The name of the compute policy to retrieve.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"compute",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/ComputePoliciesInner.java#L355-L362 |
rythmengine/rythmengine | src/main/java/org/rythmengine/utils/IO.java | IO.writeContent | public static void writeContent(CharSequence content, File file, String encoding) {
"""
Write String content to a file (always use utf-8)
@param content The content to write
@param file The file to write
"""
OutputStream os = null;
try {
os = new FileOutputStream(file);
... | java | public static void writeContent(CharSequence content, File file, String encoding) {
OutputStream os = null;
try {
os = new FileOutputStream(file);
PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));
printWriter.println(content);
... | [
"public",
"static",
"void",
"writeContent",
"(",
"CharSequence",
"content",
",",
"File",
"file",
",",
"String",
"encoding",
")",
"{",
"OutputStream",
"os",
"=",
"null",
";",
"try",
"{",
"os",
"=",
"new",
"FileOutputStream",
"(",
"file",
")",
";",
"PrintWri... | Write String content to a file (always use utf-8)
@param content The content to write
@param file The file to write | [
"Write",
"String",
"content",
"to",
"a",
"file",
"(",
"always",
"use",
"utf",
"-",
"8",
")"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/IO.java#L113-L130 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.getMethodByNameIgnoreCase | public static Method getMethodByNameIgnoreCase(Class<?> clazz, String methodName) throws SecurityException {
"""
按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code>null</code>
<p>
此方法只检查方法名是否一致(忽略大小写),并不检查参数的一致性。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param methodName 方法名,如果为空字符串返回{@code null}
@... | java | public static Method getMethodByNameIgnoreCase(Class<?> clazz, String methodName) throws SecurityException {
return getMethodByName(clazz, true, methodName);
} | [
"public",
"static",
"Method",
"getMethodByNameIgnoreCase",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"throws",
"SecurityException",
"{",
"return",
"getMethodByName",
"(",
"clazz",
",",
"true",
",",
"methodName",
")",
";",
"}"
] | 按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code>null</code>
<p>
此方法只检查方法名是否一致(忽略大小写),并不检查参数的一致性。
</p>
@param clazz 类,如果为{@code null}返回{@code null}
@param methodName 方法名,如果为空字符串返回{@code null}
@return 方法
@throws SecurityException 无权访问抛出异常
@since 4.3.2 | [
"按照方法名查找指定方法名的方法,只返回匹配到的第一个方法,如果找不到对应的方法则返回<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L498-L500 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/FacetOptions.java | FacetOptions.addFacetByRange | public final FacetOptions addFacetByRange(FieldWithRangeParameters<?, ?, ?> field) {
"""
Append additional field for range faceting
@param field the {@link Field} to be appended to range faceting fields
@return this
@since 1.5
"""
Assert.notNull(field, "Cannot range facet on null field.");
Assert.hasT... | java | public final FacetOptions addFacetByRange(FieldWithRangeParameters<?, ?, ?> field) {
Assert.notNull(field, "Cannot range facet on null field.");
Assert.hasText(field.getName(), "Cannot range facet on field with null/empty fieldname.");
this.facetRangeOnFields.add(field);
return this;
} | [
"public",
"final",
"FacetOptions",
"addFacetByRange",
"(",
"FieldWithRangeParameters",
"<",
"?",
",",
"?",
",",
"?",
">",
"field",
")",
"{",
"Assert",
".",
"notNull",
"(",
"field",
",",
"\"Cannot range facet on null field.\"",
")",
";",
"Assert",
".",
"hasText",... | Append additional field for range faceting
@param field the {@link Field} to be appended to range faceting fields
@return this
@since 1.5 | [
"Append",
"additional",
"field",
"for",
"range",
"faceting"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/FacetOptions.java#L132-L138 |
js-lib-com/net-client | src/main/java/js/net/client/ConnectionFactory.java | ConnectionFactory.isSecure | private static boolean isSecure(String protocol) throws BugError {
"""
Predicate to test if given protocol is secure.
@param protocol protocol to test if secure.
@return true it given <code>protocol</code> is secure.
@throws BugError if given protocol is not supported.
"""
if (HTTP.equalsIgnoreCase(pro... | java | private static boolean isSecure(String protocol) throws BugError {
if (HTTP.equalsIgnoreCase(protocol)) {
return false;
} else if (HTTPS.equalsIgnoreCase(protocol)) {
return true;
} else {
throw new BugError("Unsupported protocol |%s| for HTTP transaction.", protocol);
}
} | [
"private",
"static",
"boolean",
"isSecure",
"(",
"String",
"protocol",
")",
"throws",
"BugError",
"{",
"if",
"(",
"HTTP",
".",
"equalsIgnoreCase",
"(",
"protocol",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"HTTPS",
".",
"equalsIgnoreCa... | Predicate to test if given protocol is secure.
@param protocol protocol to test if secure.
@return true it given <code>protocol</code> is secure.
@throws BugError if given protocol is not supported. | [
"Predicate",
"to",
"test",
"if",
"given",
"protocol",
"is",
"secure",
"."
] | train | https://github.com/js-lib-com/net-client/blob/0489f85d8baa1be1ff115aa79929e0cf05d4c72d/src/main/java/js/net/client/ConnectionFactory.java#L167-L175 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java | SchedulerUtils.createJobDetail | public static JobDetail createJobDetail(String identity, String groupName, Class<? extends Job> clazz) {
"""
Creates a new quartz scheduler JobDetail, which can be used to
schedule a new job by passing it into {@link io.mangoo.scheduler.Scheduler#schedule(JobDetail, Trigger) schedule}
@param identity The name ... | java | public static JobDetail createJobDetail(String identity, String groupName, Class<? extends Job> clazz) {
Objects.requireNonNull(identity, Required.IDENTITY.toString());
Objects.requireNonNull(groupName, Required.GROUP_NAME.toString());
Objects.requireNonNull(clazz, Required.CLASS.toString());
... | [
"public",
"static",
"JobDetail",
"createJobDetail",
"(",
"String",
"identity",
",",
"String",
"groupName",
",",
"Class",
"<",
"?",
"extends",
"Job",
">",
"clazz",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"identity",
",",
"Required",
".",
"IDENTITY",
... | Creates a new quartz scheduler JobDetail, which can be used to
schedule a new job by passing it into {@link io.mangoo.scheduler.Scheduler#schedule(JobDetail, Trigger) schedule}
@param identity The name of the job
@param groupName The name of the job Group
@param clazz The class where the actual execution takes place
... | [
"Creates",
"a",
"new",
"quartz",
"scheduler",
"JobDetail",
"which",
"can",
"be",
"used",
"to",
"schedule",
"a",
"new",
"job",
"by",
"passing",
"it",
"into",
"{",
"@link",
"io",
".",
"mangoo",
".",
"scheduler",
".",
"Scheduler#schedule",
"(",
"JobDetail",
"... | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java#L62-L70 |
exoplatform/jcr | applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java | BackupConsole.getRepoWS | private static String getRepoWS(String[] args, int curArg) {
"""
Get parameter from argument list, check it and return as valid path to repository and
workspace.
@param args
list of arguments.
@param curArg
argument index.
@return String valid path.
"""
if (curArg == args.length)
{
... | java | private static String getRepoWS(String[] args, int curArg)
{
if (curArg == args.length)
{
System.out.println(INCORRECT_PARAM + "There is no path to workspace parameter."); //NOSONAR
return null;
}
// make correct path
String repWS = args[curArg];
repWS =... | [
"private",
"static",
"String",
"getRepoWS",
"(",
"String",
"[",
"]",
"args",
",",
"int",
"curArg",
")",
"{",
"if",
"(",
"curArg",
"==",
"args",
".",
"length",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"INCORRECT_PARAM",
"+",
"\"There is no pat... | Get parameter from argument list, check it and return as valid path to repository and
workspace.
@param args
list of arguments.
@param curArg
argument index.
@return String valid path. | [
"Get",
"parameter",
"from",
"argument",
"list",
"check",
"it",
"and",
"return",
"as",
"valid",
"path",
"to",
"repository",
"and",
"workspace",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/applications/exo.jcr.applications.backupconsole/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java#L688-L708 |
undera/jmeter-plugins | plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java | CaseFormat.changeCase | protected String changeCase(String originalString, String mode) {
"""
Change case options
@param originalString
@param mode
@return string after change case
"""
String targetString = originalString;
// mode is case insensitive, allow upper for example
CaseFormatMode changeCaseMode = CaseFormatMode.g... | java | protected String changeCase(String originalString, String mode) {
String targetString = originalString;
// mode is case insensitive, allow upper for example
CaseFormatMode changeCaseMode = CaseFormatMode.get(mode.toUpperCase());
if (changeCaseMode != null) {
switch (changeCaseMode) {
case LOWER_CAMEL_CASE... | [
"protected",
"String",
"changeCase",
"(",
"String",
"originalString",
",",
"String",
"mode",
")",
"{",
"String",
"targetString",
"=",
"originalString",
";",
"// mode is case insensitive, allow upper for example",
"CaseFormatMode",
"changeCaseMode",
"=",
"CaseFormatMode",
".... | Change case options
@param originalString
@param mode
@return string after change case | [
"Change",
"case",
"options"
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/plugins/functions/src/main/java/kg/apc/jmeter/functions/CaseFormat.java#L95-L130 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java | ParsedQuery.getBoolean | public boolean getBoolean(String key, boolean defaultValue) {
"""
Returns a boolean value by the key specified or defaultValue if the key was not provided
"""
String value = get(key);
if(value == null) return defaultValue;
return XType.getBoolean(value);
} | java | public boolean getBoolean(String key, boolean defaultValue) {
String value = get(key);
if(value == null) return defaultValue;
return XType.getBoolean(value);
} | [
"public",
"boolean",
"getBoolean",
"(",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"defaultValue",
";",
"return",
"XType",
".",
"getBool... | Returns a boolean value by the key specified or defaultValue if the key was not provided | [
"Returns",
"a",
"boolean",
"value",
"by",
"the",
"key",
"specified",
"or",
"defaultValue",
"if",
"the",
"key",
"was",
"not",
"provided"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java#L136-L140 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsWorkplaceEditorConfiguration.java | CmsWorkplaceEditorConfiguration.setResourceTypes | private void setResourceTypes(Map<String, String[]> types) {
"""
Sets the valid resource types of the editor.<p>
@param types the valid resource types of the editor
"""
if ((types == null) || (types.size() == 0)) {
setValidConfiguration(false);
LOG.error(Messages.get().getBu... | java | private void setResourceTypes(Map<String, String[]> types) {
if ((types == null) || (types.size() == 0)) {
setValidConfiguration(false);
LOG.error(Messages.get().getBundle().key(Messages.LOG_NO_RESOURCE_TYPES_0));
}
m_resTypes = types;
} | [
"private",
"void",
"setResourceTypes",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"types",
")",
"{",
"if",
"(",
"(",
"types",
"==",
"null",
")",
"||",
"(",
"types",
".",
"size",
"(",
")",
"==",
"0",
")",
")",
"{",
"setValidConfigurati... | Sets the valid resource types of the editor.<p>
@param types the valid resource types of the editor | [
"Sets",
"the",
"valid",
"resource",
"types",
"of",
"the",
"editor",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsWorkplaceEditorConfiguration.java#L508-L515 |
icode/ameba-utils | src/main/java/ameba/util/Cookies.java | Cookies.newHttpOnlyCookie | public static NewCookie newHttpOnlyCookie(String name, String value) {
"""
<p>newHttpOnlyCookie.</p>
@param name a {@link java.lang.String} object.
@param value a {@link java.lang.String} object.
@return a {@link javax.ws.rs.core.NewCookie} object.
"""
/**
* Create a new instance.
... | java | public static NewCookie newHttpOnlyCookie(String name, String value) {
/**
* Create a new instance.
*
* @param name the name of the cookie
* @param value the value of the cookie
* @param path the URI path for which the cookie is valid
* @param dom... | [
"public",
"static",
"NewCookie",
"newHttpOnlyCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"/**\n * Create a new instance.\n *\n * @param name the name of the cookie\n * @param value the value of the cookie\n * @param path ... | <p>newHttpOnlyCookie.</p>
@param name a {@link java.lang.String} object.
@param value a {@link java.lang.String} object.
@return a {@link javax.ws.rs.core.NewCookie} object. | [
"<p",
">",
"newHttpOnlyCookie",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/Cookies.java#L56-L74 |
Azure/azure-sdk-for-java | policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java | PolicySetDefinitionsInner.getAtManagementGroup | public PolicySetDefinitionInner getAtManagementGroup(String policySetDefinitionName, String managementGroupId) {
"""
Retrieves a policy set definition.
This operation retrieves the policy set definition in the given management group with the given name.
@param policySetDefinitionName The name of the policy set... | java | public PolicySetDefinitionInner getAtManagementGroup(String policySetDefinitionName, String managementGroupId) {
return getAtManagementGroupWithServiceResponseAsync(policySetDefinitionName, managementGroupId).toBlocking().single().body();
} | [
"public",
"PolicySetDefinitionInner",
"getAtManagementGroup",
"(",
"String",
"policySetDefinitionName",
",",
"String",
"managementGroupId",
")",
"{",
"return",
"getAtManagementGroupWithServiceResponseAsync",
"(",
"policySetDefinitionName",
",",
"managementGroupId",
")",
".",
"t... | Retrieves a policy set definition.
This operation retrieves the policy set definition in the given management group with the given name.
@param policySetDefinitionName The name of the policy set definition to get.
@param managementGroupId The ID of the management group.
@throws IllegalArgumentException thrown if param... | [
"Retrieves",
"a",
"policy",
"set",
"definition",
".",
"This",
"operation",
"retrieves",
"the",
"policy",
"set",
"definition",
"in",
"the",
"given",
"management",
"group",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/policy/v2018_03_01/implementation/PolicySetDefinitionsInner.java#L871-L873 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java | XsdGeneratorHelper.parseXmlStream | public static Document parseXmlStream(final Reader xmlStream) {
"""
Parses the provided InputStream to create a dom Document.
@param xmlStream An InputStream connected to an XML document.
@return A DOM Document created from the contents of the provided stream.
"""
// Build a DOM model of the pro... | java | public static Document parseXmlStream(final Reader xmlStream) {
// Build a DOM model of the provided xmlFileStream.
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try {
return factory.newDocumentBuilder()... | [
"public",
"static",
"Document",
"parseXmlStream",
"(",
"final",
"Reader",
"xmlStream",
")",
"{",
"// Build a DOM model of the provided xmlFileStream.\r",
"final",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory... | Parses the provided InputStream to create a dom Document.
@param xmlStream An InputStream connected to an XML document.
@return A DOM Document created from the contents of the provided stream. | [
"Parses",
"the",
"provided",
"InputStream",
"to",
"create",
"a",
"dom",
"Document",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/XsdGeneratorHelper.java#L431-L442 |
wdullaer/SwipeActionAdapter | library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java | SwipeViewGroup.addBackground | public SwipeViewGroup addBackground(View background, SwipeDirection direction) {
"""
Add a View to the background of the Layout. The background should have the same height
as the contentView
@param background The View to be added to the Layout
@param direction The key to be used to find it again
@return A re... | java | public SwipeViewGroup addBackground(View background, SwipeDirection direction){
if(mBackgroundMap.get(direction) != null) removeView(mBackgroundMap.get(direction));
background.setVisibility(View.INVISIBLE);
mBackgroundMap.put(direction, background);
addView(background);
return t... | [
"public",
"SwipeViewGroup",
"addBackground",
"(",
"View",
"background",
",",
"SwipeDirection",
"direction",
")",
"{",
"if",
"(",
"mBackgroundMap",
".",
"get",
"(",
"direction",
")",
"!=",
"null",
")",
"removeView",
"(",
"mBackgroundMap",
".",
"get",
"(",
"dire... | Add a View to the background of the Layout. The background should have the same height
as the contentView
@param background The View to be added to the Layout
@param direction The key to be used to find it again
@return A reference to the a layout so commands can be chained | [
"Add",
"a",
"View",
"to",
"the",
"background",
"of",
"the",
"Layout",
".",
"The",
"background",
"should",
"have",
"the",
"same",
"height",
"as",
"the",
"contentView"
] | train | https://github.com/wdullaer/SwipeActionAdapter/blob/24a7e2ed953ac11ea0d8875d375bba571ffeba55/library/src/main/java/com/wdullaer/swipeactionadapter/SwipeViewGroup.java#L76-L83 |
UrielCh/ovh-java-sdk | ovh-java-sdk-kube/src/main/java/net/minidev/ovh/api/ApiOvhKube.java | ApiOvhKube.serviceName_publiccloud_node_nodeId_DELETE | public void serviceName_publiccloud_node_nodeId_DELETE(String serviceName, String nodeId) throws IOException {
"""
Delete a node on your cluster
REST: DELETE /kube/{serviceName}/publiccloud/node/{nodeId}
@param nodeId [required] Node ID
@param serviceName [required] Cluster ID
API beta
"""
String qPa... | java | public void serviceName_publiccloud_node_nodeId_DELETE(String serviceName, String nodeId) throws IOException {
String qPath = "/kube/{serviceName}/publiccloud/node/{nodeId}";
StringBuilder sb = path(qPath, serviceName, nodeId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_publiccloud_node_nodeId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"nodeId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/kube/{serviceName}/publiccloud/node/{nodeId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Delete a node on your cluster
REST: DELETE /kube/{serviceName}/publiccloud/node/{nodeId}
@param nodeId [required] Node ID
@param serviceName [required] Cluster ID
API beta | [
"Delete",
"a",
"node",
"on",
"your",
"cluster"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-kube/src/main/java/net/minidev/ovh/api/ApiOvhKube.java#L218-L222 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.getTypeDescriptor | protected static String getTypeDescriptor(Object type) {
"""
Returns the descriptor corresponding to the given class.
@param type The type
@return The descriptor for the class
"""
if (type instanceof Class) {
return Type.getDescriptor((Class) type);
} else if (type instanceof Ty... | java | protected static String getTypeDescriptor(Object type) {
if (type instanceof Class) {
return Type.getDescriptor((Class) type);
} else if (type instanceof Type) {
return ((Type) type).getDescriptor();
} else {
String className = type.toString();
ret... | [
"protected",
"static",
"String",
"getTypeDescriptor",
"(",
"Object",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"return",
"Type",
".",
"getDescriptor",
"(",
"(",
"Class",
")",
"type",
")",
";",
"}",
"else",
"if",
"(",
"type",
... | Returns the descriptor corresponding to the given class.
@param type The type
@return The descriptor for the class | [
"Returns",
"the",
"descriptor",
"corresponding",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L386-L395 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java | MetadataBuilder.forProvider | public static MetadataBuilder forProvider(Class<? extends RuleProvider> implementationType) {
"""
Create a new {@link RuleProviderMetadata} builder instance for the given {@link RuleProvider} type, using the provided parameters and
{@link RulesetMetadata} to seed sensible defaults.
"""
String id = imp... | java | public static MetadataBuilder forProvider(Class<? extends RuleProvider> implementationType)
{
String id = implementationType.getSimpleName();
RuleMetadata metadata = Annotations.getAnnotation(implementationType, RuleMetadata.class);
if (metadata != null && !metadata.id().isEmpty())
... | [
"public",
"static",
"MetadataBuilder",
"forProvider",
"(",
"Class",
"<",
"?",
"extends",
"RuleProvider",
">",
"implementationType",
")",
"{",
"String",
"id",
"=",
"implementationType",
".",
"getSimpleName",
"(",
")",
";",
"RuleMetadata",
"metadata",
"=",
"Annotati... | Create a new {@link RuleProviderMetadata} builder instance for the given {@link RuleProvider} type, using the provided parameters and
{@link RulesetMetadata} to seed sensible defaults. | [
"Create",
"a",
"new",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/metadata/MetadataBuilder.java#L70-L79 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-core/src/main/java/org/deeplearning4j/util/ModelGuesser.java | ModelGuesser.loadModelGuess | public static Model loadModelGuess(InputStream stream, File tempDirectory) throws Exception {
"""
As per {@link #loadModelGuess(InputStream)} but (optionally) allows copying to the specified temporary directory
@param stream Stream of the model file
@param tempDirectory Temporary/working directory. May be... | java | public static Model loadModelGuess(InputStream stream, File tempDirectory) throws Exception {
//Currently (Nov 2017): KerasModelImport doesn't support loading from input streams
//Simplest solution here: write to a temporary file
File f;
if(tempDirectory == null){
f = DL4JFil... | [
"public",
"static",
"Model",
"loadModelGuess",
"(",
"InputStream",
"stream",
",",
"File",
"tempDirectory",
")",
"throws",
"Exception",
"{",
"//Currently (Nov 2017): KerasModelImport doesn't support loading from input streams",
"//Simplest solution here: write to a temporary file",
"F... | As per {@link #loadModelGuess(InputStream)} but (optionally) allows copying to the specified temporary directory
@param stream Stream of the model file
@param tempDirectory Temporary/working directory. May be null. | [
"As",
"per",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-core/src/main/java/org/deeplearning4j/util/ModelGuesser.java#L188-L209 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.toNavigableMap | public <K, V> NavigableMap<K, V> toNavigableMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) {
"""
Returns a {@link NavigableMap} whose keys and values are the result of
applying the provided mapping functions to the input ele... | java | public <K, V> NavigableMap<K, V> toNavigableMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) {
return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, TreeMap::new));
} | [
"public",
"<",
"K",
",",
"V",
">",
"NavigableMap",
"<",
"K",
",",
"V",
">",
"toNavigableMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"keyMapper",
",",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"V",
... | Returns a {@link NavigableMap} whose keys and values are the result of
applying the provided mapping functions to the input elements.
<p>
This is a <a href="package-summary.html#StreamOps">terminal</a>
operation.
<p>
If the mapped keys contains duplicates (according to
{@link Object#equals(Object)}), the value mappin... | [
"Returns",
"a",
"{",
"@link",
"NavigableMap",
"}",
"whose",
"keys",
"and",
"values",
"are",
"the",
"result",
"of",
"applying",
"the",
"provided",
"mapping",
"functions",
"to",
"the",
"input",
"elements",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L1258-L1261 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java | CommitRequestHandler.copyTxnEpochSegmentsAndCommitTxns | private CompletableFuture<Void> copyTxnEpochSegmentsAndCommitTxns(String scope, String stream, List<UUID> transactionsToCommit,
List<Long> segmentIds) {
"""
This method is called in the rolling transaction flow.
This method creates duplicate se... | java | private CompletableFuture<Void> copyTxnEpochSegmentsAndCommitTxns(String scope, String stream, List<UUID> transactionsToCommit,
List<Long> segmentIds) {
// 1. create duplicate segments
// 2. merge transactions in those segments
... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"copyTxnEpochSegmentsAndCommitTxns",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"List",
"<",
"UUID",
">",
"transactionsToCommit",
",",
"List",
"<",
"Long",
">",
"segmentIds",
")",
"{",
"// 1. create dupl... | This method is called in the rolling transaction flow.
This method creates duplicate segments for transaction epoch. It then merges all transactions from the list into
those duplicate segments. | [
"This",
"method",
"is",
"called",
"in",
"the",
"rolling",
"transaction",
"flow",
".",
"This",
"method",
"creates",
"duplicate",
"segments",
"for",
"transaction",
"epoch",
".",
"It",
"then",
"merges",
"all",
"transactions",
"from",
"the",
"list",
"into",
"those... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/eventProcessor/requesthandlers/CommitRequestHandler.java#L253-L272 |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.getCookie | public static Cookie getCookie(String name, Cookie[] cookies) {
"""
通过名称获取Cookie
@param name Cookie名
@param cookies cookie数组
@return {@link Cookie}
"""
if (Checker.isNotEmpty(cookies)) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
... | java | public static Cookie getCookie(String name, Cookie[] cookies) {
if (Checker.isNotEmpty(cookies)) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
return cookie;
}
}
}
return null;
} | [
"public",
"static",
"Cookie",
"getCookie",
"(",
"String",
"name",
",",
"Cookie",
"[",
"]",
"cookies",
")",
"{",
"if",
"(",
"Checker",
".",
"isNotEmpty",
"(",
"cookies",
")",
")",
"{",
"for",
"(",
"Cookie",
"cookie",
":",
"cookies",
")",
"{",
"if",
"(... | 通过名称获取Cookie
@param name Cookie名
@param cookies cookie数组
@return {@link Cookie} | [
"通过名称获取Cookie"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L641-L650 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_output_elasticsearch_alias_aliasId_PUT | public OvhOperation serviceName_output_elasticsearch_alias_aliasId_PUT(String serviceName, String aliasId, String description, String optionId) throws IOException {
"""
Update specified elasticsearch alias
REST: PUT /dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}
@param serviceName [required] Se... | java | public OvhOperation serviceName_output_elasticsearch_alias_aliasId_PUT(String serviceName, String aliasId, String description, String optionId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}";
StringBuilder sb = path(qPath, serviceName, aliasId);
HashMap<String... | [
"public",
"OvhOperation",
"serviceName_output_elasticsearch_alias_aliasId_PUT",
"(",
"String",
"serviceName",
",",
"String",
"aliasId",
",",
"String",
"description",
",",
"String",
"optionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/logs/{serv... | Update specified elasticsearch alias
REST: PUT /dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}
@param serviceName [required] Service name
@param aliasId [required] Alias ID
@param optionId [required] Option ID
@param description [required] Description | [
"Update",
"specified",
"elasticsearch",
"alias"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1718-L1726 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.