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
apiman/apiman
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java
AuditUtils.asString_ApiGatewayBeans
public static String asString_ApiGatewayBeans(Set<ApiGatewayBean> gateways) { """ Converts the list of gateways to a string for display/comparison. @param gateways set of gateways @return the gateways as a string """ TreeSet<ApiGatewayBean> sortedGateways = new TreeSet<>(new Comparator<ApiGatewayBean...
java
public static String asString_ApiGatewayBeans(Set<ApiGatewayBean> gateways) { TreeSet<ApiGatewayBean> sortedGateways = new TreeSet<>(new Comparator<ApiGatewayBean>() { @Override public int compare(ApiGatewayBean o1, ApiGatewayBean o2) { return o1.getGatewayId().compareTo(...
[ "public", "static", "String", "asString_ApiGatewayBeans", "(", "Set", "<", "ApiGatewayBean", ">", "gateways", ")", "{", "TreeSet", "<", "ApiGatewayBean", ">", "sortedGateways", "=", "new", "TreeSet", "<>", "(", "new", "Comparator", "<", "ApiGatewayBean", ">", "(...
Converts the list of gateways to a string for display/comparison. @param gateways set of gateways @return the gateways as a string
[ "Converts", "the", "list", "of", "gateways", "to", "a", "string", "for", "display", "/", "comparison", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/audit/AuditUtils.java#L837-L858
diffplug/durian
src/com/diffplug/common/base/TreeQuery.java
TreeQuery.isDescendantOfOrEqualTo
public static <T> boolean isDescendantOfOrEqualTo(TreeDef.Parented<T> treeDef, T child, T parent) { """ Returns true iff child is a descendant of parent, or if child is equal to parent. """ if (child.equals(parent)) { return true; } else { return isDescendantOf(treeDef, child, parent); } }
java
public static <T> boolean isDescendantOfOrEqualTo(TreeDef.Parented<T> treeDef, T child, T parent) { if (child.equals(parent)) { return true; } else { return isDescendantOf(treeDef, child, parent); } }
[ "public", "static", "<", "T", ">", "boolean", "isDescendantOfOrEqualTo", "(", "TreeDef", ".", "Parented", "<", "T", ">", "treeDef", ",", "T", "child", ",", "T", "parent", ")", "{", "if", "(", "child", ".", "equals", "(", "parent", ")", ")", "{", "ret...
Returns true iff child is a descendant of parent, or if child is equal to parent.
[ "Returns", "true", "iff", "child", "is", "a", "descendant", "of", "parent", "or", "if", "child", "is", "equal", "to", "parent", "." ]
train
https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/TreeQuery.java#L47-L53
graphhopper/graphhopper
core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java
LocationIndexTree.createReverseKey
final long createReverseKey(double lat, double lon) { """ this method returns the spatial key in reverse order for easier right-shifting """ return BitUtil.BIG.reverse(keyAlgo.encode(lat, lon), keyAlgo.getBits()); }
java
final long createReverseKey(double lat, double lon) { return BitUtil.BIG.reverse(keyAlgo.encode(lat, lon), keyAlgo.getBits()); }
[ "final", "long", "createReverseKey", "(", "double", "lat", ",", "double", "lon", ")", "{", "return", "BitUtil", ".", "BIG", ".", "reverse", "(", "keyAlgo", ".", "encode", "(", "lat", ",", "lon", ")", ",", "keyAlgo", ".", "getBits", "(", ")", ")", ";"...
this method returns the spatial key in reverse order for easier right-shifting
[ "this", "method", "returns", "the", "spatial", "key", "in", "reverse", "order", "for", "easier", "right", "-", "shifting" ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java#L377-L379
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java
FieldAccess.snarfFieldValue
protected static Variable snarfFieldValue(FieldInstruction fieldIns, ConstantPoolGen cpg, ValueNumberFrame frame) throws DataflowAnalysisException { """ Get a Variable representing the stack value which will either be stored into or loaded from a field. @param fieldIns the FieldInstruction accessi...
java
protected static Variable snarfFieldValue(FieldInstruction fieldIns, ConstantPoolGen cpg, ValueNumberFrame frame) throws DataflowAnalysisException { if (isLongOrDouble(fieldIns, cpg)) { int numSlots = frame.getNumSlots(); ValueNumber topValue = frame.getValue(numSlots - 1); ...
[ "protected", "static", "Variable", "snarfFieldValue", "(", "FieldInstruction", "fieldIns", ",", "ConstantPoolGen", "cpg", ",", "ValueNumberFrame", "frame", ")", "throws", "DataflowAnalysisException", "{", "if", "(", "isLongOrDouble", "(", "fieldIns", ",", "cpg", ")", ...
Get a Variable representing the stack value which will either be stored into or loaded from a field. @param fieldIns the FieldInstruction accessing the field @param cpg the ConstantPoolGen for the method @param frame the ValueNumberFrame containing the value to be stored or the value loaded
[ "Get", "a", "Variable", "representing", "the", "stack", "value", "which", "will", "either", "be", "stored", "into", "or", "loaded", "from", "a", "field", "." ]
train
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/bcp/FieldAccess.java#L112-L124
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.getCacheKey
private String getCacheKey(String[] keys, CmsDbContext dbc) { """ Return a cache key build from the provided information.<p> @param keys an array of keys to generate the cache key from @param dbc the database context for which to generate the key @return String a cache key build from the provided informatio...
java
private String getCacheKey(String[] keys, CmsDbContext dbc) { if (!dbc.getProjectId().isNullUUID()) { return ""; } StringBuffer b = new StringBuffer(64); int len = keys.length; if (len > 0) { for (int i = 0; i < len; i++) { b.append(keys[i...
[ "private", "String", "getCacheKey", "(", "String", "[", "]", "keys", ",", "CmsDbContext", "dbc", ")", "{", "if", "(", "!", "dbc", ".", "getProjectId", "(", ")", ".", "isNullUUID", "(", ")", ")", "{", "return", "\"\"", ";", "}", "StringBuffer", "b", "...
Return a cache key build from the provided information.<p> @param keys an array of keys to generate the cache key from @param dbc the database context for which to generate the key @return String a cache key build from the provided information
[ "Return", "a", "cache", "key", "build", "from", "the", "provided", "information", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L11185-L11204
forge/core
ui/api/src/main/java/org/jboss/forge/addon/ui/util/InputComponents.java
InputComponents.validateRequired
public static String validateRequired(final InputComponent<?, ?> input) { """ Validate if an required and enabled input has a value. If not, return the error message. @param input @return """ String requiredMessage = null; if (input.isEnabled() && input.isRequired() && !InputComponents.hasValue...
java
public static String validateRequired(final InputComponent<?, ?> input) { String requiredMessage = null; if (input.isEnabled() && input.isRequired() && !InputComponents.hasValue(input)) { requiredMessage = input.getRequiredMessage(); if (Strings.isNullOrEmpty(requiredMessage)) ...
[ "public", "static", "String", "validateRequired", "(", "final", "InputComponent", "<", "?", ",", "?", ">", "input", ")", "{", "String", "requiredMessage", "=", "null", ";", "if", "(", "input", ".", "isEnabled", "(", ")", "&&", "input", ".", "isRequired", ...
Validate if an required and enabled input has a value. If not, return the error message. @param input @return
[ "Validate", "if", "an", "required", "and", "enabled", "input", "has", "a", "value", ".", "If", "not", "return", "the", "error", "message", "." ]
train
https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/api/src/main/java/org/jboss/forge/addon/ui/util/InputComponents.java#L325-L343
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java
Utils.createNameForHiddenEventHandlerMethod
public static String createNameForHiddenEventHandlerMethod(String eventId, int handlerIndex) { """ Create the name of the hidden method that is containing the event handler code. @param eventId the id of the event. @param handlerIndex the index of the handler in the container type. @return the attribute name....
java
public static String createNameForHiddenEventHandlerMethod(String eventId, int handlerIndex) { return PREFIX_EVENT_HANDLER + fixHiddenMember(eventId) + HIDDEN_MEMBER_CHARACTER + handlerIndex; }
[ "public", "static", "String", "createNameForHiddenEventHandlerMethod", "(", "String", "eventId", ",", "int", "handlerIndex", ")", "{", "return", "PREFIX_EVENT_HANDLER", "+", "fixHiddenMember", "(", "eventId", ")", "+", "HIDDEN_MEMBER_CHARACTER", "+", "handlerIndex", ";"...
Create the name of the hidden method that is containing the event handler code. @param eventId the id of the event. @param handlerIndex the index of the handler in the container type. @return the attribute name.
[ "Create", "the", "name", "of", "the", "hidden", "method", "that", "is", "containing", "the", "event", "handler", "code", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java#L474-L476
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/Record.java
Record.handleErrorReturn
public int handleErrorReturn(int iChangeType, int iErrorCode) // init this field override for other value { """ Called when a error happens on a file operation, return the errorcode, or fix the problem. @param iChangeType The type of change that occurred. @param iErrorCode The error code encountered on th...
java
public int handleErrorReturn(int iChangeType, int iErrorCode) // init this field override for other value { BaseListener nextListener = this.getNextEnabledListener(); while (nextListener != null) { boolean bOldState = nextListener.setEnabledListener(false); // Don't allow...
[ "public", "int", "handleErrorReturn", "(", "int", "iChangeType", ",", "int", "iErrorCode", ")", "// init this field override for other value", "{", "BaseListener", "nextListener", "=", "this", ".", "getNextEnabledListener", "(", ")", ";", "while", "(", "nextListener", ...
Called when a error happens on a file operation, return the errorcode, or fix the problem. @param iChangeType The type of change that occurred. @param iErrorCode The error code encountered on the file operation. @return The new error code, or return the original code if you can't fix it.
[ "Called", "when", "a", "error", "happens", "on", "a", "file", "operation", "return", "the", "errorcode", "or", "fix", "the", "problem", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1555-L1567
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
HtmlLinkRendererBase.getStyleClass
protected String getStyleClass(FacesContext facesContext, UIComponent link) { """ Can be overwritten by derived classes to overrule the style class to be used. """ if (link instanceof HtmlCommandLink) { return ((HtmlCommandLink)link).getStyleClass(); } return (Strin...
java
protected String getStyleClass(FacesContext facesContext, UIComponent link) { if (link instanceof HtmlCommandLink) { return ((HtmlCommandLink)link).getStyleClass(); } return (String)link.getAttributes().get(HTML.STYLE_CLASS_ATTR); }
[ "protected", "String", "getStyleClass", "(", "FacesContext", "facesContext", ",", "UIComponent", "link", ")", "{", "if", "(", "link", "instanceof", "HtmlCommandLink", ")", "{", "return", "(", "(", "HtmlCommandLink", ")", "link", ")", ".", "getStyleClass", "(", ...
Can be overwritten by derived classes to overrule the style class to be used.
[ "Can", "be", "overwritten", "by", "derived", "classes", "to", "overrule", "the", "style", "class", "to", "be", "used", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java#L175-L184
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java
SpiderTransaction.deleteObjectRow
public void deleteObjectRow(TableDefinition tableDef, String objID) { """ Delete the primary field storage row for the given object. This usually called when the object is being deleted. @param tableDef {@link TableDefinition} that owns object. @param objID ID of object whose "objects" row is to be delet...
java
public void deleteObjectRow(TableDefinition tableDef, String objID) { deleteRow(SpiderService.objectsStoreName(tableDef), objID); }
[ "public", "void", "deleteObjectRow", "(", "TableDefinition", "tableDef", ",", "String", "objID", ")", "{", "deleteRow", "(", "SpiderService", ".", "objectsStoreName", "(", "tableDef", ")", ",", "objID", ")", ";", "}" ]
Delete the primary field storage row for the given object. This usually called when the object is being deleted. @param tableDef {@link TableDefinition} that owns object. @param objID ID of object whose "objects" row is to be deleted.
[ "Delete", "the", "primary", "field", "storage", "row", "for", "the", "given", "object", ".", "This", "usually", "called", "when", "the", "object", "is", "being", "deleted", "." ]
train
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/spider/SpiderTransaction.java#L396-L398
sarl/sarl
main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/comparison/ShortComparisonExtensions.java
ShortComparisonExtensions.operator_equals
@Pure @Inline(value = "($1 != null && ($1.shortValue() == $2))", constantExpression = true) public static boolean operator_equals(Short left, long right) { """ The binary {@code equals} operator. This is the equivalent to the Java {@code ==} operator. This function is null-safe. @param left a number. @param...
java
@Pure @Inline(value = "($1 != null && ($1.shortValue() == $2))", constantExpression = true) public static boolean operator_equals(Short left, long right) { return left != null ? left.shortValue() == right : false; }
[ "@", "Pure", "@", "Inline", "(", "value", "=", "\"($1 != null && ($1.shortValue() == $2))\"", ",", "constantExpression", "=", "true", ")", "public", "static", "boolean", "operator_equals", "(", "Short", "left", ",", "long", "right", ")", "{", "return", "left", "...
The binary {@code equals} operator. This is the equivalent to the Java {@code ==} operator. This function is null-safe. @param left a number. @param right a number. @return {@code left==right}
[ "The", "binary", "{", "@code", "equals", "}", "operator", ".", "This", "is", "the", "equivalent", "to", "the", "Java", "{", "@code", "==", "}", "operator", ".", "This", "function", "is", "null", "-", "safe", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/scoping/extensions/numbers/comparison/ShortComparisonExtensions.java#L425-L429
javamelody/javamelody
javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfDocumentFactory.java
PdfDocumentFactory.createWriter
private void createWriter(Document document, String title) throws DocumentException, IOException { """ We create a writer that listens to the document and directs a PDF-stream to output """ final PdfWriter writer = PdfWriter.getInstance(document, output); //writer.setViewerPreferences(PdfWriter.PageL...
java
private void createWriter(Document document, String title) throws DocumentException, IOException { final PdfWriter writer = PdfWriter.getInstance(document, output); //writer.setViewerPreferences(PdfWriter.PageLayoutTwoColumnLeft); // title final HeaderFooter header = new HeaderFooter(new Phrase(title)...
[ "private", "void", "createWriter", "(", "Document", "document", ",", "String", "title", ")", "throws", "DocumentException", ",", "IOException", "{", "final", "PdfWriter", "writer", "=", "PdfWriter", ".", "getInstance", "(", "document", ",", "output", ")", ";", ...
We create a writer that listens to the document and directs a PDF-stream to output
[ "We", "create", "a", "writer", "that", "listens", "to", "the", "document", "and", "directs", "a", "PDF", "-", "stream", "to", "output" ]
train
https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/pdf/PdfDocumentFactory.java#L180-L199
gallandarakhneorg/afc
core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java
OrientedBox3f.setFirstAxis
@Override public void setFirstAxis(double x, double y, double z, double extent, CoordinateSystem3D system) { """ Set the first axis of the second . The third axis is updated to be perpendicular to the two other axis. @param x @param y @param z @param extent @param system """ this.axis1.set(x, y, z);...
java
@Override public void setFirstAxis(double x, double y, double z, double extent, CoordinateSystem3D system) { this.axis1.set(x, y, z); assert(this.axis1.isUnitVector()); if (system.isLeftHanded()) { this.axis3.set(this.axis1.crossLeftHand(this.axis2)); } else { this.axis3.set(this.axis3.crossRightHand(thi...
[ "@", "Override", "public", "void", "setFirstAxis", "(", "double", "x", ",", "double", "y", ",", "double", "z", ",", "double", "extent", ",", "CoordinateSystem3D", "system", ")", "{", "this", ".", "axis1", ".", "set", "(", "x", ",", "y", ",", "z", ")"...
Set the first axis of the second . The third axis is updated to be perpendicular to the two other axis. @param x @param y @param z @param extent @param system
[ "Set", "the", "first", "axis", "of", "the", "second", ".", "The", "third", "axis", "is", "updated", "to", "be", "perpendicular", "to", "the", "two", "other", "axis", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/OrientedBox3f.java#L453-L463
googleapis/google-cloud-java
google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java
DnsBatch.createZoneCallback
private RpcBatch.Callback<ManagedZone> createZoneCallback( final DnsOptions serviceOptions, final DnsBatchResult<Zone> result, final boolean nullForNotFound, final boolean idempotent) { """ A joint callback for both "get zone" and "create zone" operations. """ return new RpcBatch.Ca...
java
private RpcBatch.Callback<ManagedZone> createZoneCallback( final DnsOptions serviceOptions, final DnsBatchResult<Zone> result, final boolean nullForNotFound, final boolean idempotent) { return new RpcBatch.Callback<ManagedZone>() { @Override public void onSuccess(ManagedZone resp...
[ "private", "RpcBatch", ".", "Callback", "<", "ManagedZone", ">", "createZoneCallback", "(", "final", "DnsOptions", "serviceOptions", ",", "final", "DnsBatchResult", "<", "Zone", ">", "result", ",", "final", "boolean", "nullForNotFound", ",", "final", "boolean", "i...
A joint callback for both "get zone" and "create zone" operations.
[ "A", "joint", "callback", "for", "both", "get", "zone", "and", "create", "zone", "operations", "." ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java#L258-L280
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/validator/AbstractExtraLanguageValidator.java
AbstractExtraLanguageValidator.createTypeConverterInstance
@SuppressWarnings("static-method") protected ExtraLanguageTypeConverter createTypeConverterInstance( IExtraLanguageConversionInitializer initializer, IExtraLanguageGeneratorContext context) { """ Create the instance of the type converter. @param initializer the converter initializer. @param context the ...
java
@SuppressWarnings("static-method") protected ExtraLanguageTypeConverter createTypeConverterInstance( IExtraLanguageConversionInitializer initializer, IExtraLanguageGeneratorContext context) { return new ExtraLanguageTypeConverter(initializer, context); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "ExtraLanguageTypeConverter", "createTypeConverterInstance", "(", "IExtraLanguageConversionInitializer", "initializer", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "return", "new", "ExtraLanguage...
Create the instance of the type converter. @param initializer the converter initializer. @param context the generation context. @return the type converter.
[ "Create", "the", "instance", "of", "the", "type", "converter", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/validator/AbstractExtraLanguageValidator.java#L350-L355
OpenVidu/openvidu
openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java
MediaEndpoint.unregisterElementErrListener
protected void unregisterElementErrListener(MediaElement element, final ListenerSubscription subscription) { """ Unregisters the error listener from the media element using the provided subscription. @param element the {@link MediaElement} @param subscription the associated {@link ListenerSubscription} ...
java
protected void unregisterElementErrListener(MediaElement element, final ListenerSubscription subscription) { if (element == null || subscription == null) { return; } element.removeErrorListener(subscription); }
[ "protected", "void", "unregisterElementErrListener", "(", "MediaElement", "element", ",", "final", "ListenerSubscription", "subscription", ")", "{", "if", "(", "element", "==", "null", "||", "subscription", "==", "null", ")", "{", "return", ";", "}", "element", ...
Unregisters the error listener from the media element using the provided subscription. @param element the {@link MediaElement} @param subscription the associated {@link ListenerSubscription}
[ "Unregisters", "the", "error", "listener", "from", "the", "media", "element", "using", "the", "provided", "subscription", "." ]
train
https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/kurento/endpoint/MediaEndpoint.java#L335-L340
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java
CmsGalleryController.sortCategories
public void sortCategories(String sortParams, String filter) { """ Sorts the categories according to given parameters and updates the list.<p> @param sortParams the sort parameters @param filter the filter to apply before sorting """ List<CmsCategoryBean> categories; SortParams sort = Sort...
java
public void sortCategories(String sortParams, String filter) { List<CmsCategoryBean> categories; SortParams sort = SortParams.valueOf(sortParams); switch (sort) { case tree: m_handler.onUpdateCategoriesTree(m_dialogBean.getCategories(), m_searchObject.getCategories()...
[ "public", "void", "sortCategories", "(", "String", "sortParams", ",", "String", "filter", ")", "{", "List", "<", "CmsCategoryBean", ">", "categories", ";", "SortParams", "sort", "=", "SortParams", ".", "valueOf", "(", "sortParams", ")", ";", "switch", "(", "...
Sorts the categories according to given parameters and updates the list.<p> @param sortParams the sort parameters @param filter the filter to apply before sorting
[ "Sorts", "the", "categories", "according", "to", "given", "parameters", "and", "updates", "the", "list", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1357-L1384
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java
RecommendationsInner.listRecommendedRulesForWebAppAsync
public Observable<Page<RecommendationInner>> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { """ Get all recommendations for an app. Get all recommendations for an app. @param resourceGroupName Name of the resource group t...
java
public Observable<Page<RecommendationInner>> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName, featured, filter) .map(new F...
[ "public", "Observable", "<", "Page", "<", "RecommendationInner", ">", ">", "listRecommendedRulesForWebAppAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ",", "final", "Boolean", "featured", ",", "final", "String", "filter", "...
Get all recommendations for an app. Get all recommendations for an app. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Name of the app. @param featured Specify &lt;code&gt;true&lt;/code&gt; to return only the most critical recommendations. The default is &lt;code&gt;...
[ "Get", "all", "recommendations", "for", "an", "app", ".", "Get", "all", "recommendations", "for", "an", "app", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/RecommendationsInner.java#L940-L948
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java
Whitebox.invokeMethod
public static synchronized <T> T invokeMethod(Class<?> klass, Object... arguments) throws Exception { """ Invoke a private or inner class static method without the need to specify the method name. This is thus a more refactor friendly version of the {@link #invokeMethod(Class, String, Object...)} method and is r...
java
public static synchronized <T> T invokeMethod(Class<?> klass, Object... arguments) throws Exception { return WhiteboxImpl.invokeMethod(klass, arguments); }
[ "public", "static", "synchronized", "<", "T", ">", "T", "invokeMethod", "(", "Class", "<", "?", ">", "klass", ",", "Object", "...", "arguments", ")", "throws", "Exception", "{", "return", "WhiteboxImpl", ".", "invokeMethod", "(", "klass", ",", "arguments", ...
Invoke a private or inner class static method without the need to specify the method name. This is thus a more refactor friendly version of the {@link #invokeMethod(Class, String, Object...)} method and is recommend over this method for that reason. This method might be useful to test private methods.
[ "Invoke", "a", "private", "or", "inner", "class", "static", "method", "without", "the", "need", "to", "specify", "the", "method", "name", ".", "This", "is", "thus", "a", "more", "refactor", "friendly", "version", "of", "the", "{", "@link", "#invokeMethod", ...
train
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L391-L393
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.unprojectInvRay
public Matrix4d unprojectInvRay(double winX, double winY, int[] viewport, Vector3d originDest, Vector3d dirDest) { """ /* (non-Javadoc) @see org.joml.Matrix4dc#unprojectInvRay(double, double, int[], org.joml.Vector3d, org.joml.Vector3d) """ double ndcX = (winX-viewport[0])/viewport[2]*2.0-1.0; ...
java
public Matrix4d unprojectInvRay(double winX, double winY, int[] viewport, Vector3d originDest, Vector3d dirDest) { double ndcX = (winX-viewport[0])/viewport[2]*2.0-1.0; double ndcY = (winY-viewport[1])/viewport[3]*2.0-1.0; double px = m00 * ndcX + m10 * ndcY + m30; double py = m01 * ndcX...
[ "public", "Matrix4d", "unprojectInvRay", "(", "double", "winX", ",", "double", "winY", ",", "int", "[", "]", "viewport", ",", "Vector3d", "originDest", ",", "Vector3d", "dirDest", ")", "{", "double", "ndcX", "=", "(", "winX", "-", "viewport", "[", "0", "...
/* (non-Javadoc) @see org.joml.Matrix4dc#unprojectInvRay(double, double, int[], org.joml.Vector3d, org.joml.Vector3d)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L9172-L9189
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/RemoteExceptionMappingStrategy.java
RemoteExceptionMappingStrategy.mapCSITransactionRolledBackException
@Override public Exception mapCSITransactionRolledBackException (EJSDeployedSupport s, CSITransactionRolledbackException ex) throws CSIException { """ This method is used for EJB 2.1 (and earlier) component remote interfaces as well as EJB 3.0 business r...
java
@Override public Exception mapCSITransactionRolledBackException (EJSDeployedSupport s, CSITransactionRolledbackException ex) throws CSIException { //d180095 // Ensure root is set before doing the mapping. if (s.rootEx == null) ...
[ "@", "Override", "public", "Exception", "mapCSITransactionRolledBackException", "(", "EJSDeployedSupport", "s", ",", "CSITransactionRolledbackException", "ex", ")", "throws", "CSIException", "{", "//d180095", "// Ensure root is set before doing the mapping.", "if", "(", "s", ...
This method is used for EJB 2.1 (and earlier) component remote interfaces as well as EJB 3.0 business remote interfaces that implement java.rmi.Remote. Generally, the exception mapping for the component and java.rmi.Remote business interfaces is the same, but for those differences that do exist, the code should run con...
[ "This", "method", "is", "used", "for", "EJB", "2", ".", "1", "(", "and", "earlier", ")", "component", "remote", "interfaces", "as", "well", "as", "EJB", "3", ".", "0", "business", "remote", "interfaces", "that", "implement", "java", ".", "rmi", ".", "R...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/RemoteExceptionMappingStrategy.java#L567-L585
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Validator.java
Validator.validateEmail
public static <T extends CharSequence> T validateEmail(T value, String errorMsg) throws ValidateException { """ 验证是否为可用邮箱地址 @param <T> 字符串类型 @param value 值 @param errorMsg 验证错误的信息 @return 验证后的值 @throws ValidateException 验证异常 """ if (false == isEmail(value)) { throw new ValidateException(errorMsg)...
java
public static <T extends CharSequence> T validateEmail(T value, String errorMsg) throws ValidateException { if (false == isEmail(value)) { throw new ValidateException(errorMsg); } return value; }
[ "public", "static", "<", "T", "extends", "CharSequence", ">", "T", "validateEmail", "(", "T", "value", ",", "String", "errorMsg", ")", "throws", "ValidateException", "{", "if", "(", "false", "==", "isEmail", "(", "value", ")", ")", "{", "throw", "new", "...
验证是否为可用邮箱地址 @param <T> 字符串类型 @param value 值 @param errorMsg 验证错误的信息 @return 验证后的值 @throws ValidateException 验证异常
[ "验证是否为可用邮箱地址" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L651-L656
algolia/instantsearch-android
core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java
Searcher.removeNumericRefinement
@SuppressWarnings( { """ Removes any numeric refinements relative to a specific attribute for the next queries. @param attribute the attribute that may have a refinement. @return this {@link Searcher} for chaining. """"WeakerAccess", "unused"}) // For library users public Searcher removeNumericRefineme...
java
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users public Searcher removeNumericRefinement(@NonNull String attribute) { return removeNumericRefinement(new NumericRefinement(attribute, NumericRefinement.OPERATOR_UNKNOWN, NumericRefinement.VALUE_UNKNOWN)); }
[ "@", "SuppressWarnings", "(", "{", "\"WeakerAccess\"", ",", "\"unused\"", "}", ")", "// For library users", "public", "Searcher", "removeNumericRefinement", "(", "@", "NonNull", "String", "attribute", ")", "{", "return", "removeNumericRefinement", "(", "new", "Numeric...
Removes any numeric refinements relative to a specific attribute for the next queries. @param attribute the attribute that may have a refinement. @return this {@link Searcher} for chaining.
[ "Removes", "any", "numeric", "refinements", "relative", "to", "a", "specific", "attribute", "for", "the", "next", "queries", "." ]
train
https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L718-L721
RestComm/jain-slee.http
resources/http-client/ra/src/main/java/org/restcomm/client/slee/resource/http/HttpClientResourceAdaptor.java
HttpClientResourceAdaptor.processResponseEvent
public void processResponseEvent(ResponseEvent event, HttpClientActivity activity) throws ActivityIsEndingException { """ Receives an Event from the HTTP client and sends it to the SLEE. @param event @param activity """ HttpClientActivityHandle ah = new HttpClientActivityHandle(activity.getSessi...
java
public void processResponseEvent(ResponseEvent event, HttpClientActivity activity) throws ActivityIsEndingException { HttpClientActivityHandle ah = new HttpClientActivityHandle(activity.getSessionId()); if (tracer.isFineEnabled()) tracer.fine("==== FIRING ResponseEvent EVENT TO LOCAL ...
[ "public", "void", "processResponseEvent", "(", "ResponseEvent", "event", ",", "HttpClientActivity", "activity", ")", "throws", "ActivityIsEndingException", "{", "HttpClientActivityHandle", "ah", "=", "new", "HttpClientActivityHandle", "(", "activity", ".", "getSessionId", ...
Receives an Event from the HTTP client and sends it to the SLEE. @param event @param activity
[ "Receives", "an", "Event", "from", "the", "HTTP", "client", "and", "sends", "it", "to", "the", "SLEE", "." ]
train
https://github.com/RestComm/jain-slee.http/blob/938e502a60355b988d6998d2539bbb16207674e8/resources/http-client/ra/src/main/java/org/restcomm/client/slee/resource/http/HttpClientResourceAdaptor.java#L672-L684
lucee/Lucee
core/src/main/java/lucee/runtime/op/Elvis.java
Elvis.operate
public static boolean operate(PageContext pc, double scope, Collection.Key[] varNames) { """ called by the Elvis operator from generated bytecode @param pc @param scope @param varNames @return """ return _operate(pc, scope, varNames, 0); }
java
public static boolean operate(PageContext pc, double scope, Collection.Key[] varNames) { return _operate(pc, scope, varNames, 0); }
[ "public", "static", "boolean", "operate", "(", "PageContext", "pc", ",", "double", "scope", ",", "Collection", ".", "Key", "[", "]", "varNames", ")", "{", "return", "_operate", "(", "pc", ",", "scope", ",", "varNames", ",", "0", ")", ";", "}" ]
called by the Elvis operator from generated bytecode @param pc @param scope @param varNames @return
[ "called", "by", "the", "Elvis", "operator", "from", "generated", "bytecode" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Elvis.java#L39-L41
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java
EventServiceSegment.removeRegistration
public Registration removeRegistration(String topic, String id) { """ Removes the registration matching the {@code topic} and {@code ID}. Returns the removed registration or {@code null} if none matched. @param topic the registration topic name @param id the registration ID @return the registration which ...
java
public Registration removeRegistration(String topic, String id) { Registration registration = registrationIdMap.remove(id); if (registration != null) { final Collection<Registration> all = registrations.get(topic); if (all != null) { all.remove(registration); ...
[ "public", "Registration", "removeRegistration", "(", "String", "topic", ",", "String", "id", ")", "{", "Registration", "registration", "=", "registrationIdMap", ".", "remove", "(", "id", ")", ";", "if", "(", "registration", "!=", "null", ")", "{", "final", "...
Removes the registration matching the {@code topic} and {@code ID}. Returns the removed registration or {@code null} if none matched. @param topic the registration topic name @param id the registration ID @return the registration which was removed or {@code null} if none matchec
[ "Removes", "the", "registration", "matching", "the", "{", "@code", "topic", "}", "and", "{", "@code", "ID", "}", ".", "Returns", "the", "removed", "registration", "or", "{", "@code", "null", "}", "if", "none", "matched", "." ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java#L171-L181
JOML-CI/JOML
src/org/joml/Matrix4d.java
Matrix4d.rotateAroundLocal
public Matrix4d rotateAroundLocal(Quaterniondc quat, double ox, double oy, double oz) { """ Pre-multiply the rotation - and possibly scaling - transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin. <p> When used with a right-handed coordinat...
java
public Matrix4d rotateAroundLocal(Quaterniondc quat, double ox, double oy, double oz) { return rotateAroundLocal(quat, ox, oy, oz, this); }
[ "public", "Matrix4d", "rotateAroundLocal", "(", "Quaterniondc", "quat", ",", "double", "ox", ",", "double", "oy", ",", "double", "oz", ")", "{", "return", "rotateAroundLocal", "(", "quat", ",", "ox", ",", "oy", ",", "oz", ",", "this", ")", ";", "}" ]
Pre-multiply the rotation - and possibly scaling - transformation of the given {@link Quaterniondc} to this matrix while using <code>(ox, oy, oz)</code> as the rotation origin. <p> When used with a right-handed coordinate system, the produced rotation will rotate a vector counter-clockwise around the rotation axis, whe...
[ "Pre", "-", "multiply", "the", "rotation", "-", "and", "possibly", "scaling", "-", "transformation", "of", "the", "given", "{", "@link", "Quaterniondc", "}", "to", "this", "matrix", "while", "using", "<code", ">", "(", "ox", "oy", "oz", ")", "<", "/", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L5368-L5370
calrissian/mango
mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java
MoreInetAddresses.getInet6Address
static Inet6Address getInet6Address(byte[] bytes) { """ Returns an {@link Inet6Address}, given a byte array representation of the IPv6 address. @param bytes byte array representing an IPv4 address (should be of length 16) @return {@link Inet6Address} corresponding to the supplied byte array @throws IllegalArg...
java
static Inet6Address getInet6Address(byte[] bytes) { if (bytes.length != 16) throw new IllegalArgumentException(format("Byte array has invalid length for an IPv6 address: %s != 16.", bytes.length)); try { //This is a simple way to bypass the automatic conversion to Inet4Address a...
[ "static", "Inet6Address", "getInet6Address", "(", "byte", "[", "]", "bytes", ")", "{", "if", "(", "bytes", ".", "length", "!=", "16", ")", "throw", "new", "IllegalArgumentException", "(", "format", "(", "\"Byte array has invalid length for an IPv6 address: %s != 16.\"...
Returns an {@link Inet6Address}, given a byte array representation of the IPv6 address. @param bytes byte array representing an IPv4 address (should be of length 16) @return {@link Inet6Address} corresponding to the supplied byte array @throws IllegalArgumentException if a valid {@link Inet6Address} can not be created
[ "Returns", "an", "{", "@link", "Inet6Address", "}", "given", "a", "byte", "array", "representation", "of", "the", "IPv6", "address", "." ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/net/MoreInetAddresses.java#L75-L86
netscaler/sdx_nitro
src/main/java/com/citrix/sdx/nitro/resource/config/mps/mps_upgrade.java
mps_upgrade.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> """ mps_upgrade_responses result = (mps_upgrade_responses) service.get_payl...
java
protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception { mps_upgrade_responses result = (mps_upgrade_responses) service.get_payload_formatter().string_to_resource(mps_upgrade_responses.class, response); if(result.errorcode != 0) { if (result.errorcode =...
[ "protected", "base_resource", "[", "]", "get_nitro_bulk_response", "(", "nitro_service", "service", ",", "String", "response", ")", "throws", "Exception", "{", "mps_upgrade_responses", "result", "=", "(", "mps_upgrade_responses", ")", "service", ".", "get_payload_format...
<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/mps/mps_upgrade.java#L160-L177
nostra13/Android-Universal-Image-Loader
library/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java
ImageLoader.loadImage
public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { """ Adds load image task to execution pool. Image will be returned with {@link ImageLoadingListener#onLoadingComplete(String, android.view.Vi...
java
public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { checkConfiguration(); if (targetImageSize == null) { targetImageSize = configuration.getMaxImageSize(); } if (options == null) { opti...
[ "public", "void", "loadImage", "(", "String", "uri", ",", "ImageSize", "targetImageSize", ",", "DisplayImageOptions", "options", ",", "ImageLoadingListener", "listener", ",", "ImageLoadingProgressListener", "progressListener", ")", "{", "checkConfiguration", "(", ")", "...
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 (...
[ "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#L517-L529
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java
RecipesValidator.validateScriptComponent
private static List<ModelError> validateScriptComponent( File applicationFilesDirectory, Component component ) { """ Validates a component associated with the Puppet installer. @param applicationFilesDirectory the application's directory @param component the component @return a non-null list of errors """ ...
java
private static List<ModelError> validateScriptComponent( File applicationFilesDirectory, Component component ) { List<ModelError> result = new ArrayList<> (); // There must be a "scripts" directory File directory = ResourceUtils.findInstanceResourcesDirectory( applicationFilesDirectory, component ); List<File>...
[ "private", "static", "List", "<", "ModelError", ">", "validateScriptComponent", "(", "File", "applicationFilesDirectory", ",", "Component", "component", ")", "{", "List", "<", "ModelError", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "// There m...
Validates a component associated with the Puppet installer. @param applicationFilesDirectory the application's directory @param component the component @return a non-null list of errors
[ "Validates", "a", "component", "associated", "with", "the", "Puppet", "installer", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/RecipesValidator.java#L113-L127
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java
CookieHelper.addCookiesToResponse
public static void addCookiesToResponse(List<Cookie> cookieList, HttpServletResponse resp) { """ Given a list of Cookie objects, set them into the HttpServletResponse. This method does not alter the cookies in any way. @param cookieList A List of Cookie objects @param resp HttpServletResponse into which to se...
java
public static void addCookiesToResponse(List<Cookie> cookieList, HttpServletResponse resp) { Iterator<Cookie> iterator = cookieList.listIterator(); while (iterator.hasNext()) { Cookie cookie = iterator.next(); if (cookie != null) { resp.addCookie(cookie); ...
[ "public", "static", "void", "addCookiesToResponse", "(", "List", "<", "Cookie", ">", "cookieList", ",", "HttpServletResponse", "resp", ")", "{", "Iterator", "<", "Cookie", ">", "iterator", "=", "cookieList", ".", "listIterator", "(", ")", ";", "while", "(", ...
Given a list of Cookie objects, set them into the HttpServletResponse. This method does not alter the cookies in any way. @param cookieList A List of Cookie objects @param resp HttpServletResponse into which to set the cookie
[ "Given", "a", "list", "of", "Cookie", "objects", "set", "them", "into", "the", "HttpServletResponse", ".", "This", "method", "does", "not", "alter", "the", "cookies", "in", "any", "way", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L90-L98
acromusashi/acromusashi-stream
src/main/java/acromusashi/stream/resource/ResourceResolver.java
ResourceResolver.readResource
public static String readResource(Class<?> clazz, String path) { """ Return target file's content from class and resource's path.<br> @param clazz Target class @param path resource's path @return read result """ File targetFile = resolve(clazz, path); if (targetFile == null) { ...
java
public static String readResource(Class<?> clazz, String path) { File targetFile = resolve(clazz, path); if (targetFile == null) { return null; } String result; try { result = FileUtils.readFileToString(targetFile, "UTF-8"); }...
[ "public", "static", "String", "readResource", "(", "Class", "<", "?", ">", "clazz", ",", "String", "path", ")", "{", "File", "targetFile", "=", "resolve", "(", "clazz", ",", "path", ")", ";", "if", "(", "targetFile", "==", "null", ")", "{", "return", ...
Return target file's content from class and resource's path.<br> @param clazz Target class @param path resource's path @return read result
[ "Return", "target", "file", "s", "content", "from", "class", "and", "resource", "s", "path", ".", "<br", ">" ]
train
https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/resource/ResourceResolver.java#L119-L139
roboconf/roboconf-platform
core/roboconf-plugin-puppet/src/main/java/net/roboconf/plugin/puppet/internal/PluginPuppet.java
PluginPuppet.formatExportedVariables
String formatExportedVariables( Map<String,String> instanceExports ) { """ Returns a String representing all the exported variables and their value. <p> Must be that way:<br> {@code varName1 => 'varValue1', varName2 => undef, varName3 => 'varValue3'} </p> <p> It is assumed the prefix of the exported variable...
java
String formatExportedVariables( Map<String,String> instanceExports ) { StringBuilder sb = new StringBuilder(); boolean first = true; for( Entry<String,String> entry : instanceExports.entrySet()) { if( first ) first = false; else sb.append(", "); String vname = VariableHelpers.parseVariableName(...
[ "String", "formatExportedVariables", "(", "Map", "<", "String", ",", "String", ">", "instanceExports", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "Entry", "<", "String", ",...
Returns a String representing all the exported variables and their value. <p> Must be that way:<br> {@code varName1 => 'varValue1', varName2 => undef, varName3 => 'varValue3'} </p> <p> It is assumed the prefix of the exported variable (component or facet name) is not required. </p> <p> As an example...<br> Export "Redi...
[ "Returns", "a", "String", "representing", "all", "the", "exported", "variables", "and", "their", "value", ".", "<p", ">", "Must", "be", "that", "way", ":", "<br", ">", "{", "@code", "varName1", "=", ">", "varValue1", "varName2", "=", ">", "undef", "varNa...
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-plugin-puppet/src/main/java/net/roboconf/plugin/puppet/internal/PluginPuppet.java#L429-L449
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/component/SeaGlassInternalFrameTitlePane.java
SeaGlassInternalFrameTitlePane.postClosingEvent
protected void postClosingEvent(JInternalFrame frame) { """ Post a WINDOW_CLOSING-like event to the frame, so that it can be treated like a regular Frame. @param frame the internal frame to be closed. """ InternalFrameEvent e = new InternalFrameEvent(frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING...
java
protected void postClosingEvent(JInternalFrame frame) { InternalFrameEvent e = new InternalFrameEvent(frame, InternalFrameEvent.INTERNAL_FRAME_CLOSING); // Try posting event, unless there's a SecurityManager. if (JInternalFrame.class.getClassLoader() == null) { try { ...
[ "protected", "void", "postClosingEvent", "(", "JInternalFrame", "frame", ")", "{", "InternalFrameEvent", "e", "=", "new", "InternalFrameEvent", "(", "frame", ",", "InternalFrameEvent", ".", "INTERNAL_FRAME_CLOSING", ")", ";", "// Try posting event, unless there's a Security...
Post a WINDOW_CLOSING-like event to the frame, so that it can be treated like a regular Frame. @param frame the internal frame to be closed.
[ "Post", "a", "WINDOW_CLOSING", "-", "like", "event", "to", "the", "frame", "so", "that", "it", "can", "be", "treated", "like", "a", "regular", "Frame", "." ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/component/SeaGlassInternalFrameTitlePane.java#L644-L660
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/inputs/PeekingInputReader.java
PeekingInputReader.peek
public T peek() { """ Returns the element that will be returned by {@link #next()} next. Or null if there is no next element. If null elements are allowed in the input, one can distinguish between the end of the input and a null element by calling {@link #hasNext()} @throws RuntimeException In the event that ...
java
public T peek() { if (peekedItem == null) { try { peekedItem = SerializableValue.of(getMarshaller(), super.next()); } catch (NoSuchElementException e) { // ignore. } catch (IOException e) { throw new RuntimeException("Failed to read next input", e); } } return...
[ "public", "T", "peek", "(", ")", "{", "if", "(", "peekedItem", "==", "null", ")", "{", "try", "{", "peekedItem", "=", "SerializableValue", ".", "of", "(", "getMarshaller", "(", ")", ",", "super", ".", "next", "(", ")", ")", ";", "}", "catch", "(", ...
Returns the element that will be returned by {@link #next()} next. Or null if there is no next element. If null elements are allowed in the input, one can distinguish between the end of the input and a null element by calling {@link #hasNext()} @throws RuntimeException In the event that reading from input fails.
[ "Returns", "the", "element", "that", "will", "be", "returned", "by", "{", "@link", "#next", "()", "}", "next", ".", "Or", "null", "if", "there", "is", "no", "next", "element", ".", "If", "null", "elements", "are", "allowed", "in", "the", "input", "one"...
train
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/PeekingInputReader.java#L55-L66
synchronoss/cpo-api
cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java
CassandraCpoAdapter.existsObject
@Override public <T> long existsObject(String name, T obj, Collection<CpoWhere> wheres) throws CpoException { """ The CpoAdapter will check to see if this object exists in the datasource. <p/> <pre>Example: <code> <p/> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <...
java
@Override public <T> long existsObject(String name, T obj, Collection<CpoWhere> wheres) throws CpoException { Session session = null; long objCount = -1; try { session = getReadSession(); objCount = existsObject(name, obj, session, wheres); } catch (Exception e) { throw new CpoExce...
[ "@", "Override", "public", "<", "T", ">", "long", "existsObject", "(", "String", "name", ",", "T", "obj", ",", "Collection", "<", "CpoWhere", ">", "wheres", ")", "throws", "CpoException", "{", "Session", "session", "=", "null", ";", "long", "objCount", "...
The CpoAdapter will check to see if this object exists in the datasource. <p/> <pre>Example: <code> <p/> class SomeObject so = new SomeObject(); long count = 0; class CpoAdapter cpo = null; <p/> <p/> try { cpo = new CpoAdapter(new JdbcDataSourceInfo(driver, url, user, password,1,1,false)); } catch (CpoException ce) { /...
[ "The", "CpoAdapter", "will", "check", "to", "see", "if", "this", "object", "exists", "in", "the", "datasource", ".", "<p", "/", ">", "<pre", ">", "Example", ":", "<code", ">", "<p", "/", ">", "class", "SomeObject", "so", "=", "new", "SomeObject", "()",...
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L951-L965
jeluard/semantic-versioning
api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java
DOMDiffHandler.fieldChanged
public void fieldChanged(FieldInfo oldInfo, FieldInfo newInfo) throws DiffException { """ Write out info aboout a changed field. This writes out a &lt;fieldchange&gt; node, followed by a &lt;from&gt; node, with the old information about the field followed by a &lt;to&gt; node with the new information ab...
java
public void fieldChanged(FieldInfo oldInfo, FieldInfo newInfo) throws DiffException { Node currentNode = this.currentNode; Element tmp = doc.createElementNS(XML_URI, "fieldchange"); Element from = doc.createElementNS(XML_URI, "from"); Element to = doc.createElementNS(XML_URI...
[ "public", "void", "fieldChanged", "(", "FieldInfo", "oldInfo", ",", "FieldInfo", "newInfo", ")", "throws", "DiffException", "{", "Node", "currentNode", "=", "this", ".", "currentNode", ";", "Element", "tmp", "=", "doc", ".", "createElementNS", "(", "XML_URI", ...
Write out info aboout a changed field. This writes out a &lt;fieldchange&gt; node, followed by a &lt;from&gt; node, with the old information about the field followed by a &lt;to&gt; node with the new information about the field. @param oldInfo Info about the old field. @param newInfo Info about the new field. @throws ...
[ "Write", "out", "info", "aboout", "a", "changed", "field", ".", "This", "writes", "out", "a", "&lt", ";", "fieldchange&gt", ";", "node", "followed", "by", "a", "&lt", ";", "from&gt", ";", "node", "with", "the", "old", "information", "about", "the", "fiel...
train
https://github.com/jeluard/semantic-versioning/blob/d0bfbeddca8ac4202f5225810227c72a708360a9/api/src/main/java/org/osjava/jardiff/DOMDiffHandler.java#L396-L411
hypercube1024/firefly
firefly-common/src/main/java/com/firefly/utils/function/Actions.java
Actions.toFunc
public static <T1, T2, T3, T4, T5, T6, T7> Func7<T1, T2, T3, T4, T5, T6, T7, Void> toFunc( final Action7<T1, T2, T3, T4, T5, T6, T7> action) { """ Converts an {@link Action7} to a function that calls the action and returns {@code null}. @param action the {@link Action7} to convert @return a {@link ...
java
public static <T1, T2, T3, T4, T5, T6, T7> Func7<T1, T2, T3, T4, T5, T6, T7, Void> toFunc( final Action7<T1, T2, T3, T4, T5, T6, T7> action) { return toFunc(action, (Void) null); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ",", "T6", ",", "T7", ">", "Func7", "<", "T1", ",", "T2", ",", "T3", ",", "T4", ",", "T5", ",", "T6", ",", "T7", ",", "Void", ">", "toFunc", "(", "final", "Action7",...
Converts an {@link Action7} to a function that calls the action and returns {@code null}. @param action the {@link Action7} to convert @return a {@link Func7} that calls {@code action} and returns {@code null}
[ "Converts", "an", "{", "@link", "Action7", "}", "to", "a", "function", "that", "calls", "the", "action", "and", "returns", "{", "@code", "null", "}", "." ]
train
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/function/Actions.java#L157-L160
facebookarchive/hadoop-20
src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
FSDataset.delBlockFromDisk
private boolean delBlockFromDisk(File blockFile, File metaFile, Block b) { """ Remove a block from disk @param blockFile block file @param metaFile block meta file @param b a block @return true if on-disk files are deleted; false otherwise """ if (blockFile == null) { DataNode.LOG.warn("No file e...
java
private boolean delBlockFromDisk(File blockFile, File metaFile, Block b) { if (blockFile == null) { DataNode.LOG.warn("No file exists for block: " + b); return true; } if (!blockFile.delete()) { DataNode.LOG.warn("Not able to delete the block file: " + blockFile); return false; ...
[ "private", "boolean", "delBlockFromDisk", "(", "File", "blockFile", ",", "File", "metaFile", ",", "Block", "b", ")", "{", "if", "(", "blockFile", "==", "null", ")", "{", "DataNode", ".", "LOG", ".", "warn", "(", "\"No file exists for block: \"", "+", "b", ...
Remove a block from disk @param blockFile block file @param metaFile block meta file @param b a block @return true if on-disk files are deleted; false otherwise
[ "Remove", "a", "block", "from", "disk" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L2461-L2478
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newImmutableObjectException
public static ImmutableObjectException newImmutableObjectException(Throwable cause, String message, Object... args) { """ Constructs and initializes a new {@link ImmutableObjectException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @par...
java
public static ImmutableObjectException newImmutableObjectException(Throwable cause, String message, Object... args) { return new ImmutableObjectException(format(message, args), cause); }
[ "public", "static", "ImmutableObjectException", "newImmutableObjectException", "(", "Throwable", "cause", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "new", "ImmutableObjectException", "(", "format", "(", "message", ",", "args", ")", ...
Constructs and initializes a new {@link ImmutableObjectException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwable} identified as the reason this {@link ImmutableObjectException} was thrown. @param message {@link String...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "ImmutableObjectException", "}", "with", "the", "given", "{", "@link", "Throwable", "cause", "}", "and", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", ...
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L425-L427
momokan/LWJGFont
src/main/java/net/chocolapod/lwjgfont/LWJGFont.java
LWJGFont.drawString
public final void drawString(String text, float dstX, float dstY, float dstZ) throws IOException { """ Draws the text given by the specified string, using this font instance's current color.<br> Note that the specified destination coordinates is a left point of the rendered string's baseline. @param text the str...
java
public final void drawString(String text, float dstX, float dstY, float dstZ) throws IOException { DrawPoint drawPoint = new DrawPoint(dstX, dstY, dstZ); MappedCharacter character; if (!LwjgFontUtil.isEmpty(text)) { for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if (ch == Line...
[ "public", "final", "void", "drawString", "(", "String", "text", ",", "float", "dstX", ",", "float", "dstY", ",", "float", "dstZ", ")", "throws", "IOException", "{", "DrawPoint", "drawPoint", "=", "new", "DrawPoint", "(", "dstX", ",", "dstY", ",", "dstZ", ...
Draws the text given by the specified string, using this font instance's current color.<br> Note that the specified destination coordinates is a left point of the rendered string's baseline. @param text the string to be drawn. @param dstX the x coordinate to render the string. @param dstY the y coordinate to render the...
[ "Draws", "the", "text", "given", "by", "the", "specified", "string", "using", "this", "font", "instance", "s", "current", "color", ".", "<br", ">", "Note", "that", "the", "specified", "destination", "coordinates", "is", "a", "left", "point", "of", "the", "...
train
https://github.com/momokan/LWJGFont/blob/f2d6138b73d84a7e2c1271bae25b4c76488d9ec2/src/main/java/net/chocolapod/lwjgfont/LWJGFont.java#L103-L125
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseXcoo2csr
public static int cusparseXcoo2csr( cusparseHandle handle, Pointer cooRowInd, int nnz, int m, Pointer csrSortedRowPtr, int idxBase) { """ Description: This routine compresses the indecis of rows or columns. It can be interpreted as a conversion from COO t...
java
public static int cusparseXcoo2csr( cusparseHandle handle, Pointer cooRowInd, int nnz, int m, Pointer csrSortedRowPtr, int idxBase) { return checkResult(cusparseXcoo2csrNative(handle, cooRowInd, nnz, m, csrSortedRowPtr, idxBase)); }
[ "public", "static", "int", "cusparseXcoo2csr", "(", "cusparseHandle", "handle", ",", "Pointer", "cooRowInd", ",", "int", "nnz", ",", "int", "m", ",", "Pointer", "csrSortedRowPtr", ",", "int", "idxBase", ")", "{", "return", "checkResult", "(", "cusparseXcoo2csrNa...
Description: This routine compresses the indecis of rows or columns. It can be interpreted as a conversion from COO to CSR sparse storage format.
[ "Description", ":", "This", "routine", "compresses", "the", "indecis", "of", "rows", "or", "columns", ".", "It", "can", "be", "interpreted", "as", "a", "conversion", "from", "COO", "to", "CSR", "sparse", "storage", "format", "." ]
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L11600-L11609
ansell/restlet-utils
src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java
FixedRedirectCookieAuthenticator.isLoggingIn
protected boolean isLoggingIn(final Request request, final Response response) { """ Indicates if the request is an attempt to log in and should be intercepted. @param request The current request. @param response The current response. @return True if the request is an attempt to log in and should be intercep...
java
protected boolean isLoggingIn(final Request request, final Response response) { return this.isInterceptingLogin() && this.getLoginPath().equals(request.getResourceRef().getRemainingPart(false, false)) && Method.POST.equals(request.getMethod()); }
[ "protected", "boolean", "isLoggingIn", "(", "final", "Request", "request", ",", "final", "Response", "response", ")", "{", "return", "this", ".", "isInterceptingLogin", "(", ")", "&&", "this", ".", "getLoginPath", "(", ")", ".", "equals", "(", "request", "."...
Indicates if the request is an attempt to log in and should be intercepted. @param request The current request. @param response The current response. @return True if the request is an attempt to log in and should be intercepted.
[ "Indicates", "if", "the", "request", "is", "an", "attempt", "to", "log", "in", "and", "should", "be", "intercepted", "." ]
train
https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L592-L597
acromusashi/acromusashi-stream
src/main/java/acromusashi/stream/bolt/hdfs/HdfsOutputSwitcher.java
HdfsOutputSwitcher.appendLine
public void appendLine(String target, long nowTime) throws IOException { """ メッセージをHDFSに出力し、改行する。 @param target 出力行 @param nowTime 出力時刻 @throws IOException 入出力エラー発生時 """ if (this.nextSwitchTime <= nowTime) { switchWriter(nowTime); } this.currentWriter.app...
java
public void appendLine(String target, long nowTime) throws IOException { if (this.nextSwitchTime <= nowTime) { switchWriter(nowTime); } this.currentWriter.appendLine(target); }
[ "public", "void", "appendLine", "(", "String", "target", ",", "long", "nowTime", ")", "throws", "IOException", "{", "if", "(", "this", ".", "nextSwitchTime", "<=", "nowTime", ")", "{", "switchWriter", "(", "nowTime", ")", ";", "}", "this", ".", "currentWri...
メッセージをHDFSに出力し、改行する。 @param target 出力行 @param nowTime 出力時刻 @throws IOException 入出力エラー発生時
[ "メッセージをHDFSに出力し、改行する。" ]
train
https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/bolt/hdfs/HdfsOutputSwitcher.java#L153-L161
sagiegurari/fax4j
src/main/java/org/fax4j/spi/FaxClientSpiFactory.java
FaxClientSpiFactory.createFaxClientSpi
public static FaxClientSpi createFaxClientSpi(String type,Properties configuration) { """ This function creates a new fax client SPI based on the provided configuration.<br> This is an internal framework method and should not be invoked by classes outside the fax4j framework. @param type The fax client typ...
java
public static FaxClientSpi createFaxClientSpi(String type,Properties configuration) { //create fax client SPI FaxClientSpi faxClientSpi=FaxClientSpiFactory.createFaxClientSpiImpl(type,configuration,false); return faxClientSpi; }
[ "public", "static", "FaxClientSpi", "createFaxClientSpi", "(", "String", "type", ",", "Properties", "configuration", ")", "{", "//create fax client SPI", "FaxClientSpi", "faxClientSpi", "=", "FaxClientSpiFactory", ".", "createFaxClientSpiImpl", "(", "type", ",", "configur...
This function creates a new fax client SPI based on the provided configuration.<br> This is an internal framework method and should not be invoked by classes outside the fax4j framework. @param type The fax client type (may be null for default type) @param configuration The fax client configuration (may be null) @...
[ "This", "function", "creates", "a", "new", "fax", "client", "SPI", "based", "on", "the", "provided", "configuration", ".", "<br", ">", "This", "is", "an", "internal", "framework", "method", "and", "should", "not", "be", "invoked", "by", "classes", "outside",...
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/FaxClientSpiFactory.java#L198-L204
pressgang-ccms/PressGangCCMSContentSpec
src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java
CSTransformer.transformSpecTopicWithoutTypeCheck
private static SpecTopic transformSpecTopicWithoutTypeCheck(final CSNodeWrapper node, final Map<Integer, Node> nodes, final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes) { """ Transform a Topic CSNode entity object into a SpecTopic Object that can be added to a C...
java
private static SpecTopic transformSpecTopicWithoutTypeCheck(final CSNodeWrapper node, final Map<Integer, Node> nodes, final Map<String, SpecTopic> targetTopics, final List<CSNodeWrapper> relationshipFromNodes) { final SpecTopic specTopic = new SpecTopic(node.getEntityId(), node.getTitle()); ...
[ "private", "static", "SpecTopic", "transformSpecTopicWithoutTypeCheck", "(", "final", "CSNodeWrapper", "node", ",", "final", "Map", "<", "Integer", ",", "Node", ">", "nodes", ",", "final", "Map", "<", "String", ",", "SpecTopic", ">", "targetTopics", ",", "final"...
Transform a Topic CSNode entity object into a SpecTopic Object that can be added to a Content Specification. @param node The CSNode entity object to be transformed. @param nodes A mapping of node entity ids to their transformed counterparts. @param targetTopics A mapping of ta...
[ "Transform", "a", "Topic", "CSNode", "entity", "object", "into", "a", "SpecTopic", "Object", "that", "can", "be", "added", "to", "a", "Content", "Specification", "." ]
train
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CSTransformer.java#L482-L510
ltearno/hexa.tools
hexa.core/src/main/java/fr/lteconsulting/hexa/client/sql/SQLiteTypeManagerManager.java
SQLiteTypeManager_int.localRecordStateCreateTriggerSql
@Override public Boolean localRecordStateCreateTriggerSql( SQLite db, String tableName, String fieldName ) { """ /* Créee un trigger qui permet la maj automatique d'un champ de statut (INTEGER) dont la valeur signifiera : - 0 : enregistrement créé localement - 1 : enregistrement copie conforme du serveur - 2 : ...
java
@Override public Boolean localRecordStateCreateTriggerSql( SQLite db, String tableName, String fieldName ) { String triggerSql = "CREATE TRIGGER IF NOT EXISTS " + tableName + "_" + fieldName + "_localstate_update BEFORE UPDATE ON " + tableName + " FOR EACH ROW " + "WHEN NEW." + fieldName + " <> 1 " + "BEGIN " +...
[ "@", "Override", "public", "Boolean", "localRecordStateCreateTriggerSql", "(", "SQLite", "db", ",", "String", "tableName", ",", "String", "fieldName", ")", "{", "String", "triggerSql", "=", "\"CREATE TRIGGER IF NOT EXISTS \"", "+", "tableName", "+", "\"_\"", "+", "f...
/* Créee un trigger qui permet la maj automatique d'un champ de statut (INTEGER) dont la valeur signifiera : - 0 : enregistrement créé localement - 1 : enregistrement copie conforme du serveur - 2 : enregistrement modifié localement @see com.hexa.client.sql.SQLiteTypeManagerManager.SQLiteTypeManager #localRecordStateC...
[ "/", "*", "Créee", "un", "trigger", "qui", "permet", "la", "maj", "automatique", "d", "un", "champ", "de", "statut", "(", "INTEGER", ")", "dont", "la", "valeur", "signifiera", ":", "-", "0", ":", "enregistrement", "créé", "localement", "-", "1", ":", "...
train
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/sql/SQLiteTypeManagerManager.java#L72-L81
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/APIs/ApiBase.java
ApiBase.getList
protected <T extends Dto> List<T> getList(Class<T[]> classOfT, Class<T> classOfTItem, String methodKey, Pagination pagination, String entityId, String secondEntityId, Map<String, String> filter, Sorting sorting) throws Exception { """ Gets the array of Dto instances from API. @param <T> Type on ...
java
protected <T extends Dto> List<T> getList(Class<T[]> classOfT, Class<T> classOfTItem, String methodKey, Pagination pagination, String entityId, String secondEntityId, Map<String, String> filter, Sorting sorting) throws Exception { String urlMethod = ""; if (entityId != null && entityId.length() > 0 &&...
[ "protected", "<", "T", "extends", "Dto", ">", "List", "<", "T", ">", "getList", "(", "Class", "<", "T", "[", "]", ">", "classOfT", ",", "Class", "<", "T", ">", "classOfTItem", ",", "String", "methodKey", ",", "Pagination", "pagination", ",", "String", ...
Gets the array of Dto instances from API. @param <T> Type on behalf of which the request is being called. @param classOfT Type on behalf of which the request is being called. @param methodKey Relevant method key. @param pagination Pagination object. @param entityId ...
[ "Gets", "the", "array", "of", "Dto", "instances", "from", "API", "." ]
train
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/APIs/ApiBase.java#L322-L351
phax/ph-datetime
ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java
AbstractHolidayParser._moveDate
private static LocalDate _moveDate (final MovingCondition aMoveCond, final LocalDate aDate) { """ Moves the date using the FixedMoving information @param aMoveCond @param aDate @return The moved date """ final DayOfWeek nWeekday = XMLHolidayHelper.getWeekday (aMoveCond.getWeekday ()); final int nD...
java
private static LocalDate _moveDate (final MovingCondition aMoveCond, final LocalDate aDate) { final DayOfWeek nWeekday = XMLHolidayHelper.getWeekday (aMoveCond.getWeekday ()); final int nDirection = aMoveCond.getWith () == With.NEXT ? 1 : -1; LocalDate aMovedDate = aDate; while (aMovedDate.getDayOfWe...
[ "private", "static", "LocalDate", "_moveDate", "(", "final", "MovingCondition", "aMoveCond", ",", "final", "LocalDate", "aDate", ")", "{", "final", "DayOfWeek", "nWeekday", "=", "XMLHolidayHelper", ".", "getWeekday", "(", "aMoveCond", ".", "getWeekday", "(", ")", ...
Moves the date using the FixedMoving information @param aMoveCond @param aDate @return The moved date
[ "Moves", "the", "date", "using", "the", "FixedMoving", "information" ]
train
https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/parser/AbstractHolidayParser.java#L139-L150
wildfly/wildfly-core
controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java
TransformerRegistry.getDomainRegistration
public TransformersSubRegistration getDomainRegistration(final ModelVersionRange range) { """ Get the sub registry for the domain. @param range the version range @return the sub registry """ final PathAddress address = PathAddress.EMPTY_ADDRESS; return new TransformersSubRegistrationImpl(ra...
java
public TransformersSubRegistration getDomainRegistration(final ModelVersionRange range) { final PathAddress address = PathAddress.EMPTY_ADDRESS; return new TransformersSubRegistrationImpl(range, domain, address); }
[ "public", "TransformersSubRegistration", "getDomainRegistration", "(", "final", "ModelVersionRange", "range", ")", "{", "final", "PathAddress", "address", "=", "PathAddress", ".", "EMPTY_ADDRESS", ";", "return", "new", "TransformersSubRegistrationImpl", "(", "range", ",",...
Get the sub registry for the domain. @param range the version range @return the sub registry
[ "Get", "the", "sub", "registry", "for", "the", "domain", "." ]
train
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/TransformerRegistry.java#L163-L166
google/gwtmockito
gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java
StubGenerator.shouldStub
public static boolean shouldStub(CtMethod method, Collection<Class<?>> classesToStub) { """ Returns whether the behavior of the given method should be replaced. """ // Stub any methods for which we have given explicit implementations if (STUB_METHODS.containsKey(new ClassAndMethod( method.getDe...
java
public static boolean shouldStub(CtMethod method, Collection<Class<?>> classesToStub) { // Stub any methods for which we have given explicit implementations if (STUB_METHODS.containsKey(new ClassAndMethod( method.getDeclaringClass().getName(), method.getName()))) { return true; } // Stub ...
[ "public", "static", "boolean", "shouldStub", "(", "CtMethod", "method", ",", "Collection", "<", "Class", "<", "?", ">", ">", "classesToStub", ")", "{", "// Stub any methods for which we have given explicit implementations", "if", "(", "STUB_METHODS", ".", "containsKey",...
Returns whether the behavior of the given method should be replaced.
[ "Returns", "whether", "the", "behavior", "of", "the", "given", "method", "should", "be", "replaced", "." ]
train
https://github.com/google/gwtmockito/blob/e886a9b9d290169b5f83582dd89b7545c5f198a2/gwtmockito/src/main/java/com/google/gwtmockito/impl/StubGenerator.java#L76-L96
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/font/MalisisFont.java
MalisisFont.getCharPosition
public float getCharPosition(String str, FontOptions options, int position, int charOffset) { """ Determines the character for a given X coordinate. @param str the str @param options the options @param position the position @param charOffset the char offset @return position """ if (StringUtils.isEmpty...
java
public float getCharPosition(String str, FontOptions options, int position, int charOffset) { if (StringUtils.isEmpty(str)) return 0; str = processString(str, options); //float fx = position / (fro != null ? fro.fontScale : 1); //factor the position instead of the char widths StringWalker walker = new Str...
[ "public", "float", "getCharPosition", "(", "String", "str", ",", "FontOptions", "options", ",", "int", "position", ",", "int", "charOffset", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "str", ")", ")", "return", "0", ";", "str", "=", "proces...
Determines the character for a given X coordinate. @param str the str @param options the options @param position the position @param charOffset the char offset @return position
[ "Determines", "the", "character", "for", "a", "given", "X", "coordinate", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/MalisisFont.java#L554-L566
geomajas/geomajas-project-client-gwt
common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java
HtmlBuilder.tdClass
public static String tdClass(String clazz, String... content) { """ Build a HTML TableRow with given CSS class for a string. Given content does <b>not</b> consists of HTML snippets and as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}. @param clazz class for tr element @param content cont...
java
public static String tdClass(String clazz, String... content) { return tagClass(Html.Tag.TD, clazz, content); }
[ "public", "static", "String", "tdClass", "(", "String", "clazz", ",", "String", "...", "content", ")", "{", "return", "tagClass", "(", "Html", ".", "Tag", ".", "TD", ",", "clazz", ",", "content", ")", ";", "}" ]
Build a HTML TableRow with given CSS class for a string. Given content does <b>not</b> consists of HTML snippets and as such is being prepared with {@link HtmlBuilder#htmlEncode(String)}. @param clazz class for tr element @param content content string @return HTML tr element as string
[ "Build", "a", "HTML", "TableRow", "with", "given", "CSS", "class", "for", "a", "string", ".", "Given", "content", "does", "<b", ">", "not<", "/", "b", ">", "consists", "of", "HTML", "snippets", "and", "as", "such", "is", "being", "prepared", "with", "{...
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L190-L192
languagetool-org/languagetool
languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java
SpellingCheckRule.ignoreWord
protected boolean ignoreWord(String word) throws IOException { """ Returns true iff the word should be ignored by the spell checker. If possible, use {@link #ignoreToken(AnalyzedTokenReadings[], int)} instead. """ if (!considerIgnoreWords) { return false; } if (word.endsWith(".") && !wordsTo...
java
protected boolean ignoreWord(String word) throws IOException { if (!considerIgnoreWords) { return false; } if (word.endsWith(".") && !wordsToBeIgnored.contains(word)) { return isIgnoredNoCase(word.substring(0, word.length()-1)); // e.g. word at end of sentence } return isIgnoredNoCase(w...
[ "protected", "boolean", "ignoreWord", "(", "String", "word", ")", "throws", "IOException", "{", "if", "(", "!", "considerIgnoreWords", ")", "{", "return", "false", ";", "}", "if", "(", "word", ".", "endsWith", "(", "\".\"", ")", "&&", "!", "wordsToBeIgnore...
Returns true iff the word should be ignored by the spell checker. If possible, use {@link #ignoreToken(AnalyzedTokenReadings[], int)} instead.
[ "Returns", "true", "iff", "the", "word", "should", "be", "ignored", "by", "the", "spell", "checker", ".", "If", "possible", "use", "{" ]
train
https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/spelling/SpellingCheckRule.java#L270-L278
google/truth
core/src/main/java/com/google/common/truth/MultimapSubject.java
MultimapSubject.containsExactlyEntriesIn
@CanIgnoreReturnValue public Ordered containsExactlyEntriesIn(Multimap<?, ?> expectedMultimap) { """ Fails if the {@link Multimap} does not contain precisely the same entries as the argument {@link Multimap}. <p>A subsequent call to {@link Ordered#inOrder} may be made if the caller wishes to verify that the...
java
@CanIgnoreReturnValue public Ordered containsExactlyEntriesIn(Multimap<?, ?> expectedMultimap) { checkNotNull(expectedMultimap, "expectedMultimap"); ListMultimap<?, ?> missing = difference(expectedMultimap, actual()); ListMultimap<?, ?> extra = difference(actual(), expectedMultimap); // TODO(kak): Po...
[ "@", "CanIgnoreReturnValue", "public", "Ordered", "containsExactlyEntriesIn", "(", "Multimap", "<", "?", ",", "?", ">", "expectedMultimap", ")", "{", "checkNotNull", "(", "expectedMultimap", ",", "\"expectedMultimap\"", ")", ";", "ListMultimap", "<", "?", ",", "?"...
Fails if the {@link Multimap} does not contain precisely the same entries as the argument {@link Multimap}. <p>A subsequent call to {@link Ordered#inOrder} may be made if the caller wishes to verify that the two multimaps iterate fully in the same order. That is, their key sets iterate in the same order, and the value...
[ "Fails", "if", "the", "{", "@link", "Multimap", "}", "does", "not", "contain", "precisely", "the", "same", "entries", "as", "the", "argument", "{", "@link", "Multimap", "}", "." ]
train
https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MultimapSubject.java#L205-L254
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
StreamExecutionEnvironment.createLocalEnvironment
public static LocalStreamEnvironment createLocalEnvironment(int parallelism, Configuration configuration) { """ Creates a {@link LocalStreamEnvironment}. The local execution environment will run the program in a multi-threaded fashion in the same JVM as the environment was created in. It will use the parallelism...
java
public static LocalStreamEnvironment createLocalEnvironment(int parallelism, Configuration configuration) { final LocalStreamEnvironment currentEnvironment; currentEnvironment = new LocalStreamEnvironment(configuration); currentEnvironment.setParallelism(parallelism); return currentEnvironment; }
[ "public", "static", "LocalStreamEnvironment", "createLocalEnvironment", "(", "int", "parallelism", ",", "Configuration", "configuration", ")", "{", "final", "LocalStreamEnvironment", "currentEnvironment", ";", "currentEnvironment", "=", "new", "LocalStreamEnvironment", "(", ...
Creates a {@link LocalStreamEnvironment}. The local execution environment will run the program in a multi-threaded fashion in the same JVM as the environment was created in. It will use the parallelism specified in the parameter. @param parallelism The parallelism for the local environment. @param configuration Pass a...
[ "Creates", "a", "{", "@link", "LocalStreamEnvironment", "}", ".", "The", "local", "execution", "environment", "will", "run", "the", "program", "in", "a", "multi", "-", "threaded", "fashion", "in", "the", "same", "JVM", "as", "the", "environment", "was", "cre...
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1628-L1635
graphhopper/graphhopper
core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java
GraphEdgeIdFinder.findClosestEdge
public void findClosestEdge(GHIntHashSet edgeIds, double lat, double lon, EdgeFilter filter) { """ This method fills the edgeIds hash with edgeIds found close (exact match) to the specified lat,lon """ QueryResult qr = locationIndex.findClosest(lat, lon, filter); if (qr.isValid()) e...
java
public void findClosestEdge(GHIntHashSet edgeIds, double lat, double lon, EdgeFilter filter) { QueryResult qr = locationIndex.findClosest(lat, lon, filter); if (qr.isValid()) edgeIds.add(qr.getClosestEdge().getEdge()); }
[ "public", "void", "findClosestEdge", "(", "GHIntHashSet", "edgeIds", ",", "double", "lat", ",", "double", "lon", ",", "EdgeFilter", "filter", ")", "{", "QueryResult", "qr", "=", "locationIndex", ".", "findClosest", "(", "lat", ",", "lon", ",", "filter", ")",...
This method fills the edgeIds hash with edgeIds found close (exact match) to the specified lat,lon
[ "This", "method", "fills", "the", "edgeIds", "hash", "with", "edgeIds", "found", "close", "(", "exact", "match", ")", "to", "the", "specified", "lat", "lon" ]
train
https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java#L62-L66
dlemmermann/CalendarFX
CalendarFXView/src/main/java/com/calendarfx/model/Interval.java
Interval.withStartDate
public Interval withStartDate(LocalDate date) { """ Returns a new interval based on this interval but with a different start date. @param date the new start date @return a new interval """ requireNonNull(date); return new Interval(date, startTime, endDate, endTime, zoneId); }
java
public Interval withStartDate(LocalDate date) { requireNonNull(date); return new Interval(date, startTime, endDate, endTime, zoneId); }
[ "public", "Interval", "withStartDate", "(", "LocalDate", "date", ")", "{", "requireNonNull", "(", "date", ")", ";", "return", "new", "Interval", "(", "date", ",", "startTime", ",", "endDate", ",", "endTime", ",", "zoneId", ")", ";", "}" ]
Returns a new interval based on this interval but with a different start date. @param date the new start date @return a new interval
[ "Returns", "a", "new", "interval", "based", "on", "this", "interval", "but", "with", "a", "different", "start", "date", "." ]
train
https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L319-L322
tvesalainen/util
util/src/main/java/org/vesalainen/nio/RingBuffer.java
RingBuffer.writeTo
protected int writeTo(SparseBufferOperator<B> op, Splitter<SparseBufferOperator<B>> splitter, int start, int length) throws IOException { """ Write buffers content from start @param op @param splitter @param start @param length @return @throws IOException """ return splitter.split(op, start, len...
java
protected int writeTo(SparseBufferOperator<B> op, Splitter<SparseBufferOperator<B>> splitter, int start, int length) throws IOException { return splitter.split(op, start, length); }
[ "protected", "int", "writeTo", "(", "SparseBufferOperator", "<", "B", ">", "op", ",", "Splitter", "<", "SparseBufferOperator", "<", "B", ">", ">", "splitter", ",", "int", "start", ",", "int", "length", ")", "throws", "IOException", "{", "return", "splitter",...
Write buffers content from start @param op @param splitter @param start @param length @return @throws IOException
[ "Write", "buffers", "content", "from", "start" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/RingBuffer.java#L283-L286
googleapis/google-cloud-java
google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreHelper.java
DatastoreHelper.fetch
static List<Entity> fetch(Datastore reader, Key[] keys, ReadOption... options) { """ Returns a list with a value for each given key (ordered by input). {@code null} values are returned for nonexistent keys. """ return compileEntities(keys, reader.get(Arrays.asList(keys), options)); }
java
static List<Entity> fetch(Datastore reader, Key[] keys, ReadOption... options) { return compileEntities(keys, reader.get(Arrays.asList(keys), options)); }
[ "static", "List", "<", "Entity", ">", "fetch", "(", "Datastore", "reader", ",", "Key", "[", "]", "keys", ",", "ReadOption", "...", "options", ")", "{", "return", "compileEntities", "(", "keys", ",", "reader", ".", "get", "(", "Arrays", ".", "asList", "...
Returns a list with a value for each given key (ordered by input). {@code null} values are returned for nonexistent keys.
[ "Returns", "a", "list", "with", "a", "value", "for", "each", "given", "key", "(", "ordered", "by", "input", ")", ".", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/DatastoreHelper.java#L72-L74
raydac/java-binary-block-parser
jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java
JBBPUtils.splitString
public static String[] splitString(final String str, final char splitChar) { """ Split a string for a char used as the delimeter. @param str a string to be split @param splitChar a char to be used as delimeter @return array contains split string parts without delimeter chars """ final int length...
java
public static String[] splitString(final String str, final char splitChar) { final int length = str.length(); final StringBuilder bulder = new StringBuilder(Math.max(8, length)); int counter = 1; for (int i = 0; i < length; i++) { if (str.charAt(i) == splitChar) { counter++; } }...
[ "public", "static", "String", "[", "]", "splitString", "(", "final", "String", "str", ",", "final", "char", "splitChar", ")", "{", "final", "int", "length", "=", "str", ".", "length", "(", ")", ";", "final", "StringBuilder", "bulder", "=", "new", "String...
Split a string for a char used as the delimeter. @param str a string to be split @param splitChar a char to be used as delimeter @return array contains split string parts without delimeter chars
[ "Split", "a", "string", "for", "a", "char", "used", "as", "the", "delimeter", "." ]
train
https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L441-L469
soarcn/COCOQuery
query/src/main/java/com/cocosw/query/AbstractViewQuery.java
AbstractViewQuery.animate
public T animate(int animId, Animation.AnimationListener listener) { """ Starts an animation on the view. <p/> <br> contributed by: marcosbeirigo @param animId Id of the desired animation. @param listener The listener to recieve notifications from the animation on its events. @return self """ ...
java
public T animate(int animId, Animation.AnimationListener listener) { Animation anim = AnimationUtils.loadAnimation(context, animId); anim.setAnimationListener(listener); return animate(anim); }
[ "public", "T", "animate", "(", "int", "animId", ",", "Animation", ".", "AnimationListener", "listener", ")", "{", "Animation", "anim", "=", "AnimationUtils", ".", "loadAnimation", "(", "context", ",", "animId", ")", ";", "anim", ".", "setAnimationListener", "(...
Starts an animation on the view. <p/> <br> contributed by: marcosbeirigo @param animId Id of the desired animation. @param listener The listener to recieve notifications from the animation on its events. @return self
[ "Starts", "an", "animation", "on", "the", "view", ".", "<p", "/", ">", "<br", ">", "contributed", "by", ":", "marcosbeirigo" ]
train
https://github.com/soarcn/COCOQuery/blob/712eac37ab65ef3dbdf55dbfae28750edfc36608/query/src/main/java/com/cocosw/query/AbstractViewQuery.java#L884-L888
alibaba/jstorm
jstorm-core/src/main/java/backtype/storm/state/StateFactory.java
StateFactory.getState
public static State getState(String namespace, Map stormConf, TopologyContext context) { """ Returns a new state instance using the {@link Config#TOPOLOGY_STATE_PROVIDER} or a {@link InMemoryKeyValueState} if no provider is configured. @param namespace the state namespace @param stormConf the storm conf @par...
java
public static State getState(String namespace, Map stormConf, TopologyContext context) { State state; try { String provider; if (stormConf.containsKey(Config.TOPOLOGY_STATE_PROVIDER)) { provider = (String) stormConf.get(Config.TOPOLOGY_STATE_PROVIDER); ...
[ "public", "static", "State", "getState", "(", "String", "namespace", ",", "Map", "stormConf", ",", "TopologyContext", "context", ")", "{", "State", "state", ";", "try", "{", "String", "provider", ";", "if", "(", "stormConf", ".", "containsKey", "(", "Config"...
Returns a new state instance using the {@link Config#TOPOLOGY_STATE_PROVIDER} or a {@link InMemoryKeyValueState} if no provider is configured. @param namespace the state namespace @param stormConf the storm conf @param context the topology context @return the state instance
[ "Returns", "a", "new", "state", "instance", "using", "the", "{", "@link", "Config#TOPOLOGY_STATE_PROVIDER", "}", "or", "a", "{", "@link", "InMemoryKeyValueState", "}", "if", "no", "provider", "is", "configured", "." ]
train
https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/state/StateFactory.java#L45-L69
pravega/pravega
common/src/main/java/io/pravega/common/concurrent/Futures.java
Futures.futureWithTimeout
public static <T> CompletableFuture<T> futureWithTimeout(Duration timeout, ScheduledExecutorService executorService) { """ Creates a new CompletableFuture that will timeout after the given amount of time. @param timeout The timeout for the future. @param executorService An ExecutorService that will be ...
java
public static <T> CompletableFuture<T> futureWithTimeout(Duration timeout, ScheduledExecutorService executorService) { return futureWithTimeout(timeout, null, executorService); }
[ "public", "static", "<", "T", ">", "CompletableFuture", "<", "T", ">", "futureWithTimeout", "(", "Duration", "timeout", ",", "ScheduledExecutorService", "executorService", ")", "{", "return", "futureWithTimeout", "(", "timeout", ",", "null", ",", "executorService", ...
Creates a new CompletableFuture that will timeout after the given amount of time. @param timeout The timeout for the future. @param executorService An ExecutorService that will be used to invoke the timeout on. @param <T> The Type argument for the CompletableFuture to create. @return A CompletableF...
[ "Creates", "a", "new", "CompletableFuture", "that", "will", "timeout", "after", "the", "given", "amount", "of", "time", "." ]
train
https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/Futures.java#L470-L472
mozilla/rhino
src/org/mozilla/javascript/ScriptableObject.java
ScriptableObject.get
@Override public Object get(int index, Scriptable start) { """ Returns the value of the indexed property or NOT_FOUND. @param index the numeric index for the property @param start the object in which the lookup began @return the value of the property (may be null), or NOT_FOUND """ if (externa...
java
@Override public Object get(int index, Scriptable start) { if (externalData != null) { if (index < externalData.getArrayLength()) { return externalData.getArrayElement(index); } return Scriptable.NOT_FOUND; } Slot slot = slotMap.query(...
[ "@", "Override", "public", "Object", "get", "(", "int", "index", ",", "Scriptable", "start", ")", "{", "if", "(", "externalData", "!=", "null", ")", "{", "if", "(", "index", "<", "externalData", ".", "getArrayLength", "(", ")", ")", "{", "return", "ext...
Returns the value of the indexed property or NOT_FOUND. @param index the numeric index for the property @param start the object in which the lookup began @return the value of the property (may be null), or NOT_FOUND
[ "Returns", "the", "value", "of", "the", "indexed", "property", "or", "NOT_FOUND", "." ]
train
https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L473-L488
box/box-java-sdk
src/main/java/com/box/sdk/BoxJSONObject.java
BoxJSONObject.addPendingChange
void addPendingChange(String key, String value) { """ Adds a pending field change that needs to be sent to the API. It will be included in the JSON string the next time {@link #getPendingChanges} is called. @param key the name of the field. @param value the new String value of the field. """ this....
java
void addPendingChange(String key, String value) { this.addPendingChange(key, JsonValue.valueOf(value)); }
[ "void", "addPendingChange", "(", "String", "key", ",", "String", "value", ")", "{", "this", ".", "addPendingChange", "(", "key", ",", "JsonValue", ".", "valueOf", "(", "value", ")", ")", ";", "}" ]
Adds a pending field change that needs to be sent to the API. It will be included in the JSON string the next time {@link #getPendingChanges} is called. @param key the name of the field. @param value the new String value of the field.
[ "Adds", "a", "pending", "field", "change", "that", "needs", "to", "be", "sent", "to", "the", "API", ".", "It", "will", "be", "included", "in", "the", "JSON", "string", "the", "next", "time", "{" ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxJSONObject.java#L117-L119
gosu-lang/gosu-lang
gosu-core-api/src/main/java/gw/util/perf/objectsize/ObjectSizeUtil.java
ObjectSizeUtil.deepSizeOf
public static ObjectSize deepSizeOf(Object obj, IObjectSizeFilter filter, int maxObjects) { """ Calculates full size of object iterating over its hierarchy graph. @param obj object to calculate size of @param filter the filter used to ignore fields or objects @param maxObjects the max numbers of objects to tr...
java
public static ObjectSize deepSizeOf(Object obj, IObjectSizeFilter filter, int maxObjects) { Map<Object, Object> visited = new IdentityHashMap<Object, Object>(); Stack<ObjectEntry> stack = new Stack<ObjectEntry>(); InvocationCounter sizeHistogram = new InvocationCounter(false); long result = interna...
[ "public", "static", "ObjectSize", "deepSizeOf", "(", "Object", "obj", ",", "IObjectSizeFilter", "filter", ",", "int", "maxObjects", ")", "{", "Map", "<", "Object", ",", "Object", ">", "visited", "=", "new", "IdentityHashMap", "<", "Object", ",", "Object", ">...
Calculates full size of object iterating over its hierarchy graph. @param obj object to calculate size of @param filter the filter used to ignore fields or objects @param maxObjects the max numbers of objects to traverse @return object size @throws Exception
[ "Calculates", "full", "size", "of", "object", "iterating", "over", "its", "hierarchy", "graph", "." ]
train
https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/perf/objectsize/ObjectSizeUtil.java#L57-L84
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/openwatcom/OpenWatcomCompiler.java
OpenWatcomCompiler.getUndefineSwitch
@Override protected final void getUndefineSwitch(final StringBuffer buffer, final String define) { """ Get undefine switch. @param buffer StringBuffer argument destination @param define String preprocessor macro """ OpenWatcomProcessor.getUndefineSwitch(buffer, define); }
java
@Override protected final void getUndefineSwitch(final StringBuffer buffer, final String define) { OpenWatcomProcessor.getUndefineSwitch(buffer, define); }
[ "@", "Override", "protected", "final", "void", "getUndefineSwitch", "(", "final", "StringBuffer", "buffer", ",", "final", "String", "define", ")", "{", "OpenWatcomProcessor", ".", "getUndefineSwitch", "(", "buffer", ",", "define", ")", ";", "}" ]
Get undefine switch. @param buffer StringBuffer argument destination @param define String preprocessor macro
[ "Get", "undefine", "switch", "." ]
train
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/openwatcom/OpenWatcomCompiler.java#L190-L193
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java
ClassUseWriter.addPackageUse
protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { """ Add the package use information. @param pkg the package that uses the given class @param contentTree the content tree to which the package use information will be added """ Content tdFirst = HtmlTree.TD(HtmlS...
java
protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg)))); contentTree.addContent(tdFirst); HtmlTree tdLast = new HtmlTree(HtmlTag...
[ "protected", "void", "addPackageUse", "(", "PackageDoc", "pkg", ",", "Content", "contentTree", ")", "throws", "IOException", "{", "Content", "tdFirst", "=", "HtmlTree", ".", "TD", "(", "HtmlStyle", ".", "colFirst", ",", "getHyperLink", "(", "pkg", ".", "name",...
Add the package use information. @param pkg the package that uses the given class @param contentTree the content tree to which the package use information will be added
[ "Add", "the", "package", "use", "information", "." ]
train
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java#L361-L369
tango-controls/JTango
client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java
TypeConversionUtil.castToType
@SuppressWarnings("unchecked") public static <T> T castToType(final Class<T> type, final Object val) throws DevFailed { """ Convert an object to another object. @see Transmorph @param <T> @param type @param val @return @throws DevFailed """ T result; if (val == null) { result = null; } els...
java
@SuppressWarnings("unchecked") public static <T> T castToType(final Class<T> type, final Object val) throws DevFailed { T result; if (val == null) { result = null; } else if (type.isAssignableFrom(val.getClass())) { result = (T) val; } else { LOGGER.debug("converting {} to {}", val.getClass().ge...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "T", "castToType", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Object", "val", ")", "throws", "DevFailed", "{", "T", "result", ";", "if", "(", "val"...
Convert an object to another object. @see Transmorph @param <T> @param type @param val @return @throws DevFailed
[ "Convert", "an", "object", "to", "another", "object", "." ]
train
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/client/src/main/java/fr/soleil/tango/clientapi/util/TypeConversionUtil.java#L94-L121
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/Marshaller.java
Marshaller.createCompleteKey
private void createCompleteKey(Key parent, long id) { """ Creates a complete key using the given parameters. @param parent the parent key, may be <code>null</code>. @param id the numeric ID """ String kind = entityMetadata.getKind(); if (parent == null) { key = entityManager.newNativeKeyFac...
java
private void createCompleteKey(Key parent, long id) { String kind = entityMetadata.getKind(); if (parent == null) { key = entityManager.newNativeKeyFactory().setKind(kind).newKey(id); } else { key = Key.newBuilder(parent, kind, id).build(); } }
[ "private", "void", "createCompleteKey", "(", "Key", "parent", ",", "long", "id", ")", "{", "String", "kind", "=", "entityMetadata", ".", "getKind", "(", ")", ";", "if", "(", "parent", "==", "null", ")", "{", "key", "=", "entityManager", ".", "newNativeKe...
Creates a complete key using the given parameters. @param parent the parent key, may be <code>null</code>. @param id the numeric ID
[ "Creates", "a", "complete", "key", "using", "the", "given", "parameters", "." ]
train
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Marshaller.java#L349-L356
beanshell/beanshell
src/main/java/bsh/ClassGenerator.java
ClassGenerator.invokeSuperclassMethod
public Object invokeSuperclassMethod(BshClassManager bcm, Object instance, String methodName, Object[] args) throws UtilEvalError, ReflectError, InvocationTargetException { """ Invoke a super.method() style superclass method on an object instance. This is not a normal function of the Java reflection API and is p...
java
public Object invokeSuperclassMethod(BshClassManager bcm, Object instance, String methodName, Object[] args) throws UtilEvalError, ReflectError, InvocationTargetException { // Delegate to the static method return invokeSuperclassMethodImpl(bcm, instance, methodName, args); }
[ "public", "Object", "invokeSuperclassMethod", "(", "BshClassManager", "bcm", ",", "Object", "instance", ",", "String", "methodName", ",", "Object", "[", "]", "args", ")", "throws", "UtilEvalError", ",", "ReflectError", ",", "InvocationTargetException", "{", "// Dele...
Invoke a super.method() style superclass method on an object instance. This is not a normal function of the Java reflection API and is provided by generated class accessor methods.
[ "Invoke", "a", "super", ".", "method", "()", "style", "superclass", "method", "on", "an", "object", "instance", ".", "This", "is", "not", "a", "normal", "function", "of", "the", "Java", "reflection", "API", "and", "is", "provided", "by", "generated", "clas...
train
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/ClassGenerator.java#L63-L66
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier_nslimitsessions_binding.java
nslimitidentifier_nslimitsessions_binding.count_filtered
public static long count_filtered(nitro_service service, String limitidentifier, String filter) throws Exception { """ Use this API to count the filtered set of nslimitidentifier_nslimitsessions_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP". """ nslimitidentifier_n...
java
public static long count_filtered(nitro_service service, String limitidentifier, String filter) throws Exception{ nslimitidentifier_nslimitsessions_binding obj = new nslimitidentifier_nslimitsessions_binding(); obj.set_limitidentifier(limitidentifier); options option = new options(); option.set_count(true); o...
[ "public", "static", "long", "count_filtered", "(", "nitro_service", "service", ",", "String", "limitidentifier", ",", "String", "filter", ")", "throws", "Exception", "{", "nslimitidentifier_nslimitsessions_binding", "obj", "=", "new", "nslimitidentifier_nslimitsessions_bind...
Use this API to count the filtered set of nslimitidentifier_nslimitsessions_binding resources. filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
[ "Use", "this", "API", "to", "count", "the", "filtered", "set", "of", "nslimitidentifier_nslimitsessions_binding", "resources", ".", "filter", "string", "should", "be", "in", "JSON", "format", ".", "eg", ":", "port", ":", "80", "servicetype", ":", "HTTP", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nslimitidentifier_nslimitsessions_binding.java#L145-L156
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java
Transliterator.getDisplayName
public final static String getDisplayName(String ID) { """ Returns a name for this transliterator that is appropriate for display to the user in the default <code>DISPLAY</code> locale. See {@link #getDisplayName(String,Locale)} for details. @see android.icu.util.ULocale.Category#DISPLAY """ return...
java
public final static String getDisplayName(String ID) { return getDisplayName(ID, ULocale.getDefault(Category.DISPLAY)); }
[ "public", "final", "static", "String", "getDisplayName", "(", "String", "ID", ")", "{", "return", "getDisplayName", "(", "ID", ",", "ULocale", ".", "getDefault", "(", "Category", ".", "DISPLAY", ")", ")", ";", "}" ]
Returns a name for this transliterator that is appropriate for display to the user in the default <code>DISPLAY</code> locale. See {@link #getDisplayName(String,Locale)} for details. @see android.icu.util.ULocale.Category#DISPLAY
[ "Returns", "a", "name", "for", "this", "transliterator", "that", "is", "appropriate", "for", "display", "to", "the", "user", "in", "the", "default", "<code", ">", "DISPLAY<", "/", "code", ">", "locale", ".", "See", "{" ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Transliterator.java#L1151-L1153
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java
TorrentInfo.mapFile
public PeerRequest mapFile(int file, long offset, int size) { """ This function will map a range in a specific file into a range in the torrent. The {@code offset} parameter is the offset in the file, given in bytes, where 0 is the start of the file. <p> The input range is assumed to be valid within the torren...
java
public PeerRequest mapFile(int file, long offset, int size) { return new PeerRequest(ti.map_file(file, offset, size)); }
[ "public", "PeerRequest", "mapFile", "(", "int", "file", ",", "long", "offset", ",", "int", "size", ")", "{", "return", "new", "PeerRequest", "(", "ti", ".", "map_file", "(", "file", ",", "offset", ",", "size", ")", ")", ";", "}" ]
This function will map a range in a specific file into a range in the torrent. The {@code offset} parameter is the offset in the file, given in bytes, where 0 is the start of the file. <p> The input range is assumed to be valid within the torrent. {@code offset + size} is not allowed to be greater than the file size. {...
[ "This", "function", "will", "map", "a", "range", "in", "a", "specific", "file", "into", "a", "range", "in", "the", "torrent", ".", "The", "{", "@code", "offset", "}", "parameter", "is", "the", "offset", "in", "the", "file", "given", "in", "bytes", "whe...
train
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/TorrentInfo.java#L435-L437
GumTreeDiff/gumtree
core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java
RtedAlgorithm.spfL
private double spfL(InfoTree it1, InfoTree it2) { """ Single-path function for the left-most path based on Zhang and Shasha algorithm. @param it1 @param it2 @return distance between subtrees it1 and it2 """ int fPostorder = it1.getCurrentNode(); int gPostorder = it2.getCurrentNode(); int minKR = ...
java
private double spfL(InfoTree it1, InfoTree it2) { int fPostorder = it1.getCurrentNode(); int gPostorder = it2.getCurrentNode(); int minKR = it2.info[POST2_MIN_KR][gPostorder]; int[] kr = it2.info[KR]; if (minKR > -1) { for (int j = minKR; kr[j] < gPostorder; j++) { treeEditDist(it1, it2, fPostorder, ...
[ "private", "double", "spfL", "(", "InfoTree", "it1", ",", "InfoTree", "it2", ")", "{", "int", "fPostorder", "=", "it1", ".", "getCurrentNode", "(", ")", ";", "int", "gPostorder", "=", "it2", ".", "getCurrentNode", "(", ")", ";", "int", "minKR", "=", "i...
Single-path function for the left-most path based on Zhang and Shasha algorithm. @param it1 @param it2 @return distance between subtrees it1 and it2
[ "Single", "-", "path", "function", "for", "the", "left", "-", "most", "path", "based", "on", "Zhang", "and", "Shasha", "algorithm", "." ]
train
https://github.com/GumTreeDiff/gumtree/blob/a772d4d652af44bff22c38a234ddffbfbd365a37/core/src/main/java/com/github/gumtreediff/matchers/optimal/rted/RtedAlgorithm.java#L432-L450
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.writeVint
public static int writeVint(byte[] dest, int offset, int i) { """ Writes a vInt directly to a byte array @param dest The destination array for the vInt to be written to @param offset The location where to write the vInt to @param i The Value being written into byte array @return Returns the new offset locati...
java
public static int writeVint(byte[] dest, int offset, int i) { if (i >= -112 && i <= 127) { dest[offset++] = (byte) i; } else { int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp = tmp >>...
[ "public", "static", "int", "writeVint", "(", "byte", "[", "]", "dest", ",", "int", "offset", ",", "int", "i", ")", "{", "if", "(", "i", ">=", "-", "112", "&&", "i", "<=", "127", ")", "{", "dest", "[", "offset", "++", "]", "=", "(", "byte", ")...
Writes a vInt directly to a byte array @param dest The destination array for the vInt to be written to @param offset The location where to write the vInt to @param i The Value being written into byte array @return Returns the new offset location
[ "Writes", "a", "vInt", "directly", "to", "a", "byte", "array" ]
train
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L145-L173
ckpoint/CheckPoint
src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java
MsgSettingController.updateValidationDataLists
@PostMapping("/setting/update/param/from/url") public void updateValidationDataLists(HttpServletRequest req, @RequestBody List<ValidationData> datas) { """ Update validation data lists. @param req the req @param datas the datas """ this.validationSessionComponent.sessionCheck(req); th...
java
@PostMapping("/setting/update/param/from/url") public void updateValidationDataLists(HttpServletRequest req, @RequestBody List<ValidationData> datas) { this.validationSessionComponent.sessionCheck(req); this.msgSettingService.updateValidationData(datas); }
[ "@", "PostMapping", "(", "\"/setting/update/param/from/url\"", ")", "public", "void", "updateValidationDataLists", "(", "HttpServletRequest", "req", ",", "@", "RequestBody", "List", "<", "ValidationData", ">", "datas", ")", "{", "this", ".", "validationSessionComponent"...
Update validation data lists. @param req the req @param datas the datas
[ "Update", "validation", "data", "lists", "." ]
train
https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/controller/MsgSettingController.java#L169-L173
spotify/helios
helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java
ZooKeeperMasterModel.getRunningMasters
@Override public List<String> getRunningMasters() { """ Returns a list of the host names of the currently running masters. """ final ZooKeeperClient client = provider.get("getRunningMasters"); try { final List<String> masters = client.getChildren(Paths.statusMaster()); final ImmutableList...
java
@Override public List<String> getRunningMasters() { final ZooKeeperClient client = provider.get("getRunningMasters"); try { final List<String> masters = client.getChildren(Paths.statusMaster()); final ImmutableList.Builder<String> upMasters = ImmutableList.builder(); for (final String master...
[ "@", "Override", "public", "List", "<", "String", ">", "getRunningMasters", "(", ")", "{", "final", "ZooKeeperClient", "client", "=", "provider", ".", "get", "(", "\"getRunningMasters\"", ")", ";", "try", "{", "final", "List", "<", "String", ">", "masters", ...
Returns a list of the host names of the currently running masters.
[ "Returns", "a", "list", "of", "the", "host", "names", "of", "the", "currently", "running", "masters", "." ]
train
https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/ZooKeeperMasterModel.java#L218-L233
undertow-io/undertow
core/src/main/java/io/undertow/websockets/core/WebSockets.java
WebSockets.sendClose
public static <T> void sendClose(final CloseMessage closeMessage, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) { """ Sends a complete close message, invoking the callback when complete @param closeMessage The close message @param wsChannel The web socket channel @param cal...
java
public static <T> void sendClose(final CloseMessage closeMessage, final WebSocketChannel wsChannel, final WebSocketCallback<T> callback, T context) { wsChannel.setCloseCode(closeMessage.getCode()); wsChannel.setCloseReason(closeMessage.getReason()); sendInternal(closeMessage.toByteBuffer(), WebS...
[ "public", "static", "<", "T", ">", "void", "sendClose", "(", "final", "CloseMessage", "closeMessage", ",", "final", "WebSocketChannel", "wsChannel", ",", "final", "WebSocketCallback", "<", "T", ">", "callback", ",", "T", "context", ")", "{", "wsChannel", ".", ...
Sends a complete close message, invoking the callback when complete @param closeMessage The close message @param wsChannel The web socket channel @param callback The callback to invoke on completion @param context The context object that will be passed to the callback on completion
[ "Sends", "a", "complete", "close", "message", "invoking", "the", "callback", "when", "complete" ]
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L853-L857
apollographql/apollo-android
apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java
ResponseField.forString
public static ResponseField forString(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { """ Factory method for creating a Field instance representing {@link Type#STRING}. @param responseName alias for the result of a field @param fieldNa...
java
public static ResponseField forString(String responseName, String fieldName, Map<String, Object> arguments, boolean optional, List<Condition> conditions) { return new ResponseField(Type.STRING, responseName, fieldName, arguments, optional, conditions); }
[ "public", "static", "ResponseField", "forString", "(", "String", "responseName", ",", "String", "fieldName", ",", "Map", "<", "String", ",", "Object", ">", "arguments", ",", "boolean", "optional", ",", "List", "<", "Condition", ">", "conditions", ")", "{", "...
Factory method for creating a Field instance representing {@link Type#STRING}. @param responseName alias for the result of a field @param fieldName name of the field in the GraphQL operation @param arguments arguments to be passed along with the field @param optional whether the arguments passed along are op...
[ "Factory", "method", "for", "creating", "a", "Field", "instance", "representing", "{", "@link", "Type#STRING", "}", "." ]
train
https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java#L40-L43
wwadge/bonecp
bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java
MemorizeTransactionProxy.memorize
protected static Connection memorize(final Connection target, final ConnectionHandle connectionHandle) { """ Wrap connection with a proxy. @param target connection handle @param connectionHandle originating bonecp connection @return Proxy to a connection. """ return (Connection) Proxy.newProxyInstance( ...
java
protected static Connection memorize(final Connection target, final ConnectionHandle connectionHandle) { return (Connection) Proxy.newProxyInstance( ConnectionProxy.class.getClassLoader(), new Class[] {ConnectionProxy.class}, new MemorizeTransactionProxy(target, connectionHandle)); }
[ "protected", "static", "Connection", "memorize", "(", "final", "Connection", "target", ",", "final", "ConnectionHandle", "connectionHandle", ")", "{", "return", "(", "Connection", ")", "Proxy", ".", "newProxyInstance", "(", "ConnectionProxy", ".", "class", ".", "g...
Wrap connection with a proxy. @param target connection handle @param connectionHandle originating bonecp connection @return Proxy to a connection.
[ "Wrap", "connection", "with", "a", "proxy", "." ]
train
https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java#L79-L85
groupon/odo
client/src/main/java/com/groupon/odo/client/Client.java
Client.setMethodArguments
public boolean setMethodArguments(String pathName, String methodName, Integer ordinal, Object... arguments) { """ Set the method arguments for an enabled method override @param pathName Path name @param methodName Fully qualified method name @param ordinal 1-based index of the override within the overrides of...
java
public boolean setMethodArguments(String pathName, String methodName, Integer ordinal, Object... arguments) { try { BasicNameValuePair[] params = new BasicNameValuePair[arguments.length + 2]; int x = 0; for (Object argument : arguments) { params[x] = new Basic...
[ "public", "boolean", "setMethodArguments", "(", "String", "pathName", ",", "String", "methodName", ",", "Integer", "ordinal", ",", "Object", "...", "arguments", ")", "{", "try", "{", "BasicNameValuePair", "[", "]", "params", "=", "new", "BasicNameValuePair", "["...
Set the method arguments for an enabled method override @param pathName Path name @param methodName Fully qualified method name @param ordinal 1-based index of the override within the overrides of type methodName @param arguments Array of arguments to set(specify all arguments) @return true if success, false otherwise
[ "Set", "the", "method", "arguments", "for", "an", "enabled", "method", "override" ]
train
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L704-L723
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDefinitionOptionRelUtil.java
CPDefinitionOptionRelUtil.findByUUID_G
public static CPDefinitionOptionRel findByUUID_G(String uuid, long groupId) throws com.liferay.commerce.product.exception.NoSuchCPDefinitionOptionRelException { """ Returns the cp definition option rel where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchCPDefinitionOptionRelException} if it could not...
java
public static CPDefinitionOptionRel findByUUID_G(String uuid, long groupId) throws com.liferay.commerce.product.exception.NoSuchCPDefinitionOptionRelException { return getPersistence().findByUUID_G(uuid, groupId); }
[ "public", "static", "CPDefinitionOptionRel", "findByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "exception", ".", "NoSuchCPDefinitionOptionRelException", "{", "return", "getPersi...
Returns the cp definition option rel where uuid = &#63; and groupId = &#63; or throws a {@link NoSuchCPDefinitionOptionRelException} if it could not be found. @param uuid the uuid @param groupId the group ID @return the matching cp definition option rel @throws NoSuchCPDefinitionOptionRelException if a matching cp def...
[ "Returns", "the", "cp", "definition", "option", "rel", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "or", "throws", "a", "{", "@link", "NoSuchCPDefinitionOptionRelException", "}", "if", "it", "could", "not", "be", "found", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDefinitionOptionRelUtil.java#L283-L286
Azure/azure-sdk-for-java
network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java
VpnConnectionsInner.createOrUpdateAsync
public Observable<VpnConnectionInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { """ Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @param resourceGroupName T...
java
public Observable<VpnConnectionInner> createOrUpdateAsync(String resourceGroupName, String gatewayName, String connectionName, VpnConnectionInner vpnConnectionParameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName, vpnConnectionParameters).map(new Func1<Servic...
[ "public", "Observable", "<", "VpnConnectionInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "gatewayName", ",", "String", "connectionName", ",", "VpnConnectionInner", "vpnConnectionParameters", ")", "{", "return", "createOrUpdateWithSer...
Creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing connection. @param resourceGroupName The resource group name of the VpnGateway. @param gatewayName The name of the gateway. @param connectionName The name of the connection. @param vpnConnectionParameters Parameters suppli...
[ "Creates", "a", "vpn", "connection", "to", "a", "scalable", "vpn", "gateway", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "connection", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L226-L233
javalite/activejdbc
activejdbc/src/main/java/org/javalite/activejdbc/Base.java
Base.execInsert
static Object execInsert(String query, String autoIncrementColumnName, Object... params) { """ This method is specific for inserts. @param query SQL for inserts. @param autoIncrementColumnName name of a column that is auto-incremented. @param params list of parameter values. @return new value of auto-increme...
java
static Object execInsert(String query, String autoIncrementColumnName, Object... params) { return new DB(DB.DEFAULT_NAME).execInsert(query, autoIncrementColumnName, params); }
[ "static", "Object", "execInsert", "(", "String", "query", ",", "String", "autoIncrementColumnName", ",", "Object", "...", "params", ")", "{", "return", "new", "DB", "(", "DB", ".", "DEFAULT_NAME", ")", ".", "execInsert", "(", "query", ",", "autoIncrementColumn...
This method is specific for inserts. @param query SQL for inserts. @param autoIncrementColumnName name of a column that is auto-incremented. @param params list of parameter values. @return new value of auto-incremented column that is uniquely identifying a new record inserted. May return -1 if this functionality is no...
[ "This", "method", "is", "specific", "for", "inserts", "." ]
train
https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Base.java#L293-L295
anotheria/configureme
src/main/java/org/configureme/environments/LocaleBasedEnvironment.java
LocaleBasedEnvironment.reduceVariant
private static String reduceVariant(final String variant) { """ This function is used internally to reduce the variant -> a_b_c -> a_b. @param variant the variant to reduce @return reduced variant """ if (isEmpty(variant)) throw new AssertionError("Shouldn't happen, can't reduce non existent variant"); ...
java
private static String reduceVariant(final String variant){ if (isEmpty(variant)) throw new AssertionError("Shouldn't happen, can't reduce non existent variant"); int indexOfUnderscore = variant.lastIndexOf('_'); if (indexOfUnderscore==-1) return ""; return variant.substring(0, indexOfUnderscore); }
[ "private", "static", "String", "reduceVariant", "(", "final", "String", "variant", ")", "{", "if", "(", "isEmpty", "(", "variant", ")", ")", "throw", "new", "AssertionError", "(", "\"Shouldn't happen, can't reduce non existent variant\"", ")", ";", "int", "indexOfUn...
This function is used internally to reduce the variant -> a_b_c -> a_b. @param variant the variant to reduce @return reduced variant
[ "This", "function", "is", "used", "internally", "to", "reduce", "the", "variant", "-", ">", "a_b_c", "-", ">", "a_b", "." ]
train
https://github.com/anotheria/configureme/blob/1f52dd9109349623190586bdf5a592de8016e1fa/src/main/java/org/configureme/environments/LocaleBasedEnvironment.java#L146-L154
VoltDB/voltdb
src/frontend/org/voltdb/RealVoltDB.java
RealVoltDB.validateBuildString
private Future<?> validateBuildString(final String buildString, ZooKeeper zk) { """ /* Validate the build string with the rest of the cluster by racing to publish it to ZK and then comparing the one this process has to the one in ZK. They should all match. The method returns a future so that init can continue ...
java
private Future<?> validateBuildString(final String buildString, ZooKeeper zk) { final SettableFuture<Object> retval = SettableFuture.create(); byte buildStringBytes[] = null; try { buildStringBytes = buildString.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { ...
[ "private", "Future", "<", "?", ">", "validateBuildString", "(", "final", "String", "buildString", ",", "ZooKeeper", "zk", ")", "{", "final", "SettableFuture", "<", "Object", ">", "retval", "=", "SettableFuture", ".", "create", "(", ")", ";", "byte", "buildSt...
/* Validate the build string with the rest of the cluster by racing to publish it to ZK and then comparing the one this process has to the one in ZK. They should all match. The method returns a future so that init can continue while the ZK call is pending since it ZK is pretty slow.
[ "/", "*", "Validate", "the", "build", "string", "with", "the", "rest", "of", "the", "cluster", "by", "racing", "to", "publish", "it", "to", "ZK", "and", "then", "comparing", "the", "one", "this", "process", "has", "to", "the", "one", "in", "ZK", ".", ...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/RealVoltDB.java#L4845-L4892
rsocket/rsocket-java
rsocket-load-balancer/src/main/java/io/rsocket/client/LoadBalancedRSocketMono.java
LoadBalancedRSocketMono.updateAperture
private void updateAperture(int newValue, long now) { """ Update the aperture value and ensure its value stays in the right range. @param newValue new aperture value @param now time of the change (for rate limiting purposes) """ int previous = targetAperture; targetAperture = newValue; targetAp...
java
private void updateAperture(int newValue, long now) { int previous = targetAperture; targetAperture = newValue; targetAperture = Math.max(minAperture, targetAperture); int maxAperture = Math.min(this.maxAperture, activeSockets.size() + pool.poolSize()); targetAperture = Math.min(maxAperture, targetA...
[ "private", "void", "updateAperture", "(", "int", "newValue", ",", "long", "now", ")", "{", "int", "previous", "=", "targetAperture", ";", "targetAperture", "=", "newValue", ";", "targetAperture", "=", "Math", ".", "max", "(", "minAperture", ",", "targetApertur...
Update the aperture value and ensure its value stays in the right range. @param newValue new aperture value @param now time of the change (for rate limiting purposes)
[ "Update", "the", "aperture", "value", "and", "ensure", "its", "value", "stays", "in", "the", "right", "range", "." ]
train
https://github.com/rsocket/rsocket-java/blob/5101748fbd224ec86570351cebd24d079b63fbfc/rsocket-load-balancer/src/main/java/io/rsocket/client/LoadBalancedRSocketMono.java#L318-L334
ontop/ontop
mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TargetQueryRenderer.java
TargetQueryRenderer.getAbbreviatedName
private static String getAbbreviatedName(String uri, PrefixManager pm, boolean insideQuotes) { """ Prints the short form of the predicate (by omitting the complete URI and replacing it by a prefix name). """ return pm.getShortForm(uri, insideQuotes); }
java
private static String getAbbreviatedName(String uri, PrefixManager pm, boolean insideQuotes) { return pm.getShortForm(uri, insideQuotes); }
[ "private", "static", "String", "getAbbreviatedName", "(", "String", "uri", ",", "PrefixManager", "pm", ",", "boolean", "insideQuotes", ")", "{", "return", "pm", ".", "getShortForm", "(", "uri", ",", "insideQuotes", ")", ";", "}" ]
Prints the short form of the predicate (by omitting the complete URI and replacing it by a prefix name).
[ "Prints", "the", "short", "form", "of", "the", "predicate", "(", "by", "omitting", "the", "complete", "URI", "and", "replacing", "it", "by", "a", "prefix", "name", ")", "." ]
train
https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/core/src/main/java/it/unibz/inf/ontop/spec/mapping/serializer/TargetQueryRenderer.java#L94-L96
eclipse/xtext-extras
org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java
SignatureUtil.scanIdentifier
private static int scanIdentifier(String string, int start) { """ Scans the given string for an identifier starting at the given index and returns the index of the last character. Stop characters are: ";", ":", "&lt;", "&gt;", "/", ".". @param string the signature string @param start the 0-based character in...
java
private static int scanIdentifier(String string, int start) { // need a minimum 1 char if (start >= string.length()) { throw new IllegalArgumentException(); } int p = start; while (true) { char c = string.charAt(p); if (c == '<' || c == '>' || c == ':' || c == ';' || c == '.' || c == '/') { retur...
[ "private", "static", "int", "scanIdentifier", "(", "String", "string", ",", "int", "start", ")", "{", "// need a minimum 1 char", "if", "(", "start", ">=", "string", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";"...
Scans the given string for an identifier starting at the given index and returns the index of the last character. Stop characters are: ";", ":", "&lt;", "&gt;", "/", ".". @param string the signature string @param start the 0-based character index of the first character @return the 0-based character index of the last c...
[ "Scans", "the", "given", "string", "for", "an", "identifier", "starting", "at", "the", "given", "index", "and", "returns", "the", "index", "of", "the", "last", "character", ".", "Stop", "characters", "are", ":", ";", ":", "&lt", ";", "&gt", ";", "/", "...
train
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.common.types/src/org/eclipse/xtext/common/types/access/binary/asm/SignatureUtil.java#L336-L352
aws/aws-sdk-java
aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/MachineMetricFactory.java
MachineMetricFactory.fdMetricValues
private MetricValues fdMetricValues(Set<MachineMetric> customSet, List<Long> values) { """ Returns the set of file-descriptor metrics and the corresponding values based on the default and the customized set of metrics, if any. @param customSet a non-null customized set of metrics @param values a...
java
private MetricValues fdMetricValues(Set<MachineMetric> customSet, List<Long> values) { return metricValues(customSet, MachineMetricFactory.fdMetrics, values); }
[ "private", "MetricValues", "fdMetricValues", "(", "Set", "<", "MachineMetric", ">", "customSet", ",", "List", "<", "Long", ">", "values", ")", "{", "return", "metricValues", "(", "customSet", ",", "MachineMetricFactory", ".", "fdMetrics", ",", "values", ")", "...
Returns the set of file-descriptor metrics and the corresponding values based on the default and the customized set of metrics, if any. @param customSet a non-null customized set of metrics @param values a non-null list of values corresponding to the list of default file-descriptor metrics
[ "Returns", "the", "set", "of", "file", "-", "descriptor", "metrics", "and", "the", "corresponding", "values", "based", "on", "the", "default", "and", "the", "customized", "set", "of", "metrics", "if", "any", "." ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/MachineMetricFactory.java#L231-L234
chhh/MSFTBX
MSFileToolbox/src/main/java/umich/ms/external/apache/cassandra/io/BufferedRandomAccessFile.java
BufferedRandomAccessFile.writeAtMost
private int writeAtMost(byte[] b, int off, int len) throws IOException { """ /* Write at most "len" bytes to "b" starting at position "off", and return the number of bytes written. """ if (this.curr_ >= this.hi_) { if (this.hitEOF_ && this.hi_ < this.maxHi_) { // at EOF -- bump "hi" ...
java
private int writeAtMost(byte[] b, int off, int len) throws IOException { if (this.curr_ >= this.hi_) { if (this.hitEOF_ && this.hi_ < this.maxHi_) { // at EOF -- bump "hi" this.hi_ = this.maxHi_; } else { // slow path -- write current buffer; read next one this.see...
[ "private", "int", "writeAtMost", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "this", ".", "curr_", ">=", "this", ".", "hi_", ")", "{", "if", "(", "this", ".", "hitEOF_", "&&", "t...
/* Write at most "len" bytes to "b" starting at position "off", and return the number of bytes written.
[ "/", "*", "Write", "at", "most", "len", "bytes", "to", "b", "starting", "at", "position", "off", "and", "return", "the", "number", "of", "bytes", "written", "." ]
train
https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/external/apache/cassandra/io/BufferedRandomAccessFile.java#L317-L336
mojohaus/jaxb2-maven-plugin
src/main/java/org/codehaus/mojo/jaxb2/shared/version/DependsFileParser.java
DependsFileParser.getVersionMap
public static SortedMap<String, String> getVersionMap(final URL anURL) { """ Extracts all build-time dependency information from a dependencies.properties file embedded in this plugin's JAR. @param anURL The non-empty URL to a dependencies.properties file. @return A SortedMap holding all entries in the depend...
java
public static SortedMap<String, String> getVersionMap(final URL anURL) { // Check sanity Validate.notNull(anURL, "anURL"); final SortedMap<String, String> toReturn = new TreeMap<String, String>(); try { final BufferedReader in = new BufferedReader(new InputStreamReader(anU...
[ "public", "static", "SortedMap", "<", "String", ",", "String", ">", "getVersionMap", "(", "final", "URL", "anURL", ")", "{", "// Check sanity", "Validate", ".", "notNull", "(", "anURL", ",", "\"anURL\"", ")", ";", "final", "SortedMap", "<", "String", ",", ...
Extracts all build-time dependency information from a dependencies.properties file embedded in this plugin's JAR. @param anURL The non-empty URL to a dependencies.properties file. @return A SortedMap holding all entries in the dependencies.properties file, plus its build time which is found under the {@code buildtime}...
[ "Extracts", "all", "build", "-", "time", "dependency", "information", "from", "a", "dependencies", ".", "properties", "file", "embedded", "in", "this", "plugin", "s", "JAR", "." ]
train
https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/version/DependsFileParser.java#L147-L186
lettuce-io/lettuce-core
src/main/java/io/lettuce/core/protocol/RedisStateMachine.java
RedisStateMachine.safeSet
protected void safeSet(CommandOutput<?, ?, ?> output, long integer, RedisCommand<?, ?, ?> command) { """ Safely sets {@link CommandOutput#set(long)}. Completes a command exceptionally in case an exception occurs. @param output @param integer @param command """ try { output.set(integer...
java
protected void safeSet(CommandOutput<?, ?, ?> output, long integer, RedisCommand<?, ?, ?> command) { try { output.set(integer); } catch (Exception e) { command.completeExceptionally(e); } }
[ "protected", "void", "safeSet", "(", "CommandOutput", "<", "?", ",", "?", ",", "?", ">", "output", ",", "long", "integer", ",", "RedisCommand", "<", "?", ",", "?", ",", "?", ">", "command", ")", "{", "try", "{", "output", ".", "set", "(", "integer"...
Safely sets {@link CommandOutput#set(long)}. Completes a command exceptionally in case an exception occurs. @param output @param integer @param command
[ "Safely", "sets", "{", "@link", "CommandOutput#set", "(", "long", ")", "}", ".", "Completes", "a", "command", "exceptionally", "in", "case", "an", "exception", "occurs", "." ]
train
https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/protocol/RedisStateMachine.java#L354-L361
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java
ServletContextResourceReaderHandler.isInstanceOf
private boolean isInstanceOf(Object rd, List<Class<?>> interfaces) { """ Checks if an object is an instance of on interface from a list of interface @param rd the object @param interfacesthe list of interfaces @return true if the object is an instance of on interface from a list of interface """ bo...
java
private boolean isInstanceOf(Object rd, List<Class<?>> interfaces) { boolean result = false; for (Class<?> class1 : interfaces) { if (class1.isInstance(rd)) { result = true; break; } } return result; }
[ "private", "boolean", "isInstanceOf", "(", "Object", "rd", ",", "List", "<", "Class", "<", "?", ">", ">", "interfaces", ")", "{", "boolean", "result", "=", "false", ";", "for", "(", "Class", "<", "?", ">", "class1", ":", "interfaces", ")", "{", "if",...
Checks if an object is an instance of on interface from a list of interface @param rd the object @param interfacesthe list of interfaces @return true if the object is an instance of on interface from a list of interface
[ "Checks", "if", "an", "object", "is", "an", "instance", "of", "on", "interface", "from", "a", "list", "of", "interface" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/handler/reader/ServletContextResourceReaderHandler.java#L333-L345
moparisthebest/beehive
beehive-controls/src/main/java/org/apache/beehive/controls/api/events/EventRef.java
EventRef.appendTypeDescriptor
private void appendTypeDescriptor(StringBuilder sb, Class clazz) { """ Helper method that appends a type descriptor to a StringBuilder. Used while accumulating an event descriptor string. """ if (clazz.isPrimitive()) sb.append(_primToType.get(clazz)); else if (clazz.isArray()) ...
java
private void appendTypeDescriptor(StringBuilder sb, Class clazz) { if (clazz.isPrimitive()) sb.append(_primToType.get(clazz)); else if (clazz.isArray()) sb.append(clazz.getName().replace('.','/')); else { sb.append("L"); sb.append(clazz...
[ "private", "void", "appendTypeDescriptor", "(", "StringBuilder", "sb", ",", "Class", "clazz", ")", "{", "if", "(", "clazz", ".", "isPrimitive", "(", ")", ")", "sb", ".", "append", "(", "_primToType", ".", "get", "(", "clazz", ")", ")", ";", "else", "if...
Helper method that appends a type descriptor to a StringBuilder. Used while accumulating an event descriptor string.
[ "Helper", "method", "that", "appends", "a", "type", "descriptor", "to", "a", "StringBuilder", ".", "Used", "while", "accumulating", "an", "event", "descriptor", "string", "." ]
train
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/api/events/EventRef.java#L153-L165
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfStamper.java
PdfStamper.setEncryption
public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException { """ Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a rand...
java
public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits) throws DocumentException { if (stamper.isAppend()) throw new DocumentException("Append mode does not support changing the encryption status."); if (stamper.isContentWritten()) ...
[ "public", "void", "setEncryption", "(", "byte", "userPassword", "[", "]", ",", "byte", "ownerPassword", "[", "]", ",", "int", "permissions", ",", "boolean", "strength128Bits", ")", "throws", "DocumentException", "{", "if", "(", "stamper", ".", "isAppend", "(",...
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScre...
[ "Sets", "the", "encryption", "options", "for", "this", "document", ".", "The", "userPassword", "and", "the", "ownerPassword", "can", "be", "null", "or", "have", "zero", "length", ".", "In", "this", "case", "the", "ownerPassword", "is", "replaced", "by", "a",...
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L269-L275
VoltDB/voltdb
src/frontend/org/voltdb/planner/MaterializedViewFixInfo.java
MaterializedViewFixInfo.processScanNodeWithReAggNode
public boolean processScanNodeWithReAggNode(AbstractPlanNode node, AbstractPlanNode reAggNode) { """ Find the scan node on MV table, replace it with reAggNode for join query. This scan node can not be in-lined, so it should be as a child of a join node. @param node """ // MV table scan node can not b...
java
public boolean processScanNodeWithReAggNode(AbstractPlanNode node, AbstractPlanNode reAggNode) { // MV table scan node can not be in in-lined nodes. for (int i = 0; i < node.getChildCount(); i++) { AbstractPlanNode child = node.getChild(i); if (child instanceof AbstractScanPlanN...
[ "public", "boolean", "processScanNodeWithReAggNode", "(", "AbstractPlanNode", "node", ",", "AbstractPlanNode", "reAggNode", ")", "{", "// MV table scan node can not be in in-lined nodes.", "for", "(", "int", "i", "=", "0", ";", "i", "<", "node", ".", "getChildCount", ...
Find the scan node on MV table, replace it with reAggNode for join query. This scan node can not be in-lined, so it should be as a child of a join node. @param node
[ "Find", "the", "scan", "node", "on", "MV", "table", "replace", "it", "with", "reAggNode", "for", "join", "query", ".", "This", "scan", "node", "can", "not", "be", "in", "-", "lined", "so", "it", "should", "be", "as", "a", "child", "of", "a", "join", ...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/MaterializedViewFixInfo.java#L378-L406