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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/groovy | src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java | ClassNodeUtils.hasExplicitConstructor | public static boolean hasExplicitConstructor(AbstractASTTransformation xform, ClassNode cNode) {
"""
Determine if an explicit (non-generated) constructor is in the class.
@param xform if non null, add an error if an explicit constructor is found
@param cNode the type of the containing class
@return true if an... | java | public static boolean hasExplicitConstructor(AbstractASTTransformation xform, ClassNode cNode) {
List<ConstructorNode> declaredConstructors = cNode.getDeclaredConstructors();
for (ConstructorNode constructorNode : declaredConstructors) {
// allow constructors added by other transforms if fla... | [
"public",
"static",
"boolean",
"hasExplicitConstructor",
"(",
"AbstractASTTransformation",
"xform",
",",
"ClassNode",
"cNode",
")",
"{",
"List",
"<",
"ConstructorNode",
">",
"declaredConstructors",
"=",
"cNode",
".",
"getDeclaredConstructors",
"(",
")",
";",
"for",
... | Determine if an explicit (non-generated) constructor is in the class.
@param xform if non null, add an error if an explicit constructor is found
@param cNode the type of the containing class
@return true if an explicit (non-generated) constructor was found | [
"Determine",
"if",
"an",
"explicit",
"(",
"non",
"-",
"generated",
")",
"constructor",
"is",
"in",
"the",
"class",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/apache/groovy/ast/tools/ClassNodeUtils.java#L360-L375 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractGeneratorConfigurationBlock.java | AbstractGeneratorConfigurationBlock.createOutputSectionItems | protected void createOutputSectionItems(Composite composite, OutputConfiguration outputConfiguration) {
"""
Create the items for the "Output" section.
@param composite the parent.
@param outputConfiguration the output configuration.
"""
final Text defaultDirectoryField = addTextField(composite,
org.e... | java | protected void createOutputSectionItems(Composite composite, OutputConfiguration outputConfiguration) {
final Text defaultDirectoryField = addTextField(composite,
org.eclipse.xtext.builder.preferences.Messages.OutputConfigurationPage_Directory,
BuilderPreferenceAccess.getKey(outputConfiguration,
Eclipse... | [
"protected",
"void",
"createOutputSectionItems",
"(",
"Composite",
"composite",
",",
"OutputConfiguration",
"outputConfiguration",
")",
"{",
"final",
"Text",
"defaultDirectoryField",
"=",
"addTextField",
"(",
"composite",
",",
"org",
".",
"eclipse",
".",
"xtext",
".",... | Create the items for the "Output" section.
@param composite the parent.
@param outputConfiguration the output configuration. | [
"Create",
"the",
"items",
"for",
"the",
"Output",
"section",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/properties/AbstractGeneratorConfigurationBlock.java#L494-L556 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java | PolylineSplitMerge.removeCornerAndSavePolyline | boolean removeCornerAndSavePolyline( Element<Corner> corner, double sideErrorAfterRemoved ) {
"""
Remove the corner from the current polyline. If the new polyline has a better score than the currently
saved one with the same number of corners save it
@param corner The corner to removed
"""
// System.out.... | java | boolean removeCornerAndSavePolyline( Element<Corner> corner, double sideErrorAfterRemoved ) {
// System.out.println("removing a corner idx="+target.object.index);
// Note: the corner is "lost" until the next contour is fit. Not worth the effort to recycle
Element<Corner> p = previous(corner);
// go through t... | [
"boolean",
"removeCornerAndSavePolyline",
"(",
"Element",
"<",
"Corner",
">",
"corner",
",",
"double",
"sideErrorAfterRemoved",
")",
"{",
"//\t\t\tSystem.out.println(\"removing a corner idx=\"+target.object.index);",
"// Note: the corner is \"lost\" until the next contour is fit. Not wor... | Remove the corner from the current polyline. If the new polyline has a better score than the currently
saved one with the same number of corners save it
@param corner The corner to removed | [
"Remove",
"the",
"corner",
"from",
"the",
"current",
"polyline",
".",
"If",
"the",
"new",
"polyline",
"has",
"a",
"better",
"score",
"than",
"the",
"currently",
"saved",
"one",
"with",
"the",
"same",
"number",
"of",
"corners",
"save",
"it"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/PolylineSplitMerge.java#L550-L563 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.getInstance | public static BtcFormat getInstance(Style style, Locale locale, int fractionPlaces) {
"""
Return a new auto-formatter for the given locale with the given number of fraction places.
The returned object will automatically-denominate each formatted
value, and will indicate that denomination using either a currency ... | java | public static BtcFormat getInstance(Style style, Locale locale, int fractionPlaces) {
return new BtcAutoFormat(locale, style, fractionPlaces);
} | [
"public",
"static",
"BtcFormat",
"getInstance",
"(",
"Style",
"style",
",",
"Locale",
"locale",
",",
"int",
"fractionPlaces",
")",
"{",
"return",
"new",
"BtcAutoFormat",
"(",
"locale",
",",
"style",
",",
"fractionPlaces",
")",
";",
"}"
] | Return a new auto-formatter for the given locale with the given number of fraction places.
The returned object will automatically-denominate each formatted
value, and will indicate that denomination using either a currency code,
such as {@code "mBTC"}, or symbol, such as {@code "฿"},
according to the given style argume... | [
"Return",
"a",
"new",
"auto",
"-",
"formatter",
"for",
"the",
"given",
"locale",
"with",
"the",
"given",
"number",
"of",
"fraction",
"places",
".",
"The",
"returned",
"object",
"will",
"automatically",
"-",
"denominate",
"each",
"formatted",
"value",
"and",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L920-L922 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.setItemText | public void setItemText(int index, String text, Direction dir) {
"""
Sets the text associated with the item at a given index.
@param index the index of the item to be set
@param text the item's new text
@param dir the item's direction.
@throws IndexOutOfBoundsException if the index is out of range
"""... | java | public void setItemText(int index, String text, Direction dir) {
index += getIndexOffset();
listBox.setItemText(index, text, dir);
reload();
} | [
"public",
"void",
"setItemText",
"(",
"int",
"index",
",",
"String",
"text",
",",
"Direction",
"dir",
")",
"{",
"index",
"+=",
"getIndexOffset",
"(",
")",
";",
"listBox",
".",
"setItemText",
"(",
"index",
",",
"text",
",",
"dir",
")",
";",
"reload",
"(... | Sets the text associated with the item at a given index.
@param index the index of the item to be set
@param text the item's new text
@param dir the item's direction.
@throws IndexOutOfBoundsException if the index is out of range | [
"Sets",
"the",
"text",
"associated",
"with",
"the",
"item",
"at",
"a",
"given",
"index",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L732-L736 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.jsonPath | public T jsonPath(String jsonPathExpression, Object controlValue) {
"""
Adds JsonPath message element validation.
@param jsonPathExpression
@param controlValue
@return
"""
validate(jsonPathExpression, controlValue);
return self;
} | java | public T jsonPath(String jsonPathExpression, Object controlValue) {
validate(jsonPathExpression, controlValue);
return self;
} | [
"public",
"T",
"jsonPath",
"(",
"String",
"jsonPathExpression",
",",
"Object",
"controlValue",
")",
"{",
"validate",
"(",
"jsonPathExpression",
",",
"controlValue",
")",
";",
"return",
"self",
";",
"}"
] | Adds JsonPath message element validation.
@param jsonPathExpression
@param controlValue
@return | [
"Adds",
"JsonPath",
"message",
"element",
"validation",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L606-L609 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.generateReturnTypeInvariantCheck | private void generateReturnTypeInvariantCheck(WyilFile.Stmt.Return stmt, Expr[] exprs, Context context) {
"""
Generate a return type check in the case that it is necessary. For example,
if the return type contains a type invariant then it is likely to be
necessary. However, in the special case that the value bei... | java | private void generateReturnTypeInvariantCheck(WyilFile.Stmt.Return stmt, Expr[] exprs, Context context) {
WyilFile.Decl.FunctionOrMethod declaration = (WyilFile.Decl.FunctionOrMethod) context.getEnvironment()
.getParent().enclosingDeclaration;
Tuple<WyilFile.Type> returnTypes = declaration.getType().getReturns(... | [
"private",
"void",
"generateReturnTypeInvariantCheck",
"(",
"WyilFile",
".",
"Stmt",
".",
"Return",
"stmt",
",",
"Expr",
"[",
"]",
"exprs",
",",
"Context",
"context",
")",
"{",
"WyilFile",
".",
"Decl",
".",
"FunctionOrMethod",
"declaration",
"=",
"(",
"WyilFil... | Generate a return type check in the case that it is necessary. For example,
if the return type contains a type invariant then it is likely to be
necessary. However, in the special case that the value being returned is
already of appropriate type, then it is not.
@param stmt
@param exprs
@param context
@throws ResolveE... | [
"Generate",
"a",
"return",
"type",
"check",
"in",
"the",
"case",
"that",
"it",
"is",
"necessary",
".",
"For",
"example",
"if",
"the",
"return",
"type",
"contains",
"a",
"type",
"invariant",
"then",
"it",
"is",
"likely",
"to",
"be",
"necessary",
".",
"How... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L912-L924 |
groovy/groovy-core | src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java | StaticTypeCheckingVisitor.checkOrMarkPrivateAccess | private void checkOrMarkPrivateAccess(Expression source, FieldNode fn) {
"""
Given a field node, checks if we are calling a private field from an inner class.
"""
if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
(fn.getDeclaringClass() != typeCheckingContext.getEnclosingClassNode() ... | java | private void checkOrMarkPrivateAccess(Expression source, FieldNode fn) {
if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
(fn.getDeclaringClass() != typeCheckingContext.getEnclosingClassNode() || typeCheckingContext.getEnclosingClosure()!=null) &&
fn.getDeclaringClass().getModule... | [
"private",
"void",
"checkOrMarkPrivateAccess",
"(",
"Expression",
"source",
",",
"FieldNode",
"fn",
")",
"{",
"if",
"(",
"fn",
"!=",
"null",
"&&",
"Modifier",
".",
"isPrivate",
"(",
"fn",
".",
"getModifiers",
"(",
")",
")",
"&&",
"(",
"fn",
".",
"getDecl... | Given a field node, checks if we are calling a private field from an inner class. | [
"Given",
"a",
"field",
"node",
"checks",
"if",
"we",
"are",
"calling",
"a",
"private",
"field",
"from",
"an",
"inner",
"class",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java#L347-L353 |
cloudant/sync-android | cloudant-sync-datastore-javase/src/main/java/com/cloudant/sync/internal/sqlite/sqlite4java/SQLiteWrapperUtils.java | SQLiteWrapperUtils.intForQuery | public static int intForQuery(SQLiteConnection conn, String query, Object[] bindArgs) throws SQLiteException {
"""
Utility method to run the query on the db and return the value in the
first column of the first row.
"""
SQLiteStatement stmt = null;
try {
stmt = bindArguments(conn.p... | java | public static int intForQuery(SQLiteConnection conn, String query, Object[] bindArgs) throws SQLiteException {
SQLiteStatement stmt = null;
try {
stmt = bindArguments(conn.prepare(query), bindArgs);
if (stmt.step()) {
return stmt.columnInt(0);
} else {... | [
"public",
"static",
"int",
"intForQuery",
"(",
"SQLiteConnection",
"conn",
",",
"String",
"query",
",",
"Object",
"[",
"]",
"bindArgs",
")",
"throws",
"SQLiteException",
"{",
"SQLiteStatement",
"stmt",
"=",
"null",
";",
"try",
"{",
"stmt",
"=",
"bindArguments"... | Utility method to run the query on the db and return the value in the
first column of the first row. | [
"Utility",
"method",
"to",
"run",
"the",
"query",
"on",
"the",
"db",
"and",
"return",
"the",
"value",
"in",
"the",
"first",
"column",
"of",
"the",
"first",
"row",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-javase/src/main/java/com/cloudant/sync/internal/sqlite/sqlite4java/SQLiteWrapperUtils.java#L65-L77 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java | CmsAttributeHandler.changeEntityValue | private void changeEntityValue(String value, int valueIndex) {
"""
Changes the attribute value.<p>
@param valueIndex the attribute value index
@param value the value
"""
if (getEntityType().isChoice()) {
CmsEntity choice = m_entity.getAttribute(CmsType.CHOICE_ATTRIBUTE_NAME).getComp... | java | private void changeEntityValue(String value, int valueIndex) {
if (getEntityType().isChoice()) {
CmsEntity choice = m_entity.getAttribute(CmsType.CHOICE_ATTRIBUTE_NAME).getComplexValues().get(valueIndex);
String attributeName = getChoiceName(valueIndex);
if (attributeNa... | [
"private",
"void",
"changeEntityValue",
"(",
"String",
"value",
",",
"int",
"valueIndex",
")",
"{",
"if",
"(",
"getEntityType",
"(",
")",
".",
"isChoice",
"(",
")",
")",
"{",
"CmsEntity",
"choice",
"=",
"m_entity",
".",
"getAttribute",
"(",
"CmsType",
".",... | Changes the attribute value.<p>
@param valueIndex the attribute value index
@param value the value | [
"Changes",
"the",
"attribute",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsAttributeHandler.java#L1209-L1220 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/util/EditorUtil.java | EditorUtil.goToLine | public static void goToLine(IEditorPart editorPart, int lineNumber) {
"""
Selects and reveals the given line in given editor.
<p>
Must be executed from UI thread.
@param editorPart
@param lineNumber
"""
if (!(editorPart instanceof ITextEditor) || lineNumber < DEFAULT_LINE_IN_EDITOR) {
... | java | public static void goToLine(IEditorPart editorPart, int lineNumber) {
if (!(editorPart instanceof ITextEditor) || lineNumber < DEFAULT_LINE_IN_EDITOR) {
return;
}
ITextEditor editor = (ITextEditor) editorPart;
IDocument document = editor.getDocumentProvider().getDocument(edit... | [
"public",
"static",
"void",
"goToLine",
"(",
"IEditorPart",
"editorPart",
",",
"int",
"lineNumber",
")",
"{",
"if",
"(",
"!",
"(",
"editorPart",
"instanceof",
"ITextEditor",
")",
"||",
"lineNumber",
"<",
"DEFAULT_LINE_IN_EDITOR",
")",
"{",
"return",
";",
"}",
... | Selects and reveals the given line in given editor.
<p>
Must be executed from UI thread.
@param editorPart
@param lineNumber | [
"Selects",
"and",
"reveals",
"the",
"given",
"line",
"in",
"given",
"editor",
".",
"<p",
">",
"Must",
"be",
"executed",
"from",
"UI",
"thread",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/EditorUtil.java#L48-L68 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.listSkusWithServiceResponseAsync | public Observable<ServiceResponse<Page<AvailableServiceSkuInner>>> listSkusWithServiceResponseAsync(final String groupName, final String serviceName) {
"""
Get compatible SKUs.
The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that... | java | public Observable<ServiceResponse<Page<AvailableServiceSkuInner>>> listSkusWithServiceResponseAsync(final String groupName, final String serviceName) {
return listSkusSinglePageAsync(groupName, serviceName)
.concatMap(new Func1<ServiceResponse<Page<AvailableServiceSkuInner>>, Observable<ServiceRespo... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"AvailableServiceSkuInner",
">",
">",
">",
"listSkusWithServiceResponseAsync",
"(",
"final",
"String",
"groupName",
",",
"final",
"String",
"serviceName",
")",
"{",
"return",
"listSkusSinglePageAsync",
... | Get compatible SKUs.
The services resource is the top-level resource that represents the Data Migration Service. The skus action returns the list of SKUs that a service resource can be updated to.
@param groupName Name of the resource group
@param serviceName Name of the service
@throws IllegalArgumentException thrown... | [
"Get",
"compatible",
"SKUs",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"skus",
"action",
"returns",
"the",
"list",
"of",
"SKUs",
"that",
"a",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L1414-L1426 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java | MultiMEProxyHandler.linkStarted | public void linkStarted(String busId, SIBUuid8 meUuid)
throws SIIncorrectCallException, SIErrorException, SIDiscriminatorSyntaxException,
SISelectorSyntaxException, SIResourceException {
"""
When a Link is started we want to send a reset message to the neighbouring
bus.
If the neighbour was not... | java | public void linkStarted(String busId, SIBUuid8 meUuid)
throws SIIncorrectCallException, SIErrorException, SIDiscriminatorSyntaxException,
SISelectorSyntaxException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "linkStarted... | [
"public",
"void",
"linkStarted",
"(",
"String",
"busId",
",",
"SIBUuid8",
"meUuid",
")",
"throws",
"SIIncorrectCallException",
",",
"SIErrorException",
",",
"SIDiscriminatorSyntaxException",
",",
"SISelectorSyntaxException",
",",
"SIResourceException",
"{",
"if",
"(",
"... | When a Link is started we want to send a reset message to the neighbouring
bus.
If the neighbour was not found, then create it here as we don't want to start
sending messages to it until the link has started.
@param String The name of the foreign bus
@param SIBUuid8 The uuid of the link localising ME on the foreign b... | [
"When",
"a",
"Link",
"is",
"started",
"we",
"want",
"to",
"send",
"a",
"reset",
"message",
"to",
"the",
"neighbouring",
"bus",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L858-L885 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java | SeaGlassTabbedPaneUI.paintCloseButton | protected Rectangle paintCloseButton(Graphics g, SynthContext tabContext, int tabIndex) {
"""
Paint the close button for a tab.
@param g the Graphics context.
@param tabContext the SynthContext for the tab itself.
@param tabIndex the tab index to paint.
@return the new tab bounds.
"""
... | java | protected Rectangle paintCloseButton(Graphics g, SynthContext tabContext, int tabIndex) {
Rectangle tabRect = new Rectangle(rects[tabIndex]);
Rectangle bounds = getCloseButtonBounds(tabIndex);
int offset = bounds.width + textIconGap;
boolean onLeft = isCloseButtonOnLeft();
... | [
"protected",
"Rectangle",
"paintCloseButton",
"(",
"Graphics",
"g",
",",
"SynthContext",
"tabContext",
",",
"int",
"tabIndex",
")",
"{",
"Rectangle",
"tabRect",
"=",
"new",
"Rectangle",
"(",
"rects",
"[",
"tabIndex",
"]",
")",
";",
"Rectangle",
"bounds",
"=",
... | Paint the close button for a tab.
@param g the Graphics context.
@param tabContext the SynthContext for the tab itself.
@param tabIndex the tab index to paint.
@return the new tab bounds. | [
"Paint",
"the",
"close",
"button",
"for",
"a",
"tab",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java#L774-L800 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.getDigestOffset1 | protected int getDigestOffset1(byte[] handshake, int bufferOffset) {
"""
Returns a digest byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return digest offset
"""
bufferOffset += 8;
int offset = handshake[bufferOffset] & 0xff;
bufferOffset++;
... | java | protected int getDigestOffset1(byte[] handshake, int bufferOffset) {
bufferOffset += 8;
int offset = handshake[bufferOffset] & 0xff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
bufferOffset++;
offset += handshake[bufferOffset] & 0xff;
bufferOf... | [
"protected",
"int",
"getDigestOffset1",
"(",
"byte",
"[",
"]",
"handshake",
",",
"int",
"bufferOffset",
")",
"{",
"bufferOffset",
"+=",
"8",
";",
"int",
"offset",
"=",
"handshake",
"[",
"bufferOffset",
"]",
"&",
"0xff",
";",
"bufferOffset",
"++",
";",
"off... | Returns a digest byte offset.
@param handshake handshake sequence
@param bufferOffset buffer offset
@return digest offset | [
"Returns",
"a",
"digest",
"byte",
"offset",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L508-L522 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/util/VerUtil.java | VerUtil.getTargetNameSpace | public static String getTargetNameSpace(String target) throws IOException {
"""
Retrieve the target server's name space
@param target either IP or host name
@return the namespace, e.g. urn:vim25Service
@throws IOException when there is a network issue or service issue on the target server
@throws Runtim... | java | public static String getTargetNameSpace(String target) throws IOException {
String version = "";
String urlStr = "https://" + target + "/sdk/vimService?wsdl";
try {
trustAllHttpsCertificates();
}
catch (Exception e) {
throw new RuntimeException(e)... | [
"public",
"static",
"String",
"getTargetNameSpace",
"(",
"String",
"target",
")",
"throws",
"IOException",
"{",
"String",
"version",
"=",
"\"\"",
";",
"String",
"urlStr",
"=",
"\"https://\"",
"+",
"target",
"+",
"\"/sdk/vimService?wsdl\"",
";",
"try",
"{",
"trus... | Retrieve the target server's name space
@param target either IP or host name
@return the namespace, e.g. urn:vim25Service
@throws IOException when there is a network issue or service issue on the target server
@throws RuntimeException wrapping NoSuchAlgorithmException, KeyManagementException which are
not likely ... | [
"Retrieve",
"the",
"target",
"server",
"s",
"name",
"space"
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/util/VerUtil.java#L82-L117 |
SonarOpenCommunity/sonar-cxx | cxx-squid/src/main/java/org/sonar/cxx/CxxAstScanner.java | CxxAstScanner.scanSingleFile | @SafeVarargs
public static SourceFile scanSingleFile(InputFile file, SensorContext sensorContext, CxxLanguage language,
SquidAstVisitor<Grammar>... visitors) {
"""
Helper method for testing checks without having to deploy them on a Sonar instance.
@param file is the file to be checked
@param sensorContex... | java | @SafeVarargs
public static SourceFile scanSingleFile(InputFile file, SensorContext sensorContext, CxxLanguage language,
SquidAstVisitor<Grammar>... visitors) {
return scanSingleFileConfig(language, file, new CxxConfiguration(sensorContext.fileSystem().encoding()),
visitors);
} | [
"@",
"SafeVarargs",
"public",
"static",
"SourceFile",
"scanSingleFile",
"(",
"InputFile",
"file",
",",
"SensorContext",
"sensorContext",
",",
"CxxLanguage",
"language",
",",
"SquidAstVisitor",
"<",
"Grammar",
">",
"...",
"visitors",
")",
"{",
"return",
"scanSingleFi... | Helper method for testing checks without having to deploy them on a Sonar instance.
@param file is the file to be checked
@param sensorContext SQ API batch side context
@param visitors AST checks and visitors to use
@param language CxxLanguage to use
@return file checked with measures and issues | [
"Helper",
"method",
"for",
"testing",
"checks",
"without",
"having",
"to",
"deploy",
"them",
"on",
"a",
"Sonar",
"instance",
"."
] | train | https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-squid/src/main/java/org/sonar/cxx/CxxAstScanner.java#L74-L79 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicated_nasha_new_duration_GET | public OvhOrder dedicated_nasha_new_duration_GET(String duration, OvhNasHAZoneEnum datacenter, OvhNasHAOfferEnum model) throws IOException {
"""
Get prices and contracts information
REST: GET /order/dedicated/nasha/new/{duration}
@param datacenter [required] Nas HA localization
@param model [required] Capacit... | java | public OvhOrder dedicated_nasha_new_duration_GET(String duration, OvhNasHAZoneEnum datacenter, OvhNasHAOfferEnum model) throws IOException {
String qPath = "/order/dedicated/nasha/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "datacenter", datacenter);
query(sb, "model", model);
String ... | [
"public",
"OvhOrder",
"dedicated_nasha_new_duration_GET",
"(",
"String",
"duration",
",",
"OvhNasHAZoneEnum",
"datacenter",
",",
"OvhNasHAOfferEnum",
"model",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicated/nasha/new/{duration}\"",
";",
"Strin... | Get prices and contracts information
REST: GET /order/dedicated/nasha/new/{duration}
@param datacenter [required] Nas HA localization
@param model [required] Capacity of Nas HA offer
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2089-L2096 |
google/closure-compiler | src/com/google/javascript/jscomp/CollapseProperties.java | CollapseProperties.collapseDeclarationOfNameAndDescendants | private void collapseDeclarationOfNameAndDescendants(Name n, String alias) {
"""
Collapses definitions of the collapsible properties of a global name.
Recurs on subnames that also represent JavaScript objects with
collapsible properties.
@param n A node representing a global name
@param alias The flattened n... | java | private void collapseDeclarationOfNameAndDescendants(Name n, String alias) {
boolean canCollapseChildNames = n.canCollapseUnannotatedChildNames();
// Handle this name first so that nested object literals get unrolled.
if (canCollapse(n)) {
updateGlobalNameDeclaration(n, alias, canCollapseChildNames);... | [
"private",
"void",
"collapseDeclarationOfNameAndDescendants",
"(",
"Name",
"n",
",",
"String",
"alias",
")",
"{",
"boolean",
"canCollapseChildNames",
"=",
"n",
".",
"canCollapseUnannotatedChildNames",
"(",
")",
";",
"// Handle this name first so that nested object literals ge... | Collapses definitions of the collapsible properties of a global name.
Recurs on subnames that also represent JavaScript objects with
collapsible properties.
@param n A node representing a global name
@param alias The flattened name for {@code n} | [
"Collapses",
"definitions",
"of",
"the",
"collapsible",
"properties",
"of",
"a",
"global",
"name",
".",
"Recurs",
"on",
"subnames",
"that",
"also",
"represent",
"JavaScript",
"objects",
"with",
"collapsible",
"properties",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CollapseProperties.java#L438-L452 |
ops4j/org.ops4j.pax.web | pax-web-resources/pax-web-resources-jsf/src/main/java/org/ops4j/pax/web/resources/jsf/OsgiResourceHandler.java | OsgiResourceHandler.getServiceAndExecute | private <T> T getServiceAndExecute(Function<OsgiResourceLocator, T> function) {
"""
Gets a {@link OsgiResourceLocator}-service, applies the given function,
and ungets the service.
@param function the function to apply against the {@link OsgiResourceLocator}
@return a {@link Resource}, {@link ViewResource} dep... | java | private <T> T getServiceAndExecute(Function<OsgiResourceLocator, T> function) {
// hook into OSGi-Framework
final BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
// get-service, execute function, and unget-service
ServiceReference<OsgiResourceLocator> serviceRef = context.ge... | [
"private",
"<",
"T",
">",
"T",
"getServiceAndExecute",
"(",
"Function",
"<",
"OsgiResourceLocator",
",",
"T",
">",
"function",
")",
"{",
"// hook into OSGi-Framework",
"final",
"BundleContext",
"context",
"=",
"FrameworkUtil",
".",
"getBundle",
"(",
"this",
".",
... | Gets a {@link OsgiResourceLocator}-service, applies the given function,
and ungets the service.
@param function the function to apply against the {@link OsgiResourceLocator}
@return a {@link Resource}, {@link ViewResource} depending on the
functions or {@code null}. | [
"Gets",
"a",
"{",
"@link",
"OsgiResourceLocator",
"}",
"-",
"service",
"applies",
"the",
"given",
"function",
"and",
"ungets",
"the",
"service",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-resources/pax-web-resources-jsf/src/main/java/org/ops4j/pax/web/resources/jsf/OsgiResourceHandler.java#L449-L463 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java | ProcessContextProperties.getDataUsage | private Map<String, Set<DataUsage>> getDataUsage(String dataUsageName) throws PropertyException {
"""
Extracts the data usage with the given name in form of a map containing
the attribute as key and the data usages as value.<br>
@param dataUsageName The property-name of the data usage (DATA_USAGE_X)
@return T... | java | private Map<String, Set<DataUsage>> getDataUsage(String dataUsageName) throws PropertyException {
String dataUsageString = props.getProperty(dataUsageName);
if (dataUsageString == null) {
throw new PropertyException(ProcessContextProperty.DATA_USAGE, dataUsageName, "No data usage with name \... | [
"private",
"Map",
"<",
"String",
",",
"Set",
"<",
"DataUsage",
">",
">",
"getDataUsage",
"(",
"String",
"dataUsageName",
")",
"throws",
"PropertyException",
"{",
"String",
"dataUsageString",
"=",
"props",
".",
"getProperty",
"(",
"dataUsageName",
")",
";",
"if... | Extracts the data usage with the given name in form of a map containing
the attribute as key and the data usages as value.<br>
@param dataUsageName The property-name of the data usage (DATA_USAGE_X)
@return The map-representation of the data usage-property
@throws PropertyException if there is no constraint with the g... | [
"Extracts",
"the",
"data",
"usage",
"with",
"the",
"given",
"name",
"in",
"form",
"of",
"a",
"map",
"containing",
"the",
"attribute",
"as",
"key",
"and",
"the",
"data",
"usages",
"as",
"value",
".",
"<br",
">"
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContextProperties.java#L123-L156 |
line/armeria | core/src/main/java/com/linecorp/armeria/common/stream/EmptyFixedStreamMessage.java | EmptyFixedStreamMessage.doRequest | @Override
final void doRequest(SubscriptionImpl subscription, long unused) {
"""
No objects, so just notify of close as soon as there is demand.
"""
if (requested() != 0) {
// Already have demand so don't need to do anything.
return;
}
setRequested(1);
... | java | @Override
final void doRequest(SubscriptionImpl subscription, long unused) {
if (requested() != 0) {
// Already have demand so don't need to do anything.
return;
}
setRequested(1);
notifySubscriberOfCloseEvent(subscription, SUCCESSFUL_CLOSE);
} | [
"@",
"Override",
"final",
"void",
"doRequest",
"(",
"SubscriptionImpl",
"subscription",
",",
"long",
"unused",
")",
"{",
"if",
"(",
"requested",
"(",
")",
"!=",
"0",
")",
"{",
"// Already have demand so don't need to do anything.",
"return",
";",
"}",
"setRequeste... | No objects, so just notify of close as soon as there is demand. | [
"No",
"objects",
"so",
"just",
"notify",
"of",
"close",
"as",
"soon",
"as",
"there",
"is",
"demand",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/common/stream/EmptyFixedStreamMessage.java#L25-L33 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.unbox | public static double[] unbox(final Double[] a, final double valueForNull) {
"""
<p>
Converts an array of object Doubles to primitives handling {@code null}.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Double} array, may be {@code null}
@param valueFo... | java | public static double[] unbox(final Double[] a, final double valueForNull) {
if (a == null) {
return null;
}
return unbox(a, 0, a.length, valueForNull);
} | [
"public",
"static",
"double",
"[",
"]",
"unbox",
"(",
"final",
"Double",
"[",
"]",
"a",
",",
"final",
"double",
"valueForNull",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"unbox",
"(",
"a",
",",
"0",
"... | <p>
Converts an array of object Doubles to primitives handling {@code null}.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code Double} array, may be {@code null}
@param valueForNull
the value to insert if {@code null} found
@return a {@code double} array, {@code null} if... | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"object",
"Doubles",
"to",
"primitives",
"handling",
"{",
"@code",
"null",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L1196-L1202 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java | StylesContainer.writeStylesAutomaticStyles | public void writeStylesAutomaticStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
"""
Write styles to styles.xml/automatic-styles
@param util an util
@param appendable the destination
@throws IOException if an I/O error occurs
"""
final Iterable<ObjectStyle... | java | public void writeStylesAutomaticStyles(final XMLUtil util, final Appendable appendable)
throws IOException {
final Iterable<ObjectStyle> styles = this.objectStylesContainer
.getValues(Dest.STYLES_AUTOMATIC_STYLES);
for (final ObjectStyle style : styles)
assert sty... | [
"public",
"void",
"writeStylesAutomaticStyles",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"Appendable",
"appendable",
")",
"throws",
"IOException",
"{",
"final",
"Iterable",
"<",
"ObjectStyle",
">",
"styles",
"=",
"this",
".",
"objectStylesContainer",
".",
"g... | Write styles to styles.xml/automatic-styles
@param util an util
@param appendable the destination
@throws IOException if an I/O error occurs | [
"Write",
"styles",
"to",
"styles",
".",
"xml",
"/",
"automatic",
"-",
"styles"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/StylesContainer.java#L427-L435 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfoBase.java | TEEJBInvocationInfoBase.turnNullClass2EmptyString | protected static String turnNullClass2EmptyString(Class<?> cls, String NullDefaultStr) {
"""
Helper method to convert a Class object to its textual representation.
If class is null, the <i>NullDefaultStr</i> is returned.
"""
return (cls == null) ? NullDefaultStr : cls.toString();
} | java | protected static String turnNullClass2EmptyString(Class<?> cls, String NullDefaultStr)
{
return (cls == null) ? NullDefaultStr : cls.toString();
} | [
"protected",
"static",
"String",
"turnNullClass2EmptyString",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"NullDefaultStr",
")",
"{",
"return",
"(",
"cls",
"==",
"null",
")",
"?",
"NullDefaultStr",
":",
"cls",
".",
"toString",
"(",
")",
";",
"}"
] | Helper method to convert a Class object to its textual representation.
If class is null, the <i>NullDefaultStr</i> is returned. | [
"Helper",
"method",
"to",
"convert",
"a",
"Class",
"object",
"to",
"its",
"textual",
"representation",
".",
"If",
"class",
"is",
"null",
"the",
"<i",
">",
"NullDefaultStr<",
"/",
"i",
">",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfoBase.java#L34-L37 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createNicePartialMock | public static synchronized <T> T createNicePartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
"""
Nicely mock a single specific method. Use this to handle overloaded
methods.
@param <T... | java | public static synchronized <T> T createNicePartialMock(Class<T> type, String methodNameToMock,
Class<?> firstArgumentType, Class<?>... additionalArgumentTypes) {
return doMockSpecific(type, new NiceMockStrategy(), new String[]{methodNameToMock}, null,
... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createNicePartialMock",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodNameToMock",
",",
"Class",
"<",
"?",
">",
"firstArgumentType",
",",
"Class",
"<",
"?",
">",
"...",
"additionalArgument... | Nicely mock a single specific method. Use this to handle overloaded
methods.
@param <T> The type of the mock.
@param type The type that'll be used to create a mock instance.
@param methodNameToMock The name of the method to mock
@param firstArgumentType The type of t... | [
"Nicely",
"mock",
"a",
"single",
"specific",
"method",
".",
"Use",
"this",
"to",
"handle",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L503-L507 |
jbundle/jbundle | base/screen/control/xslservlet/src/main/java/org/jbundle/base/screen/control/xslservlet/XSLServlet.java | XSLServlet.service | @Override
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
"""
process an HTML get or post.
@exception ServletException From inherited class.
@exception IOException From inherited class.
"""
ServletTask servletTask = new ServletT... | java | @Override
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
ServletTask servletTask = new ServletTask(this, BasicServlet.SERVLET_TYPE.COCOON);
try {
this.addBrowserProperties(req, servletTask);
ScreenModel scree... | [
"@",
"Override",
"public",
"void",
"service",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"ServletTask",
"servletTask",
"=",
"new",
"ServletTask",
"(",
"this",
",",
"BasicServlet",
... | process an HTML get or post.
@exception ServletException From inherited class.
@exception IOException From inherited class. | [
"process",
"an",
"HTML",
"get",
"or",
"post",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/control/xslservlet/src/main/java/org/jbundle/base/screen/control/xslservlet/XSLServlet.java#L132-L173 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeFloatWithDefault | @Pure
public static Float getAttributeFloatWithDefault(Node document, Float defaultValue, String... path) {
"""
Replies the float value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
Be careful about the fact that the ... | java | @Pure
public static Float getAttributeFloatWithDefault(Node document, Float defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
return getAttributeFloatWithDefault(document, true, defaultValue, path);
} | [
"@",
"Pure",
"public",
"static",
"Float",
"getAttributeFloatWithDefault",
"(",
"Node",
"document",
",",
"Float",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",
"notNullParameter",
"(",
"0",... | Replies the float value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
Be careful about the fact that the names are case sensitives.
@param document is the XML document to explore.
@param defaultValue is the default value to re... | [
"Replies",
"the",
"float",
"value",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L794-L798 |
Omertron/api-fanarttv | src/main/java/com/omertron/fanarttvapi/tools/ApiBuilder.java | ApiBuilder.convertUrl | private URL convertUrl(StringBuilder searchUrl) throws FanartTvException {
"""
Convert the string into a URL
@param searchUrl
@return
@throws FanartTvException
"""
try {
LOG.trace("URL: {}", searchUrl.toString());
return new URL(searchUrl.toString());
} catch (Malfo... | java | private URL convertUrl(StringBuilder searchUrl) throws FanartTvException {
try {
LOG.trace("URL: {}", searchUrl.toString());
return new URL(searchUrl.toString());
} catch (MalformedURLException ex) {
LOG.warn(FAILED_TO_CREATE_URL, searchUrl.toString(), ex.toString());... | [
"private",
"URL",
"convertUrl",
"(",
"StringBuilder",
"searchUrl",
")",
"throws",
"FanartTvException",
"{",
"try",
"{",
"LOG",
".",
"trace",
"(",
"\"URL: {}\"",
",",
"searchUrl",
".",
"toString",
"(",
")",
")",
";",
"return",
"new",
"URL",
"(",
"searchUrl",
... | Convert the string into a URL
@param searchUrl
@return
@throws FanartTvException | [
"Convert",
"the",
"string",
"into",
"a",
"URL"
] | train | https://github.com/Omertron/api-fanarttv/blob/2a1854c840d8111935d0f6abe5232e2c3c3f318b/src/main/java/com/omertron/fanarttvapi/tools/ApiBuilder.java#L154-L162 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java | StringUtil.isEqual | public static boolean isEqual(String string0, String string1, boolean caseSensitive) {
"""
Checks if both strings are equal to each other. Safely handles the case
where either string may be null. The strings are evaluated as equal if
they are both null or if they actually equal each other. One string
that is... | java | public static boolean isEqual(String string0, String string1, boolean caseSensitive) {
if (string0 == null && string1 == null) {
return true;
}
if (string0 == null && string1 != null) {
return false;
}
if (string0 != null && string1 == null) {
... | [
"public",
"static",
"boolean",
"isEqual",
"(",
"String",
"string0",
",",
"String",
"string1",
",",
"boolean",
"caseSensitive",
")",
"{",
"if",
"(",
"string0",
"==",
"null",
"&&",
"string1",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
... | Checks if both strings are equal to each other. Safely handles the case
where either string may be null. The strings are evaluated as equal if
they are both null or if they actually equal each other. One string
that is null while the other one isn't (even if its an empty string) will
be considered as NOT equal. Cas... | [
"Checks",
"if",
"both",
"strings",
"are",
"equal",
"to",
"each",
"other",
".",
"Safely",
"handles",
"the",
"case",
"where",
"either",
"string",
"may",
"be",
"null",
".",
"The",
"strings",
"are",
"evaluated",
"as",
"equal",
"if",
"they",
"are",
"both",
"n... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java#L894-L909 |
twitter/cloudhopper-commons | ch-commons-ssl/src/main/java/com/cloudhopper/commons/ssl/SslContextFactory.java | SslContextFactory.getKeyStore | protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception {
"""
Loads keystore using an input stream or a file path in the same
order of precedence.
Required for integrations to be able to override the mechanism
use... | java | protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception {
KeyStore keystore = null;
if (storeStream != null || storePath != null) {
InputStream inStream = storeStream;
try {
... | [
"protected",
"KeyStore",
"getKeyStore",
"(",
"InputStream",
"storeStream",
",",
"String",
"storePath",
",",
"String",
"storeType",
",",
"String",
"storeProvider",
",",
"String",
"storePassword",
")",
"throws",
"Exception",
"{",
"KeyStore",
"keystore",
"=",
"null",
... | Loads keystore using an input stream or a file path in the same
order of precedence.
Required for integrations to be able to override the mechanism
used to load a keystore in order to provide their own implementation.
@param storeStream keystore input stream
@param storePath path of keystore file
@param storeType key... | [
"Loads",
"keystore",
"using",
"an",
"input",
"stream",
"or",
"a",
"file",
"path",
"in",
"the",
"same",
"order",
"of",
"precedence",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-ssl/src/main/java/com/cloudhopper/commons/ssl/SslContextFactory.java#L243-L264 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java | GVRFrustumPicker.doPick | public void doPick() {
"""
Scans the scene graph to collect picked items
and generates appropriate pick events.
This function is called automatically by
the picker if it is attached to a scene object.
You can instantiate the picker and not attach
it to a scene object. In this case you must
manually set the p... | java | public void doPick()
{
GVRSceneObject owner = getOwnerObject();
GVRPickedObject[] picked = pickVisible(mScene);
if (mProjection != null)
{
Matrix4f view_matrix;
if (owner != null)
{
view_matrix = owner.getTransform().getModelMatrix... | [
"public",
"void",
"doPick",
"(",
")",
"{",
"GVRSceneObject",
"owner",
"=",
"getOwnerObject",
"(",
")",
";",
"GVRPickedObject",
"[",
"]",
"picked",
"=",
"pickVisible",
"(",
"mScene",
")",
";",
"if",
"(",
"mProjection",
"!=",
"null",
")",
"{",
"Matrix4f",
... | Scans the scene graph to collect picked items
and generates appropriate pick events.
This function is called automatically by
the picker if it is attached to a scene object.
You can instantiate the picker and not attach
it to a scene object. In this case you must
manually set the pick ray and call doPick()
to generate ... | [
"Scans",
"the",
"scene",
"graph",
"to",
"collect",
"picked",
"items",
"and",
"generates",
"appropriate",
"pick",
"events",
".",
"This",
"function",
"is",
"called",
"automatically",
"by",
"the",
"picker",
"if",
"it",
"is",
"attached",
"to",
"a",
"scene",
"obj... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRFrustumPicker.java#L172-L215 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateYXZ | public Matrix4d rotateYXZ(Vector3d angles) {
"""
Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate s... | java | public Matrix4d rotateYXZ(Vector3d angles) {
return rotateYXZ(angles.y, angles.x, angles.z);
} | [
"public",
"Matrix4d",
"rotateYXZ",
"(",
"Vector3d",
"angles",
")",
"{",
"return",
"rotateYXZ",
"(",
"angles",
".",
"y",
",",
"angles",
".",
"x",
",",
"angles",
".",
"z",
")",
";",
"}"
] | Apply rotation of <code>angles.y</code> radians about the Y axis, followed by a rotation of <code>angles.x</code> radians about the X axis and
followed by a rotation of <code>angles.z</code> radians about the Z axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angles",
".",
"y<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angles",
".",
"x<",
"/",
"code",
">",
"radians",
"about",
"the",
"X",
"axi... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L6617-L6619 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuAcct.java | CpuAcct.parse | private static CpuAcctMetric parse(final List<String> lines) {
"""
Private because it requires a specific format and cant' take a generic list of strings
"""
// File has a header. We skip it
// See src/test/resources/cpuacct.usage_all for an example
final int ncpus = lines.size() - 1;
final lon... | java | private static CpuAcctMetric parse(final List<String> lines)
{
// File has a header. We skip it
// See src/test/resources/cpuacct.usage_all for an example
final int ncpus = lines.size() - 1;
final long[] usrTime = new long[ncpus];
final long[] sysTime = new long[ncpus];
for (int i = 1; i < lin... | [
"private",
"static",
"CpuAcctMetric",
"parse",
"(",
"final",
"List",
"<",
"String",
">",
"lines",
")",
"{",
"// File has a header. We skip it",
"// See src/test/resources/cpuacct.usage_all for an example",
"final",
"int",
"ncpus",
"=",
"lines",
".",
"size",
"(",
")",
... | Private because it requires a specific format and cant' take a generic list of strings | [
"Private",
"because",
"it",
"requires",
"a",
"specific",
"format",
"and",
"cant",
"take",
"a",
"generic",
"list",
"of",
"strings"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/metrics/cgroups/CpuAcct.java#L41-L58 |
michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SwitchPreference.java | SwitchPreference.createCheckedChangeListener | private OnCheckedChangeListener createCheckedChangeListener() {
"""
Creates and returns a listener, which allows to change the preference's value, depending on
the preference's switch's state.
@return The listener, which has been created, as an instance of the type {@link
OnCheckedChangeListener}
"""
... | java | private OnCheckedChangeListener createCheckedChangeListener() {
return new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
if (getOnPreferenceChangeListener() == null || getOnPreferenceChangeL... | [
"private",
"OnCheckedChangeListener",
"createCheckedChangeListener",
"(",
")",
"{",
"return",
"new",
"OnCheckedChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onCheckedChanged",
"(",
"final",
"CompoundButton",
"buttonView",
",",
"final",
"boolean",
... | Creates and returns a listener, which allows to change the preference's value, depending on
the preference's switch's state.
@return The listener, which has been created, as an instance of the type {@link
OnCheckedChangeListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"change",
"the",
"preference",
"s",
"value",
"depending",
"on",
"the",
"preference",
"s",
"switch",
"s",
"state",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SwitchPreference.java#L154-L168 |
roboconf/roboconf-platform | core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/utils/RestServicesUtils.java | RestServicesUtils.handleError | public static ResponseBuilder handleError( Status status, RestError restError, String lang ) {
"""
Handles an error and makes the magic stuff so that users can understand it.
@param status the response's status
@param restError a REST error
@param lang the user language
@return a response builder
"""
ret... | java | public static ResponseBuilder handleError( Status status, RestError restError, String lang ) {
return handleError( status.getStatusCode(), restError, lang );
} | [
"public",
"static",
"ResponseBuilder",
"handleError",
"(",
"Status",
"status",
",",
"RestError",
"restError",
",",
"String",
"lang",
")",
"{",
"return",
"handleError",
"(",
"status",
".",
"getStatusCode",
"(",
")",
",",
"restError",
",",
"lang",
")",
";",
"}... | Handles an error and makes the magic stuff so that users can understand it.
@param status the response's status
@param restError a REST error
@param lang the user language
@return a response builder | [
"Handles",
"an",
"error",
"and",
"makes",
"the",
"magic",
"stuff",
"so",
"that",
"users",
"can",
"understand",
"it",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-services/src/main/java/net/roboconf/dm/rest/services/internal/utils/RestServicesUtils.java#L98-L100 |
bramp/unsafe | unsafe-unroller/src/main/java/net/bramp/unsafe/CopierImplementation.java | CopierImplementation.buildLongCopyStack | private void buildLongCopyStack(List<StackManipulation> stack, int iterations) throws NoSuchFieldException, NoSuchMethodException {
"""
Creates iterations copies of the equivalent java code
<pre>
unsafe.putLong(dest, destOffset, unsafe.getLong(src));
destOffset += COPY_STRIDE; src += COPY_STRIDE
</pre>
@par... | java | private void buildLongCopyStack(List<StackManipulation> stack, int iterations) throws NoSuchFieldException, NoSuchMethodException {
final Method getLongMethod = Unsafe.class.getMethod("getLong", long.class);
final Method putLongMethod = Unsafe.class.getMethod("putLong", Object.class, long.class, long.class);
... | [
"private",
"void",
"buildLongCopyStack",
"(",
"List",
"<",
"StackManipulation",
">",
"stack",
",",
"int",
"iterations",
")",
"throws",
"NoSuchFieldException",
",",
"NoSuchMethodException",
"{",
"final",
"Method",
"getLongMethod",
"=",
"Unsafe",
".",
"class",
".",
... | Creates iterations copies of the equivalent java code
<pre>
unsafe.putLong(dest, destOffset, unsafe.getLong(src));
destOffset += COPY_STRIDE; src += COPY_STRIDE
</pre>
@param iterations
@throws NoSuchFieldException
@throws NoSuchMethodException | [
"Creates",
"iterations",
"copies",
"of",
"the",
"equivalent",
"java",
"code",
"<pre",
">",
"unsafe",
".",
"putLong",
"(",
"dest",
"destOffset",
"unsafe",
".",
"getLong",
"(",
"src",
"))",
";",
"destOffset",
"+",
"=",
"COPY_STRIDE",
";",
"src",
"+",
"=",
... | train | https://github.com/bramp/unsafe/blob/805f54e2a8aee905003329556135b6c4059b4418/unsafe-unroller/src/main/java/net/bramp/unsafe/CopierImplementation.java#L128-L133 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/Service.java | Service.getParamInt | public int getParamInt(String paramName, int defaultValue) {
"""
Get the value of the parameter with the given name belonging to this service as an
integer. If the parameter is not found, the given default value is returned. If the
parameter is found but cannot be converted to an integer, an
IllegalArgumentExce... | java | public int getParamInt(String paramName, int defaultValue) {
Object paramValue = getParam(paramName);
if (paramValue == null) {
return defaultValue;
}
try {
return Integer.parseInt(paramValue.toString());
} catch (Exception e) {
throw n... | [
"public",
"int",
"getParamInt",
"(",
"String",
"paramName",
",",
"int",
"defaultValue",
")",
"{",
"Object",
"paramValue",
"=",
"getParam",
"(",
"paramName",
")",
";",
"if",
"(",
"paramValue",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"try... | Get the value of the parameter with the given name belonging to this service as an
integer. If the parameter is not found, the given default value is returned. If the
parameter is found but cannot be converted to an integer, an
IllegalArgumentException is thrown.
@param paramName Name of parameter to find.
@param ... | [
"Get",
"the",
"value",
"of",
"the",
"parameter",
"with",
"the",
"given",
"name",
"belonging",
"to",
"this",
"service",
"as",
"an",
"integer",
".",
"If",
"the",
"parameter",
"is",
"not",
"found",
"the",
"given",
"default",
"value",
"is",
"returned",
".",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/Service.java#L293-L303 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/config/ClientConfig.java | ClientConfig.getFlakeIdGeneratorConfig | public ClientFlakeIdGeneratorConfig getFlakeIdGeneratorConfig(String name) {
"""
Returns the {@link ClientFlakeIdGeneratorConfig} for the given name, creating
one if necessary and adding it to the collection of known configurations.
<p>
The configuration is found by matching the the configuration name
pattern ... | java | public ClientFlakeIdGeneratorConfig getFlakeIdGeneratorConfig(String name) {
return ConfigUtils.getConfig(configPatternMatcher, getFlakeIdGeneratorConfigMap(), name,
ClientFlakeIdGeneratorConfig.class, new BiConsumer<ClientFlakeIdGeneratorConfig, String>() {
@Override
... | [
"public",
"ClientFlakeIdGeneratorConfig",
"getFlakeIdGeneratorConfig",
"(",
"String",
"name",
")",
"{",
"return",
"ConfigUtils",
".",
"getConfig",
"(",
"configPatternMatcher",
",",
"getFlakeIdGeneratorConfigMap",
"(",
")",
",",
"name",
",",
"ClientFlakeIdGeneratorConfig",
... | Returns the {@link ClientFlakeIdGeneratorConfig} for the given name, creating
one if necessary and adding it to the collection of known configurations.
<p>
The configuration is found by matching the the configuration name
pattern to the provided {@code name} without the partition qualifier
(the part of the name after {... | [
"Returns",
"the",
"{",
"@link",
"ClientFlakeIdGeneratorConfig",
"}",
"for",
"the",
"given",
"name",
"creating",
"one",
"if",
"necessary",
"and",
"adding",
"it",
"to",
"the",
"collection",
"of",
"known",
"configurations",
".",
"<p",
">",
"The",
"configuration",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/config/ClientConfig.java#L474-L482 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/recycler/RecyclerViewType.java | RecyclerViewType.findView | @SuppressWarnings("unchecked")
public <V extends View> V findView(View containerView, int id) {
"""
Finds a view that was identified by the id attribute from the {@link View} view.
@param containerView The view that contains the view to find.
@param id The id to search for.
@param <V> The {@link View} class.... | java | @SuppressWarnings("unchecked")
public <V extends View> V findView(View containerView, int id) {
return (V)containerView.findViewById(id);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"V",
"extends",
"View",
">",
"V",
"findView",
"(",
"View",
"containerView",
",",
"int",
"id",
")",
"{",
"return",
"(",
"V",
")",
"containerView",
".",
"findViewById",
"(",
"id",
")",
";",... | Finds a view that was identified by the id attribute from the {@link View} view.
@param containerView The view that contains the view to find.
@param id The id to search for.
@param <V> The {@link View} class.
@return The view if found or null otherwise. | [
"Finds",
"a",
"view",
"that",
"was",
"identified",
"by",
"the",
"id",
"attribute",
"from",
"the",
"{",
"@link",
"View",
"}",
"view",
"."
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/recycler/RecyclerViewType.java#L76-L79 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.takeUntil | @NotNull
public IntStream takeUntil(@NotNull final IntPredicate stopPredicate) {
"""
Takes elements while the predicate returns {@code false}.
Once predicate condition is satisfied by an element, the stream
finishes with this element.
<p>This is an intermediate operation.
<p>Example:
<pre>
stopPredic... | java | @NotNull
public IntStream takeUntil(@NotNull final IntPredicate stopPredicate) {
return new IntStream(params, new IntTakeUntil(iterator, stopPredicate));
} | [
"@",
"NotNull",
"public",
"IntStream",
"takeUntil",
"(",
"@",
"NotNull",
"final",
"IntPredicate",
"stopPredicate",
")",
"{",
"return",
"new",
"IntStream",
"(",
"params",
",",
"new",
"IntTakeUntil",
"(",
"iterator",
",",
"stopPredicate",
")",
")",
";",
"}"
] | Takes elements while the predicate returns {@code false}.
Once predicate condition is satisfied by an element, the stream
finishes with this element.
<p>This is an intermediate operation.
<p>Example:
<pre>
stopPredicate: (a) -> a > 2
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [1, 2, 3]
</pre>
@param stopPredicat... | [
"Takes",
"elements",
"while",
"the",
"predicate",
"returns",
"{",
"@code",
"false",
"}",
".",
"Once",
"predicate",
"condition",
"is",
"satisfied",
"by",
"an",
"element",
"the",
"stream",
"finishes",
"with",
"this",
"element",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L778-L781 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/CoreUtils.java | CoreUtils.sortKeyValuePairByValue | public static <K extends Comparable< ? super K>,V extends Comparable< ? super V>> List<Entry<K,V>>
sortKeyValuePairByValue(Map<K,V> map) {
"""
Utility method to sort the keys and values of a map by their value.
"""
List<Map.Entry<K,V>> entries = new ArrayList<Map.Entry<K,V>>(map.entrySet())... | java | public static <K extends Comparable< ? super K>,V extends Comparable< ? super V>> List<Entry<K,V>>
sortKeyValuePairByValue(Map<K,V> map) {
List<Map.Entry<K,V>> entries = new ArrayList<Map.Entry<K,V>>(map.entrySet());
Collections.sort(entries, new Comparator<Map.Entry<K,V>>() {
@O... | [
"public",
"static",
"<",
"K",
"extends",
"Comparable",
"<",
"?",
"super",
"K",
">",
",",
"V",
"extends",
"Comparable",
"<",
"?",
"super",
"V",
">",
">",
"List",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"sortKeyValuePairByValue",
"(",
"Map",
"<",
... | Utility method to sort the keys and values of a map by their value. | [
"Utility",
"method",
"to",
"sort",
"the",
"keys",
"and",
"values",
"of",
"a",
"map",
"by",
"their",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L1163-L1176 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.neq | public SDVariable neq(String name, SDVariable x, double y) {
"""
Not equals operation: elementwise x != y<br>
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
@param name Name of the output variable
@param x Input array
@param y D... | java | public SDVariable neq(String name, SDVariable x, double y) {
validateNumerical("not equals (neq)", x);
SDVariable result = f().neq(x, y);
return updateVariableNameAndReference(result, name);
} | [
"public",
"SDVariable",
"neq",
"(",
"String",
"name",
",",
"SDVariable",
"x",
",",
"double",
"y",
")",
"{",
"validateNumerical",
"(",
"\"not equals (neq)\"",
",",
"x",
")",
";",
"SDVariable",
"result",
"=",
"f",
"(",
")",
".",
"neq",
"(",
"x",
",",
"y"... | Not equals operation: elementwise x != y<br>
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
@param name Name of the output variable
@param x Input array
@param y Double value argument to use in operation
@return Output SDVariable with valu... | [
"Not",
"equals",
"operation",
":",
"elementwise",
"x",
"!",
"=",
"y<br",
">",
"Returns",
"an",
"array",
"with",
"the",
"same",
"shape",
"/",
"size",
"as",
"the",
"input",
"with",
"values",
"1",
"where",
"condition",
"is",
"satisfied",
"or",
"value",
"0",... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1307-L1311 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonStreamWriter.java | JsonStreamWriter.writeNameValuePair | public void writeNameValuePair(String name, double value) throws IOException {
"""
Write a double attribute.
@param name attribute name
@param value attribute value
"""
internalWriteNameValuePair(name, Double.toString(value));
} | java | public void writeNameValuePair(String name, double value) throws IOException
{
internalWriteNameValuePair(name, Double.toString(value));
} | [
"public",
"void",
"writeNameValuePair",
"(",
"String",
"name",
",",
"double",
"value",
")",
"throws",
"IOException",
"{",
"internalWriteNameValuePair",
"(",
"name",
",",
"Double",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Write a double attribute.
@param name attribute name
@param value attribute value | [
"Write",
"a",
"double",
"attribute",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L173-L176 |
ysc/word | src/main/java/org/apdplat/word/corpus/Evaluation.java | Evaluation.evaluation | public static EvaluationResult evaluation(String resultText, String standardText, String perfectResult, String wrongResult) {
"""
分词效果评估
@param resultText 实际分词结果文件路径
@param standardText 标准分词结果文件路径
@param perfectResult 分词完美内容保存文件路径
@param wrongResult 分词错误内容保存文件路径
@return 评估结果
"""
long start = Syste... | java | public static EvaluationResult evaluation(String resultText, String standardText, String perfectResult, String wrongResult) {
long start = System.currentTimeMillis();
int perfectLineCount=0;
int wrongLineCount=0;
int perfectCharCount=0;
int wrongCharCount=0;
try(BufferedR... | [
"public",
"static",
"EvaluationResult",
"evaluation",
"(",
"String",
"resultText",
",",
"String",
"standardText",
",",
"String",
"perfectResult",
",",
"String",
"wrongResult",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"in... | 分词效果评估
@param resultText 实际分词结果文件路径
@param standardText 标准分词结果文件路径
@param perfectResult 分词完美内容保存文件路径
@param wrongResult 分词错误内容保存文件路径
@return 评估结果 | [
"分词效果评估"
] | train | https://github.com/ysc/word/blob/5e45607f4e97207f55d1e3bc561abda6b34f7c54/src/main/java/org/apdplat/word/corpus/Evaluation.java#L157-L202 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBasePanel.java | XBasePanel.printXmlTrailer | public void printXmlTrailer(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Code to display the side Menu.
@param out The http output stream.
@param reg Local resource bundle.
@exception DBException File exception.
"""
String strTrailer = reg.getString("xmlTrailer");
if... | java | public void printXmlTrailer(PrintWriter out, ResourceBundle reg)
throws DBException
{
String strTrailer = reg.getString("xmlTrailer");
if ((strTrailer == null) || (strTrailer.length() == 0))
strTrailer =
" <trailer>" +
" </trailer>";
out.pr... | [
"public",
"void",
"printXmlTrailer",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"String",
"strTrailer",
"=",
"reg",
".",
"getString",
"(",
"\"xmlTrailer\"",
")",
";",
"if",
"(",
"(",
"strTrailer",
"==",
"null",
... | Code to display the side Menu.
@param out The http output stream.
@param reg Local resource bundle.
@exception DBException File exception. | [
"Code",
"to",
"display",
"the",
"side",
"Menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBasePanel.java#L359-L368 |
seedstack/i18n-addon | rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java | AbstractI18nRestIT.httpPostCSV | protected Response httpPostCSV(String path, String csvBody, int status) {
"""
Posts the given CSV as multipart form data to the given path and expect a 200 status code.
@param path the resource URI
@param csvBody the resource representation
@return the http response
"""
MultiPartSpecBuilder mul... | java | protected Response httpPostCSV(String path, String csvBody, int status) {
MultiPartSpecBuilder multipart = new MultiPartSpecBuilder(csvBody.getBytes());
multipart.mimeType("multipart/form-data");
multipart.fileName("file.csv");
return httpRequest(status, "multipart/form-data")
... | [
"protected",
"Response",
"httpPostCSV",
"(",
"String",
"path",
",",
"String",
"csvBody",
",",
"int",
"status",
")",
"{",
"MultiPartSpecBuilder",
"multipart",
"=",
"new",
"MultiPartSpecBuilder",
"(",
"csvBody",
".",
"getBytes",
"(",
")",
")",
";",
"multipart",
... | Posts the given CSV as multipart form data to the given path and expect a 200 status code.
@param path the resource URI
@param csvBody the resource representation
@return the http response | [
"Posts",
"the",
"given",
"CSV",
"as",
"multipart",
"form",
"data",
"to",
"the",
"given",
"path",
"and",
"expect",
"a",
"200",
"status",
"code",
"."
] | train | https://github.com/seedstack/i18n-addon/blob/1e65101d8554623f09bda2497b0151fd10a16615/rest/src/it/java/org/seedstack/i18n/shared/AbstractI18nRestIT.java#L81-L89 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_sharepoint_license_GET | public ArrayList<OvhSharepointDailyLicense> serviceName_sharepoint_license_GET(String serviceName, OvhSharepointLicenseEnum license, OvhLicensePeriodEnum period) throws IOException {
"""
Get active licenses for specific period of time
REST: GET /msServices/{serviceName}/sharepoint/license
@param period [requir... | java | public ArrayList<OvhSharepointDailyLicense> serviceName_sharepoint_license_GET(String serviceName, OvhSharepointLicenseEnum license, OvhLicensePeriodEnum period) throws IOException {
String qPath = "/msServices/{serviceName}/sharepoint/license";
StringBuilder sb = path(qPath, serviceName);
query(sb, "license", li... | [
"public",
"ArrayList",
"<",
"OvhSharepointDailyLicense",
">",
"serviceName_sharepoint_license_GET",
"(",
"String",
"serviceName",
",",
"OvhSharepointLicenseEnum",
"license",
",",
"OvhLicensePeriodEnum",
"period",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
... | Get active licenses for specific period of time
REST: GET /msServices/{serviceName}/sharepoint/license
@param period [required] Period of time used to determine sharepoint account license statistics
@param license [required] License type
@param serviceName [required] The internal name of your Active Directory organiza... | [
"Get",
"active",
"licenses",
"for",
"specific",
"period",
"of",
"time"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L624-L631 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseIntermediateConditionalEventDefinition | public ConditionalEventDefinition parseIntermediateConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) {
"""
Parses the given element as intermediate conditional event.
@param element the XML element which contains the conditional event information
@param conditionalActivity the condi... | java | public ConditionalEventDefinition parseIntermediateConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) {
conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.INTERMEDIATE_EVENT_CONDITIONAL);
ConditionalEventDefinition conditionalEventDefinition = parseConditional... | [
"public",
"ConditionalEventDefinition",
"parseIntermediateConditionalEventDefinition",
"(",
"Element",
"element",
",",
"ActivityImpl",
"conditionalActivity",
")",
"{",
"conditionalActivity",
".",
"getProperties",
"(",
")",
".",
"set",
"(",
"BpmnProperties",
".",
"TYPE",
"... | Parses the given element as intermediate conditional event.
@param element the XML element which contains the conditional event information
@param conditionalActivity the conditional event activity
@return returns the conditional activity with the parsed information | [
"Parses",
"the",
"given",
"element",
"as",
"intermediate",
"conditional",
"event",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3477-L3488 |
kcthota/emoji4j | src/main/java/emoji4j/EmojiUtils.java | EmojiUtils.hexHtmlify | public static String hexHtmlify(String text) {
"""
Converts unicode characters in text to corresponding hexadecimal html
entities
@param text String to hexHtmlify
@return hexadecimal htmlified string
"""
String emojifiedStr = emojify(text);
return htmlifyHelper(emojifiedStr, true, false);
} | java | public static String hexHtmlify(String text) {
String emojifiedStr = emojify(text);
return htmlifyHelper(emojifiedStr, true, false);
} | [
"public",
"static",
"String",
"hexHtmlify",
"(",
"String",
"text",
")",
"{",
"String",
"emojifiedStr",
"=",
"emojify",
"(",
"text",
")",
";",
"return",
"htmlifyHelper",
"(",
"emojifiedStr",
",",
"true",
",",
"false",
")",
";",
"}"
] | Converts unicode characters in text to corresponding hexadecimal html
entities
@param text String to hexHtmlify
@return hexadecimal htmlified string | [
"Converts",
"unicode",
"characters",
"in",
"text",
"to",
"corresponding",
"hexadecimal",
"html",
"entities"
] | train | https://github.com/kcthota/emoji4j/blob/b8cc0c60b8d804cfd7f3369689576b9a93ea1e6f/src/main/java/emoji4j/EmojiUtils.java#L201-L204 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java | AutomationAccountsInner.getByResourceGroup | public AutomationAccountInner getByResourceGroup(String resourceGroupName, String automationAccountName) {
"""
Get information about an Automation Account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentExceptio... | java | public AutomationAccountInner getByResourceGroup(String resourceGroupName, String automationAccountName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, automationAccountName).toBlocking().single().body();
} | [
"public",
"AutomationAccountInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
")",
".",
"toBlocking"... | Get information about an Automation Account.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@t... | [
"Get",
"information",
"about",
"an",
"Automation",
"Account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/AutomationAccountsInner.java#L383-L385 |
RuedigerMoeller/kontraktor | modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/Http4K.java | Http4K.publishFileSystem | public Http4K publishFileSystem( String hostName, String urlPath, int port, File root ) {
"""
publishes given file root
@param hostName
@param urlPath - prefixPath (e.g. /myapp/resource)
@param port
@param root - directory to be published
"""
if ( ! root.exists() )
root.mkdirs();
... | java | public Http4K publishFileSystem( String hostName, String urlPath, int port, File root ) {
if ( ! root.exists() )
root.mkdirs();
if ( ! root.isDirectory() ) {
throw new RuntimeException("root must be an existing direcory:"+root.getAbsolutePath());
}
Pair<PathHandle... | [
"public",
"Http4K",
"publishFileSystem",
"(",
"String",
"hostName",
",",
"String",
"urlPath",
",",
"int",
"port",
",",
"File",
"root",
")",
"{",
"if",
"(",
"!",
"root",
".",
"exists",
"(",
")",
")",
"root",
".",
"mkdirs",
"(",
")",
";",
"if",
"(",
... | publishes given file root
@param hostName
@param urlPath - prefixPath (e.g. /myapp/resource)
@param port
@param root - directory to be published | [
"publishes",
"given",
"file",
"root"
] | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/modules/kontraktor-http/src/main/java/org/nustaq/kontraktor/remoting/http/undertow/Http4K.java#L139-L148 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.squaredNorm | public SDVariable squaredNorm(SDVariable x, boolean keepDims, int... dimensions) {
"""
Squared L2 norm: see {@link #norm2(String, SDVariable, boolean, int...)}
"""
return squaredNorm(null, x, keepDims, dimensions);
} | java | public SDVariable squaredNorm(SDVariable x, boolean keepDims, int... dimensions) {
return squaredNorm(null, x, keepDims, dimensions);
} | [
"public",
"SDVariable",
"squaredNorm",
"(",
"SDVariable",
"x",
",",
"boolean",
"keepDims",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"squaredNorm",
"(",
"null",
",",
"x",
",",
"keepDims",
",",
"dimensions",
")",
";",
"}"
] | Squared L2 norm: see {@link #norm2(String, SDVariable, boolean, int...)} | [
"Squared",
"L2",
"norm",
":",
"see",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2513-L2515 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge_binding.java | netbridge_binding.get | public static netbridge_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch netbridge_binding resource of given name .
"""
netbridge_binding obj = new netbridge_binding();
obj.set_name(name);
netbridge_binding response = (netbridge_binding) obj.get_resource(servic... | java | public static netbridge_binding get(nitro_service service, String name) throws Exception{
netbridge_binding obj = new netbridge_binding();
obj.set_name(name);
netbridge_binding response = (netbridge_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"netbridge_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"netbridge_binding",
"obj",
"=",
"new",
"netbridge_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
... | Use this API to fetch netbridge_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"netbridge_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/netbridge_binding.java#L136-L141 |
UrielCh/ovh-java-sdk | ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java | ApiOvhHorizonView.serviceName_accessPoint_accessPointId_customerNetwork_customerNetworkId_GET | public OvhCustomerNetworkPool serviceName_accessPoint_accessPointId_customerNetwork_customerNetworkId_GET(String serviceName, Long accessPointId, Long customerNetworkId) throws IOException {
"""
Get this object properties
REST: GET /horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork/{customer... | java | public OvhCustomerNetworkPool serviceName_accessPoint_accessPointId_customerNetwork_customerNetworkId_GET(String serviceName, Long accessPointId, Long customerNetworkId) throws IOException {
String qPath = "/horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork/{customerNetworkId}";
StringBuilder sb... | [
"public",
"OvhCustomerNetworkPool",
"serviceName_accessPoint_accessPointId_customerNetwork_customerNetworkId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"accessPointId",
",",
"Long",
"customerNetworkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/horizo... | Get this object properties
REST: GET /horizonView/{serviceName}/accessPoint/{accessPointId}/customerNetwork/{customerNetworkId}
@param serviceName [required] Domain of the service
@param accessPointId [required] Pool id
@param customerNetworkId [required] Customer Network id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-horizonView/src/main/java/net/minidev/ovh/api/ApiOvhHorizonView.java#L122-L127 |
JetBrains/xodus | entity-store/src/main/java/jetbrains/exodus/entitystore/StoreNamingRules.java | StoreNamingRules.getFQName | @NotNull
private String getFQName(@NotNull final String localName, Object... params) {
"""
Gets fully-qualified name of a table or sequence.
@param localName local table name.
@param params params.
@return fully-qualified table name.
"""
final StringBuilder builder = new StringBuilder();
... | java | @NotNull
private String getFQName(@NotNull final String localName, Object... params) {
final StringBuilder builder = new StringBuilder();
builder.append(storeName);
builder.append('.');
builder.append(localName);
for (final Object param : params) {
builder.append(... | [
"@",
"NotNull",
"private",
"String",
"getFQName",
"(",
"@",
"NotNull",
"final",
"String",
"localName",
",",
"Object",
"...",
"params",
")",
"{",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
... | Gets fully-qualified name of a table or sequence.
@param localName local table name.
@param params params.
@return fully-qualified table name. | [
"Gets",
"fully",
"-",
"qualified",
"name",
"of",
"a",
"table",
"or",
"sequence",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/entity-store/src/main/java/jetbrains/exodus/entitystore/StoreNamingRules.java#L144-L156 |
redisson/redisson | redisson/src/main/java/org/redisson/connection/MasterSlaveEntry.java | MasterSlaveEntry.changeMaster | public RFuture<RedisClient> changeMaster(URI address) {
"""
Freeze slave with <code>redis(s)://host:port</code> from slaves list.
Re-attach pub/sub listeners from it to other slave.
Shutdown old master client.
@param address of Redis
@return client
"""
ClientConnectionsEntry oldMaster = masterEnt... | java | public RFuture<RedisClient> changeMaster(URI address) {
ClientConnectionsEntry oldMaster = masterEntry;
RFuture<RedisClient> future = setupMasterEntry(address);
changeMaster(address, oldMaster, future);
return future;
} | [
"public",
"RFuture",
"<",
"RedisClient",
">",
"changeMaster",
"(",
"URI",
"address",
")",
"{",
"ClientConnectionsEntry",
"oldMaster",
"=",
"masterEntry",
";",
"RFuture",
"<",
"RedisClient",
">",
"future",
"=",
"setupMasterEntry",
"(",
"address",
")",
";",
"chang... | Freeze slave with <code>redis(s)://host:port</code> from slaves list.
Re-attach pub/sub listeners from it to other slave.
Shutdown old master client.
@param address of Redis
@return client | [
"Freeze",
"slave",
"with",
"<code",
">",
"redis",
"(",
"s",
")",
":",
"//",
"host",
":",
"port<",
"/",
"code",
">",
"from",
"slaves",
"list",
".",
"Re",
"-",
"attach",
"pub",
"/",
"sub",
"listeners",
"from",
"it",
"to",
"other",
"slave",
".",
"Shut... | train | https://github.com/redisson/redisson/blob/d3acc0249b2d5d658d36d99e2c808ce49332ea44/redisson/src/main/java/org/redisson/connection/MasterSlaveEntry.java#L409-L414 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/HpelHelper.java | HpelHelper.getThreadId | public static String getThreadId() {
"""
Returns the thread identifier for the calling thread used in log files.
This thread Id is used in WAS log and trace files. Depending on the value
assigned to com.ibm.websphere.logging.useJULThreadID system property it
will be an eight character hexadecimal string represe... | java | public static String getThreadId() {
// return Integer.toHexString(Thread.currentThread().hashCode());
if (useJULThreadId) {
// create a dummy LogRecord
LogRecord logRecord = new LogRecord(Level.FINE, "x");
return getThreadId(logRecord);
} else {
... | [
"public",
"static",
"String",
"getThreadId",
"(",
")",
"{",
"// return Integer.toHexString(Thread.currentThread().hashCode());",
"if",
"(",
"useJULThreadId",
")",
"{",
"// create a dummy LogRecord",
"LogRecord",
"logRecord",
"=",
"new",
"LogRecord",
"(",
"Level",
".",
"FI... | Returns the thread identifier for the calling thread used in log files.
This thread Id is used in WAS log and trace files. Depending on the value
assigned to com.ibm.websphere.logging.useJULThreadID system property it
will be an eight character hexadecimal string representation of either
LogRecord.getThreadId() or Thre... | [
"Returns",
"the",
"thread",
"identifier",
"for",
"the",
"calling",
"thread",
"used",
"in",
"log",
"files",
".",
"This",
"thread",
"Id",
"is",
"used",
"in",
"WAS",
"log",
"and",
"trace",
"files",
".",
"Depending",
"on",
"the",
"value",
"assigned",
"to",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/HpelHelper.java#L360-L371 |
kotcrab/vis-ui | ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java | FormValidator.directoryNotEmpty | public FormInputValidator directoryNotEmpty (VisValidatableTextField field, String errorMsg) {
"""
Validates if relative path entered in text field points to an existing and non empty directory.
"""
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, false);
field.addValidator(val... | java | public FormInputValidator directoryNotEmpty (VisValidatableTextField field, String errorMsg) {
DirectoryContentValidator validator = new DirectoryContentValidator(errorMsg, false);
field.addValidator(validator);
add(field);
return validator;
} | [
"public",
"FormInputValidator",
"directoryNotEmpty",
"(",
"VisValidatableTextField",
"field",
",",
"String",
"errorMsg",
")",
"{",
"DirectoryContentValidator",
"validator",
"=",
"new",
"DirectoryContentValidator",
"(",
"errorMsg",
",",
"false",
")",
";",
"field",
".",
... | Validates if relative path entered in text field points to an existing and non empty directory. | [
"Validates",
"if",
"relative",
"path",
"entered",
"in",
"text",
"field",
"points",
"to",
"an",
"existing",
"and",
"non",
"empty",
"directory",
"."
] | train | https://github.com/kotcrab/vis-ui/blob/3b68f82d94ae32bffa2a3399c63f432e0f4908e0/ui/src/main/java/com/kotcrab/vis/ui/util/form/FormValidator.java#L172-L177 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/OnlineSessionUsers.java | OnlineSessionUsers.addOnline | public synchronized ID addOnline(final USER user, final ID sessionId, final SESSION session) {
"""
Adds the user online.
@param user
the user
@param sessionId
the session id
@param session
the session object
@return the session id
"""
sessionIdToSession.put(sessionId, session);
return super.addOnl... | java | public synchronized ID addOnline(final USER user, final ID sessionId, final SESSION session)
{
sessionIdToSession.put(sessionId, session);
return super.addOnline(user, sessionId);
} | [
"public",
"synchronized",
"ID",
"addOnline",
"(",
"final",
"USER",
"user",
",",
"final",
"ID",
"sessionId",
",",
"final",
"SESSION",
"session",
")",
"{",
"sessionIdToSession",
".",
"put",
"(",
"sessionId",
",",
"session",
")",
";",
"return",
"super",
".",
... | Adds the user online.
@param user
the user
@param sessionId
the session id
@param session
the session object
@return the session id | [
"Adds",
"the",
"user",
"online",
"."
] | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/application/OnlineSessionUsers.java#L52-L56 |
apache/fluo-recipes | modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/AccumuloReplicator.java | AccumuloReplicator.generateMutations | public static void generateMutations(long seq, TxLog txLog, Consumer<Mutation> consumer) {
"""
Generates Accumulo mutations from a Transaction log. Used to Replicate Fluo table to Accumulo.
@param txLog Transaction log
@param seq Export sequence number
@param consumer generated mutations will be output to thi... | java | public static void generateMutations(long seq, TxLog txLog, Consumer<Mutation> consumer) {
Map<Bytes, Mutation> mutationMap = new HashMap<>();
for (LogEntry le : txLog.getLogEntries()) {
LogEntry.Operation op = le.getOp();
Column col = le.getColumn();
byte[] cf = col.getFamily().toArray();
... | [
"public",
"static",
"void",
"generateMutations",
"(",
"long",
"seq",
",",
"TxLog",
"txLog",
",",
"Consumer",
"<",
"Mutation",
">",
"consumer",
")",
"{",
"Map",
"<",
"Bytes",
",",
"Mutation",
">",
"mutationMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",... | Generates Accumulo mutations from a Transaction log. Used to Replicate Fluo table to Accumulo.
@param txLog Transaction log
@param seq Export sequence number
@param consumer generated mutations will be output to this consumer | [
"Generates",
"Accumulo",
"mutations",
"from",
"a",
"Transaction",
"log",
".",
"Used",
"to",
"Replicate",
"Fluo",
"table",
"to",
"Accumulo",
"."
] | train | https://github.com/apache/fluo-recipes/blob/24c11234c9654b16d999437ff49ddc3db86665f8/modules/accumulo/src/main/java/org/apache/fluo/recipes/accumulo/export/AccumuloReplicator.java#L78-L104 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeDouble | public static double decodeDouble(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a double from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return double value
"""
long bits = decodeDoubleBits(src, srcOffset);
... | java | public static double decodeDouble(byte[] src, int srcOffset)
throws CorruptEncodingException
{
long bits = decodeDoubleBits(src, srcOffset);
bits ^= (bits < 0) ? 0x8000000000000000L : 0xffffffffffffffffL;
return Double.longBitsToDouble(bits);
} | [
"public",
"static",
"double",
"decodeDouble",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"long",
"bits",
"=",
"decodeDoubleBits",
"(",
"src",
",",
"srcOffset",
")",
";",
"bits",
"^=",
"(",
"bits",
... | Decodes a double from exactly 8 bytes.
@param src source of encoded bytes
@param srcOffset offset into source array
@return double value | [
"Decodes",
"a",
"double",
"from",
"exactly",
"8",
"bytes",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L334-L340 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java | BigtableVeneerSettingsFactory.buildCredentialProvider | private static CredentialsProvider buildCredentialProvider(
CredentialOptions credentialOptions) throws IOException {
"""
Creates {@link CredentialsProvider} based on {@link CredentialOptions}.
"""
try {
final Credentials credentials = CredentialFactory.getCredentials(credentialOptions);
... | java | private static CredentialsProvider buildCredentialProvider(
CredentialOptions credentialOptions) throws IOException {
try {
final Credentials credentials = CredentialFactory.getCredentials(credentialOptions);
if (credentials == null) {
LOG.info("Enabling the use of null credentials. This s... | [
"private",
"static",
"CredentialsProvider",
"buildCredentialProvider",
"(",
"CredentialOptions",
"credentialOptions",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"Credentials",
"credentials",
"=",
"CredentialFactory",
".",
"getCredentials",
"(",
"credentialOptio... | Creates {@link CredentialsProvider} based on {@link CredentialOptions}. | [
"Creates",
"{"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/BigtableVeneerSettingsFactory.java#L146-L159 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.pbc | public PBConstraint pbc(final CType comparator, final int rhs, final Literal[] literals, final int[] coefficients) {
"""
Creates a new pseudo-Boolean constraint.
@param comparator the comparator of the constraint
@param rhs the right-hand side of the constraint
@param literals the literals of the... | java | public PBConstraint pbc(final CType comparator, final int rhs, final Literal[] literals, final int[] coefficients) {
return constructPBC(comparator, rhs, Arrays.copyOf(literals, literals.length), Arrays.copyOf(coefficients, coefficients.length));
} | [
"public",
"PBConstraint",
"pbc",
"(",
"final",
"CType",
"comparator",
",",
"final",
"int",
"rhs",
",",
"final",
"Literal",
"[",
"]",
"literals",
",",
"final",
"int",
"[",
"]",
"coefficients",
")",
"{",
"return",
"constructPBC",
"(",
"comparator",
",",
"rhs... | Creates a new pseudo-Boolean constraint.
@param comparator the comparator of the constraint
@param rhs the right-hand side of the constraint
@param literals the literals of the constraint
@param coefficients the coefficients of the constraint
@return the pseudo-Boolean constraint
@throws IllegalArgumentE... | [
"Creates",
"a",
"new",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L737-L739 |
Erudika/para | para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java | AWSDynamoUtils.updateTable | public static boolean updateTable(String appid, long readCapacity, long writeCapacity) {
"""
Updates the table settings (read and write capacities).
@param appid name of the {@link com.erudika.para.core.App}
@param readCapacity read capacity
@param writeCapacity write capacity
@return true if updated
"""
... | java | public static boolean updateTable(String appid, long readCapacity, long writeCapacity) {
if (StringUtils.isBlank(appid) || StringUtils.containsWhitespace(appid)) {
return false;
}
String table = getTableNameForAppid(appid);
try {
// AWS throws an exception if the new read/write capacity values are the sam... | [
"public",
"static",
"boolean",
"updateTable",
"(",
"String",
"appid",
",",
"long",
"readCapacity",
",",
"long",
"writeCapacity",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"appid",
")",
"||",
"StringUtils",
".",
"containsWhitespace",
"(",
"appid"... | Updates the table settings (read and write capacities).
@param appid name of the {@link com.erudika.para.core.App}
@param readCapacity read capacity
@param writeCapacity write capacity
@return true if updated | [
"Updates",
"the",
"table",
"settings",
"(",
"read",
"and",
"write",
"capacities",
")",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java#L211-L226 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseArray | public final <T> Collection<T> parseArray(
Class<?> destinationCollectionClass, Class<T> destinationItemClass) throws IOException {
"""
Parse a JSON Array from the given JSON parser into the given destination collection.
@param destinationCollectionClass class of destination collection (must have a public... | java | public final <T> Collection<T> parseArray(
Class<?> destinationCollectionClass, Class<T> destinationItemClass) throws IOException {
return parseArray(destinationCollectionClass, destinationItemClass, null);
} | [
"public",
"final",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"parseArray",
"(",
"Class",
"<",
"?",
">",
"destinationCollectionClass",
",",
"Class",
"<",
"T",
">",
"destinationItemClass",
")",
"throws",
"IOException",
"{",
"return",
"parseArray",
"(",
"dest... | Parse a JSON Array from the given JSON parser into the given destination collection.
@param destinationCollectionClass class of destination collection (must have a public default
constructor)
@param destinationItemClass class of destination collection item (must have a public default
constructor)
@since 1.15 | [
"Parse",
"a",
"JSON",
"Array",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"collection",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L558-L561 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java | NamespacesInner.getAuthorizationRule | public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) {
"""
Gets an authorization rule for a namespace by name.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name
@param... | java | public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) {
return getAuthorizationRuleWithServiceResponseAsync(resourceGroupName, namespaceName, authorizationRuleName).toBlocking().single().body();
} | [
"public",
"SharedAccessAuthorizationRuleResourceInner",
"getAuthorizationRule",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"authorizationRuleName",
")",
"{",
"return",
"getAuthorizationRuleWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Gets an authorization rule for a namespace by name.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name
@param authorizationRuleName Authorization rule name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the reque... | [
"Gets",
"an",
"authorization",
"rule",
"for",
"a",
"namespace",
"by",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java#L859-L861 |
wso2/transport-http | components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPVerifier.java | OCSPVerifier.getOCSPResponce | public static OCSPResp getOCSPResponce(String serviceUrl, OCSPReq request) throws CertificateVerificationException {
"""
Gets an ASN.1 encoded OCSP response (as defined in RFC 2560) from the given service URL. Currently supports
only HTTP.
@param serviceUrl URL of the OCSP endpoint.
@param request An OCSP req... | java | public static OCSPResp getOCSPResponce(String serviceUrl, OCSPReq request) throws CertificateVerificationException {
try {
byte[] array = request.getEncoded();
if (serviceUrl.startsWith("http")) {
HttpURLConnection connection;
URL url = new URL(serv... | [
"public",
"static",
"OCSPResp",
"getOCSPResponce",
"(",
"String",
"serviceUrl",
",",
"OCSPReq",
"request",
")",
"throws",
"CertificateVerificationException",
"{",
"try",
"{",
"byte",
"[",
"]",
"array",
"=",
"request",
".",
"getEncoded",
"(",
")",
";",
"if",
"(... | Gets an ASN.1 encoded OCSP response (as defined in RFC 2560) from the given service URL. Currently supports
only HTTP.
@param serviceUrl URL of the OCSP endpoint.
@param request An OCSP request object.
@return OCSP response encoded in ASN.1 structure.
@throws CertificateVerificationException if any error occurs while ... | [
"Gets",
"an",
"ASN",
".",
"1",
"encoded",
"OCSP",
"response",
"(",
"as",
"defined",
"in",
"RFC",
"2560",
")",
"from",
"the",
"given",
"service",
"URL",
".",
"Currently",
"supports",
"only",
"HTTP",
"."
] | train | https://github.com/wso2/transport-http/blob/c51aa715b473db6c1b82a7d7b22f6e65f74df4c9/components/org.wso2.transport.http.netty/src/main/java/org/wso2/transport/http/netty/contractimpl/common/certificatevalidation/ocsp/OCSPVerifier.java#L155-L189 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/ProcessExecutor.java | ProcessExecutor.startInternal | protected final WaitForProcess startInternal() throws IOException {
"""
Start the process and its stream handlers.
@return process the started process.
@throws IOException the process or its stream handlers couldn't start (in the latter case we also destroy the process).
"""
// Invoke listeners - they ... | java | protected final WaitForProcess startInternal() throws IOException {
// Invoke listeners - they can modify this executor
listeners.beforeStart(this);
if (builder.command().isEmpty()) {
throw new IllegalStateException("Command has not been set.");
}
validateStreams(streams, readOutput);
ap... | [
"protected",
"final",
"WaitForProcess",
"startInternal",
"(",
")",
"throws",
"IOException",
"{",
"// Invoke listeners - they can modify this executor",
"listeners",
".",
"beforeStart",
"(",
"this",
")",
";",
"if",
"(",
"builder",
".",
"command",
"(",
")",
".",
"isEm... | Start the process and its stream handlers.
@return process the started process.
@throws IOException the process or its stream handlers couldn't start (in the latter case we also destroy the process). | [
"Start",
"the",
"process",
"and",
"its",
"stream",
"handlers",
"."
] | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/ProcessExecutor.java#L978-L1001 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java | HeaderAndFooterGridView.getColumnWidthCompatible | protected final int getColumnWidthCompatible() {
"""
Returns the width of the grid view's columns by either using the
<code>getColumnWidth</code>-method on devices with API level 16 or greater, or via
reflection on older devices.
@return The width of the grid view's columns in pixels as an {@link Integer} val... | java | protected final int getColumnWidthCompatible() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return super.getColumnWidth();
} else {
try {
Field columnWidth = GridView.class.getDeclaredField("mColumnWidth");
columnWidth.setAccess... | [
"protected",
"final",
"int",
"getColumnWidthCompatible",
"(",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN",
")",
"{",
"return",
"super",
".",
"getColumnWidth",
"(",
")",
";",
"}",
"els... | Returns the width of the grid view's columns by either using the
<code>getColumnWidth</code>-method on devices with API level 16 or greater, or via
reflection on older devices.
@return The width of the grid view's columns in pixels as an {@link Integer} value or -1, if
the layout is pending | [
"Returns",
"the",
"width",
"of",
"the",
"grid",
"view",
"s",
"columns",
"by",
"either",
"using",
"the",
"<code",
">",
"getColumnWidth<",
"/",
"code",
">",
"-",
"method",
"on",
"devices",
"with",
"API",
"level",
"16",
"or",
"greater",
"or",
"via",
"reflec... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/view/HeaderAndFooterGridView.java#L414-L426 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.asType | @SuppressWarnings("unchecked")
public static <T> T asType(Map map, Class<T> clazz) {
"""
Coerces this map to the given type, using the map's keys as the public
method names, and values as the implementation. Typically the value
would be a closure which behaves like the method implementation.
@param map ... | java | @SuppressWarnings("unchecked")
public static <T> T asType(Map map, Class<T> clazz) {
if (!(clazz.isInstance(map)) && clazz.isInterface() && !Traits.isTrait(clazz)) {
return (T) Proxy.newProxyInstance(
clazz.getClassLoader(),
new Class[]{clazz},
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"asType",
"(",
"Map",
"map",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"!",
"(",
"clazz",
".",
"isInstance",
"(",
"map",
")",
")",
"&&",
... | Coerces this map to the given type, using the map's keys as the public
method names, and values as the implementation. Typically the value
would be a closure which behaves like the method implementation.
@param map this map
@param clazz the target type
@return a Proxy of the given type, which defers calls to this m... | [
"Coerces",
"this",
"map",
"to",
"the",
"given",
"type",
"using",
"the",
"map",
"s",
"keys",
"as",
"the",
"public",
"method",
"names",
"and",
"values",
"as",
"the",
"implementation",
".",
"Typically",
"the",
"value",
"would",
"be",
"a",
"closure",
"which",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L11809-L11827 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java | ImageLoader.loadImage | public void loadImage(String uri, ImageLoadingListener listener) {
"""
Adds load image task to execution pool. Image will be returned with
{@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}.
<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} met... | java | public void loadImage(String uri, ImageLoadingListener listener) {
loadImage(uri, null, null, listener, null);
} | [
"public",
"void",
"loadImage",
"(",
"String",
"uri",
",",
"ImageLoadingListener",
"listener",
")",
"{",
"loadImage",
"(",
"uri",
",",
"null",
",",
"null",
",",
"listener",
",",
"null",
")",
";",
"}"
] | Adds load image task to execution pool. Image will be returned with
{@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}.
<br />
<b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
@param uri Image URI (i.e. "ht... | [
"Adds",
"load",
"image",
"task",
"to",
"execution",
"pool",
".",
"Image",
"will",
"be",
"returned",
"with",
"{",
"@link",
"ImageLoadingListener#onLoadingComplete",
"(",
"String",
"android",
".",
"view",
".",
"View",
"android",
".",
"graphics",
".",
"Bitmap",
"... | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java#L424-L426 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.writeStringToTempFileNoExceptions | public static File writeStringToTempFileNoExceptions(String contents, String path, String encoding) {
"""
Writes a string to a temporary file, squashing exceptions
@param contents The string to write
@param path The file path
@param encoding The encoding to encode in
"""
OutputStream writer = null;
... | java | public static File writeStringToTempFileNoExceptions(String contents, String path, String encoding) {
OutputStream writer = null;
File tmp = null;
try{
tmp = File.createTempFile(path,".tmp");
if (path.endsWith(".gz")) {
writer = new GZIPOutputStream(new FileOutputStream(tmp));
} else {
wr... | [
"public",
"static",
"File",
"writeStringToTempFileNoExceptions",
"(",
"String",
"contents",
",",
"String",
"path",
",",
"String",
"encoding",
")",
"{",
"OutputStream",
"writer",
"=",
"null",
";",
"File",
"tmp",
"=",
"null",
";",
"try",
"{",
"tmp",
"=",
"File... | Writes a string to a temporary file, squashing exceptions
@param contents The string to write
@param path The file path
@param encoding The encoding to encode in | [
"Writes",
"a",
"string",
"to",
"a",
"temporary",
"file",
"squashing",
"exceptions"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L255-L272 |
h2oai/h2o-2 | src/main/java/water/score/ScorecardModel.java | ScorecardModel.make | public static ScorecardModel make(final String name, final double initialScore, RuleTable[] rules) {
"""
Scorecard model builder: JIT a subclass with the fast version wired in to
'score(row)'
"""
// Get the list of features
String[] colNames = new String[rules.length];
for( int i=0; i<rules.length... | java | public static ScorecardModel make(final String name, final double initialScore, RuleTable[] rules) {
// Get the list of features
String[] colNames = new String[rules.length];
for( int i=0; i<rules.length; i++ )
colNames[i] = rules[i]._name;
// javassist support for rewriting class files
Class... | [
"public",
"static",
"ScorecardModel",
"make",
"(",
"final",
"String",
"name",
",",
"final",
"double",
"initialScore",
",",
"RuleTable",
"[",
"]",
"rules",
")",
"{",
"// Get the list of features",
"String",
"[",
"]",
"colNames",
"=",
"new",
"String",
"[",
"rule... | Scorecard model builder: JIT a subclass with the fast version wired in to
'score(row)' | [
"Scorecard",
"model",
"builder",
":",
"JIT",
"a",
"subclass",
"with",
"the",
"fast",
"version",
"wired",
"in",
"to",
"score",
"(",
"row",
")"
] | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/score/ScorecardModel.java#L259-L291 |
adamfisk/littleshoot-util | src/main/java/org/littleshoot/util/xml/XPathUtils.java | XPathUtils.newXPath | public static XPathUtils newXPath(final String str) throws SAXException,
IOException {
"""
Creates a new {@link XPathUtils} instance.
@param str The string with XML data.
@return A new {@link XPathUtils} instance.
@throws SAXException If there's a SAX error in the XML.
@throws IOException If ther... | java | public static XPathUtils newXPath(final String str) throws SAXException,
IOException {
final XPathFactory xpfactory = XPathFactory.newInstance();
final XPath xPath = xpfactory.newXPath();
final Document doc = XmlUtils.toDoc(str);
return new XPathUtils(xPath, doc);
} | [
"public",
"static",
"XPathUtils",
"newXPath",
"(",
"final",
"String",
"str",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"final",
"XPathFactory",
"xpfactory",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"final",
"XPath",
"xPath",
"=",
"... | Creates a new {@link XPathUtils} instance.
@param str The string with XML data.
@return A new {@link XPathUtils} instance.
@throws SAXException If there's a SAX error in the XML.
@throws IOException If there's an IO error reading the stream. | [
"Creates",
"a",
"new",
"{",
"@link",
"XPathUtils",
"}",
"instance",
"."
] | train | https://github.com/adamfisk/littleshoot-util/blob/3c0dc4955116b3382d6b0575d2f164b7508a4f73/src/main/java/org/littleshoot/util/xml/XPathUtils.java#L86-L92 |
milaboratory/milib | src/main/java/com/milaboratory/core/mutations/Mutations.java | Mutations.extractRelativeMutationsForRange | public Mutations<S> extractRelativeMutationsForRange(int from, int to) {
"""
Extracts mutations for a range of positions in the original sequence and performs shift of corresponding
positions (moves them to {@code -from}).
<p>Insertions before {@code from} excluded. Insertions after {@code (to - 1)} included.<... | java | public Mutations<S> extractRelativeMutationsForRange(int from, int to) {
if (to < from)
throw new IllegalArgumentException("Reversed ranges are not supported.");
long indexRange = getIndexRange(from, to);
// If range size is 0 return empty array
if (indexRange == 0)
... | [
"public",
"Mutations",
"<",
"S",
">",
"extractRelativeMutationsForRange",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"to",
"<",
"from",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Reversed ranges are not supported.\"",
")",
";",
"lon... | Extracts mutations for a range of positions in the original sequence and performs shift of corresponding
positions (moves them to {@code -from}).
<p>Insertions before {@code from} excluded. Insertions after {@code (to - 1)} included.</p>
<p>
<b>Important:</b> to extract leftmost insertions (trailing insertions) use {... | [
"Extracts",
"mutations",
"for",
"a",
"range",
"of",
"positions",
"in",
"the",
"original",
"sequence",
"and",
"performs",
"shift",
"of",
"corresponding",
"positions",
"(",
"moves",
"them",
"to",
"{",
"@code",
"-",
"from",
"}",
")",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/mutations/Mutations.java#L389-L422 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_image.java | ns_image.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
ns_image_responses result = (ns_image_responses) service.get_payload_fo... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
ns_image_responses result = (ns_image_responses) service.get_payload_formatter().string_to_resource(ns_image_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == SESSION... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"ns_image_responses",
"result",
"=",
"(",
"ns_image_responses",
")",
"service",
".",
"get_payload_formatter",
... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_image.java#L265-L282 |
aws/aws-sdk-java | aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/LogPublishingOptionsStatus.java | LogPublishingOptionsStatus.withOptions | public LogPublishingOptionsStatus withOptions(java.util.Map<String, LogPublishingOption> options) {
"""
<p>
The log publishing options configured for the Elasticsearch domain.
</p>
@param options
The log publishing options configured for the Elasticsearch domain.
@return Returns a reference to this object s... | java | public LogPublishingOptionsStatus withOptions(java.util.Map<String, LogPublishingOption> options) {
setOptions(options);
return this;
} | [
"public",
"LogPublishingOptionsStatus",
"withOptions",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"LogPublishingOption",
">",
"options",
")",
"{",
"setOptions",
"(",
"options",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The log publishing options configured for the Elasticsearch domain.
</p>
@param options
The log publishing options configured for the Elasticsearch domain.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"log",
"publishing",
"options",
"configured",
"for",
"the",
"Elasticsearch",
"domain",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/LogPublishingOptionsStatus.java#L77-L80 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CloneStackRequest.java | CloneStackRequest.withAttributes | public CloneStackRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
A list of stack attributes and values as key/value pairs to be added to the cloned stack.
</p>
@param attributes
A list of stack attributes and values as key/value pairs to be added to the cloned stack.
@return Retur... | java | public CloneStackRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CloneStackRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A list of stack attributes and values as key/value pairs to be added to the cloned stack.
</p>
@param attributes
A list of stack attributes and values as key/value pairs to be added to the cloned stack.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"list",
"of",
"stack",
"attributes",
"and",
"values",
"as",
"key",
"/",
"value",
"pairs",
"to",
"be",
"added",
"to",
"the",
"cloned",
"stack",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CloneStackRequest.java#L857-L860 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java | MolecularFormulaManipulator.addIsotopeDist | private static boolean addIsotopeDist(IMolecularFormula mf,
IIsotope[] isotopes,
int idx, int count) {
"""
Helper method for adding isotope distributions to a MF. The method adds
a distribution of isotopes by splitting the set of ... | java | private static boolean addIsotopeDist(IMolecularFormula mf,
IIsotope[] isotopes,
int idx, int count) {
if (count == 0)
return true;
double frac = 100d;
for (int i = 0; i < idx; i++)
frac -... | [
"private",
"static",
"boolean",
"addIsotopeDist",
"(",
"IMolecularFormula",
"mf",
",",
"IIsotope",
"[",
"]",
"isotopes",
",",
"int",
"idx",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
"==",
"0",
")",
"return",
"true",
";",
"double",
"frac",
"=",
... | Helper method for adding isotope distributions to a MF. The method adds
a distribution of isotopes by splitting the set of isotopes in two,
the one under consideration (specified by 'idx') and the remaining to be
considered ('>idx'). The inflection point is calculate as 'k'
&le 'count' isotopes added. If there are r... | [
"Helper",
"method",
"for",
"adding",
"isotope",
"distributions",
"to",
"a",
"MF",
".",
"The",
"method",
"adds",
"a",
"distribution",
"of",
"isotopes",
"by",
"splitting",
"the",
"set",
"of",
"isotopes",
"in",
"two",
"the",
"one",
"under",
"consideration",
"("... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1548-L1572 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_item_itemId_configuration_POST | public OvhConfigurationItem cart_cartId_item_itemId_configuration_POST(String cartId, Long itemId, String label, String value) throws IOException {
"""
Setup configuration item for the product
REST: POST /order/cart/{cartId}/item/{itemId}/configuration
@param cartId [required] Cart identifier
@param itemId [r... | java | public OvhConfigurationItem cart_cartId_item_itemId_configuration_POST(String cartId, Long itemId, String label, String value) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}/configuration";
StringBuilder sb = path(qPath, cartId, itemId);
HashMap<String, Object>o = new HashMap<String, Obje... | [
"public",
"OvhConfigurationItem",
"cart_cartId_item_itemId_configuration_POST",
"(",
"String",
"cartId",
",",
"Long",
"itemId",
",",
"String",
"label",
",",
"String",
"value",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/item/{itemId}... | Setup configuration item for the product
REST: POST /order/cart/{cartId}/item/{itemId}/configuration
@param cartId [required] Cart identifier
@param itemId [required] Product item identifier
@param label [required] Label for your configuration item
@param value [required] Value or resource URL on API.OVH.COM of your c... | [
"Setup",
"configuration",
"item",
"for",
"the",
"product"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L8070-L8078 |
alkacon/opencms-core | src/org/opencms/db/CmsLoginManager.java | CmsLoginManager.createStorageKey | private static String createStorageKey(String userName, String remoteAddress) {
"""
Returns the key to use for looking up the user in the invalid login storage.<p>
@param userName the name of the user
@param remoteAddress the remore address (IP) from which the login attempt was made
@return the key to use f... | java | private static String createStorageKey(String userName, String remoteAddress) {
StringBuffer result = new StringBuffer();
result.append(userName);
result.append(KEY_SEPARATOR);
result.append(remoteAddress);
return result.toString();
} | [
"private",
"static",
"String",
"createStorageKey",
"(",
"String",
"userName",
",",
"String",
"remoteAddress",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"result",
".",
"append",
"(",
"userName",
")",
";",
"result",
".",
"a... | Returns the key to use for looking up the user in the invalid login storage.<p>
@param userName the name of the user
@param remoteAddress the remore address (IP) from which the login attempt was made
@return the key to use for looking up the user in the invalid login storage | [
"Returns",
"the",
"key",
"to",
"use",
"for",
"looking",
"up",
"the",
"user",
"in",
"the",
"invalid",
"login",
"storage",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsLoginManager.java#L249-L256 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamPlan.java | StreamPlan.requestRanges | public StreamPlan requestRanges(InetAddress from, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies) {
"""
Request data in {@code columnFamilies} under {@code keyspace} and {@code ranges} from specific node.
@param from endpoint address to fetch data from.
@para... | java | public StreamPlan requestRanges(InetAddress from, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies)
{
StreamSession session = coordinator.getOrCreateNextSession(from, connecting);
session.addStreamRequest(keyspace, ranges, Arrays.asList(columnFamilie... | [
"public",
"StreamPlan",
"requestRanges",
"(",
"InetAddress",
"from",
",",
"InetAddress",
"connecting",
",",
"String",
"keyspace",
",",
"Collection",
"<",
"Range",
"<",
"Token",
">",
">",
"ranges",
",",
"String",
"...",
"columnFamilies",
")",
"{",
"StreamSession"... | Request data in {@code columnFamilies} under {@code keyspace} and {@code ranges} from specific node.
@param from endpoint address to fetch data from.
@param connecting Actual connecting address for the endpoint
@param keyspace name of keyspace
@param ranges ranges to fetch
@param columnFamilies specific column familie... | [
"Request",
"data",
"in",
"{",
"@code",
"columnFamilies",
"}",
"under",
"{",
"@code",
"keyspace",
"}",
"and",
"{",
"@code",
"ranges",
"}",
"from",
"specific",
"node",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamPlan.java#L86-L91 |
forge/furnace | container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java | Annotations.isAnnotationPresent | public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> type) {
"""
Discover if a Method <b>m</b> has been annotated with <b>type</b>.
@param m The method to inspect.
@param type The targeted annotation class
@return True if annotation is present either on the method itself... | java | public static boolean isAnnotationPresent(final Method m, final Class<? extends Annotation> type)
{
boolean result = false;
if (m.isAnnotationPresent(type))
{
result = true;
}
else
{
for (Annotation a : m.getAnnotations())
{
if (isAnnotationP... | [
"public",
"static",
"boolean",
"isAnnotationPresent",
"(",
"final",
"Method",
"m",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"type",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"m",
".",
"isAnnotationPresent",
"(",
"ty... | Discover if a Method <b>m</b> has been annotated with <b>type</b>.
@param m The method to inspect.
@param type The targeted annotation class
@return True if annotation is present either on the method itself, or on the declaring class of the method.
Returns false if the annotation is not present. | [
"Discover",
"if",
"a",
"Method",
"<b",
">",
"m<",
"/",
"b",
">",
"has",
"been",
"annotated",
"with",
"<b",
">",
"type<",
"/",
"b",
">",
"."
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/util/Annotations.java#L30-L54 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ProjectsInner.java | ProjectsInner.createOrUpdate | public ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters) {
"""
Create or update project.
The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one.
@param groupN... | java | public ProjectInner createOrUpdate(String groupName, String serviceName, String projectName, ProjectInner parameters) {
return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, parameters).toBlocking().single().body();
} | [
"public",
"ProjectInner",
"createOrUpdate",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"ProjectInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
","... | Create or update project.
The project resource is a nested resource representing a stored migration project. The PUT method creates a new project or updates an existing one.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param parameters Infor... | [
"Create",
"or",
"update",
"project",
".",
"The",
"project",
"resource",
"is",
"a",
"nested",
"resource",
"representing",
"a",
"stored",
"migration",
"project",
".",
"The",
"PUT",
"method",
"creates",
"a",
"new",
"project",
"or",
"updates",
"an",
"existing",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ProjectsInner.java#L232-L234 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Factory.java | Factory.createFeaturable | private <O extends Featurable> O createFeaturable(Class<O> type, Setup setup) throws NoSuchMethodException {
"""
Create the featurable.
@param <O> The featurable type.
@param type The featurable type.
@param setup The associated setup.
@return The featurable instance.
@throws NoSuchMethodException If missin... | java | private <O extends Featurable> O createFeaturable(Class<O> type, Setup setup) throws NoSuchMethodException
{
final O featurable = UtilReflection.createReduce(type, services, setup);
addFeatures(featurable, services, setup);
for (final Feature feature : featurable.getFeatures())
... | [
"private",
"<",
"O",
"extends",
"Featurable",
">",
"O",
"createFeaturable",
"(",
"Class",
"<",
"O",
">",
"type",
",",
"Setup",
"setup",
")",
"throws",
"NoSuchMethodException",
"{",
"final",
"O",
"featurable",
"=",
"UtilReflection",
".",
"createReduce",
"(",
... | Create the featurable.
@param <O> The featurable type.
@param type The featurable type.
@param setup The associated setup.
@return The featurable instance.
@throws NoSuchMethodException If missing constructor. | [
"Create",
"the",
"featurable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Factory.java#L261-L277 |
jhunters/jprotobuf | src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java | ProtobufIDLProxy.isNestedTypeDependency | private static boolean isNestedTypeDependency(String type, List<Type> nestedTypes) {
"""
Checks if is nested type dependency.
@param type the type
@param nestedTypes the nested types
@return true, if is nested type dependency
"""
if (nestedTypes == null) {
return false;
}
... | java | private static boolean isNestedTypeDependency(String type, List<Type> nestedTypes) {
if (nestedTypes == null) {
return false;
}
for (Type t : nestedTypes) {
if (type.equals(t.getName())) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"isNestedTypeDependency",
"(",
"String",
"type",
",",
"List",
"<",
"Type",
">",
"nestedTypes",
")",
"{",
"if",
"(",
"nestedTypes",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"Type",
"t",
":",
"nestedT... | Checks if is nested type dependency.
@param type the type
@param nestedTypes the nested types
@return true, if is nested type dependency | [
"Checks",
"if",
"is",
"nested",
"type",
"dependency",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/src/main/java/com/baidu/bjf/remoting/protobuf/ProtobufIDLProxy.java#L1622-L1634 |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/VariantCustom.java | VariantCustom.setParameter | private String setParameter(HttpMessage msg, NameValuePair originalPair, String paramName, String value, boolean escaped) {
"""
Inner method for correct scripting
@param msg the message that need to be modified
@param originalPair the original {@code NameValuePair} being tested.
@param paramName the name of the... | java | private String setParameter(HttpMessage msg, NameValuePair originalPair, String paramName, String value, boolean escaped) {
try {
if (script != null) {
currentParam = originalPair;
script.setParameter(this, msg, paramName, value, escaped);
}
... | [
"private",
"String",
"setParameter",
"(",
"HttpMessage",
"msg",
",",
"NameValuePair",
"originalPair",
",",
"String",
"paramName",
",",
"String",
"value",
",",
"boolean",
"escaped",
")",
"{",
"try",
"{",
"if",
"(",
"script",
"!=",
"null",
")",
"{",
"currentPa... | Inner method for correct scripting
@param msg the message that need to be modified
@param originalPair the original {@code NameValuePair} being tested.
@param paramName the name of the parameter
@param value the value thta should be set for this parameter
@param escaped true if the parameter has been already escaped
@r... | [
"Inner",
"method",
"for",
"correct",
"scripting"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/VariantCustom.java#L220-L236 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_radiusConnectionLogs_GET | public ArrayList<OvhRadiusConnectionLog> serviceName_radiusConnectionLogs_GET(String serviceName) throws IOException {
"""
List the radius connection logs
REST: GET /xdsl/{serviceName}/radiusConnectionLogs
@param serviceName [required] The internal name of your XDSL offer
"""
String qPath = "/xdsl/{servi... | java | public ArrayList<OvhRadiusConnectionLog> serviceName_radiusConnectionLogs_GET(String serviceName) throws IOException {
String qPath = "/xdsl/{serviceName}/radiusConnectionLogs";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t17);
} | [
"public",
"ArrayList",
"<",
"OvhRadiusConnectionLog",
">",
"serviceName_radiusConnectionLogs_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/radiusConnectionLogs\"",
";",
"StringBuilder",
"sb",
"=",
"path... | List the radius connection logs
REST: GET /xdsl/{serviceName}/radiusConnectionLogs
@param serviceName [required] The internal name of your XDSL offer | [
"List",
"the",
"radius",
"connection",
"logs"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1612-L1617 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/FileUtil.java | FileUtil.replaceSymbolicLink | public static void replaceSymbolicLink(Path link, Path target) throws IOException {
"""
Similar to {@link Files#createSymbolicLink(Path, Path, FileAttribute[])}, but
will replace the link if it already exists, and will try to write / replace
it as an atomic operation.
@param link The path of the symbolic link... | java | public static void replaceSymbolicLink(Path link, Path target) throws IOException {
link = link.toAbsolutePath();
if (Files.exists(link, NOFOLLOW_LINKS)) {
if (!Files.isSymbolicLink(link)) {
throw new NotLinkException(String.format("%s is not a symbolic link", link));
... | [
"public",
"static",
"void",
"replaceSymbolicLink",
"(",
"Path",
"link",
",",
"Path",
"target",
")",
"throws",
"IOException",
"{",
"link",
"=",
"link",
".",
"toAbsolutePath",
"(",
")",
";",
"if",
"(",
"Files",
".",
"exists",
"(",
"link",
",",
"NOFOLLOW_LINK... | Similar to {@link Files#createSymbolicLink(Path, Path, FileAttribute[])}, but
will replace the link if it already exists, and will try to write / replace
it as an atomic operation.
@param link The path of the symbolic link. The parent directory of the
link file must already exist, and must be writable.
See {@link File... | [
"Similar",
"to",
"{",
"@link",
"Files#createSymbolicLink",
"(",
"Path",
"Path",
"FileAttribute",
"[]",
")",
"}",
"but",
"will",
"replace",
"the",
"link",
"if",
"it",
"already",
"exists",
"and",
"will",
"try",
"to",
"write",
"/",
"replace",
"it",
"as",
"an"... | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/FileUtil.java#L113-L131 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.getByResourceGroup | public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) {
"""
Gets information about the specified virtual network tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of virtual network tap.
@throws IllegalArgumentException thrown if paramet... | java | public VirtualNetworkTapInner getByResourceGroup(String resourceGroupName, String tapName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, tapName).toBlocking().single().body();
} | [
"public",
"VirtualNetworkTapInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
")",
".",
"toBlocking",
"(",
")",
".",
"si... | Gets information about the specified virtual network tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of virtual network tap.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws Runtime... | [
"Gets",
"information",
"about",
"the",
"specified",
"virtual",
"network",
"tap",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java#L277-L279 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/segment/data/CompressionFactory.java | CompressionFactory.getFloatSupplier | public static Supplier<ColumnarFloats> getFloatSupplier(
int totalSize,
int sizePer,
ByteBuffer fromBuffer,
ByteOrder order,
CompressionStrategy strategy
) {
"""
Float currently does not support any encoding types, and stores values as 4 byte float
"""
if (strategy == Compre... | java | public static Supplier<ColumnarFloats> getFloatSupplier(
int totalSize,
int sizePer,
ByteBuffer fromBuffer,
ByteOrder order,
CompressionStrategy strategy
)
{
if (strategy == CompressionStrategy.NONE) {
return new EntireLayoutColumnarFloatsSupplier(totalSize, fromBuffer, order... | [
"public",
"static",
"Supplier",
"<",
"ColumnarFloats",
">",
"getFloatSupplier",
"(",
"int",
"totalSize",
",",
"int",
"sizePer",
",",
"ByteBuffer",
"fromBuffer",
",",
"ByteOrder",
"order",
",",
"CompressionStrategy",
"strategy",
")",
"{",
"if",
"(",
"strategy",
"... | Float currently does not support any encoding types, and stores values as 4 byte float | [
"Float",
"currently",
"does",
"not",
"support",
"any",
"encoding",
"types",
"and",
"stores",
"values",
"as",
"4",
"byte",
"float"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/segment/data/CompressionFactory.java#L341-L354 |
ops4j/org.ops4j.pax.web | pax-web-runtime/src/main/java/org/ops4j/pax/web/service/internal/Activator.java | Activator.createManagedServiceFactory | private void createManagedServiceFactory(BundleContext context) {
"""
Registers a managed service factory to create {@link org.osgi.service.http.HttpContext} <em>processors</em>
- these will possibly register additional web items (like login configurations or filters) for shared or
per-bundle http services.
@... | java | private void createManagedServiceFactory(BundleContext context) {
// sanity check
if (managedServiceFactoryReg != null) {
managedServiceFactoryReg.unregister();
managedServiceFactoryReg = null;
}
final Dictionary<String, String> props = new Hashtable<>();
props.put(Constants.SERVICE_PID, HttpContextProc... | [
"private",
"void",
"createManagedServiceFactory",
"(",
"BundleContext",
"context",
")",
"{",
"// sanity check",
"if",
"(",
"managedServiceFactoryReg",
"!=",
"null",
")",
"{",
"managedServiceFactoryReg",
".",
"unregister",
"(",
")",
";",
"managedServiceFactoryReg",
"=",
... | Registers a managed service factory to create {@link org.osgi.service.http.HttpContext} <em>processors</em>
- these will possibly register additional web items (like login configurations or filters) for shared or
per-bundle http services.
@param context | [
"Registers",
"a",
"managed",
"service",
"factory",
"to",
"create",
"{",
"@link",
"org",
".",
"osgi",
".",
"service",
".",
"http",
".",
"HttpContext",
"}",
"<em",
">",
"processors<",
"/",
"em",
">",
"-",
"these",
"will",
"possibly",
"register",
"additional"... | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-runtime/src/main/java/org/ops4j/pax/web/service/internal/Activator.java#L286-L296 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/FormSpec.java | FormSpec.parseOldBoundedSize | private Size parseOldBoundedSize(String token, boolean setMax) {
"""
Parses an encoded compound size and sets the size fields. The compound size has format:
max(<atomic size>;<atomic size2>) | min(<atomic size1>;<atomic
size2>) One of the two atomic sizes must be a logical size, the other... | java | private Size parseOldBoundedSize(String token, boolean setMax) {
int semicolonIndex = token.indexOf(';');
String sizeToken1 = token.substring(4, semicolonIndex);
String sizeToken2 = token.substring(semicolonIndex + 1, token.length() - 1);
Size size1 = parseAtomicSize(sizeToken1);
... | [
"private",
"Size",
"parseOldBoundedSize",
"(",
"String",
"token",
",",
"boolean",
"setMax",
")",
"{",
"int",
"semicolonIndex",
"=",
"token",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"String",
"sizeToken1",
"=",
"token",
".",
"substring",
"(",
"4",
",",
"... | Parses an encoded compound size and sets the size fields. The compound size has format:
max(<atomic size>;<atomic size2>) | min(<atomic size1>;<atomic
size2>) One of the two atomic sizes must be a logical size, the other must be a size
constant.
@param token a token for a bounded size, e.g. "ma... | [
"Parses",
"an",
"encoded",
"compound",
"size",
"and",
"sets",
"the",
"size",
"fields",
".",
"The",
"compound",
"size",
"has",
"format",
":",
"max",
"(",
"<",
";",
"atomic",
"size>",
";;",
"<",
";",
"atomic",
"size2>",
";",
")",
"|",
"min",
"(",... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormSpec.java#L333-L356 |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java | NodeImpl.makeIterableAndSetIndex | public static NodeImpl makeIterableAndSetIndex(final NodeImpl node, final Integer index) {
"""
make it iterable and set index.
@param node node to build
@param index index to set
@return iterable node implementation
"""
return new NodeImpl( //
node.name, //
node.parent, //
true... | java | public static NodeImpl makeIterableAndSetIndex(final NodeImpl node, final Integer index) {
return new NodeImpl( //
node.name, //
node.parent, //
true, //
index, //
null, //
node.kind, //
node.parameterTypes, //
node.parameterIndex, //
node.valu... | [
"public",
"static",
"NodeImpl",
"makeIterableAndSetIndex",
"(",
"final",
"NodeImpl",
"node",
",",
"final",
"Integer",
"index",
")",
"{",
"return",
"new",
"NodeImpl",
"(",
"//",
"node",
".",
"name",
",",
"//",
"node",
".",
"parent",
",",
"//",
"true",
",",
... | make it iterable and set index.
@param node node to build
@param index index to set
@return iterable node implementation | [
"make",
"it",
"iterable",
"and",
"set",
"index",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/org/hibernate/validator/internal/engine/path/NodeImpl.java#L311-L325 |
qspin/qtaste | kernel/src/main/java/com/qspin/qtaste/ui/treetable/AbstractTreeTableModel.java | AbstractTreeTableModel.fireTreeStructureChanged | protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) {
"""
/*
Notify all listeners that have registered interest for
notification on this event type. The event instance
is lazily created using the parameters passed into
the fire method.
@see EventListen... | java | protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children) {
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
TreeModelEvent e = null;
// Process the listeners last to first, notifying
... | [
"protected",
"void",
"fireTreeStructureChanged",
"(",
"Object",
"source",
",",
"Object",
"[",
"]",
"path",
",",
"int",
"[",
"]",
"childIndices",
",",
"Object",
"[",
"]",
"children",
")",
"{",
"// Guaranteed to return a non-null array",
"Object",
"[",
"]",
"liste... | /*
Notify all listeners that have registered interest for
notification on this event type. The event instance
is lazily created using the parameters passed into
the fire method.
@see EventListenerList | [
"/",
"*",
"Notify",
"all",
"listeners",
"that",
"have",
"registered",
"interest",
"for",
"notification",
"on",
"this",
"event",
"type",
".",
"The",
"event",
"instance",
"is",
"lazily",
"created",
"using",
"the",
"parameters",
"passed",
"into",
"the",
"fire",
... | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/kernel/src/main/java/com/qspin/qtaste/ui/treetable/AbstractTreeTableModel.java#L152-L167 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.addToSession | public Result addToSession(String key, String value) {
"""
Adds the given key-value pair to the current session. This method requires a current HTTP context. If none, a
{@link java.lang.IllegalStateException} is thrown.
@param key the key
@param value the value
@return the current result
"""
cu... | java | public Result addToSession(String key, String value) {
current(true).session().put(key, value);
return this;
} | [
"public",
"Result",
"addToSession",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"current",
"(",
"true",
")",
".",
"session",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds the given key-value pair to the current session. This method requires a current HTTP context. If none, a
{@link java.lang.IllegalStateException} is thrown.
@param key the key
@param value the value
@return the current result | [
"Adds",
"the",
"given",
"key",
"-",
"value",
"pair",
"to",
"the",
"current",
"session",
".",
"This",
"method",
"requires",
"a",
"current",
"HTTP",
"context",
".",
"If",
"none",
"a",
"{",
"@link",
"java",
".",
"lang",
".",
"IllegalStateException",
"}",
"i... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L552-L555 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.flattenUpto | private WyalFile.Stmt flattenUpto(AssumptionSet assumptions, AssumptionSet ancestor) {
"""
Flatten an assumption set upto a given ancestor. That is, do not include the
ancestor or any of its ancestors in the results. This is a little like taking
the difference of the given assumptions and the given ancestor's as... | java | private WyalFile.Stmt flattenUpto(AssumptionSet assumptions, AssumptionSet ancestor) {
if (assumptions == ancestor) {
// We have reached the ancestor
return null;
} else {
// Flattern parent assumptions
AssumptionSet[] parents = assumptions.parents;
WyalFile.Stmt e = null;
switch (parents.length)... | [
"private",
"WyalFile",
".",
"Stmt",
"flattenUpto",
"(",
"AssumptionSet",
"assumptions",
",",
"AssumptionSet",
"ancestor",
")",
"{",
"if",
"(",
"assumptions",
"==",
"ancestor",
")",
"{",
"// We have reached the ancestor",
"return",
"null",
";",
"}",
"else",
"{",
... | Flatten an assumption set upto a given ancestor. That is, do not include the
ancestor or any of its ancestors in the results. This is a little like taking
the difference of the given assumptions and the given ancestor's assumptions.
@param assumptions
The assumption set to be flattened
@param ancestor
An ancestor of t... | [
"Flatten",
"an",
"assumption",
"set",
"upto",
"a",
"given",
"ancestor",
".",
"That",
"is",
"do",
"not",
"include",
"the",
"ancestor",
"or",
"any",
"of",
"its",
"ancestors",
"in",
"the",
"results",
".",
"This",
"is",
"a",
"little",
"like",
"taking",
"the"... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L2095-L2130 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.resolveTaxonomyTerm | public TaxonomyTerm resolveTaxonomyTerm(final long id) throws SQLException {
"""
Resolves a taxonomy term by id.
<p>
Uses configured caches.
</p>
@param id The taxonomy term id.
@return The resolved term or {@code null} if not found.
@throws SQLException on database error.
"""
metrics.taxonomyTerm... | java | public TaxonomyTerm resolveTaxonomyTerm(final long id) throws SQLException {
metrics.taxonomyTermCacheTries.mark();
TaxonomyTerm term = taxonomyTermCache.getIfPresent(id);
if(term != null) {
metrics.taxonomyTermCacheHits.mark();
return term;
}
Connection conn = null;
... | [
"public",
"TaxonomyTerm",
"resolveTaxonomyTerm",
"(",
"final",
"long",
"id",
")",
"throws",
"SQLException",
"{",
"metrics",
".",
"taxonomyTermCacheTries",
".",
"mark",
"(",
")",
";",
"TaxonomyTerm",
"term",
"=",
"taxonomyTermCache",
".",
"getIfPresent",
"(",
"id",... | Resolves a taxonomy term by id.
<p>
Uses configured caches.
</p>
@param id The taxonomy term id.
@return The resolved term or {@code null} if not found.
@throws SQLException on database error. | [
"Resolves",
"a",
"taxonomy",
"term",
"by",
"id",
".",
"<p",
">",
"Uses",
"configured",
"caches",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2420-L2458 |
umeding/fuzzer | src/main/java/com/uwemeding/fuzzer/Program.java | Program.addPiecewiseFunction | public PiecewiseFunction addPiecewiseFunction(String name, String argumentName) {
"""
Add a piecewise function.
<p>
@param name is the name of the function
@param argumentName argument name
@return the function
"""
return addFunction(new PiecewiseFunction(name, argumentName));
} | java | public PiecewiseFunction addPiecewiseFunction(String name, String argumentName) {
return addFunction(new PiecewiseFunction(name, argumentName));
} | [
"public",
"PiecewiseFunction",
"addPiecewiseFunction",
"(",
"String",
"name",
",",
"String",
"argumentName",
")",
"{",
"return",
"addFunction",
"(",
"new",
"PiecewiseFunction",
"(",
"name",
",",
"argumentName",
")",
")",
";",
"}"
] | Add a piecewise function.
<p>
@param name is the name of the function
@param argumentName argument name
@return the function | [
"Add",
"a",
"piecewise",
"function",
".",
"<p",
">"
] | train | https://github.com/umeding/fuzzer/blob/e8aa46313bb1d1328865f26f99455124aede828c/src/main/java/com/uwemeding/fuzzer/Program.java#L252-L254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.