repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
188
func_name
stringlengths
7
127
whole_func_string
stringlengths
77
3.91k
language
stringclasses
1 value
func_code_string
stringlengths
77
3.91k
func_code_tokens
listlengths
20
745
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
477
split_name
stringclasses
1 value
func_code_url
stringlengths
111
288
zaproxy/zaproxy
src/org/zaproxy/zap/utils/PagingTableModel.java
PagingTableModel.setData
private void setData(int offset, List<T> page) { int lastRow = offset + page.size() - 1; dataOffset = offset; data = page; fireTableRowsUpdated(offset, lastRow); }
java
private void setData(int offset, List<T> page) { int lastRow = offset + page.size() - 1; dataOffset = offset; data = page; fireTableRowsUpdated(offset, lastRow); }
[ "private", "void", "setData", "(", "int", "offset", ",", "List", "<", "T", ">", "page", ")", "{", "int", "lastRow", "=", "offset", "+", "page", ".", "size", "(", ")", "-", "1", ";", "dataOffset", "=", "offset", ";", "data", "=", "page", ";", "fir...
Sets the given {@code page} as the currently loaded data and notifies the table model listeners of the rows updated. <p> <strong>Note:</strong> This method must be call on the EDT, failing to do so might result in GUI state inconsistencies. </p> @param offset the start offset of the given {@code page} @param page the new data @see EventQueue#invokeLater(Runnable) @see TableModelListener
[ "Sets", "the", "given", "{", "@code", "page", "}", "as", "the", "currently", "loaded", "data", "and", "notifies", "the", "table", "model", "listeners", "of", "the", "rows", "updated", ".", "<p", ">", "<strong", ">", "Note", ":", "<", "/", "strong", ">"...
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/PagingTableModel.java#L335-L340
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java
ReUtil.get
public static String get(Pattern pattern, CharSequence content, int groupIndex) { if (null == content || null == pattern) { return null; } final Matcher matcher = pattern.matcher(content); if (matcher.find()) { return matcher.group(groupIndex); } return null; }
java
public static String get(Pattern pattern, CharSequence content, int groupIndex) { if (null == content || null == pattern) { return null; } final Matcher matcher = pattern.matcher(content); if (matcher.find()) { return matcher.group(groupIndex); } return null; }
[ "public", "static", "String", "get", "(", "Pattern", "pattern", ",", "CharSequence", "content", ",", "int", "groupIndex", ")", "{", "if", "(", "null", "==", "content", "||", "null", "==", "pattern", ")", "{", "return", "null", ";", "}", "final", "Matcher...
获得匹配的字符串,对应分组0表示整个匹配内容,1表示第一个括号分组内容,依次类推 @param pattern 编译后的正则模式 @param content 被匹配的内容 @param groupIndex 匹配正则的分组序号,0表示整个匹配内容,1表示第一个括号分组内容,依次类推 @return 匹配后得到的字符串,未匹配返回null
[ "获得匹配的字符串,对应分组0表示整个匹配内容,1表示第一个括号分组内容,依次类推" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L111-L121
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/APIClient.java
APIClient.copyIndex
public JSONObject copyIndex(String srcIndexName, String dstIndexName, List<String> scopes) throws AlgoliaException { return operationOnIndex("copy", srcIndexName, dstIndexName, scopes, RequestOptions.empty); }
java
public JSONObject copyIndex(String srcIndexName, String dstIndexName, List<String> scopes) throws AlgoliaException { return operationOnIndex("copy", srcIndexName, dstIndexName, scopes, RequestOptions.empty); }
[ "public", "JSONObject", "copyIndex", "(", "String", "srcIndexName", ",", "String", "dstIndexName", ",", "List", "<", "String", ">", "scopes", ")", "throws", "AlgoliaException", "{", "return", "operationOnIndex", "(", "\"copy\"", ",", "srcIndexName", ",", "dstIndex...
Copy an existing index. @param srcIndexName the name of index to copy. @param dstIndexName the new index name that will contains a copy of srcIndexName (destination will be overriten if it already exist). @param scopes the list of scopes to copy
[ "Copy", "an", "existing", "index", "." ]
train
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L373-L375
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/query/Criteria.java
Criteria.addLike
public void addLike(Object attribute, Object value) { // PAW // addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getAlias())); addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getUserAlias(attribute))); }
java
public void addLike(Object attribute, Object value) { // PAW // addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getAlias())); addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getUserAlias(attribute))); }
[ "public", "void", "addLike", "(", "Object", "attribute", ",", "Object", "value", ")", "{", "// PAW\r", "// addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getAlias()));\r", "addSelectionCriteria", "(", "ValueCriteria", ".", "buildLikeCriteria", "(", "attr...
Adds Like (LIKE) criteria, customer_name LIKE "m%ller" @see LikeCriteria @param attribute The field name to be used @param value An object representing the value of the field
[ "Adds", "Like", "(", "LIKE", ")", "criteria", "customer_name", "LIKE", "m%ller" ]
train
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L464-L469
landawn/AbacusUtil
src/com/landawn/abacus/util/DateUtil.java
DateUtil.addMonths
public static <T extends Calendar> T addMonths(final T calendar, final int amount) { return roll(calendar, amount, CalendarUnit.MONTH); }
java
public static <T extends Calendar> T addMonths(final T calendar, final int amount) { return roll(calendar, amount, CalendarUnit.MONTH); }
[ "public", "static", "<", "T", "extends", "Calendar", ">", "T", "addMonths", "(", "final", "T", "calendar", ",", "final", "int", "amount", ")", "{", "return", "roll", "(", "calendar", ",", "amount", ",", "CalendarUnit", ".", "MONTH", ")", ";", "}" ]
Adds a number of months to a calendar returning a new object. The original {@code Date} is unchanged. @param calendar the calendar, not null @param amount the amount to add, may be negative @return the new {@code Date} with the amount added @throws IllegalArgumentException if the calendar is null
[ "Adds", "a", "number", "of", "months", "to", "a", "calendar", "returning", "a", "new", "object", ".", "The", "original", "{", "@code", "Date", "}", "is", "unchanged", "." ]
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L1077-L1079
JodaOrg/joda-time
src/main/java/org/joda/time/chrono/GJChronology.java
GJChronology.getInstance
public static GJChronology getInstance( DateTimeZone zone, long gregorianCutover, int minDaysInFirstWeek) { Instant cutoverInstant; if (gregorianCutover == DEFAULT_CUTOVER.getMillis()) { cutoverInstant = null; } else { cutoverInstant = new Instant(gregorianCutover); } return getInstance(zone, cutoverInstant, minDaysInFirstWeek); }
java
public static GJChronology getInstance( DateTimeZone zone, long gregorianCutover, int minDaysInFirstWeek) { Instant cutoverInstant; if (gregorianCutover == DEFAULT_CUTOVER.getMillis()) { cutoverInstant = null; } else { cutoverInstant = new Instant(gregorianCutover); } return getInstance(zone, cutoverInstant, minDaysInFirstWeek); }
[ "public", "static", "GJChronology", "getInstance", "(", "DateTimeZone", "zone", ",", "long", "gregorianCutover", ",", "int", "minDaysInFirstWeek", ")", "{", "Instant", "cutoverInstant", ";", "if", "(", "gregorianCutover", "==", "DEFAULT_CUTOVER", ".", "getMillis", "...
Factory method returns instances of the GJ cutover chronology. Any cutover date may be specified. @param zone the time zone to use, null is default @param gregorianCutover the cutover to use @param minDaysInFirstWeek minimum number of days in first week of the year; default is 4
[ "Factory", "method", "returns", "instances", "of", "the", "GJ", "cutover", "chronology", ".", "Any", "cutover", "date", "may", "be", "specified", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJChronology.java#L232-L244
alkacon/opencms-core
src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsBinaryPreviewContent.java
CmsBinaryPreviewContent.createListItem
private CmsListItem createListItem(CmsResourceInfoBean resourceInfo, CmsDNDHandler dndHandler) { CmsListInfoBean infoBean = new CmsListInfoBean(); infoBean.setTitle( CmsStringUtil.isNotEmptyOrWhitespaceOnly(resourceInfo.getProperties().get(CmsClientProperty.PROPERTY_TITLE)) ? resourceInfo.getProperties().get(CmsClientProperty.PROPERTY_TITLE) : resourceInfo.getTitle()); infoBean.setSubTitle(resourceInfo.getResourcePath()); infoBean.setResourceType(resourceInfo.getResourceType()); infoBean.setBigIconClasses(resourceInfo.getBigIconClasses()); infoBean.setSmallIconClasses(resourceInfo.getSmallIconClasses()); infoBean.addAdditionalInfo(Messages.get().key(Messages.GUI_PREVIEW_LABEL_SIZE_0), resourceInfo.getSize()); if (resourceInfo.getDescription() != null) { infoBean.addAdditionalInfo( Messages.get().key(Messages.GUI_PREVIEW_LABEL_DESCRIPTION_0), resourceInfo.getDescription()); } if (resourceInfo.getLastModified() != null) { infoBean.addAdditionalInfo( Messages.get().key(Messages.GUI_PREVIEW_LABEL_DATEMODIFIED_0), CmsDateTimeUtil.getDate(resourceInfo.getLastModified(), Format.MEDIUM)); } CmsListItemWidget itemWidget = new CmsListItemWidget(infoBean); itemWidget.addOpenHandler(new OpenHandler<CmsListItemWidget>() { public void onOpen(OpenEvent<CmsListItemWidget> event) { int widgetHeight = event.getTarget().getOffsetHeight(); m_previewContent.getElement().getStyle().setTop(12 + widgetHeight, Unit.PX); } }); itemWidget.addCloseHandler(new CloseHandler<CmsListItemWidget>() { public void onClose(CloseEvent<CmsListItemWidget> event) { m_previewContent.getElement().getStyle().clearTop(); } }); CmsListItem result = new CmsListItem(itemWidget); CmsPushButton button = CmsResultListItem.createDeleteButton(); if (dndHandler != null) { result.initMoveHandle(dndHandler); } CmsResultsTab resultsTab = m_binaryPreviewHandler.getGalleryDialog().getResultsTab(); final DeleteHandler deleteHandler = resultsTab.makeDeleteHandler(resourceInfo.getResourcePath()); ClickHandler handler = new ClickHandler() { public void onClick(ClickEvent event) { deleteHandler.onClick(event); m_binaryPreviewHandler.closePreview(); } }; button.addClickHandler(handler); itemWidget.addButton(button); return result; }
java
private CmsListItem createListItem(CmsResourceInfoBean resourceInfo, CmsDNDHandler dndHandler) { CmsListInfoBean infoBean = new CmsListInfoBean(); infoBean.setTitle( CmsStringUtil.isNotEmptyOrWhitespaceOnly(resourceInfo.getProperties().get(CmsClientProperty.PROPERTY_TITLE)) ? resourceInfo.getProperties().get(CmsClientProperty.PROPERTY_TITLE) : resourceInfo.getTitle()); infoBean.setSubTitle(resourceInfo.getResourcePath()); infoBean.setResourceType(resourceInfo.getResourceType()); infoBean.setBigIconClasses(resourceInfo.getBigIconClasses()); infoBean.setSmallIconClasses(resourceInfo.getSmallIconClasses()); infoBean.addAdditionalInfo(Messages.get().key(Messages.GUI_PREVIEW_LABEL_SIZE_0), resourceInfo.getSize()); if (resourceInfo.getDescription() != null) { infoBean.addAdditionalInfo( Messages.get().key(Messages.GUI_PREVIEW_LABEL_DESCRIPTION_0), resourceInfo.getDescription()); } if (resourceInfo.getLastModified() != null) { infoBean.addAdditionalInfo( Messages.get().key(Messages.GUI_PREVIEW_LABEL_DATEMODIFIED_0), CmsDateTimeUtil.getDate(resourceInfo.getLastModified(), Format.MEDIUM)); } CmsListItemWidget itemWidget = new CmsListItemWidget(infoBean); itemWidget.addOpenHandler(new OpenHandler<CmsListItemWidget>() { public void onOpen(OpenEvent<CmsListItemWidget> event) { int widgetHeight = event.getTarget().getOffsetHeight(); m_previewContent.getElement().getStyle().setTop(12 + widgetHeight, Unit.PX); } }); itemWidget.addCloseHandler(new CloseHandler<CmsListItemWidget>() { public void onClose(CloseEvent<CmsListItemWidget> event) { m_previewContent.getElement().getStyle().clearTop(); } }); CmsListItem result = new CmsListItem(itemWidget); CmsPushButton button = CmsResultListItem.createDeleteButton(); if (dndHandler != null) { result.initMoveHandle(dndHandler); } CmsResultsTab resultsTab = m_binaryPreviewHandler.getGalleryDialog().getResultsTab(); final DeleteHandler deleteHandler = resultsTab.makeDeleteHandler(resourceInfo.getResourcePath()); ClickHandler handler = new ClickHandler() { public void onClick(ClickEvent event) { deleteHandler.onClick(event); m_binaryPreviewHandler.closePreview(); } }; button.addClickHandler(handler); itemWidget.addButton(button); return result; }
[ "private", "CmsListItem", "createListItem", "(", "CmsResourceInfoBean", "resourceInfo", ",", "CmsDNDHandler", "dndHandler", ")", "{", "CmsListInfoBean", "infoBean", "=", "new", "CmsListInfoBean", "(", ")", ";", "infoBean", ".", "setTitle", "(", "CmsStringUtil", ".", ...
Creates the list item for the resource information bean.<p> @param resourceInfo the resource information bean @param dndHandler the drag and drop handler @return the list item widget
[ "Creates", "the", "list", "item", "for", "the", "resource", "information", "bean", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/ui/CmsBinaryPreviewContent.java#L121-L178
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.getPatternAnyEntityInfoAsync
public Observable<PatternAnyEntityExtractor> getPatternAnyEntityInfoAsync(UUID appId, String versionId, UUID entityId) { return getPatternAnyEntityInfoWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<PatternAnyEntityExtractor>, PatternAnyEntityExtractor>() { @Override public PatternAnyEntityExtractor call(ServiceResponse<PatternAnyEntityExtractor> response) { return response.body(); } }); }
java
public Observable<PatternAnyEntityExtractor> getPatternAnyEntityInfoAsync(UUID appId, String versionId, UUID entityId) { return getPatternAnyEntityInfoWithServiceResponseAsync(appId, versionId, entityId).map(new Func1<ServiceResponse<PatternAnyEntityExtractor>, PatternAnyEntityExtractor>() { @Override public PatternAnyEntityExtractor call(ServiceResponse<PatternAnyEntityExtractor> response) { return response.body(); } }); }
[ "public", "Observable", "<", "PatternAnyEntityExtractor", ">", "getPatternAnyEntityInfoAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ")", "{", "return", "getPatternAnyEntityInfoWithServiceResponseAsync", "(", "appId", ",", "versionId",...
Gets information about the application version's Pattern.Any model. @param appId The application ID. @param versionId The version ID. @param entityId The entity extractor ID. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PatternAnyEntityExtractor object
[ "Gets", "information", "about", "the", "application", "version", "s", "Pattern", ".", "Any", "model", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10487-L10494
vdmeer/skb-java-base
src/main/java/de/vandermeer/skb/base/info/AbstractFileInfo.java
AbstractFileInfo.tryFS
protected final boolean tryFS(String directory, String fileName){ String path = directory + "/" + fileName; if(directory==null){ path = fileName; } File file = new File(path); if(this.testFile(file)==true){ //found in file system try{ this.url = file.toURI().toURL(); this.file = file; this.fullFileName = FilenameUtils.getName(file.getAbsolutePath()); if(directory!=null){ this.setRootPath = directory; } return true; } catch (MalformedURLException e) { this.errors.addError("init() - malformed URL for file with name " + this.file.getAbsolutePath() + " and message: " + e.getMessage()); } } return false; }
java
protected final boolean tryFS(String directory, String fileName){ String path = directory + "/" + fileName; if(directory==null){ path = fileName; } File file = new File(path); if(this.testFile(file)==true){ //found in file system try{ this.url = file.toURI().toURL(); this.file = file; this.fullFileName = FilenameUtils.getName(file.getAbsolutePath()); if(directory!=null){ this.setRootPath = directory; } return true; } catch (MalformedURLException e) { this.errors.addError("init() - malformed URL for file with name " + this.file.getAbsolutePath() + " and message: " + e.getMessage()); } } return false; }
[ "protected", "final", "boolean", "tryFS", "(", "String", "directory", ",", "String", "fileName", ")", "{", "String", "path", "=", "directory", "+", "\"/\"", "+", "fileName", ";", "if", "(", "directory", "==", "null", ")", "{", "path", "=", "fileName", ";...
Try to locate a file in the file system. @param directory a directory to locate the file in @param fileName a file name with optional path information @return true if the file was found, false otherwise
[ "Try", "to", "locate", "a", "file", "in", "the", "file", "system", "." ]
train
https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/AbstractFileInfo.java#L327-L349
loldevs/riotapi
rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java
ThrottledApiHandler.getTeams
public Future<Map<Long, List<RankedTeam>>> getTeams(long... ids) { return new ApiFuture<>(() -> handler.getTeamsBySummoners(ids)); }
java
public Future<Map<Long, List<RankedTeam>>> getTeams(long... ids) { return new ApiFuture<>(() -> handler.getTeamsBySummoners(ids)); }
[ "public", "Future", "<", "Map", "<", "Long", ",", "List", "<", "RankedTeam", ">", ">", ">", "getTeams", "(", "long", "...", "ids", ")", "{", "return", "new", "ApiFuture", "<>", "(", "(", ")", "->", "handler", ".", "getTeamsBySummoners", "(", "ids", "...
Retrieve the ranked teams of the specified users @param ids The users' ids @return The ranked teams of the users @see <a href=https://developer.riotgames.com/api/methods#!/594/1865>Official API documentation</a>
[ "Retrieve", "the", "ranked", "teams", "of", "the", "specified", "users" ]
train
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L1205-L1207
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/GroupApi.java
GroupApi.getVariable
public Variable getVariable(Object groupIdOrPath, String key) throws GitLabApiException { Response response = get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "variables", key); return (response.readEntity(Variable.class)); }
java
public Variable getVariable(Object groupIdOrPath, String key) throws GitLabApiException { Response response = get(Response.Status.OK, null, "groups", getGroupIdOrPath(groupIdOrPath), "variables", key); return (response.readEntity(Variable.class)); }
[ "public", "Variable", "getVariable", "(", "Object", "groupIdOrPath", ",", "String", "key", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"groups\"", ",", "getGroupId...
Get the details of a group variable. <pre><code>GitLab Endpoint: GET /groups/:id/variables/:key</code></pre> @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path @param key the key of an existing variable, required @return the Variable instance for the specified group variable @throws GitLabApiException if any exception occurs
[ "Get", "the", "details", "of", "a", "group", "variable", "." ]
train
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L1059-L1062
khuxtable/seaglass
src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabAreaPainter.java
TabbedPaneTabAreaPainter.paintHorizontalLine
private void paintHorizontalLine(Graphics2D g, JComponent c, int x, int y, int width, int height) { paintLine(g, width, height); }
java
private void paintHorizontalLine(Graphics2D g, JComponent c, int x, int y, int width, int height) { paintLine(g, width, height); }
[ "private", "void", "paintHorizontalLine", "(", "Graphics2D", "g", ",", "JComponent", "c", ",", "int", "x", ",", "int", "y", ",", "int", "width", ",", "int", "height", ")", "{", "paintLine", "(", "g", ",", "width", ",", "height", ")", ";", "}" ]
DOCUMENT ME! @param g DOCUMENT ME! @param c DOCUMENT ME! @param x DOCUMENT ME! @param y DOCUMENT ME! @param width DOCUMENT ME! @param height DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TabbedPaneTabAreaPainter.java#L118-L120
Alluxio/alluxio
core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java
GrpcServerBuilder.withChildOption
public <T> GrpcServerBuilder withChildOption(ChannelOption<T> option, T value) { mNettyServerBuilder = mNettyServerBuilder.withChildOption(option, value); return this; }
java
public <T> GrpcServerBuilder withChildOption(ChannelOption<T> option, T value) { mNettyServerBuilder = mNettyServerBuilder.withChildOption(option, value); return this; }
[ "public", "<", "T", ">", "GrpcServerBuilder", "withChildOption", "(", "ChannelOption", "<", "T", ">", "option", ",", "T", "value", ")", "{", "mNettyServerBuilder", "=", "mNettyServerBuilder", ".", "withChildOption", "(", "option", ",", "value", ")", ";", "retu...
Sets a netty channel option. @param <T> channel option type @param option the option to be set @param value the new value @return an updated instance of this {@link GrpcServerBuilder}
[ "Sets", "a", "netty", "channel", "option", "." ]
train
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/grpc/GrpcServerBuilder.java#L158-L161
google/closure-compiler
src/com/google/javascript/jscomp/ChangeVerifier.java
ChangeVerifier.verifyScopeChangesHaveBeenRecorded
private void verifyScopeChangesHaveBeenRecorded(String passName, Node root) { final String passNameMsg = passName.isEmpty() ? "" : passName + ": "; // Gather all the scope nodes that existed when the snapshot was taken. final Set<Node> snapshotScopeNodes = new HashSet<>(); NodeUtil.visitPreOrder( clonesByCurrent.get(root), new Visitor() { @Override public void visit(Node oldNode) { if (NodeUtil.isChangeScopeRoot(oldNode)) { snapshotScopeNodes.add(oldNode); } } }); NodeUtil.visitPreOrder( root, new Visitor() { @Override public void visit(Node n) { if (n.isRoot()) { verifyRoot(n); } else if (NodeUtil.isChangeScopeRoot(n)) { Node clone = clonesByCurrent.get(n); // Remove any scope nodes that still exist. snapshotScopeNodes.remove(clone); verifyNode(passNameMsg, n); if (clone == null) { verifyNewNode(passNameMsg, n); } else { verifyNodeChange(passNameMsg, n, clone); } } } }); // Only actually deleted snapshot scope nodes should remain. verifyDeletedScopeNodes(passNameMsg, snapshotScopeNodes); }
java
private void verifyScopeChangesHaveBeenRecorded(String passName, Node root) { final String passNameMsg = passName.isEmpty() ? "" : passName + ": "; // Gather all the scope nodes that existed when the snapshot was taken. final Set<Node> snapshotScopeNodes = new HashSet<>(); NodeUtil.visitPreOrder( clonesByCurrent.get(root), new Visitor() { @Override public void visit(Node oldNode) { if (NodeUtil.isChangeScopeRoot(oldNode)) { snapshotScopeNodes.add(oldNode); } } }); NodeUtil.visitPreOrder( root, new Visitor() { @Override public void visit(Node n) { if (n.isRoot()) { verifyRoot(n); } else if (NodeUtil.isChangeScopeRoot(n)) { Node clone = clonesByCurrent.get(n); // Remove any scope nodes that still exist. snapshotScopeNodes.remove(clone); verifyNode(passNameMsg, n); if (clone == null) { verifyNewNode(passNameMsg, n); } else { verifyNodeChange(passNameMsg, n, clone); } } } }); // Only actually deleted snapshot scope nodes should remain. verifyDeletedScopeNodes(passNameMsg, snapshotScopeNodes); }
[ "private", "void", "verifyScopeChangesHaveBeenRecorded", "(", "String", "passName", ",", "Node", "root", ")", "{", "final", "String", "passNameMsg", "=", "passName", ".", "isEmpty", "(", ")", "?", "\"\"", ":", "passName", "+", "\": \"", ";", "// Gather all the s...
Checks that the scope roots marked as changed have indeed changed
[ "Checks", "that", "the", "scope", "roots", "marked", "as", "changed", "have", "indeed", "changed" ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ChangeVerifier.java#L78-L117
phoenixnap/springmvc-raml-plugin
src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/RamlTypeHelper.java
RamlTypeHelper.annotateDateWithPattern
public static void annotateDateWithPattern(JAnnotationUse jAnnotationUse, String type, String format) { String param = type.toUpperCase(); switch (param) { case "DATE-ONLY": // example: 2013-09-29 jAnnotationUse.param("pattern", "yyyy-MM-dd"); break; case "TIME-ONLY": // example: 19:46:19 jAnnotationUse.param("pattern", "HH:mm:ss"); break; case "DATETIME-ONLY": // example: 2013-09-29T19:46:19 jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ss"); break; case "DATETIME": if ("rfc2616".equalsIgnoreCase(format)) { // example: Tue, 15 Nov 1994 12:45:26 GMT jAnnotationUse.param("pattern", "EEE, dd MMM yyyy HH:mm:ss z"); } else { jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ssXXX"); } break; default: jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ss"); } }
java
public static void annotateDateWithPattern(JAnnotationUse jAnnotationUse, String type, String format) { String param = type.toUpperCase(); switch (param) { case "DATE-ONLY": // example: 2013-09-29 jAnnotationUse.param("pattern", "yyyy-MM-dd"); break; case "TIME-ONLY": // example: 19:46:19 jAnnotationUse.param("pattern", "HH:mm:ss"); break; case "DATETIME-ONLY": // example: 2013-09-29T19:46:19 jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ss"); break; case "DATETIME": if ("rfc2616".equalsIgnoreCase(format)) { // example: Tue, 15 Nov 1994 12:45:26 GMT jAnnotationUse.param("pattern", "EEE, dd MMM yyyy HH:mm:ss z"); } else { jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ssXXX"); } break; default: jAnnotationUse.param("pattern", "yyyy-MM-dd'T'HH:mm:ss"); } }
[ "public", "static", "void", "annotateDateWithPattern", "(", "JAnnotationUse", "jAnnotationUse", ",", "String", "type", ",", "String", "format", ")", "{", "String", "param", "=", "type", ".", "toUpperCase", "(", ")", ";", "switch", "(", "param", ")", "{", "ca...
Adds appropriate <code>pattern</code> attribute to provided annotation on {@link Date} property. @param jAnnotationUse annotation to add pattern. Can be for: {@link JsonFormat} or {@link DateTimeFormat} @param type RAML type of the property @param format of date if specified
[ "Adds", "appropriate", "<code", ">", "pattern<", "/", "code", ">", "attribute", "to", "provided", "annotation", "on", "{", "@link", "Date", "}", "property", "." ]
train
https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/RamlTypeHelper.java#L243-L270
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.removeAll
public static boolean removeAll(Collection self, Object[] items) { Collection pickFrom = new TreeSet(new NumberAwareComparator()); pickFrom.addAll(Arrays.asList(items)); return self.removeAll(pickFrom); }
java
public static boolean removeAll(Collection self, Object[] items) { Collection pickFrom = new TreeSet(new NumberAwareComparator()); pickFrom.addAll(Arrays.asList(items)); return self.removeAll(pickFrom); }
[ "public", "static", "boolean", "removeAll", "(", "Collection", "self", ",", "Object", "[", "]", "items", ")", "{", "Collection", "pickFrom", "=", "new", "TreeSet", "(", "new", "NumberAwareComparator", "(", ")", ")", ";", "pickFrom", ".", "addAll", "(", "Ar...
Modifies this collection by removing its elements that are contained within the specified object array. See also <code>findAll</code> and <code>grep</code> when wanting to produce a new list containing items which don't match some criteria while leaving the original collection unchanged. @param self a Collection to be modified @param items array containing elements to be removed from this collection @return <tt>true</tt> if this collection changed as a result of the call @see Collection#removeAll(Collection) @since 1.7.2
[ "Modifies", "this", "collection", "by", "removing", "its", "elements", "that", "are", "contained", "within", "the", "specified", "object", "array", "." ]
train
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4968-L4972
phax/ph-pdf-layout
src/main/java/com/helger/pdflayout4/element/table/PLTable.java
PLTable.addRow
@Nonnull public PLTable addRow (@Nonnull final Iterable <? extends PLTableCell> aCells) { return addRow (aCells, m_aRows.getDefaultHeight ()); }
java
@Nonnull public PLTable addRow (@Nonnull final Iterable <? extends PLTableCell> aCells) { return addRow (aCells, m_aRows.getDefaultHeight ()); }
[ "@", "Nonnull", "public", "PLTable", "addRow", "(", "@", "Nonnull", "final", "Iterable", "<", "?", "extends", "PLTableCell", ">", "aCells", ")", "{", "return", "addRow", "(", "aCells", ",", "m_aRows", ".", "getDefaultHeight", "(", ")", ")", ";", "}" ]
Add a new table row with auto height. All contained elements are added with the specified width in the constructor. <code>null</code> elements are represented as empty cells. @param aCells The cells to add. May not be <code>null</code>. @return this
[ "Add", "a", "new", "table", "row", "with", "auto", "height", ".", "All", "contained", "elements", "are", "added", "with", "the", "specified", "width", "in", "the", "constructor", ".", "<code", ">", "null<", "/", "code", ">", "elements", "are", "represented...
train
https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/element/table/PLTable.java#L312-L316
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java
MeshGenerator.generateCylinder
public static void generateCylinder(TFloatList positions, TFloatList normals, TIntList indices, float radius, float height) { // 0,0,0 will be halfway up the cylinder in the middle final float halfHeight = height / 2; // The positions at the rims of the cylinders final List<Vector3f> rims = new ArrayList<>(); for (int angle = 0; angle < 360; angle += 15) { final double angleRads = Math.toRadians(angle); rims.add(new Vector3f( radius * TrigMath.cos(angleRads), halfHeight, radius * -TrigMath.sin(angleRads))); } // The normals for the triangles of the top and bottom faces final Vector3f topNormal = new Vector3f(0, 1, 0); final Vector3f bottomNormal = new Vector3f(0, -1, 0); // Add the top and bottom face center vertices addVector(positions, new Vector3f(0, halfHeight, 0));// 0 addVector(normals, topNormal); addVector(positions, new Vector3f(0, -halfHeight, 0));// 1 addVector(normals, bottomNormal); // Add all the faces section by section, turning around the y axis final int rimsSize = rims.size(); for (int i = 0; i < rimsSize; i++) { // Get the top and bottom vertex positions and the side normal final Vector3f t = rims.get(i); final Vector3f b = new Vector3f(t.getX(), -t.getY(), t.getZ()); final Vector3f n = new Vector3f(t.getX(), 0, t.getZ()).normalize(); // Top face vertex addVector(positions, t);// index addVector(normals, topNormal); // Bottom face vertex addVector(positions, b);// index + 1 addVector(normals, bottomNormal); // Side top vertex addVector(positions, t);// index + 2 addVector(normals, n); // Side bottom vertex addVector(positions, b);// index + 3 addVector(normals, n); // Get the current index for our vertices final int currentIndex = i * 4 + 2; // Get the index for the next iteration, wrapping around at the end final int nextIndex = (i == rimsSize - 1 ? 0 : i + 1) * 4 + 2; // Add the 4 triangles (1 top, 1 bottom, 2 for the side) addAll(indices, 0, currentIndex, nextIndex); addAll(indices, 1, nextIndex + 1, currentIndex + 1); addAll(indices, currentIndex + 2, currentIndex + 3, nextIndex + 2); addAll(indices, currentIndex + 3, nextIndex + 3, nextIndex + 2); } }
java
public static void generateCylinder(TFloatList positions, TFloatList normals, TIntList indices, float radius, float height) { // 0,0,0 will be halfway up the cylinder in the middle final float halfHeight = height / 2; // The positions at the rims of the cylinders final List<Vector3f> rims = new ArrayList<>(); for (int angle = 0; angle < 360; angle += 15) { final double angleRads = Math.toRadians(angle); rims.add(new Vector3f( radius * TrigMath.cos(angleRads), halfHeight, radius * -TrigMath.sin(angleRads))); } // The normals for the triangles of the top and bottom faces final Vector3f topNormal = new Vector3f(0, 1, 0); final Vector3f bottomNormal = new Vector3f(0, -1, 0); // Add the top and bottom face center vertices addVector(positions, new Vector3f(0, halfHeight, 0));// 0 addVector(normals, topNormal); addVector(positions, new Vector3f(0, -halfHeight, 0));// 1 addVector(normals, bottomNormal); // Add all the faces section by section, turning around the y axis final int rimsSize = rims.size(); for (int i = 0; i < rimsSize; i++) { // Get the top and bottom vertex positions and the side normal final Vector3f t = rims.get(i); final Vector3f b = new Vector3f(t.getX(), -t.getY(), t.getZ()); final Vector3f n = new Vector3f(t.getX(), 0, t.getZ()).normalize(); // Top face vertex addVector(positions, t);// index addVector(normals, topNormal); // Bottom face vertex addVector(positions, b);// index + 1 addVector(normals, bottomNormal); // Side top vertex addVector(positions, t);// index + 2 addVector(normals, n); // Side bottom vertex addVector(positions, b);// index + 3 addVector(normals, n); // Get the current index for our vertices final int currentIndex = i * 4 + 2; // Get the index for the next iteration, wrapping around at the end final int nextIndex = (i == rimsSize - 1 ? 0 : i + 1) * 4 + 2; // Add the 4 triangles (1 top, 1 bottom, 2 for the side) addAll(indices, 0, currentIndex, nextIndex); addAll(indices, 1, nextIndex + 1, currentIndex + 1); addAll(indices, currentIndex + 2, currentIndex + 3, nextIndex + 2); addAll(indices, currentIndex + 3, nextIndex + 3, nextIndex + 2); } }
[ "public", "static", "void", "generateCylinder", "(", "TFloatList", "positions", ",", "TFloatList", "normals", ",", "TIntList", "indices", ",", "float", "radius", ",", "float", "height", ")", "{", "// 0,0,0 will be halfway up the cylinder in the middle", "final", "float"...
Generates a cylindrical solid mesh. The center is at middle of the of the cylinder. @param positions Where to save the position information @param normals Where to save the normal information, can be null to ignore the attribute @param indices Where to save the indices @param radius The radius of the base and top @param height The height (distance from the base to the top)
[ "Generates", "a", "cylindrical", "solid", "mesh", ".", "The", "center", "is", "at", "middle", "of", "the", "of", "the", "cylinder", "." ]
train
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L941-L990
cloudant/sync-android
cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/AttachmentManager.java
AttachmentManager.prepareAttachment
public static PreparedAttachment prepareAttachment(String attachmentsDir, AttachmentStreamFactory attachmentStreamFactory, Attachment attachment) throws AttachmentException { if (attachment.encoding != Attachment.Encoding.Plain) { throw new AttachmentNotSavedException("Encoded attachments can only be prepared if the value of \"length\" is known"); } return new PreparedAttachment(attachment, attachmentsDir, 0, attachmentStreamFactory); }
java
public static PreparedAttachment prepareAttachment(String attachmentsDir, AttachmentStreamFactory attachmentStreamFactory, Attachment attachment) throws AttachmentException { if (attachment.encoding != Attachment.Encoding.Plain) { throw new AttachmentNotSavedException("Encoded attachments can only be prepared if the value of \"length\" is known"); } return new PreparedAttachment(attachment, attachmentsDir, 0, attachmentStreamFactory); }
[ "public", "static", "PreparedAttachment", "prepareAttachment", "(", "String", "attachmentsDir", ",", "AttachmentStreamFactory", "attachmentStreamFactory", ",", "Attachment", "attachment", ")", "throws", "AttachmentException", "{", "if", "(", "attachment", ".", "encoding", ...
Creates a PreparedAttachment from {@code attachment}, preparing it for insertion into the DocumentStore. @param attachmentStreamFactory @param attachment Attachment to prepare for insertion into DocumentStore @return PreparedAttachment, which can be used in addAttachment methods @throws AttachmentException if there was an error preparing the attachment, e.g., reading attachment data.
[ "Creates", "a", "PreparedAttachment", "from", "{", "@code", "attachment", "}", "preparing", "it", "for", "insertion", "into", "the", "DocumentStore", "." ]
train
https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/AttachmentManager.java#L201-L209
mgormley/prim
src/main/java_generated/edu/jhu/prim/vector/IntIntDenseVector.java
IntIntDenseVector.add
public void add(IntIntVector other) { if (other instanceof IntIntUnsortedVector) { IntIntUnsortedVector vec = (IntIntUnsortedVector) other; for (int i=0; i<vec.top; i++) { this.add(vec.idx[i], vec.vals[i]); } } else { // TODO: Add special case for IntIntDenseVector. other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntAdd())); } }
java
public void add(IntIntVector other) { if (other instanceof IntIntUnsortedVector) { IntIntUnsortedVector vec = (IntIntUnsortedVector) other; for (int i=0; i<vec.top; i++) { this.add(vec.idx[i], vec.vals[i]); } } else { // TODO: Add special case for IntIntDenseVector. other.iterate(new SparseBinaryOpApplier(this, new Lambda.IntAdd())); } }
[ "public", "void", "add", "(", "IntIntVector", "other", ")", "{", "if", "(", "other", "instanceof", "IntIntUnsortedVector", ")", "{", "IntIntUnsortedVector", "vec", "=", "(", "IntIntUnsortedVector", ")", "other", ";", "for", "(", "int", "i", "=", "0", ";", ...
Updates this vector to be the entrywise sum of this vector with the other.
[ "Updates", "this", "vector", "to", "be", "the", "entrywise", "sum", "of", "this", "vector", "with", "the", "other", "." ]
train
https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/IntIntDenseVector.java#L143-L153
berkesa/datatree
src/main/java/io/datatree/Tree.java
Tree.putSet
public Tree putSet(String path, boolean putIfAbsent) { return putObjectInternal(path, new LinkedHashSet<Object>(), putIfAbsent); }
java
public Tree putSet(String path, boolean putIfAbsent) { return putObjectInternal(path, new LinkedHashSet<Object>(), putIfAbsent); }
[ "public", "Tree", "putSet", "(", "String", "path", ",", "boolean", "putIfAbsent", ")", "{", "return", "putObjectInternal", "(", "path", ",", "new", "LinkedHashSet", "<", "Object", ">", "(", ")", ",", "putIfAbsent", ")", ";", "}" ]
Associates the specified Set container with the specified path. If the structure previously contained a mapping for the path, the old value is replaced. Set similar to List, but contains no duplicate elements. Sample code:<br> <br> Tree node = new Tree();<br> <br> Tree set1 = node.putSet("a.b.c");<br> set1.add(1).add(2).add(3);<br> <br> Tree set2 = node.putSet("a.b.c", true);<br> set2.add(4).add(5).add(6);<br> <br> The "set2" contains 1, 2, 3, 4, 5 and 6. @param path path with which the specified Set is to be associated @param putIfAbsent if true and the specified key is not already associated with a value associates it with the given value and returns the new Set, else returns the previous Set @return Tree of the new Set
[ "Associates", "the", "specified", "Set", "container", "with", "the", "specified", "path", ".", "If", "the", "structure", "previously", "contained", "a", "mapping", "for", "the", "path", "the", "old", "value", "is", "replaced", ".", "Set", "similar", "to", "L...
train
https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L2126-L2128
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java
RegularPactTask.constructLogString
public static String constructLogString(String message, String taskName, AbstractInvokable parent) { return message + ": " + taskName + " (" + (parent.getEnvironment().getIndexInSubtaskGroup() + 1) + '/' + parent.getEnvironment().getCurrentNumberOfSubtasks() + ')'; }
java
public static String constructLogString(String message, String taskName, AbstractInvokable parent) { return message + ": " + taskName + " (" + (parent.getEnvironment().getIndexInSubtaskGroup() + 1) + '/' + parent.getEnvironment().getCurrentNumberOfSubtasks() + ')'; }
[ "public", "static", "String", "constructLogString", "(", "String", "message", ",", "String", "taskName", ",", "AbstractInvokable", "parent", ")", "{", "return", "message", "+", "\": \"", "+", "taskName", "+", "\" (\"", "+", "(", "parent", ".", "getEnvironment",...
Utility function that composes a string for logging purposes. The string includes the given message, the given name of the task and the index in its subtask group as well as the number of instances that exist in its subtask group. @param message The main message for the log. @param taskName The name of the task. @param parent The nephele task that contains the code producing the message. @return The string for logging.
[ "Utility", "function", "that", "composes", "a", "string", "for", "logging", "purposes", ".", "The", "string", "includes", "the", "given", "message", "the", "given", "name", "of", "the", "task", "and", "the", "index", "in", "its", "subtask", "group", "as", ...
train
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/pact/runtime/task/RegularPactTask.java#L1179-L1182
google/error-prone-javac
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
ConstructorBuilder.buildConstructorDoc
public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) throws DocletException { if (writer == null) { return; } if (hasMembersToDocument()) { Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader(typeElement, memberDetailsTree); Element lastElement = constructors.get(constructors.size() - 1); for (Element contructor : constructors) { currentConstructor = (ExecutableElement)contructor; Content constructorDocTree = writer.getConstructorDocTreeHeader(currentConstructor, constructorDetailsTree); buildChildren(node, constructorDocTree); constructorDetailsTree.addContent(writer.getConstructorDoc(constructorDocTree, currentConstructor == lastElement)); } memberDetailsTree.addContent( writer.getConstructorDetails(constructorDetailsTree)); } }
java
public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) throws DocletException { if (writer == null) { return; } if (hasMembersToDocument()) { Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader(typeElement, memberDetailsTree); Element lastElement = constructors.get(constructors.size() - 1); for (Element contructor : constructors) { currentConstructor = (ExecutableElement)contructor; Content constructorDocTree = writer.getConstructorDocTreeHeader(currentConstructor, constructorDetailsTree); buildChildren(node, constructorDocTree); constructorDetailsTree.addContent(writer.getConstructorDoc(constructorDocTree, currentConstructor == lastElement)); } memberDetailsTree.addContent( writer.getConstructorDetails(constructorDetailsTree)); } }
[ "public", "void", "buildConstructorDoc", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "throws", "DocletException", "{", "if", "(", "writer", "==", "null", ")", "{", "return", ";", "}", "if", "(", "hasMembersToDocument", "(", ")", ")", "{...
Build the constructor documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added @throws DocletException is there is a problem while building the documentation
[ "Build", "the", "constructor", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java#L152-L171
super-csv/super-csv
super-csv/src/main/java/org/supercsv/io/AbstractCsvWriter.java
AbstractCsvWriter.writeRow
protected void writeRow(final String... columns) throws IOException { if( columns == null ) { throw new NullPointerException(String.format("columns to write should not be null on line %d", lineNumber)); } else if( columns.length == 0 ) { throw new IllegalArgumentException(String.format("columns to write should not be empty on line %d", lineNumber)); } StringBuilder builder = new StringBuilder(); for( int i = 0; i < columns.length; i++ ) { columnNumber = i + 1; // column no used by CsvEncoder if( i > 0 ) { builder.append((char) preference.getDelimiterChar()); // delimiter } final String csvElement = columns[i]; if( csvElement != null ) { final CsvContext context = new CsvContext(lineNumber, rowNumber, columnNumber); final String escapedCsv = encoder.encode(csvElement, context, preference); builder.append(escapedCsv); lineNumber = context.getLineNumber(); // line number can increment when encoding multi-line columns } } builder.append(preference.getEndOfLineSymbols()); // EOL writer.write(builder.toString()); }
java
protected void writeRow(final String... columns) throws IOException { if( columns == null ) { throw new NullPointerException(String.format("columns to write should not be null on line %d", lineNumber)); } else if( columns.length == 0 ) { throw new IllegalArgumentException(String.format("columns to write should not be empty on line %d", lineNumber)); } StringBuilder builder = new StringBuilder(); for( int i = 0; i < columns.length; i++ ) { columnNumber = i + 1; // column no used by CsvEncoder if( i > 0 ) { builder.append((char) preference.getDelimiterChar()); // delimiter } final String csvElement = columns[i]; if( csvElement != null ) { final CsvContext context = new CsvContext(lineNumber, rowNumber, columnNumber); final String escapedCsv = encoder.encode(csvElement, context, preference); builder.append(escapedCsv); lineNumber = context.getLineNumber(); // line number can increment when encoding multi-line columns } } builder.append(preference.getEndOfLineSymbols()); // EOL writer.write(builder.toString()); }
[ "protected", "void", "writeRow", "(", "final", "String", "...", "columns", ")", "throws", "IOException", "{", "if", "(", "columns", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "String", ".", "format", "(", "\"columns to write should not ...
Writes one or more String columns as a line to the CsvWriter. @param columns the columns to write @throws IllegalArgumentException if columns.length == 0 @throws IOException If an I/O error occurs @throws NullPointerException if columns is null
[ "Writes", "one", "or", "more", "String", "columns", "as", "a", "line", "to", "the", "CsvWriter", "." ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/io/AbstractCsvWriter.java#L174-L204
hellosign/hellosign-java-sdk
src/main/java/com/hellosign/sdk/http/HttpClient.java
HttpClient.asHttpCode
public int asHttpCode() throws HelloSignException { Integer code = getLastResponseCode(); if (code == null) { throw new HelloSignException("No request performed"); } if (code >= 200 && code < 300) { reset(); return code; } throw new HelloSignException("HTTP Code " + code, code); }
java
public int asHttpCode() throws HelloSignException { Integer code = getLastResponseCode(); if (code == null) { throw new HelloSignException("No request performed"); } if (code >= 200 && code < 300) { reset(); return code; } throw new HelloSignException("HTTP Code " + code, code); }
[ "public", "int", "asHttpCode", "(", ")", "throws", "HelloSignException", "{", "Integer", "code", "=", "getLastResponseCode", "(", ")", ";", "if", "(", "code", "==", "null", ")", "{", "throw", "new", "HelloSignException", "(", "\"No request performed\"", ")", "...
Executes the request and returns the HTTP response code. @return int HTTP response code @throws HelloSignException thrown if no request has been performed
[ "Executes", "the", "request", "and", "returns", "the", "HTTP", "response", "code", "." ]
train
https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/http/HttpClient.java#L273-L283
alkacon/opencms-core
src/org/opencms/widgets/dataview/CmsDataViewFilter.java
CmsDataViewFilter.copyWithValue
public CmsDataViewFilter copyWithValue(String value) { return new CmsDataViewFilter(m_id, m_niceName, m_helpText, m_options, value); }
java
public CmsDataViewFilter copyWithValue(String value) { return new CmsDataViewFilter(m_id, m_niceName, m_helpText, m_options, value); }
[ "public", "CmsDataViewFilter", "copyWithValue", "(", "String", "value", ")", "{", "return", "new", "CmsDataViewFilter", "(", "m_id", ",", "m_niceName", ",", "m_helpText", ",", "m_options", ",", "value", ")", ";", "}" ]
Creates a copy of the filter, but uses a different filter value for the copy.<p> @param value the filter value for the copy @return the copied filter
[ "Creates", "a", "copy", "of", "the", "filter", "but", "uses", "a", "different", "filter", "value", "for", "the", "copy", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/dataview/CmsDataViewFilter.java#L105-L108
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/string/StringHelper.java
StringHelper.getNotNull
@Nullable public static CharSequence getNotNull (@Nullable final CharSequence s, final CharSequence sDefaultIfNull) { return s == null ? sDefaultIfNull : s; }
java
@Nullable public static CharSequence getNotNull (@Nullable final CharSequence s, final CharSequence sDefaultIfNull) { return s == null ? sDefaultIfNull : s; }
[ "@", "Nullable", "public", "static", "CharSequence", "getNotNull", "(", "@", "Nullable", "final", "CharSequence", "s", ",", "final", "CharSequence", "sDefaultIfNull", ")", "{", "return", "s", "==", "null", "?", "sDefaultIfNull", ":", "s", ";", "}" ]
Get the passed {@link CharSequence} but never return <code>null</code>. If the passed parameter is <code>null</code> the second parameter is returned. @param s The parameter to be not <code>null</code>. @param sDefaultIfNull The value to be used of the first parameter is <code>null</code>. May be <code>null</code> but in this case the call to this method is obsolete. @return The passed default value if the string is <code>null</code>, otherwise the input {@link CharSequence}.
[ "Get", "the", "passed", "{", "@link", "CharSequence", "}", "but", "never", "return", "<code", ">", "null<", "/", "code", ">", ".", "If", "the", "passed", "parameter", "is", "<code", ">", "null<", "/", "code", ">", "the", "second", "parameter", "is", "r...
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4562-L4566
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java
ValueEnforcer.isBetweenExclusive
public static double isBetweenExclusive (final double dValue, final String sName, final double dLowerBoundExclusive, final double dUpperBoundExclusive) { if (isEnabled ()) return isBetweenExclusive (dValue, () -> sName, dLowerBoundExclusive, dUpperBoundExclusive); return dValue; }
java
public static double isBetweenExclusive (final double dValue, final String sName, final double dLowerBoundExclusive, final double dUpperBoundExclusive) { if (isEnabled ()) return isBetweenExclusive (dValue, () -> sName, dLowerBoundExclusive, dUpperBoundExclusive); return dValue; }
[ "public", "static", "double", "isBetweenExclusive", "(", "final", "double", "dValue", ",", "final", "String", "sName", ",", "final", "double", "dLowerBoundExclusive", ",", "final", "double", "dUpperBoundExclusive", ")", "{", "if", "(", "isEnabled", "(", ")", ")"...
Check if <code>nValue &gt; nLowerBoundInclusive &amp;&amp; nValue &lt; nUpperBoundInclusive</code> @param dValue Value @param sName Name @param dLowerBoundExclusive Lower bound @param dUpperBoundExclusive Upper bound @return The value
[ "Check", "if", "<code", ">", "nValue", "&gt", ";", "nLowerBoundInclusive", "&amp", ";", "&amp", ";", "nValue", "&lt", ";", "nUpperBoundInclusive<", "/", "code", ">" ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L2843-L2851
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/time/FastDateFormat.java
FastDateFormat.applyRules
@Deprecated protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { return printer.applyRules(calendar, buf); }
java
@Deprecated protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) { return printer.applyRules(calendar, buf); }
[ "@", "Deprecated", "protected", "StringBuffer", "applyRules", "(", "final", "Calendar", "calendar", ",", "final", "StringBuffer", "buf", ")", "{", "return", "printer", ".", "applyRules", "(", "calendar", ",", "buf", ")", ";", "}" ]
<p>Performs the formatting by applying the rules to the specified calendar.</p> @param calendar the calendar to format @param buf the buffer to format into @return the specified string buffer @deprecated Use {@link #format(Calendar, Appendable)}
[ "<p", ">", "Performs", "the", "formatting", "by", "applying", "the", "rules", "to", "the", "specified", "calendar", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java#L675-L678
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java
IoUtil.writeUtf8
public static void writeUtf8(OutputStream out, boolean isCloseOut, Object... contents) throws IORuntimeException { write(out, CharsetUtil.CHARSET_UTF_8, isCloseOut, contents); }
java
public static void writeUtf8(OutputStream out, boolean isCloseOut, Object... contents) throws IORuntimeException { write(out, CharsetUtil.CHARSET_UTF_8, isCloseOut, contents); }
[ "public", "static", "void", "writeUtf8", "(", "OutputStream", "out", ",", "boolean", "isCloseOut", ",", "Object", "...", "contents", ")", "throws", "IORuntimeException", "{", "write", "(", "out", ",", "CharsetUtil", ".", "CHARSET_UTF_8", ",", "isCloseOut", ",", ...
将多部分内容写到流中,自动转换为UTF-8字符串 @param out 输出流 @param isCloseOut 写入完毕是否关闭输出流 @param contents 写入的内容,调用toString()方法,不包括不会自动换行 @throws IORuntimeException IO异常 @since 3.1.1
[ "将多部分内容写到流中,自动转换为UTF", "-", "8字符串" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L878-L880
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/SimpleGroupMember.java
SimpleGroupMember.findMenu
protected JMenuItem findMenu(AbstractCommand attachedCommand, List abstractButtons) { if (abstractButtons == null) { return null; } for (Iterator it = abstractButtons.iterator(); it.hasNext();) { AbstractButton button = (AbstractButton)it.next(); if (button instanceof JMenuItem && attachedCommand.isAttached(button)) { it.remove(); return (JMenuItem)button; } } return null; }
java
protected JMenuItem findMenu(AbstractCommand attachedCommand, List abstractButtons) { if (abstractButtons == null) { return null; } for (Iterator it = abstractButtons.iterator(); it.hasNext();) { AbstractButton button = (AbstractButton)it.next(); if (button instanceof JMenuItem && attachedCommand.isAttached(button)) { it.remove(); return (JMenuItem)button; } } return null; }
[ "protected", "JMenuItem", "findMenu", "(", "AbstractCommand", "attachedCommand", ",", "List", "abstractButtons", ")", "{", "if", "(", "abstractButtons", "==", "null", ")", "{", "return", "null", ";", "}", "for", "(", "Iterator", "it", "=", "abstractButtons", "...
Searches the given list of {@link AbstractButton}s for one that is an instance of a {@link JMenuItem} and has the given command attached to it. If found, the menu item will be removed from the list. @param attachedCommand The command that we are checking to see if it attached to any item in the list. @param abstractButtons The collection of {@link AbstractButton}s that will be checked to see if they have the given command attached to them. May be null or empty. @return The element from the list that the given command is attached to, or null if no such element could be found.
[ "Searches", "the", "given", "list", "of", "{", "@link", "AbstractButton", "}", "s", "for", "one", "that", "is", "an", "instance", "of", "a", "{", "@link", "JMenuItem", "}", "and", "has", "the", "given", "command", "attached", "to", "it", ".", "If", "fo...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/SimpleGroupMember.java#L135-L149
tvesalainen/util
util/src/main/java/org/vesalainen/nio/RingBuffer.java
RingBuffer.writeTo
protected int writeTo(SparseBufferOperator<B> op, Splitter<SparseBufferOperator<B>> splitter) throws IOException { return writeTo(op, splitter, mark, marked); }
java
protected int writeTo(SparseBufferOperator<B> op, Splitter<SparseBufferOperator<B>> splitter) throws IOException { return writeTo(op, splitter, mark, marked); }
[ "protected", "int", "writeTo", "(", "SparseBufferOperator", "<", "B", ">", "op", ",", "Splitter", "<", "SparseBufferOperator", "<", "B", ">", ">", "splitter", ")", "throws", "IOException", "{", "return", "writeTo", "(", "op", ",", "splitter", ",", "mark", ...
Write buffers content from mark (included) @param op @param splitter @return @throws IOException
[ "Write", "buffers", "content", "from", "mark", "(", "included", ")" ]
train
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/RingBuffer.java#L270-L273
OpenLiberty/open-liberty
dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java
TypeConversion.writeIntAsVarIntBytes
public static int writeIntAsVarIntBytes(int intVal, byte[] bytes, int offset) { int pos = offset; int v = intVal; if ((v & ~0x7F) == 0) { bytes[pos++] = ((byte) v); return 1 + offset; } while (true) { if ((v & ~0x7F) == 0) { bytes[pos++] = ((byte) v); return pos; } else { bytes[pos++] = (byte) ((v & 0x7F) | 0x80); v >>>= 7; } } }
java
public static int writeIntAsVarIntBytes(int intVal, byte[] bytes, int offset) { int pos = offset; int v = intVal; if ((v & ~0x7F) == 0) { bytes[pos++] = ((byte) v); return 1 + offset; } while (true) { if ((v & ~0x7F) == 0) { bytes[pos++] = ((byte) v); return pos; } else { bytes[pos++] = (byte) ((v & 0x7F) | 0x80); v >>>= 7; } } }
[ "public", "static", "int", "writeIntAsVarIntBytes", "(", "int", "intVal", ",", "byte", "[", "]", "bytes", ",", "int", "offset", ")", "{", "int", "pos", "=", "offset", ";", "int", "v", "=", "intVal", ";", "if", "(", "(", "v", "&", "~", "0x7F", ")", ...
Writes an integer to the byte array in the Varint format. @param intVal - integer value to write to the bytes buffer in the Varint format @param bytes - byte buffer to write to - must contain enough space for maximum length which is 5 bytes. @param offset - the offset within the bytes buffer to start writing @return - returns the number of bytes used from the bytes buffer
[ "Writes", "an", "integer", "to", "the", "byte", "array", "in", "the", "Varint", "format", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.cache/src/com/ibm/ws/session/store/cache/TypeConversion.java#L244-L262
querydsl/querydsl
querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java
Configuration.registerType
public void registerType(String typeName, Class<?> clazz) { typeToName.put(typeName.toLowerCase(), clazz); }
java
public void registerType(String typeName, Class<?> clazz) { typeToName.put(typeName.toLowerCase(), clazz); }
[ "public", "void", "registerType", "(", "String", "typeName", ",", "Class", "<", "?", ">", "clazz", ")", "{", "typeToName", ".", "put", "(", "typeName", ".", "toLowerCase", "(", ")", ",", "clazz", ")", ";", "}" ]
Register a typeName to Class mapping @param typeName SQL type name @param clazz java type
[ "Register", "a", "typeName", "to", "Class", "mapping" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java#L434-L436
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java
ElemTemplateElement.containsExcludeResultPrefix
public boolean containsExcludeResultPrefix(String prefix, String uri) { ElemTemplateElement parent = this.getParentElem(); if(null != parent) return parent.containsExcludeResultPrefix(prefix, uri); return false; }
java
public boolean containsExcludeResultPrefix(String prefix, String uri) { ElemTemplateElement parent = this.getParentElem(); if(null != parent) return parent.containsExcludeResultPrefix(prefix, uri); return false; }
[ "public", "boolean", "containsExcludeResultPrefix", "(", "String", "prefix", ",", "String", "uri", ")", "{", "ElemTemplateElement", "parent", "=", "this", ".", "getParentElem", "(", ")", ";", "if", "(", "null", "!=", "parent", ")", "return", "parent", ".", "...
Get whether or not the passed URL is contained flagged by the "extension-element-prefixes" property. This method is overridden by {@link ElemLiteralResult#containsExcludeResultPrefix}. @see <a href="http://www.w3.org/TR/xslt#extension-element">extension-element in XSLT Specification</a> @param prefix non-null reference to prefix that might be excluded. @return true if the prefix should normally be excluded.
[ "Get", "whether", "or", "not", "the", "passed", "URL", "is", "contained", "flagged", "by", "the", "extension", "-", "element", "-", "prefixes", "property", ".", "This", "method", "is", "overridden", "by", "{", "@link", "ElemLiteralResult#containsExcludeResultPrefi...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java#L980-L987
roboconf/roboconf-platform
core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java
ManifestUtils.findManifestProperty
public static String findManifestProperty( Properties props, String propertyName ) { String result = null; for( Map.Entry<Object,Object> entry : props.entrySet()) { if( propertyName.equalsIgnoreCase( String.valueOf( entry.getKey()))) { result = String.valueOf( entry.getValue()); break; } } return result; }
java
public static String findManifestProperty( Properties props, String propertyName ) { String result = null; for( Map.Entry<Object,Object> entry : props.entrySet()) { if( propertyName.equalsIgnoreCase( String.valueOf( entry.getKey()))) { result = String.valueOf( entry.getValue()); break; } } return result; }
[ "public", "static", "String", "findManifestProperty", "(", "Properties", "props", ",", "String", "propertyName", ")", "{", "String", "result", "=", "null", ";", "for", "(", "Map", ".", "Entry", "<", "Object", ",", "Object", ">", "entry", ":", "props", ".",...
Finds a property in the MANIFEST properties. @param props the properties @param propertyName the property's name @return the property's value, or null if it was not found
[ "Finds", "a", "property", "in", "the", "MANIFEST", "properties", "." ]
train
https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/ManifestUtils.java#L126-L137
jfinal/jfinal
src/main/java/com/jfinal/plugin/activerecord/DbPro.java
DbPro.batchUpdate
public int[] batchUpdate(String tableName, List<Record> recordList, int batchSize) { return batchUpdate(tableName, config.dialect.getDefaultPrimaryKey(),recordList, batchSize); }
java
public int[] batchUpdate(String tableName, List<Record> recordList, int batchSize) { return batchUpdate(tableName, config.dialect.getDefaultPrimaryKey(),recordList, batchSize); }
[ "public", "int", "[", "]", "batchUpdate", "(", "String", "tableName", ",", "List", "<", "Record", ">", "recordList", ",", "int", "batchSize", ")", "{", "return", "batchUpdate", "(", "tableName", ",", "config", ".", "dialect", ".", "getDefaultPrimaryKey", "("...
Batch update records with default primary key, using the columns names of the first record in recordList. Ensure all the records can use the same sql as the first record. @param tableName the table name
[ "Batch", "update", "records", "with", "default", "primary", "key", "using", "the", "columns", "names", "of", "the", "first", "record", "in", "recordList", ".", "Ensure", "all", "the", "records", "can", "use", "the", "same", "sql", "as", "the", "first", "re...
train
https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L1257-L1259
dyu/protostuff-1.0.x
protostuff-me/src/main/java/com/dyuproject/protostuff/me/GraphIOUtil.java
GraphIOUtil.mergeFrom
public static void mergeFrom(byte[] data, Object message, Schema schema) { mergeFrom(data, 0, data.length, message, schema); }
java
public static void mergeFrom(byte[] data, Object message, Schema schema) { mergeFrom(data, 0, data.length, message, schema); }
[ "public", "static", "void", "mergeFrom", "(", "byte", "[", "]", "data", ",", "Object", "message", ",", "Schema", "schema", ")", "{", "mergeFrom", "(", "data", ",", "0", ",", "data", ".", "length", ",", "message", ",", "schema", ")", ";", "}" ]
Merges the {@code message} with the byte array using the given {@code schema}.
[ "Merges", "the", "{" ]
train
https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-me/src/main/java/com/dyuproject/protostuff/me/GraphIOUtil.java#L37-L40
mabe02/lanterna
src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java
TableModel.getCell
public synchronized V getCell(int columnIndex, int rowIndex) { if(rowIndex < 0 || columnIndex < 0) { throw new IndexOutOfBoundsException("Invalid row or column index: " + rowIndex + " " + columnIndex); } else if (rowIndex >= getRowCount()) { throw new IndexOutOfBoundsException("TableModel has " + getRowCount() + " rows, invalid access at rowIndex " + rowIndex); } if(columnIndex >= getColumnCount()) { throw new IndexOutOfBoundsException("TableModel has " + columnIndex + " columns, invalid access at columnIndex " + columnIndex); } return rows.get(rowIndex).get(columnIndex); }
java
public synchronized V getCell(int columnIndex, int rowIndex) { if(rowIndex < 0 || columnIndex < 0) { throw new IndexOutOfBoundsException("Invalid row or column index: " + rowIndex + " " + columnIndex); } else if (rowIndex >= getRowCount()) { throw new IndexOutOfBoundsException("TableModel has " + getRowCount() + " rows, invalid access at rowIndex " + rowIndex); } if(columnIndex >= getColumnCount()) { throw new IndexOutOfBoundsException("TableModel has " + columnIndex + " columns, invalid access at columnIndex " + columnIndex); } return rows.get(rowIndex).get(columnIndex); }
[ "public", "synchronized", "V", "getCell", "(", "int", "columnIndex", ",", "int", "rowIndex", ")", "{", "if", "(", "rowIndex", "<", "0", "||", "columnIndex", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"Invalid row or column index: \""...
Returns the cell value stored at a specific column/row coordinate. @param columnIndex Column index of the cell @param rowIndex Row index of the cell @return The data value stored in this cell
[ "Returns", "the", "cell", "value", "stored", "at", "a", "specific", "column", "/", "row", "coordinate", "." ]
train
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/table/TableModel.java#L284-L295
etnetera/seb
src/main/java/cz/etnetera/seb/listener/SebListener.java
SebListener.saveFile
protected void saveFile(SebEvent event, String content, String name, String extension) { event.saveFile(content, getListenerFileName(name), extension); }
java
protected void saveFile(SebEvent event, String content, String name, String extension) { event.saveFile(content, getListenerFileName(name), extension); }
[ "protected", "void", "saveFile", "(", "SebEvent", "event", ",", "String", "content", ",", "String", "name", ",", "String", "extension", ")", "{", "event", ".", "saveFile", "(", "content", ",", "getListenerFileName", "(", "name", ")", ",", "extension", ")", ...
Save string content into output file with given name and extension. @param event @param content @param name @param extension
[ "Save", "string", "content", "into", "output", "file", "with", "given", "name", "and", "extension", "." ]
train
https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/listener/SebListener.java#L437-L439
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/translator/DocumentReferenceTranslator.java
DocumentReferenceTranslator.toDomDocument
public Document toDomDocument(Object obj, boolean tryProviders) throws TranslationException { if (this instanceof XmlDocumentTranslator) return ((XmlDocumentTranslator)this).toDomDocument(obj); else throw new UnsupportedOperationException("Translator: " + this.getClass().getName() + " does not implement" + XmlDocumentTranslator.class.getName()); }
java
public Document toDomDocument(Object obj, boolean tryProviders) throws TranslationException { if (this instanceof XmlDocumentTranslator) return ((XmlDocumentTranslator)this).toDomDocument(obj); else throw new UnsupportedOperationException("Translator: " + this.getClass().getName() + " does not implement" + XmlDocumentTranslator.class.getName()); }
[ "public", "Document", "toDomDocument", "(", "Object", "obj", ",", "boolean", "tryProviders", ")", "throws", "TranslationException", "{", "if", "(", "this", "instanceof", "XmlDocumentTranslator", ")", "return", "(", "(", "XmlDocumentTranslator", ")", "this", ")", "...
Default implementation ignores providers. Override to try registry lookup.
[ "Default", "implementation", "ignores", "providers", ".", "Override", "to", "try", "registry", "lookup", "." ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/translator/DocumentReferenceTranslator.java#L70-L75
tupilabs/tap4j
tap4j/src/main/java/org/tap4j/model/TapElementFactory.java
TapElementFactory.addComment
public static void addComment(TapElement element, String comment) { if (comment != null && comment.trim().length() > 0) { element.setComment(new Comment(comment, true)); } }
java
public static void addComment(TapElement element, String comment) { if (comment != null && comment.trim().length() > 0) { element.setComment(new Comment(comment, true)); } }
[ "public", "static", "void", "addComment", "(", "TapElement", "element", ",", "String", "comment", ")", "{", "if", "(", "comment", "!=", "null", "&&", "comment", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ")", "{", "element", ".", "setC...
Add a comment to a {@link TapElement}, as long as the comment is not empty. @param element TAP element @param comment a comment
[ "Add", "a", "comment", "to", "a", "{" ]
train
https://github.com/tupilabs/tap4j/blob/1793b653ce7f3a06a7b5c9557cdf601e28dd1f55/tap4j/src/main/java/org/tap4j/model/TapElementFactory.java#L147-L151
micronaut-projects/micronaut-core
inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java
AbstractBeanDefinition.streamOfTypeForConstructorArgument
@SuppressWarnings("WeakerAccess") @Internal protected final Stream streamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, @SuppressWarnings("unused") ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument) { return resolveBeanWithGenericsFromConstructorArgument(resolutionContext, argument, (beanType, qualifier) -> ((DefaultBeanContext) context).streamOfType(resolutionContext, beanType, qualifier) ); }
java
@SuppressWarnings("WeakerAccess") @Internal protected final Stream streamOfTypeForConstructorArgument(BeanResolutionContext resolutionContext, BeanContext context, @SuppressWarnings("unused") ConstructorInjectionPoint<T> constructorInjectionPoint, Argument argument) { return resolveBeanWithGenericsFromConstructorArgument(resolutionContext, argument, (beanType, qualifier) -> ((DefaultBeanContext) context).streamOfType(resolutionContext, beanType, qualifier) ); }
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "@", "Internal", "protected", "final", "Stream", "streamOfTypeForConstructorArgument", "(", "BeanResolutionContext", "resolutionContext", ",", "BeanContext", "context", ",", "@", "SuppressWarnings", "(", "\"unused\"", ...
Obtains all bean definitions for a constructor argument at the given index <p> Warning: this method is used by internal generated code and should not be called by user code. @param resolutionContext The resolution context @param context The context @param constructorInjectionPoint The constructor injection point @param argument The argument @return The resolved bean
[ "Obtains", "all", "bean", "definitions", "for", "a", "constructor", "argument", "at", "the", "given", "index", "<p", ">", "Warning", ":", "this", "method", "is", "used", "by", "internal", "generated", "code", "and", "should", "not", "be", "called", "by", "...
train
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L1105-L1111
jenkinsci/jenkins
core/src/main/java/hudson/model/listeners/ItemListener.java
ItemListener.fireLocationChange
public static void fireLocationChange(final Item rootItem, final String oldFullName) { String prefix = rootItem.getParent().getFullName(); if (!prefix.isEmpty()) { prefix += '/'; } final String newFullName = rootItem.getFullName(); assert newFullName.startsWith(prefix); int prefixS = prefix.length(); if (oldFullName.startsWith(prefix) && oldFullName.indexOf('/', prefixS) == -1) { final String oldName = oldFullName.substring(prefixS); final String newName = rootItem.getName(); assert newName.equals(newFullName.substring(prefixS)); forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onRenamed(rootItem, oldName, newName); return null; } }); } forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onLocationChanged(rootItem, oldFullName, newFullName); return null; } }); if (rootItem instanceof ItemGroup) { for (final Item child : Items.allItems(ACL.SYSTEM, (ItemGroup)rootItem, Item.class)) { final String childNew = child.getFullName(); assert childNew.startsWith(newFullName); assert childNew.charAt(newFullName.length()) == '/'; final String childOld = oldFullName + childNew.substring(newFullName.length()); forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onLocationChanged(child, childOld, childNew); return null; } }); } } }
java
public static void fireLocationChange(final Item rootItem, final String oldFullName) { String prefix = rootItem.getParent().getFullName(); if (!prefix.isEmpty()) { prefix += '/'; } final String newFullName = rootItem.getFullName(); assert newFullName.startsWith(prefix); int prefixS = prefix.length(); if (oldFullName.startsWith(prefix) && oldFullName.indexOf('/', prefixS) == -1) { final String oldName = oldFullName.substring(prefixS); final String newName = rootItem.getName(); assert newName.equals(newFullName.substring(prefixS)); forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onRenamed(rootItem, oldName, newName); return null; } }); } forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onLocationChanged(rootItem, oldFullName, newFullName); return null; } }); if (rootItem instanceof ItemGroup) { for (final Item child : Items.allItems(ACL.SYSTEM, (ItemGroup)rootItem, Item.class)) { final String childNew = child.getFullName(); assert childNew.startsWith(newFullName); assert childNew.charAt(newFullName.length()) == '/'; final String childOld = oldFullName + childNew.substring(newFullName.length()); forAll(new Function<ItemListener, Void>() { @Override public Void apply(ItemListener l) { l.onLocationChanged(child, childOld, childNew); return null; } }); } } }
[ "public", "static", "void", "fireLocationChange", "(", "final", "Item", "rootItem", ",", "final", "String", "oldFullName", ")", "{", "String", "prefix", "=", "rootItem", ".", "getParent", "(", ")", ".", "getFullName", "(", ")", ";", "if", "(", "!", "prefix...
Calls {@link #onRenamed} and {@link #onLocationChanged} as appropriate. @param rootItem the topmost item whose location has just changed @param oldFullName the previous {@link Item#getFullName} @since 1.548
[ "Calls", "{" ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/listeners/ItemListener.java#L249-L288
sporniket/core
sporniket-core-strings/src/main/java/com/sporniket/strings/QuickDiff.java
QuickDiff.getTextLine
private String getTextLine(String[] textLines, int line) { return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line]; }
java
private String getTextLine(String[] textLines, int line) { return (isIgnoreTrailingWhiteSpaces()) ? textLines[line].trim() : textLines[line]; }
[ "private", "String", "getTextLine", "(", "String", "[", "]", "textLines", ",", "int", "line", ")", "{", "return", "(", "isIgnoreTrailingWhiteSpaces", "(", ")", ")", "?", "textLines", "[", "line", "]", ".", "trim", "(", ")", ":", "textLines", "[", "line",...
Return the specified line from the text. @param textLines The source text as an array of lines. @param line The line to return. @return the line as is, or trimed, according to {@link #isIgnoreTrailingWhiteSpaces()}.
[ "Return", "the", "specified", "line", "from", "the", "text", "." ]
train
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-strings/src/main/java/com/sporniket/strings/QuickDiff.java#L324-L327
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java
VmlGraphicsContext.unhide
public void unhide(Object group, String name) { if (isAttached()) { Element element = helper.getElement(group, name); if (element != null) { Dom.setStyleAttribute(element, "visibility", "inherit"); } } }
java
public void unhide(Object group, String name) { if (isAttached()) { Element element = helper.getElement(group, name); if (element != null) { Dom.setStyleAttribute(element, "visibility", "inherit"); } } }
[ "public", "void", "unhide", "(", "Object", "group", ",", "String", "name", ")", "{", "if", "(", "isAttached", "(", ")", ")", "{", "Element", "element", "=", "helper", ".", "getElement", "(", "group", ",", "name", ")", ";", "if", "(", "element", "!=",...
Show the specified element in the specified group. If the element does not exist, nothing will happen. @param group The group object. @param name The element name.
[ "Show", "the", "specified", "element", "in", "the", "specified", "group", ".", "If", "the", "element", "does", "not", "exist", "nothing", "will", "happen", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/VmlGraphicsContext.java#L699-L706
looly/hutool
hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java
HandleHelper.handleRow
public static <T extends Entity> T handleRow(T row, int columnCount, ResultSetMetaData meta, ResultSet rs, boolean withMetaInfo) throws SQLException { String columnLabel; int type; for (int i = 1; i <= columnCount; i++) { columnLabel = meta.getColumnLabel(i); type = meta.getColumnType(i); row.put(columnLabel, getColumnValue(rs, columnLabel, type, null)); } if (withMetaInfo) { row.setTableName(meta.getTableName(1)); row.setFieldNames(row.keySet()); } return row; }
java
public static <T extends Entity> T handleRow(T row, int columnCount, ResultSetMetaData meta, ResultSet rs, boolean withMetaInfo) throws SQLException { String columnLabel; int type; for (int i = 1; i <= columnCount; i++) { columnLabel = meta.getColumnLabel(i); type = meta.getColumnType(i); row.put(columnLabel, getColumnValue(rs, columnLabel, type, null)); } if (withMetaInfo) { row.setTableName(meta.getTableName(1)); row.setFieldNames(row.keySet()); } return row; }
[ "public", "static", "<", "T", "extends", "Entity", ">", "T", "handleRow", "(", "T", "row", ",", "int", "columnCount", ",", "ResultSetMetaData", "meta", ",", "ResultSet", "rs", ",", "boolean", "withMetaInfo", ")", "throws", "SQLException", "{", "String", "col...
处理单条数据 @param <T> Entity及其子对象 @param row Entity对象 @param columnCount 列数 @param meta ResultSetMetaData @param rs 数据集 @param withMetaInfo 是否包含表名、字段名等元信息 @return 每一行的Entity @throws SQLException SQL执行异常 @since 3.3.1
[ "处理单条数据" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L128-L141
graphql-java/graphql-java
src/main/java/graphql/execution/ValuesResolver.java
ValuesResolver.coerceArgumentValues
public Map<String, Object> coerceArgumentValues(GraphQLSchema schema, List<VariableDefinition> variableDefinitions, Map<String, Object> variableValues) { GraphqlFieldVisibility fieldVisibility = schema.getFieldVisibility(); Map<String, Object> coercedValues = new LinkedHashMap<>(); for (VariableDefinition variableDefinition : variableDefinitions) { String variableName = variableDefinition.getName(); GraphQLType variableType = TypeFromAST.getTypeFromAST(schema, variableDefinition.getType()); // 3.e if (!variableValues.containsKey(variableName)) { Value defaultValue = variableDefinition.getDefaultValue(); if (defaultValue != null) { // 3.e.i Object coercedValue = coerceValueAst(fieldVisibility, variableType, variableDefinition.getDefaultValue(), null); coercedValues.put(variableName, coercedValue); } else if (isNonNull(variableType)) { // 3.e.ii throw new NonNullableValueCoercedAsNullException(variableDefinition, variableType); } } else { Object value = variableValues.get(variableName); // 3.f Object coercedValue = getVariableValue(fieldVisibility, variableDefinition, variableType, value); // 3.g coercedValues.put(variableName, coercedValue); } } return coercedValues; }
java
public Map<String, Object> coerceArgumentValues(GraphQLSchema schema, List<VariableDefinition> variableDefinitions, Map<String, Object> variableValues) { GraphqlFieldVisibility fieldVisibility = schema.getFieldVisibility(); Map<String, Object> coercedValues = new LinkedHashMap<>(); for (VariableDefinition variableDefinition : variableDefinitions) { String variableName = variableDefinition.getName(); GraphQLType variableType = TypeFromAST.getTypeFromAST(schema, variableDefinition.getType()); // 3.e if (!variableValues.containsKey(variableName)) { Value defaultValue = variableDefinition.getDefaultValue(); if (defaultValue != null) { // 3.e.i Object coercedValue = coerceValueAst(fieldVisibility, variableType, variableDefinition.getDefaultValue(), null); coercedValues.put(variableName, coercedValue); } else if (isNonNull(variableType)) { // 3.e.ii throw new NonNullableValueCoercedAsNullException(variableDefinition, variableType); } } else { Object value = variableValues.get(variableName); // 3.f Object coercedValue = getVariableValue(fieldVisibility, variableDefinition, variableType, value); // 3.g coercedValues.put(variableName, coercedValue); } } return coercedValues; }
[ "public", "Map", "<", "String", ",", "Object", ">", "coerceArgumentValues", "(", "GraphQLSchema", "schema", ",", "List", "<", "VariableDefinition", ">", "variableDefinitions", ",", "Map", "<", "String", ",", "Object", ">", "variableValues", ")", "{", "GraphqlFie...
The http://facebook.github.io/graphql/#sec-Coercing-Variable-Values says : <pre> 1. Let coercedValues be an empty unordered Map. 2. Let variableDefinitions be the variables defined by operation. 3. For each variableDefinition in variableDefinitions: a. Let variableName be the name of variableDefinition. b. Let variableType be the expected type of variableDefinition. c. Let defaultValue be the default value for variableDefinition. d. Let value be the value provided in variableValues for the name variableName. e. If value does not exist (was not provided in variableValues): i. If defaultValue exists (including null): 1. Add an entry to coercedValues named variableName with the value defaultValue. ii. Otherwise if variableType is a Non‐Nullable type, throw a query error. iii. Otherwise, continue to the next variable definition. f. Otherwise, if value cannot be coerced according to the input coercion rules of variableType, throw a query error. g. Let coercedValue be the result of coercing value according to the input coercion rules of variableType. h. Add an entry to coercedValues named variableName with the value coercedValue. 4. Return coercedValues. </pre> @param schema the schema @param variableDefinitions the variable definitions @param variableValues the supplied variables @return coerced variable values as a map
[ "The", "http", ":", "//", "facebook", ".", "github", ".", "io", "/", "graphql", "/", "#sec", "-", "Coercing", "-", "Variable", "-", "Values", "says", ":" ]
train
https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ValuesResolver.java#L70-L98
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FileSystem.java
FileSystem.listLocatedBlockStatus
public RemoteIterator<LocatedBlockFileStatus> listLocatedBlockStatus( final Path f) throws FileNotFoundException, IOException { return listLocatedBlockStatus(f, DEFAULT_FILTER); }
java
public RemoteIterator<LocatedBlockFileStatus> listLocatedBlockStatus( final Path f) throws FileNotFoundException, IOException { return listLocatedBlockStatus(f, DEFAULT_FILTER); }
[ "public", "RemoteIterator", "<", "LocatedBlockFileStatus", ">", "listLocatedBlockStatus", "(", "final", "Path", "f", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "return", "listLocatedBlockStatus", "(", "f", ",", "DEFAULT_FILTER", ")", ";", "}" ]
List the statuses of the files/directories in the given path if the path is a directory. Return the file's status, blocks and locations if the path is a file. If a returned status is a file, it contains the file's blocks and locations. @param f is the path @return an iterator that traverses statuses of the files/directories in the given path @throws FileNotFoundException If <code>f</code> does not exist @throws IOException If an I/O error occurred
[ "List", "the", "statuses", "of", "the", "files", "/", "directories", "in", "the", "given", "path", "if", "the", "path", "is", "a", "directory", ".", "Return", "the", "file", "s", "status", "blocks", "and", "locations", "if", "the", "path", "is", "a", "...
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1107-L1110
ludovicianul/selenium-on-steroids
src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java
WebDriverHelper.goToUrlWithCookie
public void goToUrlWithCookie(final String url, final String cookieName, final String cookieValue) { // we'll do a trick to prevent Selenium falsely reporting a cross // domain cookie attempt LOG.info("Getting: " + url + " with cookieName: " + cookieName + " and cookieValue: " + cookieValue); driver.get(url + "/404.html"); // this should display 404 not found driver.manage().deleteAllCookies(); driver.manage().addCookie(new Cookie(cookieName, cookieValue)); driver.get(url); }
java
public void goToUrlWithCookie(final String url, final String cookieName, final String cookieValue) { // we'll do a trick to prevent Selenium falsely reporting a cross // domain cookie attempt LOG.info("Getting: " + url + " with cookieName: " + cookieName + " and cookieValue: " + cookieValue); driver.get(url + "/404.html"); // this should display 404 not found driver.manage().deleteAllCookies(); driver.manage().addCookie(new Cookie(cookieName, cookieValue)); driver.get(url); }
[ "public", "void", "goToUrlWithCookie", "(", "final", "String", "url", ",", "final", "String", "cookieName", ",", "final", "String", "cookieValue", ")", "{", "// we'll do a trick to prevent Selenium falsely reporting a cross", "// domain cookie attempt", "LOG", ".", "info", ...
Opens the specified URL using the specified cookie. @param url the url you want to open @param cookieName the cookie name @param cookieValue the cookie value
[ "Opens", "the", "specified", "URL", "using", "the", "specified", "cookie", "." ]
train
https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/webdriver/WebDriverHelper.java#L1115-L1125
aws/aws-sdk-java
aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/JsonContent.java
JsonContent.createJsonContent
public static JsonContent createJsonContent(HttpResponse httpResponse, JsonFactory jsonFactory) { byte[] rawJsonContent = null; try { if (httpResponse.getContent() != null) { rawJsonContent = IOUtils.toByteArray(httpResponse.getContent()); } } catch (Exception e) { LOG.debug("Unable to read HTTP response content", e); } return new JsonContent(rawJsonContent, new ObjectMapper(jsonFactory) .configure(JsonParser.Feature.ALLOW_COMMENTS, true)); }
java
public static JsonContent createJsonContent(HttpResponse httpResponse, JsonFactory jsonFactory) { byte[] rawJsonContent = null; try { if (httpResponse.getContent() != null) { rawJsonContent = IOUtils.toByteArray(httpResponse.getContent()); } } catch (Exception e) { LOG.debug("Unable to read HTTP response content", e); } return new JsonContent(rawJsonContent, new ObjectMapper(jsonFactory) .configure(JsonParser.Feature.ALLOW_COMMENTS, true)); }
[ "public", "static", "JsonContent", "createJsonContent", "(", "HttpResponse", "httpResponse", ",", "JsonFactory", "jsonFactory", ")", "{", "byte", "[", "]", "rawJsonContent", "=", "null", ";", "try", "{", "if", "(", "httpResponse", ".", "getContent", "(", ")", ...
Static factory method to create a JsonContent object from the contents of the HttpResponse provided
[ "Static", "factory", "method", "to", "create", "a", "JsonContent", "object", "from", "the", "contents", "of", "the", "HttpResponse", "provided" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/protocol/json/JsonContent.java#L43-L55
jenkinsci/jenkins
core/src/main/java/hudson/model/Computer.java
Computer.getDisplayExecutors
@Restricted(NoExternalUse.class) public List<DisplayExecutor> getDisplayExecutors() { // The size may change while we are populating, but let's start with a reasonable guess to minimize resizing List<DisplayExecutor> result = new ArrayList<>(executors.size() + oneOffExecutors.size()); int index = 0; for (Executor e: executors) { if (e.isDisplayCell()) { result.add(new DisplayExecutor(Integer.toString(index + 1), String.format("executors/%d", index), e)); } index++; } index = 0; for (OneOffExecutor e: oneOffExecutors) { if (e.isDisplayCell()) { result.add(new DisplayExecutor("", String.format("oneOffExecutors/%d", index), e)); } index++; } return result; }
java
@Restricted(NoExternalUse.class) public List<DisplayExecutor> getDisplayExecutors() { // The size may change while we are populating, but let's start with a reasonable guess to minimize resizing List<DisplayExecutor> result = new ArrayList<>(executors.size() + oneOffExecutors.size()); int index = 0; for (Executor e: executors) { if (e.isDisplayCell()) { result.add(new DisplayExecutor(Integer.toString(index + 1), String.format("executors/%d", index), e)); } index++; } index = 0; for (OneOffExecutor e: oneOffExecutors) { if (e.isDisplayCell()) { result.add(new DisplayExecutor("", String.format("oneOffExecutors/%d", index), e)); } index++; } return result; }
[ "@", "Restricted", "(", "NoExternalUse", ".", "class", ")", "public", "List", "<", "DisplayExecutor", ">", "getDisplayExecutors", "(", ")", "{", "// The size may change while we are populating, but let's start with a reasonable guess to minimize resizing", "List", "<", "Display...
Used to render the list of executors. @return a snapshot of the executor display information @since 1.607
[ "Used", "to", "render", "the", "list", "of", "executors", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Computer.java#L997-L1016
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java
PrimaveraReader.processProjectProperties
public void processProjectProperties(List<Row> rows, Integer projectID) { if (rows.isEmpty() == false) { Row row = rows.get(0); ProjectProperties properties = m_project.getProjectProperties(); properties.setCreationDate(row.getDate("create_date")); properties.setFinishDate(row.getDate("plan_end_date")); properties.setName(row.getString("proj_short_name")); properties.setStartDate(row.getDate("plan_start_date")); // data_date? properties.setDefaultTaskType(TASK_TYPE_MAP.get(row.getString("def_duration_type"))); properties.setStatusDate(row.getDate("last_recalc_date")); properties.setFiscalYearStartMonth(row.getInteger("fy_start_month_num")); properties.setUniqueID(projectID == null ? null : projectID.toString()); properties.setExportFlag(row.getBoolean("export_flag")); // cannot assign actual calendar yet as it has not been read yet m_defaultCalendarID = row.getInteger("clndr_id"); } }
java
public void processProjectProperties(List<Row> rows, Integer projectID) { if (rows.isEmpty() == false) { Row row = rows.get(0); ProjectProperties properties = m_project.getProjectProperties(); properties.setCreationDate(row.getDate("create_date")); properties.setFinishDate(row.getDate("plan_end_date")); properties.setName(row.getString("proj_short_name")); properties.setStartDate(row.getDate("plan_start_date")); // data_date? properties.setDefaultTaskType(TASK_TYPE_MAP.get(row.getString("def_duration_type"))); properties.setStatusDate(row.getDate("last_recalc_date")); properties.setFiscalYearStartMonth(row.getInteger("fy_start_month_num")); properties.setUniqueID(projectID == null ? null : projectID.toString()); properties.setExportFlag(row.getBoolean("export_flag")); // cannot assign actual calendar yet as it has not been read yet m_defaultCalendarID = row.getInteger("clndr_id"); } }
[ "public", "void", "processProjectProperties", "(", "List", "<", "Row", ">", "rows", ",", "Integer", "projectID", ")", "{", "if", "(", "rows", ".", "isEmpty", "(", ")", "==", "false", ")", "{", "Row", "row", "=", "rows", ".", "get", "(", "0", ")", "...
Process project properties. @param rows project properties data. @param projectID project ID
[ "Process", "project", "properties", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L157-L175
micrometer-metrics/micrometer
micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/ConcurrentMapCacheMetrics.java
ConcurrentMapCacheMetrics.monitor
public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, Iterable<Tag> tags) { new ConcurrentMapCacheMetrics(cache, tags).bindTo(registry); return cache; }
java
public static ConcurrentMapCache monitor(MeterRegistry registry, ConcurrentMapCache cache, Iterable<Tag> tags) { new ConcurrentMapCacheMetrics(cache, tags).bindTo(registry); return cache; }
[ "public", "static", "ConcurrentMapCache", "monitor", "(", "MeterRegistry", "registry", ",", "ConcurrentMapCache", "cache", ",", "Iterable", "<", "Tag", ">", "tags", ")", "{", "new", "ConcurrentMapCacheMetrics", "(", "cache", ",", "tags", ")", ".", "bindTo", "(",...
Record metrics on a ConcurrentMapCache cache. @param registry The registry to bind metrics to. @param cache The cache to instrument. @param tags Tags to apply to all recorded metrics. @return The instrumented cache, unchanged. The original cache is not wrapped or proxied in any way.
[ "Record", "metrics", "on", "a", "ConcurrentMapCache", "cache", "." ]
train
https://github.com/micrometer-metrics/micrometer/blob/127fa3265325cc894f368312ed8890b76a055d88/micrometer-spring-legacy/src/main/java/io/micrometer/spring/cache/ConcurrentMapCacheMetrics.java#L54-L57
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java
OperandStackStateGenerators.loadOperandStack
public static InsnList loadOperandStack(MarkerType markerType, StorageVariables storageVars, Frame<BasicValue> frame) { return loadOperandStack(markerType, storageVars, frame, 0, 0, frame.getStackSize()); }
java
public static InsnList loadOperandStack(MarkerType markerType, StorageVariables storageVars, Frame<BasicValue> frame) { return loadOperandStack(markerType, storageVars, frame, 0, 0, frame.getStackSize()); }
[ "public", "static", "InsnList", "loadOperandStack", "(", "MarkerType", "markerType", ",", "StorageVariables", "storageVars", ",", "Frame", "<", "BasicValue", ">", "frame", ")", "{", "return", "loadOperandStack", "(", "markerType", ",", "storageVars", ",", "frame", ...
Generates instructions to load the entire operand stack. Equivalent to calling {@code loadOperandStack(markerType, storageVars, frame, 0, 0, frame.getStackSize())}. @param markerType debug marker type @param storageVars variables to load operand stack from @param frame execution frame at the instruction where the operand stack is to be loaded @return instructions to load the operand stack from the storage variables @throws NullPointerException if any argument is {@code null}
[ "Generates", "instructions", "to", "load", "the", "entire", "operand", "stack", ".", "Equivalent", "to", "calling", "{" ]
train
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java#L98-L100
OpenLiberty/open-liberty
dev/com.ibm.ws.security/src/com/ibm/ws/security/AccessIdUtil.java
AccessIdUtil.createAccessId
public static String createAccessId(String type, String realm, String uniqueId) { if (type == null || type.isEmpty()) { throw new IllegalArgumentException("An internal error occured. type is null"); } if (realm == null || realm.isEmpty()) { throw new IllegalArgumentException("An internal error occured. realm is null"); } if (uniqueId == null || uniqueId.isEmpty()) { throw new IllegalArgumentException("An internal error occured. uniqueId is null"); } return type + TYPE_SEPARATOR + realm + REALM_SEPARATOR + uniqueId; }
java
public static String createAccessId(String type, String realm, String uniqueId) { if (type == null || type.isEmpty()) { throw new IllegalArgumentException("An internal error occured. type is null"); } if (realm == null || realm.isEmpty()) { throw new IllegalArgumentException("An internal error occured. realm is null"); } if (uniqueId == null || uniqueId.isEmpty()) { throw new IllegalArgumentException("An internal error occured. uniqueId is null"); } return type + TYPE_SEPARATOR + realm + REALM_SEPARATOR + uniqueId; }
[ "public", "static", "String", "createAccessId", "(", "String", "type", ",", "String", "realm", ",", "String", "uniqueId", ")", "{", "if", "(", "type", "==", "null", "||", "type", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException...
Constructs the full access identifier: type:realm/uniqueId @param type Entity type, must not be null or empty @param realm Realm, must not be null or empty @param uniqueId Entity unique ID, must not be null or empty @return An accessId representing the entity. Will not be null.
[ "Constructs", "the", "full", "access", "identifier", ":", "type", ":", "realm", "/", "uniqueId" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/AccessIdUtil.java#L84-L95
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java
ExpressionUtils.predicate
public static PredicateOperation predicate(Operator operator, Expression<?>... args) { return predicate(operator, ImmutableList.copyOf(args)); }
java
public static PredicateOperation predicate(Operator operator, Expression<?>... args) { return predicate(operator, ImmutableList.copyOf(args)); }
[ "public", "static", "PredicateOperation", "predicate", "(", "Operator", "operator", ",", "Expression", "<", "?", ">", "...", "args", ")", "{", "return", "predicate", "(", "operator", ",", "ImmutableList", ".", "copyOf", "(", "args", ")", ")", ";", "}" ]
Create a new Operation expression @param operator operator @param args operation arguments @return operation expression
[ "Create", "a", "new", "Operation", "expression" ]
train
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L83-L85
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java
JanusConfig.getSystemPropertyAsClass
public static <S> Class<? extends S> getSystemPropertyAsClass(Class<S> type, String name) { return getSystemPropertyAsClass(type, name, (Class<S>) null); }
java
public static <S> Class<? extends S> getSystemPropertyAsClass(Class<S> type, String name) { return getSystemPropertyAsClass(type, name, (Class<S>) null); }
[ "public", "static", "<", "S", ">", "Class", "<", "?", "extends", "S", ">", "getSystemPropertyAsClass", "(", "Class", "<", "S", ">", "type", ",", "String", "name", ")", "{", "return", "getSystemPropertyAsClass", "(", "type", ",", "name", ",", "(", "Class"...
Replies the value of the type system property. @param <S> - type to reply. @param type - type to reply. @param name - name of the property. @return the type, or <code>null</code> if no property found.
[ "Replies", "the", "value", "of", "the", "type", "system", "property", "." ]
train
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/JanusConfig.java#L492-L494
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/IterateTablesProcessor.java
IterateTablesProcessor.checkRecordAnnotation
private void checkRecordAnnotation(final Class<?> tableClass, final AnnotationReader annoReader) { final int horizontalSize = FieldAccessorUtils.getPropertiesWithAnnotation( tableClass, annoReader, XlsHorizontalRecords.class) .size(); final int verticalSize = FieldAccessorUtils.getPropertiesWithAnnotation( tableClass, annoReader, XlsVerticalRecords.class) .size(); if(horizontalSize > 0 && verticalSize > 0) { throw new AnnotationInvalidException(MessageBuilder.create("anno.XlsIterateTables.horizontalAndVertical") .varWithClass("tableClass", tableClass) .format()); } }
java
private void checkRecordAnnotation(final Class<?> tableClass, final AnnotationReader annoReader) { final int horizontalSize = FieldAccessorUtils.getPropertiesWithAnnotation( tableClass, annoReader, XlsHorizontalRecords.class) .size(); final int verticalSize = FieldAccessorUtils.getPropertiesWithAnnotation( tableClass, annoReader, XlsVerticalRecords.class) .size(); if(horizontalSize > 0 && verticalSize > 0) { throw new AnnotationInvalidException(MessageBuilder.create("anno.XlsIterateTables.horizontalAndVertical") .varWithClass("tableClass", tableClass) .format()); } }
[ "private", "void", "checkRecordAnnotation", "(", "final", "Class", "<", "?", ">", "tableClass", ",", "final", "AnnotationReader", "annoReader", ")", "{", "final", "int", "horizontalSize", "=", "FieldAccessorUtils", ".", "getPropertiesWithAnnotation", "(", "tableClass"...
レコード用のアノテーションの整合性のチェックを行う。 <p>{@link XlsHorizontalRecords}と{@link XlsVerticalRecords}は、どちらか一方のみ指定可能。</p> @param tableClass テーブル用のクラス情報 @param annoReader アノテーションの提供クラス
[ "レコード用のアノテーションの整合性のチェックを行う。", "<p", ">", "{" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldprocessor/impl/IterateTablesProcessor.java#L195-L211
facebookarchive/hadoop-20
src/mapred/org/apache/hadoop/mapred/IFileInputStream.java
IFileInputStream.readWithChecksum
public int readWithChecksum(byte[] b, int off, int len) throws IOException { if (currentOffset == length) { return -1; } else if (currentOffset >= dataLength) { // If the previous read drained off all the data, then just return // the checksum now. Note that checksum validation would have // happened in the earlier read int lenToCopy = (int) (checksumSize - (currentOffset - dataLength)); if (len < lenToCopy) { lenToCopy = len; } System.arraycopy(csum, (int) (currentOffset - dataLength), b, off, lenToCopy); currentOffset += lenToCopy; return lenToCopy; } int bytesRead = doRead(b,off,len); if (currentOffset == dataLength) { if (len >= bytesRead + checksumSize) { System.arraycopy(csum, 0, b, off + bytesRead, checksumSize); bytesRead += checksumSize; currentOffset += checksumSize; } } return bytesRead; }
java
public int readWithChecksum(byte[] b, int off, int len) throws IOException { if (currentOffset == length) { return -1; } else if (currentOffset >= dataLength) { // If the previous read drained off all the data, then just return // the checksum now. Note that checksum validation would have // happened in the earlier read int lenToCopy = (int) (checksumSize - (currentOffset - dataLength)); if (len < lenToCopy) { lenToCopy = len; } System.arraycopy(csum, (int) (currentOffset - dataLength), b, off, lenToCopy); currentOffset += lenToCopy; return lenToCopy; } int bytesRead = doRead(b,off,len); if (currentOffset == dataLength) { if (len >= bytesRead + checksumSize) { System.arraycopy(csum, 0, b, off + bytesRead, checksumSize); bytesRead += checksumSize; currentOffset += checksumSize; } } return bytesRead; }
[ "public", "int", "readWithChecksum", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "currentOffset", "==", "length", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "currentO...
Read bytes from the stream. At EOF, checksum is validated and sent back as the last four bytes of the buffer. The caller should handle these bytes appropriately
[ "Read", "bytes", "from", "the", "stream", ".", "At", "EOF", "checksum", "is", "validated", "and", "sent", "back", "as", "the", "last", "four", "bytes", "of", "the", "buffer", ".", "The", "caller", "should", "handle", "these", "bytes", "appropriately" ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/IFileInputStream.java#L111-L140
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/message/event/ModelMessageHandler.java
ModelMessageHandler.init
public void init(BaseMessageReceiver messageReceiver, AbstractTableModel model) { super.init(messageReceiver, null); m_model = model; }
java
public void init(BaseMessageReceiver messageReceiver, AbstractTableModel model) { super.init(messageReceiver, null); m_model = model; }
[ "public", "void", "init", "(", "BaseMessageReceiver", "messageReceiver", ",", "AbstractTableModel", "model", ")", "{", "super", ".", "init", "(", "messageReceiver", ",", "null", ")", ";", "m_model", "=", "model", ";", "}" ]
Constructor. @param messageReceiver The message receiver that this listener is added to. @param model The target table model.
[ "Constructor", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/message/event/ModelMessageHandler.java#L74-L78
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java
CPInstancePersistenceImpl.findByCompanyId
@Override public List<CPInstance> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
java
@Override public List<CPInstance> findByCompanyId(long companyId, int start, int end) { return findByCompanyId(companyId, start, end, null); }
[ "@", "Override", "public", "List", "<", "CPInstance", ">", "findByCompanyId", "(", "long", "companyId", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByCompanyId", "(", "companyId", ",", "start", ",", "end", ",", "null", ")", ";", "}" ...
Returns a range of all the cp instances where companyId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CPInstanceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param companyId the company ID @param start the lower bound of the range of cp instances @param end the upper bound of the range of cp instances (not inclusive) @return the range of matching cp instances
[ "Returns", "a", "range", "of", "all", "the", "cp", "instances", "where", "companyId", "=", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L2028-L2031
GoogleCloudPlatform/appengine-mapreduce
java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java
SortWorker.spliceIn
private static int spliceIn(ByteBuffer src, ByteBuffer dest) { int position = dest.position(); int srcPos = src.position(); dest.put(src); src.position(srcPos); return position; }
java
private static int spliceIn(ByteBuffer src, ByteBuffer dest) { int position = dest.position(); int srcPos = src.position(); dest.put(src); src.position(srcPos); return position; }
[ "private", "static", "int", "spliceIn", "(", "ByteBuffer", "src", ",", "ByteBuffer", "dest", ")", "{", "int", "position", "=", "dest", ".", "position", "(", ")", ";", "int", "srcPos", "=", "src", ".", "position", "(", ")", ";", "dest", ".", "put", "(...
Write the contents of src to dest, without messing with src's position. @param dest (position is advanced) @return the pos in dest where src is written
[ "Write", "the", "contents", "of", "src", "to", "dest", "without", "messing", "with", "src", "s", "position", "." ]
train
https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/impl/sort/SortWorker.java#L364-L370
oasp/oasp4j
modules/security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java
AccessControlSchemaXmlMapper.writeXsd
public void writeXsd(final OutputStream out) { SchemaOutputResolver sor = new SchemaOutputResolver() { @Override public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { StreamResult streamResult = new StreamResult(out); streamResult.setSystemId(suggestedFileName); return streamResult; } }; try { this.jaxbContext.generateSchema(sor); } catch (IOException e) { throw new IllegalStateException("Failed to generate and write the XSD schema!", e); } }
java
public void writeXsd(final OutputStream out) { SchemaOutputResolver sor = new SchemaOutputResolver() { @Override public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException { StreamResult streamResult = new StreamResult(out); streamResult.setSystemId(suggestedFileName); return streamResult; } }; try { this.jaxbContext.generateSchema(sor); } catch (IOException e) { throw new IllegalStateException("Failed to generate and write the XSD schema!", e); } }
[ "public", "void", "writeXsd", "(", "final", "OutputStream", "out", ")", "{", "SchemaOutputResolver", "sor", "=", "new", "SchemaOutputResolver", "(", ")", "{", "@", "Override", "public", "Result", "createOutput", "(", "String", "namespaceUri", ",", "String", "sug...
Generates the XSD (XML Schema Definition) to the given {@link OutputStream}. @param out is the {@link OutputStream} to write to.
[ "Generates", "the", "XSD", "(", "XML", "Schema", "Definition", ")", "to", "the", "given", "{", "@link", "OutputStream", "}", "." ]
train
https://github.com/oasp/oasp4j/blob/03f90132699fad95e52ec8efa54aa391f8d3c7e4/modules/security/src/main/java/io/oasp/module/security/common/impl/accesscontrol/AccessControlSchemaXmlMapper.java#L100-L118
undertow-io/undertow
core/src/main/java/io/undertow/server/handlers/proxy/ProxyHandler.java
ProxyHandler.addRequestHeader
@Deprecated public ProxyHandler addRequestHeader(final HttpString header, final ExchangeAttribute attribute) { requestHeaders.put(header, attribute); return this; }
java
@Deprecated public ProxyHandler addRequestHeader(final HttpString header, final ExchangeAttribute attribute) { requestHeaders.put(header, attribute); return this; }
[ "@", "Deprecated", "public", "ProxyHandler", "addRequestHeader", "(", "final", "HttpString", "header", ",", "final", "ExchangeAttribute", "attribute", ")", "{", "requestHeaders", ".", "put", "(", "header", ",", "attribute", ")", ";", "return", "this", ";", "}" ]
Adds a request header to the outgoing request. If the header resolves to null or an empty string it will not be added, however any existing header with the same name will be removed. @param header The header name @param attribute The header value attribute. @return this
[ "Adds", "a", "request", "header", "to", "the", "outgoing", "request", ".", "If", "the", "header", "resolves", "to", "null", "or", "an", "empty", "string", "it", "will", "not", "be", "added", "however", "any", "existing", "header", "with", "the", "same", ...
train
https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/ProxyHandler.java#L223-L227
gallandarakhneorg/afc
advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java
BusItinerary.insertBusHaltAfter
public BusItineraryHalt insertBusHaltAfter(BusItineraryHalt afterHalt, String name, BusItineraryHaltType type) { return insertBusHaltAfter(afterHalt, null, name, type); }
java
public BusItineraryHalt insertBusHaltAfter(BusItineraryHalt afterHalt, String name, BusItineraryHaltType type) { return insertBusHaltAfter(afterHalt, null, name, type); }
[ "public", "BusItineraryHalt", "insertBusHaltAfter", "(", "BusItineraryHalt", "afterHalt", ",", "String", "name", ",", "BusItineraryHaltType", "type", ")", "{", "return", "insertBusHaltAfter", "(", "afterHalt", ",", "null", ",", "name", ",", "type", ")", ";", "}" ]
Insert newHalt after afterHalt in the ordered list of {@link BusItineraryHalt}. @param afterHalt the halt where insert the new halt @param name name of the new halt @param type the type of bus halt @return the added bus halt, otherwise <code>null</code>
[ "Insert", "newHalt", "after", "afterHalt", "in", "the", "ordered", "list", "of", "{", "@link", "BusItineraryHalt", "}", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1175-L1177
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBUtils.java
EJBUtils.methodsMatch
static boolean methodsMatch(Method m1, Method m2) { if (m1 == m2) { return true; } else if (m1.getName().equals(m2.getName())) { Class<?>[] parms1 = m1.getParameterTypes(); Class<?>[] parms2 = m2.getParameterTypes(); if (parms1.length == parms2.length) { int length = parms1.length; for (int i = 0; i < length; i++) { if (parms1[i] != parms2[i]) return false; } return true; } } return false; }
java
static boolean methodsMatch(Method m1, Method m2) { if (m1 == m2) { return true; } else if (m1.getName().equals(m2.getName())) { Class<?>[] parms1 = m1.getParameterTypes(); Class<?>[] parms2 = m2.getParameterTypes(); if (parms1.length == parms2.length) { int length = parms1.length; for (int i = 0; i < length; i++) { if (parms1[i] != parms2[i]) return false; } return true; } } return false; }
[ "static", "boolean", "methodsMatch", "(", "Method", "m1", ",", "Method", "m2", ")", "{", "if", "(", "m1", "==", "m2", ")", "{", "return", "true", ";", "}", "else", "if", "(", "m1", ".", "getName", "(", ")", ".", "equals", "(", "m2", ".", "getName...
Returns true for two methods that have the same name and parameters. <p> Similar to Method.equals(), except declaring class and return type are NOT considered. <p> Useful for determining when multiple component or business interfaces implement the same method... as they will both be mapped to the same methodId. <p> @param m1 first of two methods to compare @param m2 second of two methods to compare @return true if both methods have the same name and parameters; otherwise false.
[ "Returns", "true", "for", "two", "methods", "that", "have", "the", "same", "name", "and", "parameters", ".", "<p", ">" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBUtils.java#L118-L140
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.getCertificateIssuerAsync
public Observable<IssuerBundle> getCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() { @Override public IssuerBundle call(ServiceResponse<IssuerBundle> response) { return response.body(); } }); }
java
public Observable<IssuerBundle> getCertificateIssuerAsync(String vaultBaseUrl, String issuerName) { return getCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName).map(new Func1<ServiceResponse<IssuerBundle>, IssuerBundle>() { @Override public IssuerBundle call(ServiceResponse<IssuerBundle> response) { return response.body(); } }); }
[ "public", "Observable", "<", "IssuerBundle", ">", "getCertificateIssuerAsync", "(", "String", "vaultBaseUrl", ",", "String", "issuerName", ")", "{", "return", "getCertificateIssuerWithServiceResponseAsync", "(", "vaultBaseUrl", ",", "issuerName", ")", ".", "map", "(", ...
Lists the specified certificate issuer. The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param issuerName The name of the issuer. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the IssuerBundle object
[ "Lists", "the", "specified", "certificate", "issuer", ".", "The", "GetCertificateIssuer", "operation", "returns", "the", "specified", "certificate", "issuer", "resources", "in", "the", "specified", "key", "vault", ".", "This", "operation", "requires", "the", "certif...
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L6339-L6346
apache/spark
common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java
BitSetMethods.isSet
public static boolean isSet(Object baseObject, long baseOffset, int index) { assert index >= 0 : "index (" + index + ") should >= 0"; final long mask = 1L << (index & 0x3f); // mod 64 and shift final long wordOffset = baseOffset + (index >> 6) * WORD_SIZE; final long word = Platform.getLong(baseObject, wordOffset); return (word & mask) != 0; }
java
public static boolean isSet(Object baseObject, long baseOffset, int index) { assert index >= 0 : "index (" + index + ") should >= 0"; final long mask = 1L << (index & 0x3f); // mod 64 and shift final long wordOffset = baseOffset + (index >> 6) * WORD_SIZE; final long word = Platform.getLong(baseObject, wordOffset); return (word & mask) != 0; }
[ "public", "static", "boolean", "isSet", "(", "Object", "baseObject", ",", "long", "baseOffset", ",", "int", "index", ")", "{", "assert", "index", ">=", "0", ":", "\"index (\"", "+", "index", "+", "\") should >= 0\"", ";", "final", "long", "mask", "=", "1L"...
Returns {@code true} if the bit is set at the specified index.
[ "Returns", "{" ]
train
https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/bitset/BitSetMethods.java#L62-L68
cryptomator/webdav-nio-adapter
src/main/java/org/cryptomator/frontend/webdav/mount/ProcessUtil.java
ProcessUtil.startAndWaitFor
public static Process startAndWaitFor(ProcessBuilder processBuilder, long timeout, TimeUnit unit) throws CommandFailedException, CommandTimeoutException { try { Process proc = processBuilder.start(); waitFor(proc, timeout, unit); return proc; } catch (IOException e) { throw new CommandFailedException(e); } }
java
public static Process startAndWaitFor(ProcessBuilder processBuilder, long timeout, TimeUnit unit) throws CommandFailedException, CommandTimeoutException { try { Process proc = processBuilder.start(); waitFor(proc, timeout, unit); return proc; } catch (IOException e) { throw new CommandFailedException(e); } }
[ "public", "static", "Process", "startAndWaitFor", "(", "ProcessBuilder", "processBuilder", ",", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "CommandFailedException", ",", "CommandTimeoutException", "{", "try", "{", "Process", "proc", "=", "processBuilde...
Starts a new process and invokes {@link #waitFor(Process, long, TimeUnit)}. @param processBuilder The process builder used to start the new process @param timeout Maximum time to wait @param unit Time unit of <code>timeout</code> @return The finished process. @throws CommandFailedException If an I/O error occurs when starting the process. @throws CommandTimeoutException Thrown in case of a timeout
[ "Starts", "a", "new", "process", "and", "invokes", "{", "@link", "#waitFor", "(", "Process", "long", "TimeUnit", ")", "}", "." ]
train
https://github.com/cryptomator/webdav-nio-adapter/blob/55b0d7dccea9a4ede0a30a95583d8f04c8a86d18/src/main/java/org/cryptomator/frontend/webdav/mount/ProcessUtil.java#L45-L53
Netflix/astyanax
astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java
ShardedDistributedMessageQueue.hasMessages
private boolean hasMessages(String shardName) throws MessageQueueException { UUID currentTime = TimeUUIDUtils.getUniqueTimeUUIDinMicros(); try { ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily) .setConsistencyLevel(consistencyLevel) .getKey(shardName) .withColumnRange(new RangeBuilder() .setLimit(1) // Read extra messages because of the lock column .setStart(entrySerializer .makeEndpoint((byte)MessageQueueEntryType.Message.ordinal(), Equality.EQUAL) .toBytes() ) .setEnd(entrySerializer .makeEndpoint((byte)MessageQueueEntryType.Message.ordinal(), Equality.EQUAL) .append((byte)0, Equality.EQUAL) .append(currentTime, Equality.LESS_THAN_EQUALS) .toBytes() ) .build()) .execute() .getResult(); return !result.isEmpty(); } catch (ConnectionException e) { throw new MessageQueueException("Error checking shard for messages. " + shardName, e); } }
java
private boolean hasMessages(String shardName) throws MessageQueueException { UUID currentTime = TimeUUIDUtils.getUniqueTimeUUIDinMicros(); try { ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily) .setConsistencyLevel(consistencyLevel) .getKey(shardName) .withColumnRange(new RangeBuilder() .setLimit(1) // Read extra messages because of the lock column .setStart(entrySerializer .makeEndpoint((byte)MessageQueueEntryType.Message.ordinal(), Equality.EQUAL) .toBytes() ) .setEnd(entrySerializer .makeEndpoint((byte)MessageQueueEntryType.Message.ordinal(), Equality.EQUAL) .append((byte)0, Equality.EQUAL) .append(currentTime, Equality.LESS_THAN_EQUALS) .toBytes() ) .build()) .execute() .getResult(); return !result.isEmpty(); } catch (ConnectionException e) { throw new MessageQueueException("Error checking shard for messages. " + shardName, e); } }
[ "private", "boolean", "hasMessages", "(", "String", "shardName", ")", "throws", "MessageQueueException", "{", "UUID", "currentTime", "=", "TimeUUIDUtils", ".", "getUniqueTimeUUIDinMicros", "(", ")", ";", "try", "{", "ColumnList", "<", "MessageQueueEntry", ">", "resu...
Fast check to see if a shard has messages to process @param shardName @throws MessageQueueException
[ "Fast", "check", "to", "see", "if", "a", "shard", "has", "messages", "to", "process" ]
train
https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1099-L1125
ykrasik/jaci
jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionSuppliers.java
ReflectionSuppliers.reflectionSupplier
public static <T> Spplr<T> reflectionSupplier(Object instance, String methodName, Class<T> primaryClass, Class<T> secondaryClass) { try { return reflectionSupplier(instance, methodName, primaryClass); } catch (IllegalArgumentException e) { // Try the alternative return value. return reflectionSupplier(instance, methodName, secondaryClass); } }
java
public static <T> Spplr<T> reflectionSupplier(Object instance, String methodName, Class<T> primaryClass, Class<T> secondaryClass) { try { return reflectionSupplier(instance, methodName, primaryClass); } catch (IllegalArgumentException e) { // Try the alternative return value. return reflectionSupplier(instance, methodName, secondaryClass); } }
[ "public", "static", "<", "T", ">", "Spplr", "<", "T", ">", "reflectionSupplier", "(", "Object", "instance", ",", "String", "methodName", ",", "Class", "<", "T", ">", "primaryClass", ",", "Class", "<", "T", ">", "secondaryClass", ")", "{", "try", "{", "...
Similar to {@link #reflectionSupplier(Object, String, Class)}, except allows for an alternative return type. Will first try to create a reflection supplier using the primary class, but if that fails (the method doesn't return the primary class), will re-try with the secondary class. Useful for cases where the return type could be either a primitive or the primitive's boxed version (i.e. Integer.type or Integer.class). @param instance Instance to invoke the method one. @param methodName Method name to invoke. Method must be no-args and return a value of either the primary class or the secondary type. @param primaryClass Primary return type of the method. Will be tried first. @param secondaryClass Secondary return type of the method. Will be tried if the method doesn't return the primary type. @param <T> Supplier return type. @return A {@link Spplr} that will invoke the no-args method specified by the given name on the given instance.
[ "Similar", "to", "{", "@link", "#reflectionSupplier", "(", "Object", "String", "Class", ")", "}", "except", "allows", "for", "an", "alternative", "return", "type", ".", "Will", "first", "try", "to", "create", "a", "reflection", "supplier", "using", "the", "p...
train
https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-reflection-api/src/main/java/com/github/ykrasik/jaci/reflection/ReflectionSuppliers.java#L69-L79
JodaOrg/joda-time
src/main/java/org/joda/time/TimeOfDay.java
TimeOfDay.withFieldAdded
public TimeOfDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).addWrapPartial(this, index, newValues, amount); return new TimeOfDay(this, newValues); }
java
public TimeOfDay withFieldAdded(DurationFieldType fieldType, int amount) { int index = indexOfSupported(fieldType); if (amount == 0) { return this; } int[] newValues = getValues(); newValues = getField(index).addWrapPartial(this, index, newValues, amount); return new TimeOfDay(this, newValues); }
[ "public", "TimeOfDay", "withFieldAdded", "(", "DurationFieldType", "fieldType", ",", "int", "amount", ")", "{", "int", "index", "=", "indexOfSupported", "(", "fieldType", ")", ";", "if", "(", "amount", "==", "0", ")", "{", "return", "this", ";", "}", "int"...
Returns a copy of this time with the value of the specified field increased, wrapping to what would be a new day if required. <p> If the addition is zero, then <code>this</code> is returned. <p> These three lines are equivalent: <pre> TimeOfDay added = tod.withFieldAdded(DurationFieldType.minutes(), 6); TimeOfDay added = tod.plusMinutes(6); TimeOfDay added = tod.minuteOfHour().addToCopy(6); </pre> @param fieldType the field type to add to, not null @param amount the amount to add @return a copy of this instance with the field updated @throws IllegalArgumentException if the value is null or invalid @throws ArithmeticException if the new datetime exceeds the capacity
[ "Returns", "a", "copy", "of", "this", "time", "with", "the", "value", "of", "the", "specified", "field", "increased", "wrapping", "to", "what", "would", "be", "a", "new", "day", "if", "required", ".", "<p", ">", "If", "the", "addition", "is", "zero", "...
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/TimeOfDay.java#L552-L560
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java
SibRaConnection.createConsumerSessionForDurableSubscription
@Override public ConsumerSession createConsumerSessionForDurableSubscription( final String subscriptionName, final String durableSubscriptionHome, final SIDestinationAddress destinationAddress, final SelectionCriteria criteria, final boolean supportsMultipleConsumers, final boolean nolocal, final Reliability reliability, final boolean enableReadAhead, final Reliability unrecoverableReliability, final boolean bifurcatable, final String alternateUser) throws SIConnectionDroppedException, SIConnectionUnavailableException, SIConnectionLostException, SILimitExceededException, SINotAuthorizedException, SIDurableSubscriptionNotFoundException, SIDurableSubscriptionMismatchException, SIDestinationLockedException, SIResourceException, SIErrorException, SIIncorrectCallException { checkValid(); final ConsumerSession consumerSession = _delegateConnection .createConsumerSessionForDurableSubscription(subscriptionName, durableSubscriptionHome, destinationAddress, criteria, supportsMultipleConsumers, nolocal, reliability, enableReadAhead, unrecoverableReliability, bifurcatable, alternateUser); return new SibRaConsumerSession(this, consumerSession); }
java
@Override public ConsumerSession createConsumerSessionForDurableSubscription( final String subscriptionName, final String durableSubscriptionHome, final SIDestinationAddress destinationAddress, final SelectionCriteria criteria, final boolean supportsMultipleConsumers, final boolean nolocal, final Reliability reliability, final boolean enableReadAhead, final Reliability unrecoverableReliability, final boolean bifurcatable, final String alternateUser) throws SIConnectionDroppedException, SIConnectionUnavailableException, SIConnectionLostException, SILimitExceededException, SINotAuthorizedException, SIDurableSubscriptionNotFoundException, SIDurableSubscriptionMismatchException, SIDestinationLockedException, SIResourceException, SIErrorException, SIIncorrectCallException { checkValid(); final ConsumerSession consumerSession = _delegateConnection .createConsumerSessionForDurableSubscription(subscriptionName, durableSubscriptionHome, destinationAddress, criteria, supportsMultipleConsumers, nolocal, reliability, enableReadAhead, unrecoverableReliability, bifurcatable, alternateUser); return new SibRaConsumerSession(this, consumerSession); }
[ "@", "Override", "public", "ConsumerSession", "createConsumerSessionForDurableSubscription", "(", "final", "String", "subscriptionName", ",", "final", "String", "durableSubscriptionHome", ",", "final", "SIDestinationAddress", "destinationAddress", ",", "final", "SelectionCriter...
Creates a consumer session for a durable subscription. Checks that the connection is valid and then delegates. Wraps the <code>ConsumerSession</code> returned from the delegate in a <code>SibRaConsumerSession</code>. @param subscriptionName the name for the subscription @param durableSubscriptionHome the home for the durable subscription @param destinationAddress the address of the destination @param criteria the selection criteria @param reliability the reliability @param enableReadAhead flag indicating whether read ahead is enabled @param supportsMultipleConsumers flag indicating whether multiple consumers are supported @param nolocal flag indicating whether local messages should be received @param unrecoverableReliability the unrecoverable reliability @param bifurcatable whether the new ConsumerSession may be bifurcated @param alternateUser the name of the user under whose authority operations of the ConsumerSession should be performed (may be null) @return the consumer session representing the durable subscription @throws SIIncorrectCallException if the delegation fails @throws SIErrorException if the delegation fails @throws SIResourceException if the delegation fails @throws SIDestinationLockedException if the delegation fails @throws SIDurableSubscriptionMismatchException if the delegation fails @throws SIDurableSubscriptionNotFoundException if the delegation fails @throws SINotAuthorizedException if the delegation fails @throws SILimitExceededException if the delegation fails @throws SIConnectionLostException if the delegation fails @throws SIConnectionUnavailableException if the connection is not valid @throws SIConnectionDroppedException if the delegation fails
[ "Creates", "a", "consumer", "session", "for", "a", "durable", "subscription", ".", "Checks", "that", "the", "connection", "is", "valid", "and", "then", "delegates", ".", "Wraps", "the", "<code", ">", "ConsumerSession<", "/", "code", ">", "returned", "from", ...
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaConnection.java#L1288-L1316
seancfoley/IPAddress
IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6Address.java
IPv6Address.toNormalizedString
public static String toNormalizedString(IPv6AddressNetwork network, SegmentValueProvider lowerValueProvider, SegmentValueProvider upperValueProvider, Integer prefixLength, CharSequence zone) { return toNormalizedString(network.getPrefixConfiguration(), lowerValueProvider, upperValueProvider, prefixLength, SEGMENT_COUNT, BYTES_PER_SEGMENT, BITS_PER_SEGMENT, MAX_VALUE_PER_SEGMENT, SEGMENT_SEPARATOR, DEFAULT_TEXTUAL_RADIX, zone); }
java
public static String toNormalizedString(IPv6AddressNetwork network, SegmentValueProvider lowerValueProvider, SegmentValueProvider upperValueProvider, Integer prefixLength, CharSequence zone) { return toNormalizedString(network.getPrefixConfiguration(), lowerValueProvider, upperValueProvider, prefixLength, SEGMENT_COUNT, BYTES_PER_SEGMENT, BITS_PER_SEGMENT, MAX_VALUE_PER_SEGMENT, SEGMENT_SEPARATOR, DEFAULT_TEXTUAL_RADIX, zone); }
[ "public", "static", "String", "toNormalizedString", "(", "IPv6AddressNetwork", "network", ",", "SegmentValueProvider", "lowerValueProvider", ",", "SegmentValueProvider", "upperValueProvider", ",", "Integer", "prefixLength", ",", "CharSequence", "zone", ")", "{", "return", ...
Creates the normalized string for an address without having to create the address objects first. @param lowerValueProvider @param upperValueProvider @param prefixLength @param zone @param network use {@link #defaultIpv6Network()} if there is no custom network in use @return
[ "Creates", "the", "normalized", "string", "for", "an", "address", "without", "having", "to", "create", "the", "address", "objects", "first", "." ]
train
https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/ipv6/IPv6Address.java#L1764-L1766
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuGraphNodeGetDependentNodes
public static int cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode dependentNodes[], long numDependentNodes[]) { return checkResult(cuGraphNodeGetDependentNodesNative(hNode, dependentNodes, numDependentNodes)); }
java
public static int cuGraphNodeGetDependentNodes(CUgraphNode hNode, CUgraphNode dependentNodes[], long numDependentNodes[]) { return checkResult(cuGraphNodeGetDependentNodesNative(hNode, dependentNodes, numDependentNodes)); }
[ "public", "static", "int", "cuGraphNodeGetDependentNodes", "(", "CUgraphNode", "hNode", ",", "CUgraphNode", "dependentNodes", "[", "]", ",", "long", "numDependentNodes", "[", "]", ")", "{", "return", "checkResult", "(", "cuGraphNodeGetDependentNodesNative", "(", "hNod...
Returns a node's dependent nodes.<br> <br> Returns a list of \p node's dependent nodes. \p dependentNodes may be NULL, in which case this function will return the number of dependent nodes in \p numDependentNodes. Otherwise, \p numDependentNodes entries will be filled in. If \p numDependentNodes is higher than the actual number of dependent nodes, the remaining entries in \p dependentNodes will be set to NULL, and the number of nodes actually obtained will be returned in \p numDependentNodes. @param hNode - Node to query @param dependentNodes - Pointer to return the dependent nodes @param numDependentNodes - See description @return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_VALUE @see JCudaDriver#cuGraphNodeGetDependencies JCudaDriver#cuGraphGetNodes JCudaDriver#cuGraphGetRootNodes JCudaDriver#cuGraphGetEdges JCudaDriver#cuGraphAddDependencies JCudaDriver#cuGraphRemoveDependencies
[ "Returns", "a", "node", "s", "dependent", "nodes", ".", "<br", ">", "<br", ">", "Returns", "a", "list", "of", "\\", "p", "node", "s", "dependent", "nodes", ".", "\\", "p", "dependentNodes", "may", "be", "NULL", "in", "which", "case", "this", "function"...
train
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12816-L12819
iron-io/iron_mq_java
src/main/java/io/iron/ironmq/Queue.java
Queue.touchMessage
public MessageOptions touchMessage(String id, String reservationId, Long timeout) throws IOException { String payload = gson.toJson(new MessageOptions(null, reservationId, timeout)); IronReader reader = client.post("queues/" + name + "/messages/" + id + "/touch", payload); try { return gson.fromJson(reader.reader, MessageOptions.class); } finally { reader.close(); } }
java
public MessageOptions touchMessage(String id, String reservationId, Long timeout) throws IOException { String payload = gson.toJson(new MessageOptions(null, reservationId, timeout)); IronReader reader = client.post("queues/" + name + "/messages/" + id + "/touch", payload); try { return gson.fromJson(reader.reader, MessageOptions.class); } finally { reader.close(); } }
[ "public", "MessageOptions", "touchMessage", "(", "String", "id", ",", "String", "reservationId", ",", "Long", "timeout", ")", "throws", "IOException", "{", "String", "payload", "=", "gson", ".", "toJson", "(", "new", "MessageOptions", "(", "null", ",", "reserv...
Touching a reserved message extends its timeout to the duration specified when the message was created. @param id The ID of the message to delete. @param reservationId This id is returned when you reserve a message and must be provided to delete a message that is reserved. @param timeout After timeout (in seconds), item will be placed back onto queue. @throws io.iron.ironmq.HTTPException If the IronMQ service returns a status other than 200 OK. @throws java.io.IOException If there is an error accessing the IronMQ server.
[ "Touching", "a", "reserved", "message", "extends", "its", "timeout", "to", "the", "duration", "specified", "when", "the", "message", "was", "created", "." ]
train
https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L250-L258
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/variable/dictionary/json/JsonMappingDataDictionary.java
JsonMappingDataDictionary.traverseJsonData
private void traverseJsonData(JSONObject jsonData, String jsonPath, TestContext context) { for (Iterator it = jsonData.entrySet().iterator(); it.hasNext();) { Map.Entry jsonEntry = (Map.Entry) it.next(); if (jsonEntry.getValue() instanceof JSONObject) { traverseJsonData((JSONObject) jsonEntry.getValue(), (StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()), context); } else if (jsonEntry.getValue() instanceof JSONArray) { JSONArray jsonArray = (JSONArray) jsonEntry.getValue(); for (int i = 0; i < jsonArray.size(); i++) { if (jsonArray.get(i) instanceof JSONObject) { traverseJsonData((JSONObject) jsonArray.get(i), String.format((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()) + "[%s]", i), context); } else { jsonArray.set(i, translate(String.format((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()) + "[%s]", i), jsonArray.get(i), context)); } } } else { jsonEntry.setValue(translate((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()), jsonEntry.getValue() != null ? jsonEntry.getValue() : null, context)); } } }
java
private void traverseJsonData(JSONObject jsonData, String jsonPath, TestContext context) { for (Iterator it = jsonData.entrySet().iterator(); it.hasNext();) { Map.Entry jsonEntry = (Map.Entry) it.next(); if (jsonEntry.getValue() instanceof JSONObject) { traverseJsonData((JSONObject) jsonEntry.getValue(), (StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()), context); } else if (jsonEntry.getValue() instanceof JSONArray) { JSONArray jsonArray = (JSONArray) jsonEntry.getValue(); for (int i = 0; i < jsonArray.size(); i++) { if (jsonArray.get(i) instanceof JSONObject) { traverseJsonData((JSONObject) jsonArray.get(i), String.format((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()) + "[%s]", i), context); } else { jsonArray.set(i, translate(String.format((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()) + "[%s]", i), jsonArray.get(i), context)); } } } else { jsonEntry.setValue(translate((StringUtils.hasText(jsonPath) ? jsonPath + "." + jsonEntry.getKey() : jsonEntry.getKey().toString()), jsonEntry.getValue() != null ? jsonEntry.getValue() : null, context)); } } }
[ "private", "void", "traverseJsonData", "(", "JSONObject", "jsonData", ",", "String", "jsonPath", ",", "TestContext", "context", ")", "{", "for", "(", "Iterator", "it", "=", "jsonData", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "it", ".", ...
Walks through the Json object structure and translates values based on element path if necessary. @param jsonData @param jsonPath @param context
[ "Walks", "through", "the", "Json", "object", "structure", "and", "translates", "values", "based", "on", "element", "path", "if", "necessary", "." ]
train
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/variable/dictionary/json/JsonMappingDataDictionary.java#L113-L133
dashorst/wicket-stuff-markup-validator
jing/src/main/java/com/thaiopensource/resolver/xml/transform/Transform.java
Transform.createSAXURIResolver
public static URIResolver createSAXURIResolver(Resolver resolver) { final SAXResolver saxResolver = new SAXResolver(resolver); return new URIResolver() { public Source resolve(String href, String base) throws TransformerException { try { return saxResolver.resolve(href, base); } catch (SAXException e) { throw toTransformerException(e); } catch (IOException e) { throw new TransformerException(e); } } }; }
java
public static URIResolver createSAXURIResolver(Resolver resolver) { final SAXResolver saxResolver = new SAXResolver(resolver); return new URIResolver() { public Source resolve(String href, String base) throws TransformerException { try { return saxResolver.resolve(href, base); } catch (SAXException e) { throw toTransformerException(e); } catch (IOException e) { throw new TransformerException(e); } } }; }
[ "public", "static", "URIResolver", "createSAXURIResolver", "(", "Resolver", "resolver", ")", "{", "final", "SAXResolver", "saxResolver", "=", "new", "SAXResolver", "(", "resolver", ")", ";", "return", "new", "URIResolver", "(", ")", "{", "public", "Source", "res...
Creates a URIResolver that returns a SAXSource. @param resolver @return
[ "Creates", "a", "URIResolver", "that", "returns", "a", "SAXSource", "." ]
train
https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/resolver/xml/transform/Transform.java#L32-L47
Azure/azure-sdk-for-java
labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java
GalleryImagesInner.updateAsync
public Observable<GalleryImageInner> updateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).map(new Func1<ServiceResponse<GalleryImageInner>, GalleryImageInner>() { @Override public GalleryImageInner call(ServiceResponse<GalleryImageInner> response) { return response.body(); } }); }
java
public Observable<GalleryImageInner> updateAsync(String resourceGroupName, String labAccountName, String galleryImageName, GalleryImageFragment galleryImage) { return updateWithServiceResponseAsync(resourceGroupName, labAccountName, galleryImageName, galleryImage).map(new Func1<ServiceResponse<GalleryImageInner>, GalleryImageInner>() { @Override public GalleryImageInner call(ServiceResponse<GalleryImageInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "GalleryImageInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "labAccountName", ",", "String", "galleryImageName", ",", "GalleryImageFragment", "galleryImage", ")", "{", "return", "updateWithServiceResponseAsync", ...
Modify properties of gallery images. @param resourceGroupName The name of the resource group. @param labAccountName The name of the lab Account. @param galleryImageName The name of the gallery Image. @param galleryImage Represents an image from the Azure Marketplace @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the GalleryImageInner object
[ "Modify", "properties", "of", "gallery", "images", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GalleryImagesInner.java#L775-L782
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/XlsSaver.java
XlsSaver.saveMultiple
public void saveMultiple(final InputStream templateXlsIn, final OutputStream xlsOut, final Object[] beanObjs) throws XlsMapperException, IOException { saveMultipleDetail(templateXlsIn, xlsOut, beanObjs); }
java
public void saveMultiple(final InputStream templateXlsIn, final OutputStream xlsOut, final Object[] beanObjs) throws XlsMapperException, IOException { saveMultipleDetail(templateXlsIn, xlsOut, beanObjs); }
[ "public", "void", "saveMultiple", "(", "final", "InputStream", "templateXlsIn", ",", "final", "OutputStream", "xlsOut", ",", "final", "Object", "[", "]", "beanObjs", ")", "throws", "XlsMapperException", ",", "IOException", "{", "saveMultipleDetail", "(", "templateXl...
複数のオブジェクトをそれぞれのシートへ保存する。 @param templateXlsIn 雛形となるExcelファイルの入力 @param xlsOut xlsOut 出力先のストリーム @param beanObjs 書き込むオブジェクトの配列。 @throws IllegalArgumentException {@literal templateXlsIn == null or xlsOut == null or beanObjs == null} @throws XlsMapperException マッピングに失敗した場合 @throws IOException テンプレートのファイルの読み込みやファイルの出力に失敗した場合
[ "複数のオブジェクトをそれぞれのシートへ保存する。" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/XlsSaver.java#L160-L164
js-lib-com/commons
src/main/java/js/io/FilesOutputStream.java
FilesOutputStream.addFile
public void addFile(File file) throws IOException { if (!file.exists()) { throw new IllegalArgumentException(String.format("File |%s| does not exist.", file)); } if (file.isDirectory()) { throw new IllegalArgumentException(String.format("File |%s| is a directory.", file)); } addFileEntry(file.getPath(), new FileInputStream(file)); }
java
public void addFile(File file) throws IOException { if (!file.exists()) { throw new IllegalArgumentException(String.format("File |%s| does not exist.", file)); } if (file.isDirectory()) { throw new IllegalArgumentException(String.format("File |%s| is a directory.", file)); } addFileEntry(file.getPath(), new FileInputStream(file)); }
[ "public", "void", "addFile", "(", "File", "file", ")", "throws", "IOException", "{", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "String", ".", "format", "(", "\"File |%s| does not exist.\"", ",...
Inject file content into archive using file relative path as archive entry name. File to add is relative to a common base directory. All files from this archive should be part of that base directory hierarchy; it is user code responsibility to enforce this constrain. @param file file to add to this archive. @throws IllegalArgumentException if <code>file</code> does not exist or is a directory. @throws IOException if archive writing operation fails.
[ "Inject", "file", "content", "into", "archive", "using", "file", "relative", "path", "as", "archive", "entry", "name", ".", "File", "to", "add", "is", "relative", "to", "a", "common", "base", "directory", ".", "All", "files", "from", "this", "archive", "sh...
train
https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/io/FilesOutputStream.java#L144-L152
GeoLatte/geolatte-common
src/main/java/org/geolatte/common/expressions/Expressions.java
Expressions.isBetween
public static DateIsBetween isBetween(ComparableExpression<Date> date, ComparableExpression<Date> lowDate, ComparableExpression<Date> highDate) { return new DateIsBetween(date, lowDate, highDate); }
java
public static DateIsBetween isBetween(ComparableExpression<Date> date, ComparableExpression<Date> lowDate, ComparableExpression<Date> highDate) { return new DateIsBetween(date, lowDate, highDate); }
[ "public", "static", "DateIsBetween", "isBetween", "(", "ComparableExpression", "<", "Date", ">", "date", ",", "ComparableExpression", "<", "Date", ">", "lowDate", ",", "ComparableExpression", "<", "Date", ">", "highDate", ")", "{", "return", "new", "DateIsBetween"...
Creates an IsBetween expression from the given expressions. @param date The date to compare. @param lowDate The low date to compare to. @param highDate The high date to compare to @return A DateIsBetween expression.
[ "Creates", "an", "IsBetween", "expression", "from", "the", "given", "expressions", "." ]
train
https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/expressions/Expressions.java#L767-L769
fabric8io/ipaas-quickstarts
archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java
ArchetypeBuilder.copyFile
protected void copyFile(File src, File dest, Replacement replaceFn) throws IOException { boolean isSource = isSourceFile(src); copyFile(src, dest, replaceFn, isSource); }
java
protected void copyFile(File src, File dest, Replacement replaceFn) throws IOException { boolean isSource = isSourceFile(src); copyFile(src, dest, replaceFn, isSource); }
[ "protected", "void", "copyFile", "(", "File", "src", ",", "File", "dest", ",", "Replacement", "replaceFn", ")", "throws", "IOException", "{", "boolean", "isSource", "=", "isSourceFile", "(", "src", ")", ";", "copyFile", "(", "src", ",", "dest", ",", "repla...
Copies single file from <code>src</code> to <code>dest</code>. If the file is source file, variable references will be escaped, so they'll survive Velocity template merging.
[ "Copies", "single", "file", "from", "<code", ">", "src<", "/", "code", ">", "to", "<code", ">", "dest<", "/", "code", ">", ".", "If", "the", "file", "is", "source", "file", "variable", "references", "will", "be", "escaped", "so", "they", "ll", "survive...
train
https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L714-L717
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/enhance/GEnhanceImageOps.java
GEnhanceImageOps.sharpen4
public static <T extends ImageBase<T>> void sharpen4(T input , T output ) { if( input instanceof Planar ) { Planar pi = (Planar)input; Planar po = (Planar)output; for (int i = 0; i < pi.getNumBands(); i++) { sharpen4(pi.getBand(i),po.getBand(i)); } } else { if (input instanceof GrayU8) { EnhanceImageOps.sharpen4((GrayU8) input, (GrayU8) output); } else if (input instanceof GrayF32) { EnhanceImageOps.sharpen4((GrayF32) input, (GrayF32) output); } else { throw new IllegalArgumentException("Image type not supported. " + input.getClass().getSimpleName()); } } }
java
public static <T extends ImageBase<T>> void sharpen4(T input , T output ) { if( input instanceof Planar ) { Planar pi = (Planar)input; Planar po = (Planar)output; for (int i = 0; i < pi.getNumBands(); i++) { sharpen4(pi.getBand(i),po.getBand(i)); } } else { if (input instanceof GrayU8) { EnhanceImageOps.sharpen4((GrayU8) input, (GrayU8) output); } else if (input instanceof GrayF32) { EnhanceImageOps.sharpen4((GrayF32) input, (GrayF32) output); } else { throw new IllegalArgumentException("Image type not supported. " + input.getClass().getSimpleName()); } } }
[ "public", "static", "<", "T", "extends", "ImageBase", "<", "T", ">", ">", "void", "sharpen4", "(", "T", "input", ",", "T", "output", ")", "{", "if", "(", "input", "instanceof", "Planar", ")", "{", "Planar", "pi", "=", "(", "Planar", ")", "input", "...
Applies a Laplacian-4 based sharpen filter to the image. @param input Input image. @param output Output image.
[ "Applies", "a", "Laplacian", "-", "4", "based", "sharpen", "filter", "to", "the", "image", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/enhance/GEnhanceImageOps.java#L93-L109
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/util/Threads.java
Threads.par_ief
private static void par_ief(CompList<?> t, int numproc) throws Exception { if (numproc < 1) { throw new IllegalArgumentException("numproc"); } final CountDownLatch latch = new CountDownLatch(t.list().size()); // final ExecutorService e = Executors.newFixedThreadPool(numproc); for (final Compound c : t) { e.submit(new Runnable() { @Override public void run() { try { ComponentAccess.callAnnotated(c, Initialize.class, true); c.execute(); ComponentAccess.callAnnotated(c, Finalize.class, true); } catch (Throwable E) { e.shutdownNow(); } latch.countDown(); } }); } latch.await(); // e.shutdown(); }
java
private static void par_ief(CompList<?> t, int numproc) throws Exception { if (numproc < 1) { throw new IllegalArgumentException("numproc"); } final CountDownLatch latch = new CountDownLatch(t.list().size()); // final ExecutorService e = Executors.newFixedThreadPool(numproc); for (final Compound c : t) { e.submit(new Runnable() { @Override public void run() { try { ComponentAccess.callAnnotated(c, Initialize.class, true); c.execute(); ComponentAccess.callAnnotated(c, Finalize.class, true); } catch (Throwable E) { e.shutdownNow(); } latch.countDown(); } }); } latch.await(); // e.shutdown(); }
[ "private", "static", "void", "par_ief", "(", "CompList", "<", "?", ">", "t", ",", "int", "numproc", ")", "throws", "Exception", "{", "if", "(", "numproc", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"numproc\"", ")", ";", "}", ...
Runs a set of Compounds in parallel. there are always numproc + 1 threads active. @param comp @param numproc @throws java.lang.Exception
[ "Runs", "a", "set", "of", "Compounds", "in", "parallel", ".", "there", "are", "always", "numproc", "+", "1", "threads", "active", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Threads.java#L98-L122
haraldk/TwelveMonkeys
imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java
QuickDrawContext.invertRoundRect
public void invertRoundRect(final Rectangle2D pRectangle, int pArcW, int pArcH) { invertShape(toRoundRect(pRectangle, pArcW, pArcH)); }
java
public void invertRoundRect(final Rectangle2D pRectangle, int pArcW, int pArcH) { invertShape(toRoundRect(pRectangle, pArcW, pArcH)); }
[ "public", "void", "invertRoundRect", "(", "final", "Rectangle2D", "pRectangle", ",", "int", "pArcW", ",", "int", "pArcH", ")", "{", "invertShape", "(", "toRoundRect", "(", "pRectangle", ",", "pArcW", ",", "pArcH", ")", ")", ";", "}" ]
InvertRoundRect(r,int,int) // reverses the color of all pixels in the rect @param pRectangle the rectangle to invert @param pArcW width of the oval defining the rounded corner. @param pArcH height of the oval defining the rounded corner.
[ "InvertRoundRect", "(", "r", "int", "int", ")", "//", "reverses", "the", "color", "of", "all", "pixels", "in", "the", "rect" ]
train
https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-pict/src/main/java/com/twelvemonkeys/imageio/plugins/pict/QuickDrawContext.java#L642-L644
headius/invokebinder
src/main/java/com/headius/invokebinder/Binder.java
Binder.from
public static Binder from(Class<?> returnType, Class<?> argType0, Class<?>... argTypes) { return from(MethodType.methodType(returnType, argType0, argTypes)); }
java
public static Binder from(Class<?> returnType, Class<?> argType0, Class<?>... argTypes) { return from(MethodType.methodType(returnType, argType0, argTypes)); }
[ "public", "static", "Binder", "from", "(", "Class", "<", "?", ">", "returnType", ",", "Class", "<", "?", ">", "argType0", ",", "Class", "<", "?", ">", "...", "argTypes", ")", "{", "return", "from", "(", "MethodType", ".", "methodType", "(", "returnType...
Construct a new Binder using a return type and argument types. @param returnType the return type of the incoming signature @param argType0 the first argument type of the incoming signature @param argTypes the remaining argument types of the incoming signature @return the Binder object
[ "Construct", "a", "new", "Binder", "using", "a", "return", "type", "and", "argument", "types", "." ]
train
https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L228-L230
paypal/SeLion
dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java
XmlDataProviderImpl.getDocument
private Document getDocument() { logger.entering(); DOMDocumentFactory domFactory = new DOMDocumentFactory(); SAXReader reader = new SAXReader(domFactory); Document doc; try { doc = reader.read(resource.getInputStream()); } catch (DocumentException excp) { logger.exiting(excp.getMessage()); throw new DataProviderException("Error reading XML data.", excp); } logger.exiting(doc.asXML()); return doc; }
java
private Document getDocument() { logger.entering(); DOMDocumentFactory domFactory = new DOMDocumentFactory(); SAXReader reader = new SAXReader(domFactory); Document doc; try { doc = reader.read(resource.getInputStream()); } catch (DocumentException excp) { logger.exiting(excp.getMessage()); throw new DataProviderException("Error reading XML data.", excp); } logger.exiting(doc.asXML()); return doc; }
[ "private", "Document", "getDocument", "(", ")", "{", "logger", ".", "entering", "(", ")", ";", "DOMDocumentFactory", "domFactory", "=", "new", "DOMDocumentFactory", "(", ")", ";", "SAXReader", "reader", "=", "new", "SAXReader", "(", "domFactory", ")", ";", "...
Loads the XML data from the {@link XmlFileSystemResource} into a {@link org.dom4j.Document}. @return A Document object.
[ "Loads", "the", "XML", "data", "from", "the", "{", "@link", "XmlFileSystemResource", "}", "into", "a", "{", "@link", "org", ".", "dom4j", ".", "Document", "}", "." ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java#L398-L413
phax/ph-oton
ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/typeahead/TypeaheadDatum.java
TypeaheadDatum.createWithID
@Nonnull public static TypeaheadDatum createWithID (@Nonnull final String sValue, @Nullable final String sID) { return new TypeaheadDatum (sValue, getTokensFromValue (sValue), sID); }
java
@Nonnull public static TypeaheadDatum createWithID (@Nonnull final String sValue, @Nullable final String sID) { return new TypeaheadDatum (sValue, getTokensFromValue (sValue), sID); }
[ "@", "Nonnull", "public", "static", "TypeaheadDatum", "createWithID", "(", "@", "Nonnull", "final", "String", "sValue", ",", "@", "Nullable", "final", "String", "sID", ")", "{", "return", "new", "TypeaheadDatum", "(", "sValue", ",", "getTokensFromValue", "(", ...
Create a new TypeaheadDatum with a text and an ID using {@link #getTokensFromValue(String)} to tokenize the string. @param sValue Value to display. Must not be <code>null</code>. @param sID Optional ID of the element. May be <code>null</code>. @return New {@link TypeaheadDatum}.
[ "Create", "a", "new", "TypeaheadDatum", "with", "a", "text", "and", "an", "ID", "using", "{", "@link", "#getTokensFromValue", "(", "String", ")", "}", "to", "tokenize", "the", "string", "." ]
train
https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/typeahead/TypeaheadDatum.java#L208-L212
Azure/azure-sdk-for-java
logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java
WorkflowVersionsInner.listCallbackUrl
public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, String versionId, String triggerName, GetCallbackUrlParameters parameters) { return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, versionId, triggerName, parameters).toBlocking().single().body(); }
java
public WorkflowTriggerCallbackUrlInner listCallbackUrl(String resourceGroupName, String workflowName, String versionId, String triggerName, GetCallbackUrlParameters parameters) { return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, versionId, triggerName, parameters).toBlocking().single().body(); }
[ "public", "WorkflowTriggerCallbackUrlInner", "listCallbackUrl", "(", "String", "resourceGroupName", ",", "String", "workflowName", ",", "String", "versionId", ",", "String", "triggerName", ",", "GetCallbackUrlParameters", "parameters", ")", "{", "return", "listCallbackUrlWi...
Get the callback url for a trigger of a workflow version. @param resourceGroupName The resource group name. @param workflowName The workflow name. @param versionId The workflow versionId. @param triggerName The workflow trigger name. @param parameters The callback URL parameters. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the WorkflowTriggerCallbackUrlInner object if successful.
[ "Get", "the", "callback", "url", "for", "a", "trigger", "of", "a", "workflow", "version", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowVersionsInner.java#L527-L529
looly/hutool
hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java
ImgUtil.pressImage
public static BufferedImage pressImage(Image srcImage, Image pressImg, int x, int y, float alpha) { return Img.from(srcImage).pressImage(pressImg, x, y, alpha).getImg(); }
java
public static BufferedImage pressImage(Image srcImage, Image pressImg, int x, int y, float alpha) { return Img.from(srcImage).pressImage(pressImg, x, y, alpha).getImg(); }
[ "public", "static", "BufferedImage", "pressImage", "(", "Image", "srcImage", ",", "Image", "pressImg", ",", "int", "x", ",", "int", "y", ",", "float", "alpha", ")", "{", "return", "Img", ".", "from", "(", "srcImage", ")", ".", "pressImage", "(", "pressIm...
给图片添加图片水印<br> 此方法并不关闭流 @param srcImage 源图像流 @param pressImg 水印图片,可以使用{@link ImageIO#read(File)}方法读取文件 @param x 修正值。 默认在中间,偏移量相对于中间偏移 @param y 修正值。 默认在中间,偏移量相对于中间偏移 @param alpha 透明度:alpha 必须是范围 [0.0, 1.0] 之内(包含边界值)的一个浮点数字 @return 结果图片
[ "给图片添加图片水印<br", ">", "此方法并不关闭流" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L972-L974
UrielCh/ovh-java-sdk
ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java
ApiOvhEmailpro.service_account_email_fullAccess_POST
public OvhTask service_account_email_fullAccess_POST(String service, String email, Long allowedAccountId) throws IOException { String qPath = "/email/pro/{service}/account/{email}/fullAccess"; StringBuilder sb = path(qPath, service, email); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "allowedAccountId", allowedAccountId); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTask.class); }
java
public OvhTask service_account_email_fullAccess_POST(String service, String email, Long allowedAccountId) throws IOException { String qPath = "/email/pro/{service}/account/{email}/fullAccess"; StringBuilder sb = path(qPath, service, email); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "allowedAccountId", allowedAccountId); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhTask.class); }
[ "public", "OvhTask", "service_account_email_fullAccess_POST", "(", "String", "service", ",", "String", "email", ",", "Long", "allowedAccountId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/email/pro/{service}/account/{email}/fullAccess\"", ";", "StringBui...
Allow full access to a user REST: POST /email/pro/{service}/account/{email}/fullAccess @param allowedAccountId [required] User to give full access @param service [required] The internal name of your pro organization @param email [required] Default email for this mailbox API beta
[ "Allow", "full", "access", "to", "a", "user" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L318-L325
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java
FieldAccessor.setPosition
public void setPosition(final Object targetObj, final CellPosition position) { ArgUtils.notNull(targetObj, "targetObj"); ArgUtils.notNull(position, "position"); positionSetter.ifPresent(setter -> setter.set(targetObj, position)); }
java
public void setPosition(final Object targetObj, final CellPosition position) { ArgUtils.notNull(targetObj, "targetObj"); ArgUtils.notNull(position, "position"); positionSetter.ifPresent(setter -> setter.set(targetObj, position)); }
[ "public", "void", "setPosition", "(", "final", "Object", "targetObj", ",", "final", "CellPosition", "position", ")", "{", "ArgUtils", ".", "notNull", "(", "targetObj", ",", "\"targetObj\"", ")", ";", "ArgUtils", ".", "notNull", "(", "position", ",", "\"positio...
位置情報を設定します。 <p>位置情報を保持するフィールドがない場合は、処理はスキップされます。</p> @param targetObj フィールドが定義されているクラスのインスタンス @param position 位置情報 @throws IllegalArgumentException {@literal targetObj == null or position == null}
[ "位置情報を設定します。", "<p", ">", "位置情報を保持するフィールドがない場合は、処理はスキップされます。<", "/", "p", ">" ]
train
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/FieldAccessor.java#L355-L361
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/jboss/logging/Logger.java
Logger.warnf
public void warnf(String format, Object param1) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, null); } }
java
public void warnf(String format, Object param1) { if (isEnabled(Level.WARN)) { doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, null); } }
[ "public", "void", "warnf", "(", "String", "format", ",", "Object", "param1", ")", "{", "if", "(", "isEnabled", "(", "Level", ".", "WARN", ")", ")", "{", "doLogf", "(", "Level", ".", "WARN", ",", "FQCN", ",", "format", ",", "new", "Object", "[", "]"...
Issue a formatted log message with a level of WARN. @param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor @param param1 the sole parameter
[ "Issue", "a", "formatted", "log", "message", "with", "a", "level", "of", "WARN", "." ]
train
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1405-L1409
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java
DirectoryServiceClient.asyncGetService
public ServiceDirectoryFuture asyncGetService(String serviceName, Watcher watcher){ WatcherRegistration wcb = null; if (watcher != null) { wcb = new WatcherRegistration(serviceName, watcher); } ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.GetService); GetServiceProtocol p = new GetServiceProtocol(serviceName); p.setWatcher(false); return connection.submitAsyncRequest(header, p, wcb); }
java
public ServiceDirectoryFuture asyncGetService(String serviceName, Watcher watcher){ WatcherRegistration wcb = null; if (watcher != null) { wcb = new WatcherRegistration(serviceName, watcher); } ProtocolHeader header = new ProtocolHeader(); header.setType(ProtocolType.GetService); GetServiceProtocol p = new GetServiceProtocol(serviceName); p.setWatcher(false); return connection.submitAsyncRequest(header, p, wcb); }
[ "public", "ServiceDirectoryFuture", "asyncGetService", "(", "String", "serviceName", ",", "Watcher", "watcher", ")", "{", "WatcherRegistration", "wcb", "=", "null", ";", "if", "(", "watcher", "!=", "null", ")", "{", "wcb", "=", "new", "WatcherRegistration", "(",...
Asynchronized get Service. @param serviceName the service name. @param watcher the watcher. @return the ServiceDirectoryFuture
[ "Asynchronized", "get", "Service", "." ]
train
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryServiceClient.java#L746-L758
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertDictionary
@NonNull @Override public MutableArray insertDictionary(int index, Dictionary value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertDictionary(int index, Dictionary value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertDictionary", "(", "int", "index", ",", "Dictionary", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a Dictionary object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Dictionary object @return The self object
[ "Inserts", "a", "Dictionary", "object", "at", "the", "given", "index", "." ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L553-L557
springfox/springfox
springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java
AlternateTypeRules.newRule
public static AlternateTypeRule newRule(Type original, Type alternate) { return newRule(original, alternate, Ordered.LOWEST_PRECEDENCE); }
java
public static AlternateTypeRule newRule(Type original, Type alternate) { return newRule(original, alternate, Ordered.LOWEST_PRECEDENCE); }
[ "public", "static", "AlternateTypeRule", "newRule", "(", "Type", "original", ",", "Type", "alternate", ")", "{", "return", "newRule", "(", "original", ",", "alternate", ",", "Ordered", ".", "LOWEST_PRECEDENCE", ")", ";", "}" ]
Helper method to create a new alternate rule. @param original the original @param alternate the alternate @return the alternate type rule
[ "Helper", "method", "to", "create", "a", "new", "alternate", "rule", "." ]
train
https://github.com/springfox/springfox/blob/e40e2d6f4b345ffa35cd5c0ca7a12589036acaf7/springfox-core/src/main/java/springfox/documentation/schema/AlternateTypeRules.java#L44-L46
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java
AbstractQueryProtocol.executeQuery
@Override public void executeQuery(boolean mustExecuteOnMaster, Results results, final String sql) throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_QUERY); writer.write(sql); writer.flush(); getResult(results); } catch (SQLException sqlException) { if ("70100".equals(sqlException.getSQLState()) && 1927 == sqlException.getErrorCode()) { throw handleIoException(sqlException); } throw logQuery.exceptionWithQuery(sql, sqlException, explicitClosed); } catch (IOException e) { throw handleIoException(e); } }
java
@Override public void executeQuery(boolean mustExecuteOnMaster, Results results, final String sql) throws SQLException { cmdPrologue(); try { writer.startPacket(0); writer.write(COM_QUERY); writer.write(sql); writer.flush(); getResult(results); } catch (SQLException sqlException) { if ("70100".equals(sqlException.getSQLState()) && 1927 == sqlException.getErrorCode()) { throw handleIoException(sqlException); } throw logQuery.exceptionWithQuery(sql, sqlException, explicitClosed); } catch (IOException e) { throw handleIoException(e); } }
[ "@", "Override", "public", "void", "executeQuery", "(", "boolean", "mustExecuteOnMaster", ",", "Results", "results", ",", "final", "String", "sql", ")", "throws", "SQLException", "{", "cmdPrologue", "(", ")", ";", "try", "{", "writer", ".", "startPacket", "(",...
Execute query directly to outputStream. @param mustExecuteOnMaster was intended to be launched on master connection @param results result @param sql the query to executeInternal @throws SQLException exception
[ "Execute", "query", "directly", "to", "outputStream", "." ]
train
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/protocol/AbstractQueryProtocol.java#L216-L238
Teddy-Zhu/SilentGo
utils/src/main/java/com/silentgo/utils/asm/ClassReader.java
ClassReader.readClass
public String readClass(final int index, final char[] buf) { // computes the start index of the CONSTANT_Class item in b // and reads the CONSTANT_Utf8 item designated by // the first two bytes of this CONSTANT_Class item String name = readUTF8(items[readUnsignedShort(index)], buf); return (name != null ? name.intern() : null); }
java
public String readClass(final int index, final char[] buf) { // computes the start index of the CONSTANT_Class item in b // and reads the CONSTANT_Utf8 item designated by // the first two bytes of this CONSTANT_Class item String name = readUTF8(items[readUnsignedShort(index)], buf); return (name != null ? name.intern() : null); }
[ "public", "String", "readClass", "(", "final", "int", "index", ",", "final", "char", "[", "]", "buf", ")", "{", "// computes the start index of the CONSTANT_Class item in b", "// and reads the CONSTANT_Utf8 item designated by", "// the first two bytes of this CONSTANT_Class item", ...
Reads a class constant pool item in {@link #b b}. <i>This method is intended for {@link Attribute} sub classes, and is normally not needed by class generators or adapters.</i> @param index the start index of an unsigned short value in {@link #b b}, whose value is the index of a class constant pool item. @param buf buffer to be used to read the item. This buffer must be sufficiently large. It is not automatically resized. @return the String corresponding to the specified class item.
[ "Reads", "a", "class", "constant", "pool", "item", "in", "{", "@link", "#b", "b", "}", ".", "<i", ">", "This", "method", "is", "intended", "for", "{", "@link", "Attribute", "}", "sub", "classes", "and", "is", "normally", "not", "needed", "by", "class",...
train
https://github.com/Teddy-Zhu/SilentGo/blob/27f58b0cafe56b2eb9fc6993efa9ca2b529661e1/utils/src/main/java/com/silentgo/utils/asm/ClassReader.java#L2532-L2538