repository_name
stringlengths
7
58
func_path_in_repository
stringlengths
18
194
func_name
stringlengths
6
111
whole_func_string
stringlengths
80
3.8k
language
stringclasses
1 value
func_code_string
stringlengths
80
3.8k
func_code_tokens
listlengths
20
697
func_documentation_string
stringlengths
61
2k
func_documentation_tokens
listlengths
1
434
split_name
stringclasses
1 value
func_code_url
stringlengths
111
308
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/script/Script.java
Script.writeBytes
public static void writeBytes(OutputStream os, byte[] buf) throws IOException { if (buf.length < OP_PUSHDATA1) { os.write(buf.length); os.write(buf); } else if (buf.length < 256) { os.write(OP_PUSHDATA1); os.write(buf.length); os.write(buf); ...
java
public static void writeBytes(OutputStream os, byte[] buf) throws IOException { if (buf.length < OP_PUSHDATA1) { os.write(buf.length); os.write(buf); } else if (buf.length < 256) { os.write(OP_PUSHDATA1); os.write(buf.length); os.write(buf); ...
[ "public", "static", "void", "writeBytes", "(", "OutputStream", "os", ",", "byte", "[", "]", "buf", ")", "throws", "IOException", "{", "if", "(", "buf", ".", "length", "<", "OP_PUSHDATA1", ")", "{", "os", ".", "write", "(", "buf", ".", "length", ")", ...
Writes out the given byte buffer to the output stream with the correct opcode prefix To write an integer call writeBytes(out, Utils.reverseBytes(Utils.encodeMPI(val, false)));
[ "Writes", "out", "the", "given", "byte", "buffer", "to", "the", "output", "stream", "with", "the", "correct", "opcode", "prefix", "To", "write", "an", "integer", "call", "writeBytes", "(", "out", "Utils", ".", "reverseBytes", "(", "Utils", ".", "encodeMPI", ...
train
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L320-L335
wdullaer/MaterialDateTimePicker
library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java
MonthView.getDayFromLocation
public int getDayFromLocation(float x, float y) { final int day = getInternalDayFromLocation(x, y); if (day < 1 || day > mNumCells) { return -1; } return day; }
java
public int getDayFromLocation(float x, float y) { final int day = getInternalDayFromLocation(x, y); if (day < 1 || day > mNumCells) { return -1; } return day; }
[ "public", "int", "getDayFromLocation", "(", "float", "x", ",", "float", "y", ")", "{", "final", "int", "day", "=", "getInternalDayFromLocation", "(", "x", ",", "y", ")", ";", "if", "(", "day", "<", "1", "||", "day", ">", "mNumCells", ")", "{", "retur...
Calculates the day that the given x position is in, accounting for week number. Returns the day or -1 if the position wasn't in a day. @param x The x position of the touch event @return The day number, or -1 if the position wasn't in a day
[ "Calculates", "the", "day", "that", "the", "given", "x", "position", "is", "in", "accounting", "for", "week", "number", ".", "Returns", "the", "day", "or", "-", "1", "if", "the", "position", "wasn", "t", "in", "a", "day", "." ]
train
https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L503-L509
Azure/azure-sdk-for-java
labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java
LabsInner.registerAsync
public Observable<Void> registerAsync(String resourceGroupName, String labAccountName, String labName) { return registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> res...
java
public Observable<Void> registerAsync(String resourceGroupName, String labAccountName, String labName) { return registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> res...
[ "public", "Observable", "<", "Void", ">", "registerAsync", "(", "String", "resourceGroupName", ",", "String", "labAccountName", ",", "String", "labName", ")", "{", "return", "registerWithServiceResponseAsync", "(", "resourceGroupName", ",", "labAccountName", ",", "lab...
Register to managed lab. @param resourceGroupName The name of the resource group. @param labAccountName The name of the lab Account. @param labName The name of the lab. @throws IllegalArgumentException thrown if parameters fail the validation @return the {@link ServiceResponse} object if successful.
[ "Register", "to", "managed", "lab", "." ]
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/LabsInner.java#L1063-L1070
fcrepo3/fcrepo
fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java
XercesXmlSerializers.writeConsoleWithDocType
public static void writeConsoleWithDocType(Document ele, Writer out) throws IOException { XMLSerializer serializer = new XMLSerializer(out, CONSOLE_WITH_DOCTYPE); serializer.serialize(ele); }
java
public static void writeConsoleWithDocType(Document ele, Writer out) throws IOException { XMLSerializer serializer = new XMLSerializer(out, CONSOLE_WITH_DOCTYPE); serializer.serialize(ele); }
[ "public", "static", "void", "writeConsoleWithDocType", "(", "Document", "ele", ",", "Writer", "out", ")", "throws", "IOException", "{", "XMLSerializer", "serializer", "=", "new", "XMLSerializer", "(", "out", ",", "CONSOLE_WITH_DOCTYPE", ")", ";", "serializer", "."...
This method is used in object conversion. None of the standard formats -- FOXML, METS, ATOM -- have DOCTYPE declarations, so the inability of XSLT to propagate that information is probably irrelevant. However, the line wrapping issue remains. method: "XML" charset: "UTF-8" indenting: TRUE indent-width: 2 line-width: 8...
[ "This", "method", "is", "used", "in", "object", "conversion", ".", "None", "of", "the", "standard", "formats", "--", "FOXML", "METS", "ATOM", "--", "have", "DOCTYPE", "declarations", "so", "the", "inability", "of", "XSLT", "to", "propagate", "that", "informa...
train
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java#L108-L113
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java
WTable.updateBeanValueForColumnInRow
private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer, final UIContext rowContext, final List<Integer> rowIndex, final int col, final TableModel model) { // The actual component is wrapped in a renderer wrapper, so we have to fetch it from that WComponent renderer = ((Container) rowRe...
java
private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer, final UIContext rowContext, final List<Integer> rowIndex, final int col, final TableModel model) { // The actual component is wrapped in a renderer wrapper, so we have to fetch it from that WComponent renderer = ((Container) rowRe...
[ "private", "void", "updateBeanValueForColumnInRow", "(", "final", "WTableRowRenderer", "rowRenderer", ",", "final", "UIContext", "rowContext", ",", "final", "List", "<", "Integer", ">", "rowIndex", ",", "final", "int", "col", ",", "final", "TableModel", "model", "...
Update the column in the row. @param rowRenderer the table row renderer @param rowContext the row context @param rowIndex the row id to update @param col the column to update @param model the table model
[ "Update", "the", "column", "in", "the", "row", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L440-L465
looly/hutool
hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java
ReflectUtil.invokeWithCheck
public static <T> T invokeWithCheck(Object obj, Method method, Object... args) throws UtilException { final Class<?>[] types = method.getParameterTypes(); if (null != types && null != args) { Assert.isTrue(args.length == types.length, "Params length [{}] is not fit for param length [{}] of method !", args.len...
java
public static <T> T invokeWithCheck(Object obj, Method method, Object... args) throws UtilException { final Class<?>[] types = method.getParameterTypes(); if (null != types && null != args) { Assert.isTrue(args.length == types.length, "Params length [{}] is not fit for param length [{}] of method !", args.len...
[ "public", "static", "<", "T", ">", "T", "invokeWithCheck", "(", "Object", "obj", ",", "Method", "method", ",", "Object", "...", "args", ")", "throws", "UtilException", "{", "final", "Class", "<", "?", ">", "[", "]", "types", "=", "method", ".", "getPar...
执行方法<br> 执行前要检查给定参数: <pre> 1. 参数个数是否与方法参数个数一致 2. 如果某个参数为null但是方法这个位置的参数为原始类型,则赋予原始类型默认值 </pre> @param <T> 返回对象类型 @param obj 对象,如果执行静态方法,此值为<code>null</code> @param method 方法(对象方法或static方法都可) @param args 参数对象 @return 结果 @throws UtilException 一些列异常的包装
[ "执行方法<br", ">", "执行前要检查给定参数:" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L755-L770
UrielCh/ovh-java-sdk
ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java
ApiOvhService.serviceId_GET
public OvhService serviceId_GET(Long serviceId) throws IOException { String qPath = "/service/{serviceId}"; StringBuilder sb = path(qPath, serviceId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhService.class); }
java
public OvhService serviceId_GET(Long serviceId) throws IOException { String qPath = "/service/{serviceId}"; StringBuilder sb = path(qPath, serviceId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhService.class); }
[ "public", "OvhService", "serviceId_GET", "(", "Long", "serviceId", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/service/{serviceId}\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath", ",", "serviceId", ")", ";", "String", "resp", "=", ...
Get this object properties REST: GET /service/{serviceId} @param serviceId [required] The internal ID of your service API beta
[ "Get", "this", "object", "properties" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java#L60-L65
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java
ImageBandMath.stdDev
public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg) { stdDev(input,output,avg,0,input.getNumBands() - 1); }
java
public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg) { stdDev(input,output,avg,0,input.getNumBands() - 1); }
[ "public", "static", "void", "stdDev", "(", "Planar", "<", "GrayU16", ">", "input", ",", "GrayU16", "output", ",", "@", "Nullable", "GrayU16", "avg", ")", "{", "stdDev", "(", "input", ",", "output", ",", "avg", ",", "0", ",", "input", ".", "getNumBands"...
Computes the standard deviation for each pixel across all bands in the {@link Planar} image. @param input Planar image - not modified @param output Gray scale image containing average pixel values - modified @param avg Input Gray scale image containing average image. Can be null
[ "Computes", "the", "standard", "deviation", "for", "each", "pixel", "across", "all", "bands", "in", "the", "{" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java#L527-L529
xebia-france/xebia-servlet-extras
src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java
ExpiresFilter.startsWithIgnoreCase
protected static boolean startsWithIgnoreCase(String string, String prefix) { if (string == null || prefix == null) { return string == null && prefix == null; } if (prefix.length() > string.length()) { return false; } return string.regionMatches(true, 0, ...
java
protected static boolean startsWithIgnoreCase(String string, String prefix) { if (string == null || prefix == null) { return string == null && prefix == null; } if (prefix.length() > string.length()) { return false; } return string.regionMatches(true, 0, ...
[ "protected", "static", "boolean", "startsWithIgnoreCase", "(", "String", "string", ",", "String", "prefix", ")", "{", "if", "(", "string", "==", "null", "||", "prefix", "==", "null", ")", "{", "return", "string", "==", "null", "&&", "prefix", "==", "null",...
Return <code>true</code> if the given <code>string</code> starts with the given <code>prefix</code> ignoring case. @param string can be <code>null</code> @param prefix can be <code>null</code>
[ "Return", "<code", ">", "true<", "/", "code", ">", "if", "the", "given", "<code", ">", "string<", "/", "code", ">", "starts", "with", "the", "given", "<code", ">", "prefix<", "/", "code", ">", "ignoring", "case", "." ]
train
https://github.com/xebia-france/xebia-servlet-extras/blob/b263636fc78f8794dde57d92b835edb5e95ce379/src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java#L1170-L1179
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java
WComponentGroupRenderer.doRender
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WComponentGroup group = (WComponentGroup) component; XmlStringBuilder xml = renderContext.getWriter(); List<WComponent> components = group.getComponents(); if (components != null && !components.isEmpty()) { ...
java
@Override public void doRender(final WComponent component, final WebXmlRenderContext renderContext) { WComponentGroup group = (WComponentGroup) component; XmlStringBuilder xml = renderContext.getWriter(); List<WComponent> components = group.getComponents(); if (components != null && !components.isEmpty()) { ...
[ "@", "Override", "public", "void", "doRender", "(", "final", "WComponent", "component", ",", "final", "WebXmlRenderContext", "renderContext", ")", "{", "WComponentGroup", "group", "=", "(", "WComponentGroup", ")", "component", ";", "XmlStringBuilder", "xml", "=", ...
Paints the given WComponentGroup. @param component the WComponentGroup to paint. @param renderContext the RenderContext to paint to.
[ "Paints", "the", "given", "WComponentGroup", "." ]
train
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java#L23-L43
structr/structr
structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java
GraphObjectModificationState.doValidationAndIndexing
public boolean doValidationAndIndexing(ModificationQueue modificationQueue, SecurityContext securityContext, ErrorBuffer errorBuffer, boolean doValidation) throws FrameworkException { boolean valid = true; // examine only the last 4 bits here switch (status & 0x000f) { case 6: // created, modified => only c...
java
public boolean doValidationAndIndexing(ModificationQueue modificationQueue, SecurityContext securityContext, ErrorBuffer errorBuffer, boolean doValidation) throws FrameworkException { boolean valid = true; // examine only the last 4 bits here switch (status & 0x000f) { case 6: // created, modified => only c...
[ "public", "boolean", "doValidationAndIndexing", "(", "ModificationQueue", "modificationQueue", ",", "SecurityContext", "securityContext", ",", "ErrorBuffer", "errorBuffer", ",", "boolean", "doValidation", ")", "throws", "FrameworkException", "{", "boolean", "valid", "=", ...
Call beforeModification/Creation/Deletion methods. @param modificationQueue @param securityContext @param errorBuffer @param doValidation @return valid @throws FrameworkException
[ "Call", "beforeModification", "/", "Creation", "/", "Deletion", "methods", "." ]
train
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java#L363-L395
apache/incubator-shardingsphere
sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java
BackendConnection.setCurrentSchema
public void setCurrentSchema(final String schemaName) { if (isSwitchFailed()) { throw new ShardingException("Failed to switch schema, please terminate current transaction."); } this.schemaName = schemaName; this.logicSchema = LogicSchemas.getInstance().getLogicSchema(schemaNa...
java
public void setCurrentSchema(final String schemaName) { if (isSwitchFailed()) { throw new ShardingException("Failed to switch schema, please terminate current transaction."); } this.schemaName = schemaName; this.logicSchema = LogicSchemas.getInstance().getLogicSchema(schemaNa...
[ "public", "void", "setCurrentSchema", "(", "final", "String", "schemaName", ")", "{", "if", "(", "isSwitchFailed", "(", ")", ")", "{", "throw", "new", "ShardingException", "(", "\"Failed to switch schema, please terminate current transaction.\"", ")", ";", "}", "this"...
Change logic schema of current channel. @param schemaName schema name
[ "Change", "logic", "schema", "of", "current", "channel", "." ]
train
https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-proxy/sharding-proxy-backend/src/main/java/org/apache/shardingsphere/shardingproxy/backend/communication/jdbc/connection/BackendConnection.java#L105-L111
vtatai/srec
core/src/main/java/com/github/srec/util/Utils.java
Utils.groovyEvaluateConvert
public static Value groovyEvaluateConvert(ExecutionContext context, String expression) { Object obj = groovyEvaluate(context, expression); return Utils.convertFromJava(obj); }
java
public static Value groovyEvaluateConvert(ExecutionContext context, String expression) { Object obj = groovyEvaluate(context, expression); return Utils.convertFromJava(obj); }
[ "public", "static", "Value", "groovyEvaluateConvert", "(", "ExecutionContext", "context", ",", "String", "expression", ")", "{", "Object", "obj", "=", "groovyEvaluate", "(", "context", ",", "expression", ")", ";", "return", "Utils", ".", "convertFromJava", "(", ...
Evaluates an expression using Groovy, converting the final value. @param context The EC @param expression The expression to evaluate @return The value converted
[ "Evaluates", "an", "expression", "using", "Groovy", "converting", "the", "final", "value", "." ]
train
https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/util/Utils.java#L266-L269
JodaOrg/joda-time
src/main/java/org/joda/time/chrono/ZonedChronology.java
ZonedChronology.getInstance
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) { if (base == null) { throw new IllegalArgumentException("Must supply a chronology"); } base = base.withUTC(); if (base == null) { throw new IllegalArgumentException("UTC chronology must...
java
public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) { if (base == null) { throw new IllegalArgumentException("Must supply a chronology"); } base = base.withUTC(); if (base == null) { throw new IllegalArgumentException("UTC chronology must...
[ "public", "static", "ZonedChronology", "getInstance", "(", "Chronology", "base", ",", "DateTimeZone", "zone", ")", "{", "if", "(", "base", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Must supply a chronology\"", ")", ";", "}", "ba...
Create a ZonedChronology for any chronology, overriding any time zone it may already have. @param base base chronology to wrap @param zone the time zone @throws IllegalArgumentException if chronology or time zone is null
[ "Create", "a", "ZonedChronology", "for", "any", "chronology", "overriding", "any", "time", "zone", "it", "may", "already", "have", "." ]
train
https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/ZonedChronology.java#L58-L70
kiegroup/jbpm
jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java
BAMTaskEventListener.createOrUpdateTask
protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) { return updateTask(event, newStatus, null); }
java
protected BAMTaskSummaryImpl createOrUpdateTask(TaskEvent event, Status newStatus) { return updateTask(event, newStatus, null); }
[ "protected", "BAMTaskSummaryImpl", "createOrUpdateTask", "(", "TaskEvent", "event", ",", "Status", "newStatus", ")", "{", "return", "updateTask", "(", "event", ",", "newStatus", ",", "null", ")", ";", "}" ]
Creates or updates a bam task summary instance. @param ti The source task @param newStatus The new state for the task. @return The created or updated bam task summary instance.
[ "Creates", "or", "updates", "a", "bam", "task", "summary", "instance", "." ]
train
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java#L206-L208
alkacon/opencms-core
src/org/opencms/publish/CmsPublishEngine.java
CmsPublishEngine.enqueuePublishJob
public void enqueuePublishJob(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException { // check the driver manager if ((m_driverManager == null) || (m_dbContextFactory == null)) { // the resources are unlocked in the driver manager throw new CmsPublis...
java
public void enqueuePublishJob(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException { // check the driver manager if ((m_driverManager == null) || (m_dbContextFactory == null)) { // the resources are unlocked in the driver manager throw new CmsPublis...
[ "public", "void", "enqueuePublishJob", "(", "CmsObject", "cms", ",", "CmsPublishList", "publishList", ",", "I_CmsReport", "report", ")", "throws", "CmsException", "{", "// check the driver manager", "if", "(", "(", "m_driverManager", "==", "null", ")", "||", "(", ...
Enqueues a new publish job with the given information in publish queue.<p> All resources should already be locked.<p> If possible, the publish job starts immediately.<p> @param cms the cms context to publish for @param publishList the resources to publish @param report the report to write to @throws CmsException if...
[ "Enqueues", "a", "new", "publish", "job", "with", "the", "given", "information", "in", "publish", "queue", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishEngine.java#L230-L262
JOML-CI/JOML
src/org/joml/Vector4f.java
Vector4f.set
public Vector4f set(int index, ByteBuffer buffer) { MemUtil.INSTANCE.get(this, index, buffer); return this; }
java
public Vector4f set(int index, ByteBuffer buffer) { MemUtil.INSTANCE.get(this, index, buffer); return this; }
[ "public", "Vector4f", "set", "(", "int", "index", ",", "ByteBuffer", "buffer", ")", "{", "MemUtil", ".", "INSTANCE", ".", "get", "(", "this", ",", "index", ",", "buffer", ")", ";", "return", "this", ";", "}" ]
Read this vector from the supplied {@link ByteBuffer} starting at the specified absolute buffer position/index. <p> This method will not increment the position of the given ByteBuffer. @param index the absolute position into the ByteBuffer @param buffer values will be read in <code>x, y, z, w</code> order @return this
[ "Read", "this", "vector", "from", "the", "supplied", "{", "@link", "ByteBuffer", "}", "starting", "at", "the", "specified", "absolute", "buffer", "position", "/", "index", ".", "<p", ">", "This", "method", "will", "not", "increment", "the", "position", "of",...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4f.java#L459-L462
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java
CLIQUESubspace.leftNeighbor
protected CLIQUEUnit leftNeighbor(CLIQUEUnit unit, int dim) { for(CLIQUEUnit u : denseUnits) { if(u.containsLeftNeighbor(unit, dim)) { return u; } } return null; }
java
protected CLIQUEUnit leftNeighbor(CLIQUEUnit unit, int dim) { for(CLIQUEUnit u : denseUnits) { if(u.containsLeftNeighbor(unit, dim)) { return u; } } return null; }
[ "protected", "CLIQUEUnit", "leftNeighbor", "(", "CLIQUEUnit", "unit", ",", "int", "dim", ")", "{", "for", "(", "CLIQUEUnit", "u", ":", "denseUnits", ")", "{", "if", "(", "u", ".", "containsLeftNeighbor", "(", "unit", ",", "dim", ")", ")", "{", "return", ...
Returns the left neighbor of the given unit in the specified dimension. @param unit the unit to determine the left neighbor for @param dim the dimension @return the left neighbor of the given unit in the specified dimension
[ "Returns", "the", "left", "neighbor", "of", "the", "given", "unit", "in", "the", "specified", "dimension", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/clique/CLIQUESubspace.java#L146-L153
google/closure-compiler
src/com/google/javascript/rhino/jstype/FunctionType.java
FunctionType.tryMergeFunctionPiecewise
private FunctionType tryMergeFunctionPiecewise(FunctionType other, boolean leastSuper) { Node newParamsNode = null; if (call.hasEqualParameters(other.call, EquivalenceMethod.IDENTITY, EqCache.create())) { newParamsNode = call.parameters; } else { // If the parameters are not equal, don't try to ...
java
private FunctionType tryMergeFunctionPiecewise(FunctionType other, boolean leastSuper) { Node newParamsNode = null; if (call.hasEqualParameters(other.call, EquivalenceMethod.IDENTITY, EqCache.create())) { newParamsNode = call.parameters; } else { // If the parameters are not equal, don't try to ...
[ "private", "FunctionType", "tryMergeFunctionPiecewise", "(", "FunctionType", "other", ",", "boolean", "leastSuper", ")", "{", "Node", "newParamsNode", "=", "null", ";", "if", "(", "call", ".", "hasEqualParameters", "(", "other", ".", "call", ",", "EquivalenceMetho...
Try to get the sup/inf of two functions by looking at the piecewise components.
[ "Try", "to", "get", "the", "sup", "/", "inf", "of", "two", "functions", "by", "looking", "at", "the", "piecewise", "components", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/FunctionType.java#L827-L860
alkacon/opencms-core
src/org/opencms/db/CmsDriverManager.java
CmsDriverManager.lockResource
public void lockResource(CmsDbContext dbc, CmsResource resource, CmsLockType type) throws CmsException { // update the resource cache m_monitor.clearResourceCache(); CmsProject project = dbc.currentProject(); // add the resource to the lock dispatcher m_lockManager.addResource...
java
public void lockResource(CmsDbContext dbc, CmsResource resource, CmsLockType type) throws CmsException { // update the resource cache m_monitor.clearResourceCache(); CmsProject project = dbc.currentProject(); // add the resource to the lock dispatcher m_lockManager.addResource...
[ "public", "void", "lockResource", "(", "CmsDbContext", "dbc", ",", "CmsResource", "resource", ",", "CmsLockType", "type", ")", "throws", "CmsException", "{", "// update the resource cache", "m_monitor", ".", "clearResourceCache", "(", ")", ";", "CmsProject", "project"...
Locks a resource.<p> The <code>type</code> parameter controls what kind of lock is used.<br> Possible values for this parameter are: <br> <ul> <li><code>{@link org.opencms.lock.CmsLockType#EXCLUSIVE}</code></li> <li><code>{@link org.opencms.lock.CmsLockType#TEMPORARY}</code></li> <li><code>{@link org.opencms.lock.CmsL...
[ "Locks", "a", "resource", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5406-L5433
bushidowallet/bushido-java-service
bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java
CoinUtil.fullValueString
public static String fullValueString(long value, Denomination denomination) { BigDecimal d = BigDecimal.valueOf(value); d = d.movePointLeft(denomination.getDecimalPlaces()); return d.toPlainString(); }
java
public static String fullValueString(long value, Denomination denomination) { BigDecimal d = BigDecimal.valueOf(value); d = d.movePointLeft(denomination.getDecimalPlaces()); return d.toPlainString(); }
[ "public", "static", "String", "fullValueString", "(", "long", "value", ",", "Denomination", "denomination", ")", "{", "BigDecimal", "d", "=", "BigDecimal", ".", "valueOf", "(", "value", ")", ";", "d", "=", "d", ".", "movePointLeft", "(", "denomination", ".",...
Get the given value in satoshis as a string on the form "10.12345000" using the specified denomination. <p> This method always returns a string with all decimal points. If you only wish to have the necessary digits use {@link CoinUtil#valueString(long, Denomination)} @param value The number of satoshis @param denomina...
[ "Get", "the", "given", "value", "in", "satoshis", "as", "a", "string", "on", "the", "form", "10", ".", "12345000", "using", "the", "specified", "denomination", ".", "<p", ">", "This", "method", "always", "returns", "a", "string", "with", "all", "decimal", ...
train
https://github.com/bushidowallet/bushido-java-service/blob/e1a0157527e57459b509718044d2df44084876a2/bushido-service-lib/src/main/java/com/bccapi/bitlib/util/CoinUtil.java#L153-L157
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java
AnalyticsQuery.parameterized
public static ParameterizedAnalyticsQuery parameterized(final String statement, final JsonArray positionalParams) { return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null); }
java
public static ParameterizedAnalyticsQuery parameterized(final String statement, final JsonArray positionalParams) { return new ParameterizedAnalyticsQuery(statement, positionalParams, null, null); }
[ "public", "static", "ParameterizedAnalyticsQuery", "parameterized", "(", "final", "String", "statement", ",", "final", "JsonArray", "positionalParams", ")", "{", "return", "new", "ParameterizedAnalyticsQuery", "(", "statement", ",", "positionalParams", ",", "null", ",",...
Creates an {@link AnalyticsQuery} with positional parameters as part of the query. @param statement the statement to send. @param positionalParams the positional parameters which will be put in for the placeholders. @return a {@link AnalyticsQuery}.
[ "Creates", "an", "{", "@link", "AnalyticsQuery", "}", "with", "positional", "parameters", "as", "part", "of", "the", "query", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java#L80-L83
openengsb/openengsb
components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java
AbstractStandardTransformationOperation.getParameterOrDefault
protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue) throws TransformationOperationException { return getParameter(parameters, paramName, false, defaultValue); }
java
protected String getParameterOrDefault(Map<String, String> parameters, String paramName, String defaultValue) throws TransformationOperationException { return getParameter(parameters, paramName, false, defaultValue); }
[ "protected", "String", "getParameterOrDefault", "(", "Map", "<", "String", ",", "String", ">", "parameters", ",", "String", "paramName", ",", "String", "defaultValue", ")", "throws", "TransformationOperationException", "{", "return", "getParameter", "(", "parameters",...
Get the parameter with the given parameter name from the parameter map. If the parameters does not contain such a parameter, take the default value instead.
[ "Get", "the", "parameter", "with", "the", "given", "parameter", "name", "from", "the", "parameter", "map", ".", "If", "the", "parameters", "does", "not", "contain", "such", "a", "parameter", "take", "the", "default", "value", "instead", "." ]
train
https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/AbstractStandardTransformationOperation.java#L85-L88
Azure/azure-sdk-for-java
datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java
FilesInner.createOrUpdateAsync
public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1<ServiceResponse<ProjectFileInne...
java
public Observable<ProjectFileInner> createOrUpdateAsync(String groupName, String serviceName, String projectName, String fileName, ProjectFileInner parameters) { return createOrUpdateWithServiceResponseAsync(groupName, serviceName, projectName, fileName, parameters).map(new Func1<ServiceResponse<ProjectFileInne...
[ "public", "Observable", "<", "ProjectFileInner", ">", "createOrUpdateAsync", "(", "String", "groupName", ",", "String", "serviceName", ",", "String", "projectName", ",", "String", "fileName", ",", "ProjectFileInner", "parameters", ")", "{", "return", "createOrUpdateWi...
Create a file resource. The PUT method creates a new file or updates an existing one. @param groupName Name of the resource group @param serviceName Name of the service @param projectName Name of the project @param fileName Name of the File @param parameters Information about the file @throws IllegalArgumentException ...
[ "Create", "a", "file", "resource", ".", "The", "PUT", "method", "creates", "a", "new", "file", "or", "updates", "an", "existing", "one", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L387-L394
alkacon/opencms-core
src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java
CmsDefaultXmlContentHandler.initLayouts
protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { m_useAcacia = safeParseBoolean(root.attributeValue(ATTR_USE_ACACIA), true); Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_LAYOUT); while (i.hasNext()) { ...
java
protected void initLayouts(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException { m_useAcacia = safeParseBoolean(root.attributeValue(ATTR_USE_ACACIA), true); Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_LAYOUT); while (i.hasNext()) { ...
[ "protected", "void", "initLayouts", "(", "Element", "root", ",", "CmsXmlContentDefinition", "contentDefinition", ")", "throws", "CmsXmlException", "{", "m_useAcacia", "=", "safeParseBoolean", "(", "root", ".", "attributeValue", "(", "ATTR_USE_ACACIA", ")", ",", "true"...
Initializes the layout for this content handler.<p> Unless otherwise instructed, the editor uses one specific GUI widget for each XML value schema type. For example, for a {@link org.opencms.xml.types.CmsXmlStringValue} the default widget is the {@link org.opencms.widgets.CmsInputWidget}. However, certain values can a...
[ "Initializes", "the", "layout", "for", "this", "content", "handler", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2702-L2724
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java
CommonOps_DDF2.elementDiv
public static void elementDiv( DMatrix2 a , DMatrix2 b) { a.a1 /= b.a1; a.a2 /= b.a2; }
java
public static void elementDiv( DMatrix2 a , DMatrix2 b) { a.a1 /= b.a1; a.a2 /= b.a2; }
[ "public", "static", "void", "elementDiv", "(", "DMatrix2", "a", ",", "DMatrix2", "b", ")", "{", "a", ".", "a1", "/=", "b", ".", "a1", ";", "a", ".", "a2", "/=", "b", ".", "a2", ";", "}" ]
<p>Performs an element by element division operation:<br> <br> a<sub>i</sub> = a<sub>i</sub> / b<sub>i</sub> <br> </p> @param a The left vector in the division operation. Modified. @param b The right vector in the division operation. Not modified.
[ "<p", ">", "Performs", "an", "element", "by", "element", "division", "operation", ":", "<br", ">", "<br", ">", "a<sub", ">", "i<", "/", "sub", ">", "=", "a<sub", ">", "i<", "/", "sub", ">", "/", "b<sub", ">", "i<", "/", "sub", ">", "<br", ">", ...
train
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L933-L936
alibaba/canal
driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java
UUIDSet.parseInterval
public static Interval parseInterval(String str) { String[] ss = str.split("-"); Interval interval = new Interval(); switch (ss.length) { case 1: interval.start = Long.parseLong(ss[0]); interval.stop = interval.start + 1; break; ...
java
public static Interval parseInterval(String str) { String[] ss = str.split("-"); Interval interval = new Interval(); switch (ss.length) { case 1: interval.start = Long.parseLong(ss[0]); interval.stop = interval.start + 1; break; ...
[ "public", "static", "Interval", "parseInterval", "(", "String", "str", ")", "{", "String", "[", "]", "ss", "=", "str", ".", "split", "(", "\"-\"", ")", ";", "Interval", "interval", "=", "new", "Interval", "(", ")", ";", "switch", "(", "ss", ".", "len...
解析如下格式字符串为Interval: 1 => Interval{start:1, stop:2} 1-3 => Interval{start:1, stop:4} 注意!字符串格式表达时[n,m]是两侧都包含的,Interval表达时[n,m)右侧开 @param str @return
[ "解析如下格式字符串为Interval", ":", "1", "=", ">", "Interval", "{", "start", ":", "1", "stop", ":", "2", "}", "1", "-", "3", "=", ">", "Interval", "{", "start", ":", "1", "stop", ":", "4", "}", "注意!字符串格式表达时", "[", "n", "m", "]", "是两侧都包含的,Interval表达时", "[", ...
train
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/driver/src/main/java/com/alibaba/otter/canal/parse/driver/mysql/packets/UUIDSet.java#L147-L165
pebble/pebble-android-sdk
PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java
PebbleKit.sendNackToPebble
public static void sendNackToPebble(final Context context, final int transactionId) throws IllegalArgumentException { if ((transactionId & ~0xff) != 0) { throw new IllegalArgumentException(String.format( "transaction id must be between (0, 255); got '%d'", transactio...
java
public static void sendNackToPebble(final Context context, final int transactionId) throws IllegalArgumentException { if ((transactionId & ~0xff) != 0) { throw new IllegalArgumentException(String.format( "transaction id must be between (0, 255); got '%d'", transactio...
[ "public", "static", "void", "sendNackToPebble", "(", "final", "Context", "context", ",", "final", "int", "transactionId", ")", "throws", "IllegalArgumentException", "{", "if", "(", "(", "transactionId", "&", "~", "0xff", ")", "!=", "0", ")", "{", "throw", "n...
Send a message to the connected watch that the previously sent PebbleDictionary was not received successfully. To avoid protocol timeouts on the watch, applications <em>must</em> ACK or NACK all received messages. @param context The context used to send the broadcast. @param transactionId The transaction id of the mes...
[ "Send", "a", "message", "to", "the", "connected", "watch", "that", "the", "previously", "sent", "PebbleDictionary", "was", "not", "received", "successfully", ".", "To", "avoid", "protocol", "timeouts", "on", "the", "watch", "applications", "<em", ">", "must<", ...
train
https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L357-L368
linkedin/dexmaker
dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java
MockMethodAdvice.isOverridden
public boolean isOverridden(Object instance, Method origin) { Class<?> currentType = instance.getClass(); do { try { return !origin.equals(currentType.getDeclaredMethod(origin.getName(), origin.getParameterTypes())); } catch (NoSuchMethodE...
java
public boolean isOverridden(Object instance, Method origin) { Class<?> currentType = instance.getClass(); do { try { return !origin.equals(currentType.getDeclaredMethod(origin.getName(), origin.getParameterTypes())); } catch (NoSuchMethodE...
[ "public", "boolean", "isOverridden", "(", "Object", "instance", ",", "Method", "origin", ")", "{", "Class", "<", "?", ">", "currentType", "=", "instance", ".", "getClass", "(", ")", ";", "do", "{", "try", "{", "return", "!", "origin", ".", "equals", "(...
Check if a method is overridden. @param instance mocked instance @param origin method that might be overridden @return {@code true} iff the method is overridden
[ "Check", "if", "a", "method", "is", "overridden", "." ]
train
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker-mockito-inline/src/main/java/com/android/dx/mockito/inline/MockMethodAdvice.java#L239-L252
box/box-java-sdk
src/main/java/com/box/sdk/BoxUser.java
BoxUser.getAllEnterpriseUsers
public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm, final String... fields) { return getUsersInfoForType(api, filterTerm, null, null, fields); }
java
public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm, final String... fields) { return getUsersInfoForType(api, filterTerm, null, null, fields); }
[ "public", "static", "Iterable", "<", "BoxUser", ".", "Info", ">", "getAllEnterpriseUsers", "(", "final", "BoxAPIConnection", "api", ",", "final", "String", "filterTerm", ",", "final", "String", "...", "fields", ")", "{", "return", "getUsersInfoForType", "(", "ap...
Returns an iterable containing all the enterprise users that matches the filter and specifies which child fields to retrieve from the API. @param api the API connection to be used when retrieving the users. @param filterTerm used to filter the results to only users starting with this string in either the name ...
[ "Returns", "an", "iterable", "containing", "all", "the", "enterprise", "users", "that", "matches", "the", "filter", "and", "specifies", "which", "child", "fields", "to", "retrieve", "from", "the", "API", "." ]
train
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L191-L194
lucee/Lucee
core/src/main/java/lucee/runtime/db/QoQ.java
QoQ.executeAnd
private Object executeAnd(PageContext pc, SQL sql, Query qr, Operation2 expression, int row) throws PageException { // print.out("("+expression.getLeft().toString(true)+" AND // "+expression.getRight().toString(true)+")"); boolean rtn = Caster.toBooleanValue(executeExp(pc, sql, qr, expression.getLeft(), row)); if (...
java
private Object executeAnd(PageContext pc, SQL sql, Query qr, Operation2 expression, int row) throws PageException { // print.out("("+expression.getLeft().toString(true)+" AND // "+expression.getRight().toString(true)+")"); boolean rtn = Caster.toBooleanValue(executeExp(pc, sql, qr, expression.getLeft(), row)); if (...
[ "private", "Object", "executeAnd", "(", "PageContext", "pc", ",", "SQL", "sql", ",", "Query", "qr", ",", "Operation2", "expression", ",", "int", "row", ")", "throws", "PageException", "{", "// print.out(\"(\"+expression.getLeft().toString(true)+\" AND", "// \"+expressio...
/* * @param expression / private void print(ZExpression expression) { print.ln("Operator:"+expression.getOperator().toLowerCase()); int len=expression.nbOperands(); for(int i=0;i<len;i++) { print.ln(" ["+i+"]= "+expression.getOperand(i)); } }/* /** execute a and operation @param qr QueryResult to execute on it @...
[ "/", "*", "*" ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/QoQ.java#L548-L554
erlang/otp
lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
OtpOutputStream.write_ref
public void write_ref(final String node, final int id, final int creation) { /* Always encode as an extended reference; all participating parties are now expected to be able to decode extended references. */ int ids[] = new int[1]; ids[0] = id; write_ref(node, ids, creation); }
java
public void write_ref(final String node, final int id, final int creation) { /* Always encode as an extended reference; all participating parties are now expected to be able to decode extended references. */ int ids[] = new int[1]; ids[0] = id; write_ref(node, ids, creation); }
[ "public", "void", "write_ref", "(", "final", "String", "node", ",", "final", "int", "id", ",", "final", "int", "creation", ")", "{", "/* Always encode as an extended reference; all\n\t participating parties are now expected to be\n\t able to decode extended references. */", "...
Write an old style Erlang ref to the stream. @param node the nodename. @param id an arbitrary number. Only the low order 18 bits will be used. @param creation another arbitrary number.
[ "Write", "an", "old", "style", "Erlang", "ref", "to", "the", "stream", "." ]
train
https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java#L802-L809
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java
ChartResources.getCharts
@GET @Produces(MediaType.APPLICATION_JSON) @Description("Return a list of charts owned by a user. Optionally, provide an entityId to filter charts associated " + "with a given entity. ") public List<ChartDto> getCharts(@Context HttpServletRequest req, @QueryParam("ownerName") String ownerName, @QueryParam(...
java
@GET @Produces(MediaType.APPLICATION_JSON) @Description("Return a list of charts owned by a user. Optionally, provide an entityId to filter charts associated " + "with a given entity. ") public List<ChartDto> getCharts(@Context HttpServletRequest req, @QueryParam("ownerName") String ownerName, @QueryParam(...
[ "@", "GET", "@", "Produces", "(", "MediaType", ".", "APPLICATION_JSON", ")", "@", "Description", "(", "\"Return a list of charts owned by a user. Optionally, provide an entityId to filter charts associated \"", "+", "\"", "with", "given", "entity", ".", "\"", ")", "public",...
Return a list of charts owned by a user. Optionally, provide an entityId to filter charts associated with a given entity. @param req The HttpServlet request object. Cannot be null. @param ownerName Optional. The username for which to retrieve charts. For non-privileged this must be null or equal to the log...
[ "Return", "a", "list", "of", "charts", "owned", "by", "a", "user", ".", "Optionally", "provide", "an", "entityId", "to", "filter", "charts", "associated", "with", "a", "given", "entity", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/ChartResources.java#L264-L294
deeplearning4j/deeplearning4j
datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java
WritableUtils.writeStringArray
public static void writeStringArray(DataOutput out, String[] s) throws IOException { out.writeInt(s.length); for (int i = 0; i < s.length; i++) { writeString(out, s[i]); } }
java
public static void writeStringArray(DataOutput out, String[] s) throws IOException { out.writeInt(s.length); for (int i = 0; i < s.length; i++) { writeString(out, s[i]); } }
[ "public", "static", "void", "writeStringArray", "(", "DataOutput", "out", ",", "String", "[", "]", "s", ")", "throws", "IOException", "{", "out", ".", "writeInt", "(", "s", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "...
/* Write a String array as a Nework Int N, followed by Int N Byte Array Strings. Could be generalised using introspection.
[ "/", "*", "Write", "a", "String", "array", "as", "a", "Nework", "Int", "N", "followed", "by", "Int", "N", "Byte", "Array", "Strings", ".", "Could", "be", "generalised", "using", "introspection", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java#L129-L134
joniles/mpxj
src/main/java/net/sf/mpxj/asta/AstaReader.java
AstaReader.processTasks
public void processTasks(List<Row> bars, List<Row> expandedTasks, List<Row> tasks, List<Row> milestones) { List<Row> parentBars = buildRowHierarchy(bars, expandedTasks, tasks, milestones); createTasks(m_project, "", parentBars); deriveProjectCalendar(); updateStructure(); }
java
public void processTasks(List<Row> bars, List<Row> expandedTasks, List<Row> tasks, List<Row> milestones) { List<Row> parentBars = buildRowHierarchy(bars, expandedTasks, tasks, milestones); createTasks(m_project, "", parentBars); deriveProjectCalendar(); updateStructure(); }
[ "public", "void", "processTasks", "(", "List", "<", "Row", ">", "bars", ",", "List", "<", "Row", ">", "expandedTasks", ",", "List", "<", "Row", ">", "tasks", ",", "List", "<", "Row", ">", "milestones", ")", "{", "List", "<", "Row", ">", "parentBars",...
Organises the data from Asta into a hierarchy and converts this into tasks. @param bars bar data @param expandedTasks expanded task data @param tasks task data @param milestones milestone data
[ "Organises", "the", "data", "from", "Asta", "into", "a", "hierarchy", "and", "converts", "this", "into", "tasks", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaReader.java#L198-L204
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java
QrCodeUtil.toImage
public static BufferedImage toImage(BitMatrix matrix, int foreColor, int backColor) { final int width = matrix.getWidth(); final int height = matrix.getHeight(); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < width; x++) { for (int y = 0; y < heig...
java
public static BufferedImage toImage(BitMatrix matrix, int foreColor, int backColor) { final int width = matrix.getWidth(); final int height = matrix.getHeight(); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < width; x++) { for (int y = 0; y < heig...
[ "public", "static", "BufferedImage", "toImage", "(", "BitMatrix", "matrix", ",", "int", "foreColor", ",", "int", "backColor", ")", "{", "final", "int", "width", "=", "matrix", ".", "getWidth", "(", ")", ";", "final", "int", "height", "=", "matrix", ".", ...
BitMatrix转BufferedImage @param matrix BitMatrix @param foreColor 前景色 @param backColor 背景色 @return BufferedImage @since 4.1.2
[ "BitMatrix转BufferedImage" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L341-L351
m-m-m/util
xml/src/main/java/net/sf/mmm/util/xml/base/DomUtilImpl.java
DomUtilImpl.isEqual
protected boolean isEqual(CharIterator charIterator1, CharIterator charIterator2, XmlCompareMode mode) { CharIterator c1, c2; if (mode.isNormalizeSpaces()) { c1 = new SpaceNormalizingCharIterator(charIterator1); c2 = new SpaceNormalizingCharIterator(charIterator2); } else { c1 = charItera...
java
protected boolean isEqual(CharIterator charIterator1, CharIterator charIterator2, XmlCompareMode mode) { CharIterator c1, c2; if (mode.isNormalizeSpaces()) { c1 = new SpaceNormalizingCharIterator(charIterator1); c2 = new SpaceNormalizingCharIterator(charIterator2); } else { c1 = charItera...
[ "protected", "boolean", "isEqual", "(", "CharIterator", "charIterator1", ",", "CharIterator", "charIterator2", ",", "XmlCompareMode", "mode", ")", "{", "CharIterator", "c1", ",", "c2", ";", "if", "(", "mode", ".", "isNormalizeSpaces", "(", ")", ")", "{", "c1",...
This method determines if the given {@link CharSequence}s are equal. @see #isEqual(Node, Node, XmlCompareMode) @param charIterator1 is the first {@link CharIterator}. @param charIterator2 is the second {@link CharIterator}. @param mode is the mode of comparison. @return {@code true} if equal, {@code false} otherwise.
[ "This", "method", "determines", "if", "the", "given", "{", "@link", "CharSequence", "}", "s", "are", "equal", "." ]
train
https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/xml/src/main/java/net/sf/mmm/util/xml/base/DomUtilImpl.java#L462-L473
paylogic/java-fogbugz
src/main/java/org/paylogic/fogbugz/FogbugzManager.java
FogbugzManager.getFogbugzDocument
private Document getFogbugzDocument(Map<String, String> parameters) throws IOException, ParserConfigurationException, SAXException { URL uri = new URL(this.mapToFogbugzUrl(parameters)); HttpURLConnection con = (HttpURLConnection) uri.openConnection(); DocumentBuilderFactory dbFactory = DocumentB...
java
private Document getFogbugzDocument(Map<String, String> parameters) throws IOException, ParserConfigurationException, SAXException { URL uri = new URL(this.mapToFogbugzUrl(parameters)); HttpURLConnection con = (HttpURLConnection) uri.openConnection(); DocumentBuilderFactory dbFactory = DocumentB...
[ "private", "Document", "getFogbugzDocument", "(", "Map", "<", "String", ",", "String", ">", "parameters", ")", "throws", "IOException", ",", "ParserConfigurationException", ",", "SAXException", "{", "URL", "uri", "=", "new", "URL", "(", "this", ".", "mapToFogbug...
Fetches the XML from the Fogbugz API and returns a Document object with the response XML in it, so we can use that.
[ "Fetches", "the", "XML", "from", "the", "Fogbugz", "API", "and", "returns", "a", "Document", "object", "with", "the", "response", "XML", "in", "it", "so", "we", "can", "use", "that", "." ]
train
https://github.com/paylogic/java-fogbugz/blob/75651d82b2476e9ba2a0805311e18ee36882c2df/src/main/java/org/paylogic/fogbugz/FogbugzManager.java#L108-L114
hazelcast/hazelcast
hazelcast/src/main/java/com/hazelcast/util/ConcurrentReferenceHashMap.java
ConcurrentReferenceHashMap.applyIfAbsent
@Override public V applyIfAbsent(K key, IFunction<? super K, ? extends V> mappingFunction) { checkNotNull(key); checkNotNull(mappingFunction); int hash = hashOf(key); Segment<K, V> segment = segmentFor(hash); V v = segment.get(key, hash); return v == null ? segment.p...
java
@Override public V applyIfAbsent(K key, IFunction<? super K, ? extends V> mappingFunction) { checkNotNull(key); checkNotNull(mappingFunction); int hash = hashOf(key); Segment<K, V> segment = segmentFor(hash); V v = segment.get(key, hash); return v == null ? segment.p...
[ "@", "Override", "public", "V", "applyIfAbsent", "(", "K", "key", ",", "IFunction", "<", "?", "super", "K", ",", "?", "extends", "V", ">", "mappingFunction", ")", "{", "checkNotNull", "(", "key", ")", ";", "checkNotNull", "(", "mappingFunction", ")", ";"...
* {@inheritDoc} @throws UnsupportedOperationException {@inheritDoc} @throws ClassCastException {@inheritDoc} @throws NullPointerException {@inheritDoc} @implSpec The default implementation is equivalent to the following steps for this {@code map}, then returning the current value or {@code null} if...
[ "*", "{", "@inheritDoc", "}" ]
train
https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/ConcurrentReferenceHashMap.java#L1424-L1433
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/painter/RectanglePainter.java
RectanglePainter.deleteShape
public void deleteShape(Paintable paintable, Object group, MapContext context) { Rectangle rectangle = (Rectangle) paintable; context.getVectorContext().deleteElement(group, rectangle.getId()); }
java
public void deleteShape(Paintable paintable, Object group, MapContext context) { Rectangle rectangle = (Rectangle) paintable; context.getVectorContext().deleteElement(group, rectangle.getId()); }
[ "public", "void", "deleteShape", "(", "Paintable", "paintable", ",", "Object", "group", ",", "MapContext", "context", ")", "{", "Rectangle", "rectangle", "=", "(", "Rectangle", ")", "paintable", ";", "context", ".", "getVectorContext", "(", ")", ".", "deleteEl...
Delete a {@link Paintable} object from the given {@link MapContext}. It the object does not exist, nothing will be done. @param paintable The object to be painted. @param group The group where the object resides in (optional). @param graphics The context to paint on.
[ "Delete", "a", "{", "@link", "Paintable", "}", "object", "from", "the", "given", "{", "@link", "MapContext", "}", ".", "It", "the", "object", "does", "not", "exist", "nothing", "will", "be", "done", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/painter/RectanglePainter.java#L64-L67
contentful/contentful.java
src/main/java/com/contentful/java/cda/image/ImageOption.java
ImageOption.backgroundColorOf
public static ImageOption backgroundColorOf(int color) { if (color < 0 || color > 0xFFFFFF) { throw new IllegalArgumentException("Color must be in rgb hex range of 0x0 to 0xFFFFFF."); } return new ImageOption("bg", "rgb:" + format(Locale.getDefault(), "%06X", color)); }
java
public static ImageOption backgroundColorOf(int color) { if (color < 0 || color > 0xFFFFFF) { throw new IllegalArgumentException("Color must be in rgb hex range of 0x0 to 0xFFFFFF."); } return new ImageOption("bg", "rgb:" + format(Locale.getDefault(), "%06X", color)); }
[ "public", "static", "ImageOption", "backgroundColorOf", "(", "int", "color", ")", "{", "if", "(", "color", "<", "0", "||", "color", ">", "0xFFFFFF", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Color must be in rgb hex range of 0x0 to 0xFFFFFF.\"", ...
Define a background color. <p> The color value must be a hexadecimal value, i.e. 0xFF0000 means red. @param color the color in hex to be used. @return an image option for manipulating a given url. @throws IllegalArgumentException if the color is less then zero or greater then 0xFFFFFF.
[ "Define", "a", "background", "color", ".", "<p", ">", "The", "color", "value", "must", "be", "a", "hexadecimal", "value", "i", ".", "e", ".", "0xFF0000", "means", "red", "." ]
train
https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/image/ImageOption.java#L244-L249
jcuda/jcusparse
JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java
JCusparse.cusparseCsrilu0Ex
public static int cusparseCsrilu0Ex( cusparseHandle handle, int trans, int m, cusparseMatDescr descrA, Pointer csrSortedValA_ValM, int csrSortedValA_ValMtype, /** matrix A values are updated inplace ...
java
public static int cusparseCsrilu0Ex( cusparseHandle handle, int trans, int m, cusparseMatDescr descrA, Pointer csrSortedValA_ValM, int csrSortedValA_ValMtype, /** matrix A values are updated inplace ...
[ "public", "static", "int", "cusparseCsrilu0Ex", "(", "cusparseHandle", "handle", ",", "int", "trans", ",", "int", "m", ",", "cusparseMatDescr", "descrA", ",", "Pointer", "csrSortedValA_ValM", ",", "int", "csrSortedValA_ValMtype", ",", "/** matrix A values are updated in...
<pre> Description: Compute the incomplete-LU factorization with 0 fill-in (ILU0) of the matrix A stored in CSR format based on the information in the opaque structure info that was obtained from the analysis phase (csrsv_analysis). This routine implements algorithm 1 for this problem. </pre>
[ "<pre", ">", "Description", ":", "Compute", "the", "incomplete", "-", "LU", "factorization", "with", "0", "fill", "-", "in", "(", "ILU0", ")", "of", "the", "matrix", "A", "stored", "in", "CSR", "format", "based", "on", "the", "information", "in", "the", ...
train
https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L5709-L5724
LAW-Unimi/BUbiNG
src/it/unimi/di/law/warc/records/WarcHeader.java
WarcHeader.getFirstHeader
public static Header getFirstHeader(final HeaderGroup headers, final WarcHeader.Name name) { return headers.getFirstHeader(name.value); }
java
public static Header getFirstHeader(final HeaderGroup headers, final WarcHeader.Name name) { return headers.getFirstHeader(name.value); }
[ "public", "static", "Header", "getFirstHeader", "(", "final", "HeaderGroup", "headers", ",", "final", "WarcHeader", ".", "Name", "name", ")", "{", "return", "headers", ".", "getFirstHeader", "(", "name", ".", "value", ")", ";", "}" ]
Returns the first header of given name. @param headers the headers to search from. @param name the name of the header to lookup. @return the header.
[ "Returns", "the", "first", "header", "of", "given", "name", "." ]
train
https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/records/WarcHeader.java#L123-L125
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java
LinearEquationSystem.equationsToString
public String equationsToString(String prefix, NumberFormat nf) { if((coeff == null) || (rhs == null) || (row == null) || (col == null)) { throw new NullPointerException(); } int[] coeffDigits = maxIntegerDigits(coeff); int rhsDigits = maxIntegerDigits(rhs); StringBuilder buffer = new String...
java
public String equationsToString(String prefix, NumberFormat nf) { if((coeff == null) || (rhs == null) || (row == null) || (col == null)) { throw new NullPointerException(); } int[] coeffDigits = maxIntegerDigits(coeff); int rhsDigits = maxIntegerDigits(rhs); StringBuilder buffer = new String...
[ "public", "String", "equationsToString", "(", "String", "prefix", ",", "NumberFormat", "nf", ")", "{", "if", "(", "(", "coeff", "==", "null", ")", "||", "(", "rhs", "==", "null", ")", "||", "(", "row", "==", "null", ")", "||", "(", "col", "==", "nu...
Returns a string representation of this equation system. @param prefix the prefix of each line @param nf the number format @return a string representation of this equation system
[ "Returns", "a", "string", "representation", "of", "this", "equation", "system", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LinearEquationSystem.java#L292-L318
GCRC/nunaliit
nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/Files.java
Files.getDescendantPathNames
static public Set<String> getDescendantPathNames(File dir, boolean includeDirectories) { Set<String> paths = new HashSet<String>(); if( dir.exists() && dir.isDirectory() ) { String[] names = dir.list(); for(String name : names){ File child = new File(dir,name); getPathNames(child, paths, null, include...
java
static public Set<String> getDescendantPathNames(File dir, boolean includeDirectories) { Set<String> paths = new HashSet<String>(); if( dir.exists() && dir.isDirectory() ) { String[] names = dir.list(); for(String name : names){ File child = new File(dir,name); getPathNames(child, paths, null, include...
[ "static", "public", "Set", "<", "String", ">", "getDescendantPathNames", "(", "File", "dir", ",", "boolean", "includeDirectories", ")", "{", "Set", "<", "String", ">", "paths", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "if", "(", "dir", ...
Given a directory, returns a set of strings which are the paths to all elements within the directory. This process recurses through all sub-directories. @param dir The directory to be traversed @param includeDirectories If set, the name of the paths to directories are included in the result. @return A set of paths to a...
[ "Given", "a", "directory", "returns", "a", "set", "of", "strings", "which", "are", "the", "paths", "to", "all", "elements", "within", "the", "directory", ".", "This", "process", "recurses", "through", "all", "sub", "-", "directories", "." ]
train
https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/Files.java#L85-L95
lucee/Lucee
core/src/main/java/lucee/transformer/util/SourceCode.java
SourceCode.forwardIfCurrent
public boolean forwardIfCurrent(String first, char second) { int start = pos; if (!forwardIfCurrent(first)) return false; removeSpace(); boolean rtn = forwardIfCurrent(second); if (!rtn) pos = start; return rtn; }
java
public boolean forwardIfCurrent(String first, char second) { int start = pos; if (!forwardIfCurrent(first)) return false; removeSpace(); boolean rtn = forwardIfCurrent(second); if (!rtn) pos = start; return rtn; }
[ "public", "boolean", "forwardIfCurrent", "(", "String", "first", ",", "char", "second", ")", "{", "int", "start", "=", "pos", ";", "if", "(", "!", "forwardIfCurrent", "(", "first", ")", ")", "return", "false", ";", "removeSpace", "(", ")", ";", "boolean"...
Gibt zurueck ob first den folgenden Zeichen entspricht, gefolgt von Leerzeichen und second, wenn ja wird der Zeiger um die Laenge der uebereinstimmung nach vorne gestellt. @param first Erste Zeichen zum Vergleich (Vor den Leerzeichen). @param second Zweite Zeichen zum Vergleich (Nach den Leerzeichen). @return Gibt zur...
[ "Gibt", "zurueck", "ob", "first", "den", "folgenden", "Zeichen", "entspricht", "gefolgt", "von", "Leerzeichen", "und", "second", "wenn", "ja", "wird", "der", "Zeiger", "um", "die", "Laenge", "der", "uebereinstimmung", "nach", "vorne", "gestellt", "." ]
train
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L350-L357
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java
TaskOperations.deleteTask
public void deleteTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { TaskDeleteOptions options = new TaskDeleteOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors); ...
java
public void deleteTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException { TaskDeleteOptions options = new TaskDeleteOptions(); BehaviorManager bhMgr = new BehaviorManager(this.customBehaviors(), additionalBehaviors); ...
[ "public", "void", "deleteTask", "(", "String", "jobId", ",", "String", "taskId", ",", "Iterable", "<", "BatchClientBehavior", ">", "additionalBehaviors", ")", "throws", "BatchErrorException", ",", "IOException", "{", "TaskDeleteOptions", "options", "=", "new", "Task...
Deletes the specified task. @param jobId The ID of the job containing the task. @param taskId The ID of the task. @param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request. @throws BatchErrorException Exception thrown when an error response is receiv...
[ "Deletes", "the", "specified", "task", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/TaskOperations.java#L573-L580
CenturyLinkCloud/mdw
mdw-common/src/com/centurylink/mdw/util/StringHelper.java
StringHelper.stripNewLineChar
public static String stripNewLineChar(String pString) { String tmpFidValue = pString; StringTokenizer aTokenizer = new StringTokenizer(pString, "\n"); if (aTokenizer.countTokens() > 1) { StringBuffer nameBuffer = new StringBuffer(); while (aTokenizer.hasMoreTokens()) { ...
java
public static String stripNewLineChar(String pString) { String tmpFidValue = pString; StringTokenizer aTokenizer = new StringTokenizer(pString, "\n"); if (aTokenizer.countTokens() > 1) { StringBuffer nameBuffer = new StringBuffer(); while (aTokenizer.hasMoreTokens()) { ...
[ "public", "static", "String", "stripNewLineChar", "(", "String", "pString", ")", "{", "String", "tmpFidValue", "=", "pString", ";", "StringTokenizer", "aTokenizer", "=", "new", "StringTokenizer", "(", "pString", ",", "\"\\n\"", ")", ";", "if", "(", "aTokenizer",...
This method strips out all new line characters from the passed String. @param pString A String value. @return A clean String. @see StringTokenizer
[ "This", "method", "strips", "out", "all", "new", "line", "characters", "from", "the", "passed", "String", "." ]
train
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/StringHelper.java#L943-L954
alibaba/java-dns-cache-manipulator
library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java
DnsCacheManipulator.setDnsCache
public static void setDnsCache(long expireMillis, String host, String... ips) { try { InetAddressCacheUtil.setInetAddressCache(host, ips, System.currentTimeMillis() + expireMillis); } catch (Exception e) { final String message = String.format("Fail to setDnsCache for host %s ip %...
java
public static void setDnsCache(long expireMillis, String host, String... ips) { try { InetAddressCacheUtil.setInetAddressCache(host, ips, System.currentTimeMillis() + expireMillis); } catch (Exception e) { final String message = String.format("Fail to setDnsCache for host %s ip %...
[ "public", "static", "void", "setDnsCache", "(", "long", "expireMillis", ",", "String", "host", ",", "String", "...", "ips", ")", "{", "try", "{", "InetAddressCacheUtil", ".", "setInetAddressCache", "(", "host", ",", "ips", ",", "System", ".", "currentTimeMilli...
Set a dns cache entry. @param expireMillis expire time in milliseconds. @param host host @param ips ips @throws DnsCacheManipulatorException Operation fail
[ "Set", "a", "dns", "cache", "entry", "." ]
train
https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L53-L61
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java
JobOperations.listPreparationAndReleaseTaskStatus
public PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId) throws BatchErrorException, IOException { return listPreparationAndReleaseTaskStatus(jobId, null); }
java
public PagedList<JobPreparationAndReleaseTaskExecutionInformation> listPreparationAndReleaseTaskStatus(String jobId) throws BatchErrorException, IOException { return listPreparationAndReleaseTaskStatus(jobId, null); }
[ "public", "PagedList", "<", "JobPreparationAndReleaseTaskExecutionInformation", ">", "listPreparationAndReleaseTaskStatus", "(", "String", "jobId", ")", "throws", "BatchErrorException", ",", "IOException", "{", "return", "listPreparationAndReleaseTaskStatus", "(", "jobId", ",",...
Lists the status of {@link JobPreparationTask} and {@link JobReleaseTask} tasks for the specified job. @param jobId The ID of the job. @return A list of {@link JobPreparationAndReleaseTaskExecutionInformation} instances. @throws BatchErrorException Exception thrown when an error response is received from the Batch ser...
[ "Lists", "the", "status", "of", "{", "@link", "JobPreparationTask", "}", "and", "{", "@link", "JobReleaseTask", "}", "tasks", "for", "the", "specified", "job", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L246-L248
xiancloud/xian
xian-dao/xian-mongodbdao/xian-mongodbdao-sync/src/main/java/info/xiancloud/plugin/dao/mongodb/Mongo.java
Mongo.getOrInitDefaultDatabase
public static MongoDatabase getOrInitDefaultDatabase(String connectionString, String database) { if (DEFAULT_DATABASE == null) { synchronized (LOCK) { if (DEFAULT_DATABASE == null) { if (!StringUtil.isEmpty(connectionString)) { DEFAULT_CLIE...
java
public static MongoDatabase getOrInitDefaultDatabase(String connectionString, String database) { if (DEFAULT_DATABASE == null) { synchronized (LOCK) { if (DEFAULT_DATABASE == null) { if (!StringUtil.isEmpty(connectionString)) { DEFAULT_CLIE...
[ "public", "static", "MongoDatabase", "getOrInitDefaultDatabase", "(", "String", "connectionString", ",", "String", "database", ")", "{", "if", "(", "DEFAULT_DATABASE", "==", "null", ")", "{", "synchronized", "(", "LOCK", ")", "{", "if", "(", "DEFAULT_DATABASE", ...
Get default mongodb database reference or initiate it if not initialized. @param connectionString MongoDB standard connection string @param database mongodb database name @return MongoDB mongodb client database reference.
[ "Get", "default", "mongodb", "database", "reference", "or", "initiate", "it", "if", "not", "initialized", "." ]
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-dao/xian-mongodbdao/xian-mongodbdao-sync/src/main/java/info/xiancloud/plugin/dao/mongodb/Mongo.java#L56-L74
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/animation/transformation/Rotation.java
Rotation.doTransform
@Override protected void doTransform(ITransformable.Rotate transformable, float comp) { float from = reversed ? toAngle : fromAngle; float to = reversed ? fromAngle : toAngle; transformable.rotate(from + (to - from) * comp, axisX, axisY, axisZ, offsetX, offsetY, offsetZ); }
java
@Override protected void doTransform(ITransformable.Rotate transformable, float comp) { float from = reversed ? toAngle : fromAngle; float to = reversed ? fromAngle : toAngle; transformable.rotate(from + (to - from) * comp, axisX, axisY, axisZ, offsetX, offsetY, offsetZ); }
[ "@", "Override", "protected", "void", "doTransform", "(", "ITransformable", ".", "Rotate", "transformable", ",", "float", "comp", ")", "{", "float", "from", "=", "reversed", "?", "toAngle", ":", "fromAngle", ";", "float", "to", "=", "reversed", "?", "fromAng...
Calculates the transformation. @param transformable the transformable @param comp the comp
[ "Calculates", "the", "transformation", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/animation/transformation/Rotation.java#L166-L172
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
Node.getSubscriptions
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getSubscriptions(null, null); }
java
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getSubscriptions(null, null); }
[ "public", "List", "<", "Subscription", ">", "getSubscriptions", "(", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "return", "getSubscriptions", "(", "null", ",", "null", ")", ";", "}...
Get the subscriptions currently associated with this node. @return List of {@link Subscription} @throws XMPPErrorException @throws NoResponseException @throws NotConnectedException @throws InterruptedException
[ "Get", "the", "subscriptions", "currently", "associated", "with", "this", "node", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java#L135-L137
thinkaurelius/faunus
src/main/java/com/thinkaurelius/faunus/hdfs/HDFSTools.java
HDFSTools.getFileSize
public static long getFileSize(final FileSystem fs, final Path path, final PathFilter filter) throws IOException { long totalSize = 0l; for (final Path p : getAllFilePaths(fs, path, filter)) { totalSize = totalSize + fs.getFileStatus(p).getLen(); } return totalSize; }
java
public static long getFileSize(final FileSystem fs, final Path path, final PathFilter filter) throws IOException { long totalSize = 0l; for (final Path p : getAllFilePaths(fs, path, filter)) { totalSize = totalSize + fs.getFileStatus(p).getLen(); } return totalSize; }
[ "public", "static", "long", "getFileSize", "(", "final", "FileSystem", "fs", ",", "final", "Path", "path", ",", "final", "PathFilter", "filter", ")", "throws", "IOException", "{", "long", "totalSize", "=", "0l", ";", "for", "(", "final", "Path", "p", ":", ...
/*public static String getSuffix(final String file) { if (file.contains(".")) return file.substring(file.indexOf(".") + 1); else return ""; }
[ "/", "*", "public", "static", "String", "getSuffix", "(", "final", "String", "file", ")", "{", "if", "(", "file", ".", "contains", "(", ".", "))", "return", "file", ".", "substring", "(", "file", ".", "indexOf", "(", ".", ")", "+", "1", ")", ";", ...
train
https://github.com/thinkaurelius/faunus/blob/1eb8494eeb3fe3b84a98d810d304ba01d55b0d6e/src/main/java/com/thinkaurelius/faunus/hdfs/HDFSTools.java#L41-L47
alkacon/opencms-core
src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java
CmsXmlSitemapGenerator.addDetailLinks
protected void addDetailLinks(CmsResource containerPage, Locale locale) throws CmsException { List<I_CmsResourceType> types = getDetailTypesForPage(containerPage); for (I_CmsResourceType type : types) { List<CmsResource> resourcesForType = getDetailResources(type); for (Cms...
java
protected void addDetailLinks(CmsResource containerPage, Locale locale) throws CmsException { List<I_CmsResourceType> types = getDetailTypesForPage(containerPage); for (I_CmsResourceType type : types) { List<CmsResource> resourcesForType = getDetailResources(type); for (Cms...
[ "protected", "void", "addDetailLinks", "(", "CmsResource", "containerPage", ",", "Locale", "locale", ")", "throws", "CmsException", "{", "List", "<", "I_CmsResourceType", ">", "types", "=", "getDetailTypesForPage", "(", "containerPage", ")", ";", "for", "(", "I_Cm...
Adds the detail page links for a given page to the results.<p> @param containerPage the container page resource @param locale the locale of the container page @throws CmsException if something goes wrong
[ "Adds", "the", "detail", "page", "links", "for", "a", "given", "page", "to", "the", "results", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java#L402-L424
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java
BigtableClusterUtilities.setClusterSize
private void setClusterSize(String clusterName, int newSize) throws InterruptedException { Preconditions.checkArgument(newSize > 0, "Cluster size must be > 0"); logger.info("Updating cluster %s to size %d", clusterName, newSize); Operation operation = client.updateCluster(Cluster.newBuilder() ...
java
private void setClusterSize(String clusterName, int newSize) throws InterruptedException { Preconditions.checkArgument(newSize > 0, "Cluster size must be > 0"); logger.info("Updating cluster %s to size %d", clusterName, newSize); Operation operation = client.updateCluster(Cluster.newBuilder() ...
[ "private", "void", "setClusterSize", "(", "String", "clusterName", ",", "int", "newSize", ")", "throws", "InterruptedException", "{", "Preconditions", ".", "checkArgument", "(", "newSize", ">", "0", ",", "\"Cluster size must be > 0\"", ")", ";", "logger", ".", "in...
Update a specific cluster's server node count to the number specified
[ "Update", "a", "specific", "cluster", "s", "server", "node", "count", "to", "the", "number", "specified" ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L220-L230
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/quadtree/QuadTree.java
QuadTree.subDivide
public void subDivide() { northWest = new QuadTree(this, data, new Cell(boundary.getX() - .5 * boundary.getHw(), boundary.getY() - .5 * boundary.getHh(), .5 * boundary.getHw(), .5 * boundary.getHh())); northEast = new QuadTree(this, data, new Cell(boundary.getX() + .5 * boundary....
java
public void subDivide() { northWest = new QuadTree(this, data, new Cell(boundary.getX() - .5 * boundary.getHw(), boundary.getY() - .5 * boundary.getHh(), .5 * boundary.getHw(), .5 * boundary.getHh())); northEast = new QuadTree(this, data, new Cell(boundary.getX() + .5 * boundary....
[ "public", "void", "subDivide", "(", ")", "{", "northWest", "=", "new", "QuadTree", "(", "this", ",", "data", ",", "new", "Cell", "(", "boundary", ".", "getX", "(", ")", "-", ".5", "*", "boundary", ".", "getHw", "(", ")", ",", "boundary", ".", "getY...
Create four children which fully divide this cell into four quads of equal area
[ "Create", "four", "children", "which", "fully", "divide", "this", "cell", "into", "four", "quads", "of", "equal", "area" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/quadtree/QuadTree.java#L216-L226
UrielCh/ovh-java-sdk
ovh-java-sdk-licensedirectadmin/src/main/java/net/minidev/ovh/api/ApiOvhLicensedirectadmin.java
ApiOvhLicensedirectadmin.serviceName_changeOs_POST
public OvhTask serviceName_changeOs_POST(String serviceName, OvhDirectAdminOsEnum os) throws IOException { String qPath = "/license/directadmin/{serviceName}/changeOs"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "os", os); String resp = ex...
java
public OvhTask serviceName_changeOs_POST(String serviceName, OvhDirectAdminOsEnum os) throws IOException { String qPath = "/license/directadmin/{serviceName}/changeOs"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "os", os); String resp = ex...
[ "public", "OvhTask", "serviceName_changeOs_POST", "(", "String", "serviceName", ",", "OvhDirectAdminOsEnum", "os", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/license/directadmin/{serviceName}/changeOs\"", ";", "StringBuilder", "sb", "=", "path", "(", ...
Change the Operating System for a license REST: POST /license/directadmin/{serviceName}/changeOs @param os [required] The operating system you want for this license @param serviceName [required] The name of your DirectAdmin license
[ "Change", "the", "Operating", "System", "for", "a", "license" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-licensedirectadmin/src/main/java/net/minidev/ovh/api/ApiOvhLicensedirectadmin.java#L157-L164
shrinkwrap/resolver
maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/MavenResolvedArtifactImpl.java
MavenResolvedArtifactImpl.artifactToFile
private static File artifactToFile(final Artifact artifact) throws IllegalArgumentException { if (artifact == null) { throw new IllegalArgumentException("ArtifactResult must not be null"); } // FIXME: this is not a safe assumption, file can have a different name if ("pom.xml...
java
private static File artifactToFile(final Artifact artifact) throws IllegalArgumentException { if (artifact == null) { throw new IllegalArgumentException("ArtifactResult must not be null"); } // FIXME: this is not a safe assumption, file can have a different name if ("pom.xml...
[ "private", "static", "File", "artifactToFile", "(", "final", "Artifact", "artifact", ")", "throws", "IllegalArgumentException", "{", "if", "(", "artifact", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"ArtifactResult must not be null\"", ...
Maps an artifact to a file. This allows ShrinkWrap Maven resolver to package reactor related dependencies.
[ "Maps", "an", "artifact", "to", "a", "file", ".", "This", "allows", "ShrinkWrap", "Maven", "resolver", "to", "package", "reactor", "related", "dependencies", "." ]
train
https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/MavenResolvedArtifactImpl.java#L132-L166
threerings/nenya
core/src/main/java/com/threerings/util/DirectionUtil.java
DirectionUtil.rotateCCW
public static int rotateCCW (int direction, int ticks) { for (int ii = 0; ii < ticks; ii++) { direction = FINE_CCW_ROTATE[direction]; } return direction; }
java
public static int rotateCCW (int direction, int ticks) { for (int ii = 0; ii < ticks; ii++) { direction = FINE_CCW_ROTATE[direction]; } return direction; }
[ "public", "static", "int", "rotateCCW", "(", "int", "direction", ",", "int", "ticks", ")", "{", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "ticks", ";", "ii", "++", ")", "{", "direction", "=", "FINE_CCW_ROTATE", "[", "direction", "]", ";", ...
Rotates the requested <em>fine</em> direction constant counter-clockwise by the requested number of ticks.
[ "Rotates", "the", "requested", "<em", ">", "fine<", "/", "em", ">", "direction", "constant", "counter", "-", "clockwise", "by", "the", "requested", "number", "of", "ticks", "." ]
train
https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/DirectionUtil.java#L117-L123
jOOQ/jOOL
jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java
Unchecked.unaryOperator
public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator) { return unaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION); }
java
public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator) { return unaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION); }
[ "public", "static", "<", "T", ">", "UnaryOperator", "<", "T", ">", "unaryOperator", "(", "CheckedUnaryOperator", "<", "T", ">", "operator", ")", "{", "return", "unaryOperator", "(", "operator", ",", "THROWABLE_TO_RUNTIME_EXCEPTION", ")", ";", "}" ]
Wrap a {@link CheckedUnaryOperator} in a {@link UnaryOperator}. <p> Example: <code><pre> Stream.of("a", "b", "c").map(Unchecked.unaryOperator(s -> { if (s.length() > 10) throw new Exception("Only short strings allowed"); return s; })); </pre></code>
[ "Wrap", "a", "{", "@link", "CheckedUnaryOperator", "}", "in", "a", "{", "@link", "UnaryOperator", "}", ".", "<p", ">", "Example", ":", "<code", ">", "<pre", ">", "Stream", ".", "of", "(", "a", "b", "c", ")", ".", "map", "(", "Unchecked", ".", "unar...
train
https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L1886-L1888
playn/playn
android/src/playn/android/AndroidGraphics.java
AndroidGraphics.onSurfaceChanged
public void onSurfaceChanged (int pixelWidth, int pixelHeight, int orient) { viewportChanged(pixelWidth, pixelHeight); screenSize.setSize(viewSize); switch (orient) { case Configuration.ORIENTATION_LANDSCAPE: orientDetailM.update(OrientationDetail.LANDSCAPE_LEFT); break; case Configurati...
java
public void onSurfaceChanged (int pixelWidth, int pixelHeight, int orient) { viewportChanged(pixelWidth, pixelHeight); screenSize.setSize(viewSize); switch (orient) { case Configuration.ORIENTATION_LANDSCAPE: orientDetailM.update(OrientationDetail.LANDSCAPE_LEFT); break; case Configurati...
[ "public", "void", "onSurfaceChanged", "(", "int", "pixelWidth", ",", "int", "pixelHeight", ",", "int", "orient", ")", "{", "viewportChanged", "(", "pixelWidth", ",", "pixelHeight", ")", ";", "screenSize", ".", "setSize", "(", "viewSize", ")", ";", "switch", ...
Informs the graphics system that the surface into which it is rendering has changed size. The supplied width and height are in pixels, not display units.
[ "Informs", "the", "graphics", "system", "that", "the", "surface", "into", "which", "it", "is", "rendering", "has", "changed", "size", ".", "The", "supplied", "width", "and", "height", "are", "in", "pixels", "not", "display", "units", "." ]
train
https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidGraphics.java#L134-L148
Azure/azure-sdk-for-java
automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ObjectDataTypesInner.java
ObjectDataTypesInner.listFieldsByModuleAndType
public List<TypeFieldInner> listFieldsByModuleAndType(String resourceGroupName, String automationAccountName, String moduleName, String typeName) { return listFieldsByModuleAndTypeWithServiceResponseAsync(resourceGroupName, automationAccountName, moduleName, typeName).toBlocking().single().body(); }
java
public List<TypeFieldInner> listFieldsByModuleAndType(String resourceGroupName, String automationAccountName, String moduleName, String typeName) { return listFieldsByModuleAndTypeWithServiceResponseAsync(resourceGroupName, automationAccountName, moduleName, typeName).toBlocking().single().body(); }
[ "public", "List", "<", "TypeFieldInner", ">", "listFieldsByModuleAndType", "(", "String", "resourceGroupName", ",", "String", "automationAccountName", ",", "String", "moduleName", ",", "String", "typeName", ")", "{", "return", "listFieldsByModuleAndTypeWithServiceResponseAs...
Retrieve a list of fields of a given type identified by module name. @param resourceGroupName Name of an Azure Resource group. @param automationAccountName The name of the automation account. @param moduleName The name of module. @param typeName The name of type. @throws IllegalArgumentException thrown if parameters f...
[ "Retrieve", "a", "list", "of", "fields", "of", "a", "given", "type", "identified", "by", "module", "name", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/ObjectDataTypesInner.java#L77-L79
sarxos/win-registry
src/main/java/com/github/sarxos/winreg/WindowsRegistry.java
WindowsRegistry.deleteKey
public void deleteKey(HKey hk, String key) throws RegistryException { int rc = -1; try { rc = ReflectedMethods.deleteKey(hk.root(), hk.hex(), key); } catch (Exception e) { throw new RegistryException("Cannot delete key " + key, e); } if (rc != RC.SUCCESS) { throw new RegistryException("Cannot...
java
public void deleteKey(HKey hk, String key) throws RegistryException { int rc = -1; try { rc = ReflectedMethods.deleteKey(hk.root(), hk.hex(), key); } catch (Exception e) { throw new RegistryException("Cannot delete key " + key, e); } if (rc != RC.SUCCESS) { throw new RegistryException("Cannot...
[ "public", "void", "deleteKey", "(", "HKey", "hk", ",", "String", "key", ")", "throws", "RegistryException", "{", "int", "rc", "=", "-", "1", ";", "try", "{", "rc", "=", "ReflectedMethods", ".", "deleteKey", "(", "hk", ".", "root", "(", ")", ",", "hk"...
Delete given key from registry. @param hk the HKEY @param key the key to be deleted @throws RegistryException when something is not right
[ "Delete", "given", "key", "from", "registry", "." ]
train
https://github.com/sarxos/win-registry/blob/5ccbe2157ae0ee894de7c41bec4bd7b1e0f5c437/src/main/java/com/github/sarxos/winreg/WindowsRegistry.java#L171-L181
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/exception/ContextedRuntimeException.java
ContextedRuntimeException.addContextValue
@Override public ContextedRuntimeException addContextValue(final String label, final Object value) { exceptionContext.addContextValue(label, value); return this; }
java
@Override public ContextedRuntimeException addContextValue(final String label, final Object value) { exceptionContext.addContextValue(label, value); return this; }
[ "@", "Override", "public", "ContextedRuntimeException", "addContextValue", "(", "final", "String", "label", ",", "final", "Object", "value", ")", "{", "exceptionContext", ".", "addContextValue", "(", "label", ",", "value", ")", ";", "return", "this", ";", "}" ]
Adds information helpful to a developer in diagnosing and correcting the problem. For the information to be meaningful, the value passed should have a reasonable toString() implementation. Different values can be added with the same label multiple times. <p> Note: This exception is only serializable if the object added...
[ "Adds", "information", "helpful", "to", "a", "developer", "in", "diagnosing", "and", "correcting", "the", "problem", ".", "For", "the", "information", "to", "be", "meaningful", "the", "value", "passed", "should", "have", "a", "reasonable", "toString", "()", "i...
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ContextedRuntimeException.java#L172-L176
comapi/comapi-sdk-android
COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java
InternalService.getConversations
@Deprecated public void getConversations(@NonNull final Scope scope, @Nullable Callback<ComapiResult<List<ConversationDetails>>> callback) { adapter.adapt(getConversations(scope), callback); }
java
@Deprecated public void getConversations(@NonNull final Scope scope, @Nullable Callback<ComapiResult<List<ConversationDetails>>> callback) { adapter.adapt(getConversations(scope), callback); }
[ "@", "Deprecated", "public", "void", "getConversations", "(", "@", "NonNull", "final", "Scope", "scope", ",", "@", "Nullable", "Callback", "<", "ComapiResult", "<", "List", "<", "ConversationDetails", ">", ">", ">", "callback", ")", "{", "adapter", ".", "ada...
Returns observable to get all visible conversations. @param scope {@link Scope} of the query @param callback Callback to deliver new session instance. @deprecated Please use {@link InternalService#getConversations(boolean, Callback)} instead.
[ "Returns", "observable", "to", "get", "all", "visible", "conversations", "." ]
train
https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L561-L564
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java
ObjectArrayList.removeAll
public boolean removeAll(ObjectArrayList other, boolean testForEquality) { if (other.size==0) return false; //nothing to do int limit = other.size-1; int j=0; Object[] theElements = elements; for (int i=0; i<size ; i++) { if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) < 0) theElements[j...
java
public boolean removeAll(ObjectArrayList other, boolean testForEquality) { if (other.size==0) return false; //nothing to do int limit = other.size-1; int j=0; Object[] theElements = elements; for (int i=0; i<size ; i++) { if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) < 0) theElements[j...
[ "public", "boolean", "removeAll", "(", "ObjectArrayList", "other", ",", "boolean", "testForEquality", ")", "{", "if", "(", "other", ".", "size", "==", "0", ")", "return", "false", ";", "//nothing to do\r", "int", "limit", "=", "other", ".", "size", "-", "1...
Removes from the receiver all elements that are contained in the specified list. Tests for equality or identity as specified by <code>testForEquality</code>. @param other the other list. @param testForEquality if <code>true</code> -> test for equality, otherwise for identity. @return <code>true</code> if the receiver ...
[ "Removes", "from", "the", "receiver", "all", "elements", "that", "are", "contained", "in", "the", "specified", "list", ".", "Tests", "for", "equality", "or", "identity", "as", "specified", "by", "<code", ">", "testForEquality<", "/", "code", ">", "." ]
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L642-L654
ben-manes/caffeine
caffeine/src/main/java/com/github/benmanes/caffeine/cache/TimerWheel.java
TimerWheel.deschedule
public void deschedule(@NonNull Node<K, V> node) { unlink(node); node.setNextInVariableOrder(null); node.setPreviousInVariableOrder(null); }
java
public void deschedule(@NonNull Node<K, V> node) { unlink(node); node.setNextInVariableOrder(null); node.setPreviousInVariableOrder(null); }
[ "public", "void", "deschedule", "(", "@", "NonNull", "Node", "<", "K", ",", "V", ">", "node", ")", "{", "unlink", "(", "node", ")", ";", "node", ".", "setNextInVariableOrder", "(", "null", ")", ";", "node", ".", "setPreviousInVariableOrder", "(", "null",...
Removes a timer event for this entry if present. @param node the entry in the cache
[ "Removes", "a", "timer", "event", "for", "this", "entry", "if", "present", "." ]
train
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/TimerWheel.java#L191-L195
OrienteerBAP/wicket-orientdb
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/proto/AbstractPrototyper.java
AbstractPrototyper.getDefaultValue
protected Object getDefaultValue(String propName, Class<?> returnType) { Object ret = null; if(returnType.isPrimitive()) { if(returnType.equals(boolean.class)) { return false; } else if(returnType.equals(char.class)) { return '\0'; } else { try { Class<?> wrapperClass...
java
protected Object getDefaultValue(String propName, Class<?> returnType) { Object ret = null; if(returnType.isPrimitive()) { if(returnType.equals(boolean.class)) { return false; } else if(returnType.equals(char.class)) { return '\0'; } else { try { Class<?> wrapperClass...
[ "protected", "Object", "getDefaultValue", "(", "String", "propName", ",", "Class", "<", "?", ">", "returnType", ")", "{", "Object", "ret", "=", "null", ";", "if", "(", "returnType", ".", "isPrimitive", "(", ")", ")", "{", "if", "(", "returnType", ".", ...
Method for obtaining default value of required property @param propName name of a property @param returnType type of a property @return default value for particular property
[ "Method", "for", "obtaining", "default", "value", "of", "required", "property" ]
train
https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/proto/AbstractPrototyper.java#L265-L291
Ordinastie/MalisisCore
src/main/java/net/malisis/core/block/component/WallComponent.java
WallComponent.mergeBlock
@Override public IBlockState mergeBlock(World world, BlockPos pos, IBlockState state, ItemStack itemStack, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { EnumFacing direction = DirectionalComponent.getDirection(state); EnumFacing realSide = EnumFacingUtils.getRealSide(state, side); ...
java
@Override public IBlockState mergeBlock(World world, BlockPos pos, IBlockState state, ItemStack itemStack, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { EnumFacing direction = DirectionalComponent.getDirection(state); EnumFacing realSide = EnumFacingUtils.getRealSide(state, side); ...
[ "@", "Override", "public", "IBlockState", "mergeBlock", "(", "World", "world", ",", "BlockPos", "pos", ",", "IBlockState", "state", ",", "ItemStack", "itemStack", ",", "EntityPlayer", "player", ",", "EnumFacing", "side", ",", "float", "hitX", ",", "float", "hi...
Merges the {@link IBlockState} into a corner if possible. @param world the world @param pos the pos @param state the state @param itemStack the item stack @param player the player @param side the side @param hitX the hit x @param hitY the hit y @param hitZ the hit z @return the i block state
[ "Merges", "the", "{", "@link", "IBlockState", "}", "into", "a", "corner", "if", "possible", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/block/component/WallComponent.java#L131-L169
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java
SynchronousRequest.getPvPGameInfo
public List<PvPGame> getPvPGameInfo(String api, String[] ids) throws GuildWars2Exception { isParamValid(new ParamChecker(ParamType.API, api), new ParamChecker(ids)); try { Response<List<PvPGame>> response = gw2API.getPvPGameInfo(api, processIds(ids)).execute(); if (!response.isSuccessful()) throwError(respons...
java
public List<PvPGame> getPvPGameInfo(String api, String[] ids) throws GuildWars2Exception { isParamValid(new ParamChecker(ParamType.API, api), new ParamChecker(ids)); try { Response<List<PvPGame>> response = gw2API.getPvPGameInfo(api, processIds(ids)).execute(); if (!response.isSuccessful()) throwError(respons...
[ "public", "List", "<", "PvPGame", ">", "getPvPGameInfo", "(", "String", "api", ",", "String", "[", "]", "ids", ")", "throws", "GuildWars2Exception", "{", "isParamValid", "(", "new", "ParamChecker", "(", "ParamType", ".", "API", ",", "api", ")", ",", "new",...
For more info on pvp games API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/games">here</a><br/> Get pvp game info for the given pvp game id(s) @param api Guild Wars 2 API key @param ids list of pvp game id(s) @return list of pvp game info @throws GuildWars2Exception see {@link ErrorCode} for detail @see PvP...
[ "For", "more", "info", "on", "pvp", "games", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "pvp", "/", "games", ">", "here<", "/", "a", ">", "<br", "/", ">", ...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L2772-L2781
EdwardRaff/JSAT
JSAT/src/jsat/io/JSATData.java
JSATData.writeData
public static <Type extends DataSet<Type>> void writeData(DataSet<Type> dataset, OutputStream outRaw, FloatStorageMethod fpStore) throws IOException { fpStore = FloatStorageMethod.getMethod(dataset, fpStore); DataWriter.DataSetType type; CategoricalData predicting; if(datase...
java
public static <Type extends DataSet<Type>> void writeData(DataSet<Type> dataset, OutputStream outRaw, FloatStorageMethod fpStore) throws IOException { fpStore = FloatStorageMethod.getMethod(dataset, fpStore); DataWriter.DataSetType type; CategoricalData predicting; if(datase...
[ "public", "static", "<", "Type", "extends", "DataSet", "<", "Type", ">", ">", "void", "writeData", "(", "DataSet", "<", "Type", ">", "dataset", ",", "OutputStream", "outRaw", ",", "FloatStorageMethod", "fpStore", ")", "throws", "IOException", "{", "fpStore", ...
This method writes out a JSAT dataset to a binary format that can be read in again later, and could be read in other languages.<br> <br> The format that is used will understand both {@link ClassificationDataSet} and {@link RegressionDataSet} datasets as special cases, and will store the target values in the binary file...
[ "This", "method", "writes", "out", "a", "JSAT", "dataset", "to", "a", "binary", "format", "that", "can", "be", "read", "in", "again", "later", "and", "could", "be", "read", "in", "other", "languages", ".", "<br", ">", "<br", ">", "The", "format", "that...
train
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/JSATData.java#L320-L357
gwtplus/google-gin
src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java
NameGenerator.getFragmentClassName
public String getFragmentClassName(String injectorClassName, FragmentPackageName fragmentPackageName) { // Sanity check. Preconditions.checkArgument(!injectorClassName.contains("."), "The injector class must be a simple name, but it was \"%s\"", injectorClassName); // Note that the fragment p...
java
public String getFragmentClassName(String injectorClassName, FragmentPackageName fragmentPackageName) { // Sanity check. Preconditions.checkArgument(!injectorClassName.contains("."), "The injector class must be a simple name, but it was \"%s\"", injectorClassName); // Note that the fragment p...
[ "public", "String", "getFragmentClassName", "(", "String", "injectorClassName", ",", "FragmentPackageName", "fragmentPackageName", ")", "{", "// Sanity check.", "Preconditions", ".", "checkArgument", "(", "!", "injectorClassName", ".", "contains", "(", "\".\"", ")", ","...
Computes the name of a single fragment of a Ginjector. @param injectorClassName the simple name of the injector's class (not including its package)
[ "Computes", "the", "name", "of", "a", "single", "fragment", "of", "a", "Ginjector", "." ]
train
https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/NameGenerator.java#L104-L117
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/KolmogorovSmirnovOneSample.java
KolmogorovSmirnovOneSample.checkCriticalValue
private static boolean checkCriticalValue(double score, boolean is_twoTailed, int n, double aLevel) { boolean rejected=false; double criticalValue; if(CRITICAL_VALUES.containsKey(aLevel)) { //the aLevel is one of the standards, we can use the tables if(CRITICAL_VALUES.get(aLevel).c...
java
private static boolean checkCriticalValue(double score, boolean is_twoTailed, int n, double aLevel) { boolean rejected=false; double criticalValue; if(CRITICAL_VALUES.containsKey(aLevel)) { //the aLevel is one of the standards, we can use the tables if(CRITICAL_VALUES.get(aLevel).c...
[ "private", "static", "boolean", "checkCriticalValue", "(", "double", "score", ",", "boolean", "is_twoTailed", ",", "int", "n", ",", "double", "aLevel", ")", "{", "boolean", "rejected", "=", "false", ";", "double", "criticalValue", ";", "if", "(", "CRITICAL_VAL...
Checks the Critical Value to determine if the Hypothesis should be rejected @param score @param is_twoTailed @param n @param aLevel @return
[ "Checks", "the", "Critical", "Value", "to", "determine", "if", "the", "Hypothesis", "should", "be", "rejected" ]
train
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/KolmogorovSmirnovOneSample.java#L125-L151
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java
Convolution.conv2d
public static INDArray conv2d(INDArray input, INDArray kernel, Type type) { return Nd4j.getConvolution().conv2d(input, kernel, type); }
java
public static INDArray conv2d(INDArray input, INDArray kernel, Type type) { return Nd4j.getConvolution().conv2d(input, kernel, type); }
[ "public", "static", "INDArray", "conv2d", "(", "INDArray", "input", ",", "INDArray", "kernel", ",", "Type", "type", ")", "{", "return", "Nd4j", ".", "getConvolution", "(", ")", ".", "conv2d", "(", "input", ",", "kernel", ",", "type", ")", ";", "}" ]
2d convolution (aka the last 2 dimensions @param input the input to op @param kernel the kernel to convolve with @param type @return
[ "2d", "convolution", "(", "aka", "the", "last", "2", "dimensions" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/convolution/Convolution.java#L355-L357
ironjacamar/ironjacamar
web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java
HtmlAdaptorServlet.inspectMBean
private void inspectMBean(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); if (trace) log.trace("inspectMBean, name=" + name); try { MBeanData data = getMBeanData(name); ...
java
private void inspectMBean(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); if (trace) log.trace("inspectMBean, name=" + name); try { MBeanData data = getMBeanData(name); ...
[ "private", "void", "inspectMBean", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "String", "name", "=", "request", ".", "getParameter", "(", "\"name\"", ")", ";", "if", "("...
Display a MBeans attributes and operations @param request The HTTP request @param response The HTTP response @exception ServletException Thrown if an error occurs @exception IOException Thrown if an I/O error occurs
[ "Display", "a", "MBeans", "attributes", "and", "operations" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/web/src/main/java/org/ironjacamar/web/console/HtmlAdaptorServlet.java#L174-L194
foundation-runtime/logging
logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java
TransactionLogger.getMapAsString
protected static String getMapAsString(Map<String, String> map, String separator) { if (map != null && !map.isEmpty()) { StringBuilder str = new StringBuilder(); boolean isFirst = true; for (Entry<String, String> entry : map.entrySet() ) { if (!isFirst) { str.append(separator); ...
java
protected static String getMapAsString(Map<String, String> map, String separator) { if (map != null && !map.isEmpty()) { StringBuilder str = new StringBuilder(); boolean isFirst = true; for (Entry<String, String> entry : map.entrySet() ) { if (!isFirst) { str.append(separator); ...
[ "protected", "static", "String", "getMapAsString", "(", "Map", "<", "String", ",", "String", ">", "map", ",", "String", "separator", ")", "{", "if", "(", "map", "!=", "null", "&&", "!", "map", ".", "isEmpty", "(", ")", ")", "{", "StringBuilder", "str",...
Get string representation of the given map: key:value separator key:value separator ... @param map @param separator @return string representation of the given map
[ "Get", "string", "representation", "of", "the", "given", "map", ":", "key", ":", "value", "separator", "key", ":", "value", "separator", "..." ]
train
https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L378-L393
kaazing/gateway
mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java
VicariousThreadLocal.callWith
public <R> R callWith(T value, java.util.concurrent.Callable<R> doCall) throws Exception { WeakReference<Holder> ref = local.get(); Holder holder = ref != null ? ref.get() : createHolder(); Object oldValue = holder.value; holder.value = value; try { return doCall.call...
java
public <R> R callWith(T value, java.util.concurrent.Callable<R> doCall) throws Exception { WeakReference<Holder> ref = local.get(); Holder holder = ref != null ? ref.get() : createHolder(); Object oldValue = holder.value; holder.value = value; try { return doCall.call...
[ "public", "<", "R", ">", "R", "callWith", "(", "T", "value", ",", "java", ".", "util", ".", "concurrent", ".", "Callable", "<", "R", ">", "doCall", ")", "throws", "Exception", "{", "WeakReference", "<", "Holder", ">", "ref", "=", "local", ".", "get",...
Executes task with thread-local set to the specified value. The state is restored however the task exits. If uninitialised before running the task, it will remain so upon exiting. Setting the thread-local within the task does not affect the state after exitign. @return value returned by {@code doCall}
[ "Executes", "task", "with", "thread", "-", "local", "set", "to", "the", "specified", "value", ".", "The", "state", "is", "restored", "however", "the", "task", "exits", ".", "If", "uninitialised", "before", "running", "the", "task", "it", "will", "remain", ...
train
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/util/threadlocal/VicariousThreadLocal.java#L259-L269
couchbase/couchbase-jvm-core
src/main/java/com/couchbase/client/core/message/internal/DiagnosticsReport.java
DiagnosticsReport.exportToJson
public String exportToJson(boolean pretty) { Map<String, Object> result = new HashMap<String, Object>(); Map<String, List<Map<String, Object>>> services = new HashMap<String, List<Map<String, Object>>>(); for (EndpointHealth h : endpoints) { String type = serviceTypeFromEnum(h.type(...
java
public String exportToJson(boolean pretty) { Map<String, Object> result = new HashMap<String, Object>(); Map<String, List<Map<String, Object>>> services = new HashMap<String, List<Map<String, Object>>>(); for (EndpointHealth h : endpoints) { String type = serviceTypeFromEnum(h.type(...
[ "public", "String", "exportToJson", "(", "boolean", "pretty", ")", "{", "Map", "<", "String", ",", "Object", ">", "result", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "Map", "<", "String", ",", "List", "<", "Map", "<", ...
Exports this report into the standard JSON format which is consistent across different language SDKs. @return the encoded JSON string.
[ "Exports", "this", "report", "into", "the", "standard", "JSON", "format", "which", "is", "consistent", "across", "different", "language", "SDKs", "." ]
train
https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/internal/DiagnosticsReport.java#L103-L130
hawkular/hawkular-agent
hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/JavaAgentEngine.java
JavaAgentEngine.startHawkularAgent
public void startHawkularAgent(Configuration newConfig) { if (newConfig == null) { super.startHawkularAgent(); } else { Configuration oldConfig = getConfigurationManager().getConfiguration(); boolean doNotChangeConfig = (oldConfig != null && oldConfig.getSubsystem().g...
java
public void startHawkularAgent(Configuration newConfig) { if (newConfig == null) { super.startHawkularAgent(); } else { Configuration oldConfig = getConfigurationManager().getConfiguration(); boolean doNotChangeConfig = (oldConfig != null && oldConfig.getSubsystem().g...
[ "public", "void", "startHawkularAgent", "(", "Configuration", "newConfig", ")", "{", "if", "(", "newConfig", "==", "null", ")", "{", "super", ".", "startHawkularAgent", "(", ")", ";", "}", "else", "{", "Configuration", "oldConfig", "=", "getConfigurationManager"...
This method allows you to start the agent using a Java Agent Engine Configuration ({@link Configuration}) rather than a Agent Core Engine configuration ({@link AgentCoreEngineConfiguration}). If the original agent configuration indicated the agent should be immutable, this ignores the given configuration and restarts ...
[ "This", "method", "allows", "you", "to", "start", "the", "agent", "using", "a", "Java", "Agent", "Engine", "Configuration", "(", "{", "@link", "Configuration", "}", ")", "rather", "than", "a", "Agent", "Core", "Engine", "configuration", "(", "{", "@link", ...
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-javaagent/src/main/java/org/hawkular/agent/javaagent/JavaAgentEngine.java#L141-L166
edwardcapriolo/gossip
src/main/java/com/google/code/gossip/manager/GossipManager.java
GossipManager.handleNotification
@Override public void handleNotification(Notification notification, Object handback) { LocalGossipMember deadMember = (LocalGossipMember) notification.getUserData(); GossipService.LOGGER.debug("Dead member detected: " + deadMember); members.put(deadMember, GossipState.DOWN); if (listener != null) { ...
java
@Override public void handleNotification(Notification notification, Object handback) { LocalGossipMember deadMember = (LocalGossipMember) notification.getUserData(); GossipService.LOGGER.debug("Dead member detected: " + deadMember); members.put(deadMember, GossipState.DOWN); if (listener != null) { ...
[ "@", "Override", "public", "void", "handleNotification", "(", "Notification", "notification", ",", "Object", "handback", ")", "{", "LocalGossipMember", "deadMember", "=", "(", "LocalGossipMember", ")", "notification", ".", "getUserData", "(", ")", ";", "GossipServic...
All timers associated with a member will trigger this method when it goes off. The timer will go off if we have not heard from this member in <code> _settings.T_CLEANUP </code> time.
[ "All", "timers", "associated", "with", "a", "member", "will", "trigger", "this", "method", "when", "it", "goes", "off", ".", "The", "timer", "will", "go", "off", "if", "we", "have", "not", "heard", "from", "this", "member", "in", "<code", ">", "_settings...
train
https://github.com/edwardcapriolo/gossip/blob/ac87301458c7ba4eb7d952046894ebf42ffb0518/src/main/java/com/google/code/gossip/manager/GossipManager.java#L102-L110
dmerkushov/os-helper
src/main/java/ru/dmerkushov/oshelper/OSHelper.java
OSHelper.procWaitWithProcessReturn
public static ProcessReturn procWaitWithProcessReturn (Process process) throws OSHelperException { ProcessReturn processReturn = new ProcessReturn (); try { processReturn.exitCode = process.waitFor (); } catch (InterruptedException ex) { throw new OSHelperException ("Received an InterruptedException when wa...
java
public static ProcessReturn procWaitWithProcessReturn (Process process) throws OSHelperException { ProcessReturn processReturn = new ProcessReturn (); try { processReturn.exitCode = process.waitFor (); } catch (InterruptedException ex) { throw new OSHelperException ("Received an InterruptedException when wa...
[ "public", "static", "ProcessReturn", "procWaitWithProcessReturn", "(", "Process", "process", ")", "throws", "OSHelperException", "{", "ProcessReturn", "processReturn", "=", "new", "ProcessReturn", "(", ")", ";", "try", "{", "processReturn", ".", "exitCode", "=", "pr...
/*public static Thread runCommandInThread (final List<String> toRun) throws OSHelperException { Thread commandThread; }
[ "/", "*", "public", "static", "Thread", "runCommandInThread", "(", "final", "List<String", ">", "toRun", ")", "throws", "OSHelperException", "{", "Thread", "commandThread", ";" ]
train
https://github.com/dmerkushov/os-helper/blob/a7c2b72d289d9bc23ae106d1c5e11769cf3463d6/src/main/java/ru/dmerkushov/oshelper/OSHelper.java#L77-L92
elki-project/elki
elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java
DBIDUtil.randomSample
public static DBIDs randomSample(DBIDs ids, double rate, RandomFactory random) { return randomSample(ids, rate, random.getSingleThreadedRandom()); }
java
public static DBIDs randomSample(DBIDs ids, double rate, RandomFactory random) { return randomSample(ids, rate, random.getSingleThreadedRandom()); }
[ "public", "static", "DBIDs", "randomSample", "(", "DBIDs", "ids", ",", "double", "rate", ",", "RandomFactory", "random", ")", "{", "return", "randomSample", "(", "ids", ",", "rate", ",", "random", ".", "getSingleThreadedRandom", "(", ")", ")", ";", "}" ]
Produce a random sample of the given DBIDs. @param ids Original ids, no duplicates allowed @param rate Sampling rate @param random Random generator @return Sample
[ "Produce", "a", "random", "sample", "of", "the", "given", "DBIDs", "." ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/DBIDUtil.java#L684-L686
phax/ph-pdf-layout
src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java
PDPageContentStreamExt.setFont
public void setFont (final PDFont font, final float fontSize) throws IOException { if (fontStack.isEmpty ()) fontStack.add (font); else fontStack.set (fontStack.size () - 1, font); PDDocumentHelper.handleFontSubset (m_aDoc, font); writeOperand (resources.add (font)); writeOperand (fo...
java
public void setFont (final PDFont font, final float fontSize) throws IOException { if (fontStack.isEmpty ()) fontStack.add (font); else fontStack.set (fontStack.size () - 1, font); PDDocumentHelper.handleFontSubset (m_aDoc, font); writeOperand (resources.add (font)); writeOperand (fo...
[ "public", "void", "setFont", "(", "final", "PDFont", "font", ",", "final", "float", "fontSize", ")", "throws", "IOException", "{", "if", "(", "fontStack", ".", "isEmpty", "(", ")", ")", "fontStack", ".", "add", "(", "font", ")", ";", "else", "fontStack",...
Set the font and font size to draw text with. @param font The font to use. @param fontSize The font size to draw the text. @throws IOException If there is an error writing the font information.
[ "Set", "the", "font", "and", "font", "size", "to", "draw", "text", "with", "." ]
train
https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L332-L344
kiswanij/jk-util
src/main/java/com/jk/util/JKHttpUtil.java
JKHttpUtil.getValueFromUrl
public static String getValueFromUrl(String url, String preText, int length) { String urlContents = getUrlContents(url); int indexOf = urlContents.indexOf(preText); if (indexOf != -1) { indexOf += preText.length(); String substring = urlContents.substring(indexOf, indexOf + length); return substring; }...
java
public static String getValueFromUrl(String url, String preText, int length) { String urlContents = getUrlContents(url); int indexOf = urlContents.indexOf(preText); if (indexOf != -1) { indexOf += preText.length(); String substring = urlContents.substring(indexOf, indexOf + length); return substring; }...
[ "public", "static", "String", "getValueFromUrl", "(", "String", "url", ",", "String", "preText", ",", "int", "length", ")", "{", "String", "urlContents", "=", "getUrlContents", "(", "url", ")", ";", "int", "indexOf", "=", "urlContents", ".", "indexOf", "(", ...
Gets the value from url based on pre-text value from the response. @param url the url @param preText the pre text @param length the length @return the value from url
[ "Gets", "the", "value", "from", "url", "based", "on", "pre", "-", "text", "value", "from", "the", "response", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKHttpUtil.java#L184-L193
KayLerch/alexa-skills-kit-tellask-java
src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java
AlexaSpeechletFactory.createSpeechletFromRequest
public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException { final ObjectMapper mapper = new ObjectMapper(); final JsonNode parser = mapper.readTree(serializedSpe...
java
public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException { final ObjectMapper mapper = new ObjectMapper(); final JsonNode parser = mapper.readTree(serializedSpe...
[ "public", "static", "<", "T", "extends", "AlexaSpeechlet", ">", "T", "createSpeechletFromRequest", "(", "final", "byte", "[", "]", "serializedSpeechletRequest", ",", "final", "Class", "<", "T", ">", "speechletClass", ",", "final", "UtteranceReader", "utteranceReader...
Creates an AlexaSpeechlet from bytes of a speechlet request. It will extract the locale from the request and uses it for creating a new instance of AlexaSpeechlet @param serializedSpeechletRequest bytes of a speechlet request @param speechletClass the class of your AlexaSpeechlet to instantiate @param utteranceReader t...
[ "Creates", "an", "AlexaSpeechlet", "from", "bytes", "of", "a", "speechlet", "request", ".", "It", "will", "extract", "the", "locale", "from", "the", "request", "and", "uses", "it", "for", "creating", "a", "new", "instance", "of", "AlexaSpeechlet" ]
train
https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java#L37-L54
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java
ObjFileImporter.addVertex
private void addVertex(String data) { String coords[] = data.split("\\s+"); float x = 0; float y = 0; float z = 0; if (coords.length != 3) { MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine); } else { x = Float.parseFl...
java
private void addVertex(String data) { String coords[] = data.split("\\s+"); float x = 0; float y = 0; float z = 0; if (coords.length != 3) { MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine); } else { x = Float.parseFl...
[ "private", "void", "addVertex", "(", "String", "data", ")", "{", "String", "coords", "[", "]", "=", "data", ".", "split", "(", "\"\\\\s+\"", ")", ";", "float", "x", "=", "0", ";", "float", "y", "=", "0", ";", "float", "z", "=", "0", ";", "if", ...
Creates a new {@link Vertex} from data and adds it to {@link #vertexes}. @param data the data
[ "Creates", "a", "new", "{", "@link", "Vertex", "}", "from", "data", "and", "adds", "it", "to", "{", "@link", "#vertexes", "}", "." ]
train
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/model/loader/ObjFileImporter.java#L206-L224
itfsw/QueryBuilder
src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java
Assert.notEmpty
public static void notEmpty(Map<?, ?> map, String message) { if (CollectionUtils.isEmpty(map)) { throw new IllegalArgumentException(message); } }
java
public static void notEmpty(Map<?, ?> map, String message) { if (CollectionUtils.isEmpty(map)) { throw new IllegalArgumentException(message); } }
[ "public", "static", "void", "notEmpty", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "String", "message", ")", "{", "if", "(", "CollectionUtils", ".", "isEmpty", "(", "map", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "message", ...
Assert that a Map contains entries; that is, it must not be {@code null} and must contain at least one entry. <pre class="code">Assert.notEmpty(map, "Map must contain entries");</pre> @param map the map to check @param message the exception message to use if the assertion fails @throws IllegalArgumentException if the m...
[ "Assert", "that", "a", "Map", "contains", "entries", ";", "that", "is", "it", "must", "not", "be", "{" ]
train
https://github.com/itfsw/QueryBuilder/blob/231dc9a334d54cf98755cfcb236202201ddee162/src/main/java/com/itfsw/query/builder/support/utils/spring/Assert.java#L298-L302
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
StreamTask.handleAsyncException
@Override public void handleAsyncException(String message, Throwable exception) { if (isRunning) { // only fail if the task is still running getEnvironment().failExternally(exception); } }
java
@Override public void handleAsyncException(String message, Throwable exception) { if (isRunning) { // only fail if the task is still running getEnvironment().failExternally(exception); } }
[ "@", "Override", "public", "void", "handleAsyncException", "(", "String", "message", ",", "Throwable", "exception", ")", "{", "if", "(", "isRunning", ")", "{", "// only fail if the task is still running", "getEnvironment", "(", ")", ".", "failExternally", "(", "exce...
Handles an exception thrown by another thread (e.g. a TriggerTask), other than the one executing the main task by failing the task entirely. <p>In more detail, it marks task execution failed for an external reason (a reason other than the task code itself throwing an exception). If the task is already in a terminal st...
[ "Handles", "an", "exception", "thrown", "by", "another", "thread", "(", "e", ".", "g", ".", "a", "TriggerTask", ")", "other", "than", "the", "one", "executing", "the", "main", "task", "by", "failing", "the", "task", "entirely", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java#L851-L857
zaproxy/zaproxy
src/org/parosproxy/paros/core/scanner/VariantCustom.java
VariantCustom.addParamQuery
public void addParamQuery(String name, String value) { addParam(name, value, NameValuePair.TYPE_QUERY_STRING); }
java
public void addParamQuery(String name, String value) { addParam(name, value, NameValuePair.TYPE_QUERY_STRING); }
[ "public", "void", "addParamQuery", "(", "String", "name", ",", "String", "value", ")", "{", "addParam", "(", "name", ",", "value", ",", "NameValuePair", ".", "TYPE_QUERY_STRING", ")", ";", "}" ]
Support method to add a new QueryString param to this custom variant @param name the param name @param value the value of this parameter
[ "Support", "method", "to", "add", "a", "new", "QueryString", "param", "to", "this", "custom", "variant" ]
train
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/VariantCustom.java#L152-L154
google/error-prone
core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects/CreatesDuplicateCallHeuristic.java
CreatesDuplicateCallHeuristic.isAcceptableChange
@Override public boolean isAcceptableChange( Changes changes, Tree node, MethodSymbol symbol, VisitorState state) { return findArgumentsForOtherInstances(symbol, node, state).stream() .allMatch(arguments -> !anyArgumentsMatch(changes.changedPairs(), arguments)); }
java
@Override public boolean isAcceptableChange( Changes changes, Tree node, MethodSymbol symbol, VisitorState state) { return findArgumentsForOtherInstances(symbol, node, state).stream() .allMatch(arguments -> !anyArgumentsMatch(changes.changedPairs(), arguments)); }
[ "@", "Override", "public", "boolean", "isAcceptableChange", "(", "Changes", "changes", ",", "Tree", "node", ",", "MethodSymbol", "symbol", ",", "VisitorState", "state", ")", "{", "return", "findArgumentsForOtherInstances", "(", "symbol", ",", "node", ",", "state",...
Returns true if there are no other calls to this method which already have an actual parameter in the position we are moving this one too.
[ "Returns", "true", "if", "there", "are", "no", "other", "calls", "to", "this", "method", "which", "already", "have", "an", "actual", "parameter", "in", "the", "position", "we", "are", "moving", "this", "one", "too", "." ]
train
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/argumentselectiondefects/CreatesDuplicateCallHeuristic.java#L44-L49
kiswanij/jk-util
src/main/java/com/jk/util/JKConversionUtil.java
JKConversionUtil.toInteger
public static int toInteger(Object value, int defaultValue) { if (value == null || value.toString().trim().equals("")) { return defaultValue; } if (value instanceof Integer) { return (Integer) value; } return (int) JKConversionUtil.toDouble(value); }
java
public static int toInteger(Object value, int defaultValue) { if (value == null || value.toString().trim().equals("")) { return defaultValue; } if (value instanceof Integer) { return (Integer) value; } return (int) JKConversionUtil.toDouble(value); }
[ "public", "static", "int", "toInteger", "(", "Object", "value", ",", "int", "defaultValue", ")", "{", "if", "(", "value", "==", "null", "||", "value", ".", "toString", "(", ")", ".", "trim", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "ret...
To integer. @param value the value @param defaultValue the default value @return the int
[ "To", "integer", "." ]
train
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKConversionUtil.java#L179-L187
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java
HttpChannelConfig.parseLimitMessageSize
private void parseLimitMessageSize(Map<Object, Object> props) { Object value = props.get(HttpConfigConstants.PROPNAME_MSG_SIZE_LIMIT); if (null != value) { try { this.limitMessageSize = convertLong(value); if (TraceComponent.isAnyTracingEnabled() && tc.isEvent...
java
private void parseLimitMessageSize(Map<Object, Object> props) { Object value = props.get(HttpConfigConstants.PROPNAME_MSG_SIZE_LIMIT); if (null != value) { try { this.limitMessageSize = convertLong(value); if (TraceComponent.isAnyTracingEnabled() && tc.isEvent...
[ "private", "void", "parseLimitMessageSize", "(", "Map", "<", "Object", ",", "Object", ">", "props", ")", "{", "Object", "value", "=", "props", ".", "get", "(", "HttpConfigConstants", ".", "PROPNAME_MSG_SIZE_LIMIT", ")", ";", "if", "(", "null", "!=", "value",...
Parse the possible configuration limit on the incoming message body. size. @param props
[ "Parse", "the", "possible", "configuration", "limit", "on", "the", "incoming", "message", "body", ".", "size", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L886-L901
lessthanoptimal/BoofCV
main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeAlignmentPatternLocator.java
QrCodeAlignmentPatternLocator.process
public boolean process(T image , QrCode qr ) { this.qr = qr; // this must be cleared before calling setMarker or else the distortion will be messed up qr.alignment.reset(); reader.setImage(image); reader.setMarker(qr); threshold = (float)qr.threshCorner; initializePatterns(qr); // version 1 has no a...
java
public boolean process(T image , QrCode qr ) { this.qr = qr; // this must be cleared before calling setMarker or else the distortion will be messed up qr.alignment.reset(); reader.setImage(image); reader.setMarker(qr); threshold = (float)qr.threshCorner; initializePatterns(qr); // version 1 has no a...
[ "public", "boolean", "process", "(", "T", "image", ",", "QrCode", "qr", ")", "{", "this", ".", "qr", "=", "qr", ";", "// this must be cleared before calling setMarker or else the distortion will be messed up", "qr", ".", "alignment", ".", "reset", "(", ")", ";", "...
Uses the previously detected position patterns to seed the search for the alignment patterns
[ "Uses", "the", "previously", "detected", "position", "patterns", "to", "seed", "the", "search", "for", "the", "alignment", "patterns" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeAlignmentPatternLocator.java#L56-L72
OpenLiberty/open-liberty
dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterTokenServices.java
TwitterTokenServices.isMissingParameter
protected boolean isMissingParameter(Map<String, String[]> requestParams, String endpoint) { if (TwitterConstants.TWITTER_ENDPOINT_ACCESS_TOKEN.equals(endpoint)) { // Must have oauth_token and oauth_verifier parameters in order to send request to oauth/access_token endpoint if (!requestP...
java
protected boolean isMissingParameter(Map<String, String[]> requestParams, String endpoint) { if (TwitterConstants.TWITTER_ENDPOINT_ACCESS_TOKEN.equals(endpoint)) { // Must have oauth_token and oauth_verifier parameters in order to send request to oauth/access_token endpoint if (!requestP...
[ "protected", "boolean", "isMissingParameter", "(", "Map", "<", "String", ",", "String", "[", "]", ">", "requestParams", ",", "String", "endpoint", ")", "{", "if", "(", "TwitterConstants", ".", "TWITTER_ENDPOINT_ACCESS_TOKEN", ".", "equals", "(", "endpoint", ")",...
Checks for required parameters depending on the endpoint type. - oauth/access_token: Must have oauth_token and oauth_verifier parameters in order to continue @param requestParams @param endpoint @return
[ "Checks", "for", "required", "parameters", "depending", "on", "the", "endpoint", "type", ".", "-", "oauth", "/", "access_token", ":", "Must", "have", "oauth_token", "and", "oauth_verifier", "parameters", "in", "order", "to", "continue" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/twitter/TwitterTokenServices.java#L210-L223
google/closure-compiler
src/com/google/javascript/jscomp/JSModuleGraph.java
JSModuleGraph.getSmallestCoveringSubtree
public JSModule getSmallestCoveringSubtree(JSModule parentTree, BitSet dependentModules) { checkState(!dependentModules.isEmpty()); // Candidate modules are those that all of the given dependent modules depend on, including // themselves. The dependent module with the smallest index might be our answer, if...
java
public JSModule getSmallestCoveringSubtree(JSModule parentTree, BitSet dependentModules) { checkState(!dependentModules.isEmpty()); // Candidate modules are those that all of the given dependent modules depend on, including // themselves. The dependent module with the smallest index might be our answer, if...
[ "public", "JSModule", "getSmallestCoveringSubtree", "(", "JSModule", "parentTree", ",", "BitSet", "dependentModules", ")", "{", "checkState", "(", "!", "dependentModules", ".", "isEmpty", "(", ")", ")", ";", "// Candidate modules are those that all of the given dependent mo...
Finds the module with the fewest transitive dependents on which all of the given modules depend and that is a subtree of the given parent module tree. <p>If no such subtree can be found, the parent module is returned. <p>If multiple candidates have the same number of dependents, the module farthest down in the total ...
[ "Finds", "the", "module", "with", "the", "fewest", "transitive", "dependents", "on", "which", "all", "of", "the", "given", "modules", "depend", "and", "that", "is", "a", "subtree", "of", "the", "given", "parent", "module", "tree", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L356-L395
Impetus/Kundera
src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESQuery.java
ESQuery.processGroupByClause
private TermsBuilder processGroupByClause(Expression expression, EntityMetadata entityMetadata, KunderaQuery query) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( entityMetadata.getPersistenceUnit()); Expression groupByClause = ((Gr...
java
private TermsBuilder processGroupByClause(Expression expression, EntityMetadata entityMetadata, KunderaQuery query) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( entityMetadata.getPersistenceUnit()); Expression groupByClause = ((Gr...
[ "private", "TermsBuilder", "processGroupByClause", "(", "Expression", "expression", ",", "EntityMetadata", "entityMetadata", ",", "KunderaQuery", "query", ")", "{", "MetamodelImpl", "metaModel", "=", "(", "MetamodelImpl", ")", "kunderaMetadata", ".", "getApplicationMetada...
Process group by clause. @param expression the expression @param entityMetadata the entity metadata @param query the query @return the terms builder
[ "Process", "group", "by", "clause", "." ]
train
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESQuery.java#L308-L346
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.addMovingEndpoint
public void addMovingEndpoint(Token token, InetAddress endpoint) { assert endpoint != null; lock.writeLock().lock(); try { movingEndpoints.add(Pair.create(token, endpoint)); } finally { lock.writeLock().unlock(); } }
java
public void addMovingEndpoint(Token token, InetAddress endpoint) { assert endpoint != null; lock.writeLock().lock(); try { movingEndpoints.add(Pair.create(token, endpoint)); } finally { lock.writeLock().unlock(); } }
[ "public", "void", "addMovingEndpoint", "(", "Token", "token", ",", "InetAddress", "endpoint", ")", "{", "assert", "endpoint", "!=", "null", ";", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "movingEndpoints", ".", "add", "(...
Add a new moving endpoint @param token token which is node moving to @param endpoint address of the moving node
[ "Add", "a", "new", "moving", "endpoint" ]
train
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L372-L386
Netflix/conductor
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java
WorkflowExecutor.rollbackTasks
@VisibleForTesting void rollbackTasks(String workflowId, List<Task> createdTasks) { String description = "rolling back task from DAO for " + workflowId; String operation = "rollbackTasks"; try { // rollback all newly created tasks in the workflow createdTasks.forEach...
java
@VisibleForTesting void rollbackTasks(String workflowId, List<Task> createdTasks) { String description = "rolling back task from DAO for " + workflowId; String operation = "rollbackTasks"; try { // rollback all newly created tasks in the workflow createdTasks.forEach...
[ "@", "VisibleForTesting", "void", "rollbackTasks", "(", "String", "workflowId", ",", "List", "<", "Task", ">", "createdTasks", ")", "{", "String", "description", "=", "\"rolling back task from DAO for \"", "+", "workflowId", ";", "String", "operation", "=", "\"rollb...
Rolls back all newly created tasks in a workflow, essentially resetting the workflow state, in case of an exception during task creation or task enqueuing. @param createdTasks a {@link List} of newly created tasks in the workflow which are to be rolled back
[ "Rolls", "back", "all", "newly", "created", "tasks", "in", "a", "workflow", "essentially", "resetting", "the", "workflow", "state", "in", "case", "of", "an", "exception", "during", "task", "creation", "or", "task", "enqueuing", "." ]
train
https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java#L1194-L1214
telly/groundy
library/src/main/java/com/telly/groundy/TaskResult.java
TaskResult.add
public TaskResult add(String key, String value) { mBundle.putString(key, value); return this; }
java
public TaskResult add(String key, String value) { mBundle.putString(key, value); return this; }
[ "public", "TaskResult", "add", "(", "String", "key", ",", "String", "value", ")", "{", "mBundle", ".", "putString", "(", "key", ",", "value", ")", ";", "return", "this", ";", "}" ]
Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null. @param key a String, or null @param value a String, or null
[ "Inserts", "a", "String", "value", "into", "the", "mapping", "of", "this", "Bundle", "replacing", "any", "existing", "value", "for", "the", "given", "key", ".", "Either", "key", "or", "value", "may", "be", "null", "." ]
train
https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L155-L158