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 |
|---|---|---|---|---|---|---|---|---|---|---|
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.createArea3DEffectGradient | protected RadialGradientPaint createArea3DEffectGradient(final int WIDTH, final float RADIUS_FACTOR) {
"""
Returns a radial gradient paint that will be used as overlay for the track or area image
to achieve some kind of a 3d effect.
@param WIDTH
@param RADIUS_FACTOR
@return a radial gradient paint that will be... | java | protected RadialGradientPaint createArea3DEffectGradient(final int WIDTH, final float RADIUS_FACTOR) {
final float[] FRACTIONS;
final Color[] COLORS;
FRACTIONS = new float[]{
0.0f,
0.6f,
1.0f
};
COLORS = new Color[]{
new Color(1.0f... | [
"protected",
"RadialGradientPaint",
"createArea3DEffectGradient",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"float",
"RADIUS_FACTOR",
")",
"{",
"final",
"float",
"[",
"]",
"FRACTIONS",
";",
"final",
"Color",
"[",
"]",
"COLORS",
";",
"FRACTIONS",
"=",
"new",
... | Returns a radial gradient paint that will be used as overlay for the track or area image
to achieve some kind of a 3d effect.
@param WIDTH
@param RADIUS_FACTOR
@return a radial gradient paint that will be used as overlay for the track or area image | [
"Returns",
"a",
"radial",
"gradient",
"paint",
"that",
"will",
"be",
"used",
"as",
"overlay",
"for",
"the",
"track",
"or",
"area",
"image",
"to",
"achieve",
"some",
"kind",
"of",
"a",
"3d",
"effect",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L1238-L1255 |
HotelsDotCom/corc | corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java | CorcInputFormat.getSplitPath | private Path getSplitPath(FileSplit inputSplit, JobConf conf) throws IOException {
"""
/*
This is to work around an issue reading from ORC transactional data sets that contain only deltas. These contain
synthesised column names that are not usable to us.
"""
Path path = inputSplit.getPath();
if (inpu... | java | private Path getSplitPath(FileSplit inputSplit, JobConf conf) throws IOException {
Path path = inputSplit.getPath();
if (inputSplit instanceof OrcSplit) {
OrcSplit orcSplit = (OrcSplit) inputSplit;
List<Long> deltas = orcSplit.getDeltas();
if (!orcSplit.hasBase() && deltas.size() >= 2) {
... | [
"private",
"Path",
"getSplitPath",
"(",
"FileSplit",
"inputSplit",
",",
"JobConf",
"conf",
")",
"throws",
"IOException",
"{",
"Path",
"path",
"=",
"inputSplit",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"inputSplit",
"instanceof",
"OrcSplit",
")",
"{",
"OrcS... | /*
This is to work around an issue reading from ORC transactional data sets that contain only deltas. These contain
synthesised column names that are not usable to us. | [
"/",
"*",
"This",
"is",
"to",
"work",
"around",
"an",
"issue",
"reading",
"from",
"ORC",
"transactional",
"data",
"sets",
"that",
"contain",
"only",
"deltas",
".",
"These",
"contain",
"synthesised",
"column",
"names",
"that",
"are",
"not",
"usable",
"to",
... | train | https://github.com/HotelsDotCom/corc/blob/37ecb5966315e4cf630a878ffcbada61c50bdcd3/corc-core/src/main/java/com/hotels/corc/mapred/CorcInputFormat.java#L257-L268 |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/db/ModelMapper.java | ModelMapper.getDependency | public Dependency getDependency(final DbDependency dbDependency, final String sourceName, final String sourceVersion) {
"""
Transform a dependency from database model to client/server model
@param dbDependency DbDependency
@return Dependency
"""
final DbArtifact dbArtifact = repositoryHandler.getAr... | java | public Dependency getDependency(final DbDependency dbDependency, final String sourceName, final String sourceVersion) {
final DbArtifact dbArtifact = repositoryHandler.getArtifact(dbDependency.getTarget());
final Artifact artifact;
if (dbArtifact == null) {
artifact = DataUtils.crea... | [
"public",
"Dependency",
"getDependency",
"(",
"final",
"DbDependency",
"dbDependency",
",",
"final",
"String",
"sourceName",
",",
"final",
"String",
"sourceVersion",
")",
"{",
"final",
"DbArtifact",
"dbArtifact",
"=",
"repositoryHandler",
".",
"getArtifact",
"(",
"d... | Transform a dependency from database model to client/server model
@param dbDependency DbDependency
@return Dependency | [
"Transform",
"a",
"dependency",
"from",
"database",
"model",
"to",
"client",
"/",
"server",
"model"
] | train | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/db/ModelMapper.java#L233-L248 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/idp/IdpMetadataGenerator.java | IdpMetadataGenerator.getServerURL | private String getServerURL(String entityBaseURL, String entityAlias, String processingURL) {
"""
Creates URL at which the local server is capable of accepting incoming SAML messages.
@param entityBaseURL
entity ID
@param processingURL
local context at which processing filter is waiting
@return URL of local... | java | private String getServerURL(String entityBaseURL, String entityAlias, String processingURL) {
return getServerURL(entityBaseURL, entityAlias, processingURL, null);
} | [
"private",
"String",
"getServerURL",
"(",
"String",
"entityBaseURL",
",",
"String",
"entityAlias",
",",
"String",
"processingURL",
")",
"{",
"return",
"getServerURL",
"(",
"entityBaseURL",
",",
"entityAlias",
",",
"processingURL",
",",
"null",
")",
";",
"}"
] | Creates URL at which the local server is capable of accepting incoming SAML messages.
@param entityBaseURL
entity ID
@param processingURL
local context at which processing filter is waiting
@return URL of local server | [
"Creates",
"URL",
"at",
"which",
"the",
"local",
"server",
"is",
"capable",
"of",
"accepting",
"incoming",
"SAML",
"messages",
"."
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/idp/IdpMetadataGenerator.java#L499-L503 |
dwdyer/watchmaker | examples/src/java/main/org/uncommons/watchmaker/examples/sudoku/SudokuCellRenderer.java | SudokuCellRenderer.getBorder | private Border getBorder(int row, int column) {
"""
Get appropriate border for cell based on its position in the grid.
"""
if (row % 3 == 2)
{
switch (column % 3)
{
case 2: return BOTTOM_RIGHT_BORDER;
case 0: return BOTTOM_LEFT_BORDER;
... | java | private Border getBorder(int row, int column)
{
if (row % 3 == 2)
{
switch (column % 3)
{
case 2: return BOTTOM_RIGHT_BORDER;
case 0: return BOTTOM_LEFT_BORDER;
default: return BOTTOM_BORDER;
}
}
else... | [
"private",
"Border",
"getBorder",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"if",
"(",
"row",
"%",
"3",
"==",
"2",
")",
"{",
"switch",
"(",
"column",
"%",
"3",
")",
"{",
"case",
"2",
":",
"return",
"BOTTOM_RIGHT_BORDER",
";",
"case",
"0",
... | Get appropriate border for cell based on its position in the grid. | [
"Get",
"appropriate",
"border",
"for",
"cell",
"based",
"on",
"its",
"position",
"in",
"the",
"grid",
"."
] | train | https://github.com/dwdyer/watchmaker/blob/33d942350e6bf7d9a17b9262a4f898158530247e/examples/src/java/main/org/uncommons/watchmaker/examples/sudoku/SudokuCellRenderer.java#L134-L161 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.deleteIfExists | public static void deleteIfExists(FileSystem fs, Path path, boolean recursive) throws IOException {
"""
A wrapper around {@link FileSystem#delete(Path, boolean)} that only deletes a given {@link Path} if it is present
on the given {@link FileSystem}.
"""
if (fs.exists(path)) {
deletePath(fs, path, r... | java | public static void deleteIfExists(FileSystem fs, Path path, boolean recursive) throws IOException {
if (fs.exists(path)) {
deletePath(fs, path, recursive);
}
} | [
"public",
"static",
"void",
"deleteIfExists",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"boolean",
"recursive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"fs",
".",
"exists",
"(",
"path",
")",
")",
"{",
"deletePath",
"(",
"fs",
",",
"path",
... | A wrapper around {@link FileSystem#delete(Path, boolean)} that only deletes a given {@link Path} if it is present
on the given {@link FileSystem}. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L171-L175 |
ironjacamar/ironjacamar | core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerImpl.java | WorkManagerImpl.checkAndVerifyWork | private void checkAndVerifyWork(Work work, ExecutionContext executionContext) throws WorkException {
"""
Check and verify work before submitting.
@param work the work instance
@param executionContext any execution context that is passed by apadater
@throws WorkException if any exception occurs
"""
if ... | java | private void checkAndVerifyWork(Work work, ExecutionContext executionContext) throws WorkException
{
if (specCompliant)
{
verifyWork(work);
}
if (work instanceof WorkContextProvider && executionContext != null)
{
//Implements WorkContextProvider and not-null Execution... | [
"private",
"void",
"checkAndVerifyWork",
"(",
"Work",
"work",
",",
"ExecutionContext",
"executionContext",
")",
"throws",
"WorkException",
"{",
"if",
"(",
"specCompliant",
")",
"{",
"verifyWork",
"(",
"work",
")",
";",
"}",
"if",
"(",
"work",
"instanceof",
"Wo... | Check and verify work before submitting.
@param work the work instance
@param executionContext any execution context that is passed by apadater
@throws WorkException if any exception occurs | [
"Check",
"and",
"verify",
"work",
"before",
"submitting",
"."
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/core/src/main/java/org/ironjacamar/core/workmanager/WorkManagerImpl.java#L1060-L1072 |
pf4j/pf4j | pf4j/src/main/java/org/pf4j/util/ClassUtils.java | ClassUtils.getAnnotationMirror | public static AnnotationMirror getAnnotationMirror(TypeElement typeElement, Class<?> annotationClass) {
"""
Get a certain annotation of a {@link TypeElement}.
See <a href="https://stackoverflow.com/a/10167558">stackoverflow.com</a> for more information.
@param typeElement the type element, that contains the re... | java | public static AnnotationMirror getAnnotationMirror(TypeElement typeElement, Class<?> annotationClass) {
String annotationClassName = annotationClass.getName();
for (AnnotationMirror m : typeElement.getAnnotationMirrors()) {
if (m.getAnnotationType().toString().equals(annotationClassName)) {
... | [
"public",
"static",
"AnnotationMirror",
"getAnnotationMirror",
"(",
"TypeElement",
"typeElement",
",",
"Class",
"<",
"?",
">",
"annotationClass",
")",
"{",
"String",
"annotationClassName",
"=",
"annotationClass",
".",
"getName",
"(",
")",
";",
"for",
"(",
"Annotat... | Get a certain annotation of a {@link TypeElement}.
See <a href="https://stackoverflow.com/a/10167558">stackoverflow.com</a> for more information.
@param typeElement the type element, that contains the requested annotation
@param annotationClass the class of the requested annotation
@return the requested annotation or ... | [
"Get",
"a",
"certain",
"annotation",
"of",
"a",
"{",
"@link",
"TypeElement",
"}",
".",
"See",
"<a",
"href",
"=",
"https",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"a",
"/",
"10167558",
">",
"stackoverflow",
".",
"com<",
"/",
"a",
">",
"for",
"mor... | train | https://github.com/pf4j/pf4j/blob/6dd7a6069f0e2fbd842c81e2c8c388918b88ea81/pf4j/src/main/java/org/pf4j/util/ClassUtils.java#L89-L97 |
ModeShape/modeshape | connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java | ObjectId.valueOf | public static ObjectId valueOf( String uuid ) {
"""
Constructs instance of this class from its textual representation.
@param uuid the textual representation of this object.
@return object instance.
"""
int p = uuid.indexOf("/");
if (p < 0) {
return new ObjectId(Type.OBJECT, uui... | java | public static ObjectId valueOf( String uuid ) {
int p = uuid.indexOf("/");
if (p < 0) {
return new ObjectId(Type.OBJECT, uuid);
}
int p1 = p;
while (p > 0) {
p1 = p;
p = uuid.indexOf("/", p + 1);
}
p = p1;
... | [
"public",
"static",
"ObjectId",
"valueOf",
"(",
"String",
"uuid",
")",
"{",
"int",
"p",
"=",
"uuid",
".",
"indexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"p",
"<",
"0",
")",
"{",
"return",
"new",
"ObjectId",
"(",
"Type",
".",
"OBJECT",
",",
"uuid",
... | Constructs instance of this class from its textual representation.
@param uuid the textual representation of this object.
@return object instance. | [
"Constructs",
"instance",
"of",
"this",
"class",
"from",
"its",
"textual",
"representation",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/connectors/modeshape-connector-cmis/src/main/java/org/modeshape/connector/cmis/ObjectId.java#L77-L94 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonth.java | YearMonth.withYear | public YearMonth withYear(int year) {
"""
Returns a copy of this year-month with the year field updated.
<p>
YearMonth is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
year changed.
@param year the year to set
@return a copy of this object with the f... | java | public YearMonth withYear(int year) {
int[] newValues = getValues();
newValues = getChronology().year().set(this, YEAR, newValues, year);
return new YearMonth(this, newValues);
} | [
"public",
"YearMonth",
"withYear",
"(",
"int",
"year",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"year",
"(",
")",
".",
"set",
"(",
"this",
",",
"YEAR",
",",
"newValues"... | Returns a copy of this year-month with the year field updated.
<p>
YearMonth is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
year changed.
@param year the year to set
@return a copy of this object with the field set, never null
@throws IllegalArgumentException ... | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"month",
"with",
"the",
"year",
"field",
"updated",
".",
"<p",
">",
"YearMonth",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",
"a",
"new",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonth.java#L734-L738 |
shrinkwrap/resolver | api/src/main/java/org/jboss/shrinkwrap/resolver/api/ResolverSystemFactory.java | ResolverSystemFactory.createFromUserView | static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView(
final Class<RESOLVERSYSTEMTYPE> userViewClass, final ClassLoader cl) {
"""
Creates a new {@link ResolverSystem} instance of the specified user view type using the specified {@link ClassLoader}.
Will consult a con... | java | static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView(
final Class<RESOLVERSYSTEMTYPE> userViewClass, final ClassLoader cl) {
assert userViewClass != null : "user view class must be specified";
assert cl != null : "ClassLoader must be specified";
... | [
"static",
"<",
"RESOLVERSYSTEMTYPE",
"extends",
"ResolverSystem",
">",
"RESOLVERSYSTEMTYPE",
"createFromUserView",
"(",
"final",
"Class",
"<",
"RESOLVERSYSTEMTYPE",
">",
"userViewClass",
",",
"final",
"ClassLoader",
"cl",
")",
"{",
"assert",
"userViewClass",
"!=",
"nu... | Creates a new {@link ResolverSystem} instance of the specified user view type using the specified {@link ClassLoader}.
Will consult a configuration file visible to the specified {@link ClassLoader} named
"META-INF/services/$fullyQualfiedClassName" which should contain a key=value format with the key
{@link ResolverSyst... | [
"Creates",
"a",
"new",
"{",
"@link",
"ResolverSystem",
"}",
"instance",
"of",
"the",
"specified",
"user",
"view",
"type",
"using",
"the",
"specified",
"{",
"@link",
"ClassLoader",
"}",
".",
"Will",
"consult",
"a",
"configuration",
"file",
"visible",
"to",
"t... | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/api/src/main/java/org/jboss/shrinkwrap/resolver/api/ResolverSystemFactory.java#L69-L98 |
monitorjbl/json-view | spring-json-view/src/main/java/com/monitorjbl/json/JsonViewSupportFactoryBean.java | JsonViewSupportFactoryBean.registerCustomSerializer | public <T> void registerCustomSerializer( Class<T> cls, JsonSerializer<T> forType ) {
"""
Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types.<br>
This way you could register for instance a JODA serialization as a DateTimeSerializer. <br>
Thus, when J... | java | public <T> void registerCustomSerializer( Class<T> cls, JsonSerializer<T> forType )
{
this.converter.registerCustomSerializer( cls, forType );
} | [
"public",
"<",
"T",
">",
"void",
"registerCustomSerializer",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"JsonSerializer",
"<",
"T",
">",
"forType",
")",
"{",
"this",
".",
"converter",
".",
"registerCustomSerializer",
"(",
"cls",
",",
"forType",
")",
";",
"... | Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types.<br>
This way you could register for instance a JODA serialization as a DateTimeSerializer. <br>
Thus, when JSonView find a field of that type (DateTime), it will delegate the serialization to the serialize... | [
"Registering",
"custom",
"serializer",
"allows",
"to",
"the",
"JSonView",
"to",
"deal",
"with",
"custom",
"serializations",
"for",
"certains",
"field",
"types",
".",
"<br",
">",
"This",
"way",
"you",
"could",
"register",
"for",
"instance",
"a",
"JODA",
"serial... | train | https://github.com/monitorjbl/json-view/blob/c01505ac76e5416abe8af85c5816f60bd5d483ea/spring-json-view/src/main/java/com/monitorjbl/json/JsonViewSupportFactoryBean.java#L103-L106 |
netplex/json-smart-v2 | accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java | ASMUtil.autoBoxing | protected static void autoBoxing(MethodVisitor mv, Type fieldType) {
"""
Append the call of proper autoboxing method for the given primitif type.
"""
switch (fieldType.getSort()) {
case Type.BOOLEAN:
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;");
break;
... | java | protected static void autoBoxing(MethodVisitor mv, Type fieldType) {
switch (fieldType.getSort()) {
case Type.BOOLEAN:
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Boolean", "valueOf", "(Z)Ljava/lang/Boolean;");
break;
case Type.BYTE:
mv.visitMethodInsn(INVOKESTATIC, "java/lang/Byte", "valueOf", "(B)Ljava... | [
"protected",
"static",
"void",
"autoBoxing",
"(",
"MethodVisitor",
"mv",
",",
"Type",
"fieldType",
")",
"{",
"switch",
"(",
"fieldType",
".",
"getSort",
"(",
")",
")",
"{",
"case",
"Type",
".",
"BOOLEAN",
":",
"mv",
".",
"visitMethodInsn",
"(",
"INVOKESTAT... | Append the call of proper autoboxing method for the given primitif type. | [
"Append",
"the",
"call",
"of",
"proper",
"autoboxing",
"method",
"for",
"the",
"given",
"primitif",
"type",
"."
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java#L73-L100 |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/util/MtasSolrStatus.java | MtasSolrStatus.getBoolean | private final Boolean getBoolean(NamedList<Object> response, String... args) {
"""
Gets the boolean.
@param response
the response
@param args
the args
@return the boolean
"""
Object objectItem = response.findRecursive(args);
Boolean result = null;
if (objectItem != null && objectItem instanc... | java | private final Boolean getBoolean(NamedList<Object> response, String... args) {
Object objectItem = response.findRecursive(args);
Boolean result = null;
if (objectItem != null && objectItem instanceof Boolean) {
result = (Boolean) objectItem;
}
return result;
} | [
"private",
"final",
"Boolean",
"getBoolean",
"(",
"NamedList",
"<",
"Object",
">",
"response",
",",
"String",
"...",
"args",
")",
"{",
"Object",
"objectItem",
"=",
"response",
".",
"findRecursive",
"(",
"args",
")",
";",
"Boolean",
"result",
"=",
"null",
"... | Gets the boolean.
@param response
the response
@param args
the args
@return the boolean | [
"Gets",
"the",
"boolean",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/util/MtasSolrStatus.java#L642-L649 |
alkacon/opencms-core | src/org/opencms/util/CmsRequestUtil.java | CmsRequestUtil.redirectRequestSecure | public static void redirectRequestSecure(CmsJspActionElement jsp, String target) throws IOException {
"""
Redirects the response to the target link.<p>
Use this method instead of {@link javax.servlet.http.HttpServletResponse#sendRedirect(java.lang.String)}
to avoid relative links with secure sites (and issues ... | java | public static void redirectRequestSecure(CmsJspActionElement jsp, String target) throws IOException {
jsp.getResponse().sendRedirect(OpenCms.getLinkManager().substituteLink(jsp.getCmsObject(), target, null, true));
} | [
"public",
"static",
"void",
"redirectRequestSecure",
"(",
"CmsJspActionElement",
"jsp",
",",
"String",
"target",
")",
"throws",
"IOException",
"{",
"jsp",
".",
"getResponse",
"(",
")",
".",
"sendRedirect",
"(",
"OpenCms",
".",
"getLinkManager",
"(",
")",
".",
... | Redirects the response to the target link.<p>
Use this method instead of {@link javax.servlet.http.HttpServletResponse#sendRedirect(java.lang.String)}
to avoid relative links with secure sites (and issues with apache).<p>
@param jsp the OpenCms JSP context
@param target the target link
@throws IOException if somethi... | [
"Redirects",
"the",
"response",
"to",
"the",
"target",
"link",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsRequestUtil.java#L870-L873 |
lets-blade/blade | src/main/java/com/blade/kit/AsmKit.java | AsmKit.sameType | private static boolean sameType(Type[] types, Class<?>[] classes) {
"""
Compare whether the parameter type is consistent
@param types the type of the asm({@link Type})
@param classes java type({@link Class})
@return return param type equals
"""
if (types.length != classes.length) return false;
... | java | private static boolean sameType(Type[] types, Class<?>[] classes) {
if (types.length != classes.length) return false;
for (int i = 0; i < types.length; i++) {
if (!Type.getType(classes[i]).equals(types[i])) return false;
}
return true;
} | [
"private",
"static",
"boolean",
"sameType",
"(",
"Type",
"[",
"]",
"types",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"classes",
")",
"{",
"if",
"(",
"types",
".",
"length",
"!=",
"classes",
".",
"length",
")",
"return",
"false",
";",
"for",
"(",
"int... | Compare whether the parameter type is consistent
@param types the type of the asm({@link Type})
@param classes java type({@link Class})
@return return param type equals | [
"Compare",
"whether",
"the",
"parameter",
"type",
"is",
"consistent"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/AsmKit.java#L49-L55 |
alkacon/opencms-core | src/org/opencms/gwt/CmsGwtActionElement.java | CmsGwtActionElement.exportCommon | public static String exportCommon(CmsObject cms, CmsCoreData coreData) throws Exception {
"""
Returns the serialized data for the core provider wrapped into a script tag.<p>
@param cms the CMS context
@param coreData the core data to write into the page
@return the data
@throws Exception if something goe... | java | public static String exportCommon(CmsObject cms, CmsCoreData coreData) throws Exception {
// determine the workplace locale
String wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms).getLanguage();
if (CmsStringUtil.isEmptyOrWhitespaceOnly(wpLocale)) {
// if no locale w... | [
"public",
"static",
"String",
"exportCommon",
"(",
"CmsObject",
"cms",
",",
"CmsCoreData",
"coreData",
")",
"throws",
"Exception",
"{",
"// determine the workplace locale",
"String",
"wpLocale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceL... | Returns the serialized data for the core provider wrapped into a script tag.<p>
@param cms the CMS context
@param coreData the core data to write into the page
@return the data
@throws Exception if something goes wrong | [
"Returns",
"the",
"serialized",
"data",
"for",
"the",
"core",
"provider",
"wrapped",
"into",
"a",
"script",
"tag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsGwtActionElement.java#L117-L167 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java | XSLTAttributeDef.processENUM | Object processENUM(StylesheetHandler handler, String uri, String name,
String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException {
"""
Process an attribute string of type T_ENUM into a int value.
@param handler non-null reference to curren... | java | Object processENUM(StylesheetHandler handler, String uri, String name,
String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
AVT avt = null;
if (getSupportsAVT()) {
try
{
avt = new AVT(handler, uri, name, rawName, value... | [
"Object",
"processENUM",
"(",
"StylesheetHandler",
"handler",
",",
"String",
"uri",
",",
"String",
"name",
",",
"String",
"rawName",
",",
"String",
"value",
",",
"ElemTemplateElement",
"owner",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",... | Process an attribute string of type T_ENUM into a int value.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param uri The Namespace URI, or an empty string.
@param name The local name (without prefix), or empty string if not namespace processing.
@param rawName The ... | [
"Process",
"an",
"attribute",
"string",
"of",
"type",
"T_ENUM",
"into",
"a",
"int",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java#L622-L654 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java | AbstractApplication.preloadAndLaunch | protected static void preloadAndLaunch(final Class<? extends Preloader> preloaderClass, final String... args) {
"""
Launch the Current JavaFX Application with given preloader.
@param preloaderClass the preloader class used as splash screen with progress
@param args arguments passed to java command line
"""... | java | protected static void preloadAndLaunch(final Class<? extends Preloader> preloaderClass, final String... args) {
preloadAndLaunch(ClassUtility.getClassFromStaticMethod(3), preloaderClass, args);
} | [
"protected",
"static",
"void",
"preloadAndLaunch",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Preloader",
">",
"preloaderClass",
",",
"final",
"String",
"...",
"args",
")",
"{",
"preloadAndLaunch",
"(",
"ClassUtility",
".",
"getClassFromStaticMethod",
"(",
"3",
... | Launch the Current JavaFX Application with given preloader.
@param preloaderClass the preloader class used as splash screen with progress
@param args arguments passed to java command line | [
"Launch",
"the",
"Current",
"JavaFX",
"Application",
"with",
"given",
"preloader",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/application/AbstractApplication.java#L113-L115 |
springfox/springfox | springfox-core/src/main/java/springfox/documentation/builders/BuilderDefaults.java | BuilderDefaults.replaceIfMoreSpecific | public static ResolvedType replaceIfMoreSpecific(ResolvedType replacement, ResolvedType defaultValue) {
"""
Coalesces the resolved type. Preservers the default value if the replacement is either null or represents
a type that is less specific than the default value. For e.g. if default value represents a String t... | java | public static ResolvedType replaceIfMoreSpecific(ResolvedType replacement, ResolvedType defaultValue) {
ResolvedType toReturn = defaultIfAbsent(replacement, defaultValue);
if (isObject(replacement) && isNotObject(defaultValue)) {
return defaultValue;
}
return toReturn;
} | [
"public",
"static",
"ResolvedType",
"replaceIfMoreSpecific",
"(",
"ResolvedType",
"replacement",
",",
"ResolvedType",
"defaultValue",
")",
"{",
"ResolvedType",
"toReturn",
"=",
"defaultIfAbsent",
"(",
"replacement",
",",
"defaultValue",
")",
";",
"if",
"(",
"isObject"... | Coalesces the resolved type. Preservers the default value if the replacement is either null or represents
a type that is less specific than the default value. For e.g. if default value represents a String then
the replacement value has to be any value that is a subclass of Object. If it represents Object.class then
the... | [
"Coalesces",
"the",
"resolved",
"type",
".",
"Preservers",
"the",
"default",
"value",
"if",
"the",
"replacement",
"is",
"either",
"null",
"or",
"represents",
"a",
"type",
"that",
"is",
"less",
"specific",
"than",
"the",
"default",
"value",
".",
"For",
"e",
... | train | https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/builders/BuilderDefaults.java#L127-L133 |
ddf-project/DDF | core/src/main/java/io/ddf/util/DDFUtils.java | DDFUtils.generateObjectName | public static String generateObjectName(Object obj, String sourceName, String operation, String desiredName) {
"""
Heuristic: if the source/parent already has a table name then we can add something that identifies the operation.
Plus a unique extension if needed. If the starting name is already too long, we call ... | java | public static String generateObjectName(Object obj, String sourceName, String operation, String desiredName) {
if (Strings.isNullOrEmpty(desiredName)) {
if (Strings.isNullOrEmpty(sourceName)) {
return generateUniqueName(obj);
} else if (Strings.isNullOrEmpty(operation)) {
desiredName =... | [
"public",
"static",
"String",
"generateObjectName",
"(",
"Object",
"obj",
",",
"String",
"sourceName",
",",
"String",
"operation",
",",
"String",
"desiredName",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"desiredName",
")",
")",
"{",
"if",
"(... | Heuristic: if the source/parent already has a table name then we can add something that identifies the operation.
Plus a unique extension if needed. If the starting name is already too long, we call that a degenerate case, for
which we go back to UUID-based. All this is overridden if the caller specifies a desired name... | [
"Heuristic",
":",
"if",
"the",
"source",
"/",
"parent",
"already",
"has",
"a",
"table",
"name",
"then",
"we",
"can",
"add",
"something",
"that",
"identifies",
"the",
"operation",
".",
"Plus",
"a",
"unique",
"extension",
"if",
"needed",
".",
"If",
"the",
... | train | https://github.com/ddf-project/DDF/blob/e4e68315dcec1ed8b287bf1ee73baa88e7e41eba/core/src/main/java/io/ddf/util/DDFUtils.java#L26-L44 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_ips_ip_GET | public OvhIP serviceName_ips_ip_GET(String serviceName, String ip) throws IOException {
"""
Get this object properties
REST: GET /xdsl/{serviceName}/ips/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] The IP address
"""
String qPath = "/xdsl/{serviceName}/ips... | java | public OvhIP serviceName_ips_ip_GET(String serviceName, String ip) throws IOException {
String qPath = "/xdsl/{serviceName}/ips/{ip}";
StringBuilder sb = path(qPath, serviceName, ip);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhIP.class);
} | [
"public",
"OvhIP",
"serviceName_ips_ip_GET",
"(",
"String",
"serviceName",
",",
"String",
"ip",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/ips/{ip}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"serviceName",
... | Get this object properties
REST: GET /xdsl/{serviceName}/ips/{ip}
@param serviceName [required] The internal name of your XDSL offer
@param ip [required] The IP address | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1467-L1472 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/docs/TypeSignature.java | TypeSignature.ofMap | public static TypeSignature ofMap(Class<?> namedKeyType, Class<?> namedValueType) {
"""
Creates a new type signature for the map with the specified named key and value types.
This method is a shortcut of:
<pre>{@code
ofMap(ofNamed(namedKeyType), ofNamed(namedValueType));
}</pre>
"""
return ofMap(of... | java | public static TypeSignature ofMap(Class<?> namedKeyType, Class<?> namedValueType) {
return ofMap(ofNamed(namedKeyType, "namedKeyType"), ofNamed(namedValueType, "namedValueType"));
} | [
"public",
"static",
"TypeSignature",
"ofMap",
"(",
"Class",
"<",
"?",
">",
"namedKeyType",
",",
"Class",
"<",
"?",
">",
"namedValueType",
")",
"{",
"return",
"ofMap",
"(",
"ofNamed",
"(",
"namedKeyType",
",",
"\"namedKeyType\"",
")",
",",
"ofNamed",
"(",
"... | Creates a new type signature for the map with the specified named key and value types.
This method is a shortcut of:
<pre>{@code
ofMap(ofNamed(namedKeyType), ofNamed(namedValueType));
}</pre> | [
"Creates",
"a",
"new",
"type",
"signature",
"for",
"the",
"map",
"with",
"the",
"specified",
"named",
"key",
"and",
"value",
"types",
".",
"This",
"method",
"is",
"a",
"shortcut",
"of",
":",
"<pre",
">",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/docs/TypeSignature.java#L171-L173 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderItemUrl.java | OrderItemUrl.updateItemDutyUrl | public static MozuUrl updateItemDutyUrl(Double dutyAmount, String orderId, String orderItemId, String responseFields, String updateMode, String version) {
"""
Get Resource Url for UpdateItemDuty
@param dutyAmount The amount added to the order item for duty fees.
@param orderId Unique identifier of the order.
... | java | public static MozuUrl updateItemDutyUrl(Double dutyAmount, String orderId, String orderItemId, String responseFields, String updateMode, String version)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{orderItemId}/dutyAmount/{dutyAmount}?updatemode={updateMode}&version={version}&... | [
"public",
"static",
"MozuUrl",
"updateItemDutyUrl",
"(",
"Double",
"dutyAmount",
",",
"String",
"orderId",
",",
"String",
"orderItemId",
",",
"String",
"responseFields",
",",
"String",
"updateMode",
",",
"String",
"version",
")",
"{",
"UrlFormatter",
"formatter",
... | Get Resource Url for UpdateItemDuty
@param dutyAmount The amount added to the order item for duty fees.
@param orderId Unique identifier of the order.
@param orderItemId Unique identifier of the item to remove from the order.
@param responseFields Filtering syntax appended to an API call to increase or decrease the am... | [
"Get",
"Resource",
"Url",
"for",
"UpdateItemDuty",
"@param",
"dutyAmount",
"The",
"amount",
"added",
"to",
"the",
"order",
"item",
"for",
"duty",
"fees",
"."
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/orders/OrderItemUrl.java#L121-L131 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/octracker/ConnectionDataGroup.java | ConnectionDataGroup.createnewConnectionData | private ConnectionData createnewConnectionData(NetworkConnection vc) throws FrameworkException {
"""
Create a new Connection data object
@param vc The network connection over which to create a connection data
@return ConnectionData A new connection data object
@throws FrameworkException is thrown if the new c... | java | private ConnectionData createnewConnectionData(NetworkConnection vc) throws FrameworkException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createnewConnectionData", vc);
ConnectionData connectionDataToUse;
NetworkConnectionContext co... | [
"private",
"ConnectionData",
"createnewConnectionData",
"(",
"NetworkConnection",
"vc",
")",
"throws",
"FrameworkException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"en... | Create a new Connection data object
@param vc The network connection over which to create a connection data
@return ConnectionData A new connection data object
@throws FrameworkException is thrown if the new connection data cannot be created | [
"Create",
"a",
"new",
"Connection",
"data",
"object"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/octracker/ConnectionDataGroup.java#L800-L824 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java | RespokeClient.buildGroupMessage | private RespokeGroupMessage buildGroupMessage(JSONObject source) throws JSONException {
"""
Build a group message from a JSON object. The format of the JSON object would be the
format that comes over the wire from Respoke when receiving a pubsub message. This same
format is used when retrieving message history.
... | java | private RespokeGroupMessage buildGroupMessage(JSONObject source) throws JSONException {
if (source == null) {
throw new IllegalArgumentException("source cannot be null");
}
final JSONObject header = source.getJSONObject("header");
final String endpointID = header.getString("... | [
"private",
"RespokeGroupMessage",
"buildGroupMessage",
"(",
"JSONObject",
"source",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"source cannot be null\"",
")",
";",
"}",
"final"... | Build a group message from a JSON object. The format of the JSON object would be the
format that comes over the wire from Respoke when receiving a pubsub message. This same
format is used when retrieving message history.
@param source The source JSON object to build the RespokeGroupMessage from
@return The built Respo... | [
"Build",
"a",
"group",
"message",
"from",
"a",
"JSON",
"object",
".",
"The",
"format",
"of",
"the",
"JSON",
"object",
"would",
"be",
"the",
"format",
"that",
"comes",
"over",
"the",
"wire",
"from",
"Respoke",
"when",
"receiving",
"a",
"pubsub",
"message",
... | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeClient.java#L1576-L1604 |
tvesalainen/util | util/src/main/java/org/vesalainen/code/TransactionalSetter.java | TransactionalSetter.getInstance | public static <T extends TransactionalSetter> T getInstance(Class<T> cls, Object intf) {
"""
Creates a instance of a class TransactionalSetter subclass.
@param <T> Type of TransactionalSetter subclass
@param cls TransactionalSetter subclass class
@param intf Interface implemented by TransactionalSetter subclass... | java | public static <T extends TransactionalSetter> T getInstance(Class<T> cls, Object intf)
{
Class<?>[] interfaces = cls.getInterfaces();
if (interfaces.length != 1)
{
throw new IllegalArgumentException(cls+" should implement exactly one interface");
}
boolean ... | [
"public",
"static",
"<",
"T",
"extends",
"TransactionalSetter",
">",
"T",
"getInstance",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"Object",
"intf",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"interfaces",
"=",
"cls",
".",
"getInterfaces",
"(",
")",
... | Creates a instance of a class TransactionalSetter subclass.
@param <T> Type of TransactionalSetter subclass
@param cls TransactionalSetter subclass class
@param intf Interface implemented by TransactionalSetter subclass
@return | [
"Creates",
"a",
"instance",
"of",
"a",
"class",
"TransactionalSetter",
"subclass",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/code/TransactionalSetter.java#L75-L103 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.pretrainLayer | public void pretrainLayer(String layerName, DataSetIterator dataSetIterator) {
"""
Pretrain a specified layer with the given DataSetIterator
@param layerName Layer name
@param dataSetIterator Data
"""
if (numInputArrays != 1) {
throw new UnsupportedOperationException(
... | java | public void pretrainLayer(String layerName, DataSetIterator dataSetIterator) {
if (numInputArrays != 1) {
throw new UnsupportedOperationException(
"Cannot train ComputationGraph network with multiple inputs using a DataSetIterator");
}
pretrainLayer(layerName, C... | [
"public",
"void",
"pretrainLayer",
"(",
"String",
"layerName",
",",
"DataSetIterator",
"dataSetIterator",
")",
"{",
"if",
"(",
"numInputArrays",
"!=",
"1",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Cannot train ComputationGraph network with multi... | Pretrain a specified layer with the given DataSetIterator
@param layerName Layer name
@param dataSetIterator Data | [
"Pretrain",
"a",
"specified",
"layer",
"with",
"the",
"given",
"DataSetIterator"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L879-L886 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/util/xml/ElementList.java | ElementList.renameNodesInTree | public void renameNodesInTree(String oldName, String newName) {
"""
Renames all subnodes with a certain name
@param oldName
@param newName
"""
List<Node> nodes = getNodesFromTreeByName(oldName);
Iterator i = nodes.iterator();
while (i.hasNext()) {
Node n = (Node) i.next();
n.setName(newNam... | java | public void renameNodesInTree(String oldName, String newName) {
List<Node> nodes = getNodesFromTreeByName(oldName);
Iterator i = nodes.iterator();
while (i.hasNext()) {
Node n = (Node) i.next();
n.setName(newName);
}
} | [
"public",
"void",
"renameNodesInTree",
"(",
"String",
"oldName",
",",
"String",
"newName",
")",
"{",
"List",
"<",
"Node",
">",
"nodes",
"=",
"getNodesFromTreeByName",
"(",
"oldName",
")",
";",
"Iterator",
"i",
"=",
"nodes",
".",
"iterator",
"(",
")",
";",
... | Renames all subnodes with a certain name
@param oldName
@param newName | [
"Renames",
"all",
"subnodes",
"with",
"a",
"certain",
"name"
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/util/xml/ElementList.java#L260-L267 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/tcpchannel/TCPConnectRequestContextFactory.java | TCPConnectRequestContextFactory.createTCPConnectRequestContext | public TCPConnectRequestContext createTCPConnectRequestContext(String _localHostName, int _localPort, String _remoteHostName, int _remotePort, int _timeout) {
"""
Create a new connection request context based upon the input needed to
fully define
the context.
@param _localHostName
host name of the local side... | java | public TCPConnectRequestContext createTCPConnectRequestContext(String _localHostName, int _localPort, String _remoteHostName, int _remotePort, int _timeout) {
return new TCPConnectRequestContextImpl(_localHostName, _localPort, _remoteHostName, _remotePort, _timeout);
} | [
"public",
"TCPConnectRequestContext",
"createTCPConnectRequestContext",
"(",
"String",
"_localHostName",
",",
"int",
"_localPort",
",",
"String",
"_remoteHostName",
",",
"int",
"_remotePort",
",",
"int",
"_timeout",
")",
"{",
"return",
"new",
"TCPConnectRequestContextImpl... | Create a new connection request context based upon the input needed to
fully define
the context.
@param _localHostName
host name of the local side of the connection. null is valid.
@param _localPort
port to be used by the local side of the connection
@param _remoteHostName
host name of the remote side of the connectio... | [
"Create",
"a",
"new",
"connection",
"request",
"context",
"based",
"upon",
"the",
"input",
"needed",
"to",
"fully",
"define",
"the",
"context",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/wsspi/tcpchannel/TCPConnectRequestContextFactory.java#L40-L43 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/common/ValueListMap.java | ValueListMap.addValuesToKey | public void addValuesToKey(K key, Collection<V> valueCollection) {
"""
Add a collection of one or more values to the map under the existing key or creating a new key
if it does not yet exist in the map.
@param key the key to associate the values with
@param valueCollection a collection of values t... | java | public void addValuesToKey(K key, Collection<V> valueCollection) {
if (!valueCollection.isEmpty()) {
// Create a new collection to store the values (will be changed to internal type by call
// to putIfAbsent anyway)
List<V> collectionToAppendValuesOn = new ArrayList<V>();
... | [
"public",
"void",
"addValuesToKey",
"(",
"K",
"key",
",",
"Collection",
"<",
"V",
">",
"valueCollection",
")",
"{",
"if",
"(",
"!",
"valueCollection",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Create a new collection to store the values (will be changed to internal type... | Add a collection of one or more values to the map under the existing key or creating a new key
if it does not yet exist in the map.
@param key the key to associate the values with
@param valueCollection a collection of values to add to the key | [
"Add",
"a",
"collection",
"of",
"one",
"or",
"more",
"values",
"to",
"the",
"map",
"under",
"the",
"existing",
"key",
"or",
"creating",
"a",
"new",
"key",
"if",
"it",
"does",
"not",
"yet",
"exist",
"in",
"the",
"map",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/common/ValueListMap.java#L66-L78 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/State.java | State.updateFromMatrix | private void updateFromMatrix(boolean updateZoom, boolean updateRotation) {
"""
Applying state from current matrix.
<p>
Having matrix:
<pre>
| a b tx |
A = | c d ty |
| 0 0 1 |
x = tx
y = ty
scale = sqrt(b^2+d^2)
rotation = atan(c/d) = atan(-b/a)
</pre>
See <a href="http://stackoverflow.com/qu... | java | private void updateFromMatrix(boolean updateZoom, boolean updateRotation) {
matrix.getValues(matrixValues);
x = matrixValues[2];
y = matrixValues[5];
if (updateZoom) {
zoom = (float) Math.hypot(matrixValues[1], matrixValues[4]);
}
if (updateRotation) {
... | [
"private",
"void",
"updateFromMatrix",
"(",
"boolean",
"updateZoom",
",",
"boolean",
"updateRotation",
")",
"{",
"matrix",
".",
"getValues",
"(",
"matrixValues",
")",
";",
"x",
"=",
"matrixValues",
"[",
"2",
"]",
";",
"y",
"=",
"matrixValues",
"[",
"5",
"]... | Applying state from current matrix.
<p>
Having matrix:
<pre>
| a b tx |
A = | c d ty |
| 0 0 1 |
x = tx
y = ty
scale = sqrt(b^2+d^2)
rotation = atan(c/d) = atan(-b/a)
</pre>
See <a href="http://stackoverflow.com/questions/4361242">here</a>.
@param updateZoom Whether to extract zoom from matrix
@param updateRot... | [
"Applying",
"state",
"from",
"current",
"matrix",
".",
"<p",
">",
"Having",
"matrix",
":",
"<pre",
">",
"|",
"a",
"b",
"tx",
"|",
"A",
"=",
"|",
"c",
"d",
"ty",
"|",
"|",
"0",
"0",
"1",
"|"
] | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/State.java#L155-L165 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java | EncodedElement.packIntByBits | protected static void packIntByBits(int[] inputA, int[] inputBits, int inputIndex, int inputCount, int destPos, byte[] dest) {
"""
Pack a number of bits from each int of an array(within given limits)to
the end of this list.
@param inputA Array containing input values.
@param inputBits Array containing number ... | java | protected static void packIntByBits(int[] inputA, int[] inputBits, int inputIndex, int inputCount, int destPos, byte[] dest) {
int origInputIndex = inputIndex;
inputIndex = packIntByBitsToByteBoundary(inputA, inputBits, inputIndex, inputCount,
destPos, dest);
if(destPos%8 > 0) destPos = (destPos/8+1)*8;... | [
"protected",
"static",
"void",
"packIntByBits",
"(",
"int",
"[",
"]",
"inputA",
",",
"int",
"[",
"]",
"inputBits",
",",
"int",
"inputIndex",
",",
"int",
"inputCount",
",",
"int",
"destPos",
",",
"byte",
"[",
"]",
"dest",
")",
"{",
"int",
"origInputIndex"... | Pack a number of bits from each int of an array(within given limits)to
the end of this list.
@param inputA Array containing input values.
@param inputBits Array containing number of bits to use for each index
packed. This array should be equal in size to the inputA array.
@param inputIndex Index of first usable index.... | [
"Pack",
"a",
"number",
"of",
"bits",
"from",
"each",
"int",
"of",
"an",
"array",
"(",
"within",
"given",
"limits",
")",
"to",
"the",
"end",
"of",
"this",
"list",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L881-L902 |
javagl/ND | nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/j/LongTupleNeighborhoodIterables.java | LongTupleNeighborhoodIterables.mooreNeighborhoodIterable | public static Iterable<MutableLongTuple> mooreNeighborhoodIterable(
LongTuple center, int radius, Order order) {
"""
Creates an iterable that provides iterators for iterating over the
Moore neighborhood of the given center and the given radius.<br>
<br>
Also see <a href="../../package-summary.html#Neig... | java | public static Iterable<MutableLongTuple> mooreNeighborhoodIterable(
LongTuple center, int radius, Order order)
{
return mooreNeighborhoodIterable(center, radius, null, null, order);
} | [
"public",
"static",
"Iterable",
"<",
"MutableLongTuple",
">",
"mooreNeighborhoodIterable",
"(",
"LongTuple",
"center",
",",
"int",
"radius",
",",
"Order",
"order",
")",
"{",
"return",
"mooreNeighborhoodIterable",
"(",
"center",
",",
"radius",
",",
"null",
",",
"... | Creates an iterable that provides iterators for iterating over the
Moore neighborhood of the given center and the given radius.<br>
<br>
Also see <a href="../../package-summary.html#Neighborhoods">
Neighborhoods</a>
@param center The center of the Moore neighborhood
A copy of this tuple will be stored internally.
@par... | [
"Creates",
"an",
"iterable",
"that",
"provides",
"iterators",
"for",
"iterating",
"over",
"the",
"Moore",
"neighborhood",
"of",
"the",
"given",
"center",
"and",
"the",
"given",
"radius",
".",
"<br",
">",
"<br",
">",
"Also",
"see",
"<a",
"href",
"=",
"..",
... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-iteration/src/main/java/de/javagl/nd/iteration/tuples/j/LongTupleNeighborhoodIterables.java#L60-L64 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java | DomHelper.addXmlDocumentAnnotationTo | public static void addXmlDocumentAnnotationTo(final Node aNode, final String formattedDocumentation) {
"""
<p>Adds the given formattedDocumentation within an XML documentation annotation under the supplied Node.
Only adds the documentation annotation if the formattedDocumentation is non-null and non-empty. The
d... | java | public static void addXmlDocumentAnnotationTo(final Node aNode, final String formattedDocumentation) {
if (aNode != null && formattedDocumentation != null && !formattedDocumentation.isEmpty()) {
// Add the new Elements, as required.
final Document doc = aNode.getOwnerDocument();
... | [
"public",
"static",
"void",
"addXmlDocumentAnnotationTo",
"(",
"final",
"Node",
"aNode",
",",
"final",
"String",
"formattedDocumentation",
")",
"{",
"if",
"(",
"aNode",
"!=",
"null",
"&&",
"formattedDocumentation",
"!=",
"null",
"&&",
"!",
"formattedDocumentation",
... | <p>Adds the given formattedDocumentation within an XML documentation annotation under the supplied Node.
Only adds the documentation annotation if the formattedDocumentation is non-null and non-empty. The
documentation annotation is on the form:</p>
<pre>
<code>
<xs:annotation>
<xs:documentation>(JavaDoc he... | [
"<p",
">",
"Adds",
"the",
"given",
"formattedDocumentation",
"within",
"an",
"XML",
"documentation",
"annotation",
"under",
"the",
"supplied",
"Node",
".",
"Only",
"adds",
"the",
"documentation",
"annotation",
"if",
"the",
"formattedDocumentation",
"is",
"non",
"-... | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/schemageneration/postprocessing/javadoc/DomHelper.java#L134-L162 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerState.java | PaymentChannelServerState.storeChannelInWallet | public synchronized void storeChannelInWallet(@Nullable PaymentChannelServer connectedHandler) {
"""
Stores this channel's state in the wallet as a part of a {@link StoredPaymentChannelServerStates} wallet
extension and keeps it up-to-date each time payment is incremented. This will be automatically removed when
... | java | public synchronized void storeChannelInWallet(@Nullable PaymentChannelServer connectedHandler) {
stateMachine.checkState(State.READY);
if (storedServerChannel != null)
return;
log.info("Storing state with contract hash {}.", getContract().getTxId());
StoredPaymentChannelServ... | [
"public",
"synchronized",
"void",
"storeChannelInWallet",
"(",
"@",
"Nullable",
"PaymentChannelServer",
"connectedHandler",
")",
"{",
"stateMachine",
".",
"checkState",
"(",
"State",
".",
"READY",
")",
";",
"if",
"(",
"storedServerChannel",
"!=",
"null",
")",
"ret... | Stores this channel's state in the wallet as a part of a {@link StoredPaymentChannelServerStates} wallet
extension and keeps it up-to-date each time payment is incremented. This will be automatically removed when
a call to {@link PaymentChannelV1ServerState#close()} completes successfully. A channel may only be stored ... | [
"Stores",
"this",
"channel",
"s",
"state",
"in",
"the",
"wallet",
"as",
"a",
"part",
"of",
"a",
"{",
"@link",
"StoredPaymentChannelServerStates",
"}",
"wallet",
"extension",
"and",
"keeps",
"it",
"up",
"-",
"to",
"-",
"date",
"each",
"time",
"payment",
"is... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelServerState.java#L366-L378 |
diegocarloslima/ByakuGallery | ByakuGallery/src/com/diegocarloslima/byakugallery/lib/TouchImageView.java | TouchImageView.computeTranslation | private static float computeTranslation(float viewSize, float drawableSize, float currentTranslation, float delta) {
"""
The translation values must be in [0, viewSize - drawableSize], except if we have free space. In that case we will translate to half of the free space
"""
final float sideFreeSpace = (view... | java | private static float computeTranslation(float viewSize, float drawableSize, float currentTranslation, float delta) {
final float sideFreeSpace = (viewSize - drawableSize) / 2F;
if(sideFreeSpace > 0) {
return sideFreeSpace - currentTranslation;
} else if(currentTranslation + delta > 0) {
return -currentTran... | [
"private",
"static",
"float",
"computeTranslation",
"(",
"float",
"viewSize",
",",
"float",
"drawableSize",
",",
"float",
"currentTranslation",
",",
"float",
"delta",
")",
"{",
"final",
"float",
"sideFreeSpace",
"=",
"(",
"viewSize",
"-",
"drawableSize",
")",
"/... | The translation values must be in [0, viewSize - drawableSize], except if we have free space. In that case we will translate to half of the free space | [
"The",
"translation",
"values",
"must",
"be",
"in",
"[",
"0",
"viewSize",
"-",
"drawableSize",
"]",
"except",
"if",
"we",
"have",
"free",
"space",
".",
"In",
"that",
"case",
"we",
"will",
"translate",
"to",
"half",
"of",
"the",
"free",
"space"
] | train | https://github.com/diegocarloslima/ByakuGallery/blob/a0472e8c9f79184b6b83351da06a5544e4dc1be4/ByakuGallery/src/com/diegocarloslima/byakugallery/lib/TouchImageView.java#L342-L354 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthDays | private static int getMonthDays(int month, int year) {
"""
Returns month days from the beginning of year.
@param month month (0-based)
@parma year year
@return month days from the beginning of year
"""
Integer[] newMonths = getAdjustedMonthDays(year);
return newMonths[month].intValue();
... | java | private static int getMonthDays(int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
return newMonths[month].intValue();
} | [
"private",
"static",
"int",
"getMonthDays",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthDays",
"(",
"year",
")",
";",
"return",
"newMonths",
"[",
"month",
"]",
".",
"intValue",
"(",
")",
";",... | Returns month days from the beginning of year.
@param month month (0-based)
@parma year year
@return month days from the beginning of year | [
"Returns",
"month",
"days",
"from",
"the",
"beginning",
"of",
"year",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1124-L1127 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/util/UserProperties.java | UserProperties.setProperty | public void setProperty(String strName, String strData) {
"""
Set this property.
@param strProperty The property key.
@param strValue The property value.
"""
Record recUserRegistration = this.getUserRegistration();
((PropertiesField)recUserRegistration.getField(UserRegistrationModel.PROPERTIE... | java | public void setProperty(String strName, String strData)
{
Record recUserRegistration = this.getUserRegistration();
((PropertiesField)recUserRegistration.getField(UserRegistrationModel.PROPERTIES)).setProperty(strName, strData);
} | [
"public",
"void",
"setProperty",
"(",
"String",
"strName",
",",
"String",
"strData",
")",
"{",
"Record",
"recUserRegistration",
"=",
"this",
".",
"getUserRegistration",
"(",
")",
";",
"(",
"(",
"PropertiesField",
")",
"recUserRegistration",
".",
"getField",
"(",... | Set this property.
@param strProperty The property key.
@param strValue The property value. | [
"Set",
"this",
"property",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/util/UserProperties.java#L188-L192 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandManager.java | DefaultCommandManager.createCommandGroup | @Override
public CommandGroup createCommandGroup(List<? extends Object> members) {
"""
Create a command group which holds all the given members.
@param members members to add to the group.
@return a {@link CommandGroup} which contains all the members.
"""
return createCommandGroup(null, members.toArr... | java | @Override
public CommandGroup createCommandGroup(List<? extends Object> members) {
return createCommandGroup(null, members.toArray(), false, null);
} | [
"@",
"Override",
"public",
"CommandGroup",
"createCommandGroup",
"(",
"List",
"<",
"?",
"extends",
"Object",
">",
"members",
")",
"{",
"return",
"createCommandGroup",
"(",
"null",
",",
"members",
".",
"toArray",
"(",
")",
",",
"false",
",",
"null",
")",
";... | Create a command group which holds all the given members.
@param members members to add to the group.
@return a {@link CommandGroup} which contains all the members. | [
"Create",
"a",
"command",
"group",
"which",
"holds",
"all",
"the",
"given",
"members",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/DefaultCommandManager.java#L280-L283 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllWeight.java | MatchAllWeight.createScorer | @Override
protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
"""
Creates a {@link MatchAllScorer} instance.
@param reader index reader
@return a {@link MatchAllScorer} instance
"""
return new MatchAllScorer(reader, field);
} | java | @Override
protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
return new MatchAllScorer(reader, field);
} | [
"@",
"Override",
"protected",
"Scorer",
"createScorer",
"(",
"IndexReader",
"reader",
",",
"boolean",
"scoreDocsInOrder",
",",
"boolean",
"topScorer",
")",
"throws",
"IOException",
"{",
"return",
"new",
"MatchAllScorer",
"(",
"reader",
",",
"field",
")",
";",
"}... | Creates a {@link MatchAllScorer} instance.
@param reader index reader
@return a {@link MatchAllScorer} instance | [
"Creates",
"a",
"{",
"@link",
"MatchAllScorer",
"}",
"instance",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MatchAllWeight.java#L80-L83 |
OpenLiberty/open-liberty | dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java | SelfExtractor.getCommonRootDir | private String getCommonRootDir(String filePath, HashMap validFilePaths) {
"""
Retrieves the directory in common between the specified path and the archive root directory.
If the file path cannot be found among the valid paths then null is returned.
@param filePath Path to the file to check
@param valid... | java | private String getCommonRootDir(String filePath, HashMap validFilePaths) {
for (Iterator it = validFilePaths.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
String path = (String) ((entry).getKey());
if (filePath.startsWith(path))
... | [
"private",
"String",
"getCommonRootDir",
"(",
"String",
"filePath",
",",
"HashMap",
"validFilePaths",
")",
"{",
"for",
"(",
"Iterator",
"it",
"=",
"validFilePaths",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
... | Retrieves the directory in common between the specified path and the archive root directory.
If the file path cannot be found among the valid paths then null is returned.
@param filePath Path to the file to check
@param validFilePaths A list of valid file paths and their common directories with the root
@return ... | [
"Retrieves",
"the",
"directory",
"in",
"common",
"between",
"the",
"specified",
"path",
"and",
"the",
"archive",
"root",
"directory",
".",
"If",
"the",
"file",
"path",
"cannot",
"be",
"found",
"among",
"the",
"valid",
"paths",
"then",
"null",
"is",
"returned... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/wlp.lib.extract/src/wlp/lib/extract/SelfExtractor.java#L982-L991 |
Impetus/Kundera | src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java | GraphEntityMapper.getMatchingNodeFromIndexHits | protected Node getMatchingNodeFromIndexHits(IndexHits<Node> nodesFound, boolean skipProxy) {
"""
Fetches first Non-proxy node from Index Hits
@param skipProxy
@param nodesFound
@return
"""
Node node = null;
try
{
if (nodesFound == null || nodesFound.size() == 0 || !node... | java | protected Node getMatchingNodeFromIndexHits(IndexHits<Node> nodesFound, boolean skipProxy)
{
Node node = null;
try
{
if (nodesFound == null || nodesFound.size() == 0 || !nodesFound.hasNext())
{
return null;
}
else
{
... | [
"protected",
"Node",
"getMatchingNodeFromIndexHits",
"(",
"IndexHits",
"<",
"Node",
">",
"nodesFound",
",",
"boolean",
"skipProxy",
")",
"{",
"Node",
"node",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"nodesFound",
"==",
"null",
"||",
"nodesFound",
".",
"size"... | Fetches first Non-proxy node from Index Hits
@param skipProxy
@param nodesFound
@return | [
"Fetches",
"first",
"Non",
"-",
"proxy",
"node",
"from",
"Index",
"Hits"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java#L695-L717 |
hal/core | gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/ResourceAdapterPresenter.java | ResourceAdapterPresenter.onCreateProperty | public void onCreateProperty(AddressTemplate address, ModelNode entity, String... names) {
"""
/*public void onCreate(AddressTemplate address, String name, ModelNode entity) {
ResourceAddress fqAddress = address.resolve(statementContext, name);
entity.get(OP).set(ADD);
entity.get(ADDRESS).set(fqAddress);
... | java | public void onCreateProperty(AddressTemplate address, ModelNode entity, String... names) {
List<String> args = new LinkedList<>();
args.add(0, selectedAdapter);
for (String name : names) {
args.add(name);
}
ResourceAddress fqAddress = address.resolve(statementContext... | [
"public",
"void",
"onCreateProperty",
"(",
"AddressTemplate",
"address",
",",
"ModelNode",
"entity",
",",
"String",
"...",
"names",
")",
"{",
"List",
"<",
"String",
">",
"args",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"args",
".",
"add",
"(",
"0",... | /*public void onCreate(AddressTemplate address, String name, ModelNode entity) {
ResourceAddress fqAddress = address.resolve(statementContext, name);
entity.get(OP).set(ADD);
entity.get(ADDRESS).set(fqAddress);
dispatcher.execute(new DMRAction(entity), new SimpleCallback<DMRResponse>() {
@Override
public void onSuc... | [
"/",
"*",
"public",
"void",
"onCreate",
"(",
"AddressTemplate",
"address",
"String",
"name",
"ModelNode",
"entity",
")",
"{"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/shared/subsys/jca/ResourceAdapterPresenter.java#L175-L203 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.isAssignableToOrFrom | public static boolean isAssignableToOrFrom(Class<?> classToCheck, Class<?> anotherClass) {
"""
Returns whether a class is either assignable to or from another class.
@param classToCheck class to check
@param anotherClass another class
"""
return classToCheck.isAssignableFrom(anotherClass)
|| an... | java | public static boolean isAssignableToOrFrom(Class<?> classToCheck, Class<?> anotherClass) {
return classToCheck.isAssignableFrom(anotherClass)
|| anotherClass.isAssignableFrom(classToCheck);
} | [
"public",
"static",
"boolean",
"isAssignableToOrFrom",
"(",
"Class",
"<",
"?",
">",
"classToCheck",
",",
"Class",
"<",
"?",
">",
"anotherClass",
")",
"{",
"return",
"classToCheck",
".",
"isAssignableFrom",
"(",
"anotherClass",
")",
"||",
"anotherClass",
".",
"... | Returns whether a class is either assignable to or from another class.
@param classToCheck class to check
@param anotherClass another class | [
"Returns",
"whether",
"a",
"class",
"is",
"either",
"assignable",
"to",
"or",
"from",
"another",
"class",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L97-L100 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/text/word/TextAnalyzer.java | TextAnalyzer.createInstance | static public TextAnalyzer createInstance(int type,
String dictionaryPath,
Map<String, ? extends Object> keywordDefinitions,
Map<Integer, ? extends Object> lengthDefinitions) {
"""
Create an instance of TextAnalyzer.<br>
创建一个文本分析器实例。
@param type {@link #TYPE_MMSEG_SIMPLE} | {@link #TYPE_MMSEG... | java | static public TextAnalyzer createInstance(int type,
String dictionaryPath,
Map<String, ? extends Object> keywordDefinitions,
Map<Integer, ? extends Object> lengthDefinitions){
switch(type){
case TYPE_MMSEG_COMPLEX:
case TYPE_MMSEG_MAXWORD:
case TYPE_MMSEG_SIMPLE:
return new MmsegTextAnaly... | [
"static",
"public",
"TextAnalyzer",
"createInstance",
"(",
"int",
"type",
",",
"String",
"dictionaryPath",
",",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"keywordDefinitions",
",",
"Map",
"<",
"Integer",
",",
"?",
"extends",
"Object",
">",
"l... | Create an instance of TextAnalyzer.<br>
创建一个文本分析器实例。
@param type {@link #TYPE_MMSEG_SIMPLE} | {@link #TYPE_MMSEG_COMPLEX} | {@link #TYPE_MMSEG_MAXWORD} | {@link #TYPE_FAST}
@param dictionaryPath 字典文件路径,如果为null,则表示使用缺省位置的字典文件
@param keywordDefinitions 关键词字的定义
@param lengthDefinitions 文本长度类别定义
@return A new instance... | [
"Create",
"an",
"instance",
"of",
"TextAnalyzer",
".",
"<br",
">",
"创建一个文本分析器实例。"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/text/word/TextAnalyzer.java#L61-L75 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/XmlWriter.java | XmlWriter.appendEscapedString | private void appendEscapedString(String s, StringBuilder builder) {
"""
Appends the specified string (with any non-XML-compatible characters
replaced with the corresponding escape code) to the specified
StringBuilder.
@param s
The string to escape and append to the specified
StringBuilder.
@param builder
... | java | private void appendEscapedString(String s, StringBuilder builder) {
if (s == null)
s = "";
int pos;
int start = 0;
int len = s.length();
for (pos = 0; pos < len; pos++) {
char ch = s.charAt(pos);
String escape;
switch (ch) {
... | [
"private",
"void",
"appendEscapedString",
"(",
"String",
"s",
",",
"StringBuilder",
"builder",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"s",
"=",
"\"\"",
";",
"int",
"pos",
";",
"int",
"start",
"=",
"0",
";",
"int",
"len",
"=",
"s",
".",
"lengt... | Appends the specified string (with any non-XML-compatible characters
replaced with the corresponding escape code) to the specified
StringBuilder.
@param s
The string to escape and append to the specified
StringBuilder.
@param builder
The StringBuilder to which the escaped string should be
appened. | [
"Appends",
"the",
"specified",
"string",
"(",
"with",
"any",
"non",
"-",
"XML",
"-",
"compatible",
"characters",
"replaced",
"with",
"the",
"corresponding",
"escape",
"code",
")",
"to",
"the",
"specified",
"StringBuilder",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/XmlWriter.java#L105-L153 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java | ConverterUtils.copyCell | static void copyCell(ICellAddress address, Sheet from, IDataModel to) {
"""
Does cell of a given address copy from {@link Sheet} to {@link IDataModel}.
"""
if (from == null) { return; }
Row fromRow = from.getRow(address.a1Address().row());
if (fromRow == null) { return; }
Cell f... | java | static void copyCell(ICellAddress address, Sheet from, IDataModel to) {
if (from == null) { return; }
Row fromRow = from.getRow(address.a1Address().row());
if (fromRow == null) { return; }
Cell fromCell = fromRow.getCell(address.a1Address().column());
if (fromCell == null) { retu... | [
"static",
"void",
"copyCell",
"(",
"ICellAddress",
"address",
",",
"Sheet",
"from",
",",
"IDataModel",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Row",
"fromRow",
"=",
"from",
".",
"getRow",
"(",
"address",
".",
"... | Does cell of a given address copy from {@link Sheet} to {@link IDataModel}. | [
"Does",
"cell",
"of",
"a",
"given",
"address",
"copy",
"from",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/ConverterUtils.java#L150-L162 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java | ReadMasterDomainModelUtil.populateHostResolutionContext | public static RequiredConfigurationHolder populateHostResolutionContext(final HostInfo hostInfo, final Resource root, final ExtensionRegistry extensionRegistry) {
"""
Process the host info and determine which configuration elements are required on the slave host.
@param hostInfo the host info
@para... | java | public static RequiredConfigurationHolder populateHostResolutionContext(final HostInfo hostInfo, final Resource root, final ExtensionRegistry extensionRegistry) {
final RequiredConfigurationHolder rc = new RequiredConfigurationHolder();
for (IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo info : hos... | [
"public",
"static",
"RequiredConfigurationHolder",
"populateHostResolutionContext",
"(",
"final",
"HostInfo",
"hostInfo",
",",
"final",
"Resource",
"root",
",",
"final",
"ExtensionRegistry",
"extensionRegistry",
")",
"{",
"final",
"RequiredConfigurationHolder",
"rc",
"=",
... | Process the host info and determine which configuration elements are required on the slave host.
@param hostInfo the host info
@param root the model root
@param extensionRegistry the extension registry
@return | [
"Process",
"the",
"host",
"info",
"and",
"determine",
"which",
"configuration",
"elements",
"are",
"required",
"on",
"the",
"slave",
"host",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java#L224-L230 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/EditService.java | EditService.disableAll | public void disableAll(int profileId, String client_uuid) {
"""
Delete all enabled overrides for a client
@param profileId profile ID of teh client
@param client_uuid UUID of teh client
"""
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
... | java | public void disableAll(int profileId, String client_uuid) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_ENABLED_OVERRIDE +
... | [
"public",
"void",
"disableAll",
"(",
"int",
"profileId",
",",
"String",
"client_uuid",
")",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connection",
"sqlConnection",
"=",
"sqlService",
".",
"getConnection",
"(",
")",
")",
"{",
"statem... | Delete all enabled overrides for a client
@param profileId profile ID of teh client
@param client_uuid UUID of teh client | [
"Delete",
"all",
"enabled",
"overrides",
"for",
"a",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/EditService.java#L120-L142 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java | AccountsInner.listWithServiceResponseAsync | public Observable<ServiceResponse<Page<DataLakeStoreAccountBasicInner>>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
"""
Lists the Data Lake Store accounts within the subscription. The response includes a... | java | public Observable<ServiceResponse<Page<DataLakeStoreAccountBasicInner>>> listWithServiceResponseAsync(final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) {
return listSinglePageAsync(filter, top, skip, select, orderby, count)
.c... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DataLakeStoreAccountBasicInner",
">",
">",
">",
"listWithServiceResponseAsync",
"(",
"final",
"String",
"filter",
",",
"final",
"Integer",
"top",
",",
"final",
"Integer",
"skip",
",",
"final",
"Str... | Lists the Data Lake Store accounts within the subscription. The response includes a link to the next page of results, if any.
@param filter OData filter. Optional.
@param top The number of items to return. Optional.
@param skip The number of items to skip over before returning elements. Optional.
@param select OData S... | [
"Lists",
"the",
"Data",
"Lake",
"Store",
"accounts",
"within",
"the",
"subscription",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"of",
"results",
"if",
"any",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java#L315-L327 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/VisualizeCamera2Activity.java | VisualizeCamera2Activity.processImageOuter | private void processImageOuter( ImageBase image ) {
"""
Internal function which manages images and invokes {@link #processImage}.
"""
long startTime = System.currentTimeMillis();
// this image is owned by only this process and no other. So no need to lock it while
// processing
processImage(image);
... | java | private void processImageOuter( ImageBase image ) {
long startTime = System.currentTimeMillis();
// this image is owned by only this process and no other. So no need to lock it while
// processing
processImage(image);
// If an old image finished being processes after a more recent one it won't be visualized... | [
"private",
"void",
"processImageOuter",
"(",
"ImageBase",
"image",
")",
"{",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// this image is owned by only this process and no other. So no need to lock it while",
"// processing",
"processImage",
... | Internal function which manages images and invokes {@link #processImage}. | [
"Internal",
"function",
"which",
"manages",
"images",
"and",
"invokes",
"{"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/VisualizeCamera2Activity.java#L391-L414 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addAnnotationOrGetExisting | public static AnnotationNode addAnnotationOrGetExisting(ClassNode classNode, Class<? extends Annotation> annotationClass) {
"""
Adds an annotation to the given class node or returns the existing annotation
@param classNode The class node
@param annotationClass The annotation class
"""
return addAnn... | java | public static AnnotationNode addAnnotationOrGetExisting(ClassNode classNode, Class<? extends Annotation> annotationClass) {
return addAnnotationOrGetExisting(classNode, annotationClass, Collections.<String, Object>emptyMap());
} | [
"public",
"static",
"AnnotationNode",
"addAnnotationOrGetExisting",
"(",
"ClassNode",
"classNode",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"addAnnotationOrGetExisting",
"(",
"classNode",
",",
"annotationClass",
",",
... | Adds an annotation to the given class node or returns the existing annotation
@param classNode The class node
@param annotationClass The annotation class | [
"Adds",
"an",
"annotation",
"to",
"the",
"given",
"class",
"node",
"or",
"returns",
"the",
"existing",
"annotation"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L826-L828 |
threerings/nenya | core/src/main/java/com/threerings/util/DirectionUtil.java | DirectionUtil.getFineDirection | public static int getFineDirection (Point a, Point b) {
"""
Returns which of the sixteen compass directions that point <code>b</code> lies in from
point <code>a</code> as one of the {@link DirectionCodes} direction constants.
<em>Note:</em> that the coordinates supplied are assumed to be logical (screen) rather ... | java | public static int getFineDirection (Point a, Point b)
{
return getFineDirection(a.x, a.y, b.x, b.y);
} | [
"public",
"static",
"int",
"getFineDirection",
"(",
"Point",
"a",
",",
"Point",
"b",
")",
"{",
"return",
"getFineDirection",
"(",
"a",
".",
"x",
",",
"a",
".",
"y",
",",
"b",
".",
"x",
",",
"b",
".",
"y",
")",
";",
"}"
] | Returns which of the sixteen compass directions that point <code>b</code> lies in from
point <code>a</code> as one of the {@link DirectionCodes} direction constants.
<em>Note:</em> that the coordinates supplied are assumed to be logical (screen) rather than
cartesian coordinates and <code>NORTH</code> is considered to ... | [
"Returns",
"which",
"of",
"the",
"sixteen",
"compass",
"directions",
"that",
"point",
"<code",
">",
"b<",
"/",
"code",
">",
"lies",
"in",
"from",
"point",
"<code",
">",
"a<",
"/",
"code",
">",
"as",
"one",
"of",
"the",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/DirectionUtil.java#L230-L233 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/DcpControlHandler.java | DcpControlHandler.channelRead0 | @Override
protected void channelRead0(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
"""
Since only one feature per req/res can be negotiated, repeat the process once a response comes
back until the iterator is complete or a non-success response status is received.
"""
ResponseSt... | java | @Override
protected void channelRead0(final ChannelHandlerContext ctx, final ByteBuf msg) throws Exception {
ResponseStatus status = MessageUtil.getResponseStatus(msg);
if (status.isSuccess()) {
negotiate(ctx);
} else {
originalPromise().setFailure(new IllegalStateException("Could not configur... | [
"@",
"Override",
"protected",
"void",
"channelRead0",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"ByteBuf",
"msg",
")",
"throws",
"Exception",
"{",
"ResponseStatus",
"status",
"=",
"MessageUtil",
".",
"getResponseStatus",
"(",
"msg",
")",
";",
"... | Since only one feature per req/res can be negotiated, repeat the process once a response comes
back until the iterator is complete or a non-success response status is received. | [
"Since",
"only",
"one",
"feature",
"per",
"req",
"/",
"res",
"can",
"be",
"negotiated",
"repeat",
"the",
"process",
"once",
"a",
"response",
"comes",
"back",
"until",
"the",
"iterator",
"is",
"complete",
"or",
"a",
"non",
"-",
"success",
"response",
"statu... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/DcpControlHandler.java#L103-L111 |
dnsjava/dnsjava | org/xbill/DNS/ZoneTransferIn.java | ZoneTransferIn.newAXFR | public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException {
"""
Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
@param zone The zone to transfer.
@param host The host from which to transfer the zone.
@param key The TSIG key used to authenticate t... | java | public static ZoneTransferIn
newAXFR(Name zone, String host, TSIG key)
throws UnknownHostException
{
return newAXFR(zone, host, 0, key);
} | [
"public",
"static",
"ZoneTransferIn",
"newAXFR",
"(",
"Name",
"zone",
",",
"String",
"host",
",",
"TSIG",
"key",
")",
"throws",
"UnknownHostException",
"{",
"return",
"newAXFR",
"(",
"zone",
",",
"host",
",",
"0",
",",
"key",
")",
";",
"}"
] | Instantiates a ZoneTransferIn object to do an AXFR (full zone transfer).
@param zone The zone to transfer.
@param host The host from which to transfer the zone.
@param key The TSIG key used to authenticate the transfer, or null.
@return The ZoneTransferIn object.
@throws UnknownHostException The host does not exist. | [
"Instantiates",
"a",
"ZoneTransferIn",
"object",
"to",
"do",
"an",
"AXFR",
"(",
"full",
"zone",
"transfer",
")",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/ZoneTransferIn.java#L231-L236 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_database_name_request_POST | public OvhTask serviceName_database_name_request_POST(String serviceName, String name, net.minidev.ovh.api.hosting.web.database.OvhRequestActionEnum action) throws IOException {
"""
Request specific operation for your database
REST: POST /hosting/web/{serviceName}/database/{name}/request
@param action [require... | java | public OvhTask serviceName_database_name_request_POST(String serviceName, String name, net.minidev.ovh.api.hosting.web.database.OvhRequestActionEnum action) throws IOException {
String qPath = "/hosting/web/{serviceName}/database/{name}/request";
StringBuilder sb = path(qPath, serviceName, name);
HashMap<String, ... | [
"public",
"OvhTask",
"serviceName_database_name_request_POST",
"(",
"String",
"serviceName",
",",
"String",
"name",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"hosting",
".",
"web",
".",
"database",
".",
"OvhRequestActionEnum",
"action",
")",
"thro... | Request specific operation for your database
REST: POST /hosting/web/{serviceName}/database/{name}/request
@param action [required] Action you want to request
@param serviceName [required] The internal name of your hosting
@param name [required] Database name (like mydb.mysql.db or mydb.postgres.db) | [
"Request",
"specific",
"operation",
"for",
"your",
"database"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1160-L1167 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.holdsLock | public static void holdsLock(Object lock, Supplier<String> message) {
"""
Asserts that the {@link Thread#currentThread() current Thread} holds the specified {@link Object lock}.
The assertion holds if and only if the {@link Object lock} is not {@literal null}
and the {@link Thread#currentThread() current Threa... | java | public static void holdsLock(Object lock, Supplier<String> message) {
if (isNotLockHolder(lock)) {
throw new IllegalMonitorStateException(message.get());
}
} | [
"public",
"static",
"void",
"holdsLock",
"(",
"Object",
"lock",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isNotLockHolder",
"(",
"lock",
")",
")",
"{",
"throw",
"new",
"IllegalMonitorStateException",
"(",
"message",
".",
"get",
... | Asserts that the {@link Thread#currentThread() current Thread} holds the specified {@link Object lock}.
The assertion holds if and only if the {@link Object lock} is not {@literal null}
and the {@link Thread#currentThread() current Thread} holds the given {@link Object lock}.
@param lock {@link Object} used as the lo... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Thread#currentThread",
"()",
"current",
"Thread",
"}",
"holds",
"the",
"specified",
"{",
"@link",
"Object",
"lock",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L467-L471 |
atomix/atomix | cluster/src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java | NettyMessagingService.bootstrapServer | private CompletableFuture<Void> bootstrapServer() {
"""
Bootstraps a server.
@return a future to be completed once the server has been bound to all interfaces
"""
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_REUSEADDR, true);
b.option(ChannelOption.SO_BACKLOG, 128);
b... | java | private CompletableFuture<Void> bootstrapServer() {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_REUSEADDR, true);
b.option(ChannelOption.SO_BACKLOG, 128);
b.childOption(ChannelOption.WRITE_BUFFER_WATER_MARK,
new WriteBufferWaterMark(8 * 1024, 32 * 1024));
b.childOpti... | [
"private",
"CompletableFuture",
"<",
"Void",
">",
"bootstrapServer",
"(",
")",
"{",
"ServerBootstrap",
"b",
"=",
"new",
"ServerBootstrap",
"(",
")",
";",
"b",
".",
"option",
"(",
"ChannelOption",
".",
"SO_REUSEADDR",
",",
"true",
")",
";",
"b",
".",
"optio... | Bootstraps a server.
@return a future to be completed once the server has been bound to all interfaces | [
"Bootstraps",
"a",
"server",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/cluster/src/main/java/io/atomix/cluster/messaging/impl/NettyMessagingService.java#L509-L532 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java | RDBMEntityLockStore.primAdd | private void primAdd(IEntityLock lock, Connection conn) throws SQLException, LockingException {
"""
Add the lock to the underlying store.
@param lock org.apereo.portal.concurrency.locking.IEntityLock
@param conn java.sql.Connection
"""
Integer typeID =
EntityTypesLocator.getEntityTy... | java | private void primAdd(IEntityLock lock, Connection conn) throws SQLException, LockingException {
Integer typeID =
EntityTypesLocator.getEntityTypes().getEntityIDFromType(lock.getEntityType());
String key = lock.getEntityKey();
int lockType = lock.getLockType();
Timestamp t... | [
"private",
"void",
"primAdd",
"(",
"IEntityLock",
"lock",
",",
"Connection",
"conn",
")",
"throws",
"SQLException",
",",
"LockingException",
"{",
"Integer",
"typeID",
"=",
"EntityTypesLocator",
".",
"getEntityTypes",
"(",
")",
".",
"getEntityIDFromType",
"(",
"loc... | Add the lock to the underlying store.
@param lock org.apereo.portal.concurrency.locking.IEntityLock
@param conn java.sql.Connection | [
"Add",
"the",
"lock",
"to",
"the",
"underlying",
"store",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/RDBMEntityLockStore.java#L349-L381 |
junit-team/junit4 | src/main/java/org/junit/runners/model/FrameworkMethod.java | FrameworkMethod.validatePublicVoid | public void validatePublicVoid(boolean isStatic, List<Throwable> errors) {
"""
Adds to {@code errors} if this method:
<ul>
<li>is not public, or
<li>returns something other than void, or
<li>is static (given {@code isStatic is false}), or
<li>is not static (given {@code isStatic is true}).
</ul>
"""
... | java | public void validatePublicVoid(boolean isStatic, List<Throwable> errors) {
if (isStatic() != isStatic) {
String state = isStatic ? "should" : "should not";
errors.add(new Exception("Method " + method.getName() + "() " + state + " be static"));
}
if (!isPublic()) {
... | [
"public",
"void",
"validatePublicVoid",
"(",
"boolean",
"isStatic",
",",
"List",
"<",
"Throwable",
">",
"errors",
")",
"{",
"if",
"(",
"isStatic",
"(",
")",
"!=",
"isStatic",
")",
"{",
"String",
"state",
"=",
"isStatic",
"?",
"\"should\"",
":",
"\"should n... | Adds to {@code errors} if this method:
<ul>
<li>is not public, or
<li>returns something other than void, or
<li>is static (given {@code isStatic is false}), or
<li>is not static (given {@code isStatic is true}).
</ul> | [
"Adds",
"to",
"{"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runners/model/FrameworkMethod.java#L99-L110 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.visitCall | private void visitCall(NodeTraversal t, Node n) {
"""
Visits a CALL node.
@param t The node traversal object that supplies context, such as the
scope chain to use in name lookups as well as error reporting.
@param n The node being visited.
"""
checkCallConventions(t, n);
Node child = n.getFirstCh... | java | private void visitCall(NodeTraversal t, Node n) {
checkCallConventions(t, n);
Node child = n.getFirstChild();
JSType childType = getJSType(child).restrictByNotNullOrUndefined();
if (!childType.canBeCalled()) {
report(n, NOT_CALLABLE, childType.toString());
ensureTyped(n);
return;
... | [
"private",
"void",
"visitCall",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"checkCallConventions",
"(",
"t",
",",
"n",
")",
";",
"Node",
"child",
"=",
"n",
".",
"getFirstChild",
"(",
")",
";",
"JSType",
"childType",
"=",
"getJSType",
"(",
"... | Visits a CALL node.
@param t The node traversal object that supplies context, such as the
scope chain to use in name lookups as well as error reporting.
@param n The node being visited. | [
"Visits",
"a",
"CALL",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L2534-L2583 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/sparse/Arrays.java | Arrays.binarySearch | public static int binarySearch(int[] index, int key, int begin, int end) {
"""
Searches for a key in a subset of a sorted array.
@param index
Sorted array of integers
@param key
Key to search for
@param begin
Start posisiton in the index
@param end
One past the end position in the index
@return Integer ... | java | public static int binarySearch(int[] index, int key, int begin, int end) {
return java.util.Arrays.binarySearch(index, begin, end, key);
} | [
"public",
"static",
"int",
"binarySearch",
"(",
"int",
"[",
"]",
"index",
",",
"int",
"key",
",",
"int",
"begin",
",",
"int",
"end",
")",
"{",
"return",
"java",
".",
"util",
".",
"Arrays",
".",
"binarySearch",
"(",
"index",
",",
"begin",
",",
"end",
... | Searches for a key in a subset of a sorted array.
@param index
Sorted array of integers
@param key
Key to search for
@param begin
Start posisiton in the index
@param end
One past the end position in the index
@return Integer index to key. A negative integer if not found | [
"Searches",
"for",
"a",
"key",
"in",
"a",
"subset",
"of",
"a",
"sorted",
"array",
"."
] | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/sparse/Arrays.java#L119-L121 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java | KerasEmbedding.getInputLengthFromConfig | private int getInputLengthFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
"""
Get Keras input length from Keras layer configuration. In Keras input_length, if present, denotes
the number of indices to embed per mini-batch, i.e. input will be of shape (mb, input_length)
and... | java | private int getInputLengthFromConfig(Map<String, Object> layerConfig) throws InvalidKerasConfigurationException {
Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
if (!innerConfig.containsKey(conf.getLAYER_FIELD_INPUT_LENGTH()))
throw new In... | [
"private",
"int",
"getInputLengthFromConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"layerConfig",
")",
"throws",
"InvalidKerasConfigurationException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"innerConfig",
"=",
"KerasLayerUtils",
".",
"getInnerLayer... | Get Keras input length from Keras layer configuration. In Keras input_length, if present, denotes
the number of indices to embed per mini-batch, i.e. input will be of shape (mb, input_length)
and (mb, 1) else.
@param layerConfig dictionary containing Keras layer configuration
@return input length as int | [
"Get",
"Keras",
"input",
"length",
"from",
"Keras",
"layer",
"configuration",
".",
"In",
"Keras",
"input_length",
"if",
"present",
"denotes",
"the",
"number",
"of",
"indices",
"to",
"embed",
"per",
"mini",
"-",
"batch",
"i",
".",
"e",
".",
"input",
"will",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/layers/embeddings/KerasEmbedding.java#L211-L221 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java | IndexingConfigurationImpl.isIncludedInNodeScopeIndex | public boolean isIncludedInNodeScopeIndex(NodeData state, InternalQName propertyName) {
"""
Returns <code>true</code> if the property with the given name should be
included in the node scope fulltext index. If there is not configuration
entry for that propery <code>false</code> is returned.
@param state
the ... | java | public boolean isIncludedInNodeScopeIndex(NodeData state, InternalQName propertyName)
{
IndexingRule rule = getApplicableIndexingRule(state);
if (rule != null)
{
return rule.isIncludedInNodeScopeIndex(propertyName);
}
// none of the config elements matched -> default is to incl... | [
"public",
"boolean",
"isIncludedInNodeScopeIndex",
"(",
"NodeData",
"state",
",",
"InternalQName",
"propertyName",
")",
"{",
"IndexingRule",
"rule",
"=",
"getApplicableIndexingRule",
"(",
"state",
")",
";",
"if",
"(",
"rule",
"!=",
"null",
")",
"{",
"return",
"r... | Returns <code>true</code> if the property with the given name should be
included in the node scope fulltext index. If there is not configuration
entry for that propery <code>false</code> is returned.
@param state
the node state.
@param propertyName
the name of a property.
@return <code>true</code> if the property shou... | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"property",
"with",
"the",
"given",
"name",
"should",
"be",
"included",
"in",
"the",
"node",
"scope",
"fulltext",
"index",
".",
"If",
"there",
"is",
"not",
"configuration",
"entry",
"for",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingConfigurationImpl.java#L310-L319 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.listNoteOccurrences | public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) {
"""
Lists occurrences referencing the specified note. Provider projects can use this method to get
all occurrences across consumer projects referencing the specified note.
<p>Sample code:
<pre><code>
try (Grafea... | java | public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) {
ListNoteOccurrencesRequest request =
ListNoteOccurrencesRequest.newBuilder().setName(name).setFilter(filter).build();
return listNoteOccurrences(request);
} | [
"public",
"final",
"ListNoteOccurrencesPagedResponse",
"listNoteOccurrences",
"(",
"String",
"name",
",",
"String",
"filter",
")",
"{",
"ListNoteOccurrencesRequest",
"request",
"=",
"ListNoteOccurrencesRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
... | Lists occurrences referencing the specified note. Provider projects can use this method to get
all occurrences across consumer projects referencing the specified note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]",... | [
"Lists",
"occurrences",
"referencing",
"the",
"specified",
"note",
".",
"Provider",
"projects",
"can",
"use",
"this",
"method",
"to",
"get",
"all",
"occurrences",
"across",
"consumer",
"projects",
"referencing",
"the",
"specified",
"note",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1649-L1653 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTreeIndex.java | MkTabTreeIndex.createNewLeafEntry | protected MkTabEntry createNewLeafEntry(DBID id, O object, double parentDistance) {
"""
Creates a new leaf entry representing the specified data object in the
specified subtree.
@param object the data object to be represented by the new entry
@param parentDistance the distance from the object to the routing o... | java | protected MkTabEntry createNewLeafEntry(DBID id, O object, double parentDistance) {
return new MkTabLeafEntry(id, parentDistance, knnDistances(object));
} | [
"protected",
"MkTabEntry",
"createNewLeafEntry",
"(",
"DBID",
"id",
",",
"O",
"object",
",",
"double",
"parentDistance",
")",
"{",
"return",
"new",
"MkTabLeafEntry",
"(",
"id",
",",
"parentDistance",
",",
"knnDistances",
"(",
"object",
")",
")",
";",
"}"
] | Creates a new leaf entry representing the specified data object in the
specified subtree.
@param object the data object to be represented by the new entry
@param parentDistance the distance from the object to the routing object of
the parent node | [
"Creates",
"a",
"new",
"leaf",
"entry",
"representing",
"the",
"specified",
"data",
"object",
"in",
"the",
"specified",
"subtree",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTreeIndex.java#L76-L78 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.verifyFaceToPersonAsync | public Observable<VerifyResult> verifyFaceToPersonAsync(UUID faceId, String personGroupId, UUID personId) {
"""
Verify whether two faces belong to a same person. Compares a face Id with a Person Id.
@param faceId FaceId the face, comes from Face - Detect
@param personGroupId Using existing personGroupId and pe... | java | public Observable<VerifyResult> verifyFaceToPersonAsync(UUID faceId, String personGroupId, UUID personId) {
return verifyFaceToPersonWithServiceResponseAsync(faceId, personGroupId, personId).map(new Func1<ServiceResponse<VerifyResult>, VerifyResult>() {
@Override
public VerifyResult call... | [
"public",
"Observable",
"<",
"VerifyResult",
">",
"verifyFaceToPersonAsync",
"(",
"UUID",
"faceId",
",",
"String",
"personGroupId",
",",
"UUID",
"personId",
")",
"{",
"return",
"verifyFaceToPersonWithServiceResponseAsync",
"(",
"faceId",
",",
"personGroupId",
",",
"pe... | Verify whether two faces belong to a same person. Compares a face Id with a Person Id.
@param faceId FaceId the face, comes from Face - Detect
@param personGroupId Using existing personGroupId and personId for fast loading a specified person. personGroupId is created in Person Groups.Create.
@param personId Specify a ... | [
"Verify",
"whether",
"two",
"faces",
"belong",
"to",
"a",
"same",
"person",
".",
"Compares",
"a",
"face",
"Id",
"with",
"a",
"Person",
"Id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L857-L864 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/AbstractReplicator.java | AbstractReplicator.addDocumentReplicationListener | @NonNull
public ListenerToken addDocumentReplicationListener(
Executor executor,
@NonNull DocumentReplicationListener listener) {
"""
Set the given DocumentReplicationListener to the this replicator.
@param listener
"""
if (listener == null) { throw new IllegalArgumentException("... | java | @NonNull
public ListenerToken addDocumentReplicationListener(
Executor executor,
@NonNull DocumentReplicationListener listener) {
if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }
synchronized (lock) {
setProgressLevel(ReplicatorPr... | [
"@",
"NonNull",
"public",
"ListenerToken",
"addDocumentReplicationListener",
"(",
"Executor",
"executor",
",",
"@",
"NonNull",
"DocumentReplicationListener",
"listener",
")",
"{",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Set the given DocumentReplicationListener to the this replicator.
@param listener | [
"Set",
"the",
"given",
"DocumentReplicationListener",
"to",
"the",
"this",
"replicator",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractReplicator.java#L446-L458 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.routeToAll | protected boolean routeToAll(String msg, LogRecord logRecord, Set<String> logHandlerIds) {
"""
Route the message to all LogHandlers in the set.
@return true if the set contained DEFAULT, which means the msg should be logged
normally as well. false otherwise.
"""
boolean logNormally = false;
... | java | protected boolean routeToAll(String msg, LogRecord logRecord, Set<String> logHandlerIds) {
boolean logNormally = false;
for (String id : logHandlerIds) {
if (id.equals("DEFAULT")) {
// DEFAULT is still in the list, so we should tell the caller to also log
/... | [
"protected",
"boolean",
"routeToAll",
"(",
"String",
"msg",
",",
"LogRecord",
"logRecord",
",",
"Set",
"<",
"String",
">",
"logHandlerIds",
")",
"{",
"boolean",
"logNormally",
"=",
"false",
";",
"for",
"(",
"String",
"id",
":",
"logHandlerIds",
")",
"{",
"... | Route the message to all LogHandlers in the set.
@return true if the set contained DEFAULT, which means the msg should be logged
normally as well. false otherwise. | [
"Route",
"the",
"message",
"to",
"all",
"LogHandlers",
"in",
"the",
"set",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L255-L270 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java | PrivateKeyReader.readPemPrivateKey | public static PrivateKey readPemPrivateKey(final String privateKeyAsString,
final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
"""
Reads the given {@link String}( in *.pem format) with given algorithm and returns the
{@link PrivateKey} object.
@param... | java | public static PrivateKey readPemPrivateKey(final String privateKeyAsString,
final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
{
final byte[] decoded = new Base64().decode(privateKeyAsString);
return readPrivateKey(decoded, algorithm);
} | [
"public",
"static",
"PrivateKey",
"readPemPrivateKey",
"(",
"final",
"String",
"privateKeyAsString",
",",
"final",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"final",
"byte",
"[",
... | Reads the given {@link String}( in *.pem format) with given algorithm and returns the
{@link PrivateKey} object.
@param privateKeyAsString
the private key as string( in *.pem format)
@param algorithm
the algorithm
@return the {@link PrivateKey} object
@throws NoSuchAlgorithmException
is thrown if instantiation of the... | [
"Reads",
"the",
"given",
"{",
"@link",
"String",
"}",
"(",
"in",
"*",
".",
"pem",
"format",
")",
"with",
"given",
"algorithm",
"and",
"returns",
"the",
"{",
"@link",
"PrivateKey",
"}",
"object",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PrivateKeyReader.java#L307-L313 |
hugegraph/hugegraph-common | src/main/java/com/baidu/hugegraph/util/VersionUtil.java | VersionUtil.match | public static boolean match(Version version, String begin, String end) {
"""
Compare if a version is inside a range [begin, end)
@param version The version to be compared
@param begin The lower bound of the range
@param end The upper bound of the range
@return true if belong to the range, ... | java | public static boolean match(Version version, String begin, String end) {
E.checkArgumentNotNull(version, "The version to match is null");
return version.compareTo(new Version(begin)) >= 0 &&
version.compareTo(new Version(end)) < 0;
} | [
"public",
"static",
"boolean",
"match",
"(",
"Version",
"version",
",",
"String",
"begin",
",",
"String",
"end",
")",
"{",
"E",
".",
"checkArgumentNotNull",
"(",
"version",
",",
"\"The version to match is null\"",
")",
";",
"return",
"version",
".",
"compareTo",... | Compare if a version is inside a range [begin, end)
@param version The version to be compared
@param begin The lower bound of the range
@param end The upper bound of the range
@return true if belong to the range, otherwise false | [
"Compare",
"if",
"a",
"version",
"is",
"inside",
"a",
"range",
"[",
"begin",
"end",
")"
] | train | https://github.com/hugegraph/hugegraph-common/blob/1eb2414134b639a13f68ca352c1b3eb2d956e7b2/src/main/java/com/baidu/hugegraph/util/VersionUtil.java#L38-L42 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.queryForChunk | public TResult queryForChunk(int limit, long offset) {
"""
Query for id ordered rows starting at the offset and returning no more
than the limit.
@param limit
chunk limit
@param offset
chunk query offset
@return result
@since 3.1.0
"""
return queryForChunk(table.getPkColumn().getName(), limit, offse... | java | public TResult queryForChunk(int limit, long offset) {
return queryForChunk(table.getPkColumn().getName(), limit, offset);
} | [
"public",
"TResult",
"queryForChunk",
"(",
"int",
"limit",
",",
"long",
"offset",
")",
"{",
"return",
"queryForChunk",
"(",
"table",
".",
"getPkColumn",
"(",
")",
".",
"getName",
"(",
")",
",",
"limit",
",",
"offset",
")",
";",
"}"
] | Query for id ordered rows starting at the offset and returning no more
than the limit.
@param limit
chunk limit
@param offset
chunk query offset
@return result
@since 3.1.0 | [
"Query",
"for",
"id",
"ordered",
"rows",
"starting",
"at",
"the",
"offset",
"and",
"returning",
"no",
"more",
"than",
"the",
"limit",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L487-L489 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/FileServersInner.java | FileServersInner.beginCreate | public FileServerInner beginCreate(String resourceGroupName, String fileServerName, FileServerCreateParameters parameters) {
"""
Creates a file server.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param fileServerName The name of the file server within the specified resou... | java | public FileServerInner beginCreate(String resourceGroupName, String fileServerName, FileServerCreateParameters parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, fileServerName, parameters).toBlocking().single().body();
} | [
"public",
"FileServerInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"fileServerName",
",",
"FileServerCreateParameters",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"fileServerName",
",",
... | Creates a file server.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param fileServerName The name of the file server within the specified resource group. File server names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name m... | [
"Creates",
"a",
"file",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_03_01/src/main/java/com/microsoft/azure/management/batchai/v2018_03_01/implementation/FileServersInner.java#L196-L198 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeJMX | public void writeJMX(OutputStream out, JMXServerInfo value) throws IOException {
"""
Encode a JMX instance as JSON:
{
"version" : Integer,
"mbeans" : URL,
"createMBean" : URL,
"mbeanCount" : URL,
"defaultDomain" : URL,
"domains" : URL,
"notifications" : URL,
"instanceOf" : URL
}
@param out The stream ... | java | public void writeJMX(OutputStream out, JMXServerInfo value) throws IOException {
writeStartObject(out);
writeIntField(out, OM_VERSION, value.version);
writeStringField(out, OM_MBEANS, value.mbeansURL);
writeStringField(out, OM_CREATEMBEAN, value.createMBeanURL);
writeStringField(... | [
"public",
"void",
"writeJMX",
"(",
"OutputStream",
"out",
",",
"JMXServerInfo",
"value",
")",
"throws",
"IOException",
"{",
"writeStartObject",
"(",
"out",
")",
";",
"writeIntField",
"(",
"out",
",",
"OM_VERSION",
",",
"value",
".",
"version",
")",
";",
"wri... | Encode a JMX instance as JSON:
{
"version" : Integer,
"mbeans" : URL,
"createMBean" : URL,
"mbeanCount" : URL,
"defaultDomain" : URL,
"domains" : URL,
"notifications" : URL,
"instanceOf" : URL
}
@param out The stream to write JSON to
@param value The JMX instance to encode. Can't be null.
@throws IOException If an I/O... | [
"Encode",
"a",
"JMX",
"instance",
"as",
"JSON",
":",
"{",
"version",
":",
"Integer",
"mbeans",
":",
"URL",
"createMBean",
":",
"URL",
"mbeanCount",
":",
"URL",
"defaultDomain",
":",
"URL",
"domains",
":",
"URL",
"notifications",
":",
"URL",
"instanceOf",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L963-L977 |
joniles/mpxj | src/main/java/net/sf/mpxj/reader/UniversalProjectReader.java | UniversalProjectReader.matchesFingerprint | private boolean matchesFingerprint(byte[] buffer, Pattern fingerprint) {
"""
Determine if the buffer, when expressed as text, matches a fingerprint regular expression.
@param buffer bytes from file
@param fingerprint fingerprint regular expression
@return true if the file matches the fingerprint
"""
... | java | private boolean matchesFingerprint(byte[] buffer, Pattern fingerprint)
{
return fingerprint.matcher(m_charset == null ? new String(buffer) : new String(buffer, m_charset)).matches();
} | [
"private",
"boolean",
"matchesFingerprint",
"(",
"byte",
"[",
"]",
"buffer",
",",
"Pattern",
"fingerprint",
")",
"{",
"return",
"fingerprint",
".",
"matcher",
"(",
"m_charset",
"==",
"null",
"?",
"new",
"String",
"(",
"buffer",
")",
":",
"new",
"String",
"... | Determine if the buffer, when expressed as text, matches a fingerprint regular expression.
@param buffer bytes from file
@param fingerprint fingerprint regular expression
@return true if the file matches the fingerprint | [
"Determine",
"if",
"the",
"buffer",
"when",
"expressed",
"as",
"text",
"matches",
"a",
"fingerprint",
"regular",
"expression",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/reader/UniversalProjectReader.java#L341-L344 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withBigInteger | public Item withBigInteger(String attrName, BigInteger val) {
"""
Sets the value of the specified attribute in the current item to the
given value.
"""
checkInvalidAttrName(attrName);
return withNumber(attrName, val);
} | java | public Item withBigInteger(String attrName, BigInteger val) {
checkInvalidAttrName(attrName);
return withNumber(attrName, val);
} | [
"public",
"Item",
"withBigInteger",
"(",
"String",
"attrName",
",",
"BigInteger",
"val",
")",
"{",
"checkInvalidAttrName",
"(",
"attrName",
")",
";",
"return",
"withNumber",
"(",
"attrName",
",",
"val",
")",
";",
"}"
] | Sets the value of the specified attribute in the current item to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L296-L299 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/CommonUtils.java | CommonUtils.parseInt | public static int parseInt(String num, int defaultInt) {
"""
字符串转数值
@param num 数字
@param defaultInt 默认值
@return int
"""
if (num == null) {
return defaultInt;
} else {
try {
return Integer.parseInt(num);
} catch (Exception e) {
... | java | public static int parseInt(String num, int defaultInt) {
if (num == null) {
return defaultInt;
} else {
try {
return Integer.parseInt(num);
} catch (Exception e) {
return defaultInt;
}
}
} | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"num",
",",
"int",
"defaultInt",
")",
"{",
"if",
"(",
"num",
"==",
"null",
")",
"{",
"return",
"defaultInt",
";",
"}",
"else",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"num",
")... | 字符串转数值
@param num 数字
@param defaultInt 默认值
@return int | [
"字符串转数值"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/CommonUtils.java#L166-L176 |
CrawlScript/WebCollector | src/main/java/cn/edu/hfut/dmic/webcollector/example/DemoAnnotatedBingCrawler.java | DemoAnnotatedBingCrawler.visitRedirect | @MatchCode(codes = {
"""
you have to copy it to the added task by "xxxx.meta(page.copyMeta())"
"""301, 302})
public void visitRedirect(Page page, CrawlDatums next){
try {
// page.location() may be relative url path
// we have to construct an absolute url path
Str... | java | @MatchCode(codes = {301, 302})
public void visitRedirect(Page page, CrawlDatums next){
try {
// page.location() may be relative url path
// we have to construct an absolute url path
String redirectUrl = new URL(new URL(page.url()), page.location()).toExternalForm();
... | [
"@",
"MatchCode",
"(",
"codes",
"=",
"{",
"301",
",",
"302",
"}",
")",
"public",
"void",
"visitRedirect",
"(",
"Page",
"page",
",",
"CrawlDatums",
"next",
")",
"{",
"try",
"{",
"// page.location() may be relative url path",
"// we have to construct an absolute url p... | you have to copy it to the added task by "xxxx.meta(page.copyMeta())" | [
"you",
"have",
"to",
"copy",
"it",
"to",
"the",
"added",
"task",
"by",
"xxxx",
".",
"meta",
"(",
"page",
".",
"copyMeta",
"()",
")"
] | train | https://github.com/CrawlScript/WebCollector/blob/4ca71ec0e69d354feaf64319d76e64663159902d/src/main/java/cn/edu/hfut/dmic/webcollector/example/DemoAnnotatedBingCrawler.java#L71-L82 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/QuickChart.java | QuickChart.getChart | public static XYChart getChart(
String chartTitle,
String xTitle,
String yTitle,
String[] seriesNames,
double[] xData,
double[][] yData) {
"""
Creates a Chart with multiple Series for the same X-Axis data with default style
@param chartTitle the Chart title
@param xTitle The... | java | public static XYChart getChart(
String chartTitle,
String xTitle,
String yTitle,
String[] seriesNames,
double[] xData,
double[][] yData) {
// Create Chart
XYChart chart = new XYChart(WIDTH, HEIGHT);
// Customize Chart
chart.setTitle(chartTitle);
chart.setXAxisTi... | [
"public",
"static",
"XYChart",
"getChart",
"(",
"String",
"chartTitle",
",",
"String",
"xTitle",
",",
"String",
"yTitle",
",",
"String",
"[",
"]",
"seriesNames",
",",
"double",
"[",
"]",
"xData",
",",
"double",
"[",
"]",
"[",
"]",
"yData",
")",
"{",
"/... | Creates a Chart with multiple Series for the same X-Axis data with default style
@param chartTitle the Chart title
@param xTitle The X-Axis title
@param yTitle The Y-Axis title
@param seriesNames An array of the name of the multiple series
@param xData An array containing the X-Axis data
@param yData An array of doubl... | [
"Creates",
"a",
"Chart",
"with",
"multiple",
"Series",
"for",
"the",
"same",
"X",
"-",
"Axis",
"data",
"with",
"default",
"style"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/QuickChart.java#L57-L85 |
infinispan/infinispan | server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java | ExtendedByteBuf.readMaybeString | public static Optional<String> readMaybeString(ByteBuf bf) {
"""
Reads a string if possible. If not present the reader index is reset to the last mark.
@param bf
@return
"""
Optional<byte[]> bytes = readMaybeRangedBytes(bf);
return bytes.map(b -> {
if (b.length == 0) return "";
... | java | public static Optional<String> readMaybeString(ByteBuf bf) {
Optional<byte[]> bytes = readMaybeRangedBytes(bf);
return bytes.map(b -> {
if (b.length == 0) return "";
else return new String(b, CharsetUtil.UTF_8);
});
} | [
"public",
"static",
"Optional",
"<",
"String",
">",
"readMaybeString",
"(",
"ByteBuf",
"bf",
")",
"{",
"Optional",
"<",
"byte",
"[",
"]",
">",
"bytes",
"=",
"readMaybeRangedBytes",
"(",
"bf",
")",
";",
"return",
"bytes",
".",
"map",
"(",
"b",
"->",
"{"... | Reads a string if possible. If not present the reader index is reset to the last mark.
@param bf
@return | [
"Reads",
"a",
"string",
"if",
"possible",
".",
"If",
"not",
"present",
"the",
"reader",
"index",
"is",
"reset",
"to",
"the",
"last",
"mark",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/hotrod/src/main/java/org/infinispan/server/hotrod/transport/ExtendedByteBuf.java#L244-L250 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/LiteralMapList.java | LiteralMapList.select | public LiteralMapList select(String key, Object value) {
"""
Answer a LiteralMapList containing only literal maps with the given key and value
@param key
@param value
@return
"""
LiteralMapList ret = new LiteralMapList();
for (LiteralMap lm : this) {
if (isEqual(value, lm.get(key)))
ret.add(lm);
... | java | public LiteralMapList select(String key, Object value) {
LiteralMapList ret = new LiteralMapList();
for (LiteralMap lm : this) {
if (isEqual(value, lm.get(key)))
ret.add(lm);
}
return ret;
} | [
"public",
"LiteralMapList",
"select",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"LiteralMapList",
"ret",
"=",
"new",
"LiteralMapList",
"(",
")",
";",
"for",
"(",
"LiteralMap",
"lm",
":",
"this",
")",
"{",
"if",
"(",
"isEqual",
"(",
"value",... | Answer a LiteralMapList containing only literal maps with the given key and value
@param key
@param value
@return | [
"Answer",
"a",
"LiteralMapList",
"containing",
"only",
"literal",
"maps",
"with",
"the",
"given",
"key",
"and",
"value"
] | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/LiteralMapList.java#L62-L69 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsMessages.java | CmsMessages.getRegEx | private static String getRegEx(int position, String... options) {
"""
Returns a regular expression for replacement.<p>
@param position the parameter number
@param options the optional options
@return the regular expression for replacement
"""
String value = "" + position;
for (int i = 0... | java | private static String getRegEx(int position, String... options) {
String value = "" + position;
for (int i = 0; i < options.length; i++) {
value += "," + options[i];
}
return "{" + value + "}";
} | [
"private",
"static",
"String",
"getRegEx",
"(",
"int",
"position",
",",
"String",
"...",
"options",
")",
"{",
"String",
"value",
"=",
"\"\"",
"+",
"position",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"i",
... | Returns a regular expression for replacement.<p>
@param position the parameter number
@param options the optional options
@return the regular expression for replacement | [
"Returns",
"a",
"regular",
"expression",
"for",
"replacement",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsMessages.java#L179-L186 |
haifengl/smile | core/src/main/java/smile/regression/NeuralNetwork.java | NeuralNetwork.backpropagate | private void backpropagate(Layer upper, Layer lower) {
"""
Propagates the errors back from a upper layer to the next lower layer.
@param upper the lower layer where errors are from.
@param lower the upper layer where errors are propagated back to.
"""
for (int i = 0; i <= lower.units; i++) {
... | java | private void backpropagate(Layer upper, Layer lower) {
for (int i = 0; i <= lower.units; i++) {
double out = lower.output[i];
double err = 0;
for (int j = 0; j < upper.units; j++) {
err += upper.weight[j][i] * upper.error[j];
}
if (acti... | [
"private",
"void",
"backpropagate",
"(",
"Layer",
"upper",
",",
"Layer",
"lower",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<=",
"lower",
".",
"units",
";",
"i",
"++",
")",
"{",
"double",
"out",
"=",
"lower",
".",
"output",
"[",
"i",... | Propagates the errors back from a upper layer to the next lower layer.
@param upper the lower layer where errors are from.
@param lower the upper layer where errors are propagated back to. | [
"Propagates",
"the",
"errors",
"back",
"from",
"a",
"upper",
"layer",
"to",
"the",
"next",
"lower",
"layer",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/regression/NeuralNetwork.java#L496-L510 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedTemporaryStorage.java | LimitedTemporaryStorage.createFile | public LimitedOutputStream createFile() throws IOException {
"""
Create a new temporary file. All methods of the returned output stream may throw
{@link TemporaryStorageFullException} if the temporary storage area fills up.
@return output stream to the file
@throws TemporaryStorageFullException if the tempo... | java | public LimitedOutputStream createFile() throws IOException
{
if (bytesUsed.get() >= maxBytesUsed) {
throw new TemporaryStorageFullException(maxBytesUsed);
}
synchronized (files) {
if (closed) {
throw new ISE("Closed");
}
FileUtils.forceMkdir(storageDirectory);
if (!... | [
"public",
"LimitedOutputStream",
"createFile",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bytesUsed",
".",
"get",
"(",
")",
">=",
"maxBytesUsed",
")",
"{",
"throw",
"new",
"TemporaryStorageFullException",
"(",
"maxBytesUsed",
")",
";",
"}",
"synchronize... | Create a new temporary file. All methods of the returned output stream may throw
{@link TemporaryStorageFullException} if the temporary storage area fills up.
@return output stream to the file
@throws TemporaryStorageFullException if the temporary storage area is full
@throws IOException if somethin... | [
"Create",
"a",
"new",
"temporary",
"file",
".",
"All",
"methods",
"of",
"the",
"returned",
"output",
"stream",
"may",
"throw",
"{",
"@link",
"TemporaryStorageFullException",
"}",
"if",
"the",
"temporary",
"storage",
"area",
"fills",
"up",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/LimitedTemporaryStorage.java#L74-L100 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java | ClasspathScanDescriptorProvider.scanPackage | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader) {
"""
Scans a package in the classpath (of a particular classloader) for annotated components.
@param packageName the package name to scan
@param recursive whether or... | java | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader) {
return scanPackage(packageName, recursive, classLoader, true);
} | [
"public",
"ClasspathScanDescriptorProvider",
"scanPackage",
"(",
"final",
"String",
"packageName",
",",
"final",
"boolean",
"recursive",
",",
"final",
"ClassLoader",
"classLoader",
")",
"{",
"return",
"scanPackage",
"(",
"packageName",
",",
"recursive",
",",
"classLoa... | Scans a package in the classpath (of a particular classloader) for annotated components.
@param packageName the package name to scan
@param recursive whether or not to scan subpackages recursively
@param classLoader the classloader to use
@return | [
"Scans",
"a",
"package",
"in",
"the",
"classpath",
"(",
"of",
"a",
"particular",
"classloader",
")",
"for",
"annotated",
"components",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/descriptors/ClasspathScanDescriptorProvider.java#L191-L194 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.findByG_C | @Override
public CommerceCurrency findByG_C(long groupId, String code)
throws NoSuchCurrencyException {
"""
Returns the commerce currency where groupId = ? and code = ? or throws a {@link NoSuchCurrencyException} if it could not be found.
@param groupId the group ID
@param code the code
@return the... | java | @Override
public CommerceCurrency findByG_C(long groupId, String code)
throws NoSuchCurrencyException {
CommerceCurrency commerceCurrency = fetchByG_C(groupId, code);
if (commerceCurrency == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("groupId=")... | [
"@",
"Override",
"public",
"CommerceCurrency",
"findByG_C",
"(",
"long",
"groupId",
",",
"String",
"code",
")",
"throws",
"NoSuchCurrencyException",
"{",
"CommerceCurrency",
"commerceCurrency",
"=",
"fetchByG_C",
"(",
"groupId",
",",
"code",
")",
";",
"if",
"(",
... | Returns the commerce currency where groupId = ? and code = ? or throws a {@link NoSuchCurrencyException} if it could not be found.
@param groupId the group ID
@param code the code
@return the matching commerce currency
@throws NoSuchCurrencyException if a matching commerce currency could not be found | [
"Returns",
"the",
"commerce",
"currency",
"where",
"groupId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCurrencyException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L2011-L2037 |
lucee/Lucee | core/src/main/java/lucee/commons/io/log/log4j/appender/ResourceAppender.java | ResourceAppender.setFile | protected void setFile(boolean append) throws IOException {
"""
<p>
Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
<p>
If there was already an opened file, then the previous file is closed first.
<p>
<b>Do not use this method directly. To configure a File... | java | protected void setFile(boolean append) throws IOException {
synchronized (sync) {
LogLog.debug("setFile called: " + res + ", " + append);
// It does not make sense to have immediate flush and bufferedIO.
if (bufferedIO) {
setImmediateFlush(false);
}
reset();
Resource parent = res.getP... | [
"protected",
"void",
"setFile",
"(",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"sync",
")",
"{",
"LogLog",
".",
"debug",
"(",
"\"setFile called: \"",
"+",
"res",
"+",
"\", \"",
"+",
"append",
")",
";",
"// It does not make se... | <p>
Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
<p>
If there was already an opened file, then the previous file is closed first.
<p>
<b>Do not use this method directly. To configure a FileAppender or one of its subclasses, set its
properties one by one and then ca... | [
"<p",
">",
"Sets",
"and",
"<i",
">",
"opens<",
"/",
"i",
">",
"the",
"file",
"where",
"the",
"log",
"output",
"will",
"go",
".",
"The",
"specified",
"file",
"must",
"be",
"writable",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/log/log4j/appender/ResourceAppender.java#L191-L212 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_vrack_network_vrackNetworkId_DELETE | public void serviceName_vrack_network_vrackNetworkId_DELETE(String serviceName, Long vrackNetworkId) throws IOException {
"""
Delete this description of a private network in the vRack. It must not be used by any farm server
REST: DELETE /ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}
@param servi... | java | public void serviceName_vrack_network_vrackNetworkId_DELETE(String serviceName, Long vrackNetworkId) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}";
StringBuilder sb = path(qPath, serviceName, vrackNetworkId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_vrack_network_vrackNetworkId_DELETE",
"(",
"String",
"serviceName",
",",
"Long",
"vrackNetworkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}\"",
";",
"StringBuilder",
... | Delete this description of a private network in the vRack. It must not be used by any farm server
REST: DELETE /ipLoadbalancing/{serviceName}/vrack/network/{vrackNetworkId}
@param serviceName [required] The internal name of your IP load balancing
@param vrackNetworkId [required] Internal Load Balancer identifier of th... | [
"Delete",
"this",
"description",
"of",
"a",
"private",
"network",
"in",
"the",
"vRack",
".",
"It",
"must",
"not",
"be",
"used",
"by",
"any",
"farm",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1141-L1145 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java | PubSubManager.createNode | public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Creates an instant node, if supported.
@return The node that was created
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedExce... | java | public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub reply = sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE), null);
NodeExtension elem = reply.getExtension("create", PubSubNamespace.basic.getXmlns());
... | [
"public",
"LeafNode",
"createNode",
"(",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"PubSub",
"reply",
"=",
"sendPubsubPacket",
"(",
"Type",
".",
"set",
",",
"new",
"NodeExtension",
... | Creates an instant node, if supported.
@return The node that was created
@throws XMPPErrorException
@throws NoResponseException
@throws NotConnectedException
@throws InterruptedException | [
"Creates",
"an",
"instant",
"node",
"if",
"supported",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java#L197-L205 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXField | public static XField createXField(@DottedClassName String className, String fieldName, String fieldSignature, boolean isStatic) {
"""
Create an XField object
@param className
@param fieldName
@param fieldSignature
@param isStatic
@return the created XField
"""
FieldDescriptor fieldDesc = Descrip... | java | public static XField createXField(@DottedClassName String className, String fieldName, String fieldSignature, boolean isStatic) {
FieldDescriptor fieldDesc = DescriptorFactory.instance().getFieldDescriptor(ClassName.toSlashedClassName(className),
fieldName, fieldSignature, isStatic);
re... | [
"public",
"static",
"XField",
"createXField",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"String",
"fieldName",
",",
"String",
"fieldSignature",
",",
"boolean",
"isStatic",
")",
"{",
"FieldDescriptor",
"fieldDesc",
"=",
"DescriptorFactory",
".",
"insta... | Create an XField object
@param className
@param fieldName
@param fieldSignature
@param isStatic
@return the created XField | [
"Create",
"an",
"XField",
"object"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L459-L464 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java | KeywordParser.isValidKeyword | private boolean isValidKeyword(final String keyword, final Double score) {
"""
Return true if at least one of the values is not null/empty.
@param keyword the sentiment keyword
@param score the sentiment score
@return true if at least one of the values is not null/empty
"""
return !StringUtils.isBla... | java | private boolean isValidKeyword(final String keyword, final Double score) {
return !StringUtils.isBlank(keyword)
|| score != null;
} | [
"private",
"boolean",
"isValidKeyword",
"(",
"final",
"String",
"keyword",
",",
"final",
"Double",
"score",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isBlank",
"(",
"keyword",
")",
"||",
"score",
"!=",
"null",
";",
"}"
] | Return true if at least one of the values is not null/empty.
@param keyword the sentiment keyword
@param score the sentiment score
@return true if at least one of the values is not null/empty | [
"Return",
"true",
"if",
"at",
"least",
"one",
"of",
"the",
"values",
"is",
"not",
"null",
"/",
"empty",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/KeywordParser.java#L114-L117 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsFrameset.java | CmsFrameset.getViewSelect | public String getViewSelect(String htmlAttributes) {
"""
Returns a html select box filled with the views accessible by the current user.<p>
@param htmlAttributes attributes that will be inserted into the generated html
@return a html select box filled with the views accessible by the current user
"""
... | java | public String getViewSelect(String htmlAttributes) {
List<String> options = new ArrayList<String>();
List<String> values = new ArrayList<String>();
int selectedIndex = 0;
// loop through the vectors and fill the result vectors
Iterator<CmsWorkplaceView> i = OpenCms.getWorkplace... | [
"public",
"String",
"getViewSelect",
"(",
"String",
"htmlAttributes",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"new",
"ArrayList",
"<",
"String... | Returns a html select box filled with the views accessible by the current user.<p>
@param htmlAttributes attributes that will be inserted into the generated html
@return a html select box filled with the views accessible by the current user | [
"Returns",
"a",
"html",
"select",
"box",
"filled",
"with",
"the",
"views",
"accessible",
"by",
"the",
"current",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsFrameset.java#L435-L469 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java | AuthenticationApi.signIn | public void signIn(String username, String password, Boolean saml) throws ApiException {
"""
Perform form-based authentication.
Perform form-based authentication by submitting an agent's username and password.
@param username The agent's username, formatted as 'tenant\\username'. (required)
@par... | java | public void signIn(String username, String password, Boolean saml) throws ApiException {
signInWithHttpInfo(username, password, saml);
} | [
"public",
"void",
"signIn",
"(",
"String",
"username",
",",
"String",
"password",
",",
"Boolean",
"saml",
")",
"throws",
"ApiException",
"{",
"signInWithHttpInfo",
"(",
"username",
",",
"password",
",",
"saml",
")",
";",
"}"
] | Perform form-based authentication.
Perform form-based authentication by submitting an agent's username and password.
@param username The agent's username, formatted as 'tenant\\username'. (required)
@param password The agent's password. (required)
@param saml Specifies whether to login using [Securi... | [
"Perform",
"form",
"-",
"based",
"authentication",
".",
"Perform",
"form",
"-",
"based",
"authentication",
"by",
"submitting",
"an",
"agent'",
";",
"s",
"username",
"and",
"password",
"."
] | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/internal/authentication/api/AuthenticationApi.java#L1199-L1201 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.getAsync | public <T> CompletableFuture<T> getAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes asynchronous GET request on the configured URI (alias for the `get(Class, Closure)` method), with additional configuration provided by
the configuration closure. The result will be ca... | java | public <T> CompletableFuture<T> getAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> get(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"getAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",
... | Executes asynchronous GET request on the configured URI (alias for the `get(Class, Closure)` method), with additional configuration provided by
the configuration closure. The result will be cast to the specified `type`.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://localhost:10101'
}
Co... | [
"Executes",
"asynchronous",
"GET",
"request",
"on",
"the",
"configured",
"URI",
"(",
"alias",
"for",
"the",
"get",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"closure",
".",
"Th... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L465-L467 |
upwork/java-upwork | src/com/Upwork/api/Routers/Hr/Submissions.java | Submissions.requestApproval | public JSONObject requestApproval(HashMap<String, String> params) throws JSONException {
"""
Freelancer submits work for the client to approve
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return oClient.post("/hr/v3/fp/submissions", params);
... | java | public JSONObject requestApproval(HashMap<String, String> params) throws JSONException {
return oClient.post("/hr/v3/fp/submissions", params);
} | [
"public",
"JSONObject",
"requestApproval",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"post",
"(",
"\"/hr/v3/fp/submissions\"",
",",
"params",
")",
";",
"}"
] | Freelancer submits work for the client to approve
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Freelancer",
"submits",
"work",
"for",
"the",
"client",
"to",
"approve"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Hr/Submissions.java#L53-L55 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java | MultiViewOps.homographyStereo2Lines | public static DMatrixRMaj homographyStereo2Lines( DMatrixRMaj F , PairLineNorm line0, PairLineNorm line1) {
"""
Computes the homography induced from a planar surface when viewed from two views using correspondences
of two lines. Observations must be on the planar surface.
@see HomographyInducedStereo2Line
@... | java | public static DMatrixRMaj homographyStereo2Lines( DMatrixRMaj F , PairLineNorm line0, PairLineNorm line1) {
HomographyInducedStereo2Line alg = new HomographyInducedStereo2Line();
alg.setFundamental(F,null);
if( !alg.process(line0,line1) )
return null;
return alg.getHomography();
} | [
"public",
"static",
"DMatrixRMaj",
"homographyStereo2Lines",
"(",
"DMatrixRMaj",
"F",
",",
"PairLineNorm",
"line0",
",",
"PairLineNorm",
"line1",
")",
"{",
"HomographyInducedStereo2Line",
"alg",
"=",
"new",
"HomographyInducedStereo2Line",
"(",
")",
";",
"alg",
".",
... | Computes the homography induced from a planar surface when viewed from two views using correspondences
of two lines. Observations must be on the planar surface.
@see HomographyInducedStereo2Line
@param F Fundamental matrix
@param line0 Line on the plane
@param line1 Line on the plane
@return The homography from view ... | [
"Computes",
"the",
"homography",
"induced",
"from",
"a",
"planar",
"surface",
"when",
"viewed",
"from",
"two",
"views",
"using",
"correspondences",
"of",
"two",
"lines",
".",
"Observations",
"must",
"be",
"on",
"the",
"planar",
"surface",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/MultiViewOps.java#L573-L580 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectLineLine | public static boolean intersectLineLine(float ps1x, float ps1y, float pe1x, float pe1y, float ps2x, float ps2y, float pe2x, float pe2y, Vector2f p) {
"""
Determine whether the two lines, specified via two points lying on each line, intersect each other, and store the point of intersection
into the given vector <c... | java | public static boolean intersectLineLine(float ps1x, float ps1y, float pe1x, float pe1y, float ps2x, float ps2y, float pe2x, float pe2y, Vector2f p) {
float d1x = ps1x - pe1x;
float d1y = pe1y - ps1y;
float d1ps1 = d1y * ps1x + d1x * ps1y;
float d2x = ps2x - pe2x;
float d2y = pe2y... | [
"public",
"static",
"boolean",
"intersectLineLine",
"(",
"float",
"ps1x",
",",
"float",
"ps1y",
",",
"float",
"pe1x",
",",
"float",
"pe1y",
",",
"float",
"ps2x",
",",
"float",
"ps2y",
",",
"float",
"pe2x",
",",
"float",
"pe2y",
",",
"Vector2f",
"p",
")",... | Determine whether the two lines, specified via two points lying on each line, intersect each other, and store the point of intersection
into the given vector <code>p</code>.
@param ps1x
the x coordinate of the first point on the first line
@param ps1y
the y coordinate of the first point on the first line
@param pe1x
t... | [
"Determine",
"whether",
"the",
"two",
"lines",
"specified",
"via",
"two",
"points",
"lying",
"on",
"each",
"line",
"intersect",
"each",
"other",
"and",
"store",
"the",
"point",
"of",
"intersection",
"into",
"the",
"given",
"vector",
"<code",
">",
"p<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L4941-L4954 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/FaultToleranceStateFactory.java | FaultToleranceStateFactory.createCircuitBreakerState | public CircuitBreakerState createCircuitBreakerState(CircuitBreakerPolicy policy, MetricRecorder metricRecorder) {
"""
Create an object implementing CircuitBreaker
@param policy the CircuitBreakerPolicy, may be {@code null}
@return a new CircuitBreakerState
"""
if (policy == null) {
ret... | java | public CircuitBreakerState createCircuitBreakerState(CircuitBreakerPolicy policy, MetricRecorder metricRecorder) {
if (policy == null) {
return new CircuitBreakerStateNullImpl();
} else {
return new CircuitBreakerStateImpl(policy, metricRecorder);
}
} | [
"public",
"CircuitBreakerState",
"createCircuitBreakerState",
"(",
"CircuitBreakerPolicy",
"policy",
",",
"MetricRecorder",
"metricRecorder",
")",
"{",
"if",
"(",
"policy",
"==",
"null",
")",
"{",
"return",
"new",
"CircuitBreakerStateNullImpl",
"(",
")",
";",
"}",
"... | Create an object implementing CircuitBreaker
@param policy the CircuitBreakerPolicy, may be {@code null}
@return a new CircuitBreakerState | [
"Create",
"an",
"object",
"implementing",
"CircuitBreaker"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/FaultToleranceStateFactory.java#L96-L102 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java | SARLAnnotationUtil.findIntValue | public Integer findIntValue(JvmAnnotationTarget op, Class<? extends Annotation> annotationType) {
"""
Extract the integer value of the given annotation, if it exists.
@param op the annotated element.
@param annotationType the type of the annotation to consider
@return the value of the annotation, or {@code nu... | java | public Integer findIntValue(JvmAnnotationTarget op, Class<? extends Annotation> annotationType) {
final JvmAnnotationReference reference = this.lookup.findAnnotation(op, annotationType);
if (reference != null) {
return findIntValue(reference);
}
return null;
} | [
"public",
"Integer",
"findIntValue",
"(",
"JvmAnnotationTarget",
"op",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
")",
"{",
"final",
"JvmAnnotationReference",
"reference",
"=",
"this",
".",
"lookup",
".",
"findAnnotation",
"(",
"op",
... | Extract the integer value of the given annotation, if it exists.
@param op the annotated element.
@param annotationType the type of the annotation to consider
@return the value of the annotation, or {@code null} if no annotation or no
value.
@since 0.6 | [
"Extract",
"the",
"integer",
"value",
"of",
"the",
"given",
"annotation",
"if",
"it",
"exists",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLAnnotationUtil.java#L177-L183 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.